|
|
|
@ -2,6 +2,7 @@ package com.glxp.api.admin.thread;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.glxp.api.admin.constant.Constant;
|
|
|
|
|
import com.glxp.api.admin.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.admin.constant.ThirdSysConstant;
|
|
|
|
|
import com.glxp.api.admin.dao.basic.BasicThirdSysBusApiDao;
|
|
|
|
@ -22,6 +23,7 @@ import com.glxp.api.admin.service.basic.BussinessLocalTypeService;
|
|
|
|
|
import com.glxp.api.admin.service.business.StockOrderService;
|
|
|
|
|
import com.glxp.api.admin.service.info.SyncUploadDataSetService;
|
|
|
|
|
import com.glxp.api.admin.service.inout.OrderService;
|
|
|
|
|
import com.glxp.api.admin.util.RedisUtil;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
@ -45,8 +47,6 @@ public class OrderSubmitTask implements SchedulingConfigurer {
|
|
|
|
|
@Resource
|
|
|
|
|
private ScheduledDao scheduledDao;
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemParamConfigDao systemParamConfigDao;
|
|
|
|
|
@Resource
|
|
|
|
|
private OrderService orderService;
|
|
|
|
|
@Resource
|
|
|
|
|
private StockOrderService stockOrderService;
|
|
|
|
@ -58,10 +58,10 @@ public class OrderSubmitTask implements SchedulingConfigurer {
|
|
|
|
|
private BasicThirdSysBusApiDao basicThirdSysBusApiDao;
|
|
|
|
|
@Resource
|
|
|
|
|
BussinessLocalTypeService bussinessLocalTypeService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
SyncUploadDataSetService syncUploadDataSetService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
|
|
|
@ -85,8 +85,22 @@ public class OrderSubmitTask implements SchedulingConfigurer {
|
|
|
|
|
if (!syncUploadDataSetEntity.isAutoUpload()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
long timeInterval1 = syncUploadDataSetEntity.getOrderSyncTime() * 60 * 1000L;
|
|
|
|
|
long curTime1 = System.currentTimeMillis();
|
|
|
|
|
Long lastTime1 = (Long) redisUtil.get(Constant.LAST_THIRD_UPLOAD_TIME);
|
|
|
|
|
if (lastTime1 == null) {
|
|
|
|
|
lastTime1 = System.currentTimeMillis();
|
|
|
|
|
redisUtil.set(Constant.LAST_THIRD_UPLOAD_TIME, lastTime1);
|
|
|
|
|
}
|
|
|
|
|
if (curTime1 - lastTime1 > timeInterval1) {
|
|
|
|
|
submitOrder(syncUploadDataSetEntity);
|
|
|
|
|
redisUtil.set(Constant.LAST_THIRD_UPLOAD_TIME, curTime1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void submitOrder(SyncUploadDataSetEntity syncUploadDataSetEntity) {
|
|
|
|
|
//查询所有启用的第三方系统的标识
|
|
|
|
|
List<String> thirdIds = basicThirdSysDao.selectEnabledThirdId();
|
|
|
|
|
if (CollUtil.isNotEmpty(thirdIds)) {
|
|
|
|
|