From 644ee593984532e2a8bf32558a8f60c8ff8e3974 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 21 Dec 2023 19:55:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xgf/impl/TrainingBatchServiceImpl.java | 655 +++++++++--------- .../service/xgf/impl/XgfUserServiceImpl.java | 7 +- .../datasource/xgf/XgfUserDetailsMapper.xml | 8 +- .../mybatis/datasource/xgf/XgfUserMapper.xml | 21 +- 4 files changed, 359 insertions(+), 332 deletions(-) diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java index 0431c093..1e0e701e 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -28,363 +28,384 @@ import java.util.stream.Collectors; @Transactional //开启事物 public class TrainingBatchServiceImpl implements TrainingBatchService { - @Resource - private TrainingBatchMapper trainingbatchMapper; + @Resource + private TrainingBatchMapper trainingbatchMapper; - @Resource - private TrainUsersMapper trainUsersMapper; + @Resource + private TrainUsersMapper trainUsersMapper; - @Resource - private XgfUserMapper xgfUserMapper; + @Resource + private XgfUserMapper xgfUserMapper; - @Resource - private FlowMapper flowMapper; + @Resource + private FlowMapper flowMapper; - @Resource - private FlowDetailMapper flowDetailMapper; + @Resource + private FlowDetailMapper flowDetailMapper; - @Resource - private UsersMapper usersMapper; + @Resource + private UsersMapper usersMapper; - @Resource - private DepartmentMapper departmentMapper; + @Resource + private DepartmentMapper departmentMapper; - /**新增 - * @param pd - * @throws Exception - */ - public void save(PageData pd)throws Exception{ - /* 保存主题信息 */ - String batch_id=UuidUtil.get32UUID(); - String train_area=pd.getString("TRAIN_AREA"); - pd.put("TRAINING_BATCH_ID", batch_id); //主键 - pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - pd.put("ISDELETE", 0); //是否删除 1-是 0-否 + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + /* 保存主题信息 */ + String batch_id = UuidUtil.get32UUID(); + String train_area = pd.getString("TRAIN_AREA"); + pd.put("TRAINING_BATCH_ID", batch_id); //主键 + pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd.put("ISDELETE", 0); //是否删除 1-是 0-否 - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft=new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - pd.put("CREATDATE",year + "-" + month); - PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 - String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString())+1)); - pd.put("BATCH_NAME",code); - /*翻译*/ - PageData condition = new PageData(); - condition.put("USER_ID",pd.get("SUPERVISION_USER_ID")); - PageData supUser = usersMapper.getUserInfo(condition); - pd.put("SUPERVISION_USER_NAME",supUser.get("NAME")); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + pd.put("CREATDATE", year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); + pd.put("BATCH_NAME", code); + /*翻译*/ + PageData condition = new PageData(); + condition.put("USER_ID", pd.get("SUPERVISION_USER_ID")); + PageData supUser = usersMapper.getUserInfo(condition); + pd.put("SUPERVISION_USER_NAME", supUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("SUPERVISION")); - PageData supDepartment = departmentMapper.getInfo(condition); - pd.put("SUPERVISION_DEPARTMENT_NAME",supDepartment.get("NAME")); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("SUPERVISION")); + PageData supDepartment = departmentMapper.getInfo(condition); + pd.put("SUPERVISION_DEPARTMENT_NAME", supDepartment.get("NAME")); - condition.clear(); - condition.put("USER_ID",pd.get("MANAGER_USER_ID")); - PageData manUser = usersMapper.getUserInfo(condition); - pd.put("MANAGER_USER_NAME",manUser.get("NAME")); + condition.clear(); + condition.put("USER_ID", pd.get("MANAGER_USER_ID")); + PageData manUser = usersMapper.getUserInfo(condition); + pd.put("MANAGER_USER_NAME", manUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("MANAGER")); - PageData manDepartment = departmentMapper.getInfo(condition); - pd.put("MANAGER_DEPARTMENT_NAME",manDepartment.get("NAME")); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("MANAGER")); + PageData manDepartment = departmentMapper.getInfo(condition); + pd.put("MANAGER_DEPARTMENT_NAME", manDepartment.get("NAME")); - condition.clear(); - condition.put("USER_ID",pd.get("TERRITORIALITY_USER_ID")); - PageData terUser = usersMapper.getUserInfo(condition); - pd.put("TERRITORIALITY_USER_NAME",terUser.get("NAME")); + // 2023-12-21 相关方功能限制,暂时移除集团单位审批节点 created by sparrow + if (StringUtils.isNotEmpty(pd.getString("TERRITORIALITY_USER_ID"))) { + condition.clear(); + condition.put("USER_ID", pd.get("TERRITORIALITY_USER_ID")); + PageData terUser = usersMapper.getUserInfo(condition); + pd.put("TERRITORIALITY_USER_NAME", terUser == null ? "" : terUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("TERRITORIALITY")); - PageData terDepartment = departmentMapper.getInfo(condition); - pd.put("TERRITORIALITY_DEPARTMENT_NAME",terDepartment.get("NAME")); - pd.put("IS_DELETE","0"); - pd.put("STEP_STATUS","0"); - trainingbatchMapper.save(pd); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("TERRITORIALITY")); + PageData terDepartment = departmentMapper.getInfo(condition); + pd.put("TERRITORIALITY_DEPARTMENT_NAME", terDepartment == null ? "" : terDepartment.get("NAME")); + } - String arrayDATA_ids[] = pd.getString("users").split(","); - Arrays.asList(arrayDATA_ids).forEach(id -> { - PageData user = new PageData(); - user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); - user.put("TRAINING_BATCH_ID", batch_id); - user.put("USER_ID", id); - user.put("TRAIN_AREA", train_area); - user.put("STATUS", 0); - user.put("SUPERVISION_STATE", 9); - user.put("MANAGER_STATE", 9); - user.put("TERRITORIALITY_STATE", 9); - user.put("STEP_STATUS", "0"); - user.put("BELONG_TO_CORP",pd.get("BELONG_TO_CORP")); - user.put("BELONG_TO_CORP_NAME",pd.get("BELONG_TO_CORP_NAME")); - user.put("IS_DELETE", "0"); - user.put("RESULT_STATUS","1"); - trainUsersMapper.save(user); - condition.clear(); - condition.put("XGF_USER_ID",id); - PageData userEntity = xgfUserMapper.findById(condition); - userEntity.put("STATUS","3"); - userEntity.put("STUDY_STATUS","9"); - xgfUserMapper.edit(userEntity); - }); + pd.put("IS_DELETE", "0"); + pd.put("STEP_STATUS", "1"); + trainingbatchMapper.save(pd); - /* 保存审批流程信息 */ - PageData flow = new PageData(); - flow.put("FLOW_ID", Warden.get32UUID()); - flow.put("TYPE", "0"); - flow.put("CREATOR",Jurisdiction.getUSER_ID()); - flow.put("CREATOR_NAME",Jurisdiction.getName()); - flow.put("CREATOR_TIME", DateUtil.getTime()); - flow.put("VALID_FLAG", "1"); - flow.put("FOREIGN_KEY",pd.getString("TRAINING_BATCH_ID")); - flow.put("ISDELETE", "0"); - flowMapper.save(flow); - /* 保存审批流程明细信息 */ - PageData flowDetail = new PageData(); - flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); - flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); - flowDetail.put("STEP_FLAG", "1"); - flowDetail.put("SORT",0); - flowDetail.put("APPROVER_ID",Jurisdiction.getUSER_ID()); - flowDetail.put("APPROVER_NAME",Jurisdiction.getName()); - flowDetail.put("APPROVER_TIME", DateUtil.getTime()); - flowDetail.put("APPROVER_CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - // TODO 未完成 - flowDetail.put("APPROVER_CORPINFO_NAME",""); - flowDetail.put("PASS_FLAG", "1"); - flowDetail.put("END_FLAG", "0"); - flowDetail.put("ISDELETE", "0"); - flowDetail.put("PARENT_ID","0"); - flowDetailMapper.save(flowDetail); - } + String arrayDATA_ids[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_ids).forEach(id -> { + PageData user = new PageData(); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_AREA", train_area); + user.put("STATUS", 0); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "1"); + user.put("BELONG_TO_CORP", pd.get("BELONG_TO_CORP")); + user.put("BELONG_TO_CORP_NAME", pd.get("BELONG_TO_CORP_NAME")); + user.put("IS_DELETE", "0"); + user.put("RESULT_STATUS", "1"); + trainUsersMapper.save(user); + condition.clear(); + condition.put("XGF_USER_ID", id); + PageData userEntity = xgfUserMapper.findById(condition); + userEntity.put("STATUS", "3"); + userEntity.put("STUDY_STATUS", "9"); + xgfUserMapper.edit(userEntity); + }); - /**固定人员培训 - * @param pd - * @throws Exception - */ - public void unflowTrain(PageData pd)throws Exception{ - PageData trainBatch = new PageData(); - String batch_id = UuidUtil.get32UUID(); - trainBatch.put("TRAINING_BATCH_ID", batch_id); //主键 - trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 - trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 - trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否 - trainBatch.put("TYPE", 1); - trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); - trainBatch.put("AUDIT_STATUS", 0); - trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); - trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); + /* 保存审批流程信息 */ + PageData flow = new PageData(); + flow.put("FLOW_ID", Warden.get32UUID()); + flow.put("TYPE", "0"); + flow.put("CREATOR", Jurisdiction.getUSER_ID()); + flow.put("CREATOR_NAME", Jurisdiction.getName()); + flow.put("CREATOR_TIME", DateUtil.getTime()); + flow.put("VALID_FLAG", "1"); + flow.put("FOREIGN_KEY", pd.getString("TRAINING_BATCH_ID")); + flow.put("ISDELETE", "0"); + flowMapper.save(flow); + /* 保存审批流程明细信息 */ + PageData flowDetail = new PageData(); + flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); + flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); + flowDetail.put("STEP_FLAG", "1"); + flowDetail.put("SORT", 0); + flowDetail.put("APPROVER_ID", Jurisdiction.getUSER_ID()); + flowDetail.put("APPROVER_NAME", Jurisdiction.getName()); + flowDetail.put("APPROVER_TIME", DateUtil.getTime()); + flowDetail.put("APPROVER_CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + // TODO 未完成 + flowDetail.put("APPROVER_CORPINFO_NAME", ""); + flowDetail.put("PASS_FLAG", "1"); + flowDetail.put("END_FLAG", "0"); + flowDetail.put("ISDELETE", "0"); + flowDetail.put("PARENT_ID", "0"); + flowDetailMapper.save(flowDetail); + } - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft = new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - trainBatch.put("CREATDATE", year + "-" + month); - PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取 - String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); - trainBatch.put("BATCH_NAME", code); + /** + * 固定人员培训 + * + * @param pd + * @throws Exception + */ + public void unflowTrain(PageData pd) throws Exception { + PageData trainBatch = new PageData(); + String batch_id = UuidUtil.get32UUID(); + trainBatch.put("TRAINING_BATCH_ID", batch_id); //主键 + trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 + trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 + trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否 + trainBatch.put("TYPE", 1); + trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); + trainBatch.put("AUDIT_STATUS", 0); + trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); + trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); - trainingbatchMapper.save(trainBatch); - trainBatch.put("AUDIT_STATUS", "2"); - this.audit(trainBatch); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + trainBatch.put("CREATDATE", year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); + trainBatch.put("BATCH_NAME", code); - String arrayDATA_IDS[] = pd.getString("users").split(","); - Arrays.asList(arrayDATA_IDS).forEach(id -> { - PageData user = new PageData(); - user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); - user.put("TRAINING_BATCH_ID", batch_id); - user.put("USER_ID", id); - user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); - user.put("STATUS", 1); - user.put("START_DATE", DateUtil.date2Str(new Date())); - user.put("SUPERVISION_STATE", 9); - user.put("MANAGER_STATE", 9); - user.put("TERRITORIALITY_STATE", 9); - user.put("STEP_STATUS", "0"); - trainUsersMapper.save(user); - }); - xgfUserMapper.bantchUpdateStatus(1,arrayDATA_IDS); + trainingbatchMapper.save(trainBatch); + trainBatch.put("AUDIT_STATUS", "2"); + this.audit(trainBatch); - } + String arrayDATA_IDS[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_IDS).forEach(id -> { + PageData user = new PageData(); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); + user.put("STATUS", 1); + user.put("START_DATE", DateUtil.date2Str(new Date())); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "0"); + trainUsersMapper.save(user); + }); + xgfUserMapper.bantchUpdateStatus(1, arrayDATA_IDS); - /**删除 - * @param pd - * @throws Exception - */ - public void delete(PageData pd)throws Exception{ - trainingbatchMapper.delete(pd); - } + } - /**修改 - * @param pd - * @throws Exception - */ - public void edit(PageData pd)throws Exception{ - trainingbatchMapper.edit(pd); - } + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + trainingbatchMapper.delete(pd); + } - public void audit(PageData pd)throws Exception{ - if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1){ - pd.put("STATUS",0); - pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2){ - pd.put("STATUS",1); - pd.put("START_DATE",DateUtil.date2Str(new Date())); - pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainUsersMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3){ - pd.put("STATUS",2); - pd.put("END_DATE",DateUtil.date2Str(new Date())); - pd.put("VERIFY_TIME",DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainUsersMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else{ - pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); - trainingbatchMapper.audit(pd); - } - } + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + trainingbatchMapper.edit(pd); + } - /**列表 - * @param page - * @throws Exception - */ - public List list(Page page)throws Exception{ - return trainingbatchMapper.datalistPage(page); - } + public void audit(PageData pd) throws Exception { + if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1) { + pd.put("STATUS", 0); + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2) { + pd.put("STATUS", 1); + pd.put("START_DATE", DateUtil.date2Str(new Date())); + pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3) { + pd.put("STATUS", 2); + pd.put("END_DATE", DateUtil.date2Str(new Date())); + pd.put("VERIFY_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else { + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + trainingbatchMapper.audit(pd); + } + } - /**列表(全部) - * @param pd - * @throws Exception - */ - public List listAll(PageData pd)throws Exception{ - return trainingbatchMapper.listAll(pd); - } + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + return trainingbatchMapper.datalistPage(page); + } - /**通过id获取数据 - * @param pd - * @throws Exception - */ - public PageData findById(PageData pd)throws Exception{ - return trainingbatchMapper.findById(pd); - } + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + public List listAll(PageData pd) throws Exception { + return trainingbatchMapper.listAll(pd); + } - /**批量删除 - * @param ArrayDATA_IDS - * @throws Exception - */ - public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ - trainingbatchMapper.deleteAll(ArrayDATA_IDS); - } + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return trainingbatchMapper.findById(pd); + } - /** - * 获取编号 - * @param pd - * @return - */ - @Override - public PageData getCode(PageData pd) throws Exception{ - return trainingbatchMapper.getCode(pd); - } + /** + * 批量删除 + * + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS) throws Exception { + trainingbatchMapper.deleteAll(ArrayDATA_IDS); + } - public List batchUserlistPage(Page page)throws Exception{ - return trainingbatchMapper.batchUserlistPage(page); - } + /** + * 获取编号 + * + * @param pd + * @return + */ + @Override + public PageData getCode(PageData pd) throws Exception { + return trainingbatchMapper.getCode(pd); + } - @Override - public List passUserlistPage(Page page) throws Exception { - return trainingbatchMapper.passUserlistPage(page); - } + public List batchUserlistPage(Page page) throws Exception { + return trainingbatchMapper.batchUserlistPage(page); + } - @Override - public void graduation(PageData condition) { - trainingbatchMapper.graduation(condition); - xgfUserMapper.graduation(condition); - } + @Override + public List passUserlistPage(Page page) throws Exception { + return trainingbatchMapper.passUserlistPage(page); + } - @Override - public void openClass(PageData info) { - List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("STATUS",info.getString("userStatus")); - condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); - xgfUserMapper.graduation(condition); + @Override + public void graduation(PageData condition) { + trainingbatchMapper.graduation(condition); + xgfUserMapper.graduation(condition); + } - condition.clear(); - condition.put("STATUS",info.getString("detailsStatus")); - condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); - trainUsersMapper.graduation(condition); + @Override + public void openClass(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("STATUS", info.getString("userStatus")); + condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); + xgfUserMapper.graduation(condition); - } + condition.clear(); + condition.put("STATUS", info.getString("detailsStatus")); + condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); + trainUsersMapper.graduation(condition); - @Override - public void openStudentClass(PageData info) { + } + + @Override + public void openStudentClass(PageData info) { // List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("STATUS",info.getString("userStatus")); - condition.put("USER_ID", info.getString("USER_ID")); - xgfUserMapper.graduationstudent(condition); + PageData condition = new PageData(); + condition.put("STATUS", info.getString("userStatus")); + condition.put("USER_ID", info.getString("USER_ID")); + xgfUserMapper.graduationstudent(condition); - condition.clear(); - condition.put("STATUS",info.getString("detailsStatus")); - condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); - trainUsersMapper.graduationstudent(condition); + condition.clear(); + condition.put("STATUS", info.getString("detailsStatus")); + condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); + trainUsersMapper.graduationstudent(condition); - } + } - @Override - public void updateClassMessage(PageData info) { - List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); - if (StringUtils.isNotEmpty(info.getString("START_DATE"))){ - condition.put("START_DATE",DateUtil.getTime()); - } - if (StringUtils.isNotEmpty(info.getString("END_DATE"))){ - condition.put("END_DATE",DateUtil.getTime()); - } - trainUsersMapper.updateDate(condition); - } + @Override + public void updateClassMessage(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); + if (StringUtils.isNotEmpty(info.getString("START_DATE"))) { + condition.put("START_DATE", DateUtil.getTime()); + } + if (StringUtils.isNotEmpty(info.getString("END_DATE"))) { + condition.put("END_DATE", DateUtil.getTime()); + } + trainUsersMapper.updateDate(condition); + } - @Override - public void saveFlow(PageData request) throws Exception { - /* 保存审批流程明细信息 */ - PageData condition = new PageData(); - condition.put("FLOW_ID", request.getString("FLOW_ID")); - condition.put("STEP_FLAG", "1"); - PageData flow = flowDetailMapper.selectOne(condition); - flow.put("STEP_FLAG", "0"); - flowDetailMapper.edit(flow); - PageData next_flow = new PageData(); - next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); - next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); - next_flow.put("STEP_FLAG", "1"); - next_flow.put("SORT",(Integer)flow.get("SORT")+1); - next_flow.put("APPROVER_ID",request.get("APPROVER_ID")); - next_flow.put("APPROVER_NAME",request.get("APPROVER_NAME")); - next_flow.put("APPROVER_TIME", DateUtil.getTime()); - next_flow.put("APPROVER_CORPINFO_ID",request.get("APPROVER_CORPINFO_ID")); - next_flow.put("APPROVER_CORPINFO_NAME",request.get("APPROVER_CORPINFO_NAME")); - next_flow.put("PASS_FLAG", "1"); - next_flow.put("END_FLAG", "0"); - next_flow.put("ISDELETE", "0"); - next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID")); - flowDetailMapper.save(next_flow); - } + @Override + public void saveFlow(PageData request) throws Exception { + /* 保存审批流程明细信息 */ + PageData condition = new PageData(); + condition.put("FLOW_ID", request.getString("FLOW_ID")); + condition.put("STEP_FLAG", "1"); + PageData flow = flowDetailMapper.selectOne(condition); + flow.put("STEP_FLAG", "0"); + flowDetailMapper.edit(flow); + PageData next_flow = new PageData(); + next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); + next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); + next_flow.put("STEP_FLAG", "1"); + next_flow.put("SORT", (Integer) flow.get("SORT") + 1); + next_flow.put("APPROVER_ID", request.get("APPROVER_ID")); + next_flow.put("APPROVER_NAME", request.get("APPROVER_NAME")); + next_flow.put("APPROVER_TIME", DateUtil.getTime()); + next_flow.put("APPROVER_CORPINFO_ID", request.get("APPROVER_CORPINFO_ID")); + next_flow.put("APPROVER_CORPINFO_NAME", request.get("APPROVER_CORPINFO_NAME")); + next_flow.put("PASS_FLAG", "1"); + next_flow.put("END_FLAG", "0"); + next_flow.put("ISDELETE", "0"); + next_flow.put("PARENT_ID", flow.getString("FLOW_DETAIL_ID")); + flowDetailMapper.save(next_flow); + } - @Override - public List findByUserId(PageData condition) throws Exception { - return trainingbatchMapper.findByUserId(condition); - } + @Override + public List findByUserId(PageData condition) throws Exception { + return trainingbatchMapper.findByUserId(condition); + } } diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index 93e6543c..17de5f5d 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -61,11 +61,13 @@ public class XgfUserServiceImpl implements XgfUserService { if (entity == null || entity.size() <= 0) { x.put("XGF_USER_ID", x.get("USER_ID")); x.put("XGF_USER_DETAILS_ID", x.get("USER_ID")); - x.put("ISDELETE", "0"); + x.put("XGF_USER_NAME", x.get("NAME")); x.put("VALID_FLAG", "1"); x.put("STATUS", "2"); x.put("CREATED_TIME", DateUtil.getTime()); x.put("OPERATOR_TIME", DateUtil.getTime()); + x.put("IS_DELETE", "0"); + x.put("CREATE_TIME", DateUtil.getTime()); condition.clear(); condition.put("DEPARTMENT_ID",x.get("MANAGER_DEPARTMENT_ID")); PageData regDepartmentEntity = departmentService.getCorpDepartment(condition); @@ -75,7 +77,8 @@ public class XgfUserServiceImpl implements XgfUserService { } else { x.put("XGF_USER_ID", x.get("USER_ID")); x.put("XGF_USER_DETAILS_ID", x.get("USER_ID")); - x.put("ISDELETE", "0"); + x.put("IS_DELETE", "0"); + x.put("CREATE_TIME", DateUtil.getTime()); x.put("OPERATOR_TIME", DateUtil.getTime()); condition.clear(); condition.put("DEPARTMENT_ID",x.get("MANAGER_DEPARTMENT_ID")); diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml index 409d2f14..2a3ed948 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -15,7 +15,7 @@ f.BELONG_TO_CORP, f.BELONG_TO_CORP_NAME, f.PHONE, - f.CREAT_TIME, + f.CREATE_TIME, f.DEPART_STATE, f.ISDELETE, f.AGE, @@ -69,7 +69,7 @@ BELONG_TO_CORP, BELONG_TO_CORP_NAME, PHONE, - CREAT_TIME, + CREATE_TIME, DEPART_STATE, ISDELETE, AGE, @@ -124,7 +124,7 @@ #{BELONG_TO_CORP}, #{BELONG_TO_CORP_NAME}, #{PHONE}, - #{CREAT_TIME}, + #{CREATE_TIME}, #{DEPART_STATE}, #{ISDELETE}, #{AGE}, @@ -203,7 +203,7 @@ BELONG_TO_CORP = #{BELONG_TO_CORP}, BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, PHONE = #{PHONE}, - CREAT_TIME = #{CREAT_TIME}, + CREATE_TIME = #{CREATE_TIME}, DEPART_STATE = #{DEPART_STATE}, ISDELETE = #{ISDELETE}, AGE = #{AGE}, diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 7f75b3bd..53ccf893 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -15,8 +15,8 @@ f.VALID_FLAG, f.BELONG_TO_CORP, f.BELONG_TO_CORP_NAME, - f.ISDELETE, - f.CREATED_TIME, + f.IS_DELETE, + f.CREATE_TIME, f.CORPINFO_ID, f.STATUS, f.OPERATOR_TIME, @@ -32,8 +32,8 @@ VALID_FLAG, BELONG_TO_CORP, BELONG_TO_CORP_NAME, - ISDELETE, - CREATED_TIME, + IS_DELETE, + CREATE_TIME, CORPINFO_ID, STATUS, OPERATOR_TIME, @@ -49,8 +49,8 @@ #{VALID_FLAG}, #{BELONG_TO_CORP}, #{BELONG_TO_CORP_NAME}, - #{ISDELETE}, - #{CREATED_TIME}, + #{IS_DELETE}, + #{CREATE_TIME}, #{CORPINFO_ID}, #{STATUS}, #{OPERATOR_TIME}, @@ -90,7 +90,7 @@ BELONG_TO_CORP = #{BELONG_TO_CORP}, BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, ISDELETE = #{ISDELETE}, - CREATED_TIME = #{CREATED_TIME}, + CREATE_TIME = #{CREATE_TIME}, CORPINFO_ID = #{CORPINFO_ID}, STATUS = #{STATUS}, OPERATOR_TIME = #{OPERATOR_TIME}, @@ -155,7 +155,7 @@ and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')) - ORDER BY f.CREATED_TIME DESC + ORDER BY f.CREATE_TIME DESC @@ -204,6 +204,9 @@ and a.STATUS = #{pd.STATUS} + + and a.STUDY_STATUS != #{pd.UN_STUDY_STATUS} +