|
|
@@ -8,11 +8,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.google.common.collect.Sets; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; |
|
|
|
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.sys.enumeration.ProjectEarlyWarningStatusEnum; |
|
|
|
import com.ningdatech.pmapi.sys.manage.EarlyWarningManage; |
|
|
|
import com.ningdatech.pmapi.sys.manage.NoticeManage; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.ProjectEarlyWarning; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; |
|
|
@@ -28,9 +32,13 @@ import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; |
|
|
|
import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; |
|
|
|
import com.wflow.enums.WarningNoticeTypeEnum; |
|
|
|
import com.wflow.enums.WarningRuleTypeEnum; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.temporal.ChronoUnit; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.ForkJoinPool; |
|
|
@@ -60,6 +68,10 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
private final ProjectLibManage projectLibManage; |
|
|
|
|
|
|
|
private final EarlyWarningManage earlyWarningManage; |
|
|
|
|
|
|
|
private final IProjectService projectService; |
|
|
|
|
|
|
|
public WorkbenchVO getWorkbenchData(Integer year) { |
|
|
|
WorkbenchVO res = new WorkbenchVO(); |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
@@ -235,8 +247,38 @@ public class WorkbenchManage { |
|
|
|
VUtils.isTrue(Objects.isNull(record)) |
|
|
|
.throwMessage("催办失败,id不存在!"); |
|
|
|
|
|
|
|
String noticeMethod = record.getNoticeMethod(); |
|
|
|
Integer noticeType = record.getNoticeType(); |
|
|
|
String projectCode = record.getProjectCode(); |
|
|
|
Project project = projectService.getProjectByCode(projectCode); |
|
|
|
String noticeContent = record.getNoticeContent(); |
|
|
|
String batchEmployees = record.getBatchEmployees(); |
|
|
|
Integer ruleType = record.getRuleType(); |
|
|
|
String path = record.getPath(); |
|
|
|
LocalDateTime instStart = record.getInstStart(); |
|
|
|
Integer biz = record.getBiz(); |
|
|
|
VUtils.isTrue(Objects.isNull(project)).throwMessage("催办失败,项目不存在!"); |
|
|
|
if(StringUtils.isBlank(batchEmployees)){ |
|
|
|
//如果批次员工号不存在 就取当前 |
|
|
|
batchEmployees = record.getWarningEmployeecode(); |
|
|
|
} |
|
|
|
VUtils.isTrue(StringUtils.isBlank(batchEmployees)) |
|
|
|
.throwMessage("催办失败,员工为空!"); |
|
|
|
String[] employees = batchEmployees.split(StrPool.COMMA); |
|
|
|
// Integer hours = LocalDateTime.now(); |
|
|
|
Long between = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); |
|
|
|
Integer times = 0; |
|
|
|
for(String employee : employees){ |
|
|
|
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue(),biz, |
|
|
|
instStart,employee,project, |
|
|
|
ruleType,noticeType,path,batchEmployees); |
|
|
|
times++; |
|
|
|
} |
|
|
|
|
|
|
|
return "催办成功了" + times + "个人"; |
|
|
|
} |
|
|
|
|
|
|
|
return "催办成功"; |
|
|
|
public static void main(String[] args) { |
|
|
|
System.out.println(ChronoUnit.HOURS.between(LocalDateTime.now(),LocalDateTime.now().plusMonths(1))); |
|
|
|
} |
|
|
|
} |