赞
踩
1、**问题描述:**下拉框关联数据,选择下拉框数据后,联动输入框中的数据查询不到,在后台接收到的是null
原因分析:
selectJiShiNameBygonghao(jishigonghao) {
this.$http({
url: 'jishi/getJiShiGongName',
method: 'get',
params: jishigonghao
}).then(res => {
console.log("传递的参数")
console.log(jishigonghao)
console.log("查询技师姓名")
console.log(res)
console.log(res.data)
this.ruleForm.jishixingming = res.data
})
实现代码:
selectJiShiNameBygonghao(jishigonghao) {
this.$http({
url: `jishi/getJiShiGongName/${jishigonghao}`,
method: 'get',
}).then(res => {
console.log("传递的参数")
console.log(jishigonghao)
console.log("查询技师姓名")
console.log(res)
console.log(res.data)
this.ruleForm.jishixingming = res.data
})
},
/**
* 后端查询根据技师工号查询技师姓名
*/
@RequestMapping("/getJiShiGongName/{jishigonghao}")
public R getJiShiGongName(@PathVariable("jishigonghao") String jishigonghao) {
System.out.println("技师工号为:" + jishigonghao);
List<String> result = jishiService.getJiShiGongName(jishigonghao);
return R.ok().put("data", result);
}
2、按照上述修改完成以后还是出了问题
原因分析:
后端接收的参数层级不对
console.log(res.data.data)
this.ruleForm.jishixingming = res.data.data
3、问题描述:
2024-04-11 15:49:31.385 WARN 3648 --- [nio-8080-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token
at [Source: (PushbackInputStream); line: 1, column: 287] (through reference chain: com.entity.MeirongxiangmuEntity["jishixingming"])]
原因分析:
实现代码
console.log(res.data.data[0])
this.ruleForm.jishixingming = res.data.data[0]
4、添加了一条重复项目名称的数据后,数据库所有的数据都变成了这条数据
分析原因:
select count(*)
from meirongxiangmu
where xiangmumingcheng= #{xiangmumingcheng}
```rom meirongxiangmu
where xiangmumingcheng= #{xiangmumingcheng}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。