Commit 590f3b29 authored by suhuiguang's avatar suhuiguang

1.安装告知完成后,施工信息应该是新增而不是更新

parent 5ac8a75f
package com.yeejoin.amos.boot.module.jg.biz.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
/**
......@@ -8,7 +9,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
* @author system_generator
* @date 2023-08-17
*/
public interface IIdxBizJgConstructionInfoService {
public interface IIdxBizJgConstructionInfoService extends IService<IdxBizJgConstructionInfo> {
boolean saveOrUpdateData(IdxBizJgConstructionInfo constructionInfo);
......
......@@ -986,22 +986,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo);
// 更新es
updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, map1);
// 更新施工信息表
IdxBizJgConstructionInfo idxBizJgConstructionInfo = constructionInfoService.queryNewestDetailByRecord(jgRelationEquip.getEquId());
if (!ObjectUtils.isEmpty(idxBizJgConstructionInfo)) {
idxBizJgConstructionInfo.setUscUnitCreditCode(jgInstallationNotice.getInstallUnitCreditCode());
idxBizJgConstructionInfo.setUscUnitName(jgInstallationNotice.getInstallUnitName());
idxBizJgConstructionInfo.setUscDate(jgInstallationNotice.getInstallStartDate());
// 获取施工类型id
LambdaQueryWrapper<DataDictionary> lambda = new LambdaQueryWrapper<>();
lambda.eq(DataDictionary::getType, CONSTRUCTION_TYPE);
lambda.eq(DataDictionary::getName, CONSTRUCTION_TYPE_NAME);
List<DataDictionary> dataDictionaries = dataDictionaryMapper.selectList(lambda);
if (!CollectionUtils.isEmpty(dataDictionaries)) {
idxBizJgConstructionInfo.setConstructionType(String.valueOf(dataDictionaries.get(0).getSequenceNbr()));
}
constructionInfoService.saveOrUpdateData(idxBizJgConstructionInfo);
}
// 记录施工信息表
createConstruction2Db(jgInstallationNotice, jgRelationEquip);
// 更新使用信息
updateJgUseInfo(jgInstallationNotice, jgRelationEquip);
......@@ -1016,7 +1003,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(jgInstallationNotice, taskMessageDto);
taskMap.put("model", taskMessageDto);
taskV2Model = commonService.updateTaskModel(taskMap);
commonService.updateTaskModel(taskMap);
} else {
jgInstallationNotice.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds());
jgInstallationNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
......@@ -1089,6 +1076,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
private void createConstruction2Db(JgInstallationNotice jgInstallationNotice, JgInstallationNoticeEq jgRelationEquip) {
IdxBizJgConstructionInfo idxBizJgConstructionInfo = new IdxBizJgConstructionInfo();
idxBizJgConstructionInfo.setUscUnitCreditCode(jgInstallationNotice.getInstallUnitCreditCode());
idxBizJgConstructionInfo.setUscUnitName(jgInstallationNotice.getInstallUnitName());
idxBizJgConstructionInfo.setUscDate(jgInstallationNotice.getInstallStartDate());
idxBizJgConstructionInfo.setRecord(jgRelationEquip.getEquId());
idxBizJgConstructionInfo.setRecDate(new Date());
idxBizJgConstructionInfo.setNoticeId(jgInstallationNotice.getSequenceNbr() + "");
// 获取施工类型id
LambdaQueryWrapper<DataDictionary> lambda = new LambdaQueryWrapper<>();
lambda.eq(DataDictionary::getType, CONSTRUCTION_TYPE);
lambda.eq(DataDictionary::getName, CONSTRUCTION_TYPE_NAME);
List<DataDictionary> dataDictionaries = dataDictionaryMapper.selectList(lambda);
if (!CollectionUtils.isEmpty(dataDictionaries)) {
idxBizJgConstructionInfo.setConstructionType(String.valueOf(dataDictionaries.get(0).getSequenceNbr()));
}
constructionInfoService.save(idxBizJgConstructionInfo);
}
private void updateEquipEs(JgInstallationNotice jgInstallationNotice, OtherInfo tzsJgOtherInfo,
IdxBizJgRegisterInfo tzsJgRegistrationInfo, IdxBizJgSupervisionInfo idxBizJgSupervisionInfo,
Map<String, Object> map1) {
......
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