diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java index e51471b..571d91b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java @@ -74,6 +74,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.file.entity.File; import com.ningdatech.file.entity.vo.result.FileResultVO; import com.ningdatech.file.service.FileService; +import com.sun.org.apache.xpath.internal.operations.Bool; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; import com.wflow.workflow.bean.dto.OrgInfoDTO; @@ -82,6 +83,8 @@ import com.wflow.workflow.service.ProcessInstanceService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -337,6 +340,9 @@ public class PurchaseManage { return "保存失败"; } + @Value("${mh.purchase-notice.open:true}") + private Boolean mhPurchaseNoticeOpen; + @Transactional(rollbackFor = Exception.class) public synchronized void submitPurchaseNotice(SubmitPurchaseNoticeReq req) { UserInfoDetails user = LoginUserUtil.loginUserDetail(); @@ -375,14 +381,18 @@ public class PurchaseManage { purchase.setTestValidStatus(TenderTestValidStatusEnum.WITHOUT_TEST_VALID_INFO.getCode()); purchase.setAdaptStatus(TenderAdaptStatusEnum.WITHOUT_ADAPT_INFO.getCode()); purchase.setStatus(TenderStatusEnum.TO_BE_SUBMIT_PURCHASE_INFO.getTenderStatus()); - notices.add(buildPurchaseNotice(w, user)); + if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) { + notices.add(buildPurchaseNotice(w, user)); + } return purchase; }).collect(Collectors.toList()); purchaseService.saveOrUpdateBatch(purchases); projectStateMachineUtil.pass(project); projectService.updateById(project); // 发布采购公告 - mhApiClient.publishPurchaseNotice(notices); + if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) { + mhApiClient.publishPurchaseNotice(notices); + } } private MhPurchaseNoticeDTO buildPurchaseNotice(PurchaseNoticeTenderDTO w, UserInfoDetails user) { diff --git a/hz-pm-api/src/main/resources/application-prod.yml b/hz-pm-api/src/main/resources/application-prod.yml index ab0d00f..db0a928 100644 --- a/hz-pm-api/src/main/resources/application-prod.yml +++ b/hz-pm-api/src/main/resources/application-prod.yml @@ -192,6 +192,8 @@ mh: detail-url: http://10.54.38.13:8081/mh-gateway/oss/ossfile/getFileInfoList down-url: http://10.54.38.13:8081/mh-gateway/oss/oss/downloadFileNotLogin upload-url: http://10.54.38.13:8081/mh-gateway/oss/oss/uploadFileSkipLogin + purchase-notice: + open: false sync-mh-company: open: false sync-mh-user: