@@ -1,13 +1,13 @@ | |||
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.ConstructionPlanManage; | |||
import com.hz.pm.api.projectdeclared.model.dto.ContructionSuggestionsDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectdeclared.model.req.ConstrctionPlanListReq; | |||
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; | |||
@@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletResponse; | |||
@Validated | |||
@RestController | |||
@RequestMapping("/api/v1/construction") | |||
@Api(value = "ConstructionPlan", tags = "申报管理-建设方案申报") | |||
@Api(tags = "申报管理-建设方案申报") | |||
@RequiredArgsConstructor | |||
public class ConstructionPlanController { | |||
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.helper.RegionCacheHelper; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.CommonConst; | |||
@@ -19,7 +18,7 @@ import com.hz.pm.api.projectdeclared.model.dto.ContructionSuggestionsDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; | |||
import com.hz.pm.api.projectdeclared.model.req.ConstrctionPlanListReq; | |||
import com.hz.pm.api.projectdeclared.service.IConstrctionSuggestionsService; | |||
import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; | |||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | |||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||
@@ -35,7 +34,7 @@ import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||
import com.hz.pm.api.sys.manage.NoticeManage; | |||
import com.hz.pm.api.todocenter.constant.WorkNoticeConstant; | |||
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; | |||
@@ -50,7 +49,6 @@ import com.wflow.workflow.service.ProcessModelService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.flowable.engine.HistoryService; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
@@ -70,8 +68,8 @@ import java.util.stream.Collectors; | |||
* @Date 2023/2/1 14:48 | |||
* @Author PoffyZhang | |||
*/ | |||
@Component | |||
@Slf4j | |||
@Component | |||
@RequiredArgsConstructor | |||
public class ConstructionPlanManage { | |||
@@ -85,10 +83,7 @@ public class ConstructionPlanManage { | |||
private final DefaultDeclaredProjectManage declaredProjectManage; | |||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | |||
private final NoticeManage noticeManage; | |||
private final RegionCacheHelper regionCacheHelper; | |||
private final HistoryService historyService; | |||
private final IConstrctionSuggestionsService constrctionSuggestionsService; | |||
private final IConstructionSuggestionsService constructionSuggestionsService; | |||
/** | |||
* 建设方案 | |||
@@ -98,7 +93,7 @@ public class ConstructionPlanManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public String startTheProcess(DefaultDeclaredDTO dto) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
Long userId = user.getUserId(); | |||
ProjectDTO projectInfo = dto.getProjectInfo(); | |||
Long projectInfoId = projectInfo.getId(); | |||
@@ -107,8 +102,8 @@ public class ConstructionPlanManage { | |||
VUtils.isTrue(StringUtils.isBlank(projectInfo.getConstructionPlanFile())).throwMessage("提交失败,请提交建设方案!"); | |||
// 判断 项目当前状态 是不是 方案待申报 | |||
VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(oldProject.getStatus()) || | |||
!ProjectStatusEnum.NOT_APPROVED.getCode().equals(oldProject.getStage())) | |||
VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.eq(oldProject.getStatus()) || | |||
!ProjectStatusEnum.NOT_APPROVED.eq(oldProject.getStage())) | |||
.throwMessage("提交失败 该项目不是 方案待申报状态或者未立项阶段"); | |||
projectInfo.setBuildOrgCode(user.getMhUnitIdStr()); | |||
@@ -139,7 +134,7 @@ public class ConstructionPlanManage { | |||
.last(BizConst.LIMIT_1)); | |||
if (Objects.isNull(model)) { | |||
throw new BusinessException("找不到建设申报流程配置"); | |||
throw BizException.wrap("找不到建设申报流程配置"); | |||
} | |||
//如果被禁用了的话 直接跳过 进入到下一个状态 | |||
@@ -261,9 +256,8 @@ public class ConstructionPlanManage { | |||
//项目阶段 状态 已定 方案待申报 | |||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
//放入用户的单位 | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
// 放入用户的单位 | |||
req.setBuildOrgCode(user.getMhUnitIdStr()); | |||
return projectLibManage.projectLibList(req); | |||
} | |||
@@ -275,8 +269,7 @@ public class ConstructionPlanManage { | |||
//项目阶段 状态 已定 方案待申报 | |||
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); | |||
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
//放入用户的单位 | |||
req.setBuildOrgCode(user.getMhUnitIdStr()); | |||
req.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); | |||
@@ -307,14 +300,14 @@ public class ConstructionPlanManage { | |||
.sheet(fileName) | |||
.doWrite(collect); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
throw new BizException(e); | |||
} | |||
} | |||
/** | |||
* 专家建设方案建议 暂存 等流程成功后 保存到项目 | |||
* | |||
* @param dto | |||
* @param dto \ | |||
*/ | |||
public void constructionSuggestions(ContructionSuggestionsDTO dto) { | |||
String instanceId = dto.getInstanceId(); | |||
@@ -336,7 +329,7 @@ public class ConstructionPlanManage { | |||
} | |||
ProjectConstructionSuggestions saveEntity = BeanUtil.copyProperties(dto, ProjectConstructionSuggestions.class); | |||
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) | |||
ProjectConstructionSuggestions pcs = constructionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) | |||
.eq(ProjectConstructionSuggestions::getProjectCode, dto.getProjectCode()) | |||
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId) | |||
.last(BizConst.LIMIT_1)); | |||
@@ -344,7 +337,7 @@ public class ConstructionPlanManage { | |||
saveEntity.setId(pcs.getId()); | |||
} | |||
saveEntity.setInstanceId(instanceId); | |||
constrctionSuggestionsService.saveOrUpdate(saveEntity); | |||
constructionSuggestionsService.saveOrUpdate(saveEntity); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
/** | |||
@@ -16,11 +17,9 @@ import java.math.BigDecimal; | |||
*/ | |||
@Data | |||
@TableName("nd_project_constrctiuon_suggestions") | |||
@ApiModel(value = "专家建设建议", description = "") | |||
@ApiModel(value = "专家建设建议") | |||
public class ProjectConstructionSuggestions { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("主键") | |||
@TableId(type = IdType.AUTO) | |||
private Long id; | |||
@@ -39,4 +38,5 @@ public class ProjectConstructionSuggestions { | |||
@ApiModelProperty("建议评审意见附件") | |||
private String proposeAttachFiles; | |||
} |
@@ -11,6 +11,6 @@ import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions | |||
* @author zpf | |||
* @since 2023-05-29 | |||
*/ | |||
public interface IConstrctionSuggestionsService extends IService<ProjectConstructionSuggestions> { | |||
public interface IConstructionSuggestionsService extends IService<ProjectConstructionSuggestions> { | |||
} |
@@ -3,7 +3,7 @@ package com.hz.pm.api.projectdeclared.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.hz.pm.api.projectdeclared.mapper.ConstructionSuggestionsMapper; | |||
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; | |||
import com.hz.pm.api.projectdeclared.service.IConstrctionSuggestionsService; | |||
import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
@@ -16,6 +16,6 @@ import org.springframework.stereotype.Service; | |||
*/ | |||
@Service | |||
public class ConstructionSuggestionsServiceImpl extends ServiceImpl<ConstructionSuggestionsMapper, ProjectConstructionSuggestions> | |||
implements IConstrctionSuggestionsService { | |||
implements IConstructionSuggestionsService { | |||
} |
@@ -16,7 +16,7 @@ import com.hz.pm.api.filemanage.service.INdProjectApplyBorrowService; | |||
import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage; | |||
import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.ProjectConstructionSuggestions; | |||
import com.hz.pm.api.projectdeclared.service.IConstrctionSuggestionsService; | |||
import com.hz.pm.api.projectdeclared.service.IConstructionSuggestionsService; | |||
import com.hz.pm.api.projectlib.model.dto.ProjectApplicationDTO; | |||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
@@ -29,7 +29,6 @@ import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService; | |||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.provincial.service.IJoinReviewProvincialBureauService; | |||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||
import com.hz.pm.api.staging.service.IProjectStagingService; | |||
import com.hz.pm.api.sys.manage.NoticeManage; | |||
@@ -37,7 +36,6 @@ import com.hz.pm.api.todocenter.constant.TodoCenterConst; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
import com.ningdatech.file.service.FileService; | |||
import com.wflow.contants.HisProInsEndActId; | |||
import com.wflow.workflow.bean.process.ProgressNode; | |||
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; | |||
@@ -70,13 +68,12 @@ import static com.hz.pm.api.todocenter.constant.WorkNoticeConstant.*; | |||
* @Date 2023/4/2 14:25 | |||
* @Author PoffyZhang | |||
*/ | |||
@Slf4j | |||
@Component | |||
@RequiredArgsConstructor | |||
@Slf4j | |||
public class HandlerManage { | |||
private final RuntimeService runtimeService; | |||
private final TaskService taskService; | |||
private final HistoryService historyService; | |||
private final IProjectService projectService; | |||
@@ -87,12 +84,9 @@ public class HandlerManage { | |||
private final IProjectInstService projectInstService; | |||
private final NoticeManage noticeManage; | |||
private final DeclaredProjectManage declaredProjectManage; | |||
private final FileService fileService; | |||
private final IJoinReviewProvincialBureauService joinReviewProvincialBureauService; | |||
private final INdProjectDelayApplyService projectDelayApplyService; | |||
private final INdProjectApplyBorrowService projectApplyBorrowService; | |||
private final IConstrctionSuggestionsService constrctionSuggestionsService; | |||
private final IConstructionSuggestionsService constructionSuggestionsService; | |||
@Value("${spring.profiles.active}") | |||
private String active; | |||
@@ -214,7 +208,7 @@ public class HandlerManage { | |||
.eq(ProjectConstructionSuggestions::getProjectCode, project.getProjectCode()) | |||
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId) | |||
.last(BizConst.LIMIT_1); | |||
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(query); | |||
ProjectConstructionSuggestions pcs = constructionSuggestionsService.getOne(query); | |||
if (Objects.nonNull(pcs)) { | |||
project.setProposeTotalInvest(pcs.getProposeTotalInvest()); | |||
project.setProposeAnnualBudget(pcs.getProposeAnnualBudget()); | |||