Commit 941d7052 authored by hezhuozhi's avatar hezhuozhi

【需求】管道变更/单位变更

parent 438bb612
...@@ -57,6 +57,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -57,6 +57,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -2132,8 +2135,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -2132,8 +2135,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
} }
public Map<String, Map<String, Object>> detailsByProjectContraption(String sequenceNbr) { public Map<String, Map<String, Object>> detailsByProjectContraption(String sequenceNbr) {
String[] jsonFields = {"PRODUCT_PHOTO", "OTHER_ACCESSORIES", "PRODUCT_QUALIFICATION_CERTIFICATE", "START_LATITUDE_LONGITUDE", String[] jsonFields = {"productPhoto", "otherAccessories", "productQualificationCertificate", "startLatitudeLongitude",
"END_LATITUDE_LONGITUDE"}; "endLatitudeLongitude"};
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
if (StringUtils.isEmpty(sequenceNbr)) { if (StringUtils.isEmpty(sequenceNbr)) {
resultMap.put("equipInfo", Collections.emptyMap()); resultMap.put("equipInfo", Collections.emptyMap());
...@@ -2170,7 +2173,19 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -2170,7 +2173,19 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.map(map -> { .map(map -> {
commonServiceImpl.convertStringToJsonobject(map, jsonFields); commonServiceImpl.convertStringToJsonobject(map, jsonFields);
List<JSONObject> pipelineList= new ArrayList<>(); List<JSONObject> pipelineList= new ArrayList<>();
changeRegistrationUnitEqs.forEach(item-> pipelineList.add(JSON.parseObject(item.getDeviceInfo()))); changeRegistrationUnitEqs.forEach(item-> {
JSONObject jsonObject = JSON.parseObject(item.getDeviceInfo());
if(jsonObject.containsKey("uscDate")&&!StringUtils.isEmpty(jsonObject.get("uscDate"))){
// 转换为 Instant 并指定时区(默认系统时区)
Instant instant = Instant.ofEpochMilli( Long.parseLong(jsonObject.getString("uscDate")));
ZoneId zoneId = ZoneId.systemDefault();
// 定义日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
.withZone(zoneId);
jsonObject.put("uscDate",formatter.format(instant));
}
pipelineList.add(jsonObject);
});
map.put("pipelineList", pipelineList); map.put("pipelineList", pipelineList);
return map; return map;
}).orElse(Collections.emptyMap()); }).orElse(Collections.emptyMap());
......
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