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