Commit 47e28e2c authored by hezhuozhi's avatar hezhuozhi

处理日期格式的详情

parent b17eeecf
...@@ -2253,7 +2253,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -2253,7 +2253,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List<JSONObject> pipelineList= new ArrayList<>(); List<JSONObject> pipelineList= new ArrayList<>();
changeRegistrationUnitEqs.forEach(item-> { changeRegistrationUnitEqs.forEach(item-> {
JSONObject jsonObject = JSON.parseObject(item.getDeviceInfo()); JSONObject jsonObject = JSON.parseObject(item.getDeviceInfo());
if(jsonObject.containsKey("uscDate")&&!StringUtils.isEmpty(jsonObject.get("uscDate"))){ //如果日期格式是时间戳的话需要处理
if(jsonObject.containsKey("uscDate")&&!StringUtils.isEmpty(jsonObject.get("uscDate")) && jsonObject.getString("uscDate").contains("-")){
// 转换为 Instant 并指定时区(默认系统时区) // 转换为 Instant 并指定时区(默认系统时区)
Instant instant = Instant.ofEpochMilli( Long.parseLong(jsonObject.getString("uscDate"))); Instant instant = Instant.ofEpochMilli( Long.parseLong(jsonObject.getString("uscDate")));
ZoneId zoneId = ZoneId.systemDefault(); ZoneId zoneId = ZoneId.systemDefault();
......
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