@@ -60,127 +60,126 @@ public class EarlyWarningStatisticsManage { | |||||
private final TaskService taskService; | private final TaskService taskService; | ||||
private static final List<Integer> threeYears = Lists.newArrayList(LocalDateTime.now().getYear() - 2, | private static final List<Integer> threeYears = Lists.newArrayList(LocalDateTime.now().getYear() - 2, | ||||
LocalDateTime.now().getYear() - 1,LocalDateTime.now().getYear()); | |||||
LocalDateTime.now().getYear() - 1, LocalDateTime.now().getYear()); | |||||
public EarlyWarningStatisticsVO statistics(Integer year) { | public EarlyWarningStatisticsVO statistics(Integer year) { | ||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | UserInfoDetails user = LoginUserUtil.loginUserDetail(); | ||||
//项目 | //项目 | ||||
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class) | List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class) | ||||
.eq(Project::getNewest, Boolean.TRUE)); | |||||
.eq(Project::getNewest, Boolean.TRUE)); | |||||
EarlyWarningStatisticsVO res = new EarlyWarningStatisticsVO(); | EarlyWarningStatisticsVO res = new EarlyWarningStatisticsVO(); | ||||
LambdaQueryWrapper<WflowEarlyWarningRecords> wrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class); | LambdaQueryWrapper<WflowEarlyWarningRecords> wrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class); | ||||
EarlyWarningUtil.buildPermissionWrapper(wrapper,user); | |||||
EarlyWarningUtil.buildPermissionWrapper(wrapper, user); | |||||
List<WflowEarlyWarningRecords> records = earlyWarningRecordsService.list(wrapper); | List<WflowEarlyWarningRecords> records = earlyWarningRecordsService.list(wrapper); | ||||
//累积总告警数 | //累积总告警数 | ||||
res.setAccumulatedAlarmsTotal(records.size()); | res.setAccumulatedAlarmsTotal(records.size()); | ||||
res.setAccumulatedAlarmsFlow(records.stream().filter(a -> { | |||||
res.setAccumulatedAlarmsFlow((int) records.stream().filter(a -> { | |||||
if (Objects.nonNull(a.getRuleType()) && | if (Objects.nonNull(a.getRuleType()) && | ||||
a.getRuleType().equals(WarningRuleTypeEnum.PROCESS_WARNING.getCode())) { | a.getRuleType().equals(WarningRuleTypeEnum.PROCESS_WARNING.getCode())) { | ||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size()); | |||||
res.setAccumulatedAlarmsFilling(records.stream().filter(a -> { | |||||
}).count()); | |||||
res.setAccumulatedAlarmsFilling((int) records.stream().filter(a -> { | |||||
if (Objects.nonNull(a.getRuleType()) && | if (Objects.nonNull(a.getRuleType()) && | ||||
a.getRuleType().equals(WarningRuleTypeEnum.DECLARED_WARNING.getCode())) { | a.getRuleType().equals(WarningRuleTypeEnum.DECLARED_WARNING.getCode())) { | ||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size()); | |||||
}).count()); | |||||
//近三年 | //近三年 | ||||
List<DataDTO> threeYearsAlarms = Lists.newArrayList(); | List<DataDTO> threeYearsAlarms = Lists.newArrayList(); | ||||
for(Integer thisYear : threeYears){ | |||||
for (Integer thisYear : threeYears) { | |||||
DataDTO yearData = new DataDTO(); | DataDTO yearData = new DataDTO(); | ||||
yearData.setName(thisYear.toString()); | yearData.setName(thisYear.toString()); | ||||
yearData.setNum(records.stream().filter(r -> { | |||||
if(Objects.nonNull(r.getWarningTime()) && | |||||
thisYear.equals(r.getWarningTime().getYear())){ | |||||
yearData.setNum((int) records.stream().filter(r -> { | |||||
if (Objects.nonNull(r.getWarningTime()) && | |||||
thisYear.equals(r.getWarningTime().getYear())) { | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size()); | |||||
}).count()); | |||||
threeYearsAlarms.add(yearData); | threeYearsAlarms.add(yearData); | ||||
} | } | ||||
res.setThreeYearsAlarms(threeYearsAlarms); | res.setThreeYearsAlarms(threeYearsAlarms); | ||||
//当前各流程报警数 | //当前各流程报警数 | ||||
List<DataDTO> alarmsFlowsNow = Lists.newArrayList(); | List<DataDTO> alarmsFlowsNow = Lists.newArrayList(); | ||||
for(ProjectProcessStageEnum stageEnum : ProjectProcessStageEnum.values()){ | |||||
for (ProjectProcessStageEnum stageEnum : ProjectProcessStageEnum.values()) { | |||||
String processName = stageEnum.getDesc(); | String processName = stageEnum.getDesc(); | ||||
Integer processType = stageEnum.getCode(); | Integer processType = stageEnum.getCode(); | ||||
alarmsFlowsNow.add(DataDTO.of(processName,computeFlowWarningNow(processType,records))); | |||||
alarmsFlowsNow.add(DataDTO.of(processName, computeFlowWarningNow(processType, records))); | |||||
} | } | ||||
res.setAlarmsFlowsNow(alarmsFlowsNow); | res.setAlarmsFlowsNow(alarmsFlowsNow); | ||||
//当前各填报报警数 | //当前各填报报警数 | ||||
List<DataDTO> alarmsFillingNow = Lists.newArrayList(); | List<DataDTO> alarmsFillingNow = Lists.newArrayList(); | ||||
for(WarningFlowTypeEnum fillingEnum : WarningFlowTypeEnum.values()){ | |||||
for (WarningFlowTypeEnum fillingEnum : WarningFlowTypeEnum.values()) { | |||||
String processName = fillingEnum.getDesc(); | String processName = fillingEnum.getDesc(); | ||||
Integer projectStutas = fillingEnum.getProjectStutas(); | |||||
alarmsFillingNow.add(DataDTO.of(processName,computeFillingNow(projectStutas,records,projects))); | |||||
Integer projectStatus = fillingEnum.getProjectStutas(); | |||||
alarmsFillingNow.add(DataDTO.of(processName, computeFillingNow(projectStatus, records, projects))); | |||||
} | } | ||||
res.setAlarmsFillingNow(alarmsFillingNow); | res.setAlarmsFillingNow(alarmsFillingNow); | ||||
//实施预警 | //实施预警 | ||||
List<DataDTO> alarmsConstruction = Lists.newArrayList(); | List<DataDTO> alarmsConstruction = Lists.newArrayList(); | ||||
for(WarningNoticeTypeEnum noticeTypeEnum : WarningNoticeTypeEnum.values()){ | |||||
for (WarningNoticeTypeEnum noticeTypeEnum : WarningNoticeTypeEnum.values()) { | |||||
String name = noticeTypeEnum.getDesc(); | String name = noticeTypeEnum.getDesc(); | ||||
Integer noticeType = noticeTypeEnum.getCode(); | Integer noticeType = noticeTypeEnum.getCode(); | ||||
alarmsConstruction.add(DataDTO.of(name,computeConstruction(noticeType,records,projects))); | |||||
alarmsConstruction.add(DataDTO.of(name, computeConstruction(noticeType, records, projects))); | |||||
} | } | ||||
res.setConstructionAlarms(alarmsConstruction); | res.setConstructionAlarms(alarmsConstruction); | ||||
//安全监测 | //安全监测 | ||||
List<DataDTO> safetyMonitoring = Lists.newArrayList(); | List<DataDTO> safetyMonitoring = Lists.newArrayList(); | ||||
//--1 安全设计 | //--1 安全设计 | ||||
safetyMonitoring.add(DataDTO.of("安全设计",0)); | |||||
safetyMonitoring.add(DataDTO.of("安全设计", 0)); | |||||
//--2 安全投入低于5% | //--2 安全投入低于5% | ||||
safetyMonitoring.add(DataDTO.of("安全投入低于5%",computeSafeLessFive(projects))); | |||||
safetyMonitoring.add(DataDTO.of("安全投入低于5%", computeSafeLessFive(projects))); | |||||
//--3 非信创 | //--3 非信创 | ||||
safetyMonitoring.add(DataDTO.of("非信创",computeNotXinChuang(projects))); | |||||
safetyMonitoring.add(DataDTO.of("非信创", computeNotXinChuang(projects))); | |||||
//--4 等保未做 | //--4 等保未做 | ||||
safetyMonitoring.add(DataDTO.of("等保未做",0)); | |||||
safetyMonitoring.add(DataDTO.of("等保未做", 0)); | |||||
//--5 密评未做 | //--5 密评未做 | ||||
safetyMonitoring.add(DataDTO.of("密评未做",0)); | |||||
safetyMonitoring.add(DataDTO.of("密评未做", 0)); | |||||
res.setSafetyMonitoring(safetyMonitoring); | res.setSafetyMonitoring(safetyMonitoring); | ||||
return res; | return res; | ||||
} | } | ||||
//计算非信创 | //计算非信创 | ||||
private Integer computeNotXinChuang(List<Project> projects) { | private Integer computeNotXinChuang(List<Project> projects) { | ||||
return projects.stream().filter(p -> StringUtils.isNotBlank(p.getCloudType()) && | |||||
!p.getCloudType().contains("2")) | |||||
.collect(Collectors.toList()).size(); | |||||
return (int) projects.stream().filter(p -> StringUtils.isNotBlank(p.getCloudType()) && | |||||
!p.getCloudType().contains("2")).count(); | |||||
} | } | ||||
//计算安全投入低于5% | //计算安全投入低于5% | ||||
private Integer computeSafeLessFive(List<Project> projects) { | private Integer computeSafeLessFive(List<Project> projects) { | ||||
return projects.stream().filter(p -> { | |||||
return (int) projects.stream().filter(p -> { | |||||
//计算出 安全投入 | //计算出 安全投入 | ||||
BigDecimal rate = new BigDecimal(DashboardProjectManage.convertSafetyInputRate(p)); | BigDecimal rate = new BigDecimal(DashboardProjectManage.convertSafetyInputRate(p)); | ||||
if (rate.compareTo(new BigDecimal(5)) < 0) { | if (rate.compareTo(new BigDecimal(5)) < 0) { | ||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size(); | |||||
}).count(); | |||||
} | } | ||||
private Integer computeConstruction(Integer noticeType, List<WflowEarlyWarningRecords> records, | private Integer computeConstruction(Integer noticeType, List<WflowEarlyWarningRecords> records, | ||||
List<Project> projects) { | List<Project> projects) { | ||||
//终验告警 | //终验告警 | ||||
List<WflowEarlyWarningRecords> constructionRecords = records.stream().filter(r -> { | List<WflowEarlyWarningRecords> constructionRecords = records.stream().filter(r -> { | ||||
if (Objects.nonNull(r.getRuleType()) && | |||||
WarningRuleTypeEnum.OPERATION_WARNING.getCode().equals(r.getRuleType())) { | |||||
return Boolean.TRUE; | |||||
} | |||||
return Boolean.FALSE; | |||||
}).filter(r -> Objects.nonNull(r.getNoticeType()) && r.getNoticeType().equals(noticeType) && | |||||
if (Objects.nonNull(r.getRuleType()) && | |||||
WarningRuleTypeEnum.OPERATION_WARNING.getCode().equals(r.getRuleType())) { | |||||
return Boolean.TRUE; | |||||
} | |||||
return Boolean.FALSE; | |||||
}).filter(r -> Objects.nonNull(r.getNoticeType()) && r.getNoticeType().equals(noticeType) && | |||||
WarningOperationTypeEnum.ZHONGYAN.getCode().equals(r.getBiz())) | WarningOperationTypeEnum.ZHONGYAN.getCode().equals(r.getBiz())) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
if(CollUtil.isEmpty(constructionRecords)){ | |||||
if (CollUtil.isEmpty(constructionRecords)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
Map<String, List<WflowEarlyWarningRecords>> recordsMap = constructionRecords.stream().collect(Collectors.groupingBy( | Map<String, List<WflowEarlyWarningRecords>> recordsMap = constructionRecords.stream().collect(Collectors.groupingBy( | ||||
@@ -188,21 +187,21 @@ public class EarlyWarningStatisticsManage { | |||||
//待终验的项目 | //待终验的项目 | ||||
List<Project> tobeFinalProjects = projects.stream().filter(p -> { | List<Project> tobeFinalProjects = projects.stream().filter(p -> { | ||||
if(Objects.nonNull(p.getStatus()) && | |||||
p.getStatus().equals(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode())){ | |||||
return Boolean.TRUE; | |||||
} | |||||
return Boolean.FALSE; | |||||
}).collect(Collectors.toList()); | |||||
if (Objects.nonNull(p.getStatus()) && | |||||
p.getStatus().equals(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode())) { | |||||
return Boolean.TRUE; | |||||
} | |||||
return Boolean.FALSE; | |||||
}).collect(Collectors.toList()); | |||||
return tobeFinalProjects.stream().filter(p -> { | |||||
if(recordsMap.containsKey(p.getProjectCode())){ | |||||
return (int) tobeFinalProjects.stream().filter(p -> { | |||||
if (recordsMap.containsKey(p.getProjectCode())) { | |||||
List<WflowEarlyWarningRecords> warningRecords = recordsMap.get(p.getProjectCode()); | List<WflowEarlyWarningRecords> warningRecords = recordsMap.get(p.getProjectCode()); | ||||
//如果是临期的 不能包含有超期的 | //如果是临期的 不能包含有超期的 | ||||
if(noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())){ | |||||
for(WflowEarlyWarningRecords warningRecord : warningRecords){ | |||||
if(Objects.isNull(warningRecord.getNoticeType()) || warningRecord.getNoticeType() | |||||
.equals(WarningNoticeTypeEnum.OVER.getCode())){ | |||||
if (noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) { | |||||
for (WflowEarlyWarningRecords warningRecord : warningRecords) { | |||||
if (Objects.isNull(warningRecord.getNoticeType()) || warningRecord.getNoticeType() | |||||
.equals(WarningNoticeTypeEnum.OVER.getCode())) { | |||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
} | } | ||||
} | } | ||||
@@ -211,7 +210,7 @@ public class EarlyWarningStatisticsManage { | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size(); | |||||
}).count(); | |||||
} | } | ||||
private Integer computeFillingNow(Integer projectStutas, List<WflowEarlyWarningRecords> records, | private Integer computeFillingNow(Integer projectStutas, List<WflowEarlyWarningRecords> records, | ||||
@@ -223,30 +222,30 @@ public class EarlyWarningStatisticsManage { | |||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).filter(r -> Objects.nonNull(r.getNodeId())).collect(Collectors.toList()); | }).filter(r -> Objects.nonNull(r.getNodeId())).collect(Collectors.toList()); | ||||
if(CollUtil.isEmpty(fillingRecords)){ | |||||
if (CollUtil.isEmpty(fillingRecords)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
Map<String, List<WflowEarlyWarningRecords>> warningMap = fillingRecords.stream() | Map<String, List<WflowEarlyWarningRecords>> warningMap = fillingRecords.stream() | ||||
.collect(Collectors.groupingBy(WflowEarlyWarningRecords::getProjectCode)); | .collect(Collectors.groupingBy(WflowEarlyWarningRecords::getProjectCode)); | ||||
List<Project> thisStatusProjects = projects.stream().filter(p -> { | List<Project> thisStatusProjects = projects.stream().filter(p -> { | ||||
if(Objects.nonNull(p.getStatus()) && p.getStatus().equals(projectStutas)){ | |||||
if (Objects.nonNull(p.getStatus()) && p.getStatus().equals(projectStutas)) { | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
return thisStatusProjects.stream().filter(p -> { | |||||
if(warningMap.containsKey(p.getProjectCode())){ | |||||
return (int) thisStatusProjects.stream().filter(p -> { | |||||
if (warningMap.containsKey(p.getProjectCode())) { | |||||
//这个状态有告警 并且 这个项目也是这个类型 | //这个状态有告警 并且 这个项目也是这个类型 | ||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size(); | |||||
}).count(); | |||||
} | } | ||||
//计算某个流程当前正在告警的数量 | //计算某个流程当前正在告警的数量 | ||||
private Integer computeFlowWarningNow(Integer processType,List<WflowEarlyWarningRecords> records) { | |||||
private Integer computeFlowWarningNow(Integer processType, List<WflowEarlyWarningRecords> records) { | |||||
List<WflowEarlyWarningRecords> processRecords = records.stream().filter(r -> { | List<WflowEarlyWarningRecords> processRecords = records.stream().filter(r -> { | ||||
if (Objects.nonNull(r.getRuleType()) && | if (Objects.nonNull(r.getRuleType()) && | ||||
WarningRuleTypeEnum.PROCESS_WARNING.getCode().equals(r.getRuleType())) { | WarningRuleTypeEnum.PROCESS_WARNING.getCode().equals(r.getRuleType())) { | ||||
@@ -254,7 +253,7 @@ public class EarlyWarningStatisticsManage { | |||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).filter(r -> Objects.nonNull(r.getNodeId())).collect(Collectors.toList()); | }).filter(r -> Objects.nonNull(r.getNodeId())).collect(Collectors.toList()); | ||||
if(CollUtil.isEmpty(processRecords)){ | |||||
if (CollUtil.isEmpty(processRecords)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
Map<String, List<WflowEarlyWarningRecords>> warningMap = processRecords.stream() | Map<String, List<WflowEarlyWarningRecords>> warningMap = processRecords.stream() | ||||
@@ -263,7 +262,7 @@ public class EarlyWarningStatisticsManage { | |||||
//1.先查出 所育 这个类型的 流程 | //1.先查出 所育 这个类型的 流程 | ||||
List<ProjectInst> proInsts = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) | List<ProjectInst> proInsts = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.eq(ProjectInst::getInstType, processType)); | .eq(ProjectInst::getInstType, processType)); | ||||
if(CollUtil.isEmpty(proInsts)){ | |||||
if (CollUtil.isEmpty(proInsts)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
//2.再筛选一下 选出 正在审核 未完成的 | //2.再筛选一下 选出 正在审核 未完成的 | ||||
@@ -275,28 +274,28 @@ public class EarlyWarningStatisticsManage { | |||||
.orderByProcessInstanceStartTime() | .orderByProcessInstanceStartTime() | ||||
.asc() | .asc() | ||||
.list(); | .list(); | ||||
if(CollUtil.isEmpty(processes)){ | |||||
if (CollUtil.isEmpty(processes)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
//查出所有正在执行的工作流任务 | //查出所有正在执行的工作流任务 | ||||
List<Task> tasks = taskService.createTaskQuery() | List<Task> tasks = taskService.createTaskQuery() | ||||
.list(); | .list(); | ||||
if(CollUtil.isEmpty(tasks)){ | |||||
if (CollUtil.isEmpty(tasks)) { | |||||
return 0; | return 0; | ||||
} | } | ||||
Map<String, List<Task>> taskMap = tasks.stream() | Map<String, List<Task>> taskMap = tasks.stream() | ||||
.collect(Collectors.groupingBy(Task::getProcessInstanceId)); | .collect(Collectors.groupingBy(Task::getProcessInstanceId)); | ||||
return processes.stream().filter(p -> { | |||||
if(taskMap.containsKey(p.getId())){ | |||||
return (int) processes.stream().filter(p -> { | |||||
if (taskMap.containsKey(p.getId())) { | |||||
List<Task> tasksThis = taskMap.get(p.getId()); | List<Task> tasksThis = taskMap.get(p.getId()); | ||||
for(Task taskThis : tasksThis){ | |||||
for (Task taskThis : tasksThis) { | |||||
//说明 当前有告警 | //说明 当前有告警 | ||||
if(warningMap.containsKey(taskThis.getTaskDefinitionKey())){ | |||||
if (warningMap.containsKey(taskThis.getTaskDefinitionKey())) { | |||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return Boolean.FALSE; | return Boolean.FALSE; | ||||
}).collect(Collectors.toList()).size(); | |||||
}).count(); | |||||
} | } | ||||
} | } |
@@ -175,7 +175,7 @@ public class MeetingCallOrMsgHelper { | |||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
public void callExpertByMeeting(Meeting meeting, List<MeetingExpert> experts) { | public void callExpertByMeeting(Meeting meeting, List<MeetingExpert> experts) { | ||||
String voiceContent = String.format(VoiceSmsTemplateConst.OFFLINE_TEMPLATE, | |||||
String voiceContent = String.format(VoiceSmsTemplateConst.EXPERT_INVITE, | |||||
meeting.getHoldOrg(), meeting.getName(), officialTime(meeting.getStartTime()), | meeting.getHoldOrg(), meeting.getName(), officialTime(meeting.getStartTime()), | ||||
meeting.getMeetingAddress()); | meeting.getMeetingAddress()); | ||||
List<SubmitTaskCallContext> callContexts = CollUtils.convert(experts, w -> { | List<SubmitTaskCallContext> callContexts = CollUtils.convert(experts, w -> { | ||||
@@ -0,0 +1,18 @@ | |||||
package com.hz.pm.api.projectlib.controller; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.stereotype.Controller; | |||||
/** | |||||
* <p> | |||||
* 前端控制器 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
@Controller | |||||
@RequestMapping("/api.projectlib/mhProject") | |||||
public class MhProjectController { | |||||
} |
@@ -542,7 +542,7 @@ public class ProjectLibManage { | |||||
item.setApproveUsers(buildApproveUsers(w.getInstCode(), map, userMap)); | item.setApproveUsers(buildApproveUsers(w.getInstCode(), map, userMap)); | ||||
if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus()) | if (user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.eq(item.getStatus()) | ||||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) | && StringUtils.isNotBlank(w.getSuperOrgCode()) | ||||
&& w.getSuperOrgCode().equals(user.getMhUserId())) { | |||||
&& w.getSuperOrgCode().equals(user.getMhUnitIdStr())) { | |||||
item.setCanPreDeclared(Boolean.TRUE); | item.setCanPreDeclared(Boolean.TRUE); | ||||
} | } | ||||
item.setApprovedAmount(w.getApprovalAmount()); | item.setApprovedAmount(w.getApprovalAmount()); | ||||
@@ -685,8 +685,7 @@ public class ProjectLibManage { | |||||
.eq(PaymentPlan::getProjectCode, projectInfo.getProjectCode()) | .eq(PaymentPlan::getProjectCode, projectInfo.getProjectCode()) | ||||
.orderByAsc(PaymentPlan::getPaymentTime)); | .orderByAsc(PaymentPlan::getPaymentTime)); | ||||
if (Objects.nonNull(contractVO)) { | if (Objects.nonNull(contractVO)) { | ||||
contractVO.setPayments(convertPayments(payments, | |||||
contractVO.getTotalAmount())); | |||||
contractVO.setPayments(convertPayments(payments, contractVO.getTotalAmount())); | |||||
} | } | ||||
//查询实施信息 | //查询实施信息 | ||||
@@ -775,8 +774,7 @@ public class ProjectLibManage { | |||||
* @param instanceId | * @param instanceId | ||||
* @return | * @return | ||||
*/ | */ | ||||
public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId, | |||||
Long userId) { | |||||
public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId, Long userId) { | |||||
Project project = saveProjectNewVersion(projectDto, instanceId, userId, Boolean.FALSE); | Project project = saveProjectNewVersion(projectDto, instanceId, userId, Boolean.FALSE); | ||||
//保存项目和实例的关系 | //保存项目和实例的关系 | ||||
ProjectInst projectInst = new ProjectInst(); | ProjectInst projectInst = new ProjectInst(); | ||||
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectlib.mapper; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProject; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
public interface MhProjectMapper extends BaseMapper<MhProject> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.hz.pm.api.projectlib.mapper.MhProjectMapper"> | |||||
</mapper> |
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectlib.mapper; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
public interface MhProjectSchemaTargetDataMapper extends BaseMapper<MhProjectSchemaTargetData> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.hz.pm.api.projectlib.mapper.MhProjectSchemaTargetDataMapper"> | |||||
</mapper> |
@@ -0,0 +1,56 @@ | |||||
package com.hz.pm.api.projectlib.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.math.BigDecimal; | |||||
import com.hz.pm.api.external.model.dto.MhProjectSchemeTargetDTO; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
/** | |||||
* <p> | |||||
* 信产项目信息 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
@Data | |||||
@TableName("MH_PROJECT") | |||||
@ApiModel(value = "MhProject对象") | |||||
public class MhProject implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@TableId(value = "ID", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty("项目合规性检查附件") | |||||
private String fileId; | |||||
@ApiModelProperty("项目复核附件") | |||||
private String fileIdThree; | |||||
@ApiModelProperty("项目评审附件") | |||||
private String fileIdTwo; | |||||
@ApiModelProperty("项目评审预算金额") | |||||
private BigDecimal money; | |||||
@ApiModelProperty("项目名称") | |||||
private String projectName; | |||||
@ApiModelProperty("项目总金额") | |||||
private BigDecimal totalMoney; | |||||
@ApiModelProperty("单位ID") | |||||
private Long unitId; | |||||
@ApiModelProperty("单位名称") | |||||
private String unitName; | |||||
} |
@@ -0,0 +1,107 @@ | |||||
package com.hz.pm.api.projectlib.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import java.io.Serializable; | |||||
import java.math.BigDecimal; | |||||
import java.time.LocalDate; | |||||
import java.util.Date; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.Getter; | |||||
/** | |||||
* <p> | |||||
* 项目关键指标信息 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
@Data | |||||
@TableName("MH_PROJECT_SCHEMA_TARGET_DATA") | |||||
@ApiModel(value = "MhProjectSchemaTargetData对象") | |||||
public class MhProjectSchemaTargetData implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@TableId(type = IdType.INPUT) | |||||
@ApiModelProperty(value = "ID") | |||||
private String id; | |||||
/** | |||||
* 信产项目ID{@link MhProject#getId()} | |||||
*/ | |||||
private Long mhProjectId; | |||||
@ApiModelProperty(value = "迁移上云信息系统数量") | |||||
private int cloudSystemNum; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "创建单位") | |||||
private Long createUnit; | |||||
@ApiModelProperty(value = "创建人") | |||||
private String createUser; | |||||
@ApiModelProperty(value = "附件") | |||||
private String fileId; | |||||
@ApiModelProperty(value = "本地部署非涉密信息系统数量") | |||||
private Integer fsmLocalSystemNum; | |||||
@ApiModelProperty(value = "更新购置非涉密服务器数量") | |||||
private Integer fsmServerNum; | |||||
@ApiModelProperty(value = "更新购置非涉密数据库数量") | |||||
private Integer fsmUpdateDbNum; | |||||
@ApiModelProperty(value = "更新购置非涉密中间件数量") | |||||
private Integer fsmUpdateMiddleNum; | |||||
@ApiModelProperty(value = "vCPU(核数)") | |||||
private Integer hostCpuNum; | |||||
@ApiModelProperty(value = "内存(GB)") | |||||
private Integer hostMemoryNum; | |||||
@ApiModelProperty(value = "信创云虚拟主机数量") | |||||
private Integer hostNum; | |||||
@ApiModelProperty(value = "存储(GB)") | |||||
private Integer hostStoreNum; | |||||
@ApiModelProperty(value = "总投资预算金额(万元)") | |||||
private BigDecimal money; | |||||
@ApiModelProperty(value = "本地部署涉密信息系统数量") | |||||
private Integer smLocalSystemNum; | |||||
@ApiModelProperty(value = "更新购置涉密服务器数量") | |||||
private Integer smServerNum; | |||||
@ApiModelProperty(value = "更新购置涉密数据库数量") | |||||
private Integer smUpdateDbNum; | |||||
@ApiModelProperty(value = "更新购置涉密中间件数量") | |||||
private Integer smUpdateMiddleNum; | |||||
@ApiModelProperty(value = "更新时间") | |||||
private Date updateTime; | |||||
@ApiModelProperty(value = "更新人") | |||||
private String updateUser; | |||||
@ApiModelProperty(value = "信创云数据库数量") | |||||
private Integer xcDbNum; | |||||
@ApiModelProperty(value = "信创云中间件数量") | |||||
private Integer xcMiddleNum; | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectlib.service; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
public interface IMhProjectSchemaTargetDataService extends IService<MhProjectSchemaTargetData> { | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.hz.pm.api.projectlib.service; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProject; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
public interface IMhProjectService extends IService<MhProject> { | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.hz.pm.api.projectlib.service.impl; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProjectSchemaTargetData; | |||||
import com.hz.pm.api.projectlib.mapper.MhProjectSchemaTargetDataMapper; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectSchemaTargetDataService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
@Service | |||||
public class MhProjectSchemaTargetDataServiceImpl extends ServiceImpl<MhProjectSchemaTargetDataMapper, MhProjectSchemaTargetData> implements IMhProjectSchemaTargetDataService { | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.hz.pm.api.projectlib.service.impl; | |||||
import com.hz.pm.api.projectlib.model.entity.MhProject; | |||||
import com.hz.pm.api.projectlib.mapper.MhProjectMapper; | |||||
import com.hz.pm.api.projectlib.service.IMhProjectService; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 2024-01-30 | |||||
*/ | |||||
@Service | |||||
public class MhProjectServiceImpl extends ServiceImpl<MhProjectMapper, MhProject> implements IMhProjectService { | |||||
} |
@@ -8,26 +8,24 @@ package com.hz.pm.api.sms.constant; | |||||
* @author WendyYang | * @author WendyYang | ||||
* @since 15:10 2023/3/30 | * @since 15:10 2023/3/30 | ||||
*/ | */ | ||||
public interface VoiceSmsTemplateConst { | |||||
public class VoiceSmsTemplateConst { | |||||
private VoiceSmsTemplateConst() { | |||||
} | |||||
/** | /** | ||||
* 短信登陆验证码 | * 短信登陆验证码 | ||||
*/ | */ | ||||
String SMS_COMMON_TEMPLATE = "验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。"; | |||||
public static final String SMS_VERIFY_CODE = "验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。"; | |||||
/** | /** | ||||
* 社会专家报名 | * 社会专家报名 | ||||
*/ | */ | ||||
String EXPERT_REGISTER = "专家报名验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。"; | |||||
public static final String EXPERT_REGISTER = "专家报名验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。"; | |||||
/** | /** | ||||
* 专家电话通知语音模版 | * 专家电话通知语音模版 | ||||
*/ | */ | ||||
String OFFLINE_TEMPLATE = "尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2。请您选择"; | |||||
/** | |||||
* 专家同意参加短信通知模板 | |||||
*/ | |||||
String EXPERT_AGREE_ATTEND_TEMPLATE = ""; | |||||
public static final String EXPERT_INVITE = "尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2。请您选择"; | |||||
} | } |
@@ -2,7 +2,7 @@ package com.hz.pm.api.sms.controller; | |||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.hz.pm.api.sms.constant.VerificationCodeType; | import com.hz.pm.api.sms.constant.VerificationCodeType; | ||||
import com.hz.pm.api.sms.manage.SmsManage; | |||||
import com.hz.pm.api.sms.manage.VerificationCodeManage; | |||||
import com.hz.pm.api.sms.model.po.ReqVerificationCodePO; | import com.hz.pm.api.sms.model.po.ReqVerificationCodePO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; | |||||
public class VerificationCodeController { | public class VerificationCodeController { | ||||
private final SmsManage smsManage; | |||||
private final VerificationCodeManage verificationCodeManage; | |||||
/** | /** | ||||
* 通用的发送验证码功能 | * 通用的发送验证码功能 | ||||
@@ -37,7 +37,7 @@ public class VerificationCodeController { | |||||
@PostMapping(value = "/send") | @PostMapping(value = "/send") | ||||
@WebLog("发送验证码") | @WebLog("发送验证码") | ||||
public void send(@Validated @RequestBody ReqVerificationCodePO request) { | public void send(@Validated @RequestBody ReqVerificationCodePO request) { | ||||
smsManage.sendVerificationCode(request); | |||||
verificationCodeManage.sendVerificationCode(request); | |||||
} | } | ||||
} | } |
@@ -14,6 +14,7 @@ import com.hz.pm.api.sms.utils.SmsRedisKeyUtils; | |||||
import com.ningdatech.yxt.client.YxtClient; | import com.ningdatech.yxt.client.YxtClient; | ||||
import com.ningdatech.yxt.constants.YxtSmsSignEnum; | import com.ningdatech.yxt.constants.YxtSmsSignEnum; | ||||
import com.ningdatech.yxt.model.cmd.SendSmsCmd; | import com.ningdatech.yxt.model.cmd.SendSmsCmd; | ||||
import com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext; | |||||
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; | ||||
@@ -32,53 +33,51 @@ import java.util.Objects; | |||||
@Slf4j | @Slf4j | ||||
@Component | @Component | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class SmsManage { | |||||
public class VerificationCodeManage { | |||||
private final YxtClient yxtClient; | private final YxtClient yxtClient; | ||||
private final CachePlusOps cachePlusOps; | private final CachePlusOps cachePlusOps; | ||||
public void sendVerificationCode(ReqVerificationCodePO request) { | |||||
Assert.isTrue(PhoneUtil.isMobile(request.getMobile()), "手机号码格式不正确"); | |||||
String verificationType = request.getVerificationType(); | |||||
VerificationCodeType verificationCodeTypeEnum = VerificationCodeType.of(verificationType); | |||||
public void sendVerificationCode(ReqVerificationCodePO req) { | |||||
Assert.isTrue(PhoneUtil.isMobile(req.getMobile()), "手机号码格式不正确"); | |||||
String verificationType = req.getVerificationType(); | |||||
VerificationCodeType codeType = VerificationCodeType.of(verificationType); | |||||
// 验证是否被锁定 | // 验证是否被锁定 | ||||
String lockKey = SmsRedisKeyUtils.smsSendLockKey(verificationCodeTypeEnum, request.getMobile()); | |||||
String lockKey = SmsRedisKeyUtils.smsSendLockKey(codeType, req.getMobile()); | |||||
if (StringUtils.isNotBlank(cachePlusOps.get(lockKey))) { | if (StringUtils.isNotBlank(cachePlusOps.get(lockKey))) { | ||||
throw BizException.wrap("今日" + verificationCodeTypeEnum.getDesc() + "的验证码发送次数过多,已被锁定"); | |||||
throw BizException.wrap("今日" + codeType.getDesc() + "的验证码发送次数过多,已被锁定"); | |||||
} | } | ||||
// 验证发送间隔 | // 验证发送间隔 | ||||
String cacheKey = SmsRedisKeyUtils.smsCodeVerifyKey(verificationCodeTypeEnum, request.getMobile()); | |||||
VerifyCodeCacheDTO preCache = (VerifyCodeCacheDTO) cachePlusOps.get(cacheKey); | |||||
if (preCache != null) { | |||||
if (LocalDateTime.now().minusMinutes(verificationCodeTypeEnum.getSendInterval()) | |||||
.isBefore(preCache.getSendTime())) { | |||||
throw BizException.wrap(verificationCodeTypeEnum.getSendInterval() + "分钟之内已发送过验证码,请稍后重试"); | |||||
} | |||||
String cacheKey = SmsRedisKeyUtils.smsCodeVerifyKey(codeType, req.getMobile()); | |||||
VerifyCodeCacheDTO preCache = cachePlusOps.get(cacheKey); | |||||
if (preCache != null && (LocalDateTime.now().minusMinutes(codeType.getSendInterval()) | |||||
.isBefore(preCache.getSendTime()))) { | |||||
throw BizException.wrap(codeType.getSendInterval() + "分钟之内已发送过验证码,请稍后重试"); | |||||
} | } | ||||
String code = RandomUtil.randomNumbers(6); | String code = RandomUtil.randomNumbers(6); | ||||
VerifyCodeCacheDTO cache = VerifyCodeCacheDTO.builder() | VerifyCodeCacheDTO cache = VerifyCodeCacheDTO.builder() | ||||
.code(code) | .code(code) | ||||
.sendTime(LocalDateTime.now()) | .sendTime(LocalDateTime.now()) | ||||
.mobile(request.getMobile()) | |||||
.mobile(req.getMobile()) | |||||
.build(); | .build(); | ||||
// 创建短信内容 | // 创建短信内容 | ||||
SendSmsCmd sendSmsCmd = new SendSmsCmd(); | SendSmsCmd sendSmsCmd = new SendSmsCmd(); | ||||
switch (verificationCodeTypeEnum) { | |||||
switch (codeType) { | |||||
case LOGIN: { | case LOGIN: { | ||||
SendSmsCmd.SendSmsContext sendSmsContext = new SendSmsCmd.SendSmsContext(); | |||||
sendSmsContext.setReceiveNumber(request.getMobile()); | |||||
sendSmsContext.setContent(String.format(VoiceSmsTemplateConst.SMS_COMMON_TEMPLATE, code, verificationCodeTypeEnum.getExpireTime())); | |||||
sendSmsCmd.setContextList(Collections.singletonList(sendSmsContext)); | |||||
SendSmsContext sendSmsCtx = new SendSmsContext(); | |||||
sendSmsCtx.setReceiveNumber(req.getMobile()); | |||||
sendSmsCtx.setContent(String.format(VoiceSmsTemplateConst.SMS_VERIFY_CODE, code, codeType.getExpireTime())); | |||||
sendSmsCmd.setContextList(Collections.singletonList(sendSmsCtx)); | |||||
sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | ||||
} | } | ||||
break; | break; | ||||
case EXPERT_REGISTER: { | case EXPERT_REGISTER: { | ||||
SendSmsCmd.SendSmsContext sendSmsContext = new SendSmsCmd.SendSmsContext(); | |||||
sendSmsContext.setReceiveNumber(request.getMobile()); | |||||
sendSmsContext.setContent(String.format(VoiceSmsTemplateConst.EXPERT_REGISTER, code, verificationCodeTypeEnum.getExpireTime())); | |||||
sendSmsCmd.setContextList(Collections.singletonList(sendSmsContext)); | |||||
SendSmsContext sendSmsCtx = new SendSmsContext(); | |||||
sendSmsCtx.setReceiveNumber(req.getMobile()); | |||||
sendSmsCtx.setContent(String.format(VoiceSmsTemplateConst.EXPERT_REGISTER, code, codeType.getExpireTime())); | |||||
sendSmsCmd.setContextList(Collections.singletonList(sendSmsCtx)); | |||||
sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | ||||
} | } | ||||
break; | break; | ||||
@@ -88,16 +87,16 @@ public class SmsManage { | |||||
// 发送 短信 | // 发送 短信 | ||||
yxtClient.submitSmsTask(sendSmsCmd); | yxtClient.submitSmsTask(sendSmsCmd); | ||||
log.info("send verificationCode mobile = {},code = {}", request.getMobile(), code); | |||||
log.info("发送短信验证码:{} -> {}", req.getMobile(), code); | |||||
cachePlusOps.set(new CacheKey(cacheKey, Duration.ofMinutes(verificationCodeTypeEnum.getExpireTime())), cache); | |||||
String limitKey = SmsRedisKeyUtils.smsSendLimitKey(verificationCodeTypeEnum, request.getMobile()); | |||||
cachePlusOps.set(new CacheKey(cacheKey, Duration.ofMinutes(codeType.getExpireTime())), cache); | |||||
String limitKey = SmsRedisKeyUtils.smsSendLimitKey(codeType, req.getMobile()); | |||||
if (Objects.nonNull(cachePlusOps.get(limitKey))) { | if (Objects.nonNull(cachePlusOps.get(limitKey))) { | ||||
Integer limitCount = cachePlusOps.get(limitKey); | Integer limitCount = cachePlusOps.get(limitKey); | ||||
cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), limitCount++); | cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), limitCount++); | ||||
// 超出单日发送次数之后直接锁定 | // 超出单日发送次数之后直接锁定 | ||||
if (limitCount >= verificationCodeTypeEnum.getSendTimesByDay().longValue()) { | |||||
cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), request.getMobile()); | |||||
if (limitCount >= codeType.getSendTimesByDay().longValue()) { | |||||
cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), req.getMobile()); | |||||
} | } | ||||
} else { | } else { | ||||
cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), 1); | cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), 1); |
@@ -345,7 +345,7 @@ public class NoticeManage { | |||||
wrapper.and(q3 -> q3.eq(Notice::getPermissions, NoticePermissionsEnum.SUPER.getCode()) | wrapper.and(q3 -> q3.eq(Notice::getPermissions, NoticePermissionsEnum.SUPER.getCode()) | ||||
.or(q1 -> q1.eq(Notice::getPermissions, NoticePermissionsEnum.REGION.getCode())) | .or(q1 -> q1.eq(Notice::getPermissions, NoticePermissionsEnum.REGION.getCode())) | ||||
.or(q2 -> q2.eq(Notice::getPermissions, NoticePermissionsEnum.ORG.getCode()) | .or(q2 -> q2.eq(Notice::getPermissions, NoticePermissionsEnum.ORG.getCode()) | ||||
.eq(Notice::getPermissionsValue, user.getMhUnitId()))); | |||||
.eq(Notice::getPermissionsValue, user.getMhUnitIdStr()))); | |||||
} | } | ||||
private void permissionsWrapperByEdit(LambdaQueryWrapper<Notice> wrapper, UserFullInfoDTO user) { | private void permissionsWrapperByEdit(LambdaQueryWrapper<Notice> wrapper, UserFullInfoDTO user) { | ||||
@@ -354,7 +354,7 @@ public class NoticeManage { | |||||
log.info(user.getUsername() + ",超管可以看所有"); | log.info(user.getUsername() + ",超管可以看所有"); | ||||
} else if (user.getIsOrgAdmin()) { | } else if (user.getIsOrgAdmin()) { | ||||
wrapper.eq(Notice::getPermissions, NoticePermissionsEnum.ORG.getCode()) | wrapper.eq(Notice::getPermissions, NoticePermissionsEnum.ORG.getCode()) | ||||
.eq(Notice::getPermissionsValue, user.getMhUnitId()); | |||||
.eq(Notice::getPermissionsValue, user.getMhUnitIdStr()); | |||||
} else { | } else { | ||||
wrapper.eq(Notice::getCreateOn, user.getUserId()); | wrapper.eq(Notice::getCreateOn, user.getUserId()); | ||||
} | } | ||||
@@ -23,10 +23,10 @@ public class EarlyWarningUtil { | |||||
if (user.getSuperAdmin() || user.getRegionAdmin()) { | if (user.getSuperAdmin() || user.getRegionAdmin()) { | ||||
// 可以看所有 | // 可以看所有 | ||||
} else if (user.getIsOrgAdmin()) { | } else if (user.getIsOrgAdmin()) { | ||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()); | |||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitIdStr()); | |||||
} else { | } else { | ||||
//否则都只能看自己单位的 | //否则都只能看自己单位的 | ||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()); | |||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitIdStr()); | |||||
} | } | ||||
} | } | ||||
@@ -36,10 +36,10 @@ public class EarlyWarningUtil { | |||||
if (user.getSuperAdmin() || user.getRegionAdmin()) { | if (user.getSuperAdmin() || user.getRegionAdmin()) { | ||||
// 可以看所有 | // 可以看所有 | ||||
} else if (user.getIsOrgAdmin()) { | } else if (user.getIsOrgAdmin()) { | ||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()); | |||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitIdStr()); | |||||
} else { | } else { | ||||
//否则都只能看自己单位的 | //否则都只能看自己单位的 | ||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()); | |||||
wrapper.eq(WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitIdStr()); | |||||
} | } | ||||
} | } | ||||
@@ -31,6 +31,7 @@ import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||||
import com.hz.pm.api.user.util.LoginUserUtil; | import com.hz.pm.api.user.util.LoginUserUtil; | ||||
import com.hz.pm.api.workbench.converter.WorkbenchConverter; | import com.hz.pm.api.workbench.converter.WorkbenchConverter; | ||||
import com.hz.pm.api.workbench.model.vo.WorkbenchVO; | import com.hz.pm.api.workbench.model.vo.WorkbenchVO; | ||||
import com.hz.pm.api.workbench.model.vo.WorkbenchVO.WarningStatistics; | |||||
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; | ||||
@@ -106,11 +107,11 @@ public class WorkbenchManage { | |||||
stopWatch.start(); | stopWatch.start(); | ||||
//2.项目统计数据 | //2.项目统计数据 | ||||
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage | |||||
.declaredProjectOrgStatistics(year, user), defaultDeclaredProjectManage.declaredProjectOrgStatistics(year - 1, user))); | |||||
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectOrgStatistics(year, user), | |||||
defaultDeclaredProjectManage.declaredProjectOrgStatistics(year - 1, user))); | |||||
if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { | if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { | ||||
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage | |||||
.declaredProjectRegionStatistics(year, user), defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); | |||||
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year, user), | |||||
defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); | |||||
} else { | } else { | ||||
res.setRegionDeclared(new WorkbenchVO.DeclaredStatistics()); | res.setRegionDeclared(new WorkbenchVO.DeclaredStatistics()); | ||||
} | } | ||||
@@ -165,7 +166,7 @@ public class WorkbenchManage { | |||||
//4.1 | //4.1 | ||||
//累积预警统计 | //累积预警统计 | ||||
WorkbenchVO.WarningStatistics accumulate = new WorkbenchVO.WarningStatistics(); | |||||
WarningStatistics accumulate = new WarningStatistics(); | |||||
LambdaQueryWrapper<WflowEarlyWarningRecords> overWrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) | LambdaQueryWrapper<WflowEarlyWarningRecords> overWrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) | ||||
.eq(WflowEarlyWarningRecords::getNoticeType, WarningNoticeTypeEnum.OVER.getCode()) | .eq(WflowEarlyWarningRecords::getNoticeType, WarningNoticeTypeEnum.OVER.getCode()) | ||||
.or(q2 -> q2.isNull(WflowEarlyWarningRecords::getNoticeType)); | .or(q2 -> q2.isNull(WflowEarlyWarningRecords::getNoticeType)); | ||||
@@ -195,17 +196,17 @@ public class WorkbenchManage { | |||||
projectEarlyWarningService.page(adventPage, adventPewWrapper); | projectEarlyWarningService.page(adventPage, adventPewWrapper); | ||||
LambdaQueryWrapper<ProjectEarlyWarning> normalWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) | LambdaQueryWrapper<ProjectEarlyWarning> normalWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) | ||||
.eq(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL.name()) | .eq(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL.name()) | ||||
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), ProjectEarlyWarning::getBuildOrgCode, user.getMhUnitId()); | |||||
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), ProjectEarlyWarning::getBuildOrgCode, user.getMhUnitIdStr()); | |||||
projectEarlyWarningService.page(normalPage, normalWrapper); | projectEarlyWarningService.page(normalPage, normalWrapper); | ||||
WorkbenchVO.WarningStatistics cuurent = new WorkbenchVO.WarningStatistics(); | |||||
WarningStatistics current = new WarningStatistics(); | |||||
long overTotal = overPage.getTotal(); | long overTotal = overPage.getTotal(); | ||||
long adventTotal = adventPage.getTotal(); | long adventTotal = adventPage.getTotal(); | ||||
long normalTotal = normalPage.getTotal(); | long normalTotal = normalPage.getTotal(); | ||||
cuurent.setAdvent((int) adventTotal); | |||||
cuurent.setOver((int) overTotal); | |||||
cuurent.setNormal((int) normalTotal); | |||||
projectEarlyWarning.setCurrent(cuurent); | |||||
current.setAdvent((int) adventTotal); | |||||
current.setOver((int) overTotal); | |||||
current.setNormal((int) normalTotal); | |||||
projectEarlyWarning.setCurrent(current); | |||||
List<WflowEarlyWarningRecords> warningRecords = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) | List<WflowEarlyWarningRecords> warningRecords = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) | ||||
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()) | .eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), WflowEarlyWarningRecords::getBuildOrgCode, user.getMhUnitId()) | ||||
@@ -221,15 +222,15 @@ public class WorkbenchManage { | |||||
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ||||
//取最新一条预警信息 | //取最新一条预警信息 | ||||
if (warningMap.containsKey(vo.getProjectCode())) { | if (warningMap.containsKey(vo.getProjectCode())) { | ||||
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(record.getWarningTime()); | |||||
vo.setInstStart(record.getInstStart()); | |||||
vo.setWarningUserId(record.getWarningUserId()); | |||||
vo.setNoticeMethod(record.getNoticeMethod()); | |||||
vo.setNoticeContent(record.getNoticeContent()); | |||||
vo.setPath(record.getPath()); | |||||
vo.setBatchUserIds(record.getBatchUserIds()); | |||||
vo.setRecordId(record.getId()); | |||||
WflowEarlyWarningRecords currRecord = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(currRecord.getWarningTime()); | |||||
vo.setInstStart(currRecord.getInstStart()); | |||||
vo.setWarningUserId(currRecord.getWarningUserId()); | |||||
vo.setNoticeMethod(currRecord.getNoticeMethod()); | |||||
vo.setNoticeContent(currRecord.getNoticeContent()); | |||||
vo.setPath(currRecord.getPath()); | |||||
vo.setBatchUserIds(currRecord.getBatchUserIds()); | |||||
vo.setRecordId(currRecord.getId()); | |||||
} else { | } else { | ||||
vo.setWarningTime(now); | vo.setWarningTime(now); | ||||
} | } | ||||
@@ -248,15 +249,15 @@ public class WorkbenchManage { | |||||
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ||||
//取最新一条预警信息 | //取最新一条预警信息 | ||||
if (warningMap.containsKey(vo.getProjectCode())) { | if (warningMap.containsKey(vo.getProjectCode())) { | ||||
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(record.getWarningTime()); | |||||
vo.setInstStart(record.getInstStart()); | |||||
vo.setWarningUserId(record.getWarningUserId()); | |||||
vo.setNoticeMethod(record.getNoticeMethod()); | |||||
vo.setNoticeContent(record.getNoticeContent()); | |||||
vo.setPath(record.getPath()); | |||||
vo.setBatchUserIds(record.getBatchUserIds()); | |||||
vo.setRecordId(record.getId()); | |||||
WflowEarlyWarningRecords currRecord = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(currRecord.getWarningTime()); | |||||
vo.setInstStart(currRecord.getInstStart()); | |||||
vo.setWarningUserId(currRecord.getWarningUserId()); | |||||
vo.setNoticeMethod(currRecord.getNoticeMethod()); | |||||
vo.setNoticeContent(currRecord.getNoticeContent()); | |||||
vo.setPath(currRecord.getPath()); | |||||
vo.setBatchUserIds(currRecord.getBatchUserIds()); | |||||
vo.setRecordId(currRecord.getId()); | |||||
} else { | } else { | ||||
vo.setWarningTime(now); | vo.setWarningTime(now); | ||||
} | } | ||||
@@ -274,15 +275,15 @@ public class WorkbenchManage { | |||||
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); | ||||
//取最新一条预警信息 | //取最新一条预警信息 | ||||
if (warningMap.containsKey(vo.getProjectCode())) { | if (warningMap.containsKey(vo.getProjectCode())) { | ||||
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(record.getWarningTime()); | |||||
vo.setInstStart(record.getInstStart()); | |||||
vo.setWarningUserId(record.getWarningUserId()); | |||||
vo.setNoticeMethod(record.getNoticeMethod()); | |||||
vo.setNoticeContent(record.getNoticeContent()); | |||||
vo.setPath(record.getPath()); | |||||
vo.setBatchUserIds(record.getBatchUserIds()); | |||||
vo.setRecordId(record.getId()); | |||||
WflowEarlyWarningRecords currRecord = warningMap.get(vo.getProjectCode()); | |||||
vo.setWarningTime(currRecord.getWarningTime()); | |||||
vo.setInstStart(currRecord.getInstStart()); | |||||
vo.setWarningUserId(currRecord.getWarningUserId()); | |||||
vo.setNoticeMethod(currRecord.getNoticeMethod()); | |||||
vo.setNoticeContent(currRecord.getNoticeContent()); | |||||
vo.setPath(currRecord.getPath()); | |||||
vo.setBatchUserIds(currRecord.getBatchUserIds()); | |||||
vo.setRecordId(currRecord.getId()); | |||||
} | } | ||||
vo.setProjectName(projectNameMap.get(o.getProjectCode())); | vo.setProjectName(projectNameMap.get(o.getProjectCode())); | ||||
return vo; | return vo; | ||||
@@ -23,7 +23,7 @@ spring: | |||||
max-active: 200 | max-active: 200 | ||||
max-idle: 500 | max-idle: 500 | ||||
min-idle: 8 | min-idle: 8 | ||||
max-wait: 10000 | |||||
max-wait: 60000 | |||||
application: | application: | ||||
name: hzpm | name: hzpm | ||||
jackson: | jackson: | ||||
@@ -61,7 +61,7 @@ spring: | |||||
# 配置从池返回的连接的默认自动提交行为。默认值为true。 | # 配置从池返回的连接的默认自动提交行为。默认值为true。 | ||||
auto-commit: true | auto-commit: true | ||||
# 开启连接监测泄露 | # 开启连接监测泄露 | ||||
leak-detection-threshold: 5000 | |||||
leak-detection-threshold: 30000 | |||||
# 测试连接数据库 | # 测试连接数据库 | ||||
connection-test-query: SELECT 1 | connection-test-query: SELECT 1 | ||||
#设置上传 单个文件的大小 | #设置上传 单个文件的大小 | ||||
@@ -18,7 +18,7 @@ public class CodeGen { | |||||
private static final String PATH_YYD = "/Users/wendy/coding/java/hz-project-management/hz-pm-api/src/main/java"; | private static final String PATH_YYD = "/Users/wendy/coding/java/hz-project-management/hz-pm-api/src/main/java"; | ||||
private static final String URL = "jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8"; | |||||
private static final String URL = "jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8"; | |||||
private static final String USER_NAME = "SYSDBA"; | private static final String USER_NAME = "SYSDBA"; | ||||
private static final String PASSWORD = "SYSDBA"; | private static final String PASSWORD = "SYSDBA"; | ||||
@@ -55,7 +55,7 @@ public class CodeGen { | |||||
} | } | ||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
generate("WendyYang", "meeting", PATH_YYD, "meeting_settings"); | |||||
generate("WendyYang", "projectlib", PATH_YYD, "mh_project_schema_target_data"); | |||||
} | } | ||||
} | } |