@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.manage; | package com.ningdatech.pmapi.projectdeclared.manage; | ||||
import cn.hutool.core.bean.BeanUtil; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import com.alibaba.excel.EasyExcel; | import com.alibaba.excel.EasyExcel; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 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.ConstructionPlanExportDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.ContructionSuggestionsDTO; | import com.ningdatech.pmapi.projectdeclared.model.dto.ContructionSuggestionsDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | 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.model.req.ConstrctionPlanListReq; | ||||
import com.ningdatech.pmapi.projectdeclared.service.IConstrctionSuggestionsService; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | ||||
@@ -89,6 +92,7 @@ public class ConstructionPlanManage { | |||||
private final RegionCacheHelper regionCacheHelper; | private final RegionCacheHelper regionCacheHelper; | ||||
private final HistoryService historyService; | private final HistoryService historyService; | ||||
private final IConstrctionSuggestionsService constrctionSuggestionsService; | |||||
/** | /** | ||||
* 建设方案 | * 建设方案 | ||||
* | * | ||||
@@ -365,7 +369,16 @@ public class ConstructionPlanManage { | |||||
throw new BizException("此流程不是建设方案流程 保存失败!"); | 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); | |||||
} | } | ||||
} | } |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-02-05 | |||||
*/ | |||||
public interface ConstructionSuggestionsMapper extends BaseMapper<ProjectConstructionSuggestions> { | |||||
} |
@@ -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; | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-05-29 | |||||
*/ | |||||
public interface IConstrctionSuggestionsService extends IService<ProjectConstructionSuggestions> { | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-02-05 | |||||
*/ | |||||
@Service | |||||
public class ConstructionSuggestionsServiceImpl extends ServiceImpl<ConstructionSuggestionsMapper, ProjectConstructionSuggestions> | |||||
implements IConstrctionSuggestionsService { | |||||
} |
@@ -17,6 +17,8 @@ import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; | |||||
import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; | import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; | ||||
import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService; | import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService; | ||||
import com.ningdatech.pmapi.projectdeclared.converter.ApplicationConverter; | 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.enumeration.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply; | ||||
import com.ningdatech.pmapi.projectlib.service.INdProjectDelayApplyService; | import com.ningdatech.pmapi.projectlib.service.INdProjectDelayApplyService; | ||||
@@ -92,6 +94,8 @@ public class HandlerManage { | |||||
private final INdProjectDelayApplyService projectDelayApplyService; | private final INdProjectDelayApplyService projectDelayApplyService; | ||||
private final INdProjectApplyBorrowService projectApplyBorrowService; | private final INdProjectApplyBorrowService projectApplyBorrowService; | ||||
private final IConstrctionSuggestionsService constrctionSuggestionsService; | |||||
@Value("${spring.profiles.active}") | @Value("${spring.profiles.active}") | ||||
private String active; | private String active; | ||||
@@ -199,10 +203,14 @@ public class HandlerManage { | |||||
// 当前项目状态是单位内部审核中 | // 当前项目状态是单位内部审核中 | ||||
case UNDER_INTERNAL_AUDIT: | case UNDER_INTERNAL_AUDIT: | ||||
// 当前项目状态是方案评审中 | // 当前项目状态是方案评审中 | ||||
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: | |||||
updatePassProjectStatus(userId, declaredProject); | |||||
break; | |||||
case SCHEME_UNDER_REVIEW: | case SCHEME_UNDER_REVIEW: | ||||
// 当前项目状态是终验审核中 | // 当前项目状态是终验审核中 | ||||
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: | |||||
updatePassProjectStatus(userId, declaredProject); | updatePassProjectStatus(userId, declaredProject); | ||||
// 判断是否 保存建设建议信息 | |||||
saveContructionSuggestionInfo(instance.getId(),declaredProject); | |||||
break; | break; | ||||
default: | default: | ||||
throw new BizException("传入项目状态错误: " + declaredProject.getStatus()); | 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) { | public void updateProjectApplyBorrowInfo(Project declaredProject, String instanceId) { | ||||
// 获取申请借阅信息 | // 获取申请借阅信息 | ||||
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) | ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) | ||||