Commit fe29bcf0 authored by 刘林's avatar 刘林

fix(JG):改造告知,设备移交详情接口修改,一码通添加锁

parent 4d755a19
...@@ -163,7 +163,8 @@ ...@@ -163,7 +163,8 @@
tec2.name AS equCategory, tec2.name AS equCategory,
tec1.name AS equList, tec1.name AS equList,
tec.name AS equDefine, tec.name AS equDefine,
oi.SUPERVISORY_CODE AS supervisoryCode oi.SUPERVISORY_CODE AS supervisoryCode,
ete.equ_id AS equId
FROM FROM
tzs_jg_equip_transfer jet tzs_jg_equip_transfer jet
LEFT JOIN tzs_jg_equip_transfer_eq ete ON ete.equip_transfer_id = jet.sequence_nbr LEFT JOIN tzs_jg_equip_transfer_eq ete ON ete.equip_transfer_id = jet.sequence_nbr
......
...@@ -131,7 +131,8 @@ ...@@ -131,7 +131,8 @@
tec2.name AS equCategory, tec2.name AS equCategory,
tec1.name AS equList, tec1.name AS equList,
tec.name AS equDefine, tec.name AS equDefine,
oi.SUPERVISORY_CODE AS supervisoryCode oi.SUPERVISORY_CODE AS supervisoryCode,
re.equ_id AS equId
FROM tzs_jg_reform_notice isn FROM tzs_jg_reform_notice isn
LEFT JOIN tzs_jg_reform_notice_eq re ON re.equip_transfer_id = isn.sequence_nbr LEFT JOIN tzs_jg_reform_notice_eq re ON re.equip_transfer_id = isn.sequence_nbr
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id
......
...@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper; ...@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService; import com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
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.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.ymt.api.common.BaseException; import com.yeejoin.amos.boot.module.ymt.api.common.BaseException;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; 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.enums.FlowStatusEnum;
...@@ -60,6 +61,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -60,6 +61,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
private final CommonServiceImpl commonService; private final CommonServiceImpl commonService;
private final CmWorkflowServiceImpl cmWorkflowService; private final CmWorkflowServiceImpl cmWorkflowService;
private final IJgInstallationNoticeService jrmInstallationNoticeService; private final IJgInstallationNoticeService jrmInstallationNoticeService;
private final IIdxBizJgRegisterInfoService idxBizJgRegisterInfoService;
/** /**
* 保存和保存并提交 * 保存和保存并提交
...@@ -480,13 +482,21 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -480,13 +482,21 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
"proxyStatementAttachment", "installContractAttachment"}; "proxyStatementAttachment", "installContractAttachment"};
List<Map<String, Object>> equipmentInfos = this.baseMapper.queryEquipInformation(sequenceNbr); List<Map<String, Object>> equipmentInfos = this.baseMapper.queryEquipInformation(sequenceNbr);
Map<String, Object> equipMap = null;
if (equipmentInfos != null && !equipmentInfos.isEmpty()) {
String equId = (String) equipmentInfos.get(0).get("equId");
if (equId != null) {
equipMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equId);
}
}
Map<String, Object> equipTransferInfo = createEquipTransferInfo(equipTransfer); Map<String, Object> equipTransferInfo = createEquipTransferInfo(equipTransfer);
handleJsonArrayFields(equipTransferInfo, fields); handleJsonArrayFields(equipTransferInfo, fields);
handleJsonArrayFields(equipmentInfos.get(0), fields); handleJsonArrayFields(equipMap, fields);
return Stream.concat(equipTransferInfo.entrySet().stream(), return Stream.concat(equipTransferInfo.entrySet().stream(),
equipmentInfos.get(0).entrySet().stream()) equipMap.entrySet().stream())
.filter(entry -> entry.getValue() != null) .filter(entry -> entry.getValue() != null)
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing));
} }
......
...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeEqMapper; ...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgReformNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgReformNoticeService;
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.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
...@@ -93,6 +94,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -93,6 +94,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Autowired @Autowired
private CmWorkflowServiceImpl cmWorkflowService; private CmWorkflowServiceImpl cmWorkflowService;
@Autowired
IIdxBizJgRegisterInfoService idxBizJgRegisterInfoService;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -126,18 +129,29 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -126,18 +129,29 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
"proxyStatementAttachment", "installContractAttachment"}; "proxyStatementAttachment", "installContractAttachment"};
// 设备信息 // 设备信息
List<Map<String, Object>> equipmentInfos = jgReformNoticeMapper.queryEquipInformation(sequenceNbr); List<Map<String, Object>> equipmentInfos = jgReformNoticeMapper.queryEquipInformation(sequenceNbr);
for (String s : fields) { Map<String, Object> equipMap = null;
if (installationInfo.containsKey(s)) { if (equipmentInfos != null && !equipmentInfos.isEmpty()) {
installationInfo.put(s, JSON.parseArray(installationInfo.get(s).toString())); String equId = (String) equipmentInfos.get(0).get("equId");
}
if (equipmentInfos.get(0).containsKey(s)) { if (equId != null) {
equipmentInfos.get(0).put(s, JSON.parseArray(equipmentInfos.get(0).get(s).toString())); equipMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equId);
equipMap.put("useUnitCreditCodeUse", equipMap.getOrDefault("useUnitCreditCode", ""));
equipMap.put("useUnitNameUse", equipMap.getOrDefault("useUnitName", ""));
for (String s : fields) {
if (installationInfo.containsKey(s)) {
installationInfo.put(s, JSON.parseArray(installationInfo.get(s).toString()));
}
if (equipMap.containsKey(s)) {
equipMap.put(s, JSON.parseArray(equipMap.get(s).toString()));
}
}
} }
} }
installationInfo.put("constructionManagerId", notice.getConstructionManagerId() + "_" + notice.getConstructionManager()); installationInfo.put("constructionManagerId", notice.getConstructionManagerId() + "_" + notice.getConstructionManager());
return Stream.concat( return Stream.concat(
installationInfo.entrySet().stream(), installationInfo.entrySet().stream(),
equipmentInfos.get(0).entrySet().stream() equipMap.entrySet().stream()
) )
.filter(entry -> entry.getValue() != null) .filter(entry -> entry.getValue() != null)
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing));
...@@ -258,7 +272,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -258,7 +272,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
noticeDto.setNoticeStatusDesc(noticeStatusDesc); noticeDto.setNoticeStatusDesc(noticeStatusDesc);
} }
return noticeDto; return noticeDto;
}).collect(java.util.stream.Collectors.toList()); }).collect(Collectors.toList());
noticeDtoPage.setRecords(records); noticeDtoPage.setRecords(records);
return noticeDtoPage; return noticeDtoPage;
......
...@@ -734,12 +734,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -734,12 +734,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Map<String, String> creatCode(String isNotXiXian, String city, String county, String equipCategory, String code96333, String supervisionCode) { public synchronized Map<String, String> creatCode(String isNotXiXian, String city, String county, String equipCategory, String code96333, String supervisionCode) {
//RLock lock = redissonClient.getLock(LOCK_KEY); RLock lock = redissonClient.getLock(LOCK_KEY);
Map<String, String> resultMap = null; Map<String, String> resultMap = null;
try { try {
//lock.lock(); // 获取锁 lock.lock(); // 获取锁
//log.info("加锁成功"); log.info("加锁成功");
resultMap = new HashMap<>(); resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
...@@ -803,10 +803,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -803,10 +803,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
//finally { finally {
// lock.unlock(); // 释放锁 lock.unlock(); // 释放锁
// log.info("释放锁"); log.info("释放锁");
//} }
return resultMap; return resultMap;
} }
......
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