@@ -101,6 +101,9 @@ public class CockpitStats implements Serializable { | |||||
@ApiModelProperty("专家-总人数") | @ApiModelProperty("专家-总人数") | ||||
private Integer expertTotalNum = 0; | private Integer expertTotalNum = 0; | ||||
@ApiModelProperty("专家-总人数-包含这些标签的专家总人数") | |||||
private Integer specialExpertNum = 0; | |||||
@ApiModelProperty("专家-方案合理性-擅长") | @ApiModelProperty("专家-方案合理性-擅长") | ||||
private Integer expertPlanRationalityNum = 0; | private Integer expertPlanRationalityNum = 0; | ||||
@@ -58,6 +58,7 @@ public class EarlyWarningListener { | |||||
String noticeMethod = event.getNoticeMethod(); | String noticeMethod = event.getNoticeMethod(); | ||||
String noticeContent = event.getNoticeContent(); | String noticeContent = event.getNoticeContent(); | ||||
Integer noticeType = event.getNoticeType(); | Integer noticeType = event.getNoticeType(); | ||||
Integer overTimeout = event.getOverTimeout(); | |||||
//1.根据nodeId 查询到 node 去查找 未完成 项目实例关系表 找到实例 | //1.根据nodeId 查询到 node 去查找 未完成 项目实例关系表 找到实例 | ||||
List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery() | List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery() | ||||
@@ -122,7 +123,7 @@ public class EarlyWarningListener { | |||||
String taskId = hai.getTaskId(); | String taskId = hai.getTaskId(); | ||||
String path = "toDoCenter/handleDuringExamine?instanceId=" + | String path = "toDoCenter/handleDuringExamine?instanceId=" + | ||||
instanceId + "&projectId=" + projectId + "&nodeId=" + nodeId + "&taskId=" + taskId; | 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() | hai.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime() | ||||
,employeeCode,project,WarningRuleTypeEnum.PROCESS_WARNING.getCode(),noticeType, | ,employeeCode,project,WarningRuleTypeEnum.PROCESS_WARNING.getCode(),noticeType, | ||||
path,batchEmployees,nodeId); | path,batchEmployees,nodeId); | ||||
@@ -386,8 +386,8 @@ public class CockpitStatsStatisticsTask { | |||||
String dangzhengCode = "1020000"; | String dangzhengCode = "1020000"; | ||||
String ruanyingCode = "2020000"; | String ruanyingCode = "2020000"; | ||||
String caiwuCode = "5600000"; | 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()); | cockpitStats.setExpertTotalNum(experts.size()); | ||||
Integer financialNum = 0; | Integer financialNum = 0; | ||||
@@ -398,10 +398,11 @@ public class CockpitStatsStatisticsTask { | |||||
Integer partyGovInfoNum = 0; | Integer partyGovInfoNum = 0; | ||||
Integer softHardPricingNum = 0; | Integer softHardPricingNum = 0; | ||||
Integer technicalFeasibilityAssessmentNum = 0; | Integer technicalFeasibilityAssessmentNum = 0; | ||||
Integer xinchuangOtherNum = 0; | |||||
Integer specialExpertNum = 0; | |||||
for(ExpertUserFullInfo e : experts){ | for(ExpertUserFullInfo e : experts){ | ||||
if(tagMap.containsKey(e.getUserId())){ | if(tagMap.containsKey(e.getUserId())){ | ||||
List<ExpertTag> expertTags = tagMap.get(e.getUserId()); | List<ExpertTag> expertTags = tagMap.get(e.getUserId()); | ||||
Boolean isContain = Boolean.FALSE; | |||||
for(ExpertTag expertTag : expertTags){ | for(ExpertTag expertTag : expertTags){ | ||||
if(expertTag.getTagCode().equals(networkCode)){ | if(expertTag.getTagCode().equals(networkCode)){ | ||||
networkSecurityNum++; | networkSecurityNum++; | ||||
@@ -424,13 +425,13 @@ public class CockpitStatsStatisticsTask { | |||||
if(expertTag.getTagCode().equals(ruanyingCode)){ | if(expertTag.getTagCode().equals(ruanyingCode)){ | ||||
softHardPricingNum ++; | 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.setExpertPartyGovInfoNum(partyGovInfoNum); | ||||
cockpitStats.setExpertSoftHardPricingNum(softHardPricingNum); | cockpitStats.setExpertSoftHardPricingNum(softHardPricingNum); | ||||
cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(technicalFeasibilityAssessmentNum); | cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(technicalFeasibilityAssessmentNum); | ||||
cockpitStats.setExpertXinchuangOtherNum(xinchuangOtherNum); | |||||
cockpitStats.setSpecialExpertNum(specialExpertNum); | |||||
//3.顶部数据 | //3.顶部数据 | ||||
//3.1 计划项目数(申报项目:完成年度计划的项目总数 | //3.1 计划项目数(申报项目:完成年度计划的项目总数 | ||||
@@ -32,14 +32,12 @@ import com.wflow.service.IEarlyWarningService; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.checkerframework.checker.nullness.qual.Nullable; | |||||
import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.net.InetAddress; | import java.net.InetAddress; | ||||
import java.net.UnknownHostException; | import java.net.UnknownHostException; | ||||
import java.time.*; | import java.time.*; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
@@ -232,9 +230,10 @@ public class EarlyWarningInstanceNotStartTask { | |||||
for(Integer noticeType : noticeTypes) { | for(Integer noticeType : noticeTypes) { | ||||
for (String employeeCode : batchEmployees) { | for (String employeeCode : batchEmployees) { | ||||
earlyWarningManage.doEarlyWarning(noticeMethod, Objects.nonNull(noticeType) && noticeType.equals(1) ? noticeContent : adventContent, | 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, | 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(Integer noticeType : noticeTypes){ | ||||
for (String employeeCode : batchEmployees) { | for (String employeeCode : batchEmployees) { | ||||
earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&¬iceType.equals(1) ? noticeContent : adventContent, | earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&¬iceType.equals(1) ? noticeContent : adventContent, | ||||
Objects.nonNull(noticeType) && noticeType.equals(1) ? time : adventTime,biz, | |||||
adventTime,time,biz, | |||||
needToWaringProject.getUpdateOn(),employeeCode,needToWaringProject, | needToWaringProject.getUpdateOn(),employeeCode,needToWaringProject, | ||||
WarningRuleTypeEnum.OPERATION_WARNING.getCode(),noticeType,path, | WarningRuleTypeEnum.OPERATION_WARNING.getCode(),noticeType,path, | ||||
batchEmployees.stream().collect(Collectors.joining(StrPool.COMMA)),null); | batchEmployees.stream().collect(Collectors.joining(StrPool.COMMA)),null); | ||||
@@ -548,7 +547,7 @@ public class EarlyWarningInstanceNotStartTask { | |||||
List<Integer> noticeTypes = noticeTypeMap.get(needToWaringProject.getProjectCode()); | List<Integer> noticeTypes = noticeTypeMap.get(needToWaringProject.getProjectCode()); | ||||
for(Integer noticeType : noticeTypes){ | for(Integer noticeType : noticeTypes){ | ||||
earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&¬iceType.equals(1) ? noticeContent : adventContent, | earlyWarningManage.doEarlyWarning(noticeMethod,Objects.nonNull(noticeType)&¬iceType.equals(1) ? noticeContent : adventContent, | ||||
Objects.nonNull(noticeType) && noticeType.equals(1) ? time : adventTime,null, | |||||
adventTime,time,null, | |||||
needToWaringProject.getUpdateOn(),user.getEmployeeCode(),project, | needToWaringProject.getUpdateOn(),user.getEmployeeCode(),project, | ||||
WarningRuleTypeEnum.RENEWAL_FUND.getCode(),noticeType,path,employeesStr,needToWaringProject.getId().toString()); | WarningRuleTypeEnum.RENEWAL_FUND.getCode(),noticeType,path,employeesStr,needToWaringProject.getId().toString()); | ||||
} | } | ||||
@@ -16,6 +16,7 @@ import com.ningdatech.pmapi.sys.service.INotifyService; | |||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | ||||
import com.ningdatech.yxt.model.cmd.SendSmsCmd; | import com.ningdatech.yxt.model.cmd.SendSmsCmd; | ||||
import com.wflow.enums.WarningNoticeTypeEnum; | |||||
import com.wflow.enums.WarningRuleTypeEnum; | import com.wflow.enums.WarningRuleTypeEnum; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
@@ -51,12 +52,12 @@ public class EarlyWarningManage { | |||||
* 预警通知 | * 预警通知 | ||||
* @param noticeMethod | * @param noticeMethod | ||||
* @param noticeContent | * @param noticeContent | ||||
* @param timeout | |||||
* @param adventTimeout | |||||
* @param employeeCode | * @param employeeCode | ||||
* @param project | * @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, | Project project,Integer ruleType,Integer noticeType, | ||||
String path,String batchEmployees,String nodeId) { | String path,String batchEmployees,String nodeId) { | ||||
//1.存入 预警记录 | //1.存入 预警记录 | ||||
@@ -66,22 +67,53 @@ public class EarlyWarningManage { | |||||
switch (WarningRuleTypeEnum.checkByCode(ruleType)){ | switch (WarningRuleTypeEnum.checkByCode(ruleType)){ | ||||
case PROCESS_WARNING: | 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()); | records.setRuleType(WarningRuleTypeEnum.PROCESS_WARNING.getCode()); | ||||
break; | break; | ||||
case DECLARED_WARNING: | 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()); | records.setRuleType(WarningRuleTypeEnum.DECLARED_WARNING.getCode()); | ||||
break; | break; | ||||
case OPERATION_WARNING: | 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()); | records.setRuleType(WarningRuleTypeEnum.OPERATION_WARNING.getCode()); | ||||
break; | break; | ||||
case RENEWAL_FUND: | 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()); | records.setRuleType(WarningRuleTypeEnum.RENEWAL_FUND.getCode()); | ||||
break; | break; | ||||
default: | default: | ||||
@@ -147,6 +179,13 @@ public class EarlyWarningManage { | |||||
log.info("通知内容 :{}",noticeContent); | log.info("通知内容 :{}",noticeContent); | ||||
return 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; | 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) { | private String convertContent(String noticeContent, String projectName, WarningFlowTypeEnum warningFlowTypeEnum, Integer timeout) { | ||||
noticeContent = noticeContent.replace("{projectName}",projectName) | noticeContent = noticeContent.replace("{projectName}",projectName) | ||||
.replace("{flowType}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{flowType}") | .replace("{flowType}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{flowType}") | ||||
@@ -174,6 +223,16 @@ public class EarlyWarningManage { | |||||
return noticeContent; | 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) { | private String convertContent(String noticeContent, String projectName, WarningOperationTypeEnum operationTypeEnum, Integer timeout) { | ||||
noticeContent = noticeContent.replace("{projectName}",projectName) | noticeContent = noticeContent.replace("{projectName}",projectName) | ||||
.replace("{flowType}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{flowType}") | .replace("{flowType}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{flowType}") | ||||
@@ -182,4 +241,14 @@ public class EarlyWarningManage { | |||||
log.info("通知内容 :{}",noticeContent); | log.info("通知内容 :{}",noticeContent); | ||||
return 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; | |||||
} | |||||
} | } |
@@ -293,7 +293,8 @@ public class WorkbenchManage { | |||||
Long between = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); | Long between = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); | ||||
Integer times = 0; | Integer times = 0; | ||||
for(String employee : employees){ | for(String employee : employees){ | ||||
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue(),biz, | |||||
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,between.intValue() | |||||
,between.intValue(),biz, | |||||
instStart,employee,project, | instStart,employee,project, | ||||
ruleType,noticeType,path,batchEmployees,record.getNodeId()); | ruleType,noticeType,path,batchEmployees,record.getNodeId()); | ||||
times++; | times++; | ||||