Commit ced7d9b2 authored by 季圣华's avatar 季圣华
Browse files

修复新增单据失败的bug

parent e01c52a7
...@@ -436,14 +436,18 @@ public class DepotHeadController { ...@@ -436,14 +436,18 @@ public class DepotHeadController {
@RequestParam("deleted") String deleted, @RequestParam("deleted") String deleted,
@RequestParam("updated") String updated, HttpServletRequest request) throws Exception{ @RequestParam("updated") String updated, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
if(("open").equals(mybatisPlusStatus)) {
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString()); Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null); Long count = depotHeadService.countDepotHead(null,null,null,null,null,null);
if(("open").equals(mybatisPlusStatus) && count>= billsNumLimit) { if(count>= billsNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE, throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG); ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
} else { } else {
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated); depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
} }
} else {
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
}
return result; return result;
} }
/** /**
......
...@@ -323,15 +323,20 @@ public class UserController { ...@@ -323,15 +323,20 @@ public class UserController {
@ResponseBody @ResponseBody
public Object addUser(@RequestParam("info") String beanJson, HttpServletRequest request)throws Exception{ public Object addUser(@RequestParam("info") String beanJson, HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
if(("open").equals(mybatisPlusStatus)) {
Long userNumLimit = Long.parseLong(request.getSession().getAttribute("userNumLimit").toString()); Long userNumLimit = Long.parseLong(request.getSession().getAttribute("userNumLimit").toString());
Long count = userService.countUser(null,null); Long count = userService.countUser(null,null);
if(("open").equals(mybatisPlusStatus) && count>= userNumLimit) { if(count>= userNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE, throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG); ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG);
} else { } else {
UserEx ue= JSON.parseObject(beanJson, UserEx.class); UserEx ue= JSON.parseObject(beanJson, UserEx.class);
userService.addUserAndOrgUserRel(ue); userService.addUserAndOrgUserRel(ue);
} }
} else {
UserEx ue= JSON.parseObject(beanJson, UserEx.class);
userService.addUserAndOrgUserRel(ue);
}
return result; return result;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment