diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfFlowsMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfFlowsMapper.java new file mode 100644 index 00000000..4710f34d --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfFlowsMapper.java @@ -0,0 +1,24 @@ +package com.zcloud.mapper.datasource.xgf; + +import java.util.List; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +/** + * 相关方人员审批信息列表(XgfFlows)表数据库访问层 + * + * @author liu jun + * @since 2024-01-19 12:24:00 + */ +public interface XgfFlowsMapper { + int save(PageData entity); + + int delete(PageData entity); + + int edit(PageData pd); + + List datalistPage(Page page); + + PageData findById(PageData condition); +} + diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index 47ee65ad..2e947dfa 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -26,4 +26,6 @@ public interface XgfUserService { List findRecordList(PageData condition) throws Exception; List getAppointApproveList(Page page); + + void approveAppoint(PageData request) throws Exception; } 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 2321c4db..1684043a 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.xgf.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.*; import com.zcloud.service.bus.CorpInfoService; import com.zcloud.service.system.DepartmentService; @@ -36,6 +37,12 @@ public class XgfUserServiceImpl implements XgfUserService { @Resource private FlowDetailMapper flowDetailMapper; + @Resource + private XgfFlowsMapper xgfFlowsMapper; + + @Resource + private CorpInfoMapper corpInfoMapper; + @Value("${preventionxgf.api.url}") private String prevention_xgf_url; @@ -70,7 +77,8 @@ public class XgfUserServiceImpl implements XgfUserService { x.put("XGF_USER_NAME", x.get("NAME")); x.put("VALID_FLAG", "1"); x.put("STATUS", "1"); - x.put("CHECK_STATUS","0"); + x.put("CHECK_STATUS", "0"); + x.put("CHECK_STEP", 1); x.put("CREATED_TIME", DateUtil.getTime()); x.put("OPERATOR_TIME", DateUtil.getTime()); x.put("IS_DELETE", "0"); @@ -117,7 +125,8 @@ public class XgfUserServiceImpl implements XgfUserService { x.put("IS_DELETE", "0"); x.put("VALID_FLAG", "1"); x.put("STATUS", "1"); - x.put("CHECK_STATUS","0"); + x.put("CHECK_STATUS", "0"); + x.put("CHECK_STEP", 1); if ("2".equals(x.getString("STUDY_STATUS"))) { x.put("STUDY_STATUS", "2"); } else { @@ -130,6 +139,43 @@ public class XgfUserServiceImpl implements XgfUserService { } /* 2、保存相关方人员流程审批信息 */ condition.clear(); + condition.put("FLOWS_ID", x.getString("USER_ID")); + PageData flows = xgfFlowsMapper.findById(condition); + if (flows == null || flows.size() <= 0) { + flows = new PageData(); + flows.put("FLOWS_ID", x.getString("USER_ID")); + flows.put("FLOWS_STEP", 1); + flows.put("FOREIGN_KEY_ID", x.getString("USER_ID")); + flows.put("FOREIGN_KEY_NAME", "xgf_user=>XGF_USER_ID"); + flows.put("APPOINT_ZERO_CORP_ID", x.getString("CORPINFO_ID")); + condition.clear(); + condition.put("CORPINFO_ID", x.getString("CORPINFO_ID")); + PageData corpInfo = corpInfoMapper.findById(condition); + if (corpInfo != null && corpInfo.size() > 0) { + flows.put("APPOINT_ZERO_CORP_NAME", corpInfo.getString("NAME")); + } + flows.put("APPOINT_ZERO_DEPARTMENT_ID", x.getString("APPOINT_ZERO_DEPARTMENT_ID")); + flows.put("APPOINT_ZERO_DEPARTMENT_NAME", x.getString("APPOINT_ZERO_DEPARTMENT_NAME")); + flows.put("APPOINT_ZERO_USER_ID", x.getString("APPOINT_ZERO_USER_ID")); + flows.put("APPOINT_ZERO_USER_NAME", x.getString("APPOINT_ZERO_USER_NAME")); + xgfFlowsMapper.save(flows); + } else { + flows.put("APPOINT_ZERO_CORP_ID", x.getString("CORPINFO_ID")); + flows.put("FLOWS_STEP", 1); + condition.clear(); + condition.put("CORPINFO_ID", x.getString("CORPINFO_ID")); + PageData corpInfo = corpInfoMapper.findById(condition); + if (corpInfo != null && corpInfo.size() > 0) { + flows.put("APPOINT_ZERO_CORP_NAME", corpInfo.getString("NAME")); + } + flows.put("APPOINT_ZERO_DEPARTMENT_ID", x.getString("APPOINT_ZERO_DEPARTMENT_ID")); + flows.put("APPOINT_ZERO_DEPARTMENT_NAME", x.getString("APPOINT_ZERO_DEPARTMENT_NAME")); + flows.put("APPOINT_ZERO_USER_ID", x.getString("APPOINT_ZERO_USER_ID")); + flows.put("APPOINT_ZERO_USER_NAME", x.getString("APPOINT_ZERO_USER_NAME")); + xgfFlowsMapper.edit(flows); + } + /* 3、流程记录 */ + condition.clear(); condition.put("FOREIGN_KEY", x.getString("XGF_USER_ID")); condition.put("TYPE", "1"); condition.put("VALID_FLAG", "1"); @@ -227,19 +273,8 @@ public class XgfUserServiceImpl implements XgfUserService { if ("1".equals(request.getString("STATUS"))) { entity.put("STATUS", "1"); entity.put("VALID_FLAG", "1"); - entity.put("CHECK_STATUS","1"); - condition.clear(); - condition.put("XFG_USER_DETAILS_ID", x); - PageData userInfo = xgfUserDetailsMapper.findById(condition); - if (userInfo == null || userInfo.size() == 0) { - throw new RuntimeException("未找到该用户详细信息"); - } - // 企业端人员审核完成后,指定企业端监管部门,中的某人进行审核 - userInfo.put("APPOINT_DEPARTMENT_ID", request.getString("APPOINT_DEPARTMENT_ID")); - userInfo.put("APPOINT_DEPARTMENT_NAME", request.getString("APPOINT_DEPARTMENT_NAME")); - userInfo.put("APPOINT_USER_ID", request.getString("APPOINT_USER_ID")); - userInfo.put("APPOINT_USER_NAME", request.getString("APPOINT_USER_NAME")); - xgfUserDetailsMapper.edit(userInfo); + entity.put("CHECK_STATUS", "1"); + entity.put("CHECK_STEP", 2); } else { entity.put("STATUS", "0"); PageData key = new PageData(); @@ -250,15 +285,33 @@ public class XgfUserServiceImpl implements XgfUserService { if (result == null || !"succeed".equals(result.get("result"))) { throw new RuntimeException("请求失败"); } + } + /* 保存审批信息 */ + condition.clear(); + condition.put("FLOWS_ID", x); + PageData flows = xgfFlowsMapper.findById(condition); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("未找到该用户详细信息"); + } + condition.clear(); + condition.put("STATUS", request.getString("STATUS")); + condition.put("APPOINT_CORP_ID", request.getString("APPOINT_CORP_ID")); + condition.put("APPOINT_CORP_NAME", request.getString("APPOINT_CORP_NAME")); + condition.put("APPOINT_DEPARTMENT_ID", request.getString("APPOINT_DEPARTMENT_ID")); + 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")); + handle(condition, flows); + xgfUserMapper.edit(entity); - /* 保存审批流程明细信息 */ + /* 保存审批记录 */ condition.clear(); condition.put("FOREIGN_KEY", entity.getString("XGF_USER_ID")); condition.put("TYPE", "1"); condition.put("VALID_FLAG", "1"); PageData flow = flowMapper.findByCondition(condition); - if (flow == null || flow.size() == 0){ + if (flow == null || flow.size() == 0) { throw new RuntimeException("未找到该用户审批流程"); } condition.clear(); @@ -274,7 +327,12 @@ public class XgfUserServiceImpl implements XgfUserService { nextNode.put("APPROVER_NAME", Jurisdiction.getName()); nextNode.put("APPROVER_TIME", DateUtil.getTime()); nextNode.put("APPROVER_CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - nextNode.put("APPROVER_CORPINFO_NAME", ""); + condition.clear(); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corpInfo = corpInfoMapper.findById(condition); + if (corpInfo != null && corpInfo.size() > 0) { + nextNode.put("APPROVER_CORPINFO_NAME", corpInfo.getString("NAME")); + } nextNode.put("PASS_FLAG", request.getString("STATUS")); nextNode.put("END_FLAG", "0"); nextNode.put("ISDELETE", "0"); @@ -299,10 +357,157 @@ public class XgfUserServiceImpl implements XgfUserService { public List getAppointApproveList(Page page) { List list = xgfUserMapper.appointlistPage(page); for (PageData x : list) { - if (StringUtils.isNotBlank(x.getString("APPOINT_USER_ID"))) { - // TODO 判断当前人是否有权限审批 - } + x.put("power_flag", getPower(x)); } return list; } + + @Override + public void approveAppoint(PageData request) throws Exception { + PageData condition = new PageData(); + condition.put("XGF_USER_ID",request.getString("XGF_USER_ID")); + PageData userInfo = xgfUserMapper.findById(condition); + if (userInfo == null || userInfo.size() == 0) { + throw new RuntimeException("未找到该用户"); + } + condition.clear(); + condition.put("FLOWS_ID", userInfo.getString("XGF_USER_ID")); + PageData flows = xgfFlowsMapper.findById(condition); + if (flows == null || flows.size() == 0) { + throw new RuntimeException("未找到该用户详审批信息"); + } + handle(request,flows); + } + + /* 获取当前用户是否有权限审批 */ + private String getPower(PageData x) { + switch (Integer.parseInt(x.get("CHECK_STEP").toString())) { + case 1: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_ONE_USER_ID"))) { + return "1"; + } + case 2: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_TWO_USER_ID"))) { + return "1"; + } + case 3: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_THREE_USER_ID"))) { + return "1"; + } + case 4: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_FOUR_USER_ID"))) { + return "1"; + } + case 5: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_FIVE_USER_ID"))) { + return "1"; + } + case 6: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_SIX_USER_ID"))) { + return "1"; + } + case 7: + if (Jurisdiction.getUSER_ID().equals(x.getString("APPOINT_SEVEN_USER_ID"))) { + return "1"; + } + default: + return "0"; + } + } + + void handle(PageData info, PageData flows) throws Exception{ + switch (Integer.parseInt(flows.get("FLOWS_STEP").toString())) { + case 1: + flows.put("APPOINT_ONE_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_ONE_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_ONE_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_ONE_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_ONE_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_ONE_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_ONE_TIME", DateUtil.getTime()); + flows.put("APPOINT_ONE_STATUS", info.getString("STATUS")); + flows.put("APPOINT_ONE_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 2); + xgfFlowsMapper.edit(flows); + break; + case 2: + flows.put("APPOINT_TWO_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_TWO_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_TWO_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_TWO_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_TWO_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_TWO_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_TWO_TIME", DateUtil.getTime()); + flows.put("APPOINT_TWO_STATUS", info.getString("STATUS")); + flows.put("APPOINT_TWO_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 3); + xgfFlowsMapper.edit(flows); + break; + case 3: + flows.put("APPOINT_THREE_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_THREE_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_THREE_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_THREE_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_THREE_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_THREE_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_THREE_TIME", DateUtil.getTime()); + flows.put("APPOINT_THREE_STATUS", info.getString("STATUS")); + flows.put("APPOINT_THREE_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 4); + xgfFlowsMapper.edit(flows); + break; + case 4: + flows.put("APPOINT_FOUR_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_FOUR_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_FOUR_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_FOUR_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_FOUR_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_FOUR_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_FOUR_TIME", DateUtil.getTime()); + flows.put("APPOINT_FOUR_STATUS", info.getString("STATUS")); + flows.put("APPOINT_FOUR_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 5); + xgfFlowsMapper.edit(flows); + break; + case 5: + flows.put("APPOINT_FIVE_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_FIVE_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_FIVE_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_FIVE_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_FIVE_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_FIVE_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_FIVE_TIME", DateUtil.getTime()); + flows.put("APPOINT_FIVE_STATUS", info.getString("STATUS")); + flows.put("APPOINT_FIVE_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 6); + xgfFlowsMapper.edit(flows); + break; + case 6: + flows.put("APPOINT_SIX_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_SIX_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_SIX_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_SIX_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_SIX_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_SIX_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_SIX_TIME", DateUtil.getTime()); + flows.put("APPOINT_SIX_STATUS", info.getString("STATUS")); + flows.put("APPOINT_SIX_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 7); + xgfFlowsMapper.edit(flows); + break; + case 7: + flows.put("APPOINT_SEVEN_CORP_ID", info.getString("APPOINT_CORP_ID")); + flows.put("APPOINT_SEVEN_CORP_NAME", info.getString("APPOINT_CORP_NAME")); + flows.put("APPOINT_SEVEN_DEPARTMENT_ID", info.getString("APPOINT_DEPARTMENT_ID")); + flows.put("APPOINT_SEVEN_DEPARTMENT_NAME", info.getString("APPOINT_DEPARTMENT_NAME")); + flows.put("APPOINT_SEVEN_USER_ID", info.getString("APPOINT_USER_ID")); + flows.put("APPOINT_SEVEN_USER_NAME", info.getString("APPOINT_USER_NAME")); + flows.put("APPOINT_SEVEN_TIME", DateUtil.getTime()); + flows.put("APPOINT_SEVEN_STATUS", info.getString("STATUS")); + flows.put("APPOINT_SEVEN_OPINION", info.getString("OPINION")); + flows.put("FLOWS_STEP", 8); + xgfFlowsMapper.edit(flows); + break; + } + } } diff --git a/src/main/resources/mybatis/datasource/xgf/XgfFlowsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfFlowsMapper.xml new file mode 100644 index 00000000..a9f52371 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/XgfFlowsMapper.xml @@ -0,0 +1,336 @@ + + + + + + xgf_flows + + + + f.FLOWS_ID, + f.FOREIGN_KEY_ID, + f.FOREIGN_KEY_NAME, + f.FLOWS_STEP, + f.IS_DELETE, + f.APPOINT_ZERO_CORP_ID, + f.APPOINT_ZERO_CORP_TYEP, + f.APPOINT_ZERO_CORP_NAME, + f.APPOINT_ZERO_DEPARTMENT_ID, + f.APPOINT_ZERO_DEPARTMENT_NAME, + f.APPOINT_ZERO_USER_ID, + f.APPOINT_ZERO_USER_NAME, + f.APPOINT_ZERO_STATUS, + f.APPOINT_ZERO_OPINION, + f.APPOINT_ZERO_TIME, + f.APPOINT_ONE_CORP_ID, + f.APPOINT_ONE_CORP_NAME, + f.APPOINT_ONE_CORP_TYEP, + f.APPOINT_ONE_DEPARTMENT_ID, + f.APPOINT_ONE_DEPARTMENT_NAME, + f.APPOINT_ONE_USER_ID, + f.APPOINT_ONE_USER_NAME, + f.APPOINT_ONE_STATUS, + f.APPOINT_ONE_OPINION, + f.APPOINT_ONE_TIME, + f.APPOINT_TWO_CORP_ID, + f.APPOINT_TWO_CORP_NAME, + f.APPOINT_TWO_DEPARTMENT_ID, + f.APPOINT_TWO_DEPARTMENT_NAME, + f.APPOINT_TWO_USER_ID, + f.APPOINT_TWO_USER_NAME, + f.APPOINT_TWO_TIME, + f.APPOINT_THREE_CORP_ID, + f.APPOINT_THREE_CORP_NAME, + f.APPOINT_THREE_DEPARTMENT_ID, + f.APPOINT_THREE_DEPARTMENT_NAME, + f.APPOINT_THREE_USER_ID, + f.APPOINT_THREE_USER_NAME, + f.APPOINT_THREE_STATUS, + f.APPOINT_THREE_OPINION, + f.APPOINT_THREE_TIME, + f.APPOINT_FOUR_CORP_ID, + f.APPOINT_FOUR_CORP_NAME, + f.APPOINT_FOUR_DEPARTMENT_ID, + f.APPOINT_FOUR_DEPARTMENT_NAME, + f.APPOINT_FOUR_USER_ID, + f.APPOINT_FOUR_USER_NAME, + f.APPOINT_FOUR_STATUS, + f.APPOINT_FOUR_OPINION, + f.APPOINT_FIVE_CORP_ID, + f.APPOINT_FIVE_CORP_NAME, + f.APPOINT_FIVE_DEPARTMENT_ID, + f.APPOINT_FIVE_DEPARTMENT_NAME, + f.APPOINT_FIVE_USER_ID, + f.APPOINT_FIVE_USER_NAME, + f.APPOINT_FIVE_STATUS, + f.APPOINT_FIVE_OPINION, + f.APPOINT_SIX_CORP_ID, + f.APPOINT_SIX_CORP_NAME, + f.APPOINT_SIX_DEPARTMENT_ID, + f.APPOINT_SIX_DEPARTMENT_NAME, + f.APPOINT_SIX_USER_ID, + f.APPOINT_SIX_USER_NAME, + f.APPOINT_SIX_STATUS, + f.APPOINT_SIX_OPINION, + f.APPOINT_SEVEN_CORP_ID, + f.APPOINT_SEVEN_CORP_NAME, + f.APPOINT_SEVEN_DEPARTMENT_ID, + f.APPOINT_SEVEN_DEPARTMENT_NAME, + f.APPOINT_SEVEN_USER_ID, + f.APPOINT_SEVEN_USER_NAME, + f.APPOINT_SEVEN_STATUS, + f.APPOINT_SEVEN_OPINION + + + + FLOWS_ID, + FOREIGN_KEY_ID, + FOREIGN_KEY_NAME, + FLOWS_STEP, + IS_DELETE, + APPOINT_ZERO_CORP_ID, + APPOINT_ZERO_CORP_TYEP, + APPOINT_ZERO_CORP_NAME, + APPOINT_ZERO_DEPARTMENT_ID, + APPOINT_ZERO_DEPARTMENT_NAME, + APPOINT_ZERO_USER_ID, + APPOINT_ZERO_USER_NAME, + APPOINT_ZERO_STATUS, + APPOINT_ZERO_OPINION, + APPOINT_ZERO_TIME, + APPOINT_ONE_CORP_ID, + APPOINT_ONE_CORP_NAME, + APPOINT_ONE_CORP_TYEP, + APPOINT_ONE_DEPARTMENT_ID, + APPOINT_ONE_DEPARTMENT_NAME, + APPOINT_ONE_USER_ID, + APPOINT_ONE_USER_NAME, + APPOINT_ONE_STATUS, + APPOINT_ONE_OPINION, + APPOINT_ONE_TIME, + APPOINT_TWO_CORP_ID, + APPOINT_TWO_CORP_NAME, + APPOINT_TWO_DEPARTMENT_ID, + APPOINT_TWO_DEPARTMENT_NAME, + APPOINT_TWO_USER_ID, + APPOINT_TWO_USER_NAME, + APPOINT_TWO_TIME, + APPOINT_THREE_CORP_ID, + APPOINT_THREE_CORP_NAME, + APPOINT_THREE_DEPARTMENT_ID, + APPOINT_THREE_DEPARTMENT_NAME, + APPOINT_THREE_USER_ID, + APPOINT_THREE_USER_NAME, + APPOINT_THREE_STATUS, + APPOINT_THREE_OPINION, + APPOINT_THREE_TIME, + APPOINT_FOUR_CORP_ID, + APPOINT_FOUR_CORP_NAME, + APPOINT_FOUR_DEPARTMENT_ID, + APPOINT_FOUR_DEPARTMENT_NAME, + APPOINT_FOUR_USER_ID, + APPOINT_FOUR_USER_NAME, + APPOINT_FOUR_STATUS, + APPOINT_FOUR_OPINION, + APPOINT_FIVE_CORP_ID, + APPOINT_FIVE_CORP_NAME, + APPOINT_FIVE_DEPARTMENT_ID, + APPOINT_FIVE_DEPARTMENT_NAME, + APPOINT_FIVE_USER_ID, + APPOINT_FIVE_USER_NAME, + APPOINT_FIVE_STATUS, + APPOINT_FIVE_OPINION, + APPOINT_SIX_CORP_ID, + APPOINT_SIX_CORP_NAME, + APPOINT_SIX_DEPARTMENT_ID, + APPOINT_SIX_DEPARTMENT_NAME, + APPOINT_SIX_USER_ID, + APPOINT_SIX_USER_NAME, + APPOINT_SIX_STATUS, + APPOINT_SIX_OPINION, + APPOINT_SEVEN_CORP_ID, + APPOINT_SEVEN_CORP_NAME, + APPOINT_SEVEN_DEPARTMENT_ID, + APPOINT_SEVEN_DEPARTMENT_NAME, + APPOINT_SEVEN_USER_ID, + APPOINT_SEVEN_USER_NAME, + APPOINT_SEVEN_STATUS, + APPOINT_SEVEN_OPINION + + + + #{FLOWS_ID}, + #{FOREIGN_KEY_ID}, + #{FOREIGN_KEY_NAME}, + #{FLOWS_STEP}, + #{IS_DELETE}, + #{APPOINT_ZERO_CORP_ID}, + #{APPOINT_ZERO_CORP_TYEP}, + #{APPOINT_ZERO_CORP_NAME}, + #{APPOINT_ZERO_DEPARTMENT_ID}, + #{APPOINT_ZERO_DEPARTMENT_NAME}, + #{APPOINT_ZERO_USER_ID}, + #{APPOINT_ZERO_USER_NAME}, + #{APPOINT_ZERO_STATUS}, + #{APPOINT_ZERO_OPINION}, + #{APPOINT_ZERO_TIME}, + #{APPOINT_ONE_CORP_ID}, + #{APPOINT_ONE_CORP_NAME}, + #{APPOINT_ONE_CORP_TYEP}, + #{APPOINT_ONE_DEPARTMENT_ID}, + #{APPOINT_ONE_DEPARTMENT_NAME}, + #{APPOINT_ONE_USER_ID}, + #{APPOINT_ONE_USER_NAME}, + #{APPOINT_ONE_STATUS}, + #{APPOINT_ONE_OPINION}, + #{APPOINT_ONE_TIME}, + #{APPOINT_TWO_CORP_ID}, + #{APPOINT_TWO_CORP_NAME}, + #{APPOINT_TWO_DEPARTMENT_ID}, + #{APPOINT_TWO_DEPARTMENT_NAME}, + #{APPOINT_TWO_USER_ID}, + #{APPOINT_TWO_USER_NAME}, + #{APPOINT_TWO_TIME}, + #{APPOINT_THREE_CORP_ID}, + #{APPOINT_THREE_CORP_NAME}, + #{APPOINT_THREE_DEPARTMENT_ID}, + #{APPOINT_THREE_DEPARTMENT_NAME}, + #{APPOINT_THREE_USER_ID}, + #{APPOINT_THREE_USER_NAME}, + #{APPOINT_THREE_STATUS}, + #{APPOINT_THREE_OPINION}, + #{APPOINT_THREE_TIME}, + #{APPOINT_FOUR_CORP_ID}, + #{APPOINT_FOUR_CORP_NAME}, + #{APPOINT_FOUR_DEPARTMENT_ID}, + #{APPOINT_FOUR_DEPARTMENT_NAME}, + #{APPOINT_FOUR_USER_ID}, + #{APPOINT_FOUR_USER_NAME}, + #{APPOINT_FOUR_STATUS}, + #{APPOINT_FOUR_OPINION}, + #{APPOINT_FIVE_CORP_ID}, + #{APPOINT_FIVE_CORP_NAME}, + #{APPOINT_FIVE_DEPARTMENT_ID}, + #{APPOINT_FIVE_DEPARTMENT_NAME}, + #{APPOINT_FIVE_USER_ID}, + #{APPOINT_FIVE_USER_NAME}, + #{APPOINT_FIVE_STATUS}, + #{APPOINT_FIVE_OPINION}, + #{APPOINT_SIX_CORP_ID}, + #{APPOINT_SIX_CORP_NAME}, + #{APPOINT_SIX_DEPARTMENT_ID}, + #{APPOINT_SIX_DEPARTMENT_NAME}, + #{APPOINT_SIX_USER_ID}, + #{APPOINT_SIX_USER_NAME}, + #{APPOINT_SIX_STATUS}, + #{APPOINT_SIX_OPINION}, + #{APPOINT_SEVEN_CORP_ID}, + #{APPOINT_SEVEN_CORP_NAME}, + #{APPOINT_SEVEN_DEPARTMENT_ID}, + #{APPOINT_SEVEN_DEPARTMENT_NAME}, + #{APPOINT_SEVEN_USER_ID}, + #{APPOINT_SEVEN_USER_NAME}, + #{APPOINT_SEVEN_STATUS}, + #{APPOINT_SEVEN_OPINION} + + + + + insert into xgf_flows () values () + + + + + delete from xgf_flows where FLOWS_ID = #{FLOWS_ID} + + + + + update xgf_flows set + FLOWS_ID = #{FLOWS_ID}, + FOREIGN_KEY_ID = #{FOREIGN_KEY_ID}, + FOREIGN_KEY_NAME = #{FOREIGN_KEY_NAME}, + FLOWS_STEP = #{FLOWS_STEP}, + IS_DELETE = #{IS_DELETE}, + APPOINT_ZERO_CORP_ID = #{APPOINT_ZERO_CORP_ID}, + APPOINT_ZERO_CORP_TYEP = #{APPOINT_ZERO_CORP_TYEP}, + APPOINT_ZERO_CORP_NAME = #{APPOINT_ZERO_CORP_NAME}, + APPOINT_ZERO_DEPARTMENT_ID = #{APPOINT_ZERO_DEPARTMENT_ID}, + APPOINT_ZERO_DEPARTMENT_NAME = #{APPOINT_ZERO_DEPARTMENT_NAME}, + APPOINT_ZERO_USER_ID = #{APPOINT_ZERO_USER_ID}, + APPOINT_ZERO_USER_NAME = #{APPOINT_ZERO_USER_NAME}, + APPOINT_ZERO_STATUS = #{APPOINT_ZERO_STATUS}, + APPOINT_ZERO_OPINION = #{APPOINT_ZERO_OPINION}, + APPOINT_ZERO_TIME = #{APPOINT_ZERO_TIME}, + APPOINT_ONE_CORP_ID = #{APPOINT_ONE_CORP_ID}, + APPOINT_ONE_CORP_NAME = #{APPOINT_ONE_CORP_NAME}, + APPOINT_ONE_CORP_TYEP = #{APPOINT_ONE_CORP_TYEP}, + APPOINT_ONE_DEPARTMENT_ID = #{APPOINT_ONE_DEPARTMENT_ID}, + APPOINT_ONE_DEPARTMENT_NAME = #{APPOINT_ONE_DEPARTMENT_NAME}, + APPOINT_ONE_USER_ID = #{APPOINT_ONE_USER_ID}, + APPOINT_ONE_USER_NAME = #{APPOINT_ONE_USER_NAME}, + APPOINT_ONE_STATUS = #{APPOINT_ONE_STATUS}, + APPOINT_ONE_OPINION = #{APPOINT_ONE_OPINION}, + APPOINT_ONE_TIME = #{APPOINT_ONE_TIME}, + APPOINT_TWO_CORP_ID = #{APPOINT_TWO_CORP_ID}, + APPOINT_TWO_CORP_NAME = #{APPOINT_TWO_CORP_NAME}, + APPOINT_TWO_DEPARTMENT_ID = #{APPOINT_TWO_DEPARTMENT_ID}, + APPOINT_TWO_DEPARTMENT_NAME = #{APPOINT_TWO_DEPARTMENT_NAME}, + APPOINT_TWO_USER_ID = #{APPOINT_TWO_USER_ID}, + APPOINT_TWO_USER_NAME = #{APPOINT_TWO_USER_NAME}, + APPOINT_TWO_TIME = #{APPOINT_TWO_TIME}, + APPOINT_THREE_CORP_ID = #{APPOINT_THREE_CORP_ID}, + APPOINT_THREE_CORP_NAME = #{APPOINT_THREE_CORP_NAME}, + APPOINT_THREE_DEPARTMENT_ID = #{APPOINT_THREE_DEPARTMENT_ID}, + APPOINT_THREE_DEPARTMENT_NAME = #{APPOINT_THREE_DEPARTMENT_NAME}, + APPOINT_THREE_USER_ID = #{APPOINT_THREE_USER_ID}, + APPOINT_THREE_USER_NAME = #{APPOINT_THREE_USER_NAME}, + APPOINT_THREE_STATUS = #{APPOINT_THREE_STATUS}, + APPOINT_THREE_OPINION = #{APPOINT_THREE_OPINION}, + APPOINT_THREE_TIME = #{APPOINT_THREE_TIME}, + APPOINT_FOUR_CORP_ID = #{APPOINT_FOUR_CORP_ID}, + APPOINT_FOUR_CORP_NAME = #{APPOINT_FOUR_CORP_NAME}, + APPOINT_FOUR_DEPARTMENT_ID = #{APPOINT_FOUR_DEPARTMENT_ID}, + APPOINT_FOUR_DEPARTMENT_NAME = #{APPOINT_FOUR_DEPARTMENT_NAME}, + APPOINT_FOUR_USER_ID = #{APPOINT_FOUR_USER_ID}, + APPOINT_FOUR_USER_NAME = #{APPOINT_FOUR_USER_NAME}, + APPOINT_FOUR_STATUS = #{APPOINT_FOUR_STATUS}, + APPOINT_FOUR_OPINION = #{APPOINT_FOUR_OPINION}, + APPOINT_FIVE_CORP_ID = #{APPOINT_FIVE_CORP_ID}, + APPOINT_FIVE_CORP_NAME = #{APPOINT_FIVE_CORP_NAME}, + APPOINT_FIVE_DEPARTMENT_ID = #{APPOINT_FIVE_DEPARTMENT_ID}, + APPOINT_FIVE_DEPARTMENT_NAME = #{APPOINT_FIVE_DEPARTMENT_NAME}, + APPOINT_FIVE_USER_ID = #{APPOINT_FIVE_USER_ID}, + APPOINT_FIVE_USER_NAME = #{APPOINT_FIVE_USER_NAME}, + APPOINT_FIVE_STATUS = #{APPOINT_FIVE_STATUS}, + APPOINT_FIVE_OPINION = #{APPOINT_FIVE_OPINION}, + APPOINT_SIX_CORP_ID = #{APPOINT_SIX_CORP_ID}, + APPOINT_SIX_CORP_NAME = #{APPOINT_SIX_CORP_NAME}, + APPOINT_SIX_DEPARTMENT_ID = #{APPOINT_SIX_DEPARTMENT_ID}, + APPOINT_SIX_DEPARTMENT_NAME = #{APPOINT_SIX_DEPARTMENT_NAME}, + APPOINT_SIX_USER_ID = #{APPOINT_SIX_USER_ID}, + APPOINT_SIX_USER_NAME = #{APPOINT_SIX_USER_NAME}, + APPOINT_SIX_STATUS = #{APPOINT_SIX_STATUS}, + APPOINT_SIX_OPINION = #{APPOINT_SIX_OPINION}, + APPOINT_SEVEN_CORP_ID = #{APPOINT_SEVEN_CORP_ID}, + APPOINT_SEVEN_CORP_NAME = #{APPOINT_SEVEN_CORP_NAME}, + APPOINT_SEVEN_DEPARTMENT_ID = #{APPOINT_SEVEN_DEPARTMENT_ID}, + APPOINT_SEVEN_DEPARTMENT_NAME = #{APPOINT_SEVEN_DEPARTMENT_NAME}, + APPOINT_SEVEN_USER_ID = #{APPOINT_SEVEN_USER_ID}, + APPOINT_SEVEN_USER_NAME = #{APPOINT_SEVEN_USER_NAME}, + APPOINT_SEVEN_STATUS = #{APPOINT_SEVEN_STATUS}, + APPOINT_SEVEN_OPINION = #{APPOINT_SEVEN_OPINION} + where a.FLOWS_ID = #{FLOWS_ID} + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml index 3115441f..0c1343c9 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -63,18 +63,7 @@ f.IS_BF, f.IS_SOCIAL, f.SOCIAL_NUMBER, - f.zzName, - f.APPOINT_DEPARTMENT_ID, - f.APPOINT_DEPARTMENT_NAME, - f.APPOINT_USER_ID, - f.APPOINT_USER_NAME, - f.APPOINT_ONE_CORP_ID, - f.APPOINT_ONE_CORP_NAME, - f.APPOINT_ONE_DEPARTMENT_ID, - f.APPOINT_ONE_DEPARTMENT_NAME, - f.APPOINT_ONE_USER_ID, - f.APPOINT_ONE_USER_NAME - + f.zzName @@ -133,17 +122,7 @@ IS_BF, IS_SOCIAL, SOCIAL_NUMBER, - zzName, - APPOINT_DEPARTMENT_ID, - APPOINT_DEPARTMENT_NAME, - APPOINT_USER_ID, - APPOINT_USER_NAME, - APPOINT_ONE_CORP_ID, - APPOINT_ONE_CORP_NAME, - APPOINT_ONE_DEPARTMENT_ID, - APPOINT_ONE_DEPARTMENT_NAME, - APPOINT_ONE_USER_ID, - APPOINT_ONE_USER_NAME + zzName @@ -202,17 +181,7 @@ #{IS_BF}, #{IS_SOCIAL}, #{SOCIAL_NUMBER}, - #{zzName}, - #{APPOINT_DEPARTMENT_ID}, - #{APPOINT_DEPARTMENT_NAME}, - #{APPOINT_USER_ID}, - #{APPOINT_USER_NAME}, - #{APPOINT_ONE_CORP_ID}, - #{APPOINT_ONE_CORP_NAME}, - #{APPOINT_ONE_DEPARTMENT_ID}, - #{APPOINT_ONE_DEPARTMENT_NAME}, - #{APPOINT_ONE_USER_ID}, - #{APPOINT_ONE_USER_NAME} + #{zzName} @@ -295,17 +264,7 @@ IS_BF = #{IS_BF}, IS_SOCIAL = #{IS_SOCIAL}, SOCIAL_NUMBER = #{SOCIAL_NUMBER}, - zzName = #{zzName}, - APPOINT_DEPARTMENT_ID = #{APPOINT_DEPARTMENT_ID}, - APPOINT_DEPARTMENT_NAME = #{APPOINT_DEPARTMENT_NAME}, - APPOINT_USER_ID = #{APPOINT_USER_ID}, - APPOINT_USER_NAME = #{APPOINT_USER_NAME}, - APPOINT_ONE_CORP_ID = #{APPOINT_ONE_CORP_ID}, - APPOINT_ONE_CORP_NAME = #{APPOINT_ONE_CORP_NAME}, - APPOINT_ONE_DEPARTMENT_ID = #{APPOINT_ONE_DEPARTMENT_ID}, - APPOINT_ONE_DEPARTMENT_NAME = #{APPOINT_ONE_DEPARTMENT_NAME}, - APPOINT_ONE_USER_ID = #{APPOINT_ONE_USER_ID}, - APPOINT_ONE_USER_NAME = #{APPOINT_ONE_USER_NAME} + zzName = #{zzName} where XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID} diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 78e7a597..9a021c38 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -22,7 +22,8 @@ f.OPERATOR_TIME, f.ISFLOW, f.STUDY_STATUS, - f.CHECK_STATUS + f.CHECK_STATUS, + f.CHECK_STEP @@ -40,7 +41,8 @@ OPERATOR_TIME, ISFLOW, STUDY_STATUS, - CHECK_STATUS + CHECK_STATUS, + CHECK_STEP @@ -58,7 +60,8 @@ #{OPERATOR_TIME}, #{ISFLOW}, #{STUDY_STATUS}, - #{CHECK_STATUS} + #{CHECK_STATUS}, + #{CHECK_STEP} @@ -99,7 +102,8 @@ OPERATOR_TIME = #{OPERATOR_TIME}, ISFLOW = #{ISFLOW}, STUDY_STATUS = #{STUDY_STATUS}, - CHECK_STATUS = #{CHECK_STATUS} + CHECK_STATUS = #{CHECK_STATUS}, + CHECK_STEP = #{CHECK_STEP} where XGF_USER_ID = #{XGF_USER_ID} @@ -321,15 +325,18 @@ a.BELONG_TO_CORP_NAME, a.USERNAME, a.NAME, - b.MANAGER_DEPARTMENT_ID, - b.MANAGER_DEPARTMENT_NAME, - b.MAIN_DEPARTMENT_ID, - b.MAIN_DEPARTMENT_NAME - from - xgf_user a - left join xgf_user_details b on a.XGF_USER_ID = b.XGF_USER_ID + c.* + from xgf_user a + left join xgf_flows c on a.XGF_USER_ID = c.FLOWS_ID where a.IS_DELETE = '0' - and (a.APPOINT_USER_ID = #{pd.USER_ID} or a.APPOINT_ONE_USER_ID is #{pd.USER_ID}) + and (c.APPOINT_ONE_USER_ID = #{pd.USER_ID} + or c.APPOINT_TWO_USER_ID = #{pd.USER_ID} + or c.APPOINT_THREE_USER_ID = #{pd.USER_ID} + or c.APPOINT_FOUR_USER_ID = #{pd.USER_ID} + or c.APPOINT_FIVE_USER_ID = #{pd.USER_ID} + or c.APPOINT_SIX_USER_ID = #{pd.USER_ID} + or c.APPOINT_SEVEN_USER_ID = #{pd.USER_ID} + ) and a.STATUS = #{pd.STATUS} @@ -339,6 +346,9 @@ and a.CHECK_STATUS = #{pd.CHECK_STATUS} + + and a.CHECK_STEP = #{pd.CHECK_STEP} +