Browse Source

调整

master
gjh 4 days ago
parent
commit
aa744ce141
  1. 10
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java
  2. 215
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfofileServiceImpl.java
  3. 9
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUploadfileinfoServiceImpl.java

10
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java

@ -1772,15 +1772,17 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper,
@Override @Override
public List<PlanSelectVo> getPlanNames(String projectid) { public List<PlanSelectVo> getPlanNames(String projectid) {
List<String> updatePlanList = Arrays.asList("初验阶段", "试运行阶段","终验阶段"); List<String> updatePlanList = Arrays.asList("提交终验申请", "联合验收审批 ", "提交核验申请", "部门集中核验", "上传核验报告");
LambdaQueryWrapper<HuzhouPlaninfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HuzhouPlaninfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HuzhouPlaninfo::getProjectId,projectid); queryWrapper.eq(HuzhouPlaninfo::getProjectId, projectid);
queryWrapper.in(HuzhouPlaninfo::getTaskName,updatePlanList); queryWrapper.in(HuzhouPlaninfo::getTaskName, updatePlanList);
List<HuzhouPlaninfo> planInfoList = planInfoMapper.selectList(queryWrapper); List<HuzhouPlaninfo> planInfoList = planInfoMapper.selectList(queryWrapper);
List<PlanSelectVo> rs = new ArrayList<>(); List<PlanSelectVo> rs = new ArrayList<>();
if (CollectionUtil.isNotEmpty(planInfoList)) {
for (HuzhouPlaninfo planInfo : planInfoList) { for (HuzhouPlaninfo planInfo : planInfoList) {
rs.add(new PlanSelectVo(planInfo.getTaskName(),planInfo.getId())); rs.add(new PlanSelectVo(planInfo.getTaskName(), planInfo.getId()));
}
} }
return rs; return rs;
} }

215
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfofileServiceImpl.java

