1.修改全局异常处理,打印错误代码位置

2.调整注册接口查询验证码报错问题
3.查询医疗器械信息SQL修改,修复关联查询未指定指定字段导致的查询失败问题
master
x_z 3 years ago
parent 8d3c080f34
commit dd68585799

@ -198,7 +198,11 @@ public class RegisterController {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
} }
JSONObject userCode = JSONObject.parseObject(String.valueOf(redisUtil.get(Constant.CAPTCHAS + userRegisterEntity.getMobile()))); String codeStr = String.valueOf(redisUtil.get(Constant.CAPTCHAS + userRegisterEntity.getMobile()));
if (StrUtil.isBlank(codeStr) || "null".equals(codeStr)) {
return ResultVOUtils.error(500, "验证码已过期,请重新获取");
}
JSONObject userCode = JSONObject.parseObject(codeStr);
if (userCode == null) { if (userCode == null) {
return ResultVOUtils.error(500, "验证码已失效,请重新获取"); return ResultVOUtils.error(500, "验证码已失效,请重新获取");
} }

@ -84,7 +84,7 @@ public class ThrProductsAddController {
BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity); BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity);
thrProductsService.insertThrProducts(thrProductsEntity); thrProductsService.insertThrProducts(thrProductsEntity);
} }
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success(ResultEnum.SUCCESS);
} }

@ -19,13 +19,14 @@ public class GlobalExceptionHandler {
@ExceptionHandler(value = JsonException.class) @ExceptionHandler(value = JsonException.class)
public BaseResponse handlerJsonException(JsonException e) { public BaseResponse handlerJsonException(JsonException e) {
// 返回对应的错误信息 // 返回对应的错误信息
log.error(e.getMessage(), e);
return ResultVOUtils.error(e.getCode(), e.getMessage()); return ResultVOUtils.error(e.getCode(), e.getMessage());
} }
// 拦截API异常 // 拦截API异常
@ExceptionHandler(value = RuntimeException.class) @ExceptionHandler(value = RuntimeException.class)
public BaseResponse handlerRuntimeException(RuntimeException e) { public BaseResponse handlerRuntimeException(RuntimeException e) {
log.error(e.getMessage()); log.error(e.getMessage(), e);
// 返回对应的错误信息 // 返回对应的错误信息
return ResultVOUtils.error(ResultEnum.NOT_NETWORK); return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
} }

@ -9,7 +9,7 @@
left join basic_corp on thr_products_add.customerId = basic_corp.erpId left join basic_corp on thr_products_add.customerId = basic_corp.erpId
<where> <where>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%') AND thr_products_add.name LIKE concat('%',#{name},'%')
</if> </if>
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%') AND code LIKE concat('%',#{code},'%')

Loading…
Cancel
Save