From 794b5df30b43aa0a354df7d935a3c0ef7e80a12b Mon Sep 17 00:00:00 2001 From: liujun Date: Wed, 20 Mar 2024 10:34:33 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=87=AA=E6=B5=8B=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=B7=B7=E4=B9=B1bug=E4=BF=AE=E5=A4=8D=202=E3=80=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/flow/xgf/GuFen/GuFenCharge.java | 40 +++++++++------- .../zcloud/flow/xgf/GuFen/GuFenSupervise.java | 44 +++++++++-------- .../flow/xgf/GuFen/GuFenWeiTuoCharge.java | 30 ++++++++++-- .../flow/xgf/GuFen/GuFenWeiTuoSupervise.java | 34 ++++++++------ .../java/com/zcloud/flow/xgf/InitCompany.java | 3 -- .../zcloud/flow/xgf/JiTuan/JiTuanCharge.java | 34 ++++++++------ .../flow/xgf/JiTuan/JiTuanSupervise.java | 47 +++++++++++-------- .../flow/xgf/JiTuan/JiTuanWeiTuoCharge.java | 34 ++++++++------ .../xgf/JiTuan/JiTuanWeiTuoSupervise.java | 30 +++++++----- .../zcloud/flow/xgf/YiBan/YiBanCharge.java | 40 +++++++++------- .../zcloud/flow/xgf/YiBan/YiBanSupervise.java | 46 ++++++++++++++---- .../service/xgf/impl/XgfUserServiceImpl.java | 41 ++++++++-------- src/main/resources/application-dev.properties | 3 ++ src/main/resources/flow.xml | 2 +- 14 files changed, 267 insertions(+), 161 deletions(-) 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 2d709960..2f47e23f 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java @@ -1,15 +1,14 @@ package com.zcloud.flow.xgf.GuFen; import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeSwitchComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; +import com.zcloud.flow.xgf.util.XgfFlowDto; import org.apache.commons.lang3.StringUtils; import javax.annotation.Resource; @@ -30,18 +29,14 @@ public class GuFenCharge extends NodeSwitchComponent { private XgfUserDetailsMapper xgfUserDetailsMapper; @Override - public String processSwitch() throws Exception { - System.out.println("GuFenCharge" + "节点"); - - + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); // 如果指针没有数据,赋值后自动结束 if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); info.setIterator("0"); flows.put("APPOINT_ZERO_CORP_TYPE", "0"); flows.put("APPOINT_ZERO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); @@ -50,8 +45,20 @@ public class GuFenCharge extends NodeSwitchComponent { flows.put("APPOINT_ZERO_USER_NAME", info.getAPPOINT_USER_NAME()); flows.put("FLOWS_STEP", 0); xgfFlowsMapper.edit(flows); - return ""; + return false; } + return super.isAccess(); + } + + @Override + public String processSwitch() throws Exception { + System.out.println(getName() + "节点"); + + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); condition.clear(); condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); @@ -59,7 +66,8 @@ public class GuFenCharge extends NodeSwitchComponent { // 如果不是当前流程,进入下一流程判断 if (!"1".equals(info.getIterator())) { - if (entity.get("ATTORNEY") == null || StringUtils.isNotBlank(entity.getString("ATTORNEY"))){ + // 根据是否有委托书判断是否走委托流程 + if (entity.get("ATTORNEY") != null && StringUtils.isNotBlank(entity.getString("ATTORNEY"))) { return "WeiTuo"; } return "JiTuanSupervise"; @@ -70,7 +78,7 @@ public class GuFenCharge extends NodeSwitchComponent { 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()); + flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 xgfUserService.repulse(flows); @@ -100,9 +108,9 @@ public class GuFenCharge extends NodeSwitchComponent { // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); - if (entity.get("ATTORNEY") == null || StringUtils.isNotBlank(entity.getString("ATTORNEY"))){ - return "WeiTuo"; + if (entity.get("ATTORNEY") != null && StringUtils.isNotBlank(entity.getString("ATTORNEY"))) { + return "GuFenWeiTuo"; } - return "JiTuanSupervise"; + return "GuFenSupervise"; } } 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 75dd4590..b4c9188d 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java @@ -3,16 +3,17 @@ package com.zcloud.flow.xgf.GuFen; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; +import com.zcloud.flow.xgf.util.XgfFlowDto; import org.apache.commons.lang3.StringUtils; import javax.annotation.Resource; @LiteflowComponent("GuFenSupervise") +@SuppressWarnings("all") public class GuFenSupervise extends NodeComponent { @Resource @@ -24,9 +25,31 @@ public class GuFenSupervise extends NodeComponent { @Resource private XgfUserMapper xgfUserMapper; + @Override + public boolean isAccess() { + XgfFlowDto info = this.getRequestData(); + + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); + info.setIterator("2"); + 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 false; + } + return "1".equals(info.getIterator()); + } + @Override public void process() throws Exception { - System.out.println("GuFenSupervise" + "节点"); + System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); @@ -39,23 +62,6 @@ public class GuFenSupervise extends NodeComponent { throw new RuntimeException("系统异常"); } - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("2"); - 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 (!"2".equals(info.getIterator())) { - return; - } flows.put("APPOINT_ONE_CORP_ID", "1"); flows.put("APPOINT_ONE_CORP_NAME", "秦港股份有限公司"); flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); 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 bb6d448a..03a7c00d 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java @@ -3,13 +3,13 @@ package com.zcloud.flow.xgf.GuFen; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; +import com.zcloud.flow.xgf.util.XgfFlowDto; import org.apache.commons.lang3.StringUtils; import javax.annotation.Resource; @@ -29,10 +29,32 @@ public class GuFenWeiTuoCharge extends NodeComponent { @Resource private CorpInfoMapper corpInfoMapper; + @Override + public boolean isAccess() { + XgfFlowDto info = this.getRequestData(); + + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); + 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 false; + } + return "1".equals(info.getIterator()); + } + @Override public void process() throws Exception { - System.out.println("GuFenWeiTuoCharge" + "节点"); + System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); @@ -67,7 +89,7 @@ public class GuFenWeiTuoCharge extends NodeComponent { 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()); + flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 @@ -80,7 +102,7 @@ public class GuFenWeiTuoCharge extends NodeComponent { 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()); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); xgfUserMapper.edit(entity); // 清空指针 info.setIterator(""); 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 f821b45a..a110aaa2 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java @@ -3,18 +3,19 @@ package com.zcloud.flow.xgf.GuFen; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; +import com.zcloud.flow.xgf.util.XgfFlowDto; import org.apache.commons.lang3.StringUtils; import javax.annotation.Resource; @LiteflowComponent("GuFenWeiTuoSupervise") +@SuppressWarnings("all") public class GuFenWeiTuoSupervise extends NodeComponent { @Resource @@ -30,18 +31,13 @@ public class GuFenWeiTuoSupervise extends NodeComponent { private CorpInfoMapper corpInfoMapper; @Override - public void process() throws Exception { - - System.out.println("GuFenWeiTuoSupervise" + "节点"); - + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); - // 如果指针没有数据,赋值后自动结束 if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); info.setIterator("2"); flows.put("APPOINT_TWO_CORP_TYPE", "0"); flows.put("APPOINT_TWO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); @@ -50,12 +46,19 @@ public class GuFenWeiTuoSupervise extends NodeComponent { flows.put("APPOINT_TWO_USER_NAME", info.getAPPOINT_USER_NAME()); flows.put("FLOWS_STEP", 2); xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"3".equals(info.getIterator())) { - return; + return false; } + return "2".equals(info.getIterator()); + } + + @Override + public void process() throws Exception { + System.out.println(getName() + "节点"); + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); condition.clear(); condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); @@ -85,6 +88,7 @@ public class GuFenWeiTuoSupervise extends NodeComponent { // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "1"); + info.setIterator(""); } } diff --git a/src/main/java/com/zcloud/flow/xgf/InitCompany.java b/src/main/java/com/zcloud/flow/xgf/InitCompany.java index ae5f74c3..cc06a7ea 100644 --- a/src/main/java/com/zcloud/flow/xgf/InitCompany.java +++ b/src/main/java/com/zcloud/flow/xgf/InitCompany.java @@ -2,11 +2,8 @@ package com.zcloud.flow.xgf; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeSwitchComponent; -import com.zcloud.entity.PageData; import com.zcloud.flow.xgf.util.XgfFlowDto; -import java.util.Map; - @LiteflowComponent("InitCompany") public class InitCompany extends NodeSwitchComponent { @Override 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 d3678417..84ccca99 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java @@ -1,18 +1,14 @@ package com.zcloud.flow.xgf.JiTuan; import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.core.NodeIfComponent; import com.yomahub.liteflow.core.NodeSwitchComponent; import com.zcloud.entity.PageData; import com.zcloud.flow.xgf.util.XgfFlowDto; -import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; -import com.zcloud.util.Jurisdiction; import org.apache.commons.lang3.StringUtils; import javax.annotation.Resource; @@ -33,18 +29,14 @@ public class JiTuanCharge extends NodeSwitchComponent { private XgfUserDetailsMapper xgfUserDetailsMapper; @Override - @SuppressWarnings("all") - public String processSwitch() throws Exception { - System.out.println("JiTuanCharge"+"节点"); - + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); // 如果指针没有数据,赋值后自动结束 if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); info.setIterator("1"); flows.put("APPOINT_ONE_CORP_TYPE", "0"); flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); @@ -53,9 +45,23 @@ public class JiTuanCharge extends NodeSwitchComponent { flows.put("APPOINT_ONE_USER_NAME", info.getAPPOINT_USER_NAME()); flows.put("FLOWS_STEP", 1); xgfFlowsMapper.edit(flows); - return ""; + return false; } + return super.isAccess(); + } + + @Override + @SuppressWarnings("all") + public String processSwitch() throws Exception { + System.out.println(getName()+ "节点"); + + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + + 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); @@ -103,7 +109,7 @@ public class JiTuanCharge extends NodeSwitchComponent { // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); - if (entity.get("ATTORNEY") == null || StringUtils.isNotBlank(entity.getString("ATTORNEY"))){ + if (entity.get("ATTORNEY") != null && StringUtils.isNotBlank(entity.getString("ATTORNEY"))){ return "WeiTuo"; } return "JiTuanSupervise"; 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 8532bad5..1ac9915e 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java @@ -24,9 +24,34 @@ public class JiTuanSupervise extends NodeComponent { @Resource private XgfUserMapper xgfUserMapper; + @Override + public boolean isAccess() { + + XgfFlowDto info = this.getRequestData(); + + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("2"); + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); + flows.put("APPOINT_TWO_CORP_TYPE", "0"); + flows.put("APPOINT_TWO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_TWO_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_TWO_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_TWO_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 2); + xgfFlowsMapper.edit(flows); + return false; + } + + // 如果不是当前流程,进入下一流程判断 + return "2".equals(info.getIterator()); + } + @Override public void process() throws Exception { - System.out.println("JiTuanSupervise"+"节点"); + System.out.println(getName() + "节点"); XgfFlowDto info = this.getRequestData(); PageData condition = new PageData(); @@ -37,30 +62,12 @@ public class JiTuanSupervise extends NodeComponent { if (flows == null || flows.size() == 0) { throw new RuntimeException("系统异常"); } - - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("2"); - flows.put("APPOINT_TWO_CORP_TYPE", "0"); - flows.put("APPOINT_TWO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); - flows.put("APPOINT_TWO_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); - flows.put("APPOINT_TWO_USER_ID", info.getAPPOINT_USER_ID()); - flows.put("APPOINT_TWO_USER_NAME", info.getAPPOINT_USER_NAME()); - flows.put("FLOWS_STEP", 2); - xgfFlowsMapper.edit(flows); - return; - } - - // 如果不是当前流程,进入下一流程判断 - if (!"2".equals(info.getIterator())) { - return; - } 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()); + flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 xgfUserService.repulse(flows); 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 e026eeb8..ac982c8a 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java @@ -30,17 +30,14 @@ public class JiTuanWeiTuoCharge extends NodeComponent { private CorpInfoMapper corpInfoMapper; @Override - public void process() throws Exception { - System.out.println("JiTuanWeiTuoCharge"+"节点"); - + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); // 如果指针没有数据,赋值后自动结束 if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); info.setIterator("2"); flows.put("APPOINT_TWO_CORP_TYPE", "0"); flows.put("APPOINT_TWO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); @@ -49,13 +46,22 @@ public class JiTuanWeiTuoCharge extends NodeComponent { flows.put("APPOINT_TWO_USER_NAME", info.getAPPOINT_USER_NAME()); flows.put("FLOWS_STEP", 2); xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"2".equals(info.getIterator())) { - return; + return false; } + return "2".equals(info.getIterator()); + } + + @Override + public void process() throws Exception { + System.out.println(getName() + "节点"); + + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + + 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); @@ -65,7 +71,7 @@ public class JiTuanWeiTuoCharge extends NodeComponent { 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()); + flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 @@ -78,7 +84,7 @@ public class JiTuanWeiTuoCharge extends NodeComponent { 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()); + entity.put("LIMIT_END_TIME", info.getLIMIT_END_TIME()); xgfUserMapper.edit(entity); // 清空指针 info.setIterator(""); 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 725e7bd0..0ce9f5f7 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java @@ -30,17 +30,15 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { private CorpInfoMapper corpInfoMapper; @Override - public void process() throws Exception { - System.out.println("JiTuanWeiTuoSupervise"+"节点"); - + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); - PageData condition = new PageData(); - condition.put("FLOWS_ID", info.getFLOWS_ID()); - PageData flows = xgfFlowsMapper.findById(condition); // 如果指针没有数据,赋值后自动结束 if (StringUtils.isBlank(info.getIterator())) { + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); info.setIterator("3"); flows.put("APPOINT_THREE_CORP_TYPE", "0"); flows.put("APPOINT_THREE_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); @@ -49,12 +47,20 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { flows.put("APPOINT_THREE_USER_NAME", info.getAPPOINT_USER_NAME()); flows.put("FLOWS_STEP", 3); xgfFlowsMapper.edit(flows); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"3".equals(info.getIterator())) { - return; + return false; } + return "3".equals(info.getIterator()); + } + + @Override + public void process() throws Exception { + System.out.println(getName() + "节点"); + + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); condition.clear(); condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); @@ -65,7 +71,7 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { 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()); + flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 xgfUserService.repulse(flows); 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 a0da9f72..58aa9ab9 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java @@ -3,19 +3,15 @@ package com.zcloud.flow.xgf.YiBan; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; -import com.zcloud.flow.xgf.util.XgfUtil; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; +import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; -import com.zcloud.util.HttpClientService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; -import java.util.Map; @LiteflowComponent("YiBanCharge") public class YiBanCharge extends NodeComponent { @@ -29,27 +25,39 @@ public class YiBanCharge extends NodeComponent { @Resource private XgfUserDetailsMapper xgfUserDetailsMapper; - @Value("${preventionxgf.api.url}") - private String prevention_xgf_url; @Resource private XgfUserService xgfUserService; + @Override + public boolean isAccess() { + + XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + condition.put("FLOWS_ID", info.getFLOWS_ID()); + PageData flows = xgfFlowsMapper.findById(condition); + + // 如果指针没有数据,赋值后自动结束 + if (StringUtils.isBlank(info.getIterator())) { + info.setIterator("0"); + flows.put("APPOINT_ZERO_CORP_TYPE", "0"); + flows.put("APPOINT_ZERO_DEPARTMENT_ID", info.getAPPOINT_DEPARTMENT_ID()); + flows.put("APPOINT_ZERO_DEPARTMENT_NAME", info.getAPPOINT_DEPARTMENT_NAME()); + flows.put("APPOINT_ZERO_USER_ID", info.getAPPOINT_USER_ID()); + flows.put("APPOINT_ZERO_USER_NAME", info.getAPPOINT_USER_NAME()); + flows.put("FLOWS_STEP", 0); + xgfFlowsMapper.edit(flows); + return false; + } + // 如果不是当前流程,进入下一流程判断 + return "0".equals(info.getIterator()); + } @Override public void process() throws Exception { System.out.println("YiBanCharge节点"); XgfFlowDto info = this.getRequestData(); PageData condition = new PageData(); - // 如果指针没有数据,赋值后自动结束 - if (StringUtils.isBlank(info.getIterator())) { - info.setIterator("0"); - return; - } - // 如果不是当前流程,进入下一流程判断 - if (!"0".equals(info.getIterator())) { - return; - } condition.put("FLOWS_ID", info.getFLOWS_ID()); PageData flows = xgfFlowsMapper.findById(condition); 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 01685f8b..0885ae7e 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java @@ -3,10 +3,10 @@ package com.zcloud.flow.xgf.YiBan; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zcloud.entity.PageData; -import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; +import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; @@ -31,13 +31,48 @@ public class YiBanSupervise extends NodeComponent { private CorpInfoMapper corpInfoMapper; @Override - public void process() throws Exception { - System.out.println("YiBanSupervise节点"); + public boolean isAccess() { XgfFlowDto info = this.getRequestData(); + PageData condition = new PageData(); + 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 false; + } + + return "1".equals(info.getIterator()); + } + + @Override + public void process() throws Exception { + System.out.println(getName()); + XgfFlowDto info = this.getRequestData(); + + PageData condition = new PageData(); + + 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; } // 如果不是当前流程,进入下一流程判断 @@ -45,11 +80,6 @@ public class YiBanSupervise extends NodeComponent { return; } - PageData condition = new PageData(); - - 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); 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 4307a85d..d00fb89d 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -200,7 +200,7 @@ public class XgfUserServiceImpl implements XgfUserService { flow.put("CREATOR_TIME", DateUtil.getTime()); flow.put("VALID_FLAG", "1"); flow.put("ISDELETE", "0"); - flow.put("END_FLAG","0"); + flow.put("END_FLAG", "0"); flow.put("FOREIGN_KEY", x.getString("XGF_USER_ID")); flowMapper.save(flow); /* 保存审批流程明细信息 */ @@ -302,7 +302,7 @@ public class XgfUserServiceImpl implements XgfUserService { condition.put("APPOINT_DEPARTMENT_NAME", request.getString("APPOINT_DEPARTMENT_NAME")); condition.put("APPOINT_USER_ID", request.getString("APPOINT_USER_ID")); condition.put("APPOINT_USER_NAME", request.getString("APPOINT_USER_NAME")); - condition.put("LIMIT_END_TIME",request.get("LIMIT_END_TIME")); + condition.put("LIMIT_END_TIME", request.get("LIMIT_END_TIME")); if (request.get("APPOINT_ANNEX") != null) { condition.put("APPOINT_ANNEX", request.getString("APPOINT_ANNEX")); } @@ -338,10 +338,10 @@ public class XgfUserServiceImpl implements XgfUserService { condition.put("FOREIGN_KEY", request.getString("XGF_USER_ID")); condition.put("TYPE", "1"); List list = flowMapper.getList(condition); - for(PageData x : list){ + for (PageData x : list) { condition.clear(); condition.put("FLOW_ID", x.getString("FLOW_ID")); - x.put("flow",flowDetailMapper.getList(condition)); + x.put("flow", flowDetailMapper.getList(condition)); } return list; } @@ -357,7 +357,7 @@ public class XgfUserServiceImpl implements XgfUserService { PageData zero = new PageData(); int index = Integer.parseInt(entity.getString("FLOWS_STEP")); - if (index >= 0){ + if (index >= 0) { zero.put("INDEX", "0"); zero.put("APPOINT_CORP_ID", entity.getString("APPOINT_ZERO_CORP_ID")); zero.put("APPOINT_CORP_NAME", entity.getString("APPOINT_ZERO_CORP_NAME")); @@ -472,7 +472,7 @@ public class XgfUserServiceImpl implements XgfUserService { @Transactional public void approvePlus(PageData request, MultipartFile[] chengNuoShu) throws Exception { if (chengNuoShu != null && chengNuoShu.length > 0) { - request.put("APPOINT_ANNEX", Warden.saveFile(Warden.createZip(chengNuoShu),Jurisdiction.getCORPINFO_ID())); + request.put("APPOINT_ANNEX", Warden.saveFile(Warden.createZip(chengNuoShu), Jurisdiction.getCORPINFO_ID())); } this.approve(request); } @@ -573,7 +573,7 @@ public class XgfUserServiceImpl implements XgfUserService { 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.get("LIMIT_END_TIME")); + user.put("LIMIT_END_TIME", info.get("LIMIT_END_TIME")); // created by liu jun 2024-02-26 如果有委托书则保存委托书 if (StringUtils.isNotBlank(info.getString("APPOINT_ANNEX"))) { condition.clear(); @@ -681,7 +681,7 @@ public class XgfUserServiceImpl implements XgfUserService { 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.get("LIMIT_END_TIME")); + entity.put("LIMIT_END_TIME", info.get("LIMIT_END_TIME")); xgfUserMapper.edit(entity); flows.put("APPOINT_THREE_CORP_ID", info.getString("APPOINT_CORP_ID")); @@ -879,7 +879,7 @@ public class XgfUserServiceImpl implements XgfUserService { } } - private void clearInfo(PageData flow){ + private void clearInfo(PageData flow) { flow.put("APPOINT_ONE_USER_ID", ""); flow.put("APPOINT_TWO_USER_ID", ""); flow.put("APPOINT_THREE_USER_ID", ""); @@ -888,6 +888,7 @@ public class XgfUserServiceImpl implements XgfUserService { flow.put("APPOINT_SIX_USER_ID", ""); flow.put("APPOINT_SEVEN_USER_ID", ""); } + public void saveLog(PageData info, String status, String endFlag) throws Exception { /* 保存审批记录 */ PageData condition = new PageData(); @@ -941,10 +942,10 @@ public class XgfUserServiceImpl implements XgfUserService { @Override public void saveLog(XgfFlowDto info, String status, String endFlag) throws Exception { PageData _info = new PageData(); - _info.put("OPINION",info.getOPINION()); - _info.put("APPOINT_ANNEX",info.getAPPOINT_ANNEX()); - _info.put("FLOWS_ID",info.getFLOWS_ID()); - this.saveLog(_info,status,endFlag); + _info.put("OPINION", info.getOPINION()); + _info.put("APPOINT_ANNEX", info.getAPPOINT_ANNEX()); + _info.put("FLOWS_ID", info.getFLOWS_ID()); + this.saveLog(_info, status, endFlag); } @Override @@ -959,7 +960,7 @@ public class XgfUserServiceImpl implements XgfUserService { key.putAll(entity); key.put("USER_ID", condition.get("XGF_USER_ID")); key.put("STATUS", "1"); - key.put("OPINION",flows.get("OPINION")); + 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("请求失败"); @@ -972,7 +973,7 @@ public class XgfUserServiceImpl implements XgfUserService { @Override 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())); + request.put("APPOINT_ANNEX", Warden.saveFile(Warden.createZip(chengNuoShu), Jurisdiction.getCORPINFO_ID())); } List _list = Warden.getList(request.getString("list")); @@ -995,11 +996,11 @@ public class XgfUserServiceImpl implements XgfUserService { info.setFLOWS_ID(x); info.setSTATUS(request.getString("STATUS")); info.setOPINION(request.getString("OPINION")); - info.setAPPOINT_DEPARTMENT_ID( request.getString("APPOINT_DEPARTMENT_ID")); + info.setAPPOINT_DEPARTMENT_ID(request.getString("APPOINT_DEPARTMENT_ID")); info.setAPPOINT_DEPARTMENT_NAME(request.getString("APPOINT_DEPARTMENT_NAME")); info.setAPPOINT_USER_ID(request.getString("APPOINT_USER_ID")); info.setAPPOINT_USER_NAME(request.getString("APPOINT_USER_NAME")); - if (request.get("LIMIT_END_TIME") != null){ + if (request.get("LIMIT_END_TIME") != null) { info.setLIMIT_END_TIME(request.getString("LIMIT_END_TIME")); } if (request.get("APPOINT_ANNEX") != null) { @@ -1008,11 +1009,13 @@ public class XgfUserServiceImpl implements XgfUserService { // 进行数据审核 LiteflowResponse response = flowExecutor.execute2Resp("chain1", info); - if (!response.isSuccess()){ + if (!response.isSuccess()) { Exception e = response.getCause(); e.printStackTrace(); System.out.println(response.getMessage()); throw new RuntimeException("系统异常"); + } else { + System.out.println("流程信息:" + response.getExecuteStepStrWithTime()); } } @@ -1034,7 +1037,7 @@ public class XgfUserServiceImpl implements XgfUserService { return "1"; } // created bu liu jun - 港务局要求,可以直接指定集团单位 - if ("1".equals(corpInfoId)){ + if ("1".equals(corpInfoId)) { return "2"; } return "0"; diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index da93ee1c..df22d1dc 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -128,3 +128,6 @@ mq.gwj.file.topic=czks_dockingPicture cfd.prevention.api.url=http://192.168.0.31:7021/qa-regulatory-cfd #河北秦安文件服务器前缀 heBeiQinAnFile=https://file.zcloudchina.com/YTHFile + +liteflow.rule-source=flow.xml +liteflow.print-execution-log=false diff --git a/src/main/resources/flow.xml b/src/main/resources/flow.xml index a8f0f72d..eab2b5f0 100644 --- a/src/main/resources/flow.xml +++ b/src/main/resources/flow.xml @@ -12,7 +12,7 @@ ).id("JiTuan"), SWITCH(GuFenCharge).to( GuFenSupervise, - THEN(GuFenWeiTuoCharge,GuFenWeiTuoSupervise).id("WeiTuo") + THEN(GuFenWeiTuoCharge,GuFenWeiTuoSupervise).id("GuFenWeiTuo") ).DEFAULT(DefaultNode).id("GuFen") );