From 0bd7ca3ae9d5506b63b24c599c4507fc731e800c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 9 Jul 2024 14:22:40 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E9=87=87=E8=B4=AD&=E5=90=88?= =?UTF-8?q?=E5=90=8C=E4=BF=A1=E6=81=AF=E5=A4=87=E6=A1=88=E5=90=88=E5=B9=B6?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/TenderStateChangeAction.java | 15 +---- .../impl/TenderStateMachineBuilderImpl.java | 14 ++-- .../statemachine/event/TenderStateChangeEvent.java | 8 +-- .../controller/ConstructionController.java | 9 --- .../controller/PurchaseController.java | 12 ++-- .../projectdeclared/manage/ConstructionManage.java | 54 +--------------- .../api/projectdeclared/manage/PurchaseManage.java | 57 +++++++++++++--- .../model/req/SubmitConstructionReq.java | 56 ---------------- .../model/req/SubmitPurchaseContractRecordReq.java | 75 ++++++++++++++++++++++ .../model/req/SubmitPurchaseRecordReq.java | 48 -------------- .../model/enumeration/status/TenderStatus.java | 3 +- 11 files changed, 140 insertions(+), 211 deletions(-) delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitConstructionReq.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseContractRecordReq.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseRecordReq.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java index 9d7e9f0..d1f419d 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java @@ -30,23 +30,12 @@ public class TenderStateChangeAction { } /** - * 填写采购信息 - * - * @param message \ - */ - @OnTransition(source = "TO_BE_SUBMIT_PURCHASE_INFO", target = "TO_BE_SUBMIT_CONSTRUCTION_INFO") - public void SUBMIT_PURCHASE_INFO(Message message) { - Purchase purchase = getPurchaseInfo(message); - purchase.setStatus(TenderStatus.TO_BE_SUBMIT_CONSTRUCTION_INFO.getCode()); - } - - /** * 填写合同信息 * * @param message \ */ - @OnTransition(source = "TO_BE_SUBMIT_CONSTRUCTION_INFO", target = "TO_BE_SUBMIT_OPERATION_PLAN") - public void SUBMIT_CONSTRUCTION_INFO(Message message) { + @OnTransition(source = "TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO", target = "TO_BE_SUBMIT_OPERATION_PLAN") + public void SUBMIT_PURCHASE_CONSTRUCTION_INFO(Message message) { Purchase purchase = getPurchaseInfo(message); purchase.setStatus(TenderStatus.TO_BE_SUBMIT_OPERATION_PLAN.getCode()); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java index 4082168..28083bf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/builder/impl/TenderStateMachineBuilderImpl.java @@ -65,21 +65,15 @@ public class TenderStateMachineBuilderImpl implements BaseStateMachineBuilder query = Wrappers.lambdaQuery(Contract.class) - .eq(Contract::getProjectId, projectId); - List allContracts = contractService.list(query); - BigDecimal totalAmount = DecimalUtil.sum(allContracts, Contract::getTotalAmount); - project.setUpdateOn(now); - project.setContractAmount(totalAmount); - projectService.updateById(project); - return "填写成功"; - } - private static final List PRE_INSPECTED_PURCHASE_STATUS; static { @@ -600,7 +550,7 @@ public class ConstructionManage { if (StrUtils.isBlank(purchase.getMhXcfhxReportFile()) || req.getMhXcfhxReportFile().equals(purchase.getMhXcfhxReportFile())) { String fileName = purchase.getBidName() + "-信创符合性测评报告."; - purchase.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(req.getMhXcfhxReportFile(),fileName)); + purchase.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(req.getMhXcfhxReportFile(), fileName)); } purchase.setMhXcfhxReportRecordId(req.getMhXcfhxReportRecordId()); purchase.setMhXcfhxReportFile(req.getMhXcfhxReportFile()); @@ -621,7 +571,7 @@ public class ConstructionManage { public synchronized String submitXcfhxApplyManual(Long id) { Xinchuang xinhcuang = xinchuangService.getById(id); VUtils.isTrue(Objects.isNull(xinhcuang)).throwMessage("信创符合性申请不存在"); - if(StringUtils.isNotBlank(xinhcuang.getInstCode())){ + if (StringUtils.isNotBlank(xinhcuang.getInstCode())) { List tasks = taskService.createTaskQuery().active() .processInstanceId(xinhcuang.getInstCode()) .list(); 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 5929867..72d599d 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 @@ -48,7 +48,7 @@ import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; import com.hz.pm.api.projectlib.helper.ProjectManageUtil; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectInst; -import com.hz.pm.api.projectlib.model.enumeration.*; +import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; import com.hz.pm.api.projectlib.model.enumeration.status.*; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; @@ -78,6 +78,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; + import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -338,7 +339,7 @@ public class PurchaseManage { purchase.setSelfTestStatus(TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO.getCode()); purchase.setTestValidStatus(TenderTestValidStatus.WITHOUT_TEST_VALID_INFO.getCode()); purchase.setAdaptStatus(TenderAdaptStatus.WITHOUT_ADAPT_INFO.getCode()); - purchase.setStatus(TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO.getCode()); + purchase.setStatus(TenderStatus.TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO.getCode()); purchase.setXcfhxApplyStatus(TenderXcfhxApplyStatus.TO_BE_SUBMIT_XCFHX_APPLY.getCode()); if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) { notices.add(buildPurchaseNotice(w, user)); @@ -398,11 +399,12 @@ public class PurchaseManage { } @Transactional(rollbackFor = Exception.class) - public synchronized void submitPurchaseRecord(SubmitPurchaseRecordReq req) { + public synchronized void submitPurchaseRecord(SubmitPurchaseContractRecordReq req) { Purchase purchase = purchaseService.getById(req.getBidId()); - if (!TenderStatus.TO_BE_SUBMIT_PURCHASE_INFO.eq(purchase.getStatus())) { - throw BizException.wrap("该标段无法进行采购信息备案"); + if (!TenderStatus.TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO.eq(purchase.getStatus())) { + throw BizException.wrap("该标段无法进行采购&合同信息备案"); } + // 保存采购信息 purchase.setId(req.getBidId()); purchase.setAcceptanceLetter(req.getAcceptanceLetter()); purchase.setBidBuildContent(req.getBidBuildContent()); @@ -412,6 +414,41 @@ public class PurchaseManage { purchase.setBidType(req.getBidType()); tenderStateMachineUtil.pass(purchase); purchaseService.saveOrUpdate(purchase); + + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + Long projectId = req.getProjectId(); + Project project = projectService.getNewestNoNull(projectId); + LocalDateTime now = LocalDateTime.now(); + + // 保存合同信息 + Contract contract = contractService.getByBidId(req.getBidId()); + if (contract == null) { + contract = new Contract(); + contract.setCreateBy(user.getUserIdStr()); + contract.setCreateOn(now); + } + contract.setContractTime(req.getContractTime()); + contract.setAttachment(req.getAttachment()); + contract.setName(req.getName()); + contract.setProjectId(projectId); + contract.setProjectCode(project.getProjectCode()); + contract.setBidId(req.getBidId()); + contract.setId(req.getConstructionId()); + contract.setUpdateBy(user.getUserIdStr()); + contract.setUpdateOn(now); + contract.setTotalAmount(req.getTotalAmount()); + contract.setConstructionNo(req.getConstructionNo()); + contract.setSupplierContact(req.getSupplierContact()); + contract.setSupplierContactInfo(req.getSupplierContactInfo()); + contractService.saveOrUpdate(contract); + // 修改项目合同金额 + Wrapper query = Wrappers.lambdaQuery(Contract.class) + .eq(Contract::getProjectId, projectId); + List allContracts = contractService.list(query); + BigDecimal totalAmount = DecimalUtil.sum(allContracts, Contract::getTotalAmount); + project.setUpdateOn(now); + project.setContractAmount(totalAmount); + projectService.updateById(project); } private PageVo queryData(TestValidListReq req, @@ -684,12 +721,13 @@ public class PurchaseManage { /** * 详情 + * * @param id * @return */ public XinchuangVO detailXcfhxApply(Long id) { Xinchuang xinchuang = xinchuangService.getById(id); - if(Objects.isNull(xinchuang)){ + if (Objects.isNull(xinchuang)) { return null; } return BeanUtil.copyProperties(xinchuang, XinchuangVO.class); @@ -721,6 +759,7 @@ public class PurchaseManage { /** * 新增信创系统 + * * @param dto * @return */ @@ -733,7 +772,7 @@ public class PurchaseManage { xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); } } - if(xinchuangService.save(xinchuang)){ + if (xinchuangService.save(xinchuang)) { return xinchuang.getId(); } throw BizException.wrap("新增失败"); @@ -748,7 +787,7 @@ public class PurchaseManage { String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); } - if(xinchuangService.updateById(xinchuang)){ + if (xinchuangService.updateById(xinchuang)) { return xinchuang.getId(); } throw BizException.wrap("编辑失败"); @@ -758,7 +797,7 @@ public class PurchaseManage { return mhXchxFileHelper.getXchxFile(code, null); } - public void exportXcfhFile(String code,HttpServletResponse response) throws UnsupportedEncodingException { + public void exportXcfhFile(String code, HttpServletResponse response) throws UnsupportedEncodingException { mhXchxFileHelper.exportReport(code, response); } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitConstructionReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitConstructionReq.java deleted file mode 100644 index 05f86fd..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitConstructionReq.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hz.pm.api.projectdeclared.model.req; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - *

- * SubmitConstructionReq - *

- * - * @author WendyYang - * @since 00:14 2024/2/23 - */ -@Data -@ApiModel(value = "合同对象") -public class SubmitConstructionReq { - - @ApiModelProperty("项目ID") - @NotNull(message = "项目ID不能为空") - private Long projectId; - - @ApiModelProperty("合同ID") - private Long constructionId; - - @ApiModelProperty("标段ID") - private Long bidId; - - @ApiModelProperty("合同名称") - private String name; - - @ApiModelProperty("合同总金额") - private BigDecimal totalAmount; - - @ApiModelProperty("合同编号") - private String constructionNo; - - @ApiModelProperty("合同完成时间") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDateTime contractTime; - - @ApiModelProperty("附件") - private String attachment; - - @ApiModelProperty("供应商联系人") - private String supplierContact; - - @ApiModelProperty("供应商联系方式") - private String supplierContactInfo; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseContractRecordReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseContractRecordReq.java new file mode 100644 index 0000000..474346f --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseContractRecordReq.java @@ -0,0 +1,75 @@ +package com.hz.pm.api.projectdeclared.model.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * SubmitPurchaseContractRecordReq + *

+ * + * @author WendyYang + * @since 13:55 2024/7/9 + */ +@Data +public class SubmitPurchaseContractRecordReq { + + @ApiModelProperty("项目ID") + @NotNull(message = "请传项目ID") + private Long projectId; + + @ApiModelProperty("标段ID") + private Long bidId; + + @ApiModelProperty("标段类型") + private Integer bidType; + + @ApiModelProperty("供应商") + private String supplier; + + @ApiModelProperty("供应商社会信用代码") + private String supplierSocialCreditCode; + + @ApiModelProperty("投标文件") + private String biddingDoc; + + @ApiModelProperty("中标通知书") + private String acceptanceLetter; + + @ApiModelProperty("标段建设内容") + private String bidBuildContent; + + // 合同信息 + + @ApiModelProperty("合同ID") + private Long constructionId; + + @ApiModelProperty("合同名称") + private String name; + + @ApiModelProperty("合同总金额") + private BigDecimal totalAmount; + + @ApiModelProperty("合同编号") + private String constructionNo; + + @ApiModelProperty("合同完成时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime contractTime; + + @ApiModelProperty("附件") + private String attachment; + + @ApiModelProperty("供应商联系人") + private String supplierContact; + + @ApiModelProperty("供应商联系方式") + private String supplierContactInfo; + + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseRecordReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseRecordReq.java deleted file mode 100644 index aa1aed9..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseRecordReq.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.hz.pm.api.projectdeclared.model.req; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - *

- * 采购信息备案提交参数类 - *

- * - * @author WendyYang - * @since 11:34 2024/2/22 - */ -@Data -@AllArgsConstructor -public class SubmitPurchaseRecordReq { - - @ApiModelProperty("项目ID") - @NotNull(message = "请传项目ID") - private Long projectId; - - @ApiModelProperty("标段ID") - private Long bidId; - - @ApiModelProperty("标段类型") - private Integer bidType; - - @ApiModelProperty("供应商") - private String supplier; - - @ApiModelProperty("供应商社会信用代码") - private String supplierSocialCreditCode; - - @ApiModelProperty("投标文件") - private String biddingDoc; - - @ApiModelProperty("中标通知书") - private String acceptanceLetter; - - @ApiModelProperty("标段建设内容") - private String bidBuildContent; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java index a50d457..7b48d02 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderStatus.java @@ -20,8 +20,7 @@ import java.util.Optional; @AllArgsConstructor public enum TenderStatus implements IStatus { - TO_BE_SUBMIT_PURCHASE_INFO(ProjectStatus.ON_PURCHASING, 101, "待填写采购信息"), - TO_BE_SUBMIT_CONSTRUCTION_INFO(ProjectStatus.ON_PURCHASING, 102, "待填写合同信息"), + TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO(ProjectStatus.ON_PURCHASING, 101, "待填写采购&合同信息"), TO_BE_SUBMIT_OPERATION_PLAN(ProjectStatus.ON_PURCHASING, 103, "待填写实施计划"), TO_BE_SUBMIT_FIRST_INSPECTED_INFO(ProjectStatus.TO_BE_FIRST_INSPECTED, 201, "待上传初验材料"), TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY(ProjectStatus.ON_PILOT_RUNNING, 401, "待终验申报"),