diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java index 20906c30..539d0b03 100644 --- a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java +++ b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java @@ -38,15 +38,19 @@ public class ApiXgfUserController extends BaseController { @RequestMapping(value = "/approvalApplication") @ResponseBody public Object approvalApplication() throws Exception { + Map response = new HashMap(); try { PageData request = this.getPageData(); xgfUserService.approvalApplication(request); - Map response = new HashMap(); - response.put("result", "response"); + response.put("result", "success"); + response.put("code","0"); return response; } catch (Exception e) { e.printStackTrace(); - throw new RuntimeException("系统异常"); + response.put("result", "error"); + response.put("code","9999"); + response.put("msg", e.getMessage()); + return response; } } } diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index 35c67c83..980c1801 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -120,11 +120,19 @@ public class XgfUserServiceImpl implements XgfUserService { @Override public void approvalApplication(PageData request) throws Exception { + + List list = Arrays.asList(request.getString("xgf_user_ids").split(",")); PageData condition = new PageData(); condition.put("XGF_USER_IDS", list); List entities = xgfUserMapper.listByIds(condition); + /* 校验所有数据是否都是正常状态 */ + if (entities.stream().anyMatch(n -> !"2".equals(n.getString("STATUS")))) { + String name = entities.stream().filter(n -> !"2".equals(n.getString("STATUS"))).map( n -> n.getString("NAME")).collect(Collectors.joining(",")); + throw new RuntimeException("用户[" + name + "]在系统流程中无法被打回"); + } + for (PageData x : entities) { x.put("VALID_FLAG", "0"); x.put("STATUS", "1");