Commit b8881008 authored by 刘林's avatar 刘林

fix(jg):超设计使用年限bug修改

parent b2c0bf7e
......@@ -26,5 +26,5 @@ public interface JgOverDesignServiceLifeMapper extends BaseMapper<JgOverDesignSe
@Param("dto") JgOverDesignServiceLifeDto dto,
@Param("orgCode") String orgCode);
List<Map<String, Object>> selectEquipList(@Param("records") List<String> records);
List<Map<String, Object>> selectEquipList(@Param("records") List<String> records, @Param("sequenceNbr") Long sequenceNbr);
}
......@@ -149,7 +149,8 @@
LEFT JOIN idx_biz_jg_factory_info jfi ON jui.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_register_info jri ON jui.RECORD = jri.RECORD
LEFT JOIN tzs_jg_over_design_service_life_eq tjodslq ON jui.RECORD = tjodslq.equ_id
WHERE jui.record IN
WHERE tjodslq.over_design_id = #{sequenceNbr}
AND jui.record IN
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
......@@ -36,13 +37,14 @@ import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
......@@ -104,7 +106,6 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private final CmWorkflowServiceImpl cmWorkflowService;
private final JgOverDesignServiceLifeEqMapper jgOverDesignServiceLifeEqMapper;
private final IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
private final IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
private final TzsServiceFeignClient tzsServiceFeignClient;
private final ICmWorkflowService workflowService;
private final IdxBizJgDesignInfoServiceImpl idxBizJgDesignInfoServiceImpl;
......@@ -116,6 +117,8 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private final EventPublisher eventPublisher;
private final EmqKeeper emqKeeper;
private final DataDictionaryServiceImpl dataDictionaryServiceImpl;
private final JgCertificateChangeRecordServiceImpl jgCertificateChangeRecordService;
private final JgCertificateChangeRecordEqServiceImpl jgCertificateChangeRecordEqService;
/**
* 分页查询
......@@ -651,7 +654,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
// this.updateOrCreateInspectionDetection(equipmentLists);
this.sendOverDesignMessage(equipmentLists);
this.updateDesignInfo(taskV2Model, jgOverDesignServiceLife, equipmentLists, designInfoList);
this.updateRegistrationManage(useOrgCodes);
this.updateRegistrationManage(useOrgCodes, jgOverDesignServiceLife, designInfoList, taskV2Model);
}
private Date castDate2TimeStr(String date) {
......@@ -733,7 +736,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private void saveResumeInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, List<IdxBizJgDesignInfo> designInfoList) {
jgResumeInfoService.saveBatchResume(designInfoList.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName())
.businessType(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName())
.businessId(String.valueOf(jgOverDesignServiceLife.getSequenceNbr()))
.equId(eq.getRecord())
.approvalUnit(jgOverDesignServiceLife.getReceiveOrgName())
......@@ -764,7 +767,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
}
}
private void updateRegistrationManage(List<String> useOrgCodes) {
private void updateRegistrationManage(List<String> useOrgCodes, JgOverDesignServiceLife jgOverDesignServiceLife, List<IdxBizJgDesignInfo> designInfoList, TaskV2Model taskV2Model) {
List<JgUseRegistrationManage> registrationList = useRegistrationManageService.lambdaQuery()
.in(JgUseRegistrationManage::getUseRegistrationCode, useOrgCodes)
.eq(JgUseRegistrationManage::getIsDelete, 0)
......@@ -776,11 +779,40 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
v.setVersion(v.getVersion() + 1);
}).collect(Collectors.toList())
);
FeignClientResult<AgencyUserModel> agencyUserModelFeignClientResult = Privilege.agencyUserClient.queryByUserId(jgOverDesignServiceLife.getCreateUserId());
registrationList.forEach(v->{
JgCertificateChangeRecord jgCertificateChangeRecord = new JgCertificateChangeRecord();
jgCertificateChangeRecord.setApplyNo(jgOverDesignServiceLife.getApplyNo());
jgCertificateChangeRecord.setReceiveOrgName(jgOverDesignServiceLife.getReceiveOrgName());
jgCertificateChangeRecord.setAuditPassDate(new Date());
jgCertificateChangeRecord.setRegType(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName());
jgCertificateChangeRecord.setRegDate(jgOverDesignServiceLife.getCreateDate());
jgCertificateChangeRecord.setChangeContent(jgOverDesignServiceLife.getUseUnitName()+"的"+agencyUserModelFeignClientResult.getResult().getRealName() +"办理了【" + BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName() + "】," + "单号【" + jgOverDesignServiceLife.getApplyNo() +
"】" + ",办理日期" + DateUtil.format(jgOverDesignServiceLife.getCreateDate(), DatePattern.NORM_DATE_PATTERN));
jgCertificateChangeRecord.setRecUserId(jgOverDesignServiceLife.getRecUserId());
jgCertificateChangeRecord.setRecDate(new Date());
jgCertificateChangeRecord.setCreateDate(new Date());
jgCertificateChangeRecord.setCreateUserId(jgOverDesignServiceLife.getCreateUserId());
jgCertificateChangeRecord.setUseRegistrationCode(jgOverDesignServiceLife.getUseRegistrationCode());
jgCertificateChangeRecord.setCertificateNo(v.getCertificateNo());
jgCertificateChangeRecord.setUseUnitCreditCode(jgOverDesignServiceLife.getUseUnitCreditCode());
jgCertificateChangeRecord.setUseUnitName(jgOverDesignServiceLife.getUseUnitName());
jgCertificateChangeRecord.setEquCategory(jgOverDesignServiceLife.getEquCategoryName());
jgCertificateChangeRecord.setReceiveCompanyCode(jgOverDesignServiceLife.getReceiveOrgCode());
jgCertificateChangeRecord.setRoutePath(taskV2Model.getRoutePath());
// 保存证流水信息
jgCertificateChangeRecordService.save(jgCertificateChangeRecord);
List<JgCertificateChangeRecordEq> changeRecordEqs = designInfoList.stream().map(p->{
JgCertificateChangeRecordEq jgCertificateChangeRecordEq = new JgCertificateChangeRecordEq();
jgCertificateChangeRecordEq.setEquId(p.getRecord());
jgCertificateChangeRecordEq.setChangeRecordId(jgCertificateChangeRecord.getSequenceNbr().toString());
return jgCertificateChangeRecordEq;
}).collect(toList());
jgCertificateChangeRecordEqService.saveBatch(changeRecordEqs);
});
}
}
private void buildTask(JgOverDesignServiceLife jgOverDesignServiceLife, WorkflowResultDto workflowResultDto) {
// 代办消息
ArrayList<TaskModelDto> list = new ArrayList<>();
......@@ -898,7 +930,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
.map(v -> (String) v.get("record"))
.collect(Collectors.toList());
resultDataMap.putAll(Bean.BeantoMap(overDesignServiceLife));
List<Map<String, Object>> result = this.getBaseMapper().selectEquipList(records);
List<Map<String, Object>> result = this.getBaseMapper().selectEquipList(records, sequenceNbr);
jsonObject.remove("equipmentLists");
resultDataMap.put("equipmentLists", result);
}
......
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