feat(企标稽查整改): 基础模块
This commit is contained in:
+2
-1
@@ -22,7 +22,8 @@ public enum ProcessType {
|
||||
ES_ENABLE("已封存企标启用流程", "9", "es-enable", "ProcessEsEnableServiceImpl"),
|
||||
ES_INSPECT_PLAN("企标稽查计划", "16", "inspect_plan", "ProcessEsInspectPlanServiceImpl"),
|
||||
ES_INSPECT("企标稽查流程", "17", "inspect_process", "ProcessEsInspectServiceImpl"),
|
||||
ES_INSPECT_DELAY_APPLY("稽查延期申请流程", "18", "inspect_delay_apply_process", "ProcessEsInspectDelayApplyServiceImpl")
|
||||
ES_INSPECT_DELAY_APPLY("稽查延期申请流程", "18", "inspect_delay_apply_process", "ProcessEsInspectDelayApplyServiceImpl"),
|
||||
ES_INSPECT_REPORT("企标稽查整改", "19", "inspect_report", "ProcessEsInspectReportServiceImpl")
|
||||
;
|
||||
|
||||
private final String name;
|
||||
|
||||
+1
-2
@@ -31,12 +31,11 @@
|
||||
standardization_docking_user,
|
||||
inspect_status,
|
||||
group_concat(lesio.plan_inspect_object separator ',') plan_inspect_object,
|
||||
COUNT(lenstic.id) standard_inspect_content_count
|
||||
(select count(id) count from laws_enterprise_standard_inspect_content where process_es_inspect_id = pesi.id) standard_inspect_content_count
|
||||
from process_es_inspect pesi
|
||||
left join laws_enterprise_standard_inspect lesi on pesi.inspect_id = lesi.id
|
||||
left join laws_enterprise_standard les on lesi.inspect_no = les.standard_number and les.del_flag = '0'
|
||||
left join laws_enterprise_standard_inspect_object lesio on lesi.id = lesio.inspect_id
|
||||
left join laws_enterprise_standard_inspect_content lenstic ON pesi.id = lenstic.process_es_inspect_id
|
||||
group by pesi.id) t
|
||||
${ew.customSqlSegment}
|
||||
</sql>
|
||||
|
||||
+87
-23
@@ -17,6 +17,11 @@ import com.jero.modules.activiti.process.esinspect.service.IEsInspectFlowService
|
||||
import com.jero.modules.activiti.process.esinspect.service.IProcessEsInspectService;
|
||||
import com.jero.modules.activiti.process.esinspect.vo.EsInspectFlowVO;
|
||||
import com.jero.modules.activiti.process.esinspect.vo.ProcessEsInspectVO;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.common.EsInspectRectifyCommon;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IEsInspectRectifyFlowService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IProcessEsInspectRectifyService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.EsInspectRectifyFlowVO;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||
@@ -43,10 +48,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -70,6 +72,8 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
|
||||
private final EnterpriseStandardInspectContentService enterpriseStandardInspectContentService;
|
||||
private final EnterpriseStandardInspectRectifyPlanService enterpriseStandardInspectRectifyPlanService;
|
||||
private final EnterpriseStandardInspectReportService enterpriseStandardInspectReportService;
|
||||
private final IEsInspectRectifyFlowService esInspectReportFlowService;
|
||||
private final IProcessEsInspectRectifyService processEsInspectReportService;
|
||||
public EsInspectFlowServiceImpl(ProcessAllService processAllService,
|
||||
ProcessApprovalRecordService processApprovalRecordService,
|
||||
ProcessDraftService processDraftService,
|
||||
@@ -79,7 +83,9 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
|
||||
EnterpriseStandardInspectService enterpriseStandardInspectService,
|
||||
EnterpriseStandardInspectContentService enterpriseStandardInspectContentService,
|
||||
EnterpriseStandardInspectRectifyPlanService enterpriseStandardInspectRectifyPlanService,
|
||||
EnterpriseStandardInspectReportService enterpriseStandardInspectReportService) {
|
||||
EnterpriseStandardInspectReportService enterpriseStandardInspectReportService,
|
||||
IEsInspectRectifyFlowService esInspectReportFlowService,
|
||||
IProcessEsInspectRectifyService processEsInspectReportService) {
|
||||
this.processAllService = processAllService;
|
||||
this.processApprovalRecordService = processApprovalRecordService;
|
||||
this.processDraftService = processDraftService;
|
||||
@@ -90,6 +96,8 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
|
||||
this.enterpriseStandardInspectContentService = enterpriseStandardInspectContentService;
|
||||
this.enterpriseStandardInspectRectifyPlanService = enterpriseStandardInspectRectifyPlanService;
|
||||
this.enterpriseStandardInspectReportService = enterpriseStandardInspectReportService;
|
||||
this.esInspectReportFlowService = esInspectReportFlowService;
|
||||
this.processEsInspectReportService = processEsInspectReportService;
|
||||
}
|
||||
|
||||
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
||||
@@ -291,6 +299,13 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
|
||||
for (ProcessEsInspectVO esInspectVO : processEsInspectVOList) {
|
||||
// 企标稽查id
|
||||
String inspectId = esInspectVO.getInspectId();
|
||||
// 更新企标稽数据
|
||||
enterpriseStandardInspectService.update(new LambdaUpdateWrapper<EnterpriseStandardInspect>()
|
||||
.eq(EnterpriseStandardInspect::getId, inspectId)
|
||||
.set(EnterpriseStandardInspect::getActualInspectUser, esInspectVO.getActualInspectUser())
|
||||
.set(EnterpriseStandardInspect::getCompleteDate, esInspectVO.getCompleteDate())
|
||||
.set(EnterpriseStandardInspect::getInspectStatus, EsInspectCommon.INSPECT_STATUS_3));
|
||||
|
||||
// 查询企标信息
|
||||
LawsEnterpriseStandard lawsEnterpriseStandard = lawsEnterpriseStandardService.getOne(
|
||||
new LambdaQueryWrapper<LawsEnterpriseStandard>().eq(LawsEnterpriseStandard::getStandardNumber, esInspectVO.getInspectNo()), false);
|
||||
@@ -309,30 +324,79 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
|
||||
.eq(EnterpriseStandardInspectRectifyPlan::getProcessEsInspectId, esInspectVO.getId()));
|
||||
|
||||
if (!Objects.isNull(lawsEnterpriseStandard)){
|
||||
// 保存稽查内容
|
||||
enterpriseStandardInspectContentList.forEach(enterpriseStandardInspectContent -> {
|
||||
enterpriseStandardInspectContent.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||
enterpriseStandardInspectContent.setStandardId(lawsEnterpriseStandard.getId());
|
||||
});
|
||||
enterpriseStandardInspectContentService.saveBatch(enterpriseStandardInspectContentList);
|
||||
// 企标内容
|
||||
List<String> idList = enterpriseStandardInspectContentList.stream()
|
||||
.map(EnterpriseStandardInspectContent::getId)
|
||||
.collect(Collectors.toList());
|
||||
if (!idList.isEmpty()){
|
||||
enterpriseStandardInspectContentService.update(
|
||||
new LambdaUpdateWrapper<EnterpriseStandardInspectContent>()
|
||||
.in(EnterpriseStandardInspectContent::getId, idList)
|
||||
.set(EnterpriseStandardInspectContent::getStandardId, lawsEnterpriseStandard.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
// 保存稽查报告
|
||||
enterpriseStandardInspectReportList.forEach(enterpriseStandardInspectReport -> {
|
||||
enterpriseStandardInspectReport.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||
enterpriseStandardInspectReport.setInspectId(inspectId);
|
||||
});
|
||||
enterpriseStandardInspectReportService.saveBatch(enterpriseStandardInspectReportList);
|
||||
if (!enterpriseStandardInspectReportList.isEmpty()){
|
||||
// 稽查报告
|
||||
List<String> idList = enterpriseStandardInspectReportList.stream().map(EnterpriseStandardInspectReport::getId).collect(Collectors.toList());
|
||||
if (!idList.isEmpty()){
|
||||
enterpriseStandardInspectReportService.update(
|
||||
new LambdaUpdateWrapper<EnterpriseStandardInspectReport>()
|
||||
.in(EnterpriseStandardInspectReport::getId, idList)
|
||||
.set(EnterpriseStandardInspectReport::getInspectId, inspectId));
|
||||
}
|
||||
}
|
||||
|
||||
// 保存整改计划
|
||||
enterpriseStandardInspectRectifyPlanList.forEach(enterpriseStandardInspectRectifyPlan -> {
|
||||
enterpriseStandardInspectRectifyPlan.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||
enterpriseStandardInspectRectifyPlan.setInspectId(inspectId);
|
||||
});
|
||||
enterpriseStandardInspectRectifyPlanService.saveBatch(enterpriseStandardInspectRectifyPlanList);
|
||||
if (!enterpriseStandardInspectRectifyPlanList.isEmpty()){
|
||||
enterpriseStandardInspectRectifyPlanList.forEach(enterpriseStandardInspectRectifyPlan ->
|
||||
// 自动生成企标稽查整改
|
||||
autoEsInspectReportFlow(esInspectVO, enterpriseStandardInspectRectifyPlan)
|
||||
);
|
||||
|
||||
// 企标整改计划
|
||||
List<String> idList = enterpriseStandardInspectRectifyPlanList.stream().map(EnterpriseStandardInspectRectifyPlan::getId).collect(Collectors.toList());
|
||||
enterpriseStandardInspectRectifyPlanService.update(
|
||||
new LambdaUpdateWrapper<EnterpriseStandardInspectRectifyPlan>()
|
||||
.in(EnterpriseStandardInspectRectifyPlan::getId, idList)
|
||||
.set(EnterpriseStandardInspectRectifyPlan::getInspectId, inspectId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void autoEsInspectReportFlow(ProcessEsInspectVO esInspectVO, EnterpriseStandardInspectRectifyPlan enterpriseStandardInspectRectifyPlan) {
|
||||
if (!EsInspectRectifyCommon.INSPECT_RECTIFY_STATUS_1.equals(enterpriseStandardInspectRectifyPlan.getRectifyStatus())){
|
||||
return;
|
||||
}
|
||||
// 自动生成企标稽查整改
|
||||
EsInspectRectifyFlowVO esInspectReportFlowVO = new EsInspectRectifyFlowVO();
|
||||
// 处理流程信息
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||
// 生成流程名称
|
||||
String prcName = esInspectVO.getInspectNo() + "-" + esInspectVO.getInspectName() + "-稽查整改";
|
||||
processAll.setPrcName(prcName);
|
||||
esInspectReportFlowVO.setProcessAll(processAll);
|
||||
|
||||
// 处理流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
|
||||
processApprovalRecord.setProjectId(processAll.getProjectId());
|
||||
processApprovalRecord.setUserId(enterpriseStandardInspectRectifyPlan.getResponseUser());
|
||||
esInspectReportFlowVO.setProcessApprovalRecord(processApprovalRecord);
|
||||
|
||||
// 处理业务表数据
|
||||
ProcessEsInspectRectify processEsInspectReport = new ProcessEsInspectRectify();
|
||||
processEsInspectReport.setProjectId(processAll.getProjectId());
|
||||
processEsInspectReport.setInspectRectifyPlanId(enterpriseStandardInspectRectifyPlan.getId());
|
||||
esInspectReportFlowVO.setProcessEsInspectReport(processEsInspectReport);
|
||||
processEsInspectReportService.save(processEsInspectReport);
|
||||
|
||||
// 处理人员信息
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("responsible", enterpriseStandardInspectRectifyPlan.getResponseUser());
|
||||
esInspectReportFlowVO.setMap(map);
|
||||
esInspectReportFlowService.createReportFlow(esInspectReportFlowVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flowTransfer(String taskId, String userId) {
|
||||
// 更新流程审批信息
|
||||
|
||||
+1
@@ -181,6 +181,7 @@ public class ProcessEsInspectServiceImpl extends ServiceImpl<ProcessEsInspectMap
|
||||
@NotNull
|
||||
private static QueryWrapper<ProcessEsInspectVO> getProcessEsInspectVOQueryWrapper(ProcessEsInspectVO processEsInspectVO) {
|
||||
QueryWrapper<ProcessEsInspectVO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotBlank(processEsInspectVO.getId()), "t.id", processEsInspectVO.getId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(processEsInspectVO.getProjectId()), "t.project_id", processEsInspectVO.getProjectId());
|
||||
queryWrapper.eq("t.del_flag", 0);
|
||||
queryWrapper.orderByDesc("t.create_time");
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class EsInspectDelayApplyFlowServiceImpl implements IEsInspectDelayApplyF
|
||||
|
||||
// 更新流程总表信息
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT.getValue()));
|
||||
processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT_DELAY_APPLY.getValue()));
|
||||
processAll.setCreateUserId(loginUser.getId());
|
||||
processAllService.update(processAll,
|
||||
new LambdaUpdateWrapper<ProcessAll>()
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.common;
|
||||
|
||||
/**
|
||||
* @ClassName: EsInspectReportCommon
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:12
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public class EsInspectRectifyCommon {
|
||||
private EsInspectRectifyCommon(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标稽查整改key
|
||||
*/
|
||||
public static final String KEY = "inspect_rectify";
|
||||
|
||||
/**
|
||||
* 企标稽查整改流name
|
||||
*/
|
||||
public static final String NAME = "企标稽查整改";
|
||||
|
||||
/**
|
||||
* 企标稽查整改节点: 1:整改负责人上传整改结果,2:负责人主管级领导审批,3:稽查负责人审核
|
||||
*/
|
||||
public static final String PROCESS_NODE_1 = "responsible_start";
|
||||
/**
|
||||
* 企标稽查整改节点: 1:整改负责人上传整改结果,2:负责人主管级领导审批,3:稽查负责人审核
|
||||
*/
|
||||
public static final String PROCESS_NODE_2 = "leader_approval";
|
||||
/**
|
||||
* 企标稽查整改节点: 1:整改负责人上传整改结果,2:负责人主管级领导审批,3:稽查负责人审核
|
||||
*/
|
||||
public static final String PROCESS_NODE_3 = "responsible_approval";
|
||||
|
||||
/**
|
||||
* 整改状态 1:整改中 2:审核中 3:整改已完成 4:无需整改
|
||||
*/
|
||||
public static final String INSPECT_RECTIFY_STATUS_1 = "1";
|
||||
/**
|
||||
* 整改状态 1:整改中 2:审核中 3:整改已完成 4:无需整改
|
||||
*/
|
||||
public static final String INSPECT_RECTIFY_STATUS_2 = "2";
|
||||
/**
|
||||
* 整改状态 1:整改中 2:审核中 3:整改已完成 4:无需整改
|
||||
*/
|
||||
public static final String INSPECT_RECTIFY_STATUS_3 = "3";
|
||||
/**
|
||||
* 整改状态 1:整改中 2:审核中 3:整改已完成 4:无需整改
|
||||
*/
|
||||
public static final String INSPECT_RECTIFY_STATUS_4 = "4";
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.util.SnowflakeUtils;
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IEsInspectRectifyFlowService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.EsInspectRectifyFlowVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: 企标稽查整改
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:15
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Api(tags="企标稽查整改")
|
||||
@RestController
|
||||
@RequestMapping("/process/esInspectReportFlow")
|
||||
@Slf4j
|
||||
public class EsInspectRectifyFlowController {
|
||||
|
||||
private final IEsInspectRectifyFlowService esInspectReportFlowService;
|
||||
|
||||
public EsInspectRectifyFlowController(IEsInspectRectifyFlowService esInspectReportFlowService) {
|
||||
this.esInspectReportFlowService = esInspectReportFlowService;
|
||||
}
|
||||
|
||||
@GetMapping("/demo")
|
||||
public void demo(){
|
||||
// 自动生成企标稽查整改
|
||||
EsInspectRectifyFlowVO esInspectReportFlowVO = new EsInspectRectifyFlowVO();
|
||||
// 处理流程信息
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake()));
|
||||
// 生成流程名称
|
||||
String prcName = "测试生成-稽查整改";
|
||||
processAll.setPrcName(prcName);
|
||||
esInspectReportFlowVO.setProcessAll(processAll);
|
||||
|
||||
// 处理流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
|
||||
processApprovalRecord.setProjectId(processAll.getProjectId());
|
||||
esInspectReportFlowVO.setProcessApprovalRecord(processApprovalRecord);
|
||||
|
||||
// 处理人员信息
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("responsible", "1727493356924907522");
|
||||
map.put("leader", "1727493530325823489");
|
||||
map.put("responsibleApproval", "1727493623724584961");
|
||||
esInspectReportFlowVO.setMap(map);
|
||||
esInspectReportFlowService.createReportFlow(esInspectReportFlowVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标稽查整改-流程保存
|
||||
* @param esInspectReportFlowVO 企标稽查整改VO对象
|
||||
* @return 结果对象
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改-流程保存")
|
||||
@ApiOperation(value="企标稽查整改-流程保存", notes="企标稽查整改-流程保存")
|
||||
@PostMapping(value = "/flowSave")
|
||||
public Result<T> flowSave(@RequestBody EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
esInspectReportFlowService.flowSave(esInspectReportFlowVO);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 企标稽查整改-办理详情
|
||||
* @param projectId 项目id
|
||||
* @return 结果对象
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改-办理详情")
|
||||
@ApiOperation(value="企标稽查整改-办理详情", notes="企标稽查整改-办理详情")
|
||||
@GetMapping(value = "/queryDetailByProjectId")
|
||||
@Translation
|
||||
public Result<EsInspectRectifyFlowVO> queryDetailByProjectId(@ApiParam("项目id") String projectId, @ApiParam("任务id") String taskId) {
|
||||
return Result.OK(esInspectReportFlowService.queryDetailByProjectId(projectId, taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标稽查整改-流程审批
|
||||
* @param esInspectReportFlowVO 企标稽查整改VO对象
|
||||
* @return 结果对象
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改-流程审批")
|
||||
@ApiOperation(value="企标稽查整改-流程审批", notes="企标稽查整改-流程审批")
|
||||
@PostMapping(value = "/flowApproval")
|
||||
public Result<T> flowApproval(@RequestBody EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
esInspectReportFlowService.flowApproval(esInspectReportFlowVO);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标稽查整改-驳回
|
||||
* @param esInspectReportFlowVO 企标稽查计划流程VO对象
|
||||
* @return 结果对象
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改-驳回")
|
||||
@ApiOperation(value="企标稽查整改-驳回", notes="企标稽查整改-驳回")
|
||||
@PostMapping(value = "/flowReject")
|
||||
public Result<T> flowReject(@RequestBody EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
log.info("");
|
||||
esInspectReportFlowService.flowApproval(esInspectReportFlowVO);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企标稽查整改-流程转办
|
||||
* @return 结果对象
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改-流程转办")
|
||||
@ApiOperation(value="企标稽查整改-流程转办", notes="企标稽查整改-流程转办")
|
||||
@GetMapping(value = "/flowTransfer")
|
||||
public Result<T> flowTransfer(@ApiParam("任务id") String taskId, @ApiParam("用户id") String userId) {
|
||||
esInspectReportFlowService.flowTransfer(taskId, userId);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IProcessEsInspectRectifyService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.ProcessEsInspectRectifyVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查整改业务表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="企标稽查整改业务表")
|
||||
@RestController
|
||||
@RequestMapping("/esinspectreport/processEsInspectReport")
|
||||
@Slf4j
|
||||
public class ProcessEsInspectRectifyController extends JeroController<ProcessEsInspectRectify, IProcessEsInspectRectifyService> {
|
||||
@Autowired
|
||||
private IProcessEsInspectRectifyService processEsInspectReportService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-分页列表查询")
|
||||
@ApiOperation(value="企标稽查整改业务表-分页列表查询", notes="企标稽查整改业务表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<ProcessEsInspectRectify>> queryPageList(ProcessEsInspectRectify processEsInspectReport,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<ProcessEsInspectRectify> pageList = processEsInspectReportService.queryPage(processEsInspectReport, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-列表查询")
|
||||
@ApiOperation(value="企标稽查整改业务表-列表查询", notes="企标稽查整改业务表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProcessEsInspectRectify>> queryList(ProcessEsInspectRectify processEsInspectReport, HttpServletRequest req) {
|
||||
List<ProcessEsInspectRectify> list = processEsInspectReportService.queryList(processEsInspectReport, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-添加")
|
||||
@ApiOperation(value="企标稽查整改业务表-添加", notes="企标稽查整改业务表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody ProcessEsInspectRectify processEsInspectReport) {
|
||||
processEsInspectReportService.add(processEsInspectReport);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-编辑")
|
||||
@ApiOperation(value="企标稽查整改业务表-编辑", notes="企标稽查整改业务表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody ProcessEsInspectRectify processEsInspectReport) {
|
||||
processEsInspectReportService.editById(processEsInspectReport);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-通过id删除")
|
||||
@ApiOperation(value="企标稽查整改业务表-通过id删除", notes="企标稽查整改业务表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
processEsInspectReportService.deleteById(map.get("id"));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-批量删除")
|
||||
@ApiOperation(value="企标稽查整改业务表-批量删除", notes="企标稽查整改业务表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
this.processEsInspectReportService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-通过id查询")
|
||||
@ApiOperation(value="企标稽查整改业务表-通过id查询", notes="企标稽查整改业务表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<ProcessEsInspectRectifyVO> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProcessEsInspectRectifyVO esInspectReportVO = processEsInspectReportService.queryById(id);
|
||||
if(esInspectReportVO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(esInspectReportVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过项目id查询
|
||||
*
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查整改业务表-通过项目id查询")
|
||||
@ApiOperation(value="企标稽查整改业务表-通过项目id查询", notes="企标稽查整改业务表-通过项目id查询")
|
||||
@GetMapping(value = "/queryByProjectId")
|
||||
public Result<ProcessEsInspectRectifyVO> queryByProjectId(String projectId) {
|
||||
ProcessEsInspectRectifyVO esInspectReportVO = processEsInspectReportService.queryByProjectId(projectId);
|
||||
if(esInspectReportVO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(esInspectReportVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param processEsInspectReport
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProcessEsInspectRectify processEsInspectReport) {
|
||||
return super.exportXls(request, processEsInspectReport, ProcessEsInspectRectify.class, "企标稽查整改业务表");
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.modules.laws.documenttool.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查整改业务表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("process_es_inspect_rectify")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="process_es_inspect_rectify对象", description="企标稽查整改业务表")
|
||||
public class ProcessEsInspectRectify extends BaseEntity {
|
||||
/**项目id*/
|
||||
@Excel(name = "项目id", width = 15)
|
||||
@ApiModelProperty(value = "项目id")
|
||||
private String projectId;
|
||||
/**企标稽查整改计划id*/
|
||||
@Excel(name = "企标稽查整改计划id", width = 15)
|
||||
@ApiModelProperty(value = "企标稽查整改计划id")
|
||||
private String inspectRectifyPlanId;
|
||||
/**操作类型(1:提交整改结果 2:申请延期)*/
|
||||
@Excel(name = "操作类型(1:提交整改结果 2:申请延期)", width = 15)
|
||||
@ApiModelProperty(value = "操作类型(1:提交整改结果 2:申请延期)")
|
||||
@Dict(dicCode = "report_operation_type")
|
||||
private String operationType;
|
||||
/**整改结果*/
|
||||
@Excel(name = "整改结果", width = 15)
|
||||
@ApiModelProperty(value = "整改结果")
|
||||
private String rectifyResult;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private String attachment;
|
||||
/**申请延期日期*/
|
||||
@Excel(name = "申请延期日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "申请延期日期")
|
||||
private Date applyDelayDate;
|
||||
/**延期说明*/
|
||||
@Excel(name = "延期说明", width = 15)
|
||||
@ApiModelProperty(value = "延期说明")
|
||||
private String delayDetail;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查整改业务表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ProcessEsInspectRectifyMapper extends BaseMapper<ProcessEsInspectRectify> {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.activiti.process.esinspectrectify.mapper.ProcessEsInspectRectifyMapper">
|
||||
|
||||
</mapper>
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.service;
|
||||
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.EsInspectRectifyFlowVO;
|
||||
|
||||
/**
|
||||
* @ClassName: IEsInspectReportFlowService
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:50
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public interface IEsInspectRectifyFlowService {
|
||||
/**
|
||||
* 生成企标稽查整改
|
||||
* @param esInspectReportFlowVO
|
||||
*/
|
||||
void createReportFlow(EsInspectRectifyFlowVO esInspectReportFlowVO);
|
||||
|
||||
/**
|
||||
* 企标稽查流程-流程保存
|
||||
* @param esInspectReportFlowVO
|
||||
*/
|
||||
void flowSave(EsInspectRectifyFlowVO esInspectReportFlowVO);
|
||||
|
||||
/**
|
||||
* 企标稽查流程-办理详情
|
||||
* @param projectId
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
EsInspectRectifyFlowVO queryDetailByProjectId(String projectId, String taskId);
|
||||
|
||||
/**
|
||||
* 企标稽查流程-流程审批
|
||||
* @param esInspectReportFlowVO
|
||||
*/
|
||||
void flowApproval(EsInspectRectifyFlowVO esInspectReportFlowVO);
|
||||
|
||||
/**
|
||||
* 企标稽查流程-流程转办
|
||||
* @param taskId
|
||||
* @param userId
|
||||
*/
|
||||
void flowTransfer(String taskId, String userId);
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.ProcessEsInspectRectifyVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查整改业务表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IProcessEsInspectRectifyService extends IService<ProcessEsInspectRectify> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<ProcessEsInspectRectify> queryPage(ProcessEsInspectRectify processEsInspectReport, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<ProcessEsInspectRectify> queryList(ProcessEsInspectRectify processEsInspectReport, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
void add(ProcessEsInspectRectify processEsInspectReport);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
void editById(ProcessEsInspectRectify processEsInspectReport);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ProcessEsInspectRectifyVO queryById(String id);
|
||||
|
||||
/**
|
||||
* 企标稽查整改业务表-通过项目id查询
|
||||
*
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
ProcessEsInspectRectifyVO queryByProjectId(String projectId);
|
||||
}
|
||||
+266
@@ -0,0 +1,266 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.SnowflakeUtils;
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.enums.FinishFlagEnum;
|
||||
import com.jero.modules.activiti.process.common.entity.ProcessDraft;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.common.service.ProcessDraftService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.common.EsInspectRectifyCommon;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IEsInspectRectifyFlowService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IProcessEsInspectRectifyService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.EsInspectRectifyFlowVO;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.ProcessEsInspectRectifyVO;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectRectifyPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectRectifyPlanService;
|
||||
import org.activiti.engine.ProcessEngine;
|
||||
import org.activiti.engine.ProcessEngines;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName: EsInspectReportFlowServiceImpl
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:51
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowService {
|
||||
private final ProcessAllService processAllService;
|
||||
private final ProcessApprovalRecordService processApprovalRecordService;
|
||||
private final ProcessDraftService processDraftService;
|
||||
private final ProcessNodeLinkService processNodeLinkService;
|
||||
private final IProcessEsInspectRectifyService processEsInspectReportService;
|
||||
private final EnterpriseStandardInspectRectifyPlanService enterpriseStandardInspectRectifyPlanService;
|
||||
|
||||
public EsInspectRectifyFlowServiceImpl(ProcessAllService processAllService,
|
||||
ProcessApprovalRecordService processApprovalRecordService,
|
||||
ProcessDraftService processDraftService,
|
||||
ProcessNodeLinkService processNodeLinkService,
|
||||
IProcessEsInspectRectifyService processEsInspectReportService,
|
||||
EnterpriseStandardInspectRectifyPlanService enterpriseStandardInspectRectifyPlanService) {
|
||||
this.processAllService = processAllService;
|
||||
this.processApprovalRecordService = processApprovalRecordService;
|
||||
this.processDraftService = processDraftService;
|
||||
this.processNodeLinkService = processNodeLinkService;
|
||||
this.processEsInspectReportService = processEsInspectReportService;
|
||||
this.enterpriseStandardInspectRectifyPlanService = enterpriseStandardInspectRectifyPlanService;
|
||||
}
|
||||
|
||||
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
||||
RuntimeService runtimeService = processEngine.getRuntimeService();
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
|
||||
@Override
|
||||
public void createReportFlow(EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
// 流程信息
|
||||
ProcessAll processAll = esInspectReportFlowVO.getProcessAll();
|
||||
// 流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = esInspectReportFlowVO.getProcessApprovalRecord();
|
||||
// map(参数)
|
||||
Map<String, Object> map = esInspectReportFlowVO.getMap();
|
||||
|
||||
// 根据流程key启动流程 同时 设置审批人员参数
|
||||
ProcessInstance processInstance = runtimeService
|
||||
.startProcessInstanceByKey(EsInspectRectifyCommon.KEY, map);
|
||||
|
||||
// 再次设置map
|
||||
runtimeService.setVariables(processInstance.getId(), map);
|
||||
|
||||
// 更新流程总表信息
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT_REPORT.getValue()));
|
||||
processAll.setCreateUserId(loginUser.getId());
|
||||
processAllService.update(processAll,
|
||||
new LambdaUpdateWrapper<ProcessAll>()
|
||||
.eq(ProcessAll::getProcessInstanceId, processInstance.getId()));
|
||||
|
||||
// 根据流程实例id查询
|
||||
Task task = taskService.createTaskQuery()
|
||||
.processInstanceId(processInstance.getId())
|
||||
.singleResult();
|
||||
|
||||
// 更新流程审批信息
|
||||
processApprovalRecord.setProjectId(processAll.getProjectId());
|
||||
processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue());
|
||||
processApprovalRecordService.update(processApprovalRecord,
|
||||
new LambdaUpdateWrapper<ProcessApprovalRecord>()
|
||||
.eq(ProcessApprovalRecord::getTaskId, task.getId()));
|
||||
|
||||
// 新增流程实例节点关联用户表
|
||||
processNodeLinkService.saveNodeUserLink(processInstance.getProcessDefinitionId(), processInstance.getId(), listToString(map));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flowSave(EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
// 流程信息
|
||||
ProcessAll processAll = esInspectReportFlowVO.getProcessAll();
|
||||
// 流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = esInspectReportFlowVO.getProcessApprovalRecord();
|
||||
|
||||
// 流程总表信息
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT_PLAN.getValue()));
|
||||
ProcessDraft processDraft = new ProcessDraft();
|
||||
// 属性拷贝
|
||||
BeanUtils.copyProperties(processAll, processDraft);
|
||||
processDraft.setId("");
|
||||
processDraft.setUpdateBy("");
|
||||
Date date = new Date();
|
||||
processDraft.setCreateTime(date);
|
||||
processDraft.setUpdateBy("");
|
||||
processDraft.setUpdateTime(date);
|
||||
// 保存草稿表
|
||||
if (StringUtils.isNotBlank(processApprovalRecord.getCommitFile())){
|
||||
processDraft.setHandleFile(processApprovalRecord.getCommitFile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(processApprovalRecord.getCommitText())){
|
||||
processDraft.setHandleText(processApprovalRecord.getCommitText());
|
||||
}
|
||||
processDraft.setUserId(loginUser.getId());
|
||||
// 删除旧草稿
|
||||
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
|
||||
.eq(ProcessDraft::getProjectId, processAll.getProjectId())
|
||||
.eq(ProcessDraft::getUserId, loginUser.getId()));
|
||||
// 保存新草稿
|
||||
processDraftService.save(processDraft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsInspectRectifyFlowVO queryDetailByProjectId(String projectId, String taskId) {
|
||||
EsInspectRectifyFlowVO esInspectReportFlowVO = new EsInspectRectifyFlowVO();
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
ProcessAll processAll = processAllService.getOne(new LambdaQueryWrapper<ProcessAll>()
|
||||
.eq(ProcessAll::getProjectId, projectId), false);
|
||||
ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord();
|
||||
|
||||
// 是否存在草稿
|
||||
List<ProcessDraft> processDraftList = processDraftService.list(new LambdaQueryWrapper<ProcessDraft>()
|
||||
.eq(ProcessDraft::getProjectId, projectId)
|
||||
.eq(ProcessDraft::getUserId, loginUser.getId()));
|
||||
if (!processDraftList.isEmpty()){
|
||||
String id = "";
|
||||
if(Objects.isNull(processAll)){
|
||||
processAll = new ProcessAll();
|
||||
id = String.valueOf(SnowflakeUtils.snowflake());
|
||||
}else {
|
||||
id = processAll.getId();
|
||||
}
|
||||
// 存在草稿
|
||||
ProcessDraft processDraft = processDraftList.get(0);
|
||||
// 属性拷贝
|
||||
BeanUtils.copyProperties(processDraft, processAll);
|
||||
processAll.setId(id);
|
||||
if (StringUtils.isNotBlank(processDraft.getHandleFile())){
|
||||
processApprovalRecord.setCommitFile(processDraft.getHandleFile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(processDraft.getHandleText())){
|
||||
processApprovalRecord.setCommitText(processDraft.getHandleText());
|
||||
}
|
||||
}else {
|
||||
// 不存在草稿
|
||||
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
|
||||
.eq(ProcessApprovalRecord::getProjectId, projectId)
|
||||
.eq(ProcessApprovalRecord::getUserId, loginUser.getId())
|
||||
.eq(StringUtils.isNotBlank(taskId), ProcessApprovalRecord::getTaskId, taskId)
|
||||
, false);
|
||||
}
|
||||
esInspectReportFlowVO.setProcessAll(processAll);
|
||||
esInspectReportFlowVO.setProcessApprovalRecord(processApprovalRecord);
|
||||
return esInspectReportFlowVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flowApproval(EsInspectRectifyFlowVO esInspectReportFlowVO) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// 流程信息
|
||||
ProcessAll processAll = esInspectReportFlowVO.getProcessAll();
|
||||
// 流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = esInspectReportFlowVO.getProcessApprovalRecord();
|
||||
// map(参数)
|
||||
Map<String, Object> map = esInspectReportFlowVO.getMap();
|
||||
|
||||
// 更新流程审批信息
|
||||
processApprovalRecordService.update(
|
||||
new LambdaUpdateWrapper<ProcessApprovalRecord>()
|
||||
.eq(ProcessApprovalRecord::getUserId, loginUser.getId())
|
||||
.eq(ProcessApprovalRecord::getTaskId, processAll.getTaskId())
|
||||
.set(StringUtils.isNotBlank(processApprovalRecord.getCommitText()),
|
||||
ProcessApprovalRecord::getCommitText, processApprovalRecord.getCommitText())
|
||||
.set(ProcessApprovalRecord::getCommitFlag, processApprovalRecord.getCommitFlag())
|
||||
.set(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.COMPLETE.getValue()));
|
||||
|
||||
Task task = taskService.createTaskQuery().taskId(processAll.getTaskId()).singleResult();
|
||||
if (task!= null) {
|
||||
// 完成任务
|
||||
taskService.complete(task.getId(), map);
|
||||
// 判断是否是最后一个节点
|
||||
if (isLastNode(processAll.getProcessInstanceId())){
|
||||
ProcessEsInspectRectifyVO processEsInspectReportVO = processEsInspectReportService.queryByProjectId(processAll.getProjectId());
|
||||
// 更新整改状态
|
||||
enterpriseStandardInspectRectifyPlanService.update(
|
||||
new LambdaUpdateWrapper<EnterpriseStandardInspectRectifyPlan>()
|
||||
.eq(EnterpriseStandardInspectRectifyPlan::getId, processEsInspectReportVO.getInspectRectifyPlanId())
|
||||
.set(EnterpriseStandardInspectRectifyPlan::getRectifyStatus, EsInspectRectifyCommon.INSPECT_RECTIFY_STATUS_3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flowTransfer(String taskId, String userId) {
|
||||
// 更新流程审批信息
|
||||
processApprovalRecordService.update(new LambdaUpdateWrapper<ProcessApprovalRecord>()
|
||||
.eq(ProcessApprovalRecord::getTaskId, taskId)
|
||||
.set(ProcessApprovalRecord::getTransferBy, userId)
|
||||
.set(ProcessApprovalRecord::getUserId, userId));
|
||||
// 转办
|
||||
taskService.setAssignee(taskId, userId);
|
||||
}
|
||||
|
||||
private Map<String, Object> listToString(Map<String, Object> map) {
|
||||
Map<String, Object> stringObjectHashMap;
|
||||
stringObjectHashMap = map.entrySet().stream().map(v -> {
|
||||
if (v.getValue() instanceof List) {
|
||||
List<String> list = (List<String>)v.getValue();
|
||||
v.setValue(String.join(",", list));
|
||||
}
|
||||
return v;
|
||||
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
return stringObjectHashMap;
|
||||
}
|
||||
|
||||
public boolean isLastNode(String processInstanceId) {
|
||||
// 查询流程实例状态
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.singleResult();
|
||||
|
||||
// 如果流程实例为null,表示流程已结束
|
||||
return processInstance == null;
|
||||
}
|
||||
}
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.activiti.process.esinspect.service.IProcessEsInspectService;
|
||||
import com.jero.modules.activiti.process.esinspect.vo.ProcessEsInspectVO;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.mapper.ProcessEsInspectRectifyMapper;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.service.IProcessEsInspectRectifyService;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.vo.ProcessEsInspectRectifyVO;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectReport;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectReportService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查整改业务表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class ProcessEsInspectRectifyServiceImpl extends ServiceImpl<ProcessEsInspectRectifyMapper, ProcessEsInspectRectify> implements IProcessEsInspectRectifyService {
|
||||
|
||||
private final EnterpriseStandardInspectReportService EnterpriseStandardInspectReportService;
|
||||
private final IProcessEsInspectService processEsInspectService;
|
||||
|
||||
public ProcessEsInspectRectifyServiceImpl(EnterpriseStandardInspectReportService enterpriseStandardInspectReportService,
|
||||
IProcessEsInspectService processEsInspectService) {
|
||||
EnterpriseStandardInspectReportService = enterpriseStandardInspectReportService;
|
||||
this.processEsInspectService = processEsInspectService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<ProcessEsInspectRectify> queryPage(ProcessEsInspectRectify processEsInspectReport, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProcessEsInspectRectify> queryWrapper = QueryGenerator.initQueryWrapper(processEsInspectReport, req.getParameterMap());
|
||||
Page<ProcessEsInspectRectify> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProcessEsInspectRectify> queryList(ProcessEsInspectRectify processEsInspectReport, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(processEsInspectReport, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(ProcessEsInspectRectify processEsInspectReport) {
|
||||
Date now = new Date();
|
||||
processEsInspectReport.setCreateTime(now);
|
||||
processEsInspectReport.setUpdateTime(now);
|
||||
save(processEsInspectReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param processEsInspectReport
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ProcessEsInspectRectify processEsInspectReport) {
|
||||
Date now = new Date();
|
||||
processEsInspectReport.setUpdateTime(now);
|
||||
saveOrUpdate(processEsInspectReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ProcessEsInspectRectifyVO queryById(String id) {
|
||||
ProcessEsInspectRectifyVO esInspectReportVO = new ProcessEsInspectRectifyVO();
|
||||
ProcessEsInspectRectify processEsInspectReport = getById(id);
|
||||
// 查询稽查整改信息
|
||||
EnterpriseStandardInspectReport enterpriseStandardInspectReport = EnterpriseStandardInspectReportService.queryById(processEsInspectReport.getInspectRectifyPlanId());
|
||||
esInspectReportVO.setEnterpriseStandardInspectReport(enterpriseStandardInspectReport);
|
||||
// 稽查依据
|
||||
String processEsInspectId = enterpriseStandardInspectReport.getProcessEsInspectId();
|
||||
ProcessEsInspectVO processEsInspectVO = new ProcessEsInspectVO();
|
||||
processEsInspectVO.setId(processEsInspectId);
|
||||
List<ProcessEsInspectVO> processEsInspectVOList = processEsInspectService.queryByList(processEsInspectVO);
|
||||
if (!processEsInspectVOList.isEmpty()){
|
||||
esInspectReportVO.setStandardName(processEsInspectVOList.get(0).getInspectName());
|
||||
}
|
||||
return esInspectReportVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessEsInspectRectifyVO queryByProjectId(String projectId) {
|
||||
ProcessEsInspectRectifyVO esInspectReportVO = new ProcessEsInspectRectifyVO();
|
||||
ProcessEsInspectRectify processEsInspectReport = getOne(
|
||||
new LambdaQueryWrapper<ProcessEsInspectRectify>()
|
||||
.eq(ProcessEsInspectRectify::getProjectId, projectId));
|
||||
// 查询稽查整改信息
|
||||
EnterpriseStandardInspectReport enterpriseStandardInspectReport = EnterpriseStandardInspectReportService.queryById(processEsInspectReport.getInspectRectifyPlanId());
|
||||
esInspectReportVO.setEnterpriseStandardInspectReport(enterpriseStandardInspectReport);
|
||||
// 稽查依据
|
||||
String processEsInspectId = enterpriseStandardInspectReport.getProcessEsInspectId();
|
||||
ProcessEsInspectVO processEsInspectVO = new ProcessEsInspectVO();
|
||||
processEsInspectVO.setId(processEsInspectId);
|
||||
List<ProcessEsInspectVO> processEsInspectVOList = processEsInspectService.queryByList(processEsInspectVO);
|
||||
if (!processEsInspectVOList.isEmpty()){
|
||||
esInspectReportVO.setStandardName(processEsInspectVOList.get(0).getInspectName());
|
||||
}
|
||||
return esInspectReportVO;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.vo;
|
||||
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: EsInspectReportFlowVO
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:55
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Data
|
||||
public class EsInspectRectifyFlowVO {
|
||||
/**流程信息*/
|
||||
@ApiModelProperty(value = "流程信息")
|
||||
private ProcessAll processAll;
|
||||
/**流程审批信息*/
|
||||
@ApiModelProperty(value = "流程审批信息")
|
||||
private ProcessApprovalRecord processApprovalRecord;
|
||||
/**业务基本信息*/
|
||||
@ApiModelProperty(value = "业务基本信息")
|
||||
private ProcessEsInspectRectify processEsInspectReport;
|
||||
/**map*/
|
||||
@ApiModelProperty(value = "map")
|
||||
private Map<String, Object> map;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.jero.modules.activiti.process.esinspectrectify.vo;
|
||||
|
||||
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectReport;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName: EsInspectReportVO
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-11-28 19:32
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ProcessEsInspectRectifyVO extends ProcessEsInspectRectify {
|
||||
/**稽查依据*/
|
||||
@ApiModelProperty(value = "稽查依据")
|
||||
private String standardName;
|
||||
/**企业标准检查报告*/
|
||||
@ApiModelProperty(value = "企业标准检查报告")
|
||||
private EnterpriseStandardInspectReport enterpriseStandardInspectReport;
|
||||
}
|
||||
+4
@@ -61,6 +61,10 @@ public class EnterpriseStandardInspectVo {
|
||||
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
|
||||
private String inspectUser;
|
||||
|
||||
/** 稽查负责人 翻译*/
|
||||
@ApiModelProperty(value = "稽查负责人 翻译")
|
||||
private String inspectUserDictText;
|
||||
|
||||
/** 标准化组对接人 */
|
||||
@Excel(name = "标准化组对接人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "标准化组对接人")
|
||||
|
||||
+6
-1
@@ -158,7 +158,12 @@ public class EnterpriseStandardInspectReportServiceImpl extends ServiceImpl<Ente
|
||||
*/
|
||||
@Override
|
||||
public EnterpriseStandardInspectReport queryById(String id) {
|
||||
return getById(id);
|
||||
EnterpriseStandardInspectReport enterpriseStandardInspectReport = getById(id);
|
||||
// 稽查内容查询
|
||||
EnterpriseStandardInspectContent enterpriseStandardInspectContent = enterpriseStandardInspectContentService.getById(enterpriseStandardInspectReport.getInspectContentId());
|
||||
enterpriseStandardInspectReport.setBaseClause(enterpriseStandardInspectContent.getStandardNo());
|
||||
enterpriseStandardInspectReport.setStandardRequire(enterpriseStandardInspectContent.getRequirement());
|
||||
return enterpriseStandardInspectReport;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
-2
@@ -177,14 +177,24 @@ public class EnterpriseStandardInspectServiceImpl extends ServiceImpl<Enterprise
|
||||
@Override
|
||||
public IPage<EnterpriseStandardInspectVo> queryByPage(EnterpriseStandardInspectVo enterpriseStandardInspectVo, Integer pageNo, Integer pageSize) {
|
||||
QueryWrapper<EnterpriseStandardInspectVo> queryWrapper = getEnterpriseStandardInspectVoQueryWrapper(enterpriseStandardInspectVo);
|
||||
return esInspectMapper.queryByPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<EnterpriseStandardInspectVo> enterpriseStandardInspectVoIPage = esInspectMapper.queryByPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
setProperty(enterpriseStandardInspectVoIPage.getRecords());
|
||||
return enterpriseStandardInspectVoIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnterpriseStandardInspectVo> queryByList(EnterpriseStandardInspectVo enterpriseStandardInspectVo) {
|
||||
QueryWrapper<EnterpriseStandardInspectVo> queryWrapper = getEnterpriseStandardInspectVoQueryWrapper(enterpriseStandardInspectVo);
|
||||
List<EnterpriseStandardInspectVo> enterpriseStandardInspectVos = esInspectMapper.queryByList(queryWrapper);
|
||||
return enterpriseStandardInspectVos;
|
||||
setProperty(enterpriseStandardInspectVos);
|
||||
return esInspectMapper.queryByList(queryWrapper);
|
||||
}
|
||||
|
||||
private void setProperty(List<EnterpriseStandardInspectVo> list) {
|
||||
for (EnterpriseStandardInspectVo enterpriseStandardInspectVo : list) {
|
||||
// 翻译
|
||||
enterpriseStandardInspectVo.setInspectUserDictText(sysUserService.dictByIdsOrUserNames(enterpriseStandardInspectVo.getInspectUser(), ""));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user