Browse Source

采购修改

tags/24080901
WendyYang 10 months ago
parent
commit
06d8517f25
18 changed files with 298 additions and 174 deletions
  1. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/model/vo/ProjectFileVO.java
  3. +0
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectConvertUtil.java
  4. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ConstructionController.java
  5. +5
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/OperationController.java
  6. +5
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectAdjustmentController.java
  7. +18
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java
  8. +76
    -57
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java
  9. +26
    -28
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java
  10. +50
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  11. +18
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/OperationReq.java
  12. +12
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Contract.java
  13. +19
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Operation.java
  14. +24
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java
  15. +13
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java
  16. +14
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/OperationVO.java
  17. +8
    -14
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  18. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java

+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java View File

@@ -230,7 +230,7 @@ public class ProjectFileManage {
List<ProcessDetailVO> processDetailVos = projectLibManage.processScheduleDetail(projectId);
ProjectReviewDetailVO projectReviewDetailVo = expertReviewManage.projectExpertReviewDetail(projectCode);
List<PurchaseVO> purchaseVos = purchaseManage.detailByProjectId(projectId);
ContractVO contractVo = constructionManage.detailContractByProjectId(projectId);
List<ContractVO> contractVos = constructionManage.detailContractByProjectId(projectId);
PreInsVO preInsVo = constructionManage.detailPreInsByProjectId(projectId);
FinalAcceptanceVO finalAcceptanceVo = finalAcceptanceManage.detailByProjectId(projectId);

@@ -238,7 +238,7 @@ public class ProjectFileManage {
projectFileVo.setProcessDetailVos(processDetailVos);
projectFileVo.setProjectReviewDetailVo(projectReviewDetailVo);
projectFileVo.setPurchaseVos(purchaseVos);
projectFileVo.setContractVo(contractVo);
projectFileVo.setContractVos(contractVos);
projectFileVo.setPreInsVo(preInsVo);
projectFileVo.setFinalAcceptanceVo(finalAcceptanceVo);



+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/filemanage/model/vo/ProjectFileVO.java View File

@@ -36,7 +36,7 @@ public class ProjectFileVO {
private List<PurchaseVO> purchaseVos;

@ApiModelProperty("合同登记详情")
private ContractVO contractVo;
private List<ContractVO> contractVos;

@ApiModelProperty("初验登记详情")
private PreInsVO preInsVo;


+ 0
- 12
hz-pm-api/src/main/java/com/hz/pm/api/gov/utils/ProjectConvertUtil.java View File

@@ -307,14 +307,6 @@ public class ProjectConvertUtil {
//转化采购信息
private static List<GovBizProjectProcureVO> buildProcure(ProjectDetailVO project) {
List<PurchaseVO> purchases = project.getPurchases();
ContractVO contract = project.getContract();
final BigDecimal[] paymentTotal = {BigDecimal.ZERO};
if (Objects.nonNull(contract)) {
List<PaymentPlanVO> payments = contract.getPayments();
payments.stream().map(PaymentPlanVO::getPaymentAmount)
.reduce(BigDecimal::add)
.ifPresent(b -> paymentTotal[0] = b);
}
if (CollUtil.isNotEmpty(purchases)) {
return purchases.stream().map(p -> {
GovBizProjectProcureVO purchase = new GovBizProjectProcureVO();
@@ -332,10 +324,6 @@ public class ProjectConvertUtil {
purchase.setBasePurchaseCode(p.getBudgetExecConfirmNo());
purchase.setBaseWinningBidTime(p.getTransactionTime());
purchase.setBiddingFile(p.getAcceptanceLetter());
purchase.setPaymentProgress(paymentTotal[0]);
if (Objects.nonNull(contract)) {
purchase.setPurchaseContract(contract.getAttachment());
}
purchase.setSetProjCodeFinan(project.getFinancialCode());
purchase.setPurchaseFile(p.getBidDoc());
return purchase;


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ConstructionController.java View File

@@ -2,9 +2,9 @@ package com.hz.pm.api.projectdeclared.controller;

import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.projectdeclared.manage.ConstructionManage;
import com.hz.pm.api.projectdeclared.model.dto.ContractSaveDTO;
import com.hz.pm.api.projectdeclared.model.dto.PaymentPlanSupplementDTO;
import com.hz.pm.api.projectdeclared.model.dto.PreInsSaveDTO;
import com.hz.pm.api.projectdeclared.model.req.SubmitConstructionReq;
import com.hz.pm.api.projectdeclared.model.vo.ContractVO;
import com.hz.pm.api.projectdeclared.model.vo.PreInsVO;
import com.hz.pm.api.projectdeclared.model.vo.ProjectContractListVO;
@@ -56,17 +56,17 @@ public class ConstructionController {
ExcelDownUtil.downXls(response, req, constructionManage::exportList);
}

@ApiOperation(value = "合同备案的详情-通过项目ID", notes = "合同备案的详情-通过项目ID")
@ApiOperation(value = "合同备案的详情")
@GetMapping("/contract/detail/{projectId}")
public ContractVO detailContractByProjectId(@PathVariable Long projectId) {
public List<ContractVO> detailContractByProjectId(@PathVariable Long projectId) {
return constructionManage.detailContractByProjectId(projectId);
}

@ApiOperation(value = "填写合同信息", notes = "填写合同信息")
@ApiOperation(value = "填写合同信息")
@WebLog("填写合同信息")
@PostMapping("/submit-contract")
public String submitContract(@Validated @RequestBody ContractSaveDTO dto) {
return constructionManage.submitContract(dto);
public String submitContract(@Validated @RequestBody SubmitConstructionReq req) {
return constructionManage.submitPurchaseContract(req);
}

@ApiOperation(value = "补充实际支付金额", notes = "补充实际支付金额")


+ 5
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/OperationController.java View File

@@ -1,8 +1,8 @@
package com.hz.pm.api.projectdeclared.controller;

import com.hz.pm.api.projectdeclared.model.dto.OperationReq;
import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.projectdeclared.manage.OperationManage;
import com.hz.pm.api.projectdeclared.model.dto.OperationDTO;
import com.hz.pm.api.projectdeclared.model.vo.OperationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @Classname OperationController
* @Description 申报项目-实施
@@ -28,14 +30,14 @@ public class OperationController {

@ApiOperation(value = "实施详情", notes = "实施详情")
@GetMapping("/detail/{projectId}")
public OperationVO detail(@PathVariable Long projectId) {
public List<OperationVO> detail(@PathVariable Long projectId) {
return operationManage.detail(projectId);
}

@PostMapping("/push-operation")
@ApiOperation("填写实施计划")
@WebLog("填写实施计划")
public String pushOperation(@RequestBody OperationDTO operation) {
public String pushOperation(@RequestBody OperationReq operation) {
return operationManage.pushOperation(operation);
}



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

@@ -1,5 +1,6 @@
package com.hz.pm.api.projectdeclared.controller;

import cn.hutool.core.io.FileUtil;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
@@ -15,6 +16,9 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.Comparator;
import java.util.List;

/**
* @Classname ConstructionPlanController
@@ -52,4 +56,5 @@ public class ProjectAdjustmentController {
public void exportList(AdjustmentListReq preReq, HttpServletResponse response){
ExcelDownUtil.downXls(response,preReq,projectAdjustmentManage::exportList);
}

}

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

@@ -1,14 +1,15 @@
package com.hz.pm.api.projectdeclared.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.projectdeclared.manage.ProjectAdjustmentManage;
import com.hz.pm.api.projectdeclared.manage.PurchaseManage;
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO;
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq;
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -34,8 +35,6 @@ import java.util.List;
public class PurchaseController {
private final PurchaseManage purchaseManage;

private final ProjectAdjustmentManage projectAdjustmentManage;

@ApiOperation(value = "待采购结果备案列表", notes = "待采购结果备案列表")
@GetMapping("/project-list")
public PageVo<ProjectLibListItemVO> projectlist(@ModelAttribute ProjectListReq req) {
@@ -62,4 +61,18 @@ public class PurchaseController {
return purchaseManage.submitResult(dto);
}

@ApiOperation("发布采购公告")
@WebLog("发布采购公告")
@PostMapping("/notice/submit")
public void submitPurchaseNotice(@RequestBody SubmitPurchaseNoticeReq req) {
purchaseManage.submitPurchaseNotice(req);
}

@ApiOperation("采购信息备案")
@WebLog("采购信息备案")
@PostMapping("/record/submit")
public void submitPurchaseRecord(@RequestBody SubmitPurchaseRecordReq req) {
purchaseManage.submitPurchaseRecord(req);
}

}

+ 76
- 57
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java View File

@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.common.util.DecimalUtil;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.projectdeclared.model.dto.ContractSaveDTO;
@@ -20,6 +21,7 @@ import com.hz.pm.api.projectdeclared.model.entity.Contract;
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan;
import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.req.SubmitConstructionReq;
import com.hz.pm.api.projectdeclared.model.vo.*;
import com.hz.pm.api.projectdeclared.service.IContractService;
import com.hz.pm.api.projectdeclared.service.IPaymentPlanService;
@@ -47,6 +49,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
@@ -246,51 +249,29 @@ public class ConstructionManage {
/**
* 获取合同备案详情
*
* @param projectId
* @return
* @param projectId \
* @return \
*/
public ContractVO detailContractByProjectId(Long projectId) {
public List<ContractVO> detailContractByProjectId(Long projectId) {
Project project = projectService.getNewProject(projectId);
if (Objects.isNull(project)) {
return null;
}
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class)
.eq(Contract::getProjectCode, project.getProjectCode())
.last(BizConst.LIMIT_1));

ContractVO vo = BeanUtil.copyProperties(contract, ContractVO.class);

List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class)
.eq(PaymentPlan::getProjectCode, project.getProjectCode())
.orderByAsc(PaymentPlan::getPaymentTime));

if (CollUtil.isNotEmpty(payments)) {
vo.setPayments(convertPayments(payments, contract.getTotalAmount()));
}

return vo;
}

private List<PaymentPlanVO> convertPayments(List<PaymentPlan> payments, BigDecimal totalAmount) {
if (CollUtil.isEmpty(payments)) {
return Collections.emptyList();
}
return payments.stream().map(p -> {
PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class);
vo.setRatio((Objects.isNull(totalAmount) || totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%"
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100))
.divide(totalAmount, BigDecimal.ROUND_CEILING, RoundingMode.CEILING) + "%");
return vo;
})
.collect(Collectors.toList());
List<Contract> contracts = contractService.list(Wrappers.lambdaQuery(Contract.class)
.eq(Contract::getProjectCode, project.getProjectCode()));

return BeanUtil.copyToList(contracts, ContractVO.class);
}

/**
* 填写合同信息
*
* @param dto
* @return
* @param dto \
* @return \
* @deprecated 弃用
*/
@Deprecated
@Transactional(rollbackFor = Exception.class)
public String submitContract(ContractSaveDTO dto) {
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
Long projectId = dto.getProjectId();
@@ -317,27 +298,25 @@ public class ConstructionManage {
}
contractEntity.setProjectId(projectId);
contractEntity.setProjectCode(project.getProjectCode());
if (contractService.saveOrUpdate(contractEntity)) {
//存 付款计划信心
if (Objects.nonNull(dto.getPayments())) {
//先删除
paymentPlanService.remove(Wrappers.lambdaQuery(PaymentPlan.class)
.eq(PaymentPlan::getProjectId, projectId));
if (CollUtil.isNotEmpty(dto.getPayments())) {
List<PaymentPlan> payments = dto.getPayments().stream().map(d -> {
PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class);
plan.setProjectId(projectId);
plan.setProjectCode(project.getProjectCode());
plan.setCreateOn(LocalDateTime.now());
plan.setUpdateOn(LocalDateTime.now());
plan.setCreateBy(user.getUserIdStr());
plan.setUpdateBy(user.getUserIdStr());
return plan;
}).collect(Collectors.toList());

paymentPlanService.saveBatch(payments);
}
if (contractService.saveOrUpdate(contractEntity) && (Objects.nonNull(dto.getPayments()))) {
//先删除
paymentPlanService.remove(Wrappers.lambdaQuery(PaymentPlan.class)
.eq(PaymentPlan::getProjectId, projectId));
if (CollUtil.isNotEmpty(dto.getPayments())) {
List<PaymentPlan> payments = dto.getPayments().stream().map(d -> {
PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class);
plan.setProjectId(projectId);
plan.setProjectCode(project.getProjectCode());
plan.setCreateOn(LocalDateTime.now());
plan.setUpdateOn(LocalDateTime.now());
plan.setCreateBy(user.getUserIdStr());
plan.setUpdateBy(user.getUserIdStr());
return plan;
}).collect(Collectors.toList());

paymentPlanService.saveBatch(payments);
}

}

//判断下 如果和初验都完成了 才进入下一阶段
@@ -357,6 +336,47 @@ public class ConstructionManage {
return "填写成功";
}

@Transactional(rollbackFor = Exception.class)
public String submitPurchaseContract(SubmitConstructionReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
Long projectId = req.getProjectId();
Project project = projectService.getNewProject(req.getProjectId());
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.UNDER_CONSTRUCTION.getCode().equals(project.getStatus()) ||
!ProjectStatusEnum.PROJECT_APPROVED.getCode().equals(project.getStage()))
.throwMessage("提交失败 该项目不是 建设中或者已立项阶段");

LocalDateTime now = LocalDateTime.now();
Contract contract = new Contract();
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.setCreateBy(user.getUserIdStr());
contract.setUpdateBy(user.getUserIdStr());
contract.setCreateOn(now);
contract.setUpdateOn(now);
contract.setTotalAmount(req.getTotalAmount());
contract.setConstructionNo(req.getConstructionNo());
contract.setSupplierContact(req.getSupplierContact());
contract.setSupplierContactInfo(req.getSupplierContactInfo());
contractService.saveOrUpdate(contract);

LambdaQueryWrapper<Contract> query = Wrappers.lambdaQuery(Contract.class)
.eq(Contract::getProjectId, projectId);
List<Contract> allContracts = contractService.list(query);
BigDecimal totalAmount = DecimalUtil.sum(allContracts, Contract::getTotalAmount);
project.setUpdateOn(now);
project.setContractAmount(totalAmount);
projectService.updateById(project);
return "填写成功";
}

/**
* 待初验项目列表
*
@@ -565,15 +585,14 @@ public class ConstructionManage {
project.setIsCompletedLogCollection(dto.getIsCompletedLogCollection());
project.setActualPerformanceIndicators(dto.getActualPerformanceIndicators());
projectService.updateById(project);

return "填写成功";
}

/**
* 补充项目 合同 实际支付信息
*
* @param plans
* @return
* @param plans \
* @return \
*/
public String supplement(List<PaymentPlanSupplementDTO> plans) {
if (CollUtil.isEmpty(plans)) {


+ 26
- 28
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java View File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.projectdeclared.model.dto.OperationDTO;
import com.hz.pm.api.projectdeclared.model.dto.OperationReq;
import com.hz.pm.api.projectdeclared.model.entity.Operation;
import com.hz.pm.api.projectdeclared.model.vo.OperationVO;
import com.hz.pm.api.projectdeclared.service.IOperationService;
@@ -15,11 +15,14 @@ import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.util.CollUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
@@ -42,24 +45,24 @@ public class OperationManage {
/**
* 获取实施详情
*
* @param projectId
* @return
* @param projectId \
* @return \
*/
public OperationVO detail(Long projectId) {
public List<OperationVO> detail(Long projectId) {
Project project = projectService.getNewProject(projectId);
Assert.notNull(project, "项目不存在!");

Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class)
.eq(Operation::getProjectCode, project.getProjectCode())
.last(BizConst.LIMIT_1));
List<Operation> operations = operationService.list(Wrappers.lambdaQuery(Operation.class)
.eq(Operation::getProjectCode, project.getProjectCode()));

return BeanUtil.copyProperties(operation, OperationVO.class);
return CollUtils.convert(operations, w -> BeanUtil.copyProperties(w, OperationVO.class));
}

public String pushOperation(OperationDTO operation) {
@Transactional(rollbackFor = Exception.class)
public String pushOperation(OperationReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

Project project = projectService.getNewProject(operation.getProjectId());
Project project = projectService.getNewProject(req.getProjectId());
Assert.notNull(project, "项目不存在!");

//首先要判断 项目当前状态 是不是 待开工状态
@@ -67,28 +70,23 @@ public class OperationManage {
!ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败 该项目不是 待开工或者已立项阶段");

Operation old = operationService.getOne(Wrappers.lambdaQuery(Operation.class)
Operation pre = operationService.getOne(Wrappers.lambdaQuery(Operation.class)
.eq(Operation::getProjectCode, project.getProjectCode())
.eq(Operation::getBidId, req.getBidId())
.last(BizConst.LIMIT_1));

Operation entity = BeanUtil.copyProperties(operation, Operation.class);
if (Objects.nonNull(old)) {
entity.setId(old.getId());
LocalDateTime now = LocalDateTime.now();
Operation curr = BeanUtil.copyProperties(req, Operation.class);
if (Objects.nonNull(pre)) {
curr.setId(pre.getId());
} else {
entity.setCreateOn(LocalDateTime.now());
entity.setCreateBy(user.getUsername());
curr.setCreateOn(now);
curr.setCreateBy(user.getUsername());
}
entity.setProjectCode(project.getProjectCode());
entity.setUpdateOn(LocalDateTime.now());
entity.setUpdateBy(user.getUsername());
//强制放入 计划终验时间
entity.setFinalInspectionDate(project.getPlanAcceptanceTime());
if (operationService.saveOrUpdate(entity)) {
stateMachineUtil.pass(project);
project.setUpdateOn(LocalDateTime.now());
projectService.updateById(project);
}

return entity.getProjectCode();
curr.setProjectCode(project.getProjectCode());
curr.setUpdateOn(now);
curr.setUpdateBy(user.getUsername());
operationService.saveOrUpdate(curr);
return curr.getProjectCode();
}
}

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

@@ -13,6 +13,8 @@ import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO;
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq;
import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseRecordReq;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO;
import com.hz.pm.api.projectdeclared.service.IPurchaseService;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
@@ -23,6 +25,7 @@ import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
@@ -215,4 +218,51 @@ public class PurchaseManage {
return "保存失败";
}

public void submitPurchaseNotice(SubmitPurchaseNoticeReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
Long projectId = req.getProjectId();
Project project = projectService.getNewProject(projectId);
Assert.notNull(project, "提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败,该项目不是待采购备案状态或者已立项阶段");
Purchase purchase = new Purchase();
purchase.setPurchaseMethod(req.getPurchaseMethod());
purchase.setBizAddress(req.getBidAddress());
purchase.setBidName(req.getBidName());
purchase.setBizBudget(req.getBidBudget());
purchase.setBidDoc(req.getBidDoc());
purchase.setBidStartTime(req.getBidStartTime());
purchase.setBidEndTime(req.getBidEndTime());
purchase.setId(req.getBidId());
purchase.setProjectId(projectId);
if (purchase.getId() == null) {
purchase.setCreateBy(user.getUserIdStr());
}
purchaseService.saveOrUpdate(purchase);
}

public void submitPurchaseRecord(SubmitPurchaseRecordReq req) {
Long projectId = req.getProjectId();
Project project = projectService.getNewProject(projectId);
Assert.notNull(project, "提交失败 此项目不存在!");

//首先要判断 项目当前状态 是不是 采购结果备案
VUtils.isTrue(!ProjectStatusEnum.TO_BE_PURCHASED.eq(project.getStatus())
|| !ProjectStatusEnum.PROJECT_APPROVED.eq(project.getStage()))
.throwMessage("提交失败,该项目不是待采购备案状态或者已立项阶段");

Purchase purchase = new Purchase();
purchase.setId(req.getBidId());
purchase.setAcceptanceLetter(req.getAcceptanceLetter());
purchase.setBidBuildContent(req.getBidBuildContent());
purchase.setBiddingDoc(req.getBiddingDoc());
purchase.setSupplier(req.getSupplier());
purchase.setSupplierSocialCreditCode(req.getSupplierSocialCreditCode());
purchase.setBidType(req.getBidType());
purchaseService.saveOrUpdate(purchase);
}

}

hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/OperationDTO.java → hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/OperationReq.java View File

@@ -2,24 +2,28 @@ package com.hz.pm.api.projectdeclared.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
* @Classname OperationDTO
* @Description
* @Date 2023/5/29 10:00
* @Author PoffyZhang
* <p>
* 实施计划参数类
* </p>
*
* @author WendyYang
* @since 09:25 2024/2/23
*/
@ApiModel(value = "实施对象DTO", description = "实施对象DTO")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OperationDTO {
@ApiModel(value = "实施对象DTO")
public class OperationReq {

@ApiModelProperty("实施计划ID")
private Long operationId;

@ApiModelProperty("标段ID")
private Long bidId;

@ApiModelProperty("项目ID")
@NotNull(message = "项目ID不能为空")
@@ -41,6 +45,9 @@ public class OperationDTO {
private LocalDateTime finalInspectionDate;

@ApiModelProperty("开始实施时间")
@NotNull(message = "开始实施时间不能为空")
private LocalDateTime startTrialOperationDate;

@ApiModelProperty("试运行开始时间")
private LocalDateTime pilotRunStartDate;

}

+ 12
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Contract.java View File

@@ -70,4 +70,16 @@ public class Contract {
@ApiModelProperty("项目编号")
private String projectCode;

@ApiModelProperty("标段ID")
private Long bidId;

@ApiModelProperty("合同编号")
private String constructionNo;

@ApiModelProperty("供应商联系人")
private String supplierContact;

@ApiModelProperty("供应商联系方式")
private String supplierContactInfo;

}

+ 19
- 10
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Operation.java View File

@@ -5,28 +5,33 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
* @Classname Operation
* @Description
* @Date 2023/5/29 10:00
* @Author PoffyZhang
* <p>
* Operation
* </p>
*
* @author WendyYang
* @since 09:36 2024/2/23
*/
@TableName("nd_project_operation")
@ApiModel(value = "实施对象", description = "实施对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("nd_project_operation")
@ApiModel(value = "实施对象")
public class Operation {

@TableId(type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;

@ApiModelProperty("标段ID")
private Long bidId;

@ApiModelProperty("项目ID")
private Long projectId;

@@ -39,10 +44,10 @@ public class Operation {
@ApiModelProperty("修改时间")
private LocalDateTime updateOn;

@ApiModelProperty("创建人 工号")
@ApiModelProperty("创建人ID")
private String createBy;

@ApiModelProperty("修改人 工号")
@ApiModelProperty("修改人ID")
private String updateBy;

@ApiModelProperty("项目开工时间")
@@ -56,4 +61,8 @@ public class Operation {

@ApiModelProperty("开始实施时间")
private LocalDateTime startTrialOperationDate;

@ApiModelProperty("试运行开始时间")
private LocalDateTime pilotRunStartDate;

}

+ 24
- 11
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java View File

@@ -50,12 +50,6 @@ public class Purchase {
@ApiModelProperty("供应商")
private String supplier;

@ApiModelProperty("供应商联系人")
private String supplierContact;

@ApiModelProperty("供应商联系方式")
private String supplierContactInfo;

@ApiModelProperty("供应商社会信用代码")
private String supplierSocialCreditCode;

@@ -71,18 +65,37 @@ public class Purchase {
@ApiModelProperty("代理机构")
private String agency;

@ApiModelProperty("代理机构社会统一信用代码")
private String purchaseSocialCreditCode;
@ApiModelProperty("标段类型")
private Integer bidType;

@ApiModelProperty("投标文件")
private String biddingDoc;

@ApiModelProperty("招标文件")
private String bidDoc;

@ApiModelProperty("中标通知书")
private String acceptanceLetter;

@ApiModelProperty("标段建设内容")
private String bidBuildContent;

@ApiModelProperty("代理机构社会统一信用代码")
private String purchaseSocialCreditCode;

@ApiModelProperty("招标文件")
private String bidDoc;

@ApiModelProperty("预算执行确认书编号")
private String budgetExecConfirmNo;

@ApiModelProperty("投标地址")
private String bizAddress;

@ApiModelProperty("标项预算")
private BigDecimal bizBudget;

@ApiModelProperty("开标时间")
private LocalDateTime bidStartTime;

@ApiModelProperty("投标截止时间")
private LocalDateTime bidEndTime;

}

+ 13
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ContractVO.java View File

@@ -9,7 +9,6 @@ import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname Contract
@@ -18,11 +17,9 @@ import java.util.List;
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ContractVO", description = "")
@ApiModel(value = "ContractVO")
public class ContractVO {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

@@ -75,6 +72,16 @@ public class ContractVO {
@ApiModelProperty("项目编号")
private String projectCode;

@ApiModelProperty("支付计划")
private List<PaymentPlanVO> payments;
@ApiModelProperty("供应商联系人")
private String supplierContact;

@ApiModelProperty("供应商联系方式")
private String supplierContactInfo;

@ApiModelProperty("标段ID")
private Long bidId;

@ApiModelProperty("合同编号")
private String constructionNo;

}

+ 14
- 7
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/OperationVO.java View File

@@ -9,15 +9,15 @@ import lombok.NoArgsConstructor;
import java.time.LocalDateTime;

/**
* @Classname Operation
* @Description
* @Date 2023/5/29 10:00
* @Author PoffyZhang
* <p>
* OperationVO
* </p>
*
* @author WendyYang
* @since 09:28 2024/2/23
*/
@ApiModel(value = "实施对象", description = "实施对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "实施对象")
public class OperationVO {

@ApiModelProperty("id")
@@ -50,6 +50,13 @@ public class OperationVO {
@ApiModelProperty("终验时间")
private LocalDateTime finalInspectionDate;

@ApiModelProperty("标段ID")
private Long bidId;

@ApiModelProperty("试运行开始时间")
private LocalDateTime pilotRunStartDate;

@ApiModelProperty("开始实施时间")
private LocalDateTime startTrialOperationDate;

}

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

@@ -5,7 +5,6 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -41,8 +40,12 @@ import com.hz.pm.api.portrait.model.entity.Tag;
import com.hz.pm.api.portrait.model.vo.TagVO;
import com.hz.pm.api.portrait.service.IProjectTagService;
import com.hz.pm.api.portrait.service.ITagService;
import com.hz.pm.api.projectdeclared.manage.ConstructionManage;
import com.hz.pm.api.projectdeclared.model.dto.DelayedApplyDTO;
import com.hz.pm.api.projectdeclared.model.entity.*;
import com.hz.pm.api.projectdeclared.model.entity.Operation;
import com.hz.pm.api.projectdeclared.model.entity.PaymentPlan;
import com.hz.pm.api.projectdeclared.model.entity.PreInsAcceptancePerson;
import com.hz.pm.api.projectdeclared.model.entity.Purchase;
import com.hz.pm.api.projectdeclared.model.vo.*;
import com.hz.pm.api.projectdeclared.service.*;
import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil;
@@ -94,7 +97,6 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Array;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -139,6 +141,7 @@ public class ProjectLibManage {
private final TaskService taskService;
private final UserInfoHelper userInfoHelper;
private final IExpertReviewService expertReviewService;
private final ConstructionManage constructionManage;

public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
@@ -689,17 +692,8 @@ public class ProjectLibManage {
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class));

//查询合同备案
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class)
.eq(Contract::getProjectCode, projectInfo.getProjectCode())
.last(BizConst.LIMIT_1));
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class);
vo.setContract(contractVO);
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class)
.eq(PaymentPlan::getProjectCode, projectInfo.getProjectCode())
.orderByAsc(PaymentPlan::getPaymentTime));
if (Objects.nonNull(contractVO)) {
contractVO.setPayments(convertPayments(payments, contractVO.getTotalAmount()));
}
List<ContractVO> contracts = constructionManage.detailContractByProjectId(projectInfo.getId());
vo.setContract(contracts);

//查询实施信息
Operation operation = operationService.getOne(Wrappers.lambdaQuery(Operation.class)


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/ProjectDetailVO.java View File

@@ -402,7 +402,7 @@ public class ProjectDetailVO {
private BigDecimal contractAmount;

@ApiModelProperty("合同信息")
private ContractVO contract;
private List<ContractVO> contract;

@ApiModelProperty("采购信息")
private List<PurchaseVO> purchases;


Loading…
Cancel
Save