Forráskód Böngészése

审批接口,增加审批超时时间

dzx 1 éve
szülő
commit
250d99e5d8

+ 30 - 13
src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java

@@ -27,10 +27,10 @@ import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.BaseStudentSubsidize;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
-import com.xjrsoft.module.student.mapper.BaseStudentContactMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentFamilyMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentFamilyMemberMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentUserMapper;
+import com.xjrsoft.module.student.service.IBaseStudentContactService;
 import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
 import com.xjrsoft.module.student.service.IBaseStudentService;
@@ -66,7 +66,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
 
     private final IBaseStudentService baseStudentService;
     private final BaseClassMapper baseClassMapper;
-    private final BaseStudentContactMapper studentbaseManagerBaseStudentContactMapper;
+    private final IBaseStudentContactService studentContactService;
     private final BaseStudentFamilyMapper familyMapper;
     private final BaseStudentFamilyMemberMapper familyMemberMapper;
 
@@ -96,7 +96,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
         }
         for (BaseStudentContact baseStudentContact : baseStudentUser.getBaseStudentContactList()) {
             baseStudentContact.setUserId(baseStudentUser.getId());
-            studentbaseManagerBaseStudentContactMapper.insert(baseStudentContact);
+            studentContactService.save(baseStudentContact);
         }
         for (BaseStudentFamily BaseStudentFamily : baseStudentUser.getBaseStudentFamilyList()) {
             BaseStudentFamily.setUserId(baseStudentUser.getId());
@@ -160,7 +160,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
         //********************************* BaseStudentContact  增删改  开始 *******************************************/
         {
             // 查出所有子级的id
-            List<BaseStudentContact> baseStudentContactList = studentbaseManagerBaseStudentContactMapper.selectList(Wrappers.lambdaQuery(BaseStudentContact.class).eq(BaseStudentContact::getUserId, baseStudentUser.getId()).select(BaseStudentContact::getId));
+            List<BaseStudentContact> baseStudentContactList = studentContactService.list(Wrappers.lambdaQuery(BaseStudentContact.class).eq(BaseStudentContact::getUserId, baseStudentUser.getId()).select(BaseStudentContact::getId));
             List<Long> baseStudentContactIds = baseStudentContactList.stream().map(BaseStudentContact::getId).collect(Collectors.toList());
             //原有子表单 没有被删除的主键
             List<Long> baseStudentContactOldIds = baseStudentUser.getBaseStudentContactList().stream().map(BaseStudentContact::getId).filter(Objects::nonNull).collect(Collectors.toList());
@@ -170,18 +170,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
             for (BaseStudentContact baseStudentContact : baseStudentUser.getBaseStudentContactList()) {
                 //如果不等于空则修改
                 if (baseStudentContact.getId() != null) {
-                    studentbaseManagerBaseStudentContactMapper.updateById(baseStudentContact);
+                    studentContactService.updateById(baseStudentContact);
                 }
                 //如果等于空 则新增
                 else {
                     //已经不存在的id 删除
                     baseStudentContact.setUserId(baseStudentUser.getId());
-                    studentbaseManagerBaseStudentContactMapper.insert(baseStudentContact);
+                    studentContactService.save(baseStudentContact);
                 }
             }
             //已经不存在的id 删除
             if (baseStudentContactRemoveIds.size() > 0) {
-                studentbaseManagerBaseStudentContactMapper.deleteBatchIds(baseStudentContactRemoveIds);
+                studentContactService.removeBatchByIds(baseStudentContactRemoveIds);
             }
         }
         //********************************* BaseStudentContact  增删改  结束 *******************************************/
@@ -309,7 +309,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
     public Boolean delete(List<Long> ids) {
         studentbaseManagerBaseStudentUserMapper.deleteBatchIds(ids);
         baseStudentService.remove(Wrappers.lambdaQuery(BaseStudent.class).in(BaseStudent::getUserId, ids));
-        studentbaseManagerBaseStudentContactMapper.delete(Wrappers.lambdaQuery(BaseStudentContact.class).in(BaseStudentContact::getUserId, ids));
+        studentContactService.remove(Wrappers.lambdaQuery(BaseStudentContact.class).in(BaseStudentContact::getUserId, ids));
         familyMapper.delete(Wrappers.lambdaQuery(BaseStudentFamily.class).in(BaseStudentFamily::getUserId, ids));
         familyMemberMapper.delete(Wrappers.lambdaQuery(BaseStudentFamilyMember.class).in(BaseStudentFamilyMember::getUserId, ids));
         schoolRollService.remove(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).in(BaseStudentSchoolRoll::getUserId, ids));
@@ -439,17 +439,26 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
             familyMap.put(el.getUserId(), el);
         }
 
