浏览代码

重置流程逻辑

zt 4 月之前
父节点
当前提交
08bfe303d8

+ 23 - 3
pro-base/src/main/java/com/idea/oa/apply/model/inout/AddConfirmResult.java

@@ -20,15 +20,19 @@ public class AddConfirmResult {
     // 附加:flowMainPushId推送表id,flow_id的id,task_id的id中的flowMainPushId 就可以操作了
     //1.审核结果,
     private String confirmResult;
-//,2 审核意见
+    //,2 审核意见
     private String confirmContent;
-//3 抄送人
+    //3 抄送人
     private String ccList;
-//flowMainPushId推送表id
+    //flowMainPushId推送表id
     private String flowMainPushId;
 //    private String flowId;
 //    private String taskId;
 
+    //fy增加的H5页面审核时需要上传签名照
+    private String base64;
+    //签名文件id,由base64处理得到的id
+    private String signFileId;
 
     public String getOperaterId() {
         return operaterId;
@@ -69,4 +73,20 @@ public class AddConfirmResult {
     public void setCcList(String ccList) {
         this.ccList = ccList;
     }
+
+    public String getBase64() {
+        return base64;
+    }
+
+    public void setBase64(String base64) {
+        this.base64 = base64;
+    }
+
+    public String getSignFileId() {
+        return signFileId;
+    }
+
+    public void setSignFileId(String signFileId) {
+        this.signFileId = signFileId;
+    }
 }

+ 71 - 543
pro-base/src/main/java/com/idea/oa/flow2/service/FlowMainService.java

@@ -4,10 +4,8 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.util.StringUtil;
 import com.idea.oa.activiti.service.ProActiService;
-import com.idea.oa.apply.model.ApplyProject;
 import com.idea.oa.apply.model.inout.AddConfirmResult;
 import com.idea.oa.apply.model.inout.OperaterManage;
-import com.idea.oa.apply.service.ApplyProjectService;
 import com.idea.oa.apply.util.constant.ConstantFlowType;
 import com.idea.oa.flow2.mapper.FlowMainExtendMapper;
 import com.idea.oa.flow2.mapper.FlowMainMapper;
@@ -51,14 +49,7 @@ import java.util.*;
 
 @Service
 public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
-//    @Autowired
-//    private ApplyProjectProposalService applyProjectProposalService;
-//    @Autowired
-//    private ApplyChangeProjectProposalService applyChangeProjectProposalService;
-//    @Autowired
-//    private ProMainService proMainService;
-    //    @Autowired
-//    private ApplyUseMoneyDetailService applyUseMoneyDetailService;
+
     @Autowired
     public FrameUserService frameUserService;
     @Autowired
@@ -78,17 +69,9 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
     private FlowMainLogService flowMainLogService;
     @Autowired
     private FlowMainCcService flowMainCcService;
-    @Autowired
-    private ApplyProjectService applyProjectService;
 
-//    @Autowired
-//    private ApplyChangeProjectService applyChangeProjectService;
 
-//    @Autowired
-//    private CtrMainService ctrMainService;
 
-//    @Autowired
-//    private ProTypeService proTypeService;
     @Autowired
     private FrameUserDeptService frameUserDeptService;
     @Autowired
@@ -100,7 +83,7 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
         if (!"ok_end".equals(isOkString) && !"ok_noEnd".equals(isOkString)&&!"no_end".equals(isOkString)) {
 
         }else{
-            //todo 该审核人审核结束 信息在flowMainPush中
+            // 该审核人审核结束 信息在flowMainPush中
 
         }
 
@@ -270,7 +253,7 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
 //                         不操作,说明都同意直接跳过
 
                         } else {
-                            //todo 说明有人不同意,需要结束流程
+                            // 说明有人不同意,需要结束流程
                             // 因为这是同意签核,但是之前有人不同意,并已经记录了,所以要进行不同意操作,所以要记录本用户同意,而流程是不同意结束
                             {
                                 {// 发起流程引擎操作 并结束该流程
@@ -1808,22 +1791,23 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
         try {
 
             //todo 判断是否需要确定集团审核 ============================================这里,要特别定制(只对三资,解决集团分管领导不知道选哪个的问题)
-            if (roleKey.equals("jtzjl") || roleKey.equals("xmpswyh") || roleKey.equals("jxpswyh") || roleKey.equals("jtfgld") || roleKey.equals("zyld")) {
-//                System.out.println("-100,查询数据开始:" + roleKey + "===>" + roleType);
-                if (roleKey.equals("jtfgld")) {
-                    // 三资,解决集团分管领导不知道选哪个的问题
-                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup2(roleKey, roleType, groupId);
-
-                } else if (roleKey.equals("zyld")) {
-                    // 三资,解决集团分管领导不知道选哪个的问题
-                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup3(roleKey, roleType, groupId);
-
-                } else {
-                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup(roleKey, roleType);
-
-                }
-
-            } else if (roleKey.equals("fgld")) {
+//            if (roleKey.equals("jtzjl") || roleKey.equals("xmpswyh") || roleKey.equals("jxpswyh") || roleKey.equals("jtfgld") || roleKey.equals("zyld")) {
+////                System.out.println("-100,查询数据开始:" + roleKey + "===>" + roleType);
+//                if (roleKey.equals("jtfgld")) {
+//                    // 三资,解决集团分管领导不知道选哪个的问题
+//                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup2(roleKey, roleType, groupId);
+//
+//                } else if (roleKey.equals("zyld")) {
+//                    // 三资,解决集团分管领导不知道选哪个的问题
+//                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup3(roleKey, roleType, groupId);
+//
+//                } else {
+//                    frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup(roleKey, roleType);
+//
+//                }
+//
+//            } else
+           if (roleKey.equals("fgld")) {
                 // 找分管领导
                 frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndDept(flowMain.getDeptId());
 
@@ -1832,7 +1816,8 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
                 frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndUpDept(flowMain.getDeptId());
 
             } else {
-                frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndGroup(roleKey, roleType, groupId);
+                frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndNoGroup(roleKey, roleType);
+//                frameUsersByRoleKey = flowMainExtendMapper.findFrameUsersByRoleKeyAndGroup(roleKey, roleType, groupId);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -1933,256 +1918,30 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
     public String[] getFlowStep(FlowMain flowMain) {
         String[] flowStep = null;
         {
-            if (flowMain.getFlowType().equals(ConstantFlowType.ADD_WORK)) {
-                flowStep = ConstantFlowType.ADD_WORK_FLOWSTEPS;
+            if (flowMain.getFlowType().equals(ConstantFlowType.OFF_WORK)) {
+//                flowStep = ConstantFlowType.OFF_WORK_FLOWSTEPS_noenough2;
+
             } else if (flowMain.getFlowType().equals(ConstantFlowType.PAYMENT)) {
                 flowStep = ConstantFlowType.PAYMENT_FLOWSTEPS;
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.END_PROJECT)) {
-                if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-                    flowStep = ConstantFlowType.END_PROJECT_FLOWSTEPS;
-                } else {
-                    flowStep = ConstantFlowType.END_PROJECT_FLOWSTEPS1;
-                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.START_PROJECT)) {
-                ApplyProject applyProject = applyProjectService.selectByPrimaryKey(flowMain.getFormId());
-//                ProMain proMain = proMainService.selectByPrimaryKey(applyProject.getProId());
-//                CtrMainExample example = new CtrMainExample();
-//                example.createCriteria().andProidEqualTo(applyProject.getProId());
-//                List<CtrMain> ctrMains = ctrMainService.selectByExample(example);
-//                Double ctrAmount = 0D;//合同金额
-//                if (ctrMains.size() > 0) {
-//                    ctrAmount = ctrMains.get(0).getTotalamount();
-//                }
-//                BigDecimal ratio = applyProject.getExpectRatio();//毛利
-//                BigDecimal expectCost = applyProject.getExpectCost();//投入成本
-//                //战略型T14 市场型T15 保障型T16
-//                //1、市场型项目:合同金额>=6000000,或毛利率<30%;
-//                //2、战略型项目:投入金额>300000;
-//                //3、保障型项目:毛利率<8%,或项目合同金额>=10000000
-//                String proType = proMain.getProtype();
-//                ProTypeExample proTypeExample = new ProTypeExample();
-//                proTypeExample.createCriteria().andProValueEqualTo(proType).andGroupIdEqualTo(proMain.getGroupId());
-//                List<ProType> proTypes = proTypeService.selectByExample(proTypeExample);
-//                Boolean flag = false;
-//                if (proTypes.size() > 0) {
-//                    ProType proType1 = proTypes.get(0);
-//                    if (proType1.getProLabel().equals("市场型")) {
-//                        if (ctrAmount >= 6000000D || ratio.compareTo(new BigDecimal(30)) < 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("战略型")) {
-//                        if (expectCost.compareTo(new BigDecimal(300000)) > 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("保障型")) {
-//                        if (ratio.compareTo(new BigDecimal("8")) < 0 || ctrAmount >= 10000000) {
-//                            flag = true;
-//                        }
-//                    }
-//                }
-//                if (flag) {
-//                    if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-//
-//                        flowStep = ConstantFlowType.START_PROJECT_FLOWSTEPS_enough;
-//                    } else {
-//                        flowStep = ConstantFlowType.START_PROJECT_FLOWSTEPS1_enough;
-//
-//                    }
-//                } else {
-                    //逻辑判断
-                    flowStep = ConstantFlowType.START_PROJECT_FLOWSTEPS_noenough;
-//                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT)) {
-//                ApplyChangeProject applyProject = applyChangeProjectService.selectByPrimaryKey(flowMain.getFormId());
-//                ProMain proMain = proMainService.selectByPrimaryKey(applyProject.getProId());
-//                CtrMainExample example = new CtrMainExample();
-//                example.createCriteria().andProidEqualTo(applyProject.getProId());
-//                List<CtrMain> ctrMains = ctrMainService.selectByExample(example);
-//                Double ctrAmount = 0D;//合同金额
-//                if (ctrMains.size() > 0) {
-//                    ctrAmount = ctrMains.get(0).getTotalamount();
-//                }
-//                BigDecimal ratio = applyProject.getExpectRatio();//毛利
-//                BigDecimal expectCost = applyProject.getExpectCost();//投入成本
-//                //战略型T14 市场型T15 保障型T16
-//                //1、市场型项目:合同金额>=6000000,或毛利率<30%;
-//                //2、战略型项目:投入金额>300000;
-//                //3、保障型项目:毛利率<8%,或项目合同金额>=10000000
-//                String proType = proMain.getProtype();
-//                ProTypeExample proTypeExample = new ProTypeExample();
-//                proTypeExample.createCriteria().andProValueEqualTo(proType).andGroupIdEqualTo(proMain.getGroupId());
-//                List<ProType> proTypes = proTypeService.selectByExample(proTypeExample);
-//                Boolean flag = false;
-//                if (proTypes.size() > 0) {
-//                    ProType proType1 = proTypes.get(0);
-//                    if (proType1.getProLabel().equals("市场型")) {
-//                        if (ctrAmount >= 6000000D || ratio.compareTo(new BigDecimal(30)) < 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("战略型")) {
-//                        if (expectCost.compareTo(new BigDecimal(300000)) > 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("保障型")) {
-//                        if (ratio.compareTo(new BigDecimal("8")) < 0 || ctrAmount >= 10000000) {
-//                            flag = true;
-//                        }
-//                    }
-//                }
-//                if (flag) {
-//                    if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-//
-//                        flowStep = ConstantFlowType.CHANGE_PROJECT_FLOWSTEPS_enough;
-//                    } else {
-//                        flowStep = ConstantFlowType.CHANGE_PROJECT_FLOWSTEPS1_enough;
-//
-//                    }
-//                } else {
-                    //逻辑判断
-                    flowStep = ConstantFlowType.CHANGE_PROJECT_FLOWSTEPS_noenough;
-//                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PROJECT_PROPOSAL1)) {
-                {//进行审核判断
-//                    ApplyProjectProposal applyProjectProposal = applyProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.PROJECT_PROPOSAL1_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.PROJECT_PROPOSAL1_FLOWSTEPS_enough;
-//                    }
-                }
-
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PROJECT_PROPOSAL)) {
-                {//进行审核判断
-//                    ApplyProjectProposal applyProjectProposal = applyProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.PROJECT_PROPOSAL_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.PROJECT_PROPOSAL_FLOWSTEPS_enough;
-//                    }
-                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL1)) {
-                {//进行审核判断
-//                    ApplyChangeProjectProposal applyChangeProjectProposal = applyChangeProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyChangeProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.CHANGE_PROJECT_PROPOSAL1_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.CHANGE_PROJECT_PROPOSAL1_FLOWSTEPS_enough;
-//                    }
-                }
-
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL)) {
-                {//进行审核判断
-//                    ApplyChangeProjectProposal applyChangeProjectProposal = applyChangeProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyChangeProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.CHANGE_PROJECT_PROPOSAL_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.CHANGE_PROJECT_PROPOSAL_FLOWSTEPS_enough;
-//                    }
-                }
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHECK_IN)) {
+                flowStep = ConstantFlowType.CHECK_IN_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.CONTRACT)) {
+                flowStep = ConstantFlowType.CONTRACT_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.RECEIVABLES_ADJUST)) {
+                flowStep = ConstantFlowType.RECEIVABLES_ADJUST_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.INVOICE_RED)) {
+                flowStep = ConstantFlowType.INVOICE_RED_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.BUYING_MORE)) {
+                flowStep = ConstantFlowType.BUYING_MORE_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.FINANCE)) {
+                flowStep = ConstantFlowType.FINANCE_FLOWSTEPS;
             }
         }
         return flowStep;
     }
 
 
