|
@@ -1,6 +1,7 @@
|
|
package com.ecnu.platform.cwp
|
|
package com.ecnu.platform.cwp
|
|
|
|
|
|
import com.ecnu.alg.pojo.port.data.AlgCwpImportData
|
|
import com.ecnu.alg.pojo.port.data.AlgCwpImportData
|
|
|
|
+import com.ecnu.alg.pojo.port.inputs.AlgBollard
|
|
import com.ecnu.alg.pojo.port.inputs.AlgCraneBase
|
|
import com.ecnu.alg.pojo.port.inputs.AlgCraneBase
|
|
import com.ecnu.alg.pojo.port.inputs.AlgCranePool
|
|
import com.ecnu.alg.pojo.port.inputs.AlgCranePool
|
|
import com.ecnu.alg.pojo.port.inputs.AlgStowDetail
|
|
import com.ecnu.alg.pojo.port.inputs.AlgStowDetail
|
|
@@ -40,6 +41,8 @@ class CwpDataService {
|
|
public static final String AlgCwpBlockKey = "port:AlgCwpBlock:"
|
|
public static final String AlgCwpBlockKey = "port:AlgCwpBlock:"
|
|
public static final String AlgCwpParameterKey = "port:AlgCwpParameter:"
|
|
public static final String AlgCwpParameterKey = "port:AlgCwpParameter:"
|
|
|
|
|
|
|
|
+ public static final String AlgBollardKey = "port:AlgBollard:"
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@@ -47,6 +50,13 @@ class CwpDataService {
|
|
@Doc4MethodRes(key = "result", desc = "底图信息", refClasses = AlgCwpImportData.class)
|
|
@Doc4MethodRes(key = "result", desc = "底图信息", refClasses = AlgCwpImportData.class)
|
|
AlgCwpImportData importData(Map<String, Object> map) throws Exception {
|
|
AlgCwpImportData importData(Map<String, Object> map) throws Exception {
|
|
AlgCwpImportData algCwpImportData = new AlgCwpImportData();
|
|
AlgCwpImportData algCwpImportData = new AlgCwpImportData();
|
|
|
|
+ List<AlgBollard> algBollardList = redisUtil.getByPrefix(AlgBollardKey + "*") as List<AlgBollard>
|
|
|
|
+ Collections.sort(algBollardList, new Comparator<AlgBollard>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(AlgBollard o1, AlgBollard o2) {
|
|
|
|
+ return o1.getLocation().compareTo(o2.getLocation());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
// 解析船舶航次信息
|
|
// 解析船舶航次信息
|
|
String vesselVisitId = null;
|
|
String vesselVisitId = null;
|
|
SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy hh:mm:ss a", Locale.ENGLISH);
|
|
SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy hh:mm:ss a", Locale.ENGLISH);
|
|
@@ -61,6 +71,21 @@ class CwpDataService {
|
|
algVesselVisit.setPlanEndWorkTime(sdf.parse(smartScheduleIdInfo.get("planEndWorkTime") as String))
|
|
algVesselVisit.setPlanEndWorkTime(sdf.parse(smartScheduleIdInfo.get("planEndWorkTime") as String))
|
|
algVesselVisit.setStartPst(smartScheduleIdInfo.get("planStartPst") as Double)
|
|
algVesselVisit.setStartPst(smartScheduleIdInfo.get("planStartPst") as Double)
|
|
algVesselVisit.setEndPst(smartScheduleIdInfo.get("planEndPst") as Double)
|
|
algVesselVisit.setEndPst(smartScheduleIdInfo.get("planEndPst") as Double)
|
|
|
|
+ // 根据船舶停靠位置,找到缆桩编号
|
|
|
|
+ for (int i = 0; i < algBollardList.size(); i++) {
|
|
|
|
+ AlgBollard algBollard = algBollardList.get(i)
|
|
|
|
+ if (algVesselVisit.getStartPst() < algBollard.getLocation()) {
|
|
|
|
+ algVesselVisit.setStartBollardId(algBollard.getId())
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (int i = 0; i < algBollardList.size(); i++) {
|
|
|
|
+ AlgBollard algBollard = algBollardList.get(i)
|
|
|
|
+ if (algVesselVisit.getEndPst() < algBollard.getLocation()) {
|
|
|
|
+ algVesselVisit.setEndBollardId(algBollard.getId())
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
algVesselVisit.setBerthDirection(smartScheduleIdInfo.get("planBerthDirect") as String)
|
|
algVesselVisit.setBerthDirection(smartScheduleIdInfo.get("planBerthDirect") as String)
|
|
redisUtil.set(AlgVesselVisitKey + algVesselVisit.getVesselVisitId(), algVesselVisit)
|
|
redisUtil.set(AlgVesselVisitKey + algVesselVisit.getVesselVisitId(), algVesselVisit)
|
|
algCwpImportData.getAlgVesselVisitList().add(algVesselVisit)
|
|
algCwpImportData.getAlgVesselVisitList().add(algVesselVisit)
|
|
@@ -226,6 +251,7 @@ class CwpDataService {
|
|
algVstBay1.setRowNos(algVstBay.getRowNos())
|
|
algVstBay1.setRowNos(algVstBay.getRowNos())
|
|
bayInfos.add(algVstBay1)
|
|
bayInfos.add(algVstBay1)
|
|
}
|
|
}
|
|
|
|
+ algVstHatch.setBayInfos(bayInfos)
|
|
redisUtil.set(AlgVstHatchKey + algVstHatch.getVesselStructGkey() + ":" + algVstHatch.getGkey(), algVstHatch)
|
|
redisUtil.set(AlgVstHatchKey + algVstHatch.getVesselStructGkey() + ":" + algVstHatch.getGkey(), algVstHatch)
|
|
}
|
|
}
|
|
// 解析舱盖板信息
|
|
// 解析舱盖板信息
|