feat: 立项变更流程选择企标计划接口
This commit is contained in:
+18
-2
@@ -134,8 +134,24 @@ public class ProcessESInitChangeController {
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-选择企标编号带出数据")
|
||||
@ApiOperation(value="企标立项变更流程-选择企标编号带出数据", notes="企标立项变更流程-选择企标编号带出数据")
|
||||
@PostMapping(value = "/getESPInfo")
|
||||
public Result<?> getESPInfo(@RequestParam("id") String espId) {
|
||||
@GetMapping(value = "/getESPDetail")
|
||||
public Result<?> getESPDetail(@RequestParam("id") String espId) {
|
||||
return Result.OK(espService.getDetailById(espId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择企标编号带出数据
|
||||
*
|
||||
* @param projectType
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-选择企标编号带出数据")
|
||||
@ApiOperation(value="企标立项变更流程-选择企标编号带出数据", notes="企标立项变更流程-选择企标编号带出数据")
|
||||
@GetMapping(value = "/getESPList")
|
||||
public Result<?> getESPList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam("projectType") String projectType,
|
||||
@RequestParam(name="espApplicationCategory", required = false) String espApplicationCategory) {
|
||||
return Result.OK(espService.getESPList(pageNo, pageSize, projectType, espApplicationCategory));
|
||||
}
|
||||
}
|
||||
|
||||
+17
-7
@@ -35,32 +35,42 @@ public class ProcessEsInitChange implements Serializable {
|
||||
private String espId;
|
||||
|
||||
/**
|
||||
* 标准编号1
|
||||
* 标准计划Id1(合并流程字段)
|
||||
*/
|
||||
private String standardIdOne;
|
||||
|
||||
/**
|
||||
* 标准编号1(合并流程字段)
|
||||
*/
|
||||
private String standardNoOne;
|
||||
|
||||
/**
|
||||
* 标准名称1
|
||||
* 标准名称1(合并流程字段)
|
||||
*/
|
||||
private String standardNameOne;
|
||||
|
||||
/**
|
||||
* 制修订类型1
|
||||
* 制修订类型1(合并流程字段)
|
||||
*/
|
||||
private String projectTypeOne;
|
||||
|
||||
/**
|
||||
* 标准编号2
|
||||
* 标准计划Id2(合并流程字段)
|
||||
*/
|
||||
private String standardIdTwo;
|
||||
|
||||
/**
|
||||
* 标准编号2(合并流程字段)
|
||||
*/
|
||||
private String standardNoTwo;
|
||||
|
||||
/**
|
||||
* 标准名称2
|
||||
* 标准名称2(合并流程字段)
|
||||
*/
|
||||
private String standardNameTwo;
|
||||
|
||||
/**
|
||||
* 制修订类型2
|
||||
* 制修订类型2(合并流程字段)
|
||||
*/
|
||||
private String projectTypeTwo;
|
||||
|
||||
@@ -260,7 +270,7 @@ public class ProcessEsInitChange implements Serializable {
|
||||
private String mainDraftingUnitResponsiblePerson;
|
||||
|
||||
/**
|
||||
* 新主起草单位责任人
|
||||
* 新主起草单位负责人
|
||||
*/
|
||||
private String newMainDraftingUnitResponsiblePerson;
|
||||
|
||||
|
||||
+4
-5
@@ -4,11 +4,10 @@ package com.jero.modules.activiti.process.esInitChange.entity.enums;
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/9 16:28
|
||||
*/
|
||||
public enum ESApplicationCategoryEnum {
|
||||
public enum ESPApplicationCategoryEnum {
|
||||
INITIATION("立项", "3"),
|
||||
|
||||
INITIATION("立项", "1"),
|
||||
|
||||
CHANGE("变更", "2")
|
||||
CHANGE("变更", "4")
|
||||
;
|
||||
|
||||
private final String name;
|
||||
@@ -23,7 +22,7 @@ public enum ESApplicationCategoryEnum {
|
||||
return value;
|
||||
}
|
||||
|
||||
ESApplicationCategoryEnum(String name, String value) {
|
||||
ESPApplicationCategoryEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.entity.enums;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/13 10:57
|
||||
*/
|
||||
public enum ESPChangeType {
|
||||
|
||||
ADD("新增", "add", "新增计划入库时"),
|
||||
|
||||
CHANGE("变更", "change", "变更类型为完成时间变更、责任部门变更、"),
|
||||
|
||||
CANCEL("取消", "cancel", "项目类型为工作终止为取消"),
|
||||
;
|
||||
|
||||
|
||||
private final String name;
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
ESPChangeType(String name, String value, String description) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.entity.enums;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/13 14:17
|
||||
*/
|
||||
public enum ESPProjectStatus {
|
||||
|
||||
NOT_STARTED("未开始", "1"),
|
||||
IN_PROGRESS("进行中", "2"),
|
||||
OVERDUE_COMPLETED("逾期完成", "3"),
|
||||
OVERDUE("逾期", "4"),
|
||||
COMPLETED("完成", "5");
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String value;
|
||||
|
||||
ESPProjectStatus(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@ package com.jero.modules.activiti.process.esInitChange.entity.enums;
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/9 16:28
|
||||
*/
|
||||
public enum ESProjectType {
|
||||
public enum ESPProjectType {
|
||||
|
||||
/** 立项 **/
|
||||
ENACT("制定", "1"),
|
||||
@@ -29,7 +29,7 @@ public enum ESProjectType {
|
||||
return value;
|
||||
}
|
||||
|
||||
ESProjectType(String name, String value) {
|
||||
ESPProjectType(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
+61
-7
@@ -1,8 +1,10 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.aspect.annotation.RedisLock;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPApplicationCategoryEnum;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPChangeType;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
@@ -33,19 +35,71 @@ public class ProcessESInitChangeEndListener implements ExecutionListener {
|
||||
*/
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
log.info("企标立项变更流程结束 监听执行器开始执行");
|
||||
// 获取流程实例ID
|
||||
String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// 根据流程实例Id找到所有流程业务数据
|
||||
LambdaQueryWrapper<ProcessEsInitChange> esInitChangeWrapper = new LambdaQueryWrapper<>();
|
||||
esInitChangeWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
List<ProcessEsInitChange> processEsInitChanges = esInitChangeService.list(esInitChangeWrapper);
|
||||
List<EnterpriseStandardPlan> enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// TODO 立项新增-Id置空
|
||||
// TODO 变更编辑-Id换为espId
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// // 软删除流程数据
|
||||
// esInitChangeService.removeByProcessInstanceId(processInstanceId);
|
||||
String applicationCategory = processEsInitChanges.get(0).getApplicationCategory();
|
||||
String projectType = processEsInitChanges.get(0).getProjectType();
|
||||
List<EnterpriseStandardPlan> enterpriseStandardPlans;
|
||||
if (ESPApplicationCategoryEnum.INITIATION.getValue().equals(applicationCategory)) {
|
||||
// 立项新增-Id置空
|
||||
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
processEsInitChange.setId(null);
|
||||
}
|
||||
} else {
|
||||
// 将Id设为企标计划的Id
|
||||
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
processEsInitChange.setId(processEsInitChange.getEspId());
|
||||
}
|
||||
|
||||
// 完成时间变更
|
||||
if (ESPProjectType.COMPLETE_TIME_CHANGE.getValue().equals(projectType)) {
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
}
|
||||
|
||||
// 工作中止
|
||||
if (ESPProjectType.WORK_TERMINATE.getValue().equals(projectType)) {
|
||||
// 将企标计划变更状态设为取消
|
||||
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
processEsInitChange.setProjectStatus(ESPChangeType.CANCEL.getValue());
|
||||
}
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
}
|
||||
|
||||
// 责任部门变更
|
||||
if (ESPProjectType.RESPONSIBLE_DEPT_CHANGE.getValue().equals(projectType)) {
|
||||
// 将企标计划变更状态设为变更
|
||||
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
processEsInitChange.setProjectStatus(ESPChangeType.CHANGE.getValue());
|
||||
}
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
}
|
||||
|
||||
// 合并
|
||||
if (ESPProjectType.MERGE.getValue().equals(projectType)) {
|
||||
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
processEsInitChange.setId(null);
|
||||
}
|
||||
// 删除两个老企标计划
|
||||
espService.deleteById(processEsInitChanges.get(0).getStandardIdOne());
|
||||
espService.deleteById(processEsInitChanges.get(0).getStandardIdTwo());
|
||||
// 生成新企标计划
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
}
|
||||
}
|
||||
log.info("数据存入企标计划数据库");
|
||||
// 软删除流程数据
|
||||
esInitChangeService.removeByProcessInstanceId(processInstanceId);
|
||||
log.info("软删除流程数据");
|
||||
//TODO 发起制修订流程
|
||||
log.info("自动发起企标制修订流程");
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -65,6 +65,9 @@ public class ESPlanQueryDTO {
|
||||
private String standardType;
|
||||
|
||||
@ApiModelProperty(value = "制修订类型")
|
||||
private String revisionType;
|
||||
|
||||
@ApiModelProperty(value = "申请类别")
|
||||
private String applicationCategory;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@@ -87,6 +90,9 @@ public class ESPlanQueryDTO {
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createEndDate;
|
||||
|
||||
@ApiModelProperty(value = "项目状态列表,流程中用")
|
||||
private List<String> projectStatusList;
|
||||
|
||||
public void transIdsToList() {
|
||||
if (StrUtil.isBlank(this.selections)) {
|
||||
return;
|
||||
|
||||
+10
@@ -172,6 +172,10 @@
|
||||
AND p.standard_type = #{param.standardType}
|
||||
</if>
|
||||
<!--制修订类型-->
|
||||
<if test="param.applicationCategory != null and param.applicationCategory != null">
|
||||
AND p.application_category = #{param.revisionType}
|
||||
</if>
|
||||
<!--申请类型-->
|
||||
<if test="param.applicationCategory != null and param.applicationCategory != null">
|
||||
AND p.application_category = #{param.applicationCategory}
|
||||
</if>
|
||||
@@ -189,6 +193,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.projectStatusList != null and param.projectStatusList.size() > 0">
|
||||
AND p.project_status IN
|
||||
<foreach item="item" index="index" collection="param.projectStatusList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetailById" resultType="com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan">
|
||||
|
||||
+11
@@ -45,4 +45,15 @@ public interface EnterpriseStandardPlanService extends IService<EnterpriseStanda
|
||||
* @param sheetName
|
||||
*/
|
||||
void export(HttpServletResponse response, ESPlanQueryDTO esPlanQueryDTO, String fileName, String sheetName);
|
||||
|
||||
/**
|
||||
* 立项变更流程中-选择企标计划的列表接口
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param projectType
|
||||
* @param espApplicationCategory
|
||||
* @return
|
||||
*/
|
||||
IPage<EnterpriseStandardPlanVo> getESPList(Integer pageNo, Integer pageSize, String projectType, String espApplicationCategory);
|
||||
}
|
||||
|
||||
+31
-8
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectStatus;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.laws.enterprise.entity.dto.ESPlanQueryDTO;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardPlanVo;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
@@ -15,15 +17,8 @@ import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
import com.jero.modules.laws.enterprise.mapper.EnterpriseStandardPlanMapper;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.projectLibrary.entity.LawsProjectLibrary;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -31,7 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -78,6 +73,34 @@ public class EnterpriseStandardPlanServiceImpl extends ServiceImpl<EnterpriseSta
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<EnterpriseStandardPlanVo> getESPList(Integer pageNo, Integer pageSize, String projectType, String espApplicationCategory) {
|
||||
// 构建查询参数
|
||||
ESPlanQueryDTO esPlanQueryDTO = new ESPlanQueryDTO();
|
||||
|
||||
if (!ESPProjectType.MERGE.getValue().equals(projectType)) {
|
||||
// 完成时间变更 未开始/进行中
|
||||
// 工作中止 未开始/进行中
|
||||
// 责任部门变更 未开始/进行中
|
||||
List<String> projectStatusList = new ArrayList<>();
|
||||
projectStatusList.add(ESPProjectStatus.NOT_STARTED.getValue());
|
||||
projectStatusList.add(ESPProjectStatus.IN_PROGRESS.getValue());
|
||||
esPlanQueryDTO.setProjectStatusList(projectStatusList);
|
||||
} else {
|
||||
// 合并 未开始 修订+修订 制定+制定
|
||||
esPlanQueryDTO.setProjectStatus(ESPProjectStatus.NOT_STARTED.getValue());
|
||||
if (ESPProjectType.ENACT.getValue().equals(espApplicationCategory)) {
|
||||
esPlanQueryDTO.setRevisionType(ESPProjectType.ENACT.getValue());
|
||||
} else {
|
||||
esPlanQueryDTO.setRevisionType(ESPProjectType.MODIFY.getValue());
|
||||
}
|
||||
}
|
||||
IPage<EnterpriseStandardPlanVo> page = new Page<>(pageNo, pageSize);
|
||||
esPlanMapper.page(page, esPlanQueryDTO);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, ESPlanQueryDTO esPlanQueryDTO, String fileName, String sheetName) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user