+        //查询联系信息
+        List<BaseStudentContact> contactList = studentContactService.list();
+        Map<Long, BaseStudentContact> contactMap = new HashMap<>();
+        for (BaseStudentContact el : contactList) {
+            contactMap.put(el.getUserId(), el);
+        }
+
         List<BaseStudentUser> updateStudentUserList = new ArrayList();
         List<BaseStudent> updateBaseStudentList = new ArrayList();
         List<BaseStudentSchoolRoll> updateSchoolRollList = new ArrayList();
         List<BaseStudentSubsidize> updateSubsidizeList = new ArrayList();
         List<BaseStudentFamily> updateFamilyList = new ArrayList();
+        List<BaseStudentContact> updateContactList = new ArrayList();
 
         List<BaseStudentUser> insertStudentUserList = new ArrayList();
         List<BaseStudent> insertBaseStudentList = new ArrayList();
         List<BaseStudentSchoolRoll> insertSchoolRollList = new ArrayList();
         List<BaseStudentSubsidize> insertSubsidizeList = new ArrayList();
         List<BaseStudentFamily> insertFamilyList = new ArrayList();
+        List<BaseStudentContact> insertContactList = new ArrayList();
 
         long createUserId = StpUtil.getLoginIdAsLong();
         for (Map<Integer, Object> dataMaps : excelDataList) {
@@ -461,6 +470,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
             BaseStudentSchoolRoll schoolRoll;
             BaseStudentSubsidize subsidize;
             BaseStudentFamily studentFamily;
+            BaseStudentContact contact;
             if(user != null){
                 baseStudent = baseStudentMap.get(user.getId());
                 baseStudent.setDeleteMark(DeleteMark.NODELETE.getCode());
@@ -473,6 +483,9 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
 
                 studentFamily = familyMap.get(user.getId());
                 studentFamily.setDeleteMark(DeleteMark.NODELETE.getCode());
+
+                contact = contactMap.get(user.getId());
+                contact.setDeleteMark(DeleteMark.NODELETE.getCode());
             }else{
                 user = new BaseStudentUser();
                 baseStudent = new BaseStudent();
@@ -494,6 +507,11 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
                 studentFamily.setUserId(user.getId());
                 studentFamily.setCreateUserId(createUserId);
                 studentFamily.setCreateDate(LocalDateTime.now());
+
+                contact = new BaseStudentContact();
+                contact.setUserId(user.getId());
+                contact.setCreateUserId(createUserId);
+                contact.setCreateDate(LocalDateTime.now());
             }
             //设置字段值
             if(dataMaps.get(1).toString() != null && !"".equals(dataMaps.get(1).toString())){
@@ -623,16 +641,15 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
             }
             if(dataMaps.get(42).toString() != null && !"".equals(dataMaps.get(42).toString())){
                 user.setQqNumber(dataMaps.get(42).toString());//QQ&MSN
+                contact.setQqMsn(dataMaps.get(42).toString());//QQ&MSN
             }
             if(dataMaps.get(43).toString() != null && !"".equals(dataMaps.get(43).toString())){
                 user.setWechatNumber(dataMaps.get(43).toString());//微信号码
+                contact.setWechat(dataMaps.get(43).toString());//微信号码
             }
-            if(dataMaps.get(43).toString() != null && !"".equals(dataMaps.get(43).toString())){
-                user.setWechatNumber(dataMaps.get(43).toString());//微信号码
+            if(dataMaps.get(44).toString() != null && !"".equals(dataMaps.get(44).toString())){
+                contact.setUserPage(dataMaps.get(44).toString());//个人主页
             }
-//            if(dataMaps.get(44).toString() != null && !"".equals(dataMaps.get(44).toString())){
-//                user.setWechatNumber(dataMaps.get(44).toString());//个人主页
-//            }
             if(dataMaps.get(45).toString() != null && !"".equals(dataMaps.get(45).toString())){
                 schoolRoll.setRollNumber(dataMaps.get(45).toString());//学籍号
             }

+ 8 - 3
src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowExecuteServiceImpl.java

@@ -4885,6 +4885,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                         variableInstanceOptional.ifPresent(var -> {
                             vo.setApproveUserIds(Convert.toStr(var.getValue()));
                         });
+                        vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                         voList.add(vo);
 
 
@@ -4905,7 +4906,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                             vo.setIsAppoint(Boolean.TRUE);
                             vo.setIsMultiInstance(Boolean.FALSE);
                             vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
-
+                            vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                             variableInstanceOptional.ifPresent(var -> {
                                 vo.setApproveUserIds(Convert.toStr(var.getValue()));
                             });
@@ -4930,6 +4931,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                     vo.setIsMultiInstance(Boolean.FALSE);
                     vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
                     taskService.setVariableLocal(task.getId(), WorkflowConstant.TASK_IS_APPOINT_APPROVE, YesOrNoEnum.NO.getCode());
+                    vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                     voList.add(vo);
 
                 } else {
@@ -4939,6 +4941,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                     vo.setIsMultiInstance(Boolean.TRUE);
                     vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
                     taskService.setVariableLocal(task.getId(), WorkflowConstant.TASK_IS_APPOINT_APPROVE, YesOrNoEnum.NO.getCode());
+                    vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                     voList.add(vo);
                 }
 
@@ -4993,7 +4996,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                     } else {
                         vo.setProvisionalApprover(Boolean.TRUE);
                     }
