|
|
@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.PageUtils;
|
|
|
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
|
|
@@ -19,6 +20,8 @@ import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.business.BpmBusinessFormDO;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
|
|
|
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskCopyRelationDO;
|
|
|
+import cn.iocoder.yudao.module.bpm.dal.mysql.definition.BpmTaskCopyRelationMapper;
|
|
|
import cn.iocoder.yudao.module.bpm.enums.BpmBusinessTypeEnum;
|
|
|
import cn.iocoder.yudao.module.bpm.enums.BpmCheckInWaitStatusEnum;
|
|
|
import cn.iocoder.yudao.module.bpm.enums.definition.*;
|
|
|
@@ -150,6 +153,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
@Autowired
|
|
|
private RequestScopedStorage requestScopedStorage;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BpmTaskCopyRelationMapper bpmTaskCopyRelationMapper;
|
|
|
+
|
|
|
// ========== Query 查询相关方法 ==========
|
|
|
|
|
|
@Override
|
|
|
@@ -646,10 +652,11 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
}
|
|
|
LogRecordContext.putVariable("nickname", SecurityFrameworkUtils.getLoginUserNickname());
|
|
|
LogRecordContext.putVariable("instanceName", instance.getName());
|
|
|
-
|
|
|
+ Set<Long> copyUserIdList = getCopyUserIdList(task.getTaskDefinitionKey());
|
|
|
+ copyUserIdList.addAll(reqVO.getCopyUserIds());
|
|
|
if (CollUtil.isNotEmpty(reqVO.getCopyUserIds())) {
|
|
|
//processInstanceCopyService.createProcessInstanceCopy(reqVO.getCopyUserIds(), reqVO.getId());
|
|
|
- processInstanceCopyService.createProcessInstanceCopy(reqVO.getCopyUserIds(), task);
|
|
|
+ processInstanceCopyService.createProcessInstanceCopy(copyUserIdList, task);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -674,9 +681,17 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
BpmCheckInWaitStatusEnum.FIRST_APPROVAL_PASSED_WAIT_SECOND_APPROVAL.getStatus());
|
|
|
return;
|
|
|
}
|
|
|
+ if ("second_approve".equals(key)) {
|
|
|
+ reqVO.setAuditName(parseString(variables, "firstAuditName"));
|
|
|
+ if (StrUtil.isNotBlank(reqVO.getAuditName())) {
|
|
|
+ checkInWaitApi.updateSecondReviewInfo(reqVO);
|
|
|
+ }
|
|
|
+ checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(),
|
|
|
+ BpmCheckInWaitStatusEnum.SECOND_APPROVAL_PASSED_WAIT_THIRD_APPROVAL.getStatus());
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ("third_approve".equals(key)) {
|
|
|
reqVO.setNurseLevelId(parseLong(variables, "nurseLevelId"));
|
|
|
- reqVO.setRemark(parseString(variables, "remark"));
|
|
|
if (reqVO.getNurseLevelId() != null || StrUtil.isNotBlank(reqVO.getRemark())) {
|
|
|
checkInWaitApi.updateThirdReviewInfo(reqVO);
|
|
|
}
|
|
|
@@ -686,6 +701,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
}
|
|
|
if ("fourth_approve".equals(key)) {
|
|
|
reqVO.setPhysicalExaminationReport(parseString(variables, "physicalExaminationReport"));
|
|
|
+ reqVO.setRemark(parseString(variables, "remark"));
|
|
|
if (StrUtil.isNotBlank(reqVO.getPhysicalExaminationReport())) {
|
|
|
checkInWaitApi.updateFourthReviewInfo(reqVO);
|
|
|
}
|
|
|
@@ -693,6 +709,15 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
BpmCheckInWaitStatusEnum.FOURTH_APPROVAL_PASSED_WAIT_FIFTH_APPROVAL.getStatus());
|
|
|
return;
|
|
|
}
|
|
|
+ if ("fifth_approve".equals(key)) {
|
|
|
+ reqVO.setAuditName(parseString(variables, "auditName"));
|
|
|
+ if (StrUtil.isNotBlank(reqVO.getAuditName())) {
|
|
|
+ checkInWaitApi.updateFifthReviewInfo(reqVO);
|
|
|
+ }
|
|
|
+ checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(),
|
|
|
+ BpmCheckInWaitStatusEnum.FOURTH_APPROVAL_PASSED_WAIT_FIFTH_APPROVAL.getStatus());
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ("sixth_approve".equals(key)) {
|
|
|
reqVO.setBedId(parseLong(variables, "bedId"));
|
|
|
if (reqVO.getBedId() != null) {
|
|
|
@@ -1679,5 +1704,17 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
+ private Set<Long> getCopyUserIdList(String taskDefinitionKey){
|
|
|
+ Set<Long> result = new HashSet<>();
|
|
|
+ List<BpmTaskCopyRelationDO> bpmTaskCopyRelationList = bpmTaskCopyRelationMapper.selectList(new LambdaQueryWrapperX<BpmTaskCopyRelationDO>()
|
|
|
+ .eq(BpmTaskCopyRelationDO::getTaskDefinitionKey, taskDefinitionKey));
|
|
|
+ for (BpmTaskCopyRelationDO bpmTaskCopyRelationDO : bpmTaskCopyRelationList) {
|
|
|
+ result.addAll(Arrays.stream(bpmTaskCopyRelationDO.getUserIdList().split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(s -> !s.isEmpty())
|
|
|
+ .map(Long::parseLong)
|
|
|
+ .collect(Collectors.toSet()));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|