@@ -26,8 +26,11 @@ public interface DeclaredProjectContant { | |||||
public static final Integer YEAR_THREE = 2; | public static final Integer YEAR_THREE = 2; | ||||
public static final Integer YEAR_FOUR = 4; | public static final Integer YEAR_FOUR = 4; | ||||
public static final Integer YEAR_DRAW_SURPLUS = 100; | |||||
public static final String FIXED_NUMBER = "0130"; | public static final String FIXED_NUMBER = "0130"; | ||||
public static final Long PROJECT_ID = 999L; | |||||
public static final Long MAX_PROJECT_ID = 999L; | |||||
public static final Long MIN_PROJECT_ID = 1L; | |||||
} | } | ||||
} | } |
@@ -129,13 +129,8 @@ public class ConstructionPlanManage { | |||||
params.setUser(declaredProjectManage.buildUser(employeeCode)); | params.setUser(declaredProjectManage.buildUser(employeeCode)); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(dto.getFormData()); | |||||
//把条件值给放入工作流 | |||||
defaultDeclaredProjectManage.buildCondition(params,dto); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息 | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,projectInfo); | Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode,projectInfo); | ||||
String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | String instanceId = processService.newStartProcess(model.getProcessDefId(),model.getFormId(), params,orgModelMap); | ||||
@@ -228,14 +228,10 @@ public class DeclaredProjectManage { | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(dto.getFormData()); | |||||
//把条件值给放入工作流 | |||||
defaultDeclaredProjectManage.buildCondition(params,dto); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(projectInfo,project); | BeanUtils.copyProperties(projectInfo,project); | ||||
@@ -1,10 +1,14 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.manage; | package com.ningdatech.pmapi.projectdeclared.manage; | ||||
import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.TypeReference; | |||||
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.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | ||||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | ||||
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; | |||||
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; | |||||
import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; | import com.ningdatech.pmapi.projectdeclared.model.po.DeclaredProjectStatisticsPO; | ||||
import com.ningdatech.pmapi.projectdeclared.service.IDeclaredStatisticsService; | import com.ningdatech.pmapi.projectdeclared.service.IDeclaredStatisticsService; | ||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
@@ -18,8 +22,10 @@ import com.wflow.enums.ProcessDefTypeEnum; | |||||
import com.wflow.service.OrgProcdefService; | import com.wflow.service.OrgProcdefService; | ||||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | import com.wflow.workflow.bean.dto.OrgInfoDTO; | ||||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | ||||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.util.*; | import java.util.*; | ||||
@@ -174,4 +180,33 @@ public class DefaultDeclaredProjectManage { | |||||
//查此人建设单位的项目 | //查此人建设单位的项目 | ||||
return statisticsService.getRegionStatistics(user.getRegionCode(),year); | return statisticsService.getRegionStatistics(user.getRegionCode(),year); | ||||
} | } | ||||
/** | |||||
* 把条件值放入工作流 用于判断条件 根据dto | |||||
* @param params | |||||
* @param dto | |||||
*/ | |||||
public void buildCondition(ProcessStartParamsVo params, DefaultDeclaredDTO dto) { | |||||
//放入条件判断的项目字段 | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(dto.getFormData()); | |||||
} | |||||
/** | |||||
* 把条件值放入工作流 用于判断条件 根据d项目实体 | |||||
* @param params | |||||
* @param projectInfo | |||||
*/ | |||||
public void buildCondition(ProcessStartParamsVo params, Project projectInfo) { | |||||
//放入条件判断的项目字段 | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | |||||
params.setFormData(JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
})); | |||||
} | |||||
} | } |
@@ -168,11 +168,9 @@ public class PrequalificationDeclaredProjectManage { | |||||
ProcessStartParamsVo params = new ProcessStartParamsVo(); | ProcessStartParamsVo params = new ProcessStartParamsVo(); | ||||
params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | params.setUser(defaultDeclaredProjectManage.buildUser(employeeCode)); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | |||||
params.setFormData(JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
})); | |||||
//把条件值给放入工作流 | |||||
defaultDeclaredProjectManage.buildCondition(params,projectInfo); | |||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
@@ -90,13 +90,8 @@ public class ReviewByDeptJointManage { | |||||
Map<String, Object> formData = Maps.newHashMap(); | Map<String, Object> formData = Maps.newHashMap(); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | |||||
formData.putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(formData); | |||||
//把条件值给放入工作流 | |||||
defaultDeclaredProjectManage.buildCondition(params,projectInfo); | |||||
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 | ||||
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(startUserCode,project); | Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(startUserCode,project); | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.utils; | package com.ningdatech.pmapi.projectdeclared.utils; | ||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.StrPool; | import com.ningdatech.basic.util.StrPool; | ||||
@@ -34,9 +35,7 @@ public class GenerateProjectCodeUtil { | |||||
// 获取所属行政区划代码(6位) | // 获取所属行政区划代码(6位) | ||||
String areaCode = projectInfo.getAreaCode(); | String areaCode = projectInfo.getAreaCode(); | ||||
// 获取建设年度后两位 | // 获取建设年度后两位 | ||||
Integer projectYear = projectInfo.getProjectYear(); | |||||
String year = String.valueOf(projectYear) | |||||
.substring(DeclaredProjectContant.Project.YEAR_THREE, DeclaredProjectContant.Project.YEAR_FOUR); | |||||
String year = String.valueOf(projectInfo.getProjectYear() % DeclaredProjectContant.Project.YEAR_DRAW_SURPLUS); | |||||
// 9-12位固定 | // 9-12位固定 | ||||
String fixedNumber = DeclaredProjectContant.Project.FIXED_NUMBER; | String fixedNumber = DeclaredProjectContant.Project.FIXED_NUMBER; | ||||
// 获取公司的财政编码 | // 获取公司的财政编码 | ||||
@@ -52,11 +51,11 @@ public class GenerateProjectCodeUtil { | |||||
String projectIdStr; | String projectIdStr; | ||||
// 获取项目库当前最大项目序号 | // 获取项目库当前最大项目序号 | ||||
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class).orderByDesc(Project::getId)); | List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class).orderByDesc(Project::getId)); | ||||
Project project = projectList.get(0); | |||||
Long projectId = project.getId(); | |||||
if (projectId > DeclaredProjectContant.Project.PROJECT_ID){ | |||||
Project project = CollUtil.isEmpty(projectList) ? null : projectList.get(0); | |||||
Long projectId = Objects.isNull(project) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : project.getId(); | |||||
if (projectId > DeclaredProjectContant.Project.MAX_PROJECT_ID){ | |||||
// 超过999的项目号从1开始 1 | // 超过999的项目号从1开始 1 | ||||
Long newProjectId = projectId - DeclaredProjectContant.Project.PROJECT_ID; | |||||
Long newProjectId = projectId % DeclaredProjectContant.Project.MAX_PROJECT_ID; | |||||
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, newProjectId); | projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, newProjectId); | ||||
}else { | }else { | ||||
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, projectId); | projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, projectId); | ||||