Commit fe29bcf0 authored by 刘林's avatar 刘林

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

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