diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index 2bfe035..bf28fa4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectdeclared.manage; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -22,7 +23,9 @@ import com.ningdatech.pmapi.common.util.ExcelExportStyle; import com.ningdatech.pmapi.projectdeclared.model.dto.ConstructionPlanExportDTO; import com.ningdatech.pmapi.projectdeclared.model.dto.ContructionSuggestionsDTO; import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectConstructionSuggestions; import com.ningdatech.pmapi.projectdeclared.model.req.ConstrctionPlanListReq; +import com.ningdatech.pmapi.projectdeclared.service.IConstrctionSuggestionsService; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -89,6 +92,7 @@ public class ConstructionPlanManage { private final RegionCacheHelper regionCacheHelper; private final HistoryService historyService; + private final IConstrctionSuggestionsService constrctionSuggestionsService; /** * 建设方案 * @@ -365,7 +369,16 @@ public class ConstructionPlanManage { throw new BizException("此流程不是建设方案流程 保存失败!"); } - + ProjectConstructionSuggestions saveEntity = BeanUtil.copyProperties(dto,ProjectConstructionSuggestions.class); + ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) + .eq(ProjectConstructionSuggestions::getProjectCode, dto.getProjectCode()) + .eq(ProjectConstructionSuggestions::getInstanceId, processInstanceId) + .last(BizConst.LIMIT_1)); + if(Objects.nonNull(pcs)){ + saveEntity.setId(pcs.getId()); + } + saveEntity.setInstanceId(processInstanceId); + constrctionSuggestionsService.saveOrUpdate(saveEntity); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ConstructionSuggestionsMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ConstructionSuggestionsMapper.java new file mode 100644 index 0000000..0d62310 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ConstructionSuggestionsMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectConstructionSuggestions; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface ConstructionSuggestionsMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectConstructionSuggestions.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectConstructionSuggestions.java new file mode 100644 index 0000000..c2577ad --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectConstructionSuggestions.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.projectdeclared.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.math.BigDecimal; + +/** + * @Classname ProjectContructionSuggestions + * @Description + * @Date 2023/5/30 15:35 + * @Author PoffyZhang + */ +@Data +@TableName("nd_contract") +@ApiModel(value = "专家建设建议", description = "") +public class ProjectConstructionSuggestions { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("实例ID") + private String instanceId; + + @ApiModelProperty("项目编号") + private String projectCode; + + @ApiModelProperty("建议项目总投资") + private BigDecimal proposeTotalInvest; + + @ApiModelProperty("建议年度预算") + private BigDecimal proposeAnnualBudget; + + @ApiModelProperty("建议评审意见附件") + private String proposeAttachFiles; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IConstrctionSuggestionsService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IConstrctionSuggestionsService.java new file mode 100644 index 0000000..db75cdd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IConstrctionSuggestionsService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectConstructionSuggestions; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-05-29 + */ +public interface IConstrctionSuggestionsService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ConstructionSuggestionsServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ConstructionSuggestionsServiceImpl.java new file mode 100644 index 0000000..f49656d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ConstructionSuggestionsServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.ConstructionSuggestionsMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectConstructionSuggestions; +import com.ningdatech.pmapi.projectdeclared.service.IConstrctionSuggestionsService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class ConstructionSuggestionsServiceImpl extends ServiceImpl + implements IConstrctionSuggestionsService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 62754c6..5cbe052 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -17,6 +17,8 @@ import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService; import com.ningdatech.pmapi.projectdeclared.converter.ApplicationConverter; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectConstructionSuggestions; +import com.ningdatech.pmapi.projectdeclared.service.IConstrctionSuggestionsService; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply; import com.ningdatech.pmapi.projectlib.service.INdProjectDelayApplyService; @@ -92,6 +94,8 @@ public class HandlerManage { private final INdProjectDelayApplyService projectDelayApplyService; private final INdProjectApplyBorrowService projectApplyBorrowService; + private final IConstrctionSuggestionsService constrctionSuggestionsService; + @Value("${spring.profiles.active}") private String active; @@ -199,10 +203,14 @@ public class HandlerManage { // 当前项目状态是单位内部审核中 case UNDER_INTERNAL_AUDIT: // 当前项目状态是方案评审中 + case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: + updatePassProjectStatus(userId, declaredProject); + break; case SCHEME_UNDER_REVIEW: // 当前项目状态是终验审核中 - case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: updatePassProjectStatus(userId, declaredProject); + // 判断是否 保存建设建议信息 + saveContructionSuggestionInfo(instance.getId(),declaredProject); break; default: throw new BizException("传入项目状态错误: " + declaredProject.getStatus()); @@ -226,6 +234,27 @@ public class HandlerManage { } } + /** + * 去保存 建设建议信息 + * @param instanceId + * @param project + */ + private void saveContructionSuggestionInfo(String instanceId, Project project) { + ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) + .eq(ProjectConstructionSuggestions::getProjectCode, project.getProjectCode()) + .eq(ProjectConstructionSuggestions::getInstanceId, instanceId) + .last(BizConst.LIMIT_1)); + if(Objects.isNull(pcs)){ + log.info("没有该流程的 建设 建议信息"); + return; + } + + project.setProposeTotalInvest(pcs.getProposeTotalInvest()); + project.setProposeAnnualBudget(pcs.getProposeAnnualBudget()); + project.setProposeAttachFiles(pcs.getProposeAttachFiles()); + projectService.updateById(project); + } + public void updateProjectApplyBorrowInfo(Project declaredProject, String instanceId) { // 获取申请借阅信息 ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class)