Commit c44d450c authored by 刘林's avatar 刘林

fix(jg):个人气瓶登记单监管业务登记管理不显示单子,工作台撤回后在提交报错设备设备正在流程中

parent 20a25685
......@@ -67,16 +67,9 @@ public class JgInstallationNoticeController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新安装告知", notes = "根据sequenceNbr更新安装告知")
public ResponseModel<JgInstallationNoticeDto> updateBySequenceNbrJgInstallationNotice(@RequestParam String submitType, @RequestBody Map<String, Object> model, @RequestParam(value = "op", required = false) String op) {
JgInstallationNoticeDto installationInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("installationInfo")), JgInstallationNoticeDto.class, true);
// installationInfo.setEquList(((LinkedHashMap<?, ?>) model.get("installationInfo")).get("equListDesc").toString());
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空");
}
Object o = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("proxyStatementAttachment");
Object o1 = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("installContractAttachment");
Object o2 = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("otherAccessories");
installationInfo.setProxyStatementAttachmentList((List<Map<String, Object>>) o);
installationInfo.setInstallContractAttachmentList((List<Map<String, Object>>) o1);
installationInfo.setOtherAccessoriesList((List<Map<String, Object>>) o2);
return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateInstallationNotice(submitType, installationInfo, op));
}
......
......@@ -227,7 +227,10 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
map.put("SEQUENCE_NBR", jsonObject.get("sequenceNbr"));
equipList.add(map);
}
this.repeatUsedEquipCheck(equipList, reginParams.getCompany().getCompanyCode());
this.repeatUsedEquipCheck(equipList,
CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] :
reginParams.getCompany().getCompanyCode());
}
List<ProcessTaskDTO> processTasks = new ArrayList<>();
// 判断当前是否为提交
......@@ -443,7 +446,10 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
equipList.add(map);
}
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
this.repeatUsedEquipCheck(equipList, reginParams.getCompany().getCompanyCode());
this.repeatUsedEquipCheck(equipList,
CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] :
reginParams.getCompany().getCompanyCode());
}
if ("1".equals(submitType)) {
//发起流程
......@@ -1052,4 +1058,4 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
SortVo sortMap = commonService.sortFieldConversion(sort);
return this.baseMapper.getListPage(page, sortMap, dto, roleIds, companyCode, RequestContext.getExeUserId());
}
}
\ No newline at end of file
}
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
......@@ -161,9 +162,12 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
}
private void checkForRepeatUsedEquip(JSONObject map, String equId, ReginParams reginParams) {
CompanyBo company = reginParams.getCompany();
if (!ObjectUtils.isEmpty(map.get("submit"))) {
EquipUsedCheckStrategyContext.getUsedStrategy(BUSINESS_TYPE_KEY)
.equipRepeatUsedCheck(equId, reginParams.getCompany().getCompanyCode());
.equipRepeatUsedCheck(equId, CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode());
}
}
......@@ -187,6 +191,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
public List<Map<String, Object>> save(JSONObject map) {
try {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String companyCode = CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] : reginParams.getCompany().getCompanyCode();
UseInfo useInfo = new UseInfo();
String equipId = map.get("record").toString();
LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda();
......@@ -201,7 +207,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
String supervisoryCode = otherInfo.getSupervisoryCode();
jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode);
jgChangeRegistrationReform.setUseUnitName(ObjectUtils.isEmpty(useInfo.getUseUnitName()) ? reginParams.getCompany().getCompanyName() : useInfo.getUseUnitName());
jgChangeRegistrationReform.setUseUnitCreditCode(ObjectUtils.isEmpty(useInfo.getUseUnitCreditCode()) ? reginParams.getCompany().getCompanyCode() : useInfo.getUseUnitCreditCode());
jgChangeRegistrationReform.setUseUnitCreditCode(ObjectUtils.isEmpty(useInfo.getUseUnitCreditCode()) ? companyCode : useInfo.getUseUnitCreditCode());
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) {
jgChangeRegistrationReform.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories")));
}
......@@ -213,11 +219,11 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setRenovationSupervisioninspectionCertificate(JSONObject.toJSONString(map.get("renovationSupervisioninspectionCertificate")));
}
// 使用单位提交
jgChangeRegistrationReform.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
jgChangeRegistrationReform.setUseUnitCreditCode(companyCode);
if (!ObjectUtils.isEmpty(map.get("inspectUnitCreditCode"))) {
jgChangeRegistrationReform.setInspectUnitCreditCode(map.get("inspectUnitCreditCode").toString());
} else {
jgChangeRegistrationReform.setInspectUnitCreditCode(reginParams.getCompany().getCompanyCode());
jgChangeRegistrationReform.setInspectUnitCreditCode(companyCode);
}
if (!ObjectUtils.isEmpty(map.get("inspectOrgName"))) {
jgChangeRegistrationReform.setInspectUnitName(map.get("inspectOrgName").toString());
......
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.common.StringUtil;
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.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
......@@ -181,7 +182,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
if ("1".equals(submitType)) {
this.repeatUsedEquipCheck(registrationIdList, reginParams.getCompany().getCompanyCode());
this.repeatUsedEquipCheck(registrationIdList,
CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] :
reginParams.getCompany().getCompanyCode());
}
//查询证下的设备
......@@ -264,7 +268,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//注册登记日期
oldTransfer.setRegDate(new Date());
//使用机构
oldTransfer.setUseUnitCreditCode(company.getCompanyCode());
oldTransfer.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] : company.getCompanyCode());
oldTransfer.setUseUnitName(company.getCompanyName());
//录入单位统一信用代码
oldTransfer.setInputUnitNo(company.getCompanyCode());
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
......@@ -394,8 +395,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
deviceList.forEach(jsonObject -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.equipRepeatUsedCheck(String.valueOf(jsonObject.get("SEQUENCE_NBR")), reginParams.getCompany().getCompanyCode()));
.equipRepeatUsedCheck(String.valueOf(jsonObject.get("SEQUENCE_NBR")),
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
return noticeDto;
}
......@@ -415,8 +420,10 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
JgChangeRegistrationUnitDto model,
String type,
ReginParams reginParams) {
String orgCode;
orgCode = reginParams.getCompany().getCompanyCode();
String orgCode = reginParams.getCompany().getCompanyCode();
if (CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType())) {
orgCode = reginParams.getCompany().getCompanyCode().split("_")[1];
}
String companyType = reginParams.getCompany().getCompanyType();
String currentUserId = reginParams.getUserModel().getUserId();
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
......@@ -603,7 +610,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
model.setStatus(taskName[0]);
}
model.setNewUseUnitName(reginParams.getCompany().getCompanyName());
model.setNewUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
model.setNewUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] :
reginParams.getCompany().getCompanyCode());
if (!CollectionUtils.isEmpty(nextExecutorUserIds)) {
model.setNextExecuteUserIds(nextExecutorUserIds.get(0));
}
......@@ -702,8 +711,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
deviceList.forEach(jsonObject -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.equipRepeatUsedCheck(String.valueOf(jsonObject.get("SEQUENCE_NBR")), reginParams.getCompany().getCompanyCode()));
.equipRepeatUsedCheck(String.valueOf(jsonObject.get("SEQUENCE_NBR")),
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
return Collections.singletonList(model);
}
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
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.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -14,6 +15,7 @@ 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.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
......@@ -141,7 +143,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
// 设备列表
List<Map<String, Object>> equipments = (List<Map<String, Object>>) map.get("equipments");
if (SUBMIT_TYPE_FLOW.equals(submit)) {// 校验设备不能再多个流程中
this.repeatUsedEquipCheck(equipments, reginParams.getCompany().getCompanyCode());
CompanyBo company = reginParams.getCompany();
this.repeatUsedEquipCheck(equipments,
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode());
}
String businessCode = ObjectUtils.isEmpty(map.get("applyType")) ? String.valueOf(map.get("businessCode")) : String.valueOf(map.get("applyType"));
// 接收机构
......
......@@ -154,14 +154,17 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this.saveOrUpdateHisDataBatch(jgEquipTransferEqList);
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
jgEquipTransferEqList.forEach(equipTransferEq -> EquipUsedCheckStrategyContext.getUsedStrategy(EQUIP_TRANSFER_PROCESS_KEY)
.equipRepeatUsedCheck(equipTransferEq.getEquId(), reginParams.getCompany().getCompanyCode()));
.equipRepeatUsedCheck(equipTransferEq.getEquId(), CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
return transferList;
}
/**
* 删除 redis校验重复引用设备的数据
* 删除redis校验重复引用设备的数据
*/
private void delRepeatUseEquipData(Long id, String status, String companyCode) {
List<JgEquipTransferEq> list = equipTransferEqService.lambdaQuery().eq(JgEquipTransferEq::getEquipTransferId, id).list();
......@@ -406,8 +409,11 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this.saveOrUpdateHisDataBatch(jgEquipTransferEqList);
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
jgEquipTransferEqList.forEach(equipTransferEq -> EquipUsedCheckStrategyContext.getUsedStrategy(EQUIP_TRANSFER_PROCESS_KEY)
.equipRepeatUsedCheck(equipTransferEq.getEquId(), reginParams.getCompany().getCompanyCode()));
.equipRepeatUsedCheck(equipTransferEq.getEquId(), CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
return equipTransferDto;
}
......
......@@ -145,12 +145,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
AmosRequestContext amosRequestContext;
@Autowired
private Sequence sequence;
@Autowired
CodeUtil codeUtil;
@Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
JgCertificateChangeRecordServiceImpl certificateChangeRecordService;
@Autowired
JgCertificateChangeRecordEqServiceImpl certificateChangeRecordEqService;
@Autowired
private Sequence sequence;
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired
private ProduceInfoMapper produceInfoMapper;
......@@ -177,12 +181,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired
JgCertificateChangeRecordServiceImpl certificateChangeRecordService;
@Autowired
JgCertificateChangeRecordEqServiceImpl certificateChangeRecordEqService;
@Autowired
private IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
@Autowired
......@@ -190,6 +188,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
private EquipTechParamPipelineMapper equipTechParamPipelineMapper;
/**
* 根据sequenceNbr查询
*
......@@ -209,11 +208,11 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("city", notice.getCity() + "_" + notice.getCityName());
installationInfo.put("county", notice.getCounty() + "_" + notice.getCountyName());
// 处理安装负责人-详情
if (!ObjectUtils.isEmpty(installationInfo.get("installLeaderName"))){
if (!ObjectUtils.isEmpty(installationInfo.get("installLeaderName"))) {
installationInfo.put("installLeaderName", installationInfo.get("installLeaderName"));
}
// 处理设备类型
if (!ObjectUtils.isEmpty(installationInfo.get("equCategoryCode"))){
if (!ObjectUtils.isEmpty(installationInfo.get("equCategoryCode"))) {
installationInfo.put("EQU_CATEGORY_CODE", installationInfo.get("equCategoryCode"));
}
// 处理设备筛选默认值
......@@ -327,7 +326,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private Map<String, Object> setNewEquipData(String companyLevel, Map<String, Object> installationInfo) {
LambdaQueryWrapper<JgInstallationNoticeEq> lambda = new QueryWrapper<JgInstallationNoticeEq>().lambda();
lambda.eq(JgInstallationNoticeEq::getEquipTransferId,installationInfo.get("sequenceNbr"));
lambda.eq(JgInstallationNoticeEq::getEquipTransferId, installationInfo.get("sequenceNbr"));
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda);
List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
......@@ -484,7 +483,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
lambda.eq(JgInstallationNoticeEq::getEquipTransferId, noticeDto.getSequenceNbr());
jgInstallationNoticeEqMapper.delete(lambda);
ArrayList<JgInstallationNoticeEq> jgInstallationNoticeEqs = new ArrayList<>();
noticeDto.getDeviceList().forEach(item->{
noticeDto.getDeviceList().forEach(item -> {
JgInstallationNoticeEq jgInstallationNoticeEq = new JgInstallationNoticeEq();
jgInstallationNoticeEq.setEquId(String.valueOf(item.get("SEQUENCE_NBR")));
jgInstallationNoticeEq.setEquCategoryCode(String.valueOf(item.get("EQU_CATEGORY_CODE")));
......@@ -594,7 +593,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list();
HashMap<String, Object> map = new HashMap<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>();
equList.forEach(equ ->{
equList.forEach(equ -> {
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equ.getSequenceNbr());
if (Objects.isNull(jgInstallationNotice) || CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("安装告知单不存在");
......@@ -765,7 +764,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
BeanUtils.copyProperties(obj, taskMessageDto);
dto.setModel(taskMessageDto);
// 摘要 按原有规则组装
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】",obj.getEquList(), obj.getApplyNo()));
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", obj.getEquList(), obj.getApplyNo()));
// 申请单号
dto.setTaskCode(obj.getApplyNo());
// 业务类型枚举code值
......@@ -798,7 +797,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskModelDto.setStartUserCompanyName(item.getCreateUserCompanyName()); // 任务发起人所在单位
taskModelDto.setStartDate(item.getCreateDate());
taskModelDto.setNextExecuteUser(item.getNextExecuteIds());
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】",item.getEquList(), item.getApplyNo()));
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()));
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(item, taskMessageDto);
taskModelDto.setModel(taskMessageDto);
......@@ -813,42 +812,42 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void businessData(String submitType, ReginParams reginParams, JgInstallationNoticeDto model, List<Map<String, Object>> deviceList, List<String> applyNoList, List<JgInstallationNotice> list, List<JgInstallationNoticeEq> equipList, List<WorkflowResultDto> workflowResultList) {
CompanyBo companyBo = commonService.getOneCompany(model.getReceiveOrgCreditCode());
JgInstallationNotice dto = new JgInstallationNotice();
BeanUtils.copyProperties(model, dto);
JgInstallationNotice dto = new JgInstallationNotice();
BeanUtils.copyProperties(model, dto);
// int i = deviceList.indexOf(obj);
String applyNo = applyNoList.get(0);
dto.setApplyNo(applyNo);
dto.setNoticeDate(new Date());
// 统计使用
dto.setReceiveCompanyOrgCode(companyBo.getOrgCode());
dto.setEquList(String.valueOf(deviceList.get(0).get("EQU_LIST")));
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
dto.setNextExecuteIds(workflowResultList.get(0).getNextExecutorRoleIds());
dto.setNextExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds());
dto.setInstanceStatus(workflowResultList.get(0).getNextExecutorRoleIds() + "," + workflowResultList.get(0).getExecutorRoleIds());
dto.setPromoter(reginParams.getUserModel().getUserId());
dto.setNextTaskId(workflowResultList.get(0).getNextTaskId());
} else {
dto.setNextExecuteUserIds(reginParams.getUserModel().getUserId());
}
dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
String applyNo = applyNoList.get(0);
dto.setApplyNo(applyNo);
dto.setNoticeDate(new Date());
// 统计使用
dto.setReceiveCompanyOrgCode(companyBo.getOrgCode());
dto.setEquList(String.valueOf(deviceList.get(0).get("EQU_LIST")));
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
dto.setNextExecuteIds(workflowResultList.get(0).getNextExecutorRoleIds());
dto.setNextExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds());
dto.setInstanceStatus(workflowResultList.get(0).getNextExecutorRoleIds() + "," + workflowResultList.get(0).getExecutorRoleIds());
dto.setPromoter(reginParams.getUserModel().getUserId());
dto.setNextTaskId(workflowResultList.get(0).getNextTaskId());
} else {
dto.setNextExecuteUserIds(reginParams.getUserModel().getUserId());
}
dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
// dto.setEquList((String.valueOf(obj.get("EQU_LIST"))));
dto.setEntrustingUnitName(dto.getUseUnitName());
dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
dto.setEntrustingUnitName(dto.getUseUnitName());
dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
// dto.setEquRegisterCode(String.valueOf(obj.get("EQU_CODE")));
// dto.setFactoryNum(String.valueOf(obj.get("FACTORY_NUM")));
if (!CollectionUtils.isEmpty(workflowResultList)) {
dto.setInstanceId(workflowResultList.get(0).getInstanceId());
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
} else {
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode()));
}
dto.setCreateUserName(reginParams.getUserModel().getRealName());
dto.setCreateUserId(reginParams.getUserModel().getUserId());
if (!CollectionUtils.isEmpty(workflowResultList)) {
dto.setInstanceId(workflowResultList.get(0).getInstanceId());
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
} else {
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode()));
}
dto.setCreateUserName(reginParams.getUserModel().getRealName());
dto.setCreateUserId(reginParams.getUserModel().getUserId());
// dto.setEquAddress(obj.getOrDefault("ADDRESS", "").toString());
list.add(dto);
list.add(dto);
deviceList.forEach(obj -> {
JgInstallationNoticeEq jgRelationEquip = new JgInstallationNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
......@@ -872,12 +871,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>();
// deviceList.forEach(item -> {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
// dto.setBusinessKey(item.get("SEQUENCE_NBR").toString());
dto.setCompleteFirstTask(Boolean.TRUE);
dto.setNextExecuteUserCompanyCode(receiveOrgCreditCode);
list.add(dto);
dto.setCompleteFirstTask(Boolean.TRUE);
dto.setNextExecuteUserCompanyCode(receiveOrgCreditCode);
list.add(dto);
// });
actWorkflowBatchDTO.setProcess(list);
List<ProcessTaskDTO> processTaskDTOS = iCmWorkflowService.startBatch(actWorkflowBatchDTO);
......@@ -1106,93 +1105,93 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskMap.put("model", taskMessageDto);
TaskV2Model taskV2Model1 = commonService.updateTaskModel(taskMap);
String finalYm = ym;
jgRelationEquips.forEach(jgRelationEquip ->{
LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OtherInfo::getRecord, jgRelationEquip.getEquId());
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
LambdaQueryWrapper<IdxBizJgRegisterInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(IdxBizJgRegisterInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgRegisterInfo idxBizJgRegisterInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
String equCode = Optional.ofNullable(idxBizJgRegisterInfo.getEquDefine())
.orElse(idxBizJgRegisterInfo.getEquCategory());
String registrationCode = equCode + jgInstallationNotice.getReceiveOrgCreditCode() + finalYm;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
String deviceRegistrationCode = responseModel.getResult();
Map<String, Object> map = new HashMap<>();
map.put("code96333", tzsJgOtherInfo.getCode96333());
map.put("superviseCode", tzsJgOtherInfo.getSupervisoryCode());
map.put("cityCode", jgInstallationNotice.getCity());
map.put("countyCode", jgInstallationNotice.getCounty());
map.put("equCategory", idxBizJgRegisterInfo.getEquCategory());
map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1");
Map<String, Object> mapCode;
ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
mapCode = code.getResult();
supervisoryCodeInfoMapper.updateStatusBySuperviseCode(mapCode.get("superviseCode").toString());
jgInstallationNotice.setHandleDate(new Date());
// jgInstallationNotice.setInformNumber(deviceRegistrationCode);
jgRelationEquip.setInformNumber(deviceRegistrationCode);
jgInstallationNotice.setSupervisoryCode(mapCode.get("superviseCode").toString());
jgInstallationNotice.setPromoter("");
Map<String, Object> map1 = new HashMap<>();
// 更新其他业务表
if (!ValidationUtil.isEmpty(mapCode.get("code96333"))) {
tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
map1.put("CODE96333", tzsJgOtherInfo.getCode96333());
}
tzsJgOtherInfo.setSupervisoryCode(mapCode.get("superviseCode").toString());
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
// 更新设备监管部门信息
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda()
.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName());
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
}
jgRelationEquips.forEach(jgRelationEquip -> {
LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OtherInfo::getRecord, jgRelationEquip.getEquId());
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
LambdaQueryWrapper<IdxBizJgRegisterInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(IdxBizJgRegisterInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgRegisterInfo idxBizJgRegisterInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
String equCode = Optional.ofNullable(idxBizJgRegisterInfo.getEquDefine())
.orElse(idxBizJgRegisterInfo.getEquCategory());
String registrationCode = equCode + jgInstallationNotice.getReceiveOrgCreditCode() + finalYm;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
String deviceRegistrationCode = responseModel.getResult();
Map<String, Object> map = new HashMap<>();
map.put("code96333", tzsJgOtherInfo.getCode96333());
map.put("superviseCode", tzsJgOtherInfo.getSupervisoryCode());
map.put("cityCode", jgInstallationNotice.getCity());
map.put("countyCode", jgInstallationNotice.getCounty());
map.put("equCategory", idxBizJgRegisterInfo.getEquCategory());
map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1");
Map<String, Object> mapCode;
ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
mapCode = code.getResult();
supervisoryCodeInfoMapper.updateStatusBySuperviseCode(mapCode.get("superviseCode").toString());
jgInstallationNotice.setHandleDate(new Date());
//jgInstallationNotice.setInformNumber(deviceRegistrationCode);
jgRelationEquip.setInformNumber(deviceRegistrationCode);
jgInstallationNotice.setSupervisoryCode(mapCode.get("superviseCode").toString());
jgInstallationNotice.setPromoter("");
Map<String, Object> map1 = new HashMap<>();
// 更新其他业务表
if (!ValidationUtil.isEmpty(mapCode.get("code96333"))) {
tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
map1.put("CODE96333", tzsJgOtherInfo.getCode96333());
}
tzsJgOtherInfo.setSupervisoryCode(mapCode.get("superviseCode").toString());
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
// 更新设备监管部门信息
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda()
.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName());
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
}
// 生成设备代码及更新历史表的的设备代码字段
this.justGenerateEquCode(idxBizJgRegisterInfo, jgInstallationNotice.getReceiveOrgCreditCode(), jgInstallationNotice);
tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo);
// 更新es
updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, map1, dto);
// 记录施工信息表
createConstruction2Db(jgInstallationNotice, jgRelationEquip);
// 更新使用信息
updateJgUseInfo(jgInstallationNotice, jgRelationEquip);
// 生成证记录表主键
long certChangeSeq = sequence.nextId();
// 生成jg证书变更记录
genJgCertificateChangeRecord(jgInstallationNotice,certChangeSeq, registrationCode, idxBizJgRegisterInfo, taskV2Model1);
// 查询设备制造信息
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>();
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper);
// 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq();
changeRecordEq.setChangeRecordId(String.valueOf(certChangeSeq));//登记证记录主键
changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum());
certificateChangeRecordEqService.save(changeRecordEq);
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(jgInstallationNotice.getSequenceNbr() + "")
.equId(jgRelationEquip.getEquId())
.approvalUnit(jgInstallationNotice.getReceiveOrgName())
.approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
.status("正常")
.routePath(taskV2Model1.getRoutePath())
.build());
// 生成设备代码及更新历史表的的设备代码字段
this.justGenerateEquCode(idxBizJgRegisterInfo, jgInstallationNotice.getReceiveOrgCreditCode(), jgInstallationNotice);
tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo);
// 更新es
updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, map1, dto);
// 记录施工信息表
createConstruction2Db(jgInstallationNotice, jgRelationEquip);
// 更新使用信息
updateJgUseInfo(jgInstallationNotice, jgRelationEquip);
// 生成证记录表主键
long certChangeSeq = sequence.nextId();
// 生成jg证书变更记录
genJgCertificateChangeRecord(jgInstallationNotice, certChangeSeq, registrationCode, idxBizJgRegisterInfo, taskV2Model1);
// 查询设备制造信息
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>();
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper);
// 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq();
changeRecordEq.setChangeRecordId(String.valueOf(certChangeSeq));//登记证记录主键
changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum());
certificateChangeRecordEqService.save(changeRecordEq);
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(jgInstallationNotice.getSequenceNbr() + "")
.equId(jgRelationEquip.getEquId())
.approvalUnit(jgInstallationNotice.getReceiveOrgName())
.approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
.status("正常")
.routePath(taskV2Model1.getRoutePath())
.build());
});
// 更新关联设备表
jgInstallationNoticeEqService.updateBatchById(jgRelationEquips);
......@@ -1269,7 +1268,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
public void genJgCertificateChangeRecord(JgInstallationNotice jgInstallationNotice,Long sequenceNbr, String registrationCode, IdxBizJgRegisterInfo idxBizJgRegisterInfo, TaskV2Model taskV2Model1) {
public void genJgCertificateChangeRecord(JgInstallationNotice jgInstallationNotice, Long sequenceNbr, String registrationCode, IdxBizJgRegisterInfo idxBizJgRegisterInfo, TaskV2Model taskV2Model1) {
// 生成一条tzs_jg_certificate_change_record记录
JgCertificateChangeRecord jgCertificateChangeRecord = new JgCertificateChangeRecord();
jgCertificateChangeRecord.setApplyNo(jgInstallationNotice.getApplyNo());
......@@ -1326,7 +1325,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
map1.put("USC_UNIT_CREDIT_CODE", "");
map1.put("USC_UNIT_NAME", "");
map1.put("USE_PLACE", String.format("%s/%s/%s/%s", jgInstallationNotice.getProvinceName(), jgInstallationNotice.getCityName(), jgInstallationNotice.getCountyName(), jgInstallationNotice.getStreetName()));
map1.put("ADDRESS",jgInstallationNotice.getAddress());
map1.put("ADDRESS", jgInstallationNotice.getAddress());
objMap.put(tzsJgOtherInfo.getRecord(), map1);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
......@@ -1334,7 +1333,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private String buildRecordContent(JgInstallationNotice obj) {
//张三办理了【单位变更】 ,单号【DWBG202407050001】,办理日期2024-07-05
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
return obj.getCreateUserName() + "办理了【"+BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName()+"】,单号【"
return obj.getCreateUserName() + "办理了【" + BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName() + "】,单号【"
+ obj.getApplyNo() + "】,申请日期" + simpleDateFormat.format(obj.getCreateDate());
}
......@@ -1578,22 +1577,22 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr());
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(queryWrapper);
jgInstallationNoticeEqs.forEach(jgRelationEquip ->{
// 强制更新字段为 NULL
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, jgRelationEquip.getEquId()); // 设置更新条件
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, null);
updateWrapper.set(IdxBizJgUseInfo::getUseUnitName, null);
useInfoService.update(updateWrapper);
// 2.2 es的USE_UNIT_CREDIT_CODE赋空
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(jgRelationEquip.getEquId());
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setUSE_UNIT_CREDIT_CODE(null);
esEquipmentCategoryDto.setUSE_UNIT_NAME(null);
esEquipmentCategory.save(esEquipmentCategoryDto);
}
});
jgInstallationNoticeEqs.forEach(jgRelationEquip -> {
// 强制更新字段为 NULL
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, jgRelationEquip.getEquId()); // 设置更新条件
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, null);
updateWrapper.set(IdxBizJgUseInfo::getUseUnitName, null);
useInfoService.update(updateWrapper);
// 2.2 es的USE_UNIT_CREDIT_CODE赋空
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(jgRelationEquip.getEquId());
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setUSE_UNIT_CREDIT_CODE(null);
esEquipmentCategoryDto.setUSE_UNIT_NAME(null);
esEquipmentCategory.save(esEquipmentCategoryDto);
}
});
}
@Transactional
......@@ -1602,12 +1601,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNotice> list = this.lambdaQuery().list();
ArrayList<JgInstallationNoticeEq> jgInstallationNoticeEqs = new ArrayList<>();
ArrayList<JgRegistrationHistory> jgRegistrationHistories = new ArrayList<>();
list.forEach(item ->{
list.forEach(item -> {
// 设备信息
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, item.getSequenceNbr()).list();
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.lambdaQuery().eq(JgRegistrationHistory::getCurrentDocumentId, item.getSequenceNbr()).one();
if (!ObjectUtils.isEmpty(jgRegistrationHistory) && !ObjectUtils.isEmpty(jgRegistrationHistory.getChangeData())){
List<String> ids = equList.stream().map(a -> a.getEquId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(jgRegistrationHistory) && !ObjectUtils.isEmpty(jgRegistrationHistory.getChangeData())) {
List<String> ids = equList.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips);
JSONObject object = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
......@@ -1615,22 +1614,22 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgRegistrationHistory.setChangeData(JSONObject.toJSONString(object));
jgRegistrationHistories.add(jgRegistrationHistory);
}
equList.forEach(equ->{
if (!ObjectUtils.isEmpty(item.getInformNumber())){
equList.forEach(equ -> {
if (!ObjectUtils.isEmpty(item.getInformNumber())) {
equ.setInformNumber(item.getInformNumber());
}
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoService.lambdaQuery().eq(IdxBizJgRegisterInfo::getRecord, equ.getEquId()).one();
if (!ObjectUtils.isEmpty(registerInfo) && !ObjectUtils.isEmpty(registerInfo.getEquList()) && !ObjectUtils.isEmpty(registerInfo.getEquCategory())){
if (!ObjectUtils.isEmpty(registerInfo) && !ObjectUtils.isEmpty(registerInfo.getEquList()) && !ObjectUtils.isEmpty(registerInfo.getEquCategory())) {
equ.setEquListCode(registerInfo.getEquList());
equ.setEquCategoryCode(registerInfo.getEquCategory());
if (ObjectUtils.isEmpty(item.getEquListCode()) || ObjectUtils.isEmpty(item.getEquCategoryCode())){
if (ObjectUtils.isEmpty(item.getEquListCode()) || ObjectUtils.isEmpty(item.getEquCategoryCode())) {
item.setEquListCode(registerInfo.getEquList());
item.setEquCategoryCode(registerInfo.getEquCategory());
if ("8300".equals(item.getEquCategoryCode())){
if ("8300".equals(item.getEquCategoryCode())) {
LambdaQueryWrapper<EquipTechParamPipeline> lambda = new QueryWrapper<EquipTechParamPipeline>().lambda();
lambda.eq(EquipTechParamPipeline::getRecord, equ.getEquId());
EquipTechParamPipeline equipTechParamPipeline = equipTechParamPipelineMapper.selectOne(lambda);
if (!ObjectUtils.isEmpty(equipTechParamPipeline) && !ObjectUtils.isEmpty(equipTechParamPipeline.getDeviceName())){
if (!ObjectUtils.isEmpty(equipTechParamPipeline) && !ObjectUtils.isEmpty(equipTechParamPipeline.getDeviceName())) {
item.setProjectContraption(equipTechParamPipeline.getDeviceName());
}
}
......
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
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.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
......@@ -133,7 +134,11 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
public Page<JgScrapCancelDto> getList(JgScrapCancelDto dto, String sort, Page<JgScrapCancelDto> page, List<String> roleIds) {
ReginParams reginParams = this.getSelectedOrgInfo();
String orgCode = reginParams.getCompany().getCompanyCode();
CompanyBo company = reginParams.getCompany();
String orgCode = company.getCompanyCode();
if (CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType())) {
orgCode = company.getCompanyCode().split("_")[1];
}
dto.setCreateUserId(reginParams.getUserModel().getUserId());
String currentUserId = reginParams.getUserModel().getUserId();
SortVo sortMap = commonService.sortFieldConversion(sort);
......@@ -215,8 +220,12 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
// 判断当前是否为提交
List<WorkflowResultDto> workflowResultDtos = null;
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
CompanyBo company = reginParams.getCompany();
List<JgScrapCancelEq> JgScrapCancelEqList = getCancelEqs(noticeParams);
this.repeatUsedEquipCheck(JgScrapCancelEqList, reginParams.getCompany().getCompanyCode());
this.repeatUsedEquipCheck(JgScrapCancelEqList,
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode());
// 发起流程
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>();
......@@ -256,7 +265,9 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
} else {
jgScrapCancel.setAuditStatus(String.valueOf(WorkFlowStatusEnum.CANCEL_SUBMIT.getPass()));
}
jgScrapCancel.setUseUnitCode(reginParams.getCompany().getCompanyCode());
jgScrapCancel.setUseUnitCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(reginParams.getCompany().getCompanyType()) ?
reginParams.getCompany().getCompanyCode().split("_")[1] :
reginParams.getCompany().getCompanyCode());
jgScrapCancel.setUseUnitName(reginParams.getCompany().getCompanyName());
jgScrapCancel.setCreateUserId(RequestContext.getExeUserId());
this.setUseRegisterInfo(jgScrapCancel, noticeParams);
......@@ -521,8 +532,11 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
List<String> roleListAll = new ArrayList<>();
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
List<JgScrapCancelEq> JgScrapCancelEqList = getCancelEqs(pageData);
this.repeatUsedEquipCheck(JgScrapCancelEqList, reginParams.getCompany().getCompanyCode());
this.repeatUsedEquipCheck(JgScrapCancelEqList, CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode());
// 更新并提交
// 发起流程
if (!StringUtils.hasText(jgScrapCancelDto.getInstanceId())) {
......
......@@ -627,7 +627,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private void checkForRepeatUsedEquip(JSONObject map, CompanyBo company) {
if (!ObjectUtils.isEmpty(map.get("submit"))) {
// 流程中或已完成
EquipUsedCheckStrategyContext.getUsedStrategy(DEFINITION_KEY).equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode());
EquipUsedCheckStrategyContext.getUsedStrategy(DEFINITION_KEY).equipRepeatUsedCheck(map.get("equipId").toString(),
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? company.getCompanyCode().split("_")[1] : company.getCompanyCode());
}
}
......@@ -676,7 +677,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (CylinderTypeEnum.CYLINDER.getCode().equals(map.get("EQU_CATEGORY_CODE"))) {
boolean hasExistingCertificate = this.baseMapper.selectList(
new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getUseUnitCreditCode, company.getCompanyCode())
.eq(JgUseRegistration::getUseUnitCreditCode, CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] : company.getCompanyCode())
.eq(JgUseRegistration::getIsDelete, false)
.eq(JgUseRegistration::getStatus, "已完成")
).stream().anyMatch(v -> !ObjectUtils.isEmpty(v.getUseRegistrationCode()) && v.getUseRegistrationCode().contains("瓶30"));
......
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