Commit 00baf6a4 authored by hezhuozhi's avatar hezhuozhi

处理日期格式的详情

parent 47e28e2c
...@@ -2254,7 +2254,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -2254,7 +2254,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
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")) && jsonObject.getString("uscDate").contains("-")){ 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