|
@@ -10,6 +10,7 @@ import com.google.common.collect.Sets; |
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
|
|
|
import com.ningdatech.pmapi.common.constant.BizConst; |
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; |
|
|
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; |
|
|
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; |
|
|
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; |
|
@@ -32,8 +33,10 @@ import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; |
|
|
import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; |
|
|
import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; |
|
|
import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; |
|
|
|
|
|
import com.wflow.bean.entity.WflowEarlyWarning; |
|
|
import com.wflow.enums.WarningNoticeTypeEnum; |
|
|
import com.wflow.enums.WarningNoticeTypeEnum; |
|
|
import com.wflow.enums.WarningRuleTypeEnum; |
|
|
import com.wflow.enums.WarningRuleTypeEnum; |
|
|
|
|
|
import com.wflow.service.IEarlyWarningService; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@@ -63,6 +66,8 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
|
private final IEarlyWarningRecordsService earlyWarningRecordsService; |
|
|
private final IEarlyWarningRecordsService earlyWarningRecordsService; |
|
|
|
|
|
|
|
|
|
|
|
private final IEarlyWarningService earlyWarningService; |
|
|
|
|
|
|
|
|
private final IProjectEarlyWarningService projectEarlyWarningService; |
|
|
private final IProjectEarlyWarningService projectEarlyWarningService; |
|
|
|
|
|
|
|
|
private final NoticeManage noticeManage; |
|
|
private final NoticeManage noticeManage; |
|
@@ -297,14 +302,15 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(record)) |
|
|
VUtils.isTrue(Objects.isNull(record)) |
|
|
.throwMessage("催办失败,id不存在!"); |
|
|
.throwMessage("催办失败,id不存在!"); |
|
|
|
|
|
|
|
|
String noticeMethod = record.getNoticeMethod(); |
|
|
String noticeMethod = record.getNoticeMethod(); |
|
|
Integer noticeType = record.getNoticeType(); |
|
|
Integer noticeType = record.getNoticeType(); |
|
|
String projectCode = record.getProjectCode(); |
|
|
String projectCode = record.getProjectCode(); |
|
|
Project project = projectService.getProjectByCode(projectCode); |
|
|
Project project = projectService.getProjectByCode(projectCode); |
|
|
String noticeContent = record.getNoticeContent(); |
|
|
|
|
|
String batchEmployees = record.getBatchEmployees(); |
|
|
String batchEmployees = record.getBatchEmployees(); |
|
|
Integer ruleType = record.getRuleType(); |
|
|
Integer ruleType = record.getRuleType(); |
|
|
|
|
|
String areaCode = record.getAreaCode(); |
|
|
|
|
|
//如果是临期 可以取到 超期的小时数 |
|
|
|
|
|
Integer overTime = record.getOverTime(); |
|
|
String path = record.getPath(); |
|
|
String path = record.getPath(); |
|
|
LocalDateTime instStart = record.getInstStart(); |
|
|
LocalDateTime instStart = record.getInstStart(); |
|
|
Integer biz = record.getBiz(); |
|
|
Integer biz = record.getBiz(); |
|
@@ -313,15 +319,27 @@ public class WorkbenchManage { |
|
|
//如果批次员工号不存在 就取当前 |
|
|
//如果批次员工号不存在 就取当前 |
|
|
batchEmployees = record.getWarningEmployeecode(); |
|
|
batchEmployees = record.getWarningEmployeecode(); |
|
|
} |
|
|
} |
|
|
|
|
|
String noticeContent = record.getNoticeContent(); |
|
|
|
|
|
//查出配置的模板 |
|
|
|
|
|
WflowEarlyWarning config = earlyWarningService.getOne(Wrappers.lambdaQuery(WflowEarlyWarning.class) |
|
|
|
|
|
.eq(WflowEarlyWarning::getAreaCode, areaCode) |
|
|
|
|
|
.eq(WflowEarlyWarning::getRuleType, ruleType) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
//如果配置能取到 就取模板的 |
|
|
|
|
|
if(Objects.nonNull(config)){ |
|
|
|
|
|
noticeContent = config.getNoticeContent(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
VUtils.isTrue(StringUtils.isBlank(batchEmployees)) |
|
|
VUtils.isTrue(StringUtils.isBlank(batchEmployees)) |
|
|
.throwMessage("催办失败,员工为空!"); |
|
|
.throwMessage("催办失败,员工为空!"); |
|
|
String[] employees = batchEmployees.split(StrPool.COMMA); |
|
|
String[] employees = batchEmployees.split(StrPool.COMMA); |
|
|
//算出 当前和他的 小时差 |
|
|
|
|
|
Long between = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); |
|
|
|
|
|
|
|
|
//算出 当前和他的 小时差 临期 |
|
|
|
|
|
Long adventBetween = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); |
|
|
|
|
|
Integer overBetween = overTime - adventBetween.intValue(); |
|
|
Integer times = 0; |
|
|
Integer times = 0; |
|
|
for(String employee : employees){ |
|
|
for(String employee : employees){ |
|
|
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue() |
|
|
|
|
|
,between.intValue(),biz, |
|
|
|
|
|
|
|
|
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,adventBetween.intValue() |
|
|
|
|
|
,overBetween,biz, |
|
|
instStart,employee,project, |
|
|
instStart,employee,project, |
|
|
ruleType,noticeType,path,batchEmployees,record.getNodeId()); |
|
|
ruleType,noticeType,path,batchEmployees,record.getNodeId()); |
|
|
times++; |
|
|
times++; |
|
|