Browse Source

船舶流量监测导出优化(空载/重载问题待排查解决)

sbj 1 month ago
parent
commit
c8c44aedd3

+ 14 - 21
ghjg-item-server/src/main/java/com/shanghaichengdi/ghjgitem/controller/ShipIdentificationController.java

@@ -42,8 +42,8 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/ghjg/shipIdentification")
 public class ShipIdentificationController {
   @Autowired ShipIdentificationService shipIdentificationService;
-  String ghjgFileservice = OutsideInterface.GHJG_FILE_SERVICE.getUrlString();
-  String url = OutsideInterface.GHJG_FILE_LOAD.getUrlString();
+  String ghjgFileservice = "http://10.83.68.109:8080/ghjgWebServiceTest/";
+  String url = "E:/DataShareFolder/";
 
   @PostMapping("GetAllPage")
   @ApiOperation("获取全部【列表数据】")
@@ -80,28 +80,22 @@ public class ShipIdentificationController {
   public String GetExcel(@RequestBody Map<String, Object> map) {
     String newye = dateToString(new Date(), "yyyy");
     long s = System.nanoTime();
-    String tkk =
-        url
-            + "supervise/shipIdentification/rectify/"
-            + newye
-            + "/"
-            + dateToString(new Date(), "MM")
-            + "/excel/";
+    String tkk = url + "shipIdentification/rectify/" + newye + "/" + dateToString(new Date(), "MM") + "/excel/";
     new File(tkk).mkdirs();
     String towofile = tkk + s + "船舶通航感知信息.xlsx";
     List<ShipIdentificationTo> objAppointmentListTos = new LinkedList<>();
-    map.replace("size", 50000);
+    map.put("size",8000);
     JSONObject j = JSONObject.parseObject(this.GetAllPage(map));
-    if ("无数据".equals(j.get("msg"))) {
+    if (j.get("msg").equals("无数据")) {
     } else {
-      List<ShipIdentificationVo> objVehicleDeclares =
-          j.getJSONArray("data").toJavaList(ShipIdentificationVo.class);
+      List<ShipIdentificationVo> objVehicleDeclares = j.getJSONArray("data").toJavaList(ShipIdentificationVo.class);
+      log.info("查到船舶通航感知导出数据:"+ objVehicleDeclares.toString());
       for (int i = 0; i < objVehicleDeclares.size(); i++) {
         ShipIdentificationVo a = objVehicleDeclares.get(i);
         ShipIdentificationTo to = new ShipIdentificationTo();
         to.setNum(i + 1);
         to.setBoatName(a.getBoatName());
-        to.setAnalysisName(a.getAnalysisName());
+//        to.setAnalysisName(a.getAnalysisName());
         to.setAnalysisTime(a.getAnalysisTime());
         to.setBayonetName(a.getBayonetName());
         to.setMmsi(a.getMmsi());
@@ -119,18 +113,17 @@ public class ShipIdentificationController {
     }
     if (objAppointmentListTos.size() >= 8000) {
       return new ResultMsg<String>()
-          .setCode(ResultState.ERROR_NEEDDATA)
-          .setMsg("导出数量庞大,请选择条件以缩小导出范围")
-          .toJSON();
+              .setCode(ResultState.ERROR_NEEDDATA)
+              .setMsg("导出数量庞大,请选择条件以缩小导出范围")
+              .toJSON();
     }
     EasyExcel.write(towofile, ShipIdentificationTo.class)
-        .sheet("船舶通航感知信息")
-        .doWrite(() -> objAppointmentListTos);
+            .sheet("船舶通航感知信息")
+            .doWrite(() -> objAppointmentListTos);
 
-    String pdfurl = towofile.replace(url.replace("/test", ""), (ghjgFileservice + "supervise/"));
+    String pdfurl = towofile.replace(url, (ghjgFileservice + "supervise/"));
     return new ResultMsg<String>().setCode(ResultState.SUCCESS).setMsg(pdfurl).toJSON();
   }
-
   @GetMapping("getBoatInfo/{shipId}")
   @ApiOperation("船舶通航感知查看船舶信息")
   @ResponseBody

+ 2 - 2
ghjg-item-server/src/main/java/com/shanghaichengdi/ghjgitem/controller/model/res/ShipIdentificationTo.java

@@ -10,8 +10,8 @@ public class ShipIdentificationTo {
     private Integer num;
     @ExcelProperty({"船舶通航感知信息", "船舶名称"})
     private String boatName;
-    @ExcelProperty({"船舶通航感知信息", "船名图像识别"})
-    private String analysisName;
+//    @ExcelProperty({"船舶通航感知信息", "船名图像识别"})
+//    private String analysisName;
     @ExcelProperty({"船舶通航感知信息", "观测时间"})
     private String analysisTime;
     @ExcelProperty({"船舶通航感知信息", "卡口名称"})