Browse Source

modify:

1. 发布采购公告删除暂存;
tags/24102401^0
WendyYang 1 month ago
parent
commit
632fece70b
6 changed files with 26 additions and 65 deletions
  1. +0
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java
  2. +1
    -56
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java
  3. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java
  4. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  5. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/MhSystemReplaceSyncTask.java
  6. +12
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java

+ 0
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java View File

@@ -112,10 +112,4 @@ public class DeclaredProjectController {
ExcelDownUtil.downXls(response, req, declaredProjectManage::exportList);
}

@ApiOperation(value = "初始化状态变更记录", hidden = true)
@GetMapping("/initStateChangeRecord")
public void initStateChangeRecord() {
declaredProjectManage.initStateChangeRecord();
}

}

+ 1
- 56
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -330,7 +330,7 @@ public class DeclaredProjectManage {
* @param dto \
* @return \
*/
public Long saveToDraft(ProjectDraftSaveDTO dto, ProjectDraftTypeEnum draftType) {
public synchronized Long saveToDraft(ProjectDraftSaveDTO dto, ProjectDraftTypeEnum draftType) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

ProjectDTO projectInfo = dto.getProjectInfo();
@@ -554,59 +554,4 @@ public class DeclaredProjectManage {
}
}

@Transactional(rollbackFor = Exception.class)
public void initStateChangeRecord() {
List<MhProject> projects = mhProjectService.list();
for (MhProject project : projects) {
if (project.getProjectCode() == null) {
continue;
}
Project proj = projectService.getProjectByCode(project.getProjectCode());
if (proj == null) {
continue;
}
projectStatusChangeService.remove(Wrappers.lambdaQuery(ProjectStatusChange.class)
.in(ProjectStatusChange::getEvent,
ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT,
ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS,
ProjectStateChangeEvent.PROJECT_REVIEW_SUBMIT,
ProjectStateChangeEvent.PROJECT_REVIEW_PASS)
.eq(ProjectStatusChange::getProjectCode, project.getProjectCode()));
List<ProjectStatusChange> changes = new ArrayList<>();
changes.add(new ProjectStatusChange() {{
setAfterStatus(ProjectStatus.ON_COMPLIANCE_REVIEW.getCode());
setBeforeStatus(ProjectStatus.TO_BE_DECLARED.getCode());
setEvent(ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT.name());
setCreateOn(proj.getCreateOn());
setProjectCode(project.getProjectCode());
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode()));
}});
changes.add(new ProjectStatusChange() {{
setAfterStatus(ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode());
setBeforeStatus(ProjectStatus.ON_COMPLIANCE_REVIEW.getCode());
setEvent(ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS.name());
setCreateOn(proj.getCreateOn().plusMinutes(1));
setProjectCode(project.getProjectCode());
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode()));
}});
changes.add(new ProjectStatusChange() {{
setAfterStatus(ProjectStatus.ON_PROJECT_REVIEW.getCode());
setBeforeStatus(ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode());
setEvent(ProjectStateChangeEvent.PROJECT_REVIEW_SUBMIT.name());
setCreateOn(proj.getCreateOn().plusMinutes(2));
setProjectCode(project.getProjectCode());
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode()));
}});
changes.add(new ProjectStatusChange() {{
setAfterStatus(ProjectStatus.ON_ANNUAL_PLAN.getCode());
setBeforeStatus(ProjectStatus.ON_PROJECT_REVIEW.getCode());
setEvent(ProjectStateChangeEvent.PROJECT_REVIEW_PASS.name());
setCreateOn(proj.getCreateOn().plusMinutes(3));
setProjectCode(project.getProjectCode());
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode()));
}});
projectStatusChangeService.saveBatch(changes);
}
}

}

+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java View File

