|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
@@ -67,16 +68,25 @@ public class AisInfoServiceImpl implements IAisInfoService {
|
|
|
JSONArray result = jsonObject.getJSONArray("result");
|
|
|
if (result != null && !result.isEmpty()) {
|
|
|
Map<String, String> stringStringMap = Convert.toMap(String.class, String.class, result.get(0));
|
|
|
+ String arrivalOrLeave = stringStringMap.get("arrival_or_leave");
|
|
|
String expectTime = stringStringMap.get("expect_time");
|
|
|
+ String berthName = "";
|
|
|
+ String nextPortName = "";
|
|
|
+ if ("0".equals(arrivalOrLeave)) {
|
|
|
+ nextPortName = stringStringMap.get("report_port_name");
|
|
|
+ berthName = stringStringMap.get("berth_name");
|
|
|
+ } else if ("1".equals(arrivalOrLeave)) {
|
|
|
+ nextPortName = stringStringMap.get("next_port_name");
|
|
|
+ }
|
|
|
return ShipEepReportRecInfo.builder()
|
|
|
- .berthName(stringStringMap.get("berth_name"))
|
|
|
- .nextPortName(stringStringMap.get("next_port_name"))
|
|
|
- .expectTime(StrUtil.isNotBlank(expectTime) && expectTime.length() >= 16 ? expectTime.replace("T", " ").substring(0, 16) : "")
|
|
|
+ .berthName(berthName)
|
|
|
+ .nextPortName(nextPortName)
|
|
|
+ .expectTime(StrUtil.isNotBlank(expectTime) && expectTime.length() >= 16 ? DateUtil.format(DateUtil.offsetHour(DateUtil.parse(expectTime), 8), "yyyy-MM-dd HH:mm") : "")
|
|
|
.build();
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("获取船舶停靠信息异常");
|
|
|
+ log.error("获取船舶停靠信息异常:{}", e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|