Browse Source

modify:

1. 采购列表修改;
tags/24082801
WendyYang 4 months ago
parent
commit
6d71f431be
4 changed files with 19 additions and 47 deletions
  1. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  2. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningNoticeTypeEnum.java
  3. +13
    -37
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java
  4. +0
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningProjectTask.java

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java View File

@@ -178,12 +178,12 @@ public class PurchaseManage {
if (req.getTabStatus() != null) {
if (TenderMainStatus.TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO.eq(req.getTabStatus())) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE +
" and np.status = '{0}' ", req.getTabStatus());
" and np.status = {0} ", req.getTabStatus());
} else if (TenderMainStatus.PURCHASE_FINISHED.eq(req.getTabStatus())) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE +
" and npsc.event = {0} ", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO);
} else if (ProjectStatus.TO_BE_PURCHASED.eq(req.getTabStatus())) {
query.eq(Project::getStatus, ProjectStatus.TO_BE_PURCHASED);
query.eq(Project::getStatus, ProjectStatus.TO_BE_PURCHASED.getCode());
} else {
return PageVo.empty();
}
@@ -203,7 +203,7 @@ public class PurchaseManage {
.in(Purchase::getProjectId, projectIds);
if (req.getTabStatus() != null) {
if (TenderMainStatus.TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO.eq(req.getTabStatus())) {
purchaseQuery.eq(Purchase::getStatus, req.getStatus());
purchaseQuery.eq(Purchase::getStatus, req.getTabStatus());
} else if (TenderMainStatus.PURCHASE_FINISHED.eq(req.getTabStatus())) {
purchaseQuery.exists(ExistsSqlConst.PURCHASE_EXISTS_PURCHASE_STATUS_CHANGE +
" and npsc.event = {0} ", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO);


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/WarningNoticeTypeEnum.java View File

@@ -8,8 +8,8 @@ import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

/**
*
* 预警提醒类型枚举
*
* @author ZPF
* @since 2023/10/31 16:14
*/
@@ -21,7 +21,8 @@ public enum WarningNoticeTypeEnum {
* 预警提醒类型枚举
*/
CONTACT(1, "项目联系人"),
RESPONSIBLE(2, "项目负责人");
RESPONSIBLE(2, "项目负责人"),
NONE(0, "不通知");

private Integer code;
private String desc;


+ 13
- 37
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -34,11 +35,10 @@ import com.wflow.service.IEarlyWarningService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.Duration;
import java.time.LocalDateTime;
@@ -52,50 +52,34 @@ import java.util.stream.Collectors;
* @date 2023/8/3 上午9:53
* 预警填报 超时任务
*/
@Component
@Slf4j
@Component
@RequiredArgsConstructor
@ConditionalOnExpression("${early-warning-instance-task:false}")
public class EarlyWarningInstanceNotStartTask {

@Value("${hostname:}")
private String HOST_NAME;

private final IEarlyWarningService earlyWarningService;

private final IProjectService projectService;

private final EarlyWarningManage earlyWarningManage;

private final IOperationService operationService;

private final IUserInfoService userInfoService;

private final IProjectRenewalFundDeclarationService renewalFundDeclarationService;

private final RoleManage roleManage;

private final IProjectEarlyWarningService projectEarlyWarningService;

@Scheduled(cron = "0 0/2 * * * ?")
public void doEarlyWarningDeclared() throws UnknownHostException {
if (!HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) {
return;
}

log.info("=========== 预警填报超时任务开始 ========");
/**
* 填报预警
*/
@Scheduled(cron = "${early-warning-instance-task.cron:0 0/5 * * * ?}")
public void doEarlyWarningDeclared() {
StopWatch stopWatch = new StopWatch();
stopWatch.start();

// 1.查询 填报的 预警规则 填报类型的 每个区域 每个规则
List<WflowEarlyWarning> warnings = earlyWarningService.list(Wrappers.lambdaQuery(WflowEarlyWarning.class)
.eq(WflowEarlyWarning::getRuleType, WarningRuleTypeEnum.DECLARED_WARNING.getCode()));
Wrapper<WflowEarlyWarning> query = Wrappers.lambdaQuery(WflowEarlyWarning.class)
.eq(WflowEarlyWarning::getRuleType, WarningRuleTypeEnum.DECLARED_WARNING.getCode())
.eq(WflowEarlyWarning::getIsOpen, true);
List<WflowEarlyWarning> warnings = earlyWarningService.list(query);
for (WflowEarlyWarning warning : warnings) {
//2. 取出rule的数据
if (Boolean.FALSE.equals(warning.getIsOpen())) {
log.info(warning.getId() + " 此规则关闭了");
continue;
}

String noticeMethod = warning.getNoticeMethod();
if (StringUtils.isBlank(noticeMethod) ||
(!noticeMethod.contains(String.valueOf(CommonEnum.ZWDD.getCode())) &&
@@ -234,10 +218,6 @@ public class EarlyWarningInstanceNotStartTask {

@Scheduled(cron = "10 0/2 * * * ?")
public void doEarlyWarningOperation() throws UnknownHostException {
if (!HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) {
return;
}

log.info("=========== 预警实施超时任务开始 ========");
StopWatch stopWatch = new StopWatch();
stopWatch.start();
@@ -422,10 +402,6 @@ public class EarlyWarningInstanceNotStartTask {
*/
@Scheduled(cron = "20 0/2 * * * ?")
public void doEarlyWarningRenewalFund() throws UnknownHostException {
if (!HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) {
return;
}

log.info("=========== 预警续建资金项目 超时任务开始 ========");
StopWatch stopWatch = new StopWatch();
stopWatch.start();


+ 0
- 5
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningProjectTask.java View File

@@ -48,15 +48,10 @@ import java.util.stream.Collectors;
public class EarlyWarningProjectTask {

private final IProjectService projectService;

private final IProjectEarlyWarningService projectEarlyWarningService;

private final IEarlyWarningRecordsService earlyWarningRecordsService;

private final IProjectRenewalFundDeclarationService renewalFundDeclarationService;

private final TaskService taskService;

@Value("${hostname:}")
private String HOST_NAME;



Loading…
Cancel
Save