@@ -17,6 +17,8 @@ import com.hz.pm.api.projectlib.model.enumeration.status.TenderMainStatus;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.scheduler.listener.event.MhTodoHandedEvent;
import com.hz.pm.api.scheduler.listener.event.MhTodoSendEvent;
import com.hz.pm.api.sys.manage.StagingManage;
import com.hz.pm.api.sys.model.enumeration.StagingType;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
@@ -45,6 +47,7 @@ public class OperationManage {
private final IPurchaseService purchaseService;
private final IProjectService projectService;
private final TenderStateMachineUtil tenderStateMachineUtil;
private final StagingManage stagingManage;

/**
* 获取实施详情
@@ -95,6 +98,7 @@ public class OperationManage {
// 修改标段状态
tenderStateMachineUtil.pass(purchase);
purchaseService.updateById(purchase);
stagingManage.delete(StagingType.OPERATION_PLAN, req.getBidId());
SpringUtil.publishEvent(MhTodoHandedEvent.of(MHTodoTypeEnum.WITHOUT_OPERATION_PLAN, purchase.getId()));
SpringUtil.publishEvent(MhTodoSendEvent.of(MHTodoTypeEnum.ADAPTION_APPLY, project, purchase));
return operation.getProjectCode();


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

@@ -59,6 +59,8 @@ import com.hz.pm.api.projectlib.service.*;
import com.hz.pm.api.scheduler.listener.event.MhTodoHandedEvent;
import com.hz.pm.api.scheduler.listener.event.MhTodoSendEvent;
import com.hz.pm.api.sys.manage.ProcessModelManage;
import com.hz.pm.api.sys.manage.StagingManage;
import com.hz.pm.api.sys.model.enumeration.StagingType;
import com.hz.pm.api.user.helper.MhUnitCache;
import com.hz.pm.api.user.helper.MhUnitQueryAuthHelper;
import com.hz.pm.api.user.helper.MhUnitQueryAuthHelper.UnitQueryState;
@@ -136,6 +138,7 @@ public class PurchaseManage {
private final IProjectGovSystemReplaceInfosService projectGovSystemReplaceInfosService;
private final IProjectStatusChangeService projectStatusChangeService;
private final ProjectStatusRewriteHandlerContext projectStatusRewriteHandlerContext;
private final StagingManage stagingManage;

public PurchaseProgressStatVO purchaseProgressStatistics(ProjectListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
@@ -472,6 +475,7 @@ public class PurchaseManage {
if (!notices.isEmpty()) {
mhApiClient.publishPurchaseNotice(notices);
}
stagingManage.delete(StagingType.PURCHASE_NOTICE, project.getProjectCode());
}

@Transactional(rollbackFor = Exception.class)
@@ -548,6 +552,7 @@ public class PurchaseManage {
if (!notices.isEmpty()) {
mhApiClient.publishPurchaseNotice(notices);
}
stagingManage.delete(StagingType.PURCHASE_NOTICE, project.getProjectCode());
}

private MhPurchaseNoticeDTO buildPurchaseNotice(PurchaseNoticeTenderDTO w, UserInfoDetails user) {
@@ -658,6 +663,7 @@ public class PurchaseManage {
if (BidTypeEnum.BUILD_APP.eq(purchase.getBidType())) {
SpringUtil.publishEvent(MhTodoSendEvent.of(MHTodoTypeEnum.WITHOUT_OPERATION_PLAN, project, purchase));
}
stagingManage.delete(StagingType.PURCHASE_RECORD, req.getBidId());
}

public AdaptionProgressStatVO adaptionProgressStatistics(PurchaseAdaptionListReq req) {


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/MhSystemReplaceSyncTask.java View File

@@ -9,7 +9,8 @@ import org.springframework.stereotype.Component;
* <p>
* MhSystemReplaceSyncTask
* </p>
*I
* I
*
* @author WendyYang
* @since 20:53 2024/8/20
*/
@@ -23,7 +24,7 @@ public class MhSystemReplaceSyncTask {
this.mhSystemReplaceManage = mhSystemReplaceManage;
}

@Scheduled(cron = "${mh-system-replace-sync.cron:0 0 1 * * ?}")
@Scheduled(cron = "${mh-system-replace-sync.cron:0 0/20 7-22 * * ?}")
public void execute() {
mhSystemReplaceManage.syncMhSystemReplaceInfo();
}


+ 12
- 1
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java View File

@@ -2,7 +2,6 @@ package com.hz.pm.api.sys.manage;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.sys.model.dto.StagingDTO;
@@ -59,4 +58,16 @@ public class StagingManage {
return detail;
}

public void delete(StagingType type, String bizId) {
Wrapper<Staging> query = Wrappers.lambdaQuery(Staging.class)
.eq(Staging::getType, type)
.eq(Staging::getCreateBy, LoginUserUtil.getUserId())
.eq(StrUtil.isNotBlank(bizId), Staging::getBizId, bizId);
stagingService.remove(query);
}

public void delete(StagingType type, Long bizId) {
delete(type, bizId.toString());
}

}

Loading…
Cancel
Save