From 8be39e14d3c65c9c28dfebff90535c6d0d7cc057 Mon Sep 17 00:00:00 2001 From: liujun Date: Fri, 22 Dec 2023 17:41:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/controller/api/ApiXgfUserController.java | 10 +++++++--- .../zcloud/service/xgf/impl/XgfUserServiceImpl.java | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) 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");