Commit 1f98e347 authored by suhuiguang's avatar suhuiguang

feat(jg): 压力管道后续业务

1.启用停用代码提交
parent 66e9c6fe
...@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,8 +5,6 @@ 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.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
...@@ -14,9 +12,9 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; ...@@ -14,9 +12,9 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -31,13 +29,11 @@ import java.util.Map; ...@@ -31,13 +29,11 @@ import java.util.Map;
@RestController @RestController
@Api(tags = "Api") @Api(tags = "Api")
@RequestMapping(value = "/jg-enable-disable") @RequestMapping(value = "/jg-enable-disable")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class JgEnableDisableController extends BaseController { public class JgEnableDisableController extends BaseController {
@Autowired
JgEnableDisableServiceImpl jgEnableDisableServiceImpl;
@Autowired private final JgEnableDisableServiceImpl jgEnableDisableServiceImpl;
RedisUtils redisUtils;
/** /**
* 新增 * 新增
...@@ -48,7 +44,7 @@ public class JgEnableDisableController extends BaseController { ...@@ -48,7 +44,7 @@ public class JgEnableDisableController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<Object> save(@RequestBody JSONObject map) { public ResponseModel<Object> save(@RequestBody JSONObject map) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.saveOrUpdate(map, reginParams)); return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.saveOrUpdate(map, reginParams));
} }
...@@ -64,7 +60,7 @@ public class JgEnableDisableController extends BaseController { ...@@ -64,7 +60,7 @@ public class JgEnableDisableController extends BaseController {
Page<Map<String, Object>> page = new Page<>(); Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.pageList(page, sort, dto, client)); return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.pageList(page, sort, dto, client, getSelectedOrgInfo()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -75,7 +71,7 @@ public class JgEnableDisableController extends BaseController { ...@@ -75,7 +71,7 @@ public class JgEnableDisableController extends BaseController {
String.valueOf(map.get("instanceId")), String.valueOf(map.get("instanceId")),
String.valueOf(map.get("operate")), String.valueOf(map.get("operate")),
String.valueOf(map.get("comment")), String.valueOf(map.get("comment")),
String.valueOf(map.get("nextTaskId"))); String.valueOf(map.get("nextTaskId")), getSelectedOrgInfo());
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
......
...@@ -9,22 +9,27 @@ import com.alibaba.fastjson.JSONObject; ...@@ -9,22 +9,27 @@ import com.alibaba.fastjson.JSONObject;
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;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent; import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService; import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest; import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
...@@ -35,7 +40,6 @@ import com.yeejoin.amos.boot.module.jg.biz.edit.utils.JsonDiffUtil; ...@@ -35,7 +40,6 @@ import com.yeejoin.amos.boot.module.jg.biz.edit.utils.JsonDiffUtil;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher; import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
...@@ -46,7 +50,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; ...@@ -46,7 +50,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.Workflow; import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.*; import com.yeejoin.amos.feign.workflow.model.*;
...@@ -64,6 +67,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -64,6 +67,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -80,8 +84,6 @@ import static java.util.stream.Collectors.toSet; ...@@ -80,8 +84,6 @@ import static java.util.stream.Collectors.toSet;
@Service @Service
public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, JgEnableDisable, JgEnableDisableMapper> implements IJgEnableDisableService, ICompensateFlowDataOfRedis<JgEnableDisable> { public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, JgEnableDisable, JgEnableDisableMapper> implements IJgEnableDisableService, ICompensateFlowDataOfRedis<JgEnableDisable> {
@Autowired
RedisUtils redisUtils;
@Autowired @Autowired
JgEnableDisableEqServiceImpl jgEnableDisableEqService; JgEnableDisableEqServiceImpl jgEnableDisableEqService;
...@@ -91,11 +93,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -91,11 +93,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired @Autowired
TzsServiceFeignClient tzsServiceFeignClient; TzsServiceFeignClient tzsServiceFeignClient;
private final List<String> NOT_FLOWING_STATE = Arrays.asList("待提交", "已驳回", "已撤回", "已作废", "已完成");
private final String PROCESS_DEFINITION_KEY = "deactivateEnable";
private static final String SUBMIT_TYPE_FLOW = "1"; @Autowired
JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired @Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
...@@ -133,19 +133,12 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -133,19 +133,12 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired @Autowired
private ESEquipmentCategory esEquipmentCategory; private ESEquipmentCategory esEquipmentCategory;
/** private final List<String> NOT_FLOWING_STATE = Collections.unmodifiableList(Arrays.asList("待提交", "已驳回", "已撤回", "已作废", "已完成"));
* 设备状态:启用
*/
public static final String APPLY_TYPE_QY = "SB_QY";
/** private final String PROCESS_DEFINITION_KEY = "deactivateEnable";
* 设备状态:启用
*/
public static final String APPLY_TYPE_TY = "SB_TY";
private static final String SUBMIT_TYPE_FLOW = "1";
@Autowired
JgResumeInfoServiceImpl jgResumeInfoService;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) { public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) {
...@@ -246,8 +239,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -246,8 +239,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
} else { } else {
// 启用 选择的设备中有超过定期检验有效期的设备,下次检验日期在当前时间之前的,提示:启用的设备中存在超过定期检验有效期的设备。,不能继续下一步。 // 启用 选择的设备中有超过定期检验有效期的设备,下次检验日期在当前时间之前的,提示:启用的设备中存在超过定期检验有效期的设备。,不能继续下一步。
if (APPLY_TYPE_QY.equals(map.getString("applyType"))) { if (ApplicationFormTypeEnum.SBQY.getBusinessCode().equals(map.getString("applyType"))) {
if(!EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)){ if (!EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)) {
List<String> record = equipments.stream().map(equ -> String.valueOf(equ.get("record"))).collect(Collectors.toList()); List<String> record = equipments.stream().map(equ -> String.valueOf(equ.get("record"))).collect(Collectors.toList());
List<IdxBizJgInspectionDetectionInfo> inspectInfos = jgInspectionDetectionInfoService.checkInspectionInfo(record); List<IdxBizJgInspectionDetectionInfo> inspectInfos = jgInspectionDetectionInfoService.checkInspectionInfo(record);
List<Date> nextInspectDates = inspectInfos.stream().map(IdxBizJgInspectionDetectionInfo::getNextInspectDate).collect(Collectors.toList()); List<Date> nextInspectDates = inspectInfos.stream().map(IdxBizJgInspectionDetectionInfo::getNextInspectDate).collect(Collectors.toList());
...@@ -329,7 +322,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -329,7 +322,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
private void setCertInfoByEquList(JSONObject map, JgEnableDisable jgEnableDisable) { private void setCertInfoByEquList(JSONObject map, JgEnableDisable jgEnableDisable) {
if(!EquipmentClassifityEnum.YLGD.getCode().equals(jgEnableDisable.getEquListCode())) { if (!EquipmentClassifityEnum.YLGD.getCode().equals(jgEnableDisable.getEquListCode())) {
// 使用登记证相关 // 使用登记证相关
List<String> certificates = (List<String>) map.get("sequenceNbrs"); List<String> certificates = (List<String>) map.get("sequenceNbrs");
LambdaQueryWrapper<JgUseRegistrationManage> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgUseRegistrationManage> lambdaQueryWrapper = new LambdaQueryWrapper<>();
...@@ -371,7 +364,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -371,7 +364,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
private String getRegistrationClass(JgEnableDisable jgEnableDisable) { private String getRegistrationClass(JgEnableDisable jgEnableDisable) {
// SB_QY启用,SB_TY停用 // SB_QY启用,SB_TY停用
if (APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())) { if (ApplicationFormTypeEnum.SBQY.getBusinessCode().equals(jgEnableDisable.getApplyType())) {
return BusinessTypeEnum.JG_EQUIPMENT_START.getName(); return BusinessTypeEnum.JG_EQUIPMENT_START.getName();
} else { } else {
return BusinessTypeEnum.JG_EQUIPMENT_STOP.getName(); return BusinessTypeEnum.JG_EQUIPMENT_STOP.getName();
...@@ -463,7 +456,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -463,7 +456,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
private String getRecordKey(String equListCode) { private String getRecordKey(String equListCode) {
if(!EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)) { if (!EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)) {
return "SEQUENCE_NBR"; return "SEQUENCE_NBR";
} else { } else {
return "record"; return "record";
...@@ -514,8 +507,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -514,8 +507,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page, String sort, JgEnableDisableDto dto, String client) { public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page, String sort, JgEnableDisableDto dto, String client, ReginParams reginParams) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if ("company".equals(reginParams.getCompany().getLevel())) { if ("company".equals(reginParams.getCompany().getLevel())) {
dto.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ? dto.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] : reginParams.getCompany().getCompanyCode().split("_")[1] :
...@@ -574,11 +566,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -574,11 +566,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
@Autowired
RegistrationInfoMapper tzsJgRegistrationInfoMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void flowExecute(Long id, String instanceId, String operate, String comment, String nextTaskId) { public void flowExecute(Long id, String instanceId, String operate, String comment, String nextTaskId, ReginParams reginParams) {
String lockKey = CommonServiceImpl.buildJgExecuteLockKey(instanceId); String lockKey = CommonServiceImpl.buildJgExecuteLockKey(instanceId);
RLock lock = redissonClient.getLock(lockKey); RLock lock = redissonClient.getLock(lockKey);
try { try {
...@@ -589,8 +578,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -589,8 +578,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
// 流程执行时,状态及权限校验 // 流程执行时,状态及权限校验
commonService.checkForExecuteFlow(nextTaskId, instanceId); commonService.checkForExecuteFlow(nextTaskId, instanceId);
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
JgEnableDisable jgEnableDisable = this.baseMapper.selectById(id); JgEnableDisable jgEnableDisable = this.baseMapper.selectById(id);
// 执行工作流并返回组装好的工作流信息 // 执行工作流并返回组装好的工作流信息
...@@ -698,7 +685,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -698,7 +685,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr()); queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr());
List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper); List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper);
jgResumeInfoService.saveBatchResume(enableDisableEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgEnableDisable.getApplyNo()) jgResumeInfoService.saveBatchResume(enableDisableEqs.stream().map(eq -> JgResumeInfoDto.builder().applyNo(jgEnableDisable.getApplyNo())
.businessType(getRegistrationClass(jgEnableDisable)) .businessType(getRegistrationClass(jgEnableDisable))
.businessId(String.valueOf(jgEnableDisable.getSequenceNbr())) .businessId(String.valueOf(jgEnableDisable.getSequenceNbr()))
.equId(eq.getEquId()) .equId(eq.getEquId())
...@@ -726,7 +713,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -726,7 +713,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
List<JgEnableDisableEq> jgEnableDisableEqs = jgEnableDisableEqMapper.selectList(lambdaEq); List<JgEnableDisableEq> jgEnableDisableEqs = jgEnableDisableEqMapper.selectList(lambdaEq);
jgEnableDisableEqs.forEach(jgEnableDisableEq -> { jgEnableDisableEqs.forEach(jgEnableDisableEq -> {
IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo(); IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo();
if (APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())) { if (ApplicationFormTypeEnum.SBQY.getBusinessCode().equals(jgEnableDisable.getApplyType())) {
// 1启用 // 1启用
idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.ZAIYONG.getCode())); idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.ZAIYONG.getCode()));
} else { } else {
...@@ -885,16 +872,16 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -885,16 +872,16 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, enableDisable.getSequenceNbr()); queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, enableDisable.getSequenceNbr());
queryWrapper.select(BaseEntity::getSequenceNbr, JgEnableDisableEq::getEquId); queryWrapper.select(BaseEntity::getSequenceNbr, JgEnableDisableEq::getEquId);
List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper).stream().filter(e-> org.apache.commons.lang3.StringUtils.isNotEmpty(e.getEquId())).collect(Collectors.toList()); List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper).stream().filter(e -> org.apache.commons.lang3.StringUtils.isNotEmpty(e.getEquId())).collect(Collectors.toList());
if(!enableDisableEqs.isEmpty()) { if (!enableDisableEqs.isEmpty()) {
List<Map<String,Object>> equipments; List<Map<String, Object>> equipments;
if(!enableDisable.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())){ if (!enableDisable.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())) {
equipments = new ArrayList<>(); equipments = new ArrayList<>();
Iterable<ESEquipmentCategoryDto> equipmentCategoryDtos = esEquipmentCategory.findAllById(enableDisableEqs.stream().map(JgEnableDisableEq::getEquId).collect(Collectors.toList())); Iterable<ESEquipmentCategoryDto> equipmentCategoryDtos = esEquipmentCategory.findAllById(enableDisableEqs.stream().map(JgEnableDisableEq::getEquId).collect(Collectors.toList()));
equipmentCategoryDtos.forEach(dto->{ equipmentCategoryDtos.forEach(dto -> {
Map<String,Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
BeanUtils.copyProperties(dto,item); BeanUtils.copyProperties(dto, item);
BeanUtil.beanToMap(dto,item, true, false); BeanUtil.beanToMap(dto, item, true, false);
item.replaceAll((k, v) -> v == null ? "" : v); item.replaceAll((k, v) -> v == null ? "" : v);
item.put("record", dto.getSEQUENCE_NBR()); item.put("record", dto.getSEQUENCE_NBR());
item.put("equipAddress", concatWithSplit(trimNull2Empty(dto.getUSE_PLACE()), trimNull2Empty(dto.getADDRESS()))); item.put("equipAddress", concatWithSplit(trimNull2Empty(dto.getUSE_PLACE()), trimNull2Empty(dto.getADDRESS())));
...@@ -905,7 +892,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -905,7 +892,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} else { } else {
equipments = this.getBaseMapper().selectPipeLineByRecords(enableDisableEqs.stream().map(JgEnableDisableEq::getEquId).collect(Collectors.toList())); equipments = this.getBaseMapper().selectPipeLineByRecords(enableDisableEqs.stream().map(JgEnableDisableEq::getEquId).collect(Collectors.toList()));
// 检验报告数据格式化 转json // 检验报告数据格式化 转json
equipments.stream().filter(e-> e.get("inspectReport") != null).forEach(item->{ equipments.stream().filter(e -> e.get("inspectReport") != null).forEach(item -> {
item.put("inspectReport", JSON.parse(item.get("inspectReport").toString())); item.put("inspectReport", JSON.parse(item.get("inspectReport").toString()));
}); });
} }
...@@ -925,7 +912,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -925,7 +912,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
return resultMap; return resultMap;
} }
private String concatWithSplit(String ... strs){ private String concatWithSplit(String... strs) {
return Arrays.stream(strs).filter(org.apache.commons.lang3.StringUtils::isNotEmpty).collect(Collectors.joining("/")); return Arrays.stream(strs).filter(org.apache.commons.lang3.StringUtils::isNotEmpty).collect(Collectors.joining("/"));
} }
...@@ -946,7 +933,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -946,7 +933,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Override @Override
public boolean beforeCheck(JgEnableDisable jgEnableDisable) { public boolean beforeCheck(JgEnableDisable jgEnableDisable) {
return jgEnableDisable.getInstanceId() != null && !jgEnableDisable.getAuditStatus().equals(FlowStatusEnum.TO_BE_FINISHED.getName()) &&!jgEnableDisable.getAuditStatus().equals(FlowStatusEnum.TO_BE_DISCARD.getName()); return jgEnableDisable.getInstanceId() != null && !jgEnableDisable.getAuditStatus().equals(FlowStatusEnum.TO_BE_FINISHED.getName()) && !jgEnableDisable.getAuditStatus().equals(FlowStatusEnum.TO_BE_DISCARD.getName());
} }
@Override @Override
...@@ -994,7 +981,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -994,7 +981,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page, String sequenceNbr) { public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page, String sequenceNbr) {
// 兼容个人业务 // 兼容个人业务
if(useUnitCreditCode.contains("_")){ if (useUnitCreditCode.contains("_")) {
useUnitCreditCode = useUnitCreditCode.split("_")[1]; useUnitCreditCode = useUnitCreditCode.split("_")[1];
} }
// 查询流程中的装置 // 查询流程中的装置
...@@ -1003,7 +990,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -1003,7 +990,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
proIds.remove(null); proIds.remove(null);
proIds.remove(""); proIds.remove("");
// 编辑时要有自己 // 编辑时要有自己
if(org.apache.commons.lang3.StringUtils.isNotEmpty(sequenceNbr)){ if (org.apache.commons.lang3.StringUtils.isNotEmpty(sequenceNbr)) {
proIds.remove(sequenceNbr); proIds.remove(sequenceNbr);
} }
return this.getBaseMapper().queryJgProjectContraptionPage(page, useUnitCreditCode, proIds); return this.getBaseMapper().queryJgProjectContraptionPage(page, useUnitCreditCode, proIds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment