Browse Source

modify:

1. 标项绑定底账、解绑接口;
tags/24111101
WendyYang 3 weeks ago
parent
commit
50c73e5fd7
3 changed files with 76 additions and 4 deletions
  1. +15
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectLibController.java
  2. +32
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  3. +29
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/BindSystemToBidReq.java

+ 15
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectLibController.java View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos;
import com.hz.pm.api.projectlib.manage.ProjectLibManage;
import com.hz.pm.api.projectlib.model.req.BindSystemToBidReq;
import com.hz.pm.api.projectlib.model.req.ProjectApplicationListReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO;
@@ -102,6 +103,20 @@ public class ProjectLibController {
return projectLibManage.getSystemReplaceInfosOption(projectCode);
}

@PostMapping("/bindSystemToBid")
@WebLog("绑定系统至标项")
@ApiOperation("绑定系统至标项")
public void bindSystemToBid(@RequestBody @Valid BindSystemToBidReq req) {
projectLibManage.bindSystemToBid(req);
}

@PostMapping("/cancelSystemFromBid")
@WebLog("从标项解绑系统")
@ApiOperation("从标项解绑系统")
public void cancelSystemFromBid(@RequestBody @Valid BindSystemToBidReq req) {
projectLibManage.cancelSystemFromBid(req);
}

@GetMapping("/processSchedule/{projectId}")
@ApiOperation("项目库申报项目当前进度详情")
public List<ProcessDetailVO> processScheduleDetail(@PathVariable("projectId") Long projectId) {


+ 32
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java View File

@@ -69,6 +69,7 @@ import com.hz.pm.api.projectlib.model.enumeration.ProjectRenewalApprovalStatusEn
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.enumeration.status.TenderMainStatus;
import com.hz.pm.api.projectlib.model.po.ProjectPO;
import com.hz.pm.api.projectlib.model.req.BindSystemToBidReq;
import com.hz.pm.api.projectlib.model.req.ProjectApplicationListReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.*;
@@ -140,7 +141,7 @@ public class ProjectLibManage {
private final UserInfoHelper userInfoHelper;
private final IExpertReviewService expertReviewService;
private final ConstructionManage constructionManage;
private final IProjectGovSystemReplaceInfosService projectGovSystemReplaceInfosService;
private final IProjectGovSystemReplaceInfosService systemReplaceInfosService;
private final MhUnitCache mhUnitCache;
private final IMhProjectSchemaTargetDataService projectSchemaTargetDataService;
private final IMhProjectService mhProjectService;
@@ -680,7 +681,7 @@ public class ProjectLibManage {
.eq(ProjectGovSystemReplaceInfos::getProjectId, projectId)
.orderByAsc(ProjectGovSystemReplaceInfos::getId)
.orderByAsc(ProjectGovSystemReplaceInfos::getBatchNo);
List<ProjectGovSystemReplaceInfos> govSystemReplaceInfos = projectGovSystemReplaceInfosService.list(query);
List<ProjectGovSystemReplaceInfos> govSystemReplaceInfos = systemReplaceInfosService.list(query);
if (govSystemReplaceInfos.isEmpty()) {
return Collections.emptyList();
}
@@ -773,7 +774,7 @@ public class ProjectLibManage {

//查询初验信息
Map<Long, List<PreInsAcceptancePerson>> acceptPersonsMap = acceptancePersonService.listByBidIds(purchaseMap.keySet());
List<ProjectGovSystemReplaceInfos> systemReplaceInfos = projectGovSystemReplaceInfosService.listByBidIds(purchaseMap.keySet());
List<ProjectGovSystemReplaceInfos> systemReplaceInfos = systemReplaceInfosService.listByBidIds(purchaseMap.keySet());
Map<Long, List<ProjectGovSystemReplaceInfos>> replaceInfosMap = CollUtils.group(systemReplaceInfos, ProjectGovSystemReplaceInfos::getBidId);
purchaseMap.forEach((k, v) -> {
PurchaseFullInfoVO purchaseFullInfo = new PurchaseFullInfoVO();
@@ -1199,7 +1200,7 @@ public class ProjectLibManage {
}

public List<ProjectGovSystemReplaceInfos> getSystemReplaceInfosOption(String projectCode) {
return projectGovSystemReplaceInfosService.listByProjectCode(projectCode);
return systemReplaceInfosService.listByProjectCode(projectCode);
}

public List<ProcessDetailVO> processScheduleDetail(Long projectId) {
@@ -1494,5 +1495,32 @@ public class ProjectLibManage {
return res;
}

public synchronized void bindSystemToBid(BindSystemToBidReq req) {
List<ProjectGovSystemReplaceInfos> replaceInfos = systemReplaceInfosService.listByIds(req.getSystemReplaceInfoIds());
if (replaceInfos.isEmpty()) {
throw ReturnException.wrap("系统替换信息不存在");
}
replaceInfos.removeIf(w -> req.getBidId().equals(w.getBidId()));
if (!replaceInfos.isEmpty()) {
replaceInfos.forEach(w -> {
if (w.getBidId() != null) {
throw ReturnException.wrap("已关联其他标项");
}
w.setBidId(req.getBidId());
});
systemReplaceInfosService.updateBatchById(replaceInfos);
}
}

public void cancelSystemFromBid(BindSystemToBidReq req) {
List<ProjectGovSystemReplaceInfos> replaceInfos = systemReplaceInfosService.listByIds(req.getSystemReplaceInfoIds());
if (replaceInfos.isEmpty()) {
throw ReturnException.wrap("系统替换信息不存在");
}
Wrapper<ProjectGovSystemReplaceInfos> wrapper = Wrappers.lambdaUpdate(ProjectGovSystemReplaceInfos.class)
.set(ProjectGovSystemReplaceInfos::getBidId, null)
.in(ProjectGovSystemReplaceInfos::getId, req.getSystemReplaceInfoIds());
systemReplaceInfosService.update(wrapper);
}

}

+ 29
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/BindSystemToBidReq.java View File

@@ -0,0 +1,29 @@
package com.hz.pm.api.projectlib.model.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* <p>
* BindSystemToBidReq
* </p>
*
* @author WendyYang
* @since 11:16 2024/11/8
*/
@Data
public class BindSystemToBidReq {

@ApiModelProperty("标项ID")
@NotNull(message = "标项ID不能为空")
private Long bidId;

@ApiModelProperty("系统替换信息ID")
@NotEmpty(message = "系统替换信息ID不能为空")
private List<Long> systemReplaceInfoIds;

}

Loading…
Cancel
Save