Explorar o código

船舶动态表

yangk %!s(int64=3) %!d(string=hai) anos
pai
achega
ce5fc1d4ea

+ 26 - 25
.idea/workspace.xml

@@ -131,7 +131,8 @@
       <workItem from="1636685226129" duration="4073000" />
       <workItem from="1636700814042" duration="442000" />
       <workItem from="1636702370148" duration="5105000" />
-      <workItem from="1636719939751" duration="1520000" />
+      <workItem from="1636719939751" duration="1666000" />
+      <workItem from="1636766353639" duration="2925000" />
     </task>
     <servers />
   </component>
@@ -155,54 +156,54 @@
       <screen x="0" y="0" width="1366" height="728" />
     </state>
     <state x="395" y="182" key="FileChooserDialogImpl/0.0.1366.728@0.0.1366.728" timestamp="1636700847996" />
-    <state width="1323" height="225" key="GridCell.Tab.0.bottom" timestamp="1636720925700">
+    <state width="1323" height="225" key="GridCell.Tab.0.bottom" timestamp="1636770276602">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636720925700" />
-    <state width="1323" height="225" key="GridCell.Tab.0.center" timestamp="1636720925699">
+    <state width="1323" height="225" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636770276602" />
+    <state width="1323" height="225" key="GridCell.Tab.0.center" timestamp="1636770276601">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1636720925699" />
-    <state width="1323" height="225" key="GridCell.Tab.0.left" timestamp="1636720925698">
+    <state width="1323" height="225" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1636770276601" />
+    <state width="1323" height="225" key="GridCell.Tab.0.left" timestamp="1636770276601">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1636720925698" />
-    <state width="1323" height="225" key="GridCell.Tab.0.right" timestamp="1636720925699">
+    <state width="1323" height="225" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1636770276601" />
+    <state width="1323" height="225" key="GridCell.Tab.0.right" timestamp="1636770276602">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1636720925699" />
-    <state width="1323" height="225" key="GridCell.Tab.1.bottom" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1636770276602" />
+    <state width="1323" height="225" key="GridCell.Tab.1.bottom" timestamp="1636770276403">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.1.center" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636770276403" />
+    <state width="1323" height="225" key="GridCell.Tab.1.center" timestamp="1636770276402">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.1.left" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1636770276402" />
+    <state width="1323" height="225" key="GridCell.Tab.1.left" timestamp="1636770276402">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.1.right" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1636770276402" />
+    <state width="1323" height="225" key="GridCell.Tab.1.right" timestamp="1636770276402">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.2.bottom" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1636770276402" />
+    <state width="1323" height="225" key="GridCell.Tab.2.bottom" timestamp="1636770276403">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.2.center" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1636770276403" />
+    <state width="1323" height="225" key="GridCell.Tab.2.center" timestamp="1636770276403">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.2.left" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1636770276403" />
+    <state width="1323" height="225" key="GridCell.Tab.2.left" timestamp="1636770276403">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
-    <state width="1323" height="225" key="GridCell.Tab.2.right" timestamp="1636714858051">
+    <state width="1323" height="225" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1636770276403" />
+    <state width="1323" height="225" key="GridCell.Tab.2.right" timestamp="1636770276403">
       <screen x="0" y="0" width="1366" height="728" />
     </state>
-    <state width="1323" height="225" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1636714858051" />
+    <state width="1323" height="225" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1636770276403" />
     <state x="184" y="8" key="SettingsEditor" timestamp="1636700851196">
       <screen x="0" y="0" width="1366" height="728" />
     </state>

+ 18 - 17
src/main/java/com/steerinfo/dil/controller/ShipDynamicsController.java

@@ -49,6 +49,7 @@ public class ShipDynamicsController extends BaseRESTfulController {
                         list.get(i-1).get("dateOfLoans").toString().substring(0, 10)+"放货"+
                         list.get(i-1).get("numberOfLoans").toString());
                 map.put("tonnage",list.get(i-1).get("tonnage"));
+                tonnageSum+=Double.parseDouble(list.get(i-1).get("tonnage").toString());
                 map.put("capacity1","小计");
                 map.put("capacity2","小计");
                 map.put("capacity3","小计");
