|
@@ -1,8 +1,6 @@ |
|
|
package com.ningdatech.pmapi.projectdeclared.manage; |
|
|
package com.ningdatech.pmapi.projectdeclared.manage; |
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
import com.alibaba.excel.EasyExcel; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
@@ -10,7 +8,6 @@ import com.ningdatech.basic.function.VUtils; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.util.NdDateUtils; |
|
|
import com.ningdatech.basic.util.NdDateUtils; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
import com.ningdatech.pmapi.common.constant.RegionConst; |
|
|
|
|
|
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; |
|
|
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; |
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
@@ -18,8 +15,6 @@ import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelExportStyle; |
|
|
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.DefaultDeclaredDTO; |
|
|
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; |
|
|
import com.ningdatech.pmapi.projectdeclared.model.dto.PretrialDeclaredExportDTO; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.req.ConstrctionPlanListReq; |
|
|
import com.ningdatech.pmapi.projectdeclared.model.req.ConstrctionPlanListReq; |
|
|
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; |
|
@@ -34,7 +29,6 @@ import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.wflow.bean.entity.WflowModels; |
|
|
import com.wflow.bean.entity.WflowModels; |
|
|
import com.wflow.exception.BusinessException; |
|
|
import com.wflow.exception.BusinessException; |
|
@@ -67,7 +61,7 @@ import java.util.stream.Collectors; |
|
|
@Component |
|
|
@Component |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
|
public class ConstructionPlanManage { |
|
|
|
|
|
|
|
|
public class ConstructionPlanManage { |
|
|
|
|
|
|
|
|
private final IProjectService projectService; |
|
|
private final IProjectService projectService; |
|
|
|
|
|
|
|
@@ -96,7 +90,7 @@ public class ConstructionPlanManage { |
|
|
public String startTheProcess(DefaultDeclaredDTO dto) { |
|
|
public String startTheProcess(DefaultDeclaredDTO dto) { |
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
String employeeCode = user.getEmployeeCode(); |
|
|
String employeeCode = user.getEmployeeCode(); |
|
|
VUtils.isTrue(Objects.isNull(user) ||Objects.isNull(employeeCode)) |
|
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(user) || Objects.isNull(employeeCode)) |
|
|
.throwMessage("获取登录用户失败!"); |
|
|
.throwMessage("获取登录用户失败!"); |
|
|
|
|
|
|
|
|
ProjectDTO projectDto = dto.getProjectInfo(); |
|
|
ProjectDTO projectDto = dto.getProjectInfo(); |
|
@@ -130,10 +124,10 @@ public class ConstructionPlanManage { |
|
|
params.setProcessUsers(Collections.emptyMap()); |
|
|
params.setProcessUsers(Collections.emptyMap()); |
|
|
//放入条件判断的项目字段 |
|
|
//放入条件判断的项目字段 |
|
|
//把条件值给放入工作流 |
|
|
//把条件值给放入工作流 |
|
|
defaultDeclaredProjectManage.buildCondition(params,dto); |
|
|
|
|
|
|
|
|
defaultDeclaredProjectManage.buildCondition(params, dto); |
|
|
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 |
|
|
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 |
|
|
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,projectInfo); |
|
|
|
|
|
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); |
|
|
|
|
|
|
|
|
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode, projectInfo); |
|
|
|
|
|
String instanceId = processService.newStartProcess(model.getProcessDefId(), model.getFormId(), params, orgModelMap); |
|
|
log.info("建设方案项目申报成功 【{}】", instanceId); |
|
|
log.info("建设方案项目申报成功 【{}】", instanceId); |
|
|
|
|
|
|
|
|
//保存建设项目 |
|
|
//保存建设项目 |
|
@@ -151,7 +145,7 @@ public class ConstructionPlanManage { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public String restartTheProcess(DefaultDeclaredDTO dto) { |
|
|
public String restartTheProcess(DefaultDeclaredDTO dto) { |
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
VUtils.isTrue(Objects.isNull(user) ||Objects.isNull(user.getEmployeeCode())) |
|
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(user) || Objects.isNull(user.getEmployeeCode())) |
|
|
.throwMessage("获取登录用户失败!"); |
|
|
.throwMessage("获取登录用户失败!"); |
|
|
|
|
|
|
|
|
ProjectDTO projectDto = dto.getProjectInfo(); |
|
|
ProjectDTO projectDto = dto.getProjectInfo(); |
|
@@ -197,13 +191,14 @@ public class ConstructionPlanManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查项目 |
|
|
* 查项目 |
|
|
|
|
|
* |
|
|
* @param planReq |
|
|
* @param planReq |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public PageVo<ProjectLibListItemVO> projectLibList(ConstrctionPlanListReq planReq) { |
|
|
public PageVo<ProjectLibListItemVO> projectLibList(ConstrctionPlanListReq planReq) { |
|
|
//限定参数 复制bean |
|
|
//限定参数 复制bean |
|
|
ProjectListReq req = new ProjectListReq(); |
|
|
ProjectListReq req = new ProjectListReq(); |
|
|
BeanUtils.copyProperties(planReq,req); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(planReq, req); |
|
|
//项目阶段 状态 已定 方案待申报 |
|
|
//项目阶段 状态 已定 方案待申报 |
|
|
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); |
|
|
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); |
|
|
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); |
|
|
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); |
|
@@ -217,7 +212,7 @@ public class ConstructionPlanManage { |
|
|
public void exportList(HttpServletResponse response, ConstrctionPlanListReq planReq) { |
|
|
public void exportList(HttpServletResponse response, ConstrctionPlanListReq planReq) { |
|
|
//限定参数 复制bean |
|
|
//限定参数 复制bean |
|
|
ProjectListReq req = new ProjectListReq(); |
|
|
ProjectListReq req = new ProjectListReq(); |
|
|
BeanUtils.copyProperties(planReq,req); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(planReq, req); |
|
|
//项目阶段 状态 已定 方案待申报 |
|
|
//项目阶段 状态 已定 方案待申报 |
|
|
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); |
|
|
req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); |
|
|
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); |
|
|
req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); |
|
@@ -244,7 +239,7 @@ public class ConstructionPlanManage { |
|
|
collect.get(i).setSerialNumber(i + 1); |
|
|
collect.get(i).setSerialNumber(i + 1); |
|
|
} |
|
|
} |
|
|
String fileName = "建设方案申报项目列表"; |
|
|
String fileName = "建设方案申报项目列表"; |
|
|
ExcelDownUtil.setFileName(fileName,response); |
|
|
|
|
|
|
|
|
ExcelDownUtil.setFileName(fileName, response); |
|
|
//数据导出处理函数 |
|
|
//数据导出处理函数 |
|
|
try { |
|
|
try { |
|
|
EasyExcel.write(response.getOutputStream(), ConstructionPlanExportDTO.class) |
|
|
EasyExcel.write(response.getOutputStream(), ConstructionPlanExportDTO.class) |
|
|