+
     /**
      * 获取流程步骤(后端查询各个节点名称用),逻辑同上  todo 新增流程要在这里加_步骤2
      *
@@ -2192,257 +1951,30 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
     public String[] getOnlyFlowFlowStep(FlowMain flowMain) {
         String[] flowStep = null;
         {
-            if (flowMain.getFlowType().equals(ConstantFlowType.ADD_WORK)) {
-                flowStep = ConstantFlowType.onlyFlow_ADD_WORK_FLOWSTEPS;
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PROJECT_PROPOSAL1)) {
-                {//进行审核判断
-//                    ApplyProjectProposal applyProjectProposal = applyProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL1_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL1_FLOWSTEPS_enough;
-//                    }
-                }
-
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.START_PROJECT)) {
-
-
-                ApplyProject applyProject = applyProjectService.selectByPrimaryKey(flowMain.getFormId());
-//                ProMain proMain = proMainService.selectByPrimaryKey(applyProject.getProId());
-//                CtrMainExample example = new CtrMainExample();
-//                example.createCriteria().andProidEqualTo(applyProject.getProId());
-//                List<CtrMain> ctrMains = ctrMainService.selectByExample(example);
-//                Double ctrAmount = 0D;//合同金额
-//                if (ctrMains.size() > 0) {
-//                    ctrAmount = ctrMains.get(0).getTotalamount();
-//                }
-//                BigDecimal ratio = applyProject.getExpectRatio();//毛利
-//                BigDecimal expectCost = applyProject.getExpectCost();//投入成本
-//                //战略型T14 市场型T15 保障型T16
-//                //1、市场型项目:合同金额>=6000000,或毛利率<30%;
-//                //2、战略型项目:投入金额>300000;
-//                //3、保障型项目:毛利率<8%,或项目合同金额>=10000000
-//                String proType = proMain.getProtype();
-//                ProTypeExample proTypeExample = new ProTypeExample();
-//                proTypeExample.createCriteria().andProValueEqualTo(proType).andGroupIdEqualTo(proMain.getGroupId());
-//                List<ProType> proTypes = proTypeService.selectByExample(proTypeExample);
-//                Boolean flag = false;
-//                if (proTypes.size() > 0) {
-//                    ProType proType1 = proTypes.get(0);
-//                    if (proType1.getProLabel().equals("市场型")) {
-//                        if (ctrAmount >= 6000000D || ratio.compareTo(new BigDecimal(30)) < 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("战略型")) {
-//                        if (expectCost.compareTo(new BigDecimal(300000)) > 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("保障型")) {
-//                        if (ratio.compareTo(new BigDecimal("8")) < 0 || ctrAmount >= 10000000) {
-//                            flag = true;
-//                        }
-//                    }
-//                }
-//                if (flag) {
-//                    if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-//                        flowStep = ConstantFlowType.onlyFlow_START_PROJECT_FLOWSTEPS_enough;
-//                    } else {
-//                        flowStep = ConstantFlowType.onlyFlow_START_PROJECT_FLOWSTEPS1_enough;
-//
-//                    }
-//                } else {
-                    //逻辑判断
-                    flowStep = ConstantFlowType.onlyFlow_START_PROJECT_FLOWSTEPS_noenough;
-//                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT)) {
-//                ApplyChangeProject applyProject = applyChangeProjectService.selectByPrimaryKey(flowMain.getFormId());
-//                ProMain proMain = proMainService.selectByPrimaryKey(applyProject.getProId());
-//                CtrMainExample example = new CtrMainExample();
-//                example.createCriteria().andProidEqualTo(applyProject.getProId());
-//                List<CtrMain> ctrMains = ctrMainService.selectByExample(example);
-//                Double ctrAmount = 0D;//合同金额
-//                if (ctrMains.size() > 0) {
-//                    ctrAmount = ctrMains.get(0).getTotalamount();
-//                }
-//                BigDecimal ratio = applyProject.getExpectRatio();//毛利
-//                BigDecimal expectCost = applyProject.getExpectCost();//投入成本
-//                //战略型T14 市场型T15 保障型T16
-//                //1、市场型项目:合同金额>=6000000,或毛利率<30%;
-//                //2、战略型项目:投入金额>300000;
-//                //3、保障型项目:毛利率<8%,或项目合同金额>=10000000
-//                String proType = proMain.getProtype();
-//                ProTypeExample proTypeExample = new ProTypeExample();
-//                proTypeExample.createCriteria().andProValueEqualTo(proType).andGroupIdEqualTo(proMain.getGroupId());
-//                List<ProType> proTypes = proTypeService.selectByExample(proTypeExample);
-//                Boolean flag = false;
-//                if (proTypes.size() > 0) {
-//                    ProType proType1 = proTypes.get(0);
-//                    if (proType1.getProLabel().equals("市场型")) {
-//                        if (ctrAmount >= 6000000D || ratio.compareTo(new BigDecimal(30)) < 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("战略型")) {
-//                        if (expectCost.compareTo(new BigDecimal(300000)) > 0) {
-//                            flag = true;
-//                        }
-//                    } else if (proType1.getProLabel().equals("保障型")) {
-//                        if (ratio.compareTo(new BigDecimal("8")) < 0 || ctrAmount >= 10000000) {
-//                            flag = true;
-//                        }
-//                    }
-//                }
-//                if (flag) {
-//                    if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-//                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_FLOWSTEPS_enough;
-//                    } else {
-//                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_FLOWSTEPS1_enough;
-//
-//                    }
-//                } else {
-                    //逻辑判断
-                    flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_FLOWSTEPS_noenough;
-//                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PROJECT_PROPOSAL)) {
-                {//进行审核判断
-//                    ApplyProjectProposal applyProjectProposal = applyProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL_FLOWSTEPS_enough;
-//                    }
-                }
+            if (flowMain.getFlowType().equals(ConstantFlowType.OFF_WORK)) {
+//                flowStep = ConstantFlowType.onlyFlow_OFF_WORK_FLOWSTEPS_noenough2;
             } else if (flowMain.getFlowType().equals(ConstantFlowType.PAYMENT)) {
                 flowStep = ConstantFlowType.onlyFlow_PAYMENT_FLOWSTEPS;
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.END_PROJECT)) {
-                if (flowMain.getGroupId().equals(ConstantFlowType.groupIdMyself)) {
-                    flowStep = ConstantFlowType.onlyFlow_END_PROJECT_FLOWSTEPS;
-                } else {
-                    flowStep = ConstantFlowType.onlyFlow_END_PROJECT_FLOWSTEPS1;
-
-                }
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL1)) {
-                {//进行审核判断
-//                    ApplyChangeProjectProposal applyChangeProjectProposal = applyChangeProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyChangeProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL1_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL1_FLOWSTEPS_enough;
-//                    }
-                }
-
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL)) {
-                {//进行审核判断
-//                    ApplyChangeProjectProposal applyChangeProjectProposal = applyChangeProjectProposalService.selectByPrimaryKey(flowMain.getFormId());
-////获取商机库信息
-//                    ProMain proMain = proMainService.selectByPrimaryKey(applyChangeProjectProposal.getTableProMainId());
-//
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    {
-//                        if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(300000)) < 0) {
-//                            feeMoneyTotalMap.put("less30w", "yes");
-//                        } else {
-//                            feeMoneyTotalMap.put("less30w", "no");
-//                        }
-//                        Double presales = proMain.getPresales();
-//                        if (presales == null) {
-//                            feeMoneyTotalMap.put("lessequal5", "no");
-//                        } else {//预投入限额<=销售额的5%或小于300000
-//                            if (applyChangeProjectProposal.getProMoney().compareTo(new BigDecimal(presales).multiply(new BigDecimal(0.05))) <= 0) {
-//                                feeMoneyTotalMap.put("lessequal5", "yes");
-//                            } else {
-//                                feeMoneyTotalMap.put("lessequal5", "no");
-//                            }
-//                        }
-//                    }
-//
-//
-//                    if ("yes".equals(feeMoneyTotalMap.get("less30w")) && "yes".equals(feeMoneyTotalMap.get("lessequal5"))) {
-//                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL_FLOWSTEPS_noenough;
-//                    } else {
-                        flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL_FLOWSTEPS_enough;
-//                    }
-                }
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.CHECK_IN)) {
+                flowStep = ConstantFlowType.onlyFlow_CHECK_IN_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.CONTRACT)) {
+                flowStep = ConstantFlowType.onlyFlow_CONTRACT_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.RECEIVABLES_ADJUST)) {
+                flowStep = ConstantFlowType.onlyFlow_RECEIVABLES_ADJUST_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.INVOICE_RED)) {
+                flowStep = ConstantFlowType.onlyFlow_INVOICE_RED_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.BUYING_MORE)) {
+                flowStep = ConstantFlowType.onlyFlow_BUYING_MORE_FLOWSTEPS;
+            } else if (flowMain.getFlowType().equals(ConstantFlowType.FINANCE)){
+                flowStep = ConstantFlowType.onlyFlow_FINANCE_FLOWSTEPS;
             }
+
         }
         return flowStep;
     }
 
+
+
     /**
      * 获取全流程信息 todo 新增流程要在这里加_步骤1
      *
@@ -2452,27 +1984,22 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
     public String[] getOnlylowStepAll(String flowType) {
         String[] flowStep = null;
         {
-            if (flowType.equals(ConstantFlowType.ADD_WORK)) {
-                flowStep = ConstantFlowType.onlyFlow_ADD_WORK_FLOWSTEPS_ALL;
-            } else if (flowType.equals(ConstantFlowType.PAYMENT)) {
+            if (flowType.equals(ConstantFlowType.OFF_WORK)) {
+                flowStep = ConstantFlowType.onlyFlow_OFF_WORK_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.PAYMENT)) {
                 flowStep = ConstantFlowType.onlyFlow_PAYMENT_FLOWSTEPS_ALL;
-
-            } else if (flowType.equals(ConstantFlowType.END_PROJECT)) {
-                flowStep = ConstantFlowType.onlyFlow_END_PROJECT_FLOWSTEPS_ALL;
-            } else if (flowType.equals(ConstantFlowType.PROJECT_PROPOSAL1)) {
-                flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL1_FLOWSTEPS_ALL;
-            } else if (flowType.equals(ConstantFlowType.PROJECT_PROPOSAL)) {
-                flowStep = ConstantFlowType.onlyFlow_PROJECT_PROPOSAL_FLOWSTEPS_ALL;
-            } else if (flowType.equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL1)) {
-                flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL1_FLOWSTEPS_ALL;
-            } else if (flowType.equals(ConstantFlowType.CHANGE_PROJECT_PROPOSAL)) {
-                flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_PROPOSAL_FLOWSTEPS_ALL;
-
-            } else if (flowType.equals(ConstantFlowType.START_PROJECT)) {
-                flowStep = ConstantFlowType.onlyFlow_START_PROJECT_FLOWSTEPS_ALL;
-
-            } else if (flowType.equals(ConstantFlowType.CHANGE_PROJECT)) {
-                flowStep = ConstantFlowType.onlyFlow_CHANGE_PROJECT_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.CHECK_IN)) {
+                flowStep = ConstantFlowType.onlyFlow_CHECK_IN_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.CONTRACT)) {
+                flowStep = ConstantFlowType.onlyFlow_CONTRACT_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.RECEIVABLES_ADJUST)) {
+                flowStep = ConstantFlowType.onlyFlow_RECEIVABLES_ADJUST_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.INVOICE_RED)) {
+                flowStep = ConstantFlowType.onlyFlow_INVOICE_RED_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.BUYING_MORE)) {
+                flowStep = ConstantFlowType.onlyFlow_BUYING_MORE_FLOWSTEPS_ALL;
+            }else if (flowType.equals(ConstantFlowType.FINANCE)) {
+                flowStep = ConstantFlowType.onlyFlow_FINANCE_FLOWSTEPS_ALL;
             }
         }
         return flowStep;
@@ -2480,6 +2007,7 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
 
 
 
+
     /**
      * 前端流程图使用查看各个流程节点目前的情况
      *

+ 18 - 32
pro-base/src/main/resources/mybatis/flow2/FlowMainCcMapper.xml

@@ -13,7 +13,6 @@
     <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
     <result column="group_id" jdbcType="VARCHAR" property="groupId" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="is_read" jdbcType="VARCHAR" property="isRead" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -75,7 +74,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, flow_main_id, cc_user, main_log_ids, status, created_by, created_at, updated_by, 
-    updated_at, group_id, remark, is_read
+    updated_at, group_id, remark
   </sql>
   <select id="selectByExample" parameterType="com.idea.oa.flow2.model.FlowMainCcExample" resultMap="BaseResultMap">
     select
@@ -108,23 +107,25 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.idea.oa.flow2.model.FlowMainCc">
-    insert into flow_main_cc (id,flow_main_id, cc_user, main_log_ids,
+    
+      
+    
+    insert into flow_main_cc (id,flow_main_id, cc_user, main_log_ids, 
       status, created_by, created_at, 
       updated_by, updated_at, group_id, 
-      remark, is_read)
-    values (#{id,jdbcType=VARCHAR},#{flowMainId,jdbcType=VARCHAR}, #{ccUser,jdbcType=VARCHAR}, #{mainLogIds,jdbcType=VARCHAR},
+      remark)
+    values (#{id,jdbcType=VARCHAR},#{flowMainId,jdbcType=VARCHAR}, #{ccUser,jdbcType=VARCHAR}, #{mainLogIds,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, 
       #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{groupId,jdbcType=VARCHAR}, 
-      #{remark,jdbcType=VARCHAR}, #{isRead,jdbcType=VARCHAR})
+      #{remark,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.oa.flow2.model.FlowMainCc">
-
-
-
+    
+      
+    
     insert into flow_main_cc
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">id,</if>
-        <if test="flowMainId != null">
+    <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if>
+      <if test="flowMainId != null">
         flow_main_id,
       </if>
       <if test="ccUser != null">
@@ -154,13 +155,9 @@
       <if test="remark != null">
         remark,
       </if>
-      <if test="isRead != null">
-        is_read,
-      </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">#{id,jdbcType=VARCHAR},</if>
-        <if test="flowMainId != null">
+    <trim prefix="values (" suffix=")" suffixOverrides=","><if test="id != null">#{id,jdbcType=VARCHAR},</if>
+      <if test="flowMainId != null">
         #{flowMainId,jdbcType=VARCHAR},
       </if>
       <if test="ccUser != null">
@@ -190,9 +187,6 @@
       <if test="remark != null">
         #{remark,jdbcType=VARCHAR},
       </if>
-      <if test="isRead != null">
-        #{isRead,jdbcType=VARCHAR},
-      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.oa.flow2.model.FlowMainCcExample" resultType="java.lang.Long">
@@ -237,9 +231,6 @@
       <if test="record.remark != null">
         remark = #{record.remark,jdbcType=VARCHAR},
       </if>
-      <if test="record.isRead != null">
-        is_read = #{record.isRead,jdbcType=VARCHAR},
-      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -257,8 +248,7 @@
       updated_by = #{record.updatedBy,jdbcType=VARCHAR},
       updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
       group_id = #{record.groupId,jdbcType=VARCHAR},
-      remark = #{record.remark,jdbcType=VARCHAR},
-      is_read = #{record.isRead,jdbcType=VARCHAR}
+      remark = #{record.remark,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -296,9 +286,6 @@
       <if test="remark != null">
         remark = #{remark,jdbcType=VARCHAR},
       </if>
-      <if test="isRead != null">
-        is_read = #{isRead,jdbcType=VARCHAR},
-      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -313,8 +300,7 @@
       updated_by = #{updatedBy,jdbcType=VARCHAR},
       updated_at = #{updatedAt,jdbcType=TIMESTAMP},
       group_id = #{groupId,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      is_read = #{isRead,jdbcType=VARCHAR}
+      remark = #{remark,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
-</mapper>
+</mapper>

+ 115 - 6
pro-base/src/main/resources/mybatis/flow2/FlowMainExtendMapper.xml

@@ -129,12 +129,6 @@
             <if test="entity.auditUser != null and entity.auditUser  !=''">
                 and flow_main_cc.cc_user = #{entity.auditUser}
             </if>
-            <if test="entity.isRead != null and entity.isRead != '' and entity.isRead  =='1'.toString()">
-                and flow_main_cc.is_read is null
-            </if>
-            <if test="entity.isRead != null and entity.isRead != '' and entity.isRead  =='2'.toString()">
-                and flow_main_cc.is_read = #{entity.isRead}
-            </if>
         </where>
         group by flow_main_cc.cc_user, flow_main_cc.flow_main_id) as tt
         LEFT JOIN
@@ -258,4 +252,119 @@
 
     </select>
 
+    <select id="toDolistByInfoById" parameterType="String" resultType="com.idea.oa.flow2.model.in.FlowMainIn">
+        SELECT
+        flow_main.*,
+        frame_user.truename as applyUserName,
+        sys_dept.dept_name as applyDeptName,
+        flow_main_push.push_user_key as pushUserKey,
+        flow_main_push.id as flowMainPushId,
+        case
+        flow_main.flow_status
+        when 1 then '审核中'
+        when 2 then '退回发起人'
+        when 3 then '已结束'
+        when 4 then '已撤回'
+        end as flowStatusString,
+        case  flow_main.flow_status when 1 then '' else (
+        CASE flow_main_log.audit_result WHEN '1' THEN '同意' WHEN '2' THEN '不同意驳回到申请人' WHEN '3' THEN '不同意驳回到上一个审核人' WHEN '4' THEN '委托别人进行审核'  WHEN '5' THEN '不同意且结束流程' END) end  AS auditResultString
+        FROM
+        flow_main_push
+        LEFT JOIN flow_main ON flow_main_push.flow_main_id = flow_main.id
+        LEFT JOIN frame_user ON frame_user.id = flow_main.apply_user
+        LEFT JOIN sys_dept ON sys_dept.id = frame_user.department
+        LEFT JOIN flow_main_log on flow_main_log.id=flow_main.last_main_log_id
+        WHERE flow_main_push.ID=#{id}
+    </select>
+
+
+<!--  特别定制(只对三资,解决集团分管领导不知道选哪个的问题)  -->
+    <select id="findFrameRoleDatasByUserId" parameterType="java.util.Map" resultType="com.rockstar.frame.model.FrameRoleData">
+        SELECT DISTINCT
+            frame_role_data.id,
+            frame_role_data.role_type,
+            frame_role_data.role_name,
+            frame_role_data.role_key
+                AS role_key,
+            frame_role_data.STATUS,
+            frame_role_data.comments,
+            frame_role_data.created_at,
+            frame_role_data.updated_at
+        FROM
+            frame_role_data_user
+                LEFT JOIN frame_role_data ON frame_role_data.id = frame_role_data_user.role_data_id
+                LEFT JOIN frame_user ON frame_user.id = frame_role_data_user.user_id
+        WHERE
+            (
+                        frame_role_data_user.user_id = #{userId}
+                    AND frame_role_data.role_type = #{roleType}
+
+                )
+    </select>
+    <select id="findFrameUsersByRoleKeyAndNoGroup2" parameterType="java.util.Map" resultType="com.rockstar.frame.model.FrameUser">
+        SELECT
+            frame_user.*
+        FROM
+            frame_role_data_user
+                LEFT JOIN frame_role_data ON frame_role_data.id = frame_role_data_user.role_data_id
+                LEFT JOIN frame_user ON frame_user.id = frame_role_data_user.user_id
+        WHERE
+            (
+                    CASE
+
+                        WHEN #{groupId} = '2356' THEN
+                            frame_role_data.role_key = 'thyjtfgld'
+                        WHEN #{groupId} = '2365' THEN
+                            frame_role_data.role_key = 'xsjjtfgld'
+                        WHEN #{groupId}= '2367' THEN
+                            frame_role_data.role_key = 'xjjjtfgld'
+                        WHEN #{groupId} = '806' THEN
+                            frame_role_data.role_key = 'lxjtfgld'
+                        WHEN #{groupId} = '807' THEN
+                            frame_role_data.role_key = 'xzxjtfgld'
+                        WHEN #{groupId} = '808' THEN
+                            frame_role_data.role_key = 'syjtfgld'
+                        WHEN #{groupId} = '809' THEN
+                            frame_role_data.role_key = 'sajtfgld'
+
+                        ELSE frame_role_data.role_key = 'xxxxxxx'
+                        END
+
+                    AND frame_role_data.role_type=#{roleType}
+                    AND frame_user.STATUS='1')
+    </select>
+
+    <select id="findFrameUsersByRoleKeyAndNoGroup3" parameterType="java.util.Map" resultType="com.rockstar.frame.model.FrameUser">
+        SELECT
+            frame_user.*
+        FROM
+            frame_role_data_user
+                LEFT JOIN frame_role_data ON frame_role_data.id = frame_role_data_user.role_data_id
+                LEFT JOIN frame_user ON frame_user.id = frame_role_data_user.user_id
+        WHERE
+            (
+                    CASE
+                        WHEN #{groupId}= '809' THEN
+                            frame_role_data.role_key = 'sazyld'
+                        WHEN #{groupId}= '2367' THEN
+                            frame_role_data.role_key = 'xjjzyld'
+                        WHEN #{groupId}= '807' THEN
+                            frame_role_data.role_key = 'xzxzyld'
+                        WHEN #{groupId}= '2356' THEN
+                            frame_role_data.role_key = 'thyzyld'
+                        WHEN #{groupId}= '2365' THEN
+                            frame_role_data.role_key = 'xsazyld'
+                        WHEN #{groupId}= '808' THEN
+                            frame_role_data.role_key = 'syzyld'
+                        WHEN #{groupId}= '806' THEN
+                            frame_role_data.role_key = 'lxzyld'
+                        WHEN #{groupId}= '800' THEN
+                            frame_role_data.role_key = 'sjjtzyld'
+
+                        ELSE frame_role_data.role_key = 'xxxxxxx'
+                        END
+
+                    AND frame_role_data.role_type=#{roleType}
+                    AND frame_user.STATUS='1')
+    </select>
 </mapper>

+ 17 - 5
pro-base/src/main/resources/mybatis/flow2/FlowMainLogMapper.xml

@@ -23,6 +23,7 @@
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
     <result column="group_id" jdbcType="VARCHAR" property="groupId" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="sign_file_id" jdbcType="VARCHAR" property="signFileId" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -85,7 +86,7 @@
   <sql id="Base_Column_List">
     id, flow_main_id, form_id, audit_user, audit_content, audit_result, audit_type, flow_type, 
     flow_post, flow_id, task_id, next_persons, up_main_log_id, cc_list, push_user_key, 
-    node_name, status, created_by, created_at, group_id, remark
+    node_name, status, created_by, created_at, group_id, remark,sign_file_id
   </sql>
   <select id="selectByExample" parameterType="com.idea.oa.flow2.model.FlowMainLogExample" resultMap="BaseResultMap">
     select
@@ -124,7 +125,7 @@
       flow_id, task_id, next_persons, 
       up_main_log_id, cc_list, push_user_key, 
       node_name, status, created_by, 
-      created_at, group_id, remark
+      created_at, group_id, remark,sign_file_id
       )
     values (#{id,jdbcType=VARCHAR}, #{flowMainId,jdbcType=VARCHAR}, #{formId,jdbcType=VARCHAR}, 
       #{auditUser,jdbcType=VARCHAR}, #{auditContent,jdbcType=VARCHAR}, #{auditResult,jdbcType=VARCHAR}, 
@@ -132,7 +133,7 @@
       #{flowId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{nextPersons,jdbcType=VARCHAR}, 
       #{upMainLogId,jdbcType=VARCHAR}, #{ccList,jdbcType=VARCHAR}, #{pushUserKey,jdbcType=VARCHAR}, 
       #{nodeName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, 
-      #{createdAt,jdbcType=TIMESTAMP}, #{groupId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}
+      #{createdAt,jdbcType=TIMESTAMP}, #{groupId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{signFileId,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.idea.oa.flow2.model.FlowMainLog">
@@ -201,6 +202,9 @@
       <if test="remark != null">
         remark,
       </if>
+      <if test="signFileId != null">
+        sign_file_id,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -266,6 +270,9 @@
       <if test="remark != null">
         #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="signFileId != null">
+        #{signFileId,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.oa.flow2.model.FlowMainLogExample" resultType="java.lang.Long">
@@ -367,7 +374,8 @@
       created_by = #{record.createdBy,jdbcType=VARCHAR},
       created_at = #{record.createdAt,jdbcType=TIMESTAMP},
       group_id = #{record.groupId,jdbcType=VARCHAR},
-      remark = #{record.remark,jdbcType=VARCHAR}
+      remark = #{record.remark,jdbcType=VARCHAR},
+      sign_file_id = #{record.signFileId,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -435,6 +443,9 @@
       <if test="remark != null">
         remark = #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="signFileId != null">
+        sign_file_id = #{signFileId,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -459,7 +470,8 @@
       created_by = #{createdBy,jdbcType=VARCHAR},
       created_at = #{createdAt,jdbcType=TIMESTAMP},
       group_id = #{groupId,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR}
+      remark = #{remark,jdbcType=VARCHAR},
+      sign_file_id = #{signFileId,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 49 - 32
pro-base/src/main/resources/mybatis/flow2/FlowMainPushMapper.xml

@@ -7,7 +7,6 @@
     <result column="form_id" jdbcType="VARCHAR" property="formId" />
     <result column="push_user" jdbcType="VARCHAR" property="pushUser" />
     <result column="push_user_key" jdbcType="VARCHAR" property="pushUserKey" />
-    <result column="node_name" jdbcType="VARCHAR" property="nodeName" />
     <result column="push_type" jdbcType="INTEGER" property="pushType" />
     <result column="push_role" jdbcType="INTEGER" property="pushRole" />
     <result column="flow_type" jdbcType="VARCHAR" property="flowType" />
@@ -22,6 +21,8 @@
     <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
     <result column="group_id" jdbcType="VARCHAR" property="groupId" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="node_name" jdbcType="VARCHAR" property="nodeName" />
+    <result column="node_user_role" jdbcType="VARCHAR" property="nodeUserRole" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -82,9 +83,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, flow_main_id, form_id, push_user, push_user_key, node_name, push_type, push_role, 
-    flow_type, flow_post, flow_id, task_id, up_main_log_id, status, created_by, created_at, 
-    updated_by, updated_at, group_id, remark
+    id, flow_main_id, form_id, push_user, push_user_key, push_type, push_role, flow_type, 
+    flow_post, flow_id, task_id, up_main_log_id, status, created_by, created_at, updated_by, 
+    updated_at, group_id, remark, node_name, node_user_role
   </sql>
   <select id="selectByExample" parameterType="com.idea.oa.flow2.model.FlowMainPushExample" resultMap="BaseResultMap">
     select
@@ -118,19 +119,21 @@
   </delete>
   <insert id="insert" parameterType="com.idea.oa.flow2.model.FlowMainPush">
     insert into flow_main_push (id, flow_main_id, form_id, 
-      push_user, push_user_key, node_name, 
-      push_type, push_role, flow_type, 
-      flow_post, flow_id, task_id, 
-      up_main_log_id, status, created_by, 
-      created_at, updated_by, updated_at, 
-      group_id, remark)
+      push_user, push_user_key, push_type, 
+      push_role, flow_type, flow_post, 
+      flow_id, task_id, up_main_log_id, 
+      status, created_by, created_at, 
+      updated_by, updated_at, group_id, 
+      remark, node_name, node_user_role
+      )
     values (#{id,jdbcType=VARCHAR}, #{flowMainId,jdbcType=VARCHAR}, #{formId,jdbcType=VARCHAR}, 
-      #{pushUser,jdbcType=VARCHAR}, #{pushUserKey,jdbcType=VARCHAR}, #{nodeName,jdbcType=VARCHAR}, 
-      #{pushType,jdbcType=INTEGER}, #{pushRole,jdbcType=INTEGER}, #{flowType,jdbcType=VARCHAR}, 
-      #{flowPost,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, 
-      #{upMainLogId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, 
-      #{createdAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, 
-      #{groupId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR})
+      #{pushUser,jdbcType=VARCHAR}, #{pushUserKey,jdbcType=VARCHAR}, #{pushType,jdbcType=INTEGER}, 
+      #{pushRole,jdbcType=INTEGER}, #{flowType,jdbcType=VARCHAR}, #{flowPost,jdbcType=VARCHAR}, 
+      #{flowId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{upMainLogId,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, 
+      #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{groupId,jdbcType=VARCHAR}, 
+      #{remark,jdbcType=VARCHAR}, #{nodeName,jdbcType=VARCHAR}, #{nodeUserRole,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.idea.oa.flow2.model.FlowMainPush">
     insert into flow_main_push
@@ -150,9 +153,6 @@
       <if test="pushUserKey != null">
         push_user_key,
       </if>
-      <if test="nodeName != null">
-        node_name,
-      </if>
       <if test="pushType != null">
         push_type,
       </if>
@@ -195,6 +195,12 @@
       <if test="remark != null">
         remark,
       </if>
+      <if test="nodeName != null">
+        node_name,
+      </if>
+      <if test="nodeUserRole != null">
+        node_user_role,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -212,9 +218,6 @@
       <if test="pushUserKey != null">
         #{pushUserKey,jdbcType=VARCHAR},
       </if>
-      <if test="nodeName != null">
-        #{nodeName,jdbcType=VARCHAR},
-      </if>
       <if test="pushType != null">
         #{pushType,jdbcType=INTEGER},
       </if>
@@ -257,6 +260,12 @@
       <if test="remark != null">
         #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="nodeName != null">
+        #{nodeName,jdbcType=VARCHAR},
+      </if>
+      <if test="nodeUserRole != null">
+        #{nodeUserRole,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.oa.flow2.model.FlowMainPushExample" resultType="java.lang.Long">
@@ -283,9 +292,6 @@
       <if test="record.pushUserKey != null">
         push_user_key = #{record.pushUserKey,jdbcType=VARCHAR},
       </if>
-      <if test="record.nodeName != null">
-        node_name = #{record.nodeName,jdbcType=VARCHAR},
-      </if>
       <if test="record.pushType != null">
         push_type = #{record.pushType,jdbcType=INTEGER},
       </if>
@@ -328,6 +334,12 @@
       <if test="record.remark != null">
         remark = #{record.remark,jdbcType=VARCHAR},
       </if>
+      <if test="record.nodeName != null">
+        node_name = #{record.nodeName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.nodeUserRole != null">
+        node_user_role = #{record.nodeUserRole,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -340,7 +352,6 @@
       form_id = #{record.formId,jdbcType=VARCHAR},
       push_user = #{record.pushUser,jdbcType=VARCHAR},
       push_user_key = #{record.pushUserKey,jdbcType=VARCHAR},
-      node_name = #{record.nodeName,jdbcType=VARCHAR},
       push_type = #{record.pushType,jdbcType=INTEGER},
       push_role = #{record.pushRole,jdbcType=INTEGER},
       flow_type = #{record.flowType,jdbcType=VARCHAR},
@@ -354,7 +365,9 @@
       updated_by = #{record.updatedBy,jdbcType=VARCHAR},
       updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
       group_id = #{record.groupId,jdbcType=VARCHAR},
-      remark = #{record.remark,jdbcType=VARCHAR}
+      remark = #{record.remark,jdbcType=VARCHAR},
+      node_name = #{record.nodeName,jdbcType=VARCHAR},
+      node_user_role = #{record.nodeUserRole,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -374,9 +387,6 @@
       <if test="pushUserKey != null">
         push_user_key = #{pushUserKey,jdbcType=VARCHAR},
       </if>
-      <if test="nodeName != null">
-        node_name = #{nodeName,jdbcType=VARCHAR},
-      </if>
       <if test="pushType != null">
         push_type = #{pushType,jdbcType=INTEGER},
       </if>
@@ -419,6 +429,12 @@
       <if test="remark != null">
         remark = #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="nodeName != null">
+        node_name = #{nodeName,jdbcType=VARCHAR},
+      </if>
+      <if test="nodeUserRole != null">
+        node_user_role = #{nodeUserRole,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -428,7 +444,6 @@
       form_id = #{formId,jdbcType=VARCHAR},
       push_user = #{pushUser,jdbcType=VARCHAR},
       push_user_key = #{pushUserKey,jdbcType=VARCHAR},
-      node_name = #{nodeName,jdbcType=VARCHAR},
       push_type = #{pushType,jdbcType=INTEGER},
       push_role = #{pushRole,jdbcType=INTEGER},
       flow_type = #{flowType,jdbcType=VARCHAR},
@@ -442,7 +457,9 @@
       updated_by = #{updatedBy,jdbcType=VARCHAR},
       updated_at = #{updatedAt,jdbcType=TIMESTAMP},
       group_id = #{groupId,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR}
+      remark = #{remark,jdbcType=VARCHAR},
+      node_name = #{nodeName,jdbcType=VARCHAR},
+      node_user_role = #{nodeUserRole,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>