Browse Source

modify:

1. 增加手动推送采购公告接口;
tags/24110601
WendyYang 4 weeks ago
parent
commit
b7d89a0e52
4 changed files with 40 additions and 16 deletions
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java
  2. +8
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java
  3. +29
    -15
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  4. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectManageTodoCountManage.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java View File

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

import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
@@ -121,6 +122,7 @@ public class MhApiClient {
if (environmentUtil.isDevEnv()) {
return;
}
Assert.notEmpty(notices, "采购公告为空");
String requestUrl = mhApiHost + PURCHASE_NOTICE;
String retBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(notices));
MhRetDTO<Object> retObj = JSONUtil.toBean(retBody,


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

@@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@@ -177,4 +178,11 @@ public class PurchaseController {
purchaseManage.purchaseOrgConfirm(req);
}

@GetMapping("/purchase/{bidId}")
@PreAuthorize("hasAuthority('SUPER_ADMIN')")
@ApiOperation("推送采购公告至信创云图")
public void pushToMhNotice(@PathVariable Long bidId) {
purchaseManage.pushToMhNotice(bidId);
}

}

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

@@ -555,12 +555,26 @@ public class PurchaseManage {
stagingManage.delete(StagingType.PURCHASE_NOTICE, project.getProjectCode());
}

private MhPurchaseNoticeDTO buildPurchaseNotice(PurchaseNoticeTenderDTO w, UserInfoDetails user) {
public synchronized void pushToMhNotice(Long purchaseId) {
Purchase purchase = purchaseService.getById(purchaseId);
if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) {
Assert.notNull(purchase, "采购信息不存在");
MhPurchaseNoticeDTO purchaseNotice = buildPurchaseNotice(purchase);
mhApiClient.publishPurchaseNotice(Collections.singletonList(purchaseNotice));
}
}

private MhPurchaseNoticeDTO buildPurchaseNotice(Purchase w) {
PurchaseNoticeTenderDTO tender = BeanUtil.copyProperties(w, PurchaseNoticeTenderDTO.class);
return buildPurchaseNotice(tender, LoginUserUtil.userDetail());
}

private MhPurchaseNoticeDTO buildPurchaseNotice(PurchaseNoticeTenderDTO purchaseNotice, UserInfoDetails user) {
if (environmentUtil.isDevEnv()) {
return null;
}
Date now = new Date();
List<FileResultVO> bidFiles = JSONUtil.toList(w.getBidDoc(), FileResultVO.class);
List<FileResultVO> bidFiles = JSONUtil.toList(purchaseNotice.getBidDoc(), FileResultVO.class);
List<File> files = fileService.listByIds(CollUtils.fieldSet(bidFiles, FileResultVO::getId));
String fileIds = files.stream().map(file -> {
String fileUrl = fileService.findUrlByFile(file);
@@ -571,29 +585,29 @@ public class PurchaseManage {
tmpFile.deleteOnExit();
return fileId;
}).collect(Collectors.joining(","));
PurchaseScopeEnum scope = PurchaseScopeEnum.getByCode(w.getPurchaseScope())
PurchaseScopeEnum scope = PurchaseScopeEnum.getByCode(purchaseNotice.getPurchaseScope())
.orElseThrow(() -> BizException.wrap("采购范围无效"));
return MhPurchaseNoticeDTO.builder()
.bidOpenTime(DateUtil.date(w.getBidStartTime()).toJdkDate())
.endTime(DateUtil.date(w.getBidEndTime()).toJdkDate())
.buyDesc(w.getPurchaseRemark())
.budgetMoney(w.getBidBudget().multiply(BigDecimal.valueOf(10000)))
.buyItem(w.getBidName())
.bidOpenTime(DateUtil.date(purchaseNotice.getBidStartTime()).toJdkDate())
.endTime(DateUtil.date(purchaseNotice.getBidEndTime()).toJdkDate())
.buyDesc(purchaseNotice.getPurchaseRemark())
.budgetMoney(purchaseNotice.getBidBudget().multiply(BigDecimal.valueOf(10000)))
.buyItem(purchaseNotice.getBidName())
.buyFile(fileIds)
.buyScope(scope.getMhCode())
.buyWay(w.getPurchaseMethod())
.buyUnitName(w.getPurchaseUnit())
.createUnit(w.getPurchaseUnitId().intValue())
.buyWay(purchaseNotice.getPurchaseMethod())
.buyUnitName(purchaseNotice.getPurchaseUnit())
.createUnit(purchaseNotice.getPurchaseUnitId().intValue())
.createTime(now)
.updateTime(now)
.createUser(user.getMhUserId())
.updateUser(user.getMhUserId())
// 招标采购
.type("ZBGG")
.detailAddress(w.getPurchaseConnectAddress())
.linkAddress(w.getBidAddress())
.linkUser(w.getPurchaseContact())
.linkPhone(w.getPurchasePhone())
.detailAddress(purchaseNotice.getPurchaseConnectAddress())
.linkAddress(purchaseNotice.getBidAddress())
.linkUser(purchaseNotice.getPurchaseContact())
.linkPhone(purchaseNotice.getPurchasePhone())
.postStatus("Y")
.build();
}


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectManageTodoCountManage.java View File

@@ -54,7 +54,7 @@ public class ProjectManageTodoCountManage {
DeclaredProgressStatisticsVO::getFailedCount));
// 专家评审
ReviewProgressStatisticsVO expertReviewStat = projectReviewManage.expertReviewProjectProgressStatistics(new ProjectListReq());
todoCount.setExpertReview(sum(expertReviewStat, ReviewProgressStatisticsVO::getWithoutConstructionPlanSealFileCount));
todoCount.setExpertReview(sum(expertReviewStat, ReviewProgressStatisticsVO::getTodoCount));
// 项目复核
ReviewProgressStatisticsVO projectReviewStat = projectReviewManage.reviewProjectProgressStatistics(new ProjectListReq());
todoCount.setProjectReview(sum(projectReviewStat, ReviewProgressStatisticsVO::getTodoCount,


Loading…
Cancel
Save