|
|
@@ -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(); |
|
|
|
} |
|
|
|