-
+                    vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                     voList.add(vo);
 
                     //如果是需要指定审批人 默认设置变量
@@ -5013,7 +5016,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                         vo.setIsAppoint(Boolean.TRUE);
                         vo.setIsMultiInstance(Boolean.FALSE);
                         vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
-
+                        vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                         if (variableInstance != null) {
                             vo.setApproveUserIds(Convert.toStr(variableInstance.getValue()));
                         } else {
@@ -5040,6 +5043,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                 vo.setIsMultiInstance(Boolean.FALSE);
                 vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
                 voList.add(vo);
+                vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                 taskService.setVariableLocal(task.getId(), WorkflowConstant.TASK_IS_APPOINT_APPROVE, YesOrNoEnum.NO.getCode());
 
 
@@ -5048,6 +5052,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
                 vo.setTaskId(task.getId());
                 vo.setIsAppoint(Boolean.FALSE);
                 vo.setIsMultiInstance(Boolean.TRUE);
+                vo.setApproveTime(commonPropertiesConfig.getApprovalTime());
                 vo.setProvisionalApprover(userTaskConfig.getProvisionalApprover());
                 voList.add(vo);
                 taskService.setVariableLocal(task.getId(), WorkflowConstant.TASK_IS_APPOINT_APPROVE, YesOrNoEnum.NO.getCode());

+ 4 - 0
src/main/java/com/xjrsoft/module/workflow/vo/LaunchAndApproveVo.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.workflow.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -42,4 +43,7 @@ public class LaunchAndApproveVo {
      */
     private String approveUserIds;
 
+    @ApiModelProperty("审批超时时间")
+    private Integer approveTime;
+
 }