根据冀北专责需求调整我的待办内容

1、取消展示终端监测计划;
2、增加技术监督测试计划展示;
This commit is contained in:
2024-09-24 14:03:54 +08:00
parent 320a236582
commit 3280c29013
8 changed files with 98 additions and 64 deletions

View File

@@ -14,6 +14,7 @@ import java.util.Arrays;
@AllArgsConstructor @AllArgsConstructor
public enum BpmProcessInstanceStatusEnum implements IntArrayValuable { public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
AWAIT(0, "待提交审批"),
RUNNING(1, "审批中"), RUNNING(1, "审批中"),
APPROVE(2, "审批通过"), APPROVE(2, "审批通过"),
REJECT(3, "审批不通过"), REJECT(3, "审批不通过"),

View File

@@ -49,10 +49,7 @@ import org.springframework.web.bind.annotation.*;
import org.flowable.task.api.history.HistoricTaskInstance; import org.flowable.task.api.history.HistoricTaskInstance;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -151,23 +148,21 @@ public class BpmTaskController extends BaseController {
public HttpResult<List<TodoVO>> allTodoList() { public HttpResult<List<TodoVO>> allTodoList() {
String methodDescribe = getMethodDescribe("allTodoList"); String methodDescribe = getMethodDescribe("allTodoList");
List<TodoVO> result = new ArrayList<>(); List<TodoVO> result = new ArrayList<>();
// 获取当前用户所有不通过的工作流程 // 获取当前用户所有不通过的工作流程
List<BpmProcessInstanceVO> rejectProcessInstanceList = getRejectProcessInstanceList(); List<BpmProcessInstanceVO> rejectProcessInstanceList = getRejectProcessInstanceList();
if(CollectionUtil.isNotEmpty(rejectProcessInstanceList)){ if(CollectionUtil.isNotEmpty(rejectProcessInstanceList)){
// 转为统一的todoVO3 // 转为统一的todoVO3
result.addAll(TodoVOConvert.convertByBpmProcessInstance(rejectProcessInstanceList)); result.addAll(TodoVOConvert.convertByBpmProcessInstance(rejectProcessInstanceList));
} }
// 获取当前用户所有待办工作流程 // 获取当前用户所有待办工作流程
HttpResult<List<BpmTaskVO>> todoAllList = this.todoAllList(); HttpResult<List<BpmTaskVO>> todoAllList = this.todoAllList();
if(CollectionUtil.isNotEmpty(todoAllList.getData())){ if(CollectionUtil.isNotEmpty(todoAllList.getData())){
// 转为统一的todoVO3 // 转为统一的todoVO3
result.addAll(TodoVOConvert.convertByBpmTaskVO(todoAllList.getData())); result.addAll(TodoVOConvert.convertByBpmTaskVO(todoAllList.getData()));
} }
// 获取没有流程的一些待办信息 // 获取没有流程的一些待办信息
result.addAll(businessCommonFeignClient.getTodoBusiness().getData()); result.addAll(businessCommonFeignClient.getTodoBusiness().getData());
result = result.stream().sorted(Comparator.comparing(TodoVO::getTaskCreateTime).reversed()).collect(Collectors.toList());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
} }

View File

@@ -1,5 +1,6 @@
package com.njcn.supervision.controller; package com.njcn.supervision.controller;
import cn.hutool.core.text.StrPool;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
import com.njcn.bpm.pojo.vo.TodoVO; import com.njcn.bpm.pojo.vo.TodoVO;
@@ -12,8 +13,8 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.enums.SupervisionKeyEnum; import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.enums.SupervisionResponseEnum; import com.njcn.supervision.enums.SupervisionResponseEnum;
import com.njcn.supervision.service.device.ICheckDeviceService;
import com.njcn.supervision.service.leaflet.IWarningLeafletService; import com.njcn.supervision.service.leaflet.IWarningLeafletService;
import com.njcn.supervision.service.survey.ISurveyTestService;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -43,7 +44,7 @@ public class BusinessCommonController extends BaseController {
private IWarningLeafletService warningLeafletService; private IWarningLeafletService warningLeafletService;
@Resource @Resource
private ICheckDeviceService checkDeviceService; private ISurveyTestService surveyTestService;
@ApiIgnore @ApiIgnore
@@ -106,7 +107,7 @@ public class BusinessCommonController extends BaseController {
List<TodoVO> todoVOList = new ArrayList<>(); List<TodoVO> todoVOList = new ArrayList<>();
//可能需要判断当前用户是否需要处理这些待办,比如专职下发的预告警单,应该由负责单位去处理 //可能需要判断当前用户是否需要处理这些待办,比如专职下发的预告警单,应该由负责单位去处理
todoVOList.addAll(warningLeafletService.getTodoBusiness()); todoVOList.addAll(warningLeafletService.getTodoBusiness());
todoVOList.addAll(checkDeviceService.getTodoBusiness()); todoVOList.addAll(surveyTestService.getTodoBusiness());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, todoVOList, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, todoVOList, methodDescribe);
} }
@@ -119,7 +120,8 @@ public class BusinessCommonController extends BaseController {
private void getBpmServiceByBusinessStatusKey(String processKey, String businessId, String reason, Integer status) { private void getBpmServiceByBusinessStatusKey(String processKey, String businessId, String reason, Integer status) {
String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey); String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey);
try { try {
if ("SupervisionTempLineRunTestServiceImpl".equals(fullServicePath.substring(fullServicePath.lastIndexOf(".") + 1))) { assert fullServicePath != null;
if ("SupervisionTempLineRunTestServiceImpl".equals(fullServicePath.substring(fullServicePath.lastIndexOf(StrPool.DOT) + 1))) {
IBpmReasonService iBpmService = (IBpmReasonService) SpringUtil.getBean(Class.forName(fullServicePath)); IBpmReasonService iBpmService = (IBpmReasonService) SpringUtil.getBean(Class.forName(fullServicePath));
iBpmService.updateProcessStatus(businessId, reason, status); iBpmService.updateProcessStatus(businessId, reason, status);
} else { } else {
@@ -142,7 +144,8 @@ public class BusinessCommonController extends BaseController {
String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey); String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey);
BpmInstanceInfo instanceInfo; BpmInstanceInfo instanceInfo;
try { try {
if ("SupervisionTempLineRunTestServiceImpl".equals(fullServicePath.substring(fullServicePath.lastIndexOf(".") + 1))) { assert fullServicePath != null;
if ("SupervisionTempLineRunTestServiceImpl".equals(fullServicePath.substring(fullServicePath.lastIndexOf(StrPool.DOT) + 1))) {
IBpmReasonService iBpmService = (IBpmReasonService) SpringUtil.getBean(Class.forName(fullServicePath)); IBpmReasonService iBpmService = (IBpmReasonService) SpringUtil.getBean(Class.forName(fullServicePath));
instanceInfo = iBpmService.getInstanceInfo(businessId); instanceInfo = iBpmService.getInstanceInfo(businessId);
} else { } else {
@@ -155,21 +158,4 @@ public class BusinessCommonController extends BaseController {
return instanceInfo; return instanceInfo;
} }
/**
* 根据业务流key获取实现类对象
*
* @param processKey 业务流key
*/
private IBpmService getBpmServiceByBusinessKey(String processKey) {
String fullServicePath = SupervisionKeyEnum.getFullServicePathByKey(processKey);
IBpmService executor;
try {
executor = (IBpmService) SpringUtil.getBean(Class.forName(fullServicePath));
} catch (ClassNotFoundException e) {
throw new BusinessException(SupervisionResponseEnum.SUPERVISION_SERVICE_NOT_FOUND);
}
return executor;
}
} }

View File

@@ -7,6 +7,8 @@ import com.njcn.supervision.pojo.po.survey.SurveyTest;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
* 普测测试的管理表 Mapper 接口 * 普测测试的管理表 Mapper 接口
@@ -18,4 +20,11 @@ import org.apache.ibatis.annotations.Param;
public interface SurveyTestMapper extends BaseMapper<SurveyTest> { public interface SurveyTestMapper extends BaseMapper<SurveyTest> {
Page<SurveyTestVO> surveyTestPage(Page<Object> objectPage, @Param("ew")QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper); Page<SurveyTestVO> surveyTestPage(Page<Object> objectPage, @Param("ew")QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper);
/**
* 根据条件查询待测试的计划
* @param queryWrapper 查询条件
* @return 待测试的计划
*/
List<SurveyTestVO> getTodoBusiness(@Param("ew")QueryWrapper<SurveyTestVO> queryWrapper);
} }

View File

@@ -17,4 +17,21 @@
WHERE ${ew.sqlSegment} WHERE ${ew.sqlSegment}
</select> </select>
<select id="getTodoBusiness" resultType="SurveyTestVO">
SELECT supervision_survey_test.*,
supervision_survey_plan.plan_name planName,
supervision_survey_plan.custom_substation_flag customSubstationFlag,
supervision_survey_plan.substation substation,
supervision_survey_plan.plan_start_time planStartTime,
supervision_survey_plan.supv_type supvType,
supervision_survey_plan.supv_object_name supvObjectName,
supervision_survey_plan.plan_end_time planEndTime,
sys_user.name createBy
FROM supervision_survey_test supervision_survey_test
left join supervision_survey_plan supervision_survey_plan
on supervision_survey_test.plan_id = supervision_survey_plan.id,
sys_user sys_user
WHERE sys_user.id = supervision_survey_plan.create_by and ${ew.sqlSegment}
</select>
</mapper> </mapper>

View File

@@ -6,7 +6,6 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
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.query.QueryWrapper;
@@ -27,16 +26,12 @@ import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.supervision.enums.*; import com.njcn.supervision.enums.*;
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper; import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam; import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
import com.njcn.supervision.pojo.po.device.CheckDevice;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning; import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning;
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet; import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import com.njcn.supervision.service.device.TempLineRunTestWarningService; import com.njcn.supervision.service.device.TempLineRunTestWarningService;
import com.njcn.supervision.service.leaflet.IWarningLeafletService; import com.njcn.supervision.service.leaflet.IWarningLeafletService;
import com.njcn.supervision.service.survey.ISurveyTestService; import com.njcn.supervision.service.survey.ISurveyTestService;
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService;
import com.njcn.supervision.utils.InstanceUtil; import com.njcn.supervision.utils.InstanceUtil;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
@@ -79,9 +74,6 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
@Resource @Resource
private DeptFeignClient deptFeignClient; private DeptFeignClient deptFeignClient;
@Lazy
@Resource
private SupervisionGeneralSurveyPlanPOService supervisionGeneralSurveyPlanPOService;
@Resource @Resource
private FileStorageUtil fileStorageUtil; private FileStorageUtil fileStorageUtil;

View File

@@ -2,6 +2,7 @@ package com.njcn.supervision.service.survey;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.bpm.pojo.vo.TodoVO;
import com.njcn.bpm.service.IBpmService; import com.njcn.bpm.service.IBpmService;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam; import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam; import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
@@ -35,4 +36,10 @@ public interface ISurveyTestService extends IBpmService<SurveyTest> {
void initiateWarningLeaflet(WarningAddParam warningAddParam); void initiateWarningLeaflet(WarningAddParam warningAddParam);
Boolean deleteSurveyPlanTest(List<String> supervisionId); Boolean deleteSurveyPlanTest(List<String> supervisionId);
/**
* 获取当前用户的待办业务
* @return 待办业务
*/
List<TodoVO> getTodoBusiness();
} }

View File

@@ -20,19 +20,18 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.bpm.pojo.vo.TodoVO;
import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.pms.pojo.po.PmsNewEnergy;
import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO; import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
import com.njcn.supervision.enums.*; import com.njcn.supervision.enums.*;
import com.njcn.supervision.mapper.survey.SurveyTestMapper; import com.njcn.supervision.mapper.survey.SurveyTestMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam; import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam; import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
import com.njcn.supervision.pojo.po.device.CheckDevice;
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.po.survey.SurveyPlan; import com.njcn.supervision.pojo.po.survey.SurveyPlan;
import com.njcn.supervision.pojo.po.survey.SurveyTest; import com.njcn.supervision.pojo.po.survey.SurveyTest;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
import com.njcn.supervision.service.leaflet.IWarningLeafletService; import com.njcn.supervision.service.leaflet.IWarningLeafletService;
import com.njcn.supervision.service.survey.ISurveyPlanService; import com.njcn.supervision.service.survey.ISurveyPlanService;
@@ -42,6 +41,7 @@ import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.api.UserFeignClient; import com.njcn.user.api.UserFeignClient;
import com.njcn.user.pojo.vo.UserVO;
import com.njcn.web.factory.PageFactory; import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil; import com.njcn.web.utils.RequestUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@@ -88,7 +88,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
@Override @Override
public Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) { public Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) {
QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper = new QueryWrapper<>(); QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper = new QueryWrapper<>();
List<String> deptIds = new ArrayList<>();; List<String> deptIds = new ArrayList<>();
if (Objects.nonNull(surveyTestQueryParam)) { if (Objects.nonNull(surveyTestQueryParam)) {
//添加上时间范围 //添加上时间范围
surveyTestVOQueryWrapper.and(wrapper -> surveyTestVOQueryWrapper.and(wrapper ->
@@ -126,8 +126,6 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus()); surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus());
} }
surveyTestVOQueryWrapper.eq(StringUtils.isNotBlank(surveyTestQueryParam.getSupvType()),"supervision_survey_plan.supv_type",surveyTestQueryParam.getSupvType()); surveyTestVOQueryWrapper.eq(StringUtils.isNotBlank(surveyTestQueryParam.getSupvType()),"supervision_survey_plan.supv_type",surveyTestQueryParam.getSupvType());
//获取当前用户部门所有同事的id查看该部门下所有的数据
surveyTestVOQueryWrapper surveyTestVOQueryWrapper
.eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
.orderByDesc("supervision_survey_test.Update_Time"); .orderByDesc("supervision_survey_test.Update_Time");
@@ -232,15 +230,14 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
} }
surveyTest.setState(DataStateEnum.ENABLE.getCode()); surveyTest.setState(DataStateEnum.ENABLE.getCode());
surveyTest.setCreateBy(RequestUtil.getUserIndex()); surveyTest.setCreateBy(RequestUtil.getUserIndex());
// surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
this.updateById(surveyTest); this.updateById(surveyTest);
// 发起 BPM 流程 // 发起 BPM 流程
if(Objects.equals(surveyTestParam.getSaveOrCheckflag(),"2")) { if(Objects.equals(surveyTestParam.getSaveOrCheckflag(),"2")) {
Map<String, Object> processInstanceVariables = new HashMap<>(); Map<String, Object> processInstanceVariables = new HashMap<>(16);
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey()); bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey());
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId()); bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId());
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(8));
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData(); String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyTest.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
// 将工作流的编号,更新到流程单中 // 将工作流的编号,更新到流程单中
@@ -264,11 +261,11 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
//处理历史流程id列表 //处理历史流程id列表
String historyInstanceIds = InstanceUtil.dealHistoryId(surveyTest.getProcessInstanceId(), surveyTest.getHistoryInstanceId()); String historyInstanceIds = InstanceUtil.dealHistoryId(surveyTest.getProcessInstanceId(), surveyTest.getHistoryInstanceId());
// 发起 BPM 流程 // 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>(); Map<String, Object> processInstanceVariables = new HashMap<>(16);
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey()); bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_TEST.getKey());
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId()); bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyTest.getId());
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>()); bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(8));
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData(); String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData();
// 将工作流的编号,更新到流程单中 // 将工作流的编号,更新到流程单中
@@ -422,21 +419,51 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
.in(SurveyTest::getId, supervisionId)); .in(SurveyTest::getId, supervisionId));
} }
/** @Override
* 组装谐波普测的问题 public List<TodoVO> getTodoBusiness() {
* 格式planCreateTime发起的planName普测计划由负责人leader测试后于planComplateTime完成其中subName在本次普测计划测试中存在电能质量问题详细请查看附件 List<TodoVO> todoVOList = new ArrayList<>();
*/ //如果用户为管理员则不查
private String assembleIssueDetail(SurveyTestVO surveyTestVO) { UserVO userVO = userFeignClient.getUserById(RequestUtil.getUserIndex()).getData();
return "变电站:".concat(surveyTestVO.getSubstationName()) if(Objects.nonNull(userVO) && userVO.getType() == 1){
.concat("") return todoVOList;
.concat(LocalDateTimeUtil.format(surveyTestVO.getCreateTime(), DatePattern.CHINESE_DATE_PATTERN)) }
.concat("发起的") QueryWrapper<SurveyTestVO> queryWrapper = new QueryWrapper<>();
.concat(surveyTestVO.getPlanName()) List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(RequestUtil.getDeptIndex()).getData();
.concat("普测计划,由负责人") if(CollectionUtil.isEmpty(deptIds)){
.concat(surveyTestVO.getCompleteBy()) return todoVOList;
.concat("测试后,于") }
.concat(LocalDateTimeUtil.format(surveyTestVO.getCompleteTime(), DatePattern.CHINESE_DATE_PATTERN)) queryWrapper.in("supervision_survey_test.dept_id", deptIds)
.concat("完成变电站电能质量测试,") .eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
.concat("在本次普测计划测试中存在电能质量问题,详细请查看问题附件"); .eq("supervision_survey_test.status", BpmProcessInstanceStatusEnum.AWAIT.getStatus())
.orderByDesc("supervision_survey_test.Update_Time");
List<SurveyTestVO> surveyTestVOList = this.baseMapper.getTodoBusiness(queryWrapper);
if(CollectionUtil.isNotEmpty(surveyTestVOList)){
todoVOList = surveyTestVOList.stream().map(item -> {
if (item.getCustomSubstationFlag() == 0) {
//关联台账内的变电站名称
String substation = item.getSubstation();
if(StringUtils.isNotEmpty(substation)){
item.setSubstationName(lineFeignClient.getSubstationInfo(substation).getData().getName());
}
} else {
item.setSubstationName(item.getSubstation());
}
TodoVO todoVO = new TodoVO();
todoVO.setTaskName("技术监督测试");
todoVO.setTaskContent(item.getSubstationName());
todoVO.setStartUser(item.getCreateBy());
todoVO.setId(item.getId());
todoVO.setTaskCreateTime(item.getCreateTime());
todoVO.setSource(3);
todoVO.setRoutePath("supervision/harmonicmanagement");
todoVO.setTabValue(2);
return todoVO;
}).collect(Collectors.toList());
}
return todoVOList;
} }
} }