Browse Source

驾驶舱修改

master
PoffyZhang 10 months ago
parent
commit
1de2495ee8
6 changed files with 101 additions and 27 deletions
  1. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java
  2. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java
  3. +10
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java
  4. +5
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java
  5. +79
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java
  6. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

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

@@ -101,6 +101,9 @@ public class CockpitStats implements Serializable {
@ApiModelProperty("专家-总人数")
private Integer expertTotalNum = 0;

@ApiModelProperty("专家-总人数-包含这些标签的专家总人数")
private Integer specialExpertNum = 0;

@ApiModelProperty("专家-方案合理性-擅长")
private Integer expertPlanRationalityNum = 0;



+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java View File

@@ -58,6 +58,7 @@ public class EarlyWarningListener {
String noticeMethod = event.getNoticeMethod();
String noticeContent = event.getNoticeContent();
Integer noticeType = event.getNoticeType();
Integer overTimeout = event.getOverTimeout();

//1.根据nodeId 查询到 node 去查找 未完成 项目实例关系表 找到实例
List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery()
@@ -122,7 +123,7 @@ public class EarlyWarningListener {
String taskId = hai.getTaskId();
String path = "toDoCenter/handleDuringExamine?instanceId=" +
instanceId + "&projectId=" + projectId + "&nodeId=" + nodeId + "&taskId=" + taskId;
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,timeout,pi.getInstType(),
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,timeout,overTimeout, pi.getInstType(),
hai.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()
,employeeCode,project,WarningRuleTypeEnum.PROCESS_WARNING.getCode(),noticeType,
path,batchEmployees,nodeId);


+ 10
- 9
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java View File

@@ -386,8 +386,8 @@ public class CockpitStatsStatisticsTask {
String dangzhengCode = "1020000";
String ruanyingCode = "2020000";
String caiwuCode = "5600000";
String xinxihuaCode = "5400000";
String xinchuangOtherCode = "5500000";
List<String> specialTags = Lists.newArrayList(networkCode,xinchuangCode,fanganCode,jishuCode,
dangzhengCode,ruanyingCode,caiwuCode);

cockpitStats.setExpertTotalNum(experts.size());
Integer financialNum = 0;
@@ -398,10 +398,11 @@ public class CockpitStatsStatisticsTask {
Integer partyGovInfoNum = 0;
Integer softHardPricingNum = 0;
Integer technicalFeasibilityAssessmentNum = 0;
Integer xinchuangOtherNum = 0;
Integer specialExpertNum = 0;
for(ExpertUserFullInfo e : experts){
if(tagMap.containsKey(e.getUserId())){
List<ExpertTag> expertTags = tagMap.get(e.getUserId());
Boolean isContain = Boolean.FALSE;
for(ExpertTag expertTag : expertTags){
if(expertTag.getTagCode().equals(networkCode)){
networkSecurityNum++;
@@ -424,13 +425,13 @@ public class CockpitStatsStatisticsTask {
if(expertTag.getTagCode().equals(ruanyingCode)){
softHardPricingNum ++;
}
if(expertTag.getTagCode().equals(xinxihuaCode)){
promotionInfoTechnologyNum++;
}
if(expertTag.getTagCode().equals(xinchuangOtherCode)){
xinchuangOtherNum++;
if(specialTags.contains(expertTag.getTagCode())){
isContain = Boolean.TRUE;
}
}
if(isContain){
specialExpertNum ++;
}
}
}
//财务专家
@@ -443,7 +444,7 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setExpertPartyGovInfoNum(partyGovInfoNum);
cockpitStats.setExpertSoftHardPricingNum(softHardPricingNum);
cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(technicalFeasibilityAssessmentNum);
cockpitStats.setExpertXinchuangOtherNum(xinchuangOtherNum);
cockpitStats.setSpecialExpertNum(specialExpertNum);

//3.顶部数据
//3.1 计划项目数(申报项目:完成年度计划的项目总数


+ 5
- 6
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java View File

@@ -32,14 +32,12 @@ import com.wflow.service.IEarlyWarningService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -232,9 +230,10 @@ public class EarlyWarningInstanceNotStartTask {
for(Integer noticeType : noticeTypes) {
for (String employeeCode : batchEmployees) {
earlyWarningManage.doEarlyWarning(noticeMethod, Objects.nonNull(noticeType) && noticeType.equals(1) ? noticeContent : adventContent,
Objects.nonNull(noticeType) && noticeType.equals(1) ? time : adventTime, biz,
adventTime,time, biz,
needToWaringProject.getUpdateOn(),employeeCode, needToWaringProject,
WarningRuleTypeEnum.DECLARED_WARNING.getCode(), noticeType, path, batchEmployeesStr,null);
WarningRuleTypeEnum.DECLARED_WARNING.getCode(), noticeType, path, batchEmployeesStr,
null);
}
}
}
@@ -430,7 +429,7 @@ public class EarlyWarningInstanceNotStartTask {
for(Integer noticeType : noticeTypes){
for (String employeeCode : batchEmployees) {
earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&&noticeType.equals(1) ? noticeContent : adventContent,
Objects.nonNull(noticeType) && noticeType.equals(1) ? time : adventTime,biz,
adventTime,time,biz,
needToWaringProject.getUpdateOn(),employeeCode,needToWaringProject,
WarningRuleTypeEnum.OPERATION_WARNING.getCode(),noticeType,path,
batchEmployees.stream().collect(Collectors.joining(StrPool.COMMA)),null);
@@ -548,7 +547,7 @@ public class EarlyWarningInstanceNotStartTask {
List<Integer> noticeTypes = noticeTypeMap.get(needToWaringProject.getProjectCode());
for(Integer noticeType : noticeTypes){
earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&&noticeType.equals(1) ? noticeContent : adventContent,
Objects.nonNull(noticeType) && noticeType.equals(1) ? time : adventTime,null,
adventTime,time,null,
needToWaringProject.getUpdateOn(),user.getEmployeeCode(),project,
WarningRuleTypeEnum.RENEWAL_FUND.getCode(),noticeType,path,employeesStr,needToWaringProject.getId().toString());
}


+ 79
- 10
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java View File

@@ -16,6 +16,7 @@ import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.yxt.model.cmd.SendSmsCmd;
import com.wflow.enums.WarningNoticeTypeEnum;
import com.wflow.enums.WarningRuleTypeEnum;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -51,12 +52,12 @@ public class EarlyWarningManage {
* 预警通知
* @param noticeMethod
* @param noticeContent
* @param timeout
* @param adventTimeout
* @param employeeCode
* @param project
*/
public void doEarlyWarning(String noticeMethod,String noticeContent, Integer timeout,Integer biz,
LocalDateTime startTime,String employeeCode,
public void doEarlyWarning(String noticeMethod,String noticeContent, Integer adventTimeout,Integer overTimeout,
Integer biz, LocalDateTime startTime,String employeeCode,
Project project,Integer ruleType,Integer noticeType,
String path,String batchEmployees,String nodeId) {
//1.存入 预警记录
@@ -66,22 +67,53 @@ public class EarlyWarningManage {

switch (WarningRuleTypeEnum.checkByCode(ruleType)){
case PROCESS_WARNING:
content = convertContent(noticeContent,project.getProjectName(),
InstTypeEnum.getByCode(biz),timeout);
if(Objects.isNull(noticeType)){
content = convertContent(noticeContent,project.getProjectName(),
InstTypeEnum.getByCode(biz),overTimeout);
}else if(noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) {
content = convertAdventContent(noticeContent,project.getProjectName(),
InstTypeEnum.getByCode(biz),adventTimeout,overTimeout);
}else{
content = convertContent(noticeContent,project.getProjectName(),
InstTypeEnum.getByCode(biz),overTimeout);
}
records.setRuleType(WarningRuleTypeEnum.PROCESS_WARNING.getCode());
break;
case DECLARED_WARNING:
content = convertContent(noticeContent,project.getProjectName(),
WarningFlowTypeEnum.getByCode(biz),timeout);
if(Objects.isNull(noticeType)){
content = convertContent(noticeContent,project.getProjectName(),
WarningFlowTypeEnum.getByCode(biz),overTimeout);
}else if(noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) {
content = convertAdventContent(noticeContent,project.getProjectName(),
WarningFlowTypeEnum.getByCode(biz),adventTimeout,overTimeout);
}else{
content = convertContent(noticeContent,project.getProjectName(),
WarningFlowTypeEnum.getByCode(biz),overTimeout);
}
records.setRuleType(WarningRuleTypeEnum.DECLARED_WARNING.getCode());
break;
case OPERATION_WARNING:
content = convertContent(noticeContent,project.getProjectName(),
WarningOperationTypeEnum.getByCode(biz),timeout);
if(Objects.isNull(noticeType)){
content = convertContent(noticeContent,project.getProjectName(),
WarningOperationTypeEnum.getByCode(biz),overTimeout);
}else if(noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) {
content = convertAdventContent(noticeContent,project.getProjectName(),
WarningOperationTypeEnum.getByCode(biz),adventTimeout,overTimeout);
}else{
content = convertContent(noticeContent,project.getProjectName(),
WarningOperationTypeEnum.getByCode(biz),overTimeout);
}
records.setRuleType(WarningRuleTypeEnum.OPERATION_WARNING.getCode());
break;
case RENEWAL_FUND:
content = convertContent(noticeContent,project.getProjectName(),timeout);
if(Objects.isNull(noticeType)){
content = convertContent(noticeContent,project.getProjectName(),overTimeout);
}else if(noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) {
content = convertAdventContent(noticeContent,project.getProjectName(),adventTimeout,overTimeout);
}else{
content = convertContent(noticeContent,project.getProjectName(),overTimeout);
}

records.setRuleType(WarningRuleTypeEnum.RENEWAL_FUND.getCode());
break;
default:
@@ -147,6 +179,13 @@ public class EarlyWarningManage {
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}
private String convertAdventContent(String noticeContent, String projectName, Integer timeout,Integer overTimeOut) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{time}",String.valueOf(timeout))
.replace("{time2}",String.valueOf((overTimeOut - timeout)));
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}

/**
* 转换出 通知的内容
@@ -165,6 +204,16 @@ public class EarlyWarningManage {
return noticeContent;
}

private String convertAdventContent(String noticeContent, String projectName, InstTypeEnum instTypeEnum, Integer timeout,Integer overTimeOut) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{flowType}",Objects.nonNull(instTypeEnum) ? instTypeEnum.getDesc() : "{flowType}")
.replace("{stepName}",Objects.nonNull(instTypeEnum) ? instTypeEnum.getDesc() : "{stepName}")
.replace("{time}",String.valueOf(timeout))
.replace("{time2}",String.valueOf((overTimeOut - timeout)));
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}

private String convertContent(String noticeContent, String projectName, WarningFlowTypeEnum warningFlowTypeEnum, Integer timeout) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{flowType}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{flowType}")
@@ -174,6 +223,16 @@ public class EarlyWarningManage {
return noticeContent;
}

private String convertAdventContent(String noticeContent, String projectName, WarningFlowTypeEnum warningFlowTypeEnum, Integer timeout,Integer overTimeout) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{flowType}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{flowType}")
.replace("{stepName}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{stepName}")
.replace("{time}",String.valueOf(timeout))
.replace("{time2}",String.valueOf((overTimeout - timeout)));
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}

private String convertContent(String noticeContent, String projectName, WarningOperationTypeEnum operationTypeEnum, Integer timeout) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{flowType}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{flowType}")
@@ -182,4 +241,14 @@ public class EarlyWarningManage {
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}

private String convertAdventContent(String noticeContent, String projectName, WarningOperationTypeEnum operationTypeEnum, Integer timeout,Integer overTimeout) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{flowType}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{flowType}")
.replace("{stepName}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{stepName}")
.replace("{time}",String.valueOf(timeout))
.replace("{time2}",String.valueOf((overTimeout - timeout)));
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}
}

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

@@ -293,7 +293,8 @@ public class WorkbenchManage {
Long between = ChronoUnit.HOURS.between(instStart,LocalDateTime.now());
Integer times = 0;
for(String employee : employees){
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue(),biz,
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue()
,between.intValue(),biz,
instStart,employee,project,
ruleType,noticeType,path,batchEmployees,record.getNodeId());
times++;


Loading…
Cancel
Save