Commit 87407767 authored by tianbo's avatar tianbo

fix(jg): 解决设备认领服务中的日期转换和组织分支信息处理问题

- 添加CREATE_DATE为空时使用REC_DATE的逻辑处理 - 实现对属地监管部门代码和名称的解析和设置 - 确保日期转换前进行空值验证以避免转换错误
parent 362baaf1
......@@ -207,8 +207,13 @@ public class EquipClaimServiceImpl {
sourceAsJSON.put(EQU_STATE, EquimentEnum.getName.get(Integer.valueOf(sourceAsJSON.get(EQU_STATE).toString())));
}
sourceAsJSON.put(record, sourceAsJSON.get(SEQUENCE_NBR));
// 录入时间如果CREATE_DATE为空则使用REC_DATE
// 日期转化
sourceAsJSON.put(CREATE_DATE, Instant.ofEpochMilli(Long.parseLong(sourceAsJSON.getString(CREATE_DATE))).atZone(ZoneId.systemDefault()).toLocalDate());
if (ValidationUtil.isEmpty(sourceAsJSON.get(CREATE_DATE))) {
sourceAsJSON.put(CREATE_DATE, Instant.ofEpochMilli(Long.parseLong(sourceAsJSON.getString("REC_DATE"))).atZone(ZoneId.systemDefault()).toLocalDate());
} else {
sourceAsJSON.put(CREATE_DATE, Instant.ofEpochMilli(Long.parseLong(sourceAsJSON.getString(CREATE_DATE))).atZone(ZoneId.systemDefault()).toLocalDate());
}
list.add(sourceAsJSON);
}
if (response.getInternalResponse().hits().getTotalHits() != null) {
......@@ -892,6 +897,8 @@ public class EquipClaimServiceImpl {
supervisionInfo.setRecord(record);
supervisionInfo.setRecDate(timestamp);
supervisionInfo.setSequenceNbr(Objects.toString(equipInfo.get("SUPERVISIONINFO_SEQ"), null));
supervisionInfo.setOrgBranchCode(Objects.toString(equipInfo.get("orgBranchCode"), "").split("_")[0]);
supervisionInfo.setOrgBranchName(Objects.toString(equipInfo.get("orgBranchCode"), "").split("_")[1]);
iIdxBizJgSupervisionInfoService.saveOrUpdateData(supervisionInfo);
// 其他信息
IdxBizJgOtherInfo otherInfo = JSON.parseObject(toJSONString(equipInfo), IdxBizJgOtherInfo.class);
......
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