Browse Source

工作台 预警 催办 处理

master
PoffyZhang 10 months ago
parent
commit
a2f6b4ec74
4 changed files with 49 additions and 1 deletions
  1. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java
  3. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java
  4. +43
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java View File

@@ -106,6 +106,7 @@ public class EarlyWarningManage {
records.setNoticeType(noticeType);
records.setPath(path);
records.setBatchEmployees(batchEmployees);
records.setBiz(biz);
earlyWarningRecordsService.save(records);

//2.消息提醒


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java View File

@@ -110,6 +110,9 @@ public class WflowEarlyWarningRecords implements Serializable {
@ApiModelProperty(value = "规则类型 1.流程预警规则 2.填报预警规则 3.实施监督 4.续建资金项目")
private Integer ruleType;

@ApiModelProperty(value = "业务biz")
private Integer biz;

@ApiModelProperty(value = "路径")
private String path;



+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/WflowEarlyWarningRecordsVO.java View File

@@ -118,6 +118,8 @@ public class WflowEarlyWarningRecordsVO implements Serializable {
private String createBy;
private LocalDateTime updateOn;
private String updateBy;
@ApiModelProperty(value = "业务biz")
private Integer biz;

public String getInstTypeName(){
if(Objects.nonNull(this.instType) && Objects.nonNull(this.ruleType)){


+ 43
- 1
pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java View File

@@ -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)));
}
}

Loading…
Cancel
Save