diff --git a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java index aad1eeb9..e13a816d 100644 --- a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -65,13 +65,14 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/approvePlus") @ResponseBody - public Object approvePlus(@RequestParam(value="chengNuoShu",required=false) MultipartFile[] chengNuoShu) throws Exception { - PageData request = this.getPageData(); - xgfUserService.approvePlus(request,chengNuoShu); + public Object approvePlus(@RequestParam(value = "chengNuoShu", required = false) MultipartFile[] chengNuoShu) throws Exception { PageData response = new PageData(); response.put("result", "success"); + PageData request = this.getPageData(); + xgfUserService.approvePlus(request, chengNuoShu); response.put("data", request); return response; + } /** @@ -79,18 +80,26 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/approveMax") @ResponseBody - public Object approveMax(@RequestParam(value="chengNuoShu",required=false) MultipartFile[] chengNuoShu) throws Exception { + public Object approveMax(@RequestParam(value = "chengNuoShu", required = false) MultipartFile[] chengNuoShu) throws Exception { PageData request = this.getPageData(); - xgfUserService.approveMax(request,chengNuoShu); PageData response = new PageData(); response.put("result", "success"); + response.put("code","0"); response.put("data", request); + try { + xgfUserService.approveMax(request, chengNuoShu); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("errorMessage", e.getMessage()); + return response; + } return response; } @RequestMapping(value = "/regulatoryUserList") @ResponseBody - public Object regulatoryUserList() throws Exception{ + public Object regulatoryUserList() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); @@ -132,7 +141,7 @@ public class XgfUserController extends BaseController { @RequestMapping(value = "/getAppointApproveList") @ResponseBody - public Object getAppointApproveList(Page page) throws Exception{ + public Object getAppointApproveList(Page page) throws Exception { PageData request = this.getPageData(); request.put("USER_ID", Jurisdiction.getUSER_ID()); page.setPd(request); @@ -145,11 +154,11 @@ public class XgfUserController extends BaseController { @RequestMapping(value = "/getWorkTask") @ResponseBody - public Object getWorkTask() throws Exception{ + public Object getWorkTask() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); - response.put("list",xgfUserService.getWorkTask(request)); + response.put("list", xgfUserService.getWorkTask(request)); return response; } @@ -159,7 +168,7 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/appointApprove") @ResponseBody - public Object appointApprove() throws Exception{ + public Object appointApprove() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("result", "success"); @@ -172,7 +181,7 @@ public class XgfUserController extends BaseController { */ @RequestMapping(value = "/getApproveInfo") @ResponseBody - public Object getApproveInfo() throws Exception{ + public Object getApproveInfo() throws Exception { PageData request = this.getPageData(); PageData response = new PageData(); response.put("list", xgfUserService.getApproveInfo(request)); diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java index 8c529cba..7b0f3ae3 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java @@ -54,70 +54,79 @@ public class GuFenCharge extends NodeSwitchComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); - // 如果不是当前流程,进入下一流程判断 - if (!"0".equals(info.getIterator())) { - // 根据是否有委托书判断是否走委托流程 - if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + // 如果不是当前流程,进入下一流程判断 + if (!"0".equals(info.getIterator())) { + // 根据是否有委托书判断是否走委托流程 + if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + return "GuFenWeiTuo"; + } + return "GuFenSupervise"; + } + + flows.put("APPOINT_ZERO_CORP_ID", "1"); + flows.put("APPOINT_ZERO_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); + flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); + flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + return ""; + } else { + xgfFlowsMapper.edit(flows); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 + if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + } + // created by liu jun 2024-02-04 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + userInfo.put("ATTORNEY", info.getAPPOINT_ANNEX()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(entity); + // 将指针清空 + info.setIterator(""); + } + + if (StringUtils.isNotBlank(info.getATTORNEY())) { + xgfUserService.saveLog(info, "1", "0"); return "GuFenWeiTuo"; + } else { + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); } return "GuFenSupervise"; - } - - flows.put("APPOINT_ZERO_CORP_ID", "1"); - flows.put("APPOINT_ZERO_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); - flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); - flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows, info); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); return ""; - } else { - xgfFlowsMapper.edit(flows); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 - if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - } - // created by liu jun 2024-02-04 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getATTORNEY())) { - userInfo.put("ATTORNEY", info.getAPPOINT_ANNEX()); - xgfUserDetailsMapper.edit(userInfo); - } - xgfUserMapper.edit(entity); - // 将指针清空 - info.setIterator(""); } - - if (StringUtils.isNotBlank(info.getATTORNEY())) { - xgfUserService.saveLog(info, "1", "0"); - return "GuFenWeiTuo"; - }else { - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } - return "GuFenSupervise"; } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "0".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java index 43ed5672..0b5f20f8 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java @@ -50,49 +50,55 @@ public class GuFenSupervise extends NodeComponent { @Override public void process() throws Exception { System.out.println(getName() + "节点"); - - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); + } - flows.put("APPOINT_ONE_CORP_ID", "1"); - flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + flows.put("APPOINT_ONE_CORP_ID", "1"); + flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("STATUS", "2"); - xgfUserMapper.edit(entity); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("STATUS", "2"); + xgfUserMapper.edit(entity); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + info.setErrorMsg(e.getMessage()); + e.printStackTrace(); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java index 28a0fd93..2633f7d2 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java @@ -53,69 +53,72 @@ public class GuFenWeiTuoCharge extends NodeComponent { @Override public void process() throws Exception { - System.out.println(getName() + "节点"); - - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - return; - } + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + return; + } - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - xgfUserMapper.edit(entity); - // 清空指针 - info.setIterator(""); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); + + flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + xgfUserMapper.edit(entity); + // 清空指针 + info.setIterator(""); + } + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "1".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java index 4c399549..23bbaef2 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java @@ -56,46 +56,54 @@ public class GuFenWeiTuoSupervise extends NodeComponent { public void process() throws Exception { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); - info.setIterator(""); + flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + info.setIterator(""); + } + } catch (Exception e) { + info.setErrorMsg(e.getMessage()); + e.printStackTrace(); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "2".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java index 70c82eb1..1b88bcae 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java @@ -52,72 +52,81 @@ public class JiTuanCharge extends NodeSwitchComponent { @Override @SuppressWarnings("all") public String processSwitch() throws Exception { - System.out.println(getName()+ "节点"); + System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); - condition.clear(); - condition.put("XGF_USER_DETAILS_ID",flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))){ + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + if (userInfo.get("ATTORNEY") != null && StringUtils.isNotBlank(userInfo.getString("ATTORNEY"))) { + return "WeiTuo"; + } + return "JiTuanSupervise"; + } + + flows.put("APPOINT_ONE_CORP_ID", "1"); + flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + return ""; + } else { + xgfFlowsMapper.edit(flows); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 + if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + } + // created by liu jun 2024-02-04 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + userInfo.put("ATTORNEY", info.getATTORNEY()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(entity); + // 将指针清空 + info.setIterator(""); + } + + // 保存操作记录 + if (StringUtils.isNotBlank(info.getATTORNEY())) { + xgfUserService.saveLog(info, "1", "0"); return "WeiTuo"; + } else { + xgfUserService.saveLog(info, info.getSTATUS(), "0"); } return "JiTuanSupervise"; - } - - flows.put("APPOINT_ONE_CORP_ID", "1"); - flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); return ""; - } else { - xgfFlowsMapper.edit(flows); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - // created by liu jun 2024-03-01 港务局开会后,将入场告知培训的有效期设置权限给发包单位 - if (StringUtils.isNotBlank(info.getLIMIT_END_TIME())) { - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - } - // created by liu jun 2024-02-04 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getATTORNEY())) { - userInfo.put("ATTORNEY", info.getATTORNEY()); - xgfUserDetailsMapper.edit(userInfo); - } - xgfUserMapper.edit(entity); - // 将指针清空 - info.setIterator(""); } - - // 保存操作记录 - if (StringUtils.isNotBlank(info.getATTORNEY())){ - xgfUserService.saveLog(info, "1", "0"); - return "WeiTuo"; - }else { - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } - return "JiTuanSupervise"; } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "1".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java index 03d76e6d..334b5550 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java @@ -54,45 +54,53 @@ public class JiTuanSupervise extends NodeComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } - flows.put("APPOINT_TWO_CORP_ID", "1"); - flows.put("APPOINT_TWO_CORP_NAME", "秦港股份有限公司"); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); + } + flows.put("APPOINT_TWO_CORP_ID", "1"); + flows.put("APPOINT_TWO_CORP_NAME", "秦港股份有限公司"); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("STATUS", "2"); - xgfUserMapper.edit(entity); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("STATUS", "2"); + xgfUserMapper.edit(entity); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java index 7adb8cc1..1c716945 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java @@ -55,49 +55,55 @@ public class JiTuanWeiTuoCharge extends NodeComponent { @Override public void process() throws Exception { System.out.println(getName() + "节点"); - XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); - flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); - flows.put("APPOINT_TWO_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 1); - entity.put("VALID_FLAG", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - xgfUserMapper.edit(entity); - // 清空指针 - info.setIterator(""); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); + + flows.put("APPOINT_TWO_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_TWO_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getSTATUS()); + flows.put("APPOINT_TWO_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 1); + entity.put("VALID_FLAG", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + xgfUserMapper.edit(entity); + // 清空指针 + info.setIterator(""); + } + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "2".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java index 783cf372..a91befe9 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java @@ -55,39 +55,44 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); + try { + PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - flows.put("APPOINT_THREE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_THREE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_THREE_TIME", DateUtil.getTime()); - flows.put("APPOINT_THREE_STATUS", info.getSTATUS()); - flows.put("APPOINT_THREE_OPINION", info.getOPINION()); - flows.put("OPINION", info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + flows.put("APPOINT_THREE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_THREE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_THREE_TIME", DateUtil.getTime()); + flows.put("APPOINT_THREE_STATUS", info.getSTATUS()); + flows.put("APPOINT_THREE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @@ -95,6 +100,9 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())) { + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "3".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java index 2d9bfabb..4617bbd3 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java @@ -57,47 +57,55 @@ public class YiBanCharge extends NodeComponent { public void process() throws Exception { System.out.println("YiBanCharge节点"); XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + try { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - if (flows == null || flows.size() == 0) { - throw new RuntimeException("系统异常"); - } - - flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); - flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); - flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - } else { - xgfFlowsMapper.edit(flows); - condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData user = xgfUserMapper.findById(condition); - user.put("CHECK_STEP", 1); - user.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); - // created by liu jun 2024-02-26 如果有委托书则保存委托书 - if (StringUtils.isNotBlank(info.getAPPOINT_ANNEX())) { - condition.clear(); - condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); - PageData userInfo = xgfUserDetailsMapper.findById(condition); - userInfo.put("COMMITMENT_LETTER", info.getAPPOINT_ANNEX()); - xgfUserDetailsMapper.edit(userInfo); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("系统异常"); } - xgfUserMapper.edit(user); - // 将指针清空 - info.setIterator(""); + + flows.put("APPOINT_ZERO_TIME", DateUtil.getTime()); + flows.put("APPOINT_ZERO_STATUS", info.getSTATUS()); + flows.put("APPOINT_ZERO_OPINION", info.getOPINION()); + flows.put("OPINION",info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows,info); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData user = xgfUserMapper.findById(condition); + user.put("CHECK_STEP", 1); + user.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); + // created by liu jun 2024-02-26 如果有委托书则保存委托书 + if (StringUtils.isNotBlank(info.getAPPOINT_ANNEX())) { + condition.clear(); + condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID")); + PageData userInfo = xgfUserDetailsMapper.findById(condition); + userInfo.put("COMMITMENT_LETTER", info.getAPPOINT_ANNEX()); + xgfUserDetailsMapper.edit(userInfo); + } + xgfUserMapper.edit(user); + // 将指针清空 + info.setIterator(""); + } + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + }catch (Exception e){ + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())){ + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS()) && "0".equals(info.getIterator())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java index 3f02448a..f5d2f5eb 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java @@ -57,76 +57,83 @@ public class YiBanSupervise extends NodeComponent { public void process() throws Exception { System.out.println(getName()); XgfFlowDto info = this.getRequestData(); + try { + PageData condition = new PageData(); - PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + // 如果不是当前流程,进入下一流程判断 + if (!"1".equals(info.getIterator())) { + return; + } - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"1".equals(info.getIterator())) { - return; - } - - condition.clear(); - condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - PageData corpEntity = corpInfoMapper.findById(condition); - - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("1"); - flows.put("APPOINT_ONE_CORP_TYPE", "0"); - flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 1); - xgfFlowsMapper.edit(flows); - return; - } - - flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); - flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); - flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); - flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); - flows.put("APPOINT_ONE_OPINION", info.getOPINION()); - flows.put("OPINION",info.getOPINION()); - if ("0".equals(info.getSTATUS())) { - // 打回至相关方端 - xgfUserService.repulse(flows,info); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "0"); - } else { - xgfFlowsMapper.edit(flows); condition.clear(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("CHECK_STATUS", 2); - entity.put("VALID_FLAG", "1"); - entity.put("STATUS", "2"); - entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); - xgfUserMapper.edit(entity); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpEntity = corpInfoMapper.findById(condition); - // 保存操作记录 - xgfUserService.saveLog(info, info.getSTATUS(), "1"); + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("1"); + flows.put("APPOINT_ONE_CORP_TYPE", "0"); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ONE_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 1); + xgfFlowsMapper.edit(flows); + return; + } + + flows.put("APPOINT_ONE_CORP_ID", Jurisdiction.getCORPINFO_ID()); + flows.put("APPOINT_ONE_CORP_NAME", corpEntity.getString("CORP_NAME")); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getSTATUS()); + flows.put("APPOINT_ONE_OPINION", info.getOPINION()); + flows.put("OPINION", info.getOPINION()); + if ("0".equals(info.getSTATUS())) { + // 打回至相关方端 + xgfUserService.repulse(flows, info); + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "0"); + } else { + xgfFlowsMapper.edit(flows); + condition.clear(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("CHECK_STATUS", 2); + entity.put("VALID_FLAG", "1"); + entity.put("STATUS", "2"); + entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); + xgfUserMapper.edit(entity); + + // 保存操作记录 + xgfUserService.saveLog(info, info.getSTATUS(), "1"); + } + } catch (Exception e) { + e.printStackTrace(); + info.setErrorMsg(e.getMessage()); } } @Override public boolean isEnd() { XgfFlowDto info = this.getRequestData(); + if (StringUtils.isNotBlank(info.getErrorMsg())){ + throw new RuntimeException(info.getErrorMsg()); + } if ("0".equals(info.getSTATUS())) { return true; } diff --git a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java index f27de069..f72c6637 100644 --- a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java +++ b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java @@ -49,4 +49,6 @@ public class XgfFlowDto { // 打回节点游标 private String BACK_STEP; + private String errorMsg; + private String code; } 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 4fd0fa17..d3428b1c 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -1007,7 +1007,7 @@ public class XgfUserServiceImpl implements XgfUserService { key.put("OPINION", flows.get("OPINION")); Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", key); if (result == null || !"succeed".equals(result.get("result"))) { - throw new RuntimeException("请求失败"); + info.setErrorMsg("请求失败"); } xgfUserMapper.edit(entity); this.clearInfo(flows); @@ -1017,15 +1017,19 @@ public class XgfUserServiceImpl implements XgfUserService { PageData condition = new PageData(); condition.put("FLOWS_ID",flows.getString("FLOWS_ID")); PageData flowEntity = xgfFlowsMapper.findById(condition); - if (flowEntity != null && flowEntity.size() > 0 && flowEntity.getString("FLOWS_STEP").equals(info.getBACK_STEP())){ - throw new RuntimeException("不能自己打回到自己"); + if (flowEntity != null && flowEntity.size() > 0 && (flowEntity.get("FLOWS_STEP").toString()).equals(info.getBACK_STEP())){ + info.setErrorMsg("不能自己打回到自己"); } flowEntity.put("FLOWS_STEP", info.getBACK_STEP()); xgfFlowsMapper.edit(flowEntity); + // 2、保存审批记录 + this.saveLog(info, "0", "0"); + } } @Override + @Transactional public void approveMax(PageData request, MultipartFile[] chengNuoShu) throws Exception { if (chengNuoShu != null && chengNuoShu.length > 0) { request.put("APPOINT_ANNEX", Warden.saveFile(Warden.createZip(chengNuoShu), Jurisdiction.getCORPINFO_ID())); @@ -1070,16 +1074,16 @@ public class XgfUserServiceImpl implements XgfUserService { if (request.get("APPOINT_ANNEX") != null) { info.setAPPOINT_ANNEX(request.getString("APPOINT_ANNEX")); } + info.setBACK_STEP(request.getString("BACK_STEP")); // 进行数据审核 LiteflowResponse response = flowExecutor.execute2Resp("chain1", info); - if (!response.isSuccess()) { + if (response.isSuccess()) { + System.out.println("流程信息:" + response.getExecuteStepStrWithTime()); + } else { Exception e = response.getCause(); e.printStackTrace(); - System.out.println(response.getMessage()); - throw new RuntimeException("系统异常"); - } else { - System.out.println("流程信息:" + response.getExecuteStepStrWithTime()); + throw new RuntimeException(e.getMessage()); } }