@ -6,14 +6,11 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.util.StringUtils; import com.alibaba.excel.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.easy.admin.auth.model.SysUser; import com.easy.admin.auth.model.SysUser;
import com.easy.admin.auth.service.SysUserService; import com.easy.admin.auth.service.SysUserService;
import com.easy.admin.common.api.vo.Result;
import com.easy.admin.common.core.exception.EasyException; import com.easy.admin.common.core.exception.EasyException;
import com.easy.admin.modules.huzhou.dao.HuzhouContractinfoMapper; import com.easy.admin.modules.huzhou.dao.HuzhouContractinfoMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouPlaninfoMapper; import com.easy.admin.modules.huzhou.dao.HuzhouPlaninfoMapper;
@ -40,14 +37,12 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@ -190,6 +185,9 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
planinfoMapper.insert(target2); planinfoMapper.insert(target2);
} }
} }
if("终验阶段".equals(taskName)){
autoCreatPlanAfterFinal(planinfo);
}
String superLeader = ""; String superLeader = "";
String adminDivision=""; String adminDivision="";
@ -257,61 +255,14 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
} }
// 创建流程 // 创建流程
WorkFlow workFlow = workflowService.createFlow(key,planinfoid); WorkFlow workFlow = workflowService.createFlow(key,planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} }
else if("集中核验".equals(taskName)){ else if("集中核验".equals(taskName)){
WorkFlow workFlow = workflowService.createFlow("centralizedCheck",planinfoid); WorkFlow workFlow = workflowService.createFlow("centralizedCheck",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
}else if("招标文件编制".equals(taskName)){ }else if("招标文件编制".equals(taskName)){
WorkFlow workFlow = workflowService.createFlow("bidDocumentsPreparation",planinfoid); WorkFlow workFlow = workflowService.createFlow("bidDocumentsPreparation",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} else if ("可研报告初稿编制".equals(taskName)) { } else if ("可研报告初稿编制".equals(taskName)) {
//审批通过但是要开始下一阶段流程 //审批通过但是要开始下一阶段流程
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo(); HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
@ -346,77 +297,23 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
} else if ("可研报告送审稿编制".equals(taskName)) { } else if ("可研报告送审稿编制".equals(taskName)) {
//finalFeasibilityReportDraft //finalFeasibilityReportDraft
WorkFlow workFlow = workflowService.createFlow("finalFeasibilityReportDraft",planinfoid); WorkFlow workFlow = workflowService.createFlow("finalFeasibilityReportDraft",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} else if("立项审批".equals(taskName)){ } else if("立项审批".equals(taskName)){
WorkFlow workFlow = workflowService.createFlow("projectApprovalStage",planinfoid); WorkFlow workFlow = workflowService.createFlow("projectApprovalStage",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
}else if("提交终验申请".equals(taskName)){ }else if("提交终验申请".equals(taskName)){
WorkFlow workFlow = workflowService.createFlow("submitFinalApplication",planinfoid); WorkFlow workFlow = workflowService.createFlow("submitFinalApplication",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} else if ("联合验收审批".equals(taskName)) { } else if ("联合验收审批".equals(taskName)) {
WorkFlow workFlow = workflowService.createFlow("JAA", planinfoid); WorkFlow workFlow = workflowService.createFlow("JAA", planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId(); } else if ("提交核验申请".equals(taskName)) {
String processInstanceId = workFlow.getProcessInstanceId(); WorkFlow workFlow = workflowService.createFlow("DCV", planinfoid);
Map<String, Object> variables = new HashMap<>(); basicFlowUpdate(planinfoid, strings, workFlow);
variables.put("taskLeadingDepartment", strings); } else if ("上传核验报告".equals(taskName)) {
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息 WorkFlow workFlow = workflowService.createFlow("UAR", planinfoid);
//发起人节点处理 basicFlowUpdate(planinfoid, strings, workFlow);
taskService.setVariableLocal(taskId, "approvalStatue", "1");//添加审批状态 通过 }else {
String comment = "同意";
taskService.addComment(taskId, processInstanceId, comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} else {
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo(); HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid); huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("2"); huzhouPlaninfo.setIsfinish("2");
@ -454,6 +351,67 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
} }
} }
private void basicFlowUpdate(String planinfoid, ArrayList<String> strings, WorkFlow workFlow) {
Task task = workFlow.getTask();
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment", strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId, "approvalStatue", "1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId, processInstanceId, comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
}
private void autoCreatPlanAfterFinal(HuzhouPlaninfo planinfo) {
LambdaQueryWrapper<HuzhouPlaninfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HuzhouPlaninfo::getProjectId, planinfo.getProjectId());
queryWrapper.eq(HuzhouPlaninfo::getTaskName,"终验阶段");
HuzhouPlaninfo source = planinfoMapper.selectOne(queryWrapper);
if (source != null) {
HuzhouPlaninfo target = new HuzhouPlaninfo();
BeanUtils.copyProperties(source, target, "id", "actualStartTime", "actualEndTime");
target.setTaskName("提交核验申请");
target.setTaskFile("《验收文件》");
target.setIsfinish("0");
// 设置日期为 2025-12-31
LocalDate targetLocalDate = LocalDate.of(2025, 12, 31);
ZoneId zone = ZoneId.of("GMT+8");
Date setDate = Date.from(targetLocalDate.atStartOfDay(zone).toInstant());
target.setScheduledStartTime(setDate);
target.setScheduledEndTime(setDate);
planinfoMapper.insert(target);
// 添加计划
HuzhouPlaninfo target2 = new HuzhouPlaninfo();
BeanUtils.copyProperties(source, target2, "id", "actualStartTime", "actualEndTime");
target2.setTaskName("部门集中核验");
target2.setTaskFile("《验收文件》");
target2.setIsfinish("0");
target2.setScheduledStartTime(setDate);
target2.setScheduledEndTime(setDate);
planinfoMapper.insert(target2);
// 添加计划
HuzhouPlaninfo target3 = new HuzhouPlaninfo();
BeanUtils.copyProperties(source, target3, "id", "actualStartTime", "actualEndTime");
target3.setTaskName("上传核验报告");
target3.setTaskFile("《验收文件》");
target3.setIsfinish("0");
target3.setScheduledStartTime(setDate);
target3.setScheduledEndTime(setDate);
planinfoMapper.insert(target3);
}
}
private void checkVariable(String contractMoneyFieldsValue, List<HuzhouContractinfo> contractList, HuzhouPlaninfo planinfo, String taskName) throws JsonProcessingException { private void checkVariable(String contractMoneyFieldsValue, List<HuzhouContractinfo> contractList, HuzhouPlaninfo planinfo, String taskName) throws JsonProcessingException {
// 增加终验申请校验 // 增加终验申请校验
HuzhouProjectinfo huzhouProjectinfo = projectinfoService.getById(planinfo.getProjectId()); HuzhouProjectinfo huzhouProjectinfo = projectinfoService.getById(planinfo.getProjectId());
@ -818,22 +776,7 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil
} else if ("可研报告送审稿编制".equals(taskName)) { } else if ("可研报告送审稿编制".equals(taskName)) {
//finalFeasibilityReportDraft //finalFeasibilityReportDraft
WorkFlow workFlow = workflowService.createFlow("finalFeasibilityReportDraft",planinfoid); WorkFlow workFlow = workflowService.createFlow("finalFeasibilityReportDraft",planinfoid);
Task task = workFlow.getTask(); basicFlowUpdate(planinfoid, strings, workFlow);
String taskId = task.getId();
String processInstanceId = workFlow.getProcessInstanceId();
Map<String, Object> variables = new HashMap<>();
variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理
taskService.setVariableLocal(taskId,"approvalStatue","1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId,processInstanceId,comment);//添加审批意见
taskService.complete(taskId, variables);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoService.updateById(huzhouPlaninfo);
} }
} }
@Override @Override

9
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUploadfileinfoServiceImpl.java

@ -203,9 +203,11 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
huzhouPlaninfo.setIsfinish("1"); huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date()); huzhouPlaninfo.setActualStartTime(new Date());
planinfoMapper.updateById(huzhouPlaninfo); planinfoMapper.updateById(huzhouPlaninfo);
HuzhouPlaninfo planinfo = planinfoMapper.selectById(planinfoid); HuzhouPlaninfo planinfo = planinfoMapper.selectById(planinfoid);
String projectId = planinfo.getProjectId();
//更新项目的联合技术审查估算金额 //更新项目的联合技术审查估算金额
String projectId = planinfo.getProjectId();
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo(); HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
huzhouProjectinfo.setId(projectId); huzhouProjectinfo.setId(projectId);
huzhouProjectinfo.setUrtEstimatedAmount(urtEstimatedAmount); huzhouProjectinfo.setUrtEstimatedAmount(urtEstimatedAmount);
@ -241,7 +243,6 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
//如果项目信息为空说明是子项目 //如果项目信息为空说明是子项目
if(projectinfo==null){ if(projectinfo==null){
throw new EasyException("未找到项目的任务牵头处室信息"); throw new EasyException("未找到项目的任务牵头处室信息");
}else {
} }
superLeader=projectinfo.getSuperLeader(); superLeader=projectinfo.getSuperLeader();
@ -255,11 +256,11 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
String error = "任务牵头处室"+dictName+"负责人未找到"; String error = "任务牵头处室"+dictName+"负责人未找到";
throw new EasyException(error); throw new EasyException(error);
} }
for (HashMap<String, String> map:userDictByRoles for (HashMap<String, String> map : userDictByRoles) {
) {
String userid = map.get("value"); String userid = map.get("value");
strings.add(userid); strings.add(userid);
} }
variables.put("taskLeadingDepartment",strings); variables.put("taskLeadingDepartment",strings);
runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息 runtimeService.setVariable(processInstanceId, "taskLeadingDepartment", strings);//设置第四个人变量信息
//发起人节点处理 //发起人节点处理

Loading…
Cancel
Save