单据同步相关修改

master
anthonywj 2 years ago
parent e5cb4011ee
commit 9a7e2eb57c

@ -22,6 +22,9 @@ public interface IoOrderService {
IoOrderEntity findByBillNo(String billNO);
List<IoOrderEntity> findByStatus(String action, Integer status);
int insertOrder(IoOrderEntity orderEntity);
int insertOrUpdate(IoOrderEntity orderEntity);

@ -135,6 +135,11 @@ public class IoOrderServiceImpl implements IoOrderService {
return orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNO));
}
@Override
public List<IoOrderEntity> findByStatus(String action, Integer status) {
return orderDao.selectList(new QueryWrapper<IoOrderEntity>().eq("action", action).eq("status", status));
}
@Override
public int insertOrder(IoOrderEntity orderEntity) {
orderEntity.setId(null);

@ -75,86 +75,16 @@ public class SpsSyncDownloadService {
//查询数据同步设置
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
List<IoOrderEntity> orderEntities = new ArrayList<>();
//待校验
if (syncDataSetEntity.isOrderUnCheck()) {
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<String> filterList = new ArrayList<>();
filterList.add(syncDataBustypeEntity.getAction());
orderFilterRequest.setActions(filterList);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
List<IoOrderEntity> temps = orderService.filterOrderList(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<IoOrderEntity> temps = orderService.findByStatus(syncDataBustypeEntity.getAction(), syncDataBustypeEntity.getOrderStatus());
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
}
//待核对
if (syncDataSetEntity.isOrderUnCheck()) {
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<String> filterList = new ArrayList<>();
filterList.add(syncDataBustypeEntity.getAction());
orderFilterRequest.setActions(filterList);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK_SUCCESS);
List<IoOrderEntity> temps = orderService.filterOrderList(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
}
}
//待审核
if (syncDataSetEntity.isOrderUnReceive()) {
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<String> filterList = new ArrayList<>();
filterList.add(syncDataBustypeEntity.getAction());
orderFilterRequest.setActions(filterList);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
List<IoOrderEntity> temps = orderService.filterOrderList(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
}
}
//已完成
if (syncDataSetEntity.isOrderScanFinish()) {
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<String> filterList = new ArrayList<>();
filterList.add(syncDataBustypeEntity.getAction());
orderFilterRequest.setActions(filterList);
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_AUDITED);
List<IoOrderEntity> temps = orderService.filterOrderList(orderFilterRequest);
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
}
}
syncOrderResponse.setOrderEntities(orderEntities);
List<IoCodeEntity> codeEntities = new ArrayList<>();
List<IoOrderDetailBizEntity> orderDetailBizEntities = new ArrayList<>();

@ -36,7 +36,7 @@ public class AsyncSpsTask implements SchedulingConfigurer {
scheduledRequest.setCronName("syncIdcSps");
logger.info("syncIdcSps----------------");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduledEntity!=null ? scheduledEntity.getCron() : "* 0/30 * * * ?";
String cron = scheduledEntity != null ? scheduledEntity.getCron() : "* 0/30 * * * ?";
if (cron.isEmpty()) {
logger.error("cron is null");
@ -47,9 +47,8 @@ public class AsyncSpsTask implements SchedulingConfigurer {
}
private void process() {
logger.info("syncIdcSps----process------------");
idcService.asyncSpsTask();
}
logger.info("syncIdcSps----process------------");
idcService.asyncSpsTask();
}
}

Loading…
Cancel
Save