Browse Source

.gitignore

zoro 10 months ago
parent
commit
cb2ebe03d9
2 changed files with 3 additions and 148 deletions
  1. 3 0
      .gitignore
  2. 0 148
      src/test/java/test.java

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/.idea/
+/target/
+/logFiles/

+ 0 - 148
src/test/java/test.java

@@ -1,148 +0,0 @@
-import cn.hutool.http.HttpResponse;
-import cn.hutool.http.HttpUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.hikvision.artemis.sdk.util.HttpUtils;
-import com.shanghaigeography.Util.DateUtils;
-import com.shcd.GHJGApplication;
-import com.shcd.entity.*;
-import com.shcd.service.*;
-import org.checkerframework.checker.units.qual.A;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-@SpringBootTest(classes = GHJGApplication.class)
-public class test {
-    @Resource
-    private ShipLockDoorStatusRealtimeService shipLockDoorStatusRealtimeService;
-
-    @Test
-    public void test() {
-
-    }
-
-
-    @Autowired
-    private ShipIllegalAutoService shipIllegalAutoService;
-    @Autowired
-    private ShipIllegalArtificialService shipIllegalArtificialService;
-
-    @Test
-    public void test2() {
-        Date date = new Date();
-        String end = DateUtils.dateToString(date, "yyyy-MM-dd HH:mm");
-        String start = DateUtils.dateToString(new Date(date.getTime() - 5 * 60 * 1000), "yyyy-MM-dd HH:mm");
-        //String start = "2023-10-17 00:00";
-        //String end = "2023-10-17 23:59";
-        HttpResponse execute = HttpUtil.createGet("http://222.66.154.74:8024/xunxiang/ship/open/get-illegal-info?start=" + start + "&end=" + end).
-                header("secretId", "durr").
-                header("secretKey", "WpEuxS+GyBzT0go10TGJeQjR5reA0LolEkmVzfmS87dU7H7LNP2xYsD1rmGgoEHx8ApuX8GaIPgZsUhOa8wJ+YkfkTsuMC74zMOVCyt5xOw=").execute();
-        execute.close();
-        HashMap hashMap = JSONObject.parseObject(execute.body(), HashMap.class);
-        HashMap hashMap1 = JSONObject.parseObject(hashMap.get("data").toString(), HashMap.class);
-        List<ShipIllegalAuto> auto = JSONObject.parseArray(hashMap1.get("auto").toString(), ShipIllegalAuto.class);
-        List<ShipIllegalArtificial> artificial = JSONObject.parseArray(hashMap1.get("handle").toString(), ShipIllegalArtificial.class);
-        if (!auto.isEmpty()) {
-            auto.forEach(i->i.setIndext(i.getIndex()));
-//            for (ShipIllegalAuto shipIllegalAuto : auto) {
-//                shipIllegalAutoService.saveOrUpdate(shipIllegalAuto);
-//            }
-           shipIllegalAutoService.saveOrUpdateBatch(auto);
-        }
-        if (!artificial.isEmpty()) {
-            shipIllegalArtificialService.saveOrUpdateBatch(artificial);
-        }
-    }
-
-
-    @Autowired
-    private ShipLockStatisticDetailService shipLockStatisticDetailService;
-    @Autowired
-    private ShipLockStatisticService shipLockStatisticService;
-
-    @Test
-    public void test3() {
-        HttpResponse execute = HttpUtil.createGet("http://222.66.154.74:8024/xunxiang/ship/open/get-lock-statistic?date=2023-10-20").
-                header("secretId", "durr").
-                header("secretKey", "WpEuxS+GyBzT0go10TGJeQjR5reA0LolEkmVzfmS87dU7H7LNP2xYsD1rmGgoEHx8ApuX8GaIPgZsUhOa8wJ+YkfkTsuMC74zMOVCyt5xOw=").execute();
-        execute.close();
-        HashMap hashMap = JSONObject.parseObject(execute.body(), HashMap.class);
-        HashMap data = JSONObject.parseObject(hashMap.get("data").toString(), HashMap.class);
-        ShipLockStatistic shipLockShipStatus = JSONObject.parseObject(hashMap.get("data").toString(), ShipLockStatistic.class);
-        List<ShipLockStatisticDetail> details = JSONObject.parseArray(data.get("details").toString(), ShipLockStatisticDetail.class);
-        shipLockStatisticDetailService.saveOrUpdateBatch(details);
-        shipLockStatisticService.saveOrUpdate(shipLockShipStatus);
-//        for (ShipLockStatisticDetail detail : details) {
-//            System.out.println(detail);
-//        }
-//        System.out.println(shipLockShipStatus);
-    }
-
-    private static final String[] status = {"预申报", "候泊中", "待闸中", "过闸中", "已过闸"};
-
-    @Autowired
-    private ShipLockShipStatusService shipLockShipStatusService;
-
-    @Test
-    public void test4() {
-        for (String s : status) {
-            HttpResponse execute = HttpUtil.createGet("http://222.66.154.74:8024/xunxiang/ship/open/get-ship-by-status?status=" + s + "&pageNum=1&pageSize=10000000").
-                    header("secretId", "durr").
-                    header("secretKey", "WpEuxS+GyBzT0go10TGJeQjR5reA0LolEkmVzfmS87dU7H7LNP2xYsD1rmGgoEHx8ApuX8GaIPgZsUhOa8wJ+YkfkTsuMC74zMOVCyt5xOw=").execute();
-            //execute.close();
-            HashMap hashMap = JSONObject.parseObject(execute.body(), HashMap.class);
-            HashMap hashMap1 = JSONObject.parseObject(hashMap.get("data").toString(), HashMap.class);
-            List<ShipLockShipStatus> data = JSONObject.parseArray(hashMap1.get("records").toString(), ShipLockShipStatus.class);
-            shipLockShipStatusService.saveOrUpdateBatch(data);
-        }
-    }
-
-    @Autowired
-    private ShipRunInfoService shipRunInfoService;
-    @Autowired
-    private ShipLockWaterLevelService shipLockWaterLevelService;
-
-    @Test
-    public void test5() {
-        HttpResponse execute = HttpUtil.createGet("http://222.66.154.74:8024/xunxiang/ship/info/query/newData").
-                header("secretId", "yangshuai").
-                header("secretKey", "rlDR2kzLkZ5mpJbUscF7Si9EnlLJWcAc3uCnIiZdAvfm9haipGiCBZ0GuyFypkSWQ2hVgpTgAu0MdgLfLw64TkOvTmKkleci0rgE55wQuck=").execute();
-        execute.close();
-        HashMap hashMap = JSONObject.parseObject(execute.body(), HashMap.class);
-        if (new Integer(0).equals(hashMap.get("code"))){
-            System.out.println(123);
-        }
-        HashMap hashMap1 = JSONObject.parseObject(hashMap.get("data").toString(), HashMap.class);
-        List<ShipRunInfo> shipRunInfos = JSONObject.parseArray(hashMap1.get("shipRunInfos").toString(), ShipRunInfo.class);
-        shipRunInfos.forEach(i -> i.setDateTime(i.getDate()));
-        shipRunInfoService.saveOrUpdateBatch(shipRunInfos);
-        ShipLockWaterLevel data = JSONObject.parseObject(hashMap.get("data").toString(), ShipLockWaterLevel.class);
-        data.setDateTime(data.getDate());
-        shipLockWaterLevelService.saveOrUpdate(data);
-        System.out.println(data);
-    }
-
-
-    @Autowired
-    private ShipLockAreaStatisticService shipLockAreaStatisticService;
-    @Test
-    public void test6() throws ParseException {
-        HttpResponse execute = HttpUtil.createGet("http://222.66.154.74:8024/xunxiang/ship/open/get-area-statistic").
-                header("secretId", "durr").
-                header("secretKey", "WpEuxS+GyBzT0go10TGJeQjR5reA0LolEkmVzfmS87dU7H7LNP2xYsD1rmGgoEHx8ApuX8GaIPgZsUhOa8wJ+YkfkTsuMC74zMOVCyt5xOw=").execute();
-        HashMap hashMap = JSONObject.parseObject(execute.body(), HashMap.class);
-        ShipLockAreaStatistic shipLockAreaStatistic = JSONObject.parseObject(hashMap.get("data").toString(), ShipLockAreaStatistic.class);
-        shipLockAreaStatistic.setDateTime(DateUtils.stringToDate(DateUtils.dateToString(shipLockAreaStatistic.getDtCreate(),"yyyy-MM-dd"),"yyyy-MM-dd"));
-        shipLockAreaStatistic.setTotal(shipLockAreaStatistic.getInsideCount() + shipLockAreaStatistic.getOutsideCount());
-        System.out.println(shipLockAreaStatistic);
-        shipLockAreaStatisticService.saveOrUpdate(shipLockAreaStatistic);
-    }
-}