@@ -86,16 +87,15 @@ public class ShipDynamicsController extends BaseRESTfulController {
             list.get(i).get("numberOfLoans").toString();
             map.put("pm",pm);
             map.put("tonnage",list.get(i).get("tonnage"));
-            tonnageSum+=Double.parseDouble(list.get(i).get("tonnage").toString());
             //1:未到闸船舶2:等闸船舶3:已过闸船舶4:到港待卸船舶
             String capacity1=null;
             String capacity2=null;
             String capacity3=null;
             String capacity4=null;
-            Double capacityNumber1=0.0;
-            Double capacityNumber2=0.0;
-            Double capacityNumber3=0.0;
-            Double capacityNumber4=0.0;
+            String capacityNumber1=null;
+            String capacityNumber2=null;
+            String capacityNumber3=null;
+            String capacityNumber4=null;
             String outPortTime1=null;
             String outPortTime2=null;
             String outPortTime3=null;
@@ -107,32 +107,32 @@ public class ShipDynamicsController extends BaseRESTfulController {
             String locationStatus = list.get(i).get("locationStatus").toString();
             if ("未到闸船舶".equals(locationStatus)) {
                 capacity1 = list.get(i).get("capacity").toString();
-                capacityNumber1 = Double.valueOf(list.get(i).get("capacityNumber").toString());
+                capacityNumber1 = list.get(i).get("capacityNumber").toString();
                 outPortTime1 = list.get(i).get("outPortTime").toString().substring(0, 10);
                 locationValue1 = list.get(i).get("locationValue").toString();
-                capacityNumberSum1 += capacityNumber1;
-                capacityNumberAllSum1+=capacityNumber1;
+                capacityNumberSum1 += Double.valueOf(capacityNumber1);
+                capacityNumberAllSum1+=Double.valueOf(capacityNumber1);
             } else if ("等闸船舶".equals(locationStatus)) {
                 capacity2 = list.get(i).get("capacity").toString();
-                capacityNumber2 = Double.valueOf(list.get(i).get("capacityNumber").toString());
+                capacityNumber2 = list.get(i).get("capacityNumber").toString();
                 outPortTime2 = list.get(i).get("outPortTime").toString().substring(0, 10);
                 locationValue2 = list.get(i).get("locationValue").toString();
-                capacityNumberSum2 += capacityNumber2;
-                capacityNumberAllSum2+=capacityNumber2;
+                capacityNumberSum2 += Double.valueOf(capacityNumber2);
+                capacityNumberAllSum2+=Double.valueOf(capacityNumber2);
             } else if ("已过闸船舶".equals(locationStatus)) {
                 capacity3 = list.get(i).get("capacity").toString();
-                capacityNumber3 = Double.valueOf(list.get(i).get("capacityNumber").toString());
+                capacityNumber3 = list.get(i).get("capacityNumber").toString();
                 outPortTime3 = list.get(i).get("outPortTime").toString().substring(0, 10);
                 locationValue3 = list.get(i).get("locationValue").toString();
-                capacityNumberSum3 += capacityNumber3;
-                capacityNumberAllSum3+=capacityNumber3;
+                capacityNumberSum3 += Double.valueOf(capacityNumber3);
+                capacityNumberAllSum3+=Double.valueOf(capacityNumber3);
             } else if ("到港待卸船舶".equals(locationStatus)) {
                 capacity4 = list.get(i).get("capacity").toString();
-                capacityNumber4 = Double.valueOf(list.get(i).get("capacityNumber").toString());
+                capacityNumber4 = list.get(i).get("capacityNumber").toString();
                 outPortTime4 = list.get(i).get("outPortTime").toString().substring(0, 10);
                 locationValue4 = list.get(i).get("locationValue").toString();
-                capacityNumberSum4 += capacityNumber4;
-                capacityNumberAllSum4+=capacityNumber4;
+                capacityNumberSum4 += Double.valueOf(capacityNumber4);
+                capacityNumberAllSum4+=Double.valueOf(capacityNumber4);
             }
             map.put("capacity1",capacity1);
             map.put("capacityNumber1",capacityNumber1);
@@ -159,6 +159,7 @@ public class ShipDynamicsController extends BaseRESTfulController {
                 list.get(list.size()-1).get("dateOfLoans").toString().substring(0, 10)+"放货"+
                 list.get(list.size()-1).get("numberOfLoans").toString());
         map.put("tonnage",list.get(list.size()-1).get("tonnage"));
+        tonnageSum+=Double.parseDouble(list.get(list.size()-1).get("tonnage").toString());
         map.put("capacity1","小计");
         map.put("capacity2","小计");
         map.put("capacity3","小计");