@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import java.time.LocalDateTime; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
@@ -75,7 +76,8 @@ public class EmployeeBatchGetTask { | |||||
} | } | ||||
Long totalSize = data.getTotalSize(); | Long totalSize = data.getTotalSize(); | ||||
if (totalSize > PAGE_SIZE) { | if (totalSize > PAGE_SIZE) { | ||||
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE); | |||||
int restPageNo = totalSize % PAGE_SIZE > 0 ? 1 : 0; | |||||
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE) + restPageNo; | |||||
for (pageNo = 2; pageNo <= maxPageNo; pageNo++) { | for (pageNo = 2; pageNo <= maxPageNo; pageNo++) { | ||||
query.setPageNo(maxPageNo); | query.setPageNo(maxPageNo); | ||||
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | ||||
@@ -99,7 +101,6 @@ public class EmployeeBatchGetTask { | |||||
saveBatch(dingEmployeeInfoSaveRecordList); | saveBatch(dingEmployeeInfoSaveRecordList); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -137,6 +138,10 @@ public class EmployeeBatchGetTask { | |||||
dingEmployeeInfo.setOrganizationCode(govEmployeePosition.getOrganizationCode()); | dingEmployeeInfo.setOrganizationCode(govEmployeePosition.getOrganizationCode()); | ||||
dingEmployeeInfo.setEmpPosVirtualOrganizationCode(govEmployeePosition.getEmpPosVirtualOrganizationCode()); | dingEmployeeInfo.setEmpPosVirtualOrganizationCode(govEmployeePosition.getEmpPosVirtualOrganizationCode()); | ||||
dingEmployeeInfo.setEmpStatus(govEmployeePosition.getStatus()); | dingEmployeeInfo.setEmpStatus(govEmployeePosition.getStatus()); | ||||
dingEmployeeInfo.setCreateOn(LocalDateTime.now()); | |||||
dingEmployeeInfo.setUpdateOn(LocalDateTime.now()); | |||||
dingEmployeeInfo.setCreateBy(-1L); | |||||
dingEmployeeInfo.setUpdateBy(-1L); | |||||
segmentSaveRecordList.add(dingEmployeeInfo); | segmentSaveRecordList.add(dingEmployeeInfo); | ||||
} | } | ||||
saveRecordList.addAll(segmentSaveRecordList); | saveRecordList.addAll(segmentSaveRecordList); | ||||
@@ -32,7 +32,7 @@ public class DingEmployeeInfo implements Serializable { | |||||
private Long updateBy; | private Long updateBy; | ||||
private String emplyeeName; | |||||
private String employeeName; | |||||
private String gmtCreate; | private String gmtCreate; | ||||
@@ -56,6 +56,6 @@ public class ProjectAdjustmentController { | |||||
@PostMapping | @PostMapping | ||||
public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { | public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { | ||||
String instanceId = projectAdjustmentManage.adjustment(dto); | String instanceId = projectAdjustmentManage.adjustment(dto); | ||||
return "建设方案申报 【" + instanceId + "】 成功"; | |||||
return "项目内容调整并且重新申报 【" + instanceId + "】 成功"; | |||||
} | } | ||||
} | } |
@@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
@@ -57,6 +58,7 @@ public class ConstructionPlanManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
@@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
@@ -65,6 +66,8 @@ public class DeclaredProjectManage { | |||||
private final IProjectInstService projectInstService; | private final IProjectInstService projectInstService; | ||||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | |||||
public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) { | public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) { | ||||
Page<ProjectDraft> page = params.page(); | Page<ProjectDraft> page = params.page(); | ||||
LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | ||||
@@ -108,6 +111,7 @@ public class DeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
ProjectDTO projectInfo = dto.getProjectInfo(); | ProjectDTO projectInfo = dto.getProjectInfo(); | ||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
@@ -122,6 +126,9 @@ public class DeclaredProjectManage { | |||||
throw new BusinessException(String.format("此 【%s】区域找不到单位流程配置", regionCode)); | throw new BusinessException(String.format("此 【%s】区域找不到单位流程配置", regionCode)); | ||||
} | } | ||||
//项目名称去重 | |||||
defaultDeclaredProjectManage.checkDuplication(projectInfo); | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
@@ -133,6 +140,7 @@ public class DeclaredProjectManage { | |||||
}) | }) | ||||
); | ); | ||||
params.setFormData(dto.getFormData()); | params.setFormData(dto.getFormData()); | ||||
//开始申报 | |||||
String instanceId = processService.startProcess(model.getProcessDefId(), params); | String instanceId = processService.startProcess(model.getProcessDefId(), params); | ||||
log.info("申报项目成功 【{}】", instanceId); | log.info("申报项目成功 【{}】", instanceId); | ||||
@@ -148,6 +156,7 @@ public class DeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String reStartTheProcess(DefaultDeclaredDTO dto) { | public String reStartTheProcess(DefaultDeclaredDTO dto) { | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
@@ -1,14 +1,14 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.manage; | package com.ningdatech.pmapi.projectdeclared.manage; | ||||
import com.google.common.collect.Maps; | |||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.basic.function.VUtils; | |||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import javax.annotation.PostConstruct; | |||||
import java.util.Map; | |||||
import java.util.function.Function; | |||||
import java.util.Objects; | |||||
/** | /** | ||||
* @Classname DefaultDeclaredProjectManage | * @Classname DefaultDeclaredProjectManage | ||||
@@ -22,28 +22,14 @@ import java.util.function.Function; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class DefaultDeclaredProjectManage { | public class DefaultDeclaredProjectManage { | ||||
private final DeclaredProjectManage declaredProjectManage; | |||||
private final IProjectService projectService; | |||||
private final ConstructionPlanManage constructionPlanManage; | |||||
private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage; | |||||
public Map<Integer, Function<DefaultDeclaredDTO,String>> startProcessMap = Maps.newHashMap(); | |||||
/** | |||||
* 初始化业务分派逻辑,代替了if-else部分 | |||||
* key: 枚举 状态值 | |||||
* value: lambda表达式,最终会获取发起实例的函数 | |||||
*/ | |||||
@PostConstruct | |||||
public void startProcessInit(){ | |||||
startProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||||
dto->declaredProjectManage.reStartTheProcess(dto)); | |||||
startProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), | |||||
dto->constructionPlanManage.startTheProcess(dto)); | |||||
startProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||||
dto->prequalificationDeclaredProjectManage.startTheProcess(dto)); | |||||
startProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||||
dto->null); | |||||
//项目名称去重 | |||||
public void checkDuplication(ProjectDTO project){ | |||||
VUtils.isTrue(projectService.count(Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getProjectName,project.getProjectName()) | |||||
.ne(Objects.nonNull(project.getId()),Project::getId,project.getId())) > 0) | |||||
.throwMessage(String.format("修改失败 此项目名 【%s】 已存在!",project.getProjectName())); | |||||
} | } | ||||
} | } |
@@ -24,6 +24,7 @@ import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
@@ -57,6 +58,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String startTheProcess(DefaultDeclaredDTO dto) { | public String startTheProcess(DefaultDeclaredDTO dto) { | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | ||||
import com.ningdatech.pmapi.projectdeclared.utils.ReStartProcessMapUtil; | |||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | ||||
@@ -14,6 +15,8 @@ import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
@@ -35,6 +38,8 @@ public class ProjectAdjustmentManage { | |||||
private final IProjectApplicationService projectApplicationService; | private final IProjectApplicationService projectApplicationService; | ||||
private final ReStartProcessMapUtil reStartProcessMapUtil; | |||||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | ||||
/** | /** | ||||
@@ -42,12 +47,29 @@ public class ProjectAdjustmentManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public String adjustment(DefaultDeclaredDTO dto) { | public String adjustment(DefaultDeclaredDTO dto) { | ||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
Project projectInfo = projectService.getById(projectDto.getId()); | Project projectInfo = projectService.getById(projectDto.getId()); | ||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!"); | ||||
//项目名称去重 | |||||
defaultDeclaredProjectManage.checkDuplication(projectDto); | |||||
//修改项目内容 | |||||
if(!modifyProject(projectDto)){ | |||||
throw new BusinessException("调整项目失败!"); | |||||
} | |||||
//最后去重新 提交项目流程 不同的状态 提交到不同的工作流去 | |||||
Function<DefaultDeclaredDTO, String> declaredFunction = | |||||
reStartProcessMapUtil.reStartProcessMap.get(projectInfo.getStatus()); | |||||
VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!"); | |||||
return declaredFunction.apply(dto); | |||||
} | |||||
private Boolean modifyProject(ProjectDTO projectDto) { | |||||
//先修改项目信息 | //先修改项目信息 | ||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(projectDto,project); | BeanUtils.copyProperties(projectDto,project); | ||||
@@ -69,11 +91,6 @@ public class ProjectAdjustmentManage { | |||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
projectApplicationService.saveBatch(applications); | projectApplicationService.saveBatch(applications); | ||||
} | } | ||||
//最后去重新 提交项目流程 不同的状态 提交到不同的工作流去 | |||||
Function<DefaultDeclaredDTO, String> declaredFunction = | |||||
defaultDeclaredProjectManage.startProcessMap.get(project.getStatus()); | |||||
VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!"); | |||||
return declaredFunction.apply(dto); | |||||
return Boolean.TRUE; | |||||
} | } | ||||
} | } |
@@ -1,6 +1,7 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.model.dto; | package com.ningdatech.pmapi.projectdeclared.model.dto; | ||||
import com.ningdatech.basic.model.PagePo; | import com.ningdatech.basic.model.PagePo; | ||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Builder; | import lombok.Builder; | ||||
import lombok.Data; | import lombok.Data; | ||||
@@ -19,21 +20,29 @@ import org.springframework.format.annotation.DateTimeFormat; | |||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class DeclaredProjectListParamDTO extends PagePo { | public class DeclaredProjectListParamDTO extends PagePo { | ||||
@ApiModelProperty("用户ID") | |||||
private String userId; | private String userId; | ||||
@ApiModelProperty("项目名称") | |||||
private String projectName; | private String projectName; | ||||
@ApiModelProperty("项目类型 1建设 2运维") | |||||
private Integer projectType; | private Integer projectType; | ||||
@ApiModelProperty("项目阶段") | |||||
private Integer projectStage; | private Integer projectStage; | ||||
@ApiModelProperty("项目状态") | |||||
private Integer projectStatus; | private Integer projectStatus; | ||||
@ApiModelProperty("项目年份") | |||||
private Integer projectYear; | private Integer projectYear; | ||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
@ApiModelProperty("开始时间") | |||||
private String startTime; | private String startTime; | ||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
@ApiModelProperty("结束时间") | |||||
private String endTime; | private String endTime; | ||||
} | } |
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||
@@ -24,11 +25,14 @@ import java.util.Map; | |||||
public class DefaultDeclaredDTO implements Serializable { | public class DefaultDeclaredDTO implements Serializable { | ||||
@NotNull | @NotNull | ||||
@ApiModelProperty("项目信息") | |||||
private ProjectDTO projectInfo; | private ProjectDTO projectInfo; | ||||
@ApiModelProperty("表单信息 保留") | |||||
private Map<String,Object> formData; | private Map<String,Object> formData; | ||||
@NotNull | @NotNull | ||||
@ApiModelProperty("用户信息 暂时填一下") | |||||
private ProcessInstanceUserDto user; | private ProcessInstanceUserDto user; | ||||
public Map<String,Object> getFormData(){ | public Map<String,Object> getFormData(){ | ||||
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectdeclared.model.dto; | |||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.*; | import lombok.*; | ||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
@@ -26,9 +27,11 @@ public class ProjectDraftSaveDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@NotNull | @NotNull | ||||
@ApiModelProperty("项目信息") | |||||
private ProjectDTO projectInfo; | private ProjectDTO projectInfo; | ||||
@NotNull | @NotNull | ||||
@ApiModelProperty("用户信息") | |||||
private ProcessInstanceUserDto user; | private ProcessInstanceUserDto user; | ||||
} | } |
@@ -0,0 +1,47 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.utils; | |||||
import com.google.common.collect.Maps; | |||||
import com.ningdatech.pmapi.projectdeclared.manage.ConstructionPlanManage; | |||||
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; | |||||
import com.ningdatech.pmapi.projectdeclared.manage.PrequalificationDeclaredProjectManage; | |||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.stereotype.Component; | |||||
import javax.annotation.PostConstruct; | |||||
import java.util.Map; | |||||
import java.util.function.Function; | |||||
/** | |||||
* @Classname ReSubmitProcessMap | |||||
* @Description 项目调整 重新提交时的 事件函数MAP | |||||
* @Date 2023/2/15 11:19 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Component | |||||
@RequiredArgsConstructor | |||||
public class ReStartProcessMapUtil { | |||||
private final DeclaredProjectManage declaredProjectManage; | |||||
private final ConstructionPlanManage constructionPlanManage; | |||||
private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage; | |||||
public Map<Integer, Function<DefaultDeclaredDTO,String>> reStartProcessMap = Maps.newHashMap(); | |||||
/** | |||||
* 初始化业务分派逻辑,代替了if-else部分 | |||||
* key: 枚举 状态值 | |||||
* value: lambda表达式,最终会获取发起实例的函数 | |||||
*/ | |||||
@PostConstruct | |||||
public void reStartProcessInit(){ | |||||
reStartProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||||
dto->declaredProjectManage.reStartTheProcess(dto)); | |||||
reStartProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), | |||||
dto->constructionPlanManage.startTheProcess(dto)); | |||||
reStartProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||||
dto->prequalificationDeclaredProjectManage.startTheProcess(dto)); | |||||
reStartProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||||
dto->null); | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
package com.ningdatech.pmapi.projectlib.enumeration; | |||||
/** | |||||
* <p> | |||||
* ProjectRenewalApprovalStatusEnum | |||||
* </p> | |||||
* | |||||
* @author Poffy | |||||
* @since 16:54 2023/2/11 | |||||
*/ | |||||
public enum ProjectRenewalApprovalStatusEnum { | |||||
/** | |||||
* 续建项目 审核状态 | |||||
* 审核中 | |||||
* 通过 | |||||
* 不通过 | |||||
*/ | |||||
PENDING, | |||||
PASS, | |||||
NOT_PASS; | |||||
} |
@@ -36,12 +36,6 @@ public class ProjectApplicationDTO implements Serializable { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@ApiModelProperty("更新时间") | |||||
private LocalDateTime updateOn; | |||||
@ApiModelProperty("删除时间") | |||||
private LocalDateTime deleteOn; | |||||
@ApiModelProperty("关联IRS现有应用") | @ApiModelProperty("关联IRS现有应用") | ||||
private String relatedExistsApplication; | private String relatedExistsApplication; | ||||
@@ -162,8 +156,4 @@ public class ProjectApplicationDTO implements Serializable { | |||||
@ApiModelProperty("试点文件") | @ApiModelProperty("试点文件") | ||||
private String experimentsFile; | private String experimentsFile; | ||||
private Long createBy; | |||||
private Long updateBy; | |||||
} | } |
@@ -34,12 +34,6 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("所属地区名称") | @ApiModelProperty("所属地区名称") | ||||
private String area; | private String area; | ||||
@ApiModelProperty("项目阶段") | |||||
private Integer stage; | |||||
@ApiModelProperty("项目状态") | |||||
private Integer status; | |||||
@ApiModelProperty("项目名称") | @ApiModelProperty("项目名称") | ||||
private String projectName; | private String projectName; | ||||
@@ -231,13 +225,6 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") | @ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") | ||||
private Boolean isInnovateWholeProvinceShare; | private Boolean isInnovateWholeProvinceShare; | ||||
private LocalDateTime createOn; | |||||
private LocalDateTime updateOn; | |||||
@ApiModelProperty("流程实例编号") | |||||
private String instCode; | |||||
@ApiModelProperty("安全投入-模块信息") | @ApiModelProperty("安全投入-模块信息") | ||||
private String safetyInputModular; | private String safetyInputModular; | ||||
@@ -274,12 +261,6 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("前端所需验证字段") | @ApiModelProperty("前端所需验证字段") | ||||
private Integer allApplicationsDone; | private Integer allApplicationsDone; | ||||
@ApiModelProperty("流程实例id") | |||||
private String processInsId; | |||||
@ApiModelProperty("流程实例 formId") | |||||
private String formId; | |||||
@ApiModelProperty("项目应用实例") | @ApiModelProperty("项目应用实例") | ||||
private List<ProjectApplicationDTO> applicationList; | private List<ProjectApplicationDTO> applicationList; | ||||
@@ -289,8 +270,4 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("动态表单 json") | @ApiModelProperty("动态表单 json") | ||||
private Map<String,Object> dynamicForm; | private Map<String,Object> dynamicForm; | ||||
private Long createBy; | |||||
private Long updateBy; | |||||
} | } |
@@ -1,7 +1,7 @@ | |||||
package com.ningdatech.pmapi.organization; | package com.ningdatech.pmapi.organization; | ||||
import com.ningdatech.pmapi.AppTests; | import com.ningdatech.pmapi.AppTests; | ||||
//import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; | |||||
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; | |||||
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; | import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; | ||||
import com.ningdatech.zwdd.client.ZwddAuthClient; | import com.ningdatech.zwdd.client.ZwddAuthClient; | ||||
import com.ningdatech.zwdd.client.ZwddClient; | import com.ningdatech.zwdd.client.ZwddClient; | ||||
@@ -24,17 +24,17 @@ class OrganizationTest extends AppTests { | |||||
@Autowired | @Autowired | ||||
private OrganizationBatchGetTask organizationBatchGetTask; | private OrganizationBatchGetTask organizationBatchGetTask; | ||||
// @Autowired | |||||
// private EmployeeBatchGetTask employeeBatchGetTask; | |||||
@Autowired | |||||
private EmployeeBatchGetTask employeeBatchGetTask; | |||||
@Test | @Test | ||||
public void testBatchGetOrganization() { | public void testBatchGetOrganization() { | ||||
organizationBatchGetTask.batchGetOrganizationTask(); | organizationBatchGetTask.batchGetOrganizationTask(); | ||||
} | } | ||||
// @Test | |||||
// public void testEmployeeBatchGetTask(){ | |||||
// employeeBatchGetTask.batchGetEmployeeTask(); | |||||
// } | |||||
@Test | |||||
public void testEmployeeBatchGetTask(){ | |||||
employeeBatchGetTask.batchGetEmployeeTask(); | |||||
} | |||||
} | } |