24282 1 yıl önce
ebeveyn
işleme
fc84baef07

+ 5 - 5
sd-wln/src/main/java/com/sd/wln/scheduled/WlnSyncTask.java

@@ -4,13 +4,14 @@ import com.sd.wln.service.WlnOrderService;
 import com.sd.wln.service.WlnOutboundOrderService;
 import com.sd.wln.service.WlnSkuService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 /**
  * 同步万里牛数据(本地环境不执行同步逻辑)
  */
-// @Profile({"test", "prod"})
+@Profile({"test", "prod"})
 @Component
 public class WlnSyncTask {
 
@@ -26,7 +27,7 @@ public class WlnSyncTask {
     /**
      * 每天凌晨1点同步一次sku信息
      */
-    // @Scheduled(cron = "0 0 1 * * ?")
+    @Scheduled(cron = "0 0 1 * * ?")
     // @Scheduled(fixedDelay = 60 * 1000)
     public void syncSku() {
         for (int i = 0; i < 3; i++) {
@@ -47,7 +48,7 @@ public class WlnSyncTask {
     /**
      * 每分钟同步一次订单数据
      */
-    // @Scheduled(fixedDelay = 60 * 1000)
+    @Scheduled(fixedDelay = 3 * 60 * 1000)
     private void syncOrder() {
         wlnOrderService.syncOrder();
     }
@@ -55,10 +56,9 @@ public class WlnSyncTask {
     /**
      * 每5分钟同步一次出库单数据
      */
-    @Scheduled(fixedDelay = 5 * 60 * 1000)
+    @Scheduled(fixedDelay = 10 * 60 * 1000)
     private void syncOutboundOrder() {
         wlnOutboundOrderService.syncOutboundOrder();
-        System.out.println();
     }
 
 }

+ 15 - 19
sd-wln/src/main/java/com/sd/wln/util/WlnUtil.java

@@ -112,25 +112,21 @@ public class WlnUtil {
         return json.getJSONArray("data").toJavaList(JSONObject.class);
     }
 
-
-    public static void main(String[] args) throws Exception {
-        // List<JSONObject> skuList = getSkuList(1, 200);
-        //
-        // List<JSONObject> skuClassifyList = getSkuClassifyList();
-        //
-        // long endTime = System.currentTimeMillis();
-        // long startTime = endTime - 1000 * 60 * 60 * 24;
-        // List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
-
-        long endTime = System.currentTimeMillis();
-        long startTime = endTime - 1000 * 60 * 60 * 24 * 7;
-
-        List<JSONObject> outboundOrder = getOutboundOrder(0, 200, 1690367461000L, 1690367461000L);
-
-        String s = JSONObject.toJSONString(outboundOrder);
-        System.out.println();
-    }
-
+    // public static void main(String[] args) throws Exception {
+    //     List<JSONObject> skuList = getSkuList(1, 200);
+    //
+    //     List<JSONObject> skuClassifyList = getSkuClassifyList();
+    //
+    //     long endTime = System.currentTimeMillis();
+    //     long startTime = endTime - 1000 * 60 * 60 * 24;
+    //     List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
+    //
+    //     long endTime = System.currentTimeMillis();
+    //     long startTime = endTime - 1000 * 60 * 60 * 24 * 7;
+    //     List<JSONObject> outboundOrder = getOutboundOrder(0, 200, 1690367461000L, 1690367461000L);
+    //
+    //     System.out.println();
+    // }
 
     /**
      * post请求