|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.glxp.sale.admin.controller.basic;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.db.sql.Order;
|
|
|
|
|
import com.glxp.sale.admin.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.sale.admin.dao.basic.UdiInfoDao;
|
|
|
|
|
import com.glxp.sale.admin.entity.auth.AuthAdmin;
|
|
|
|
@ -8,6 +9,7 @@ import com.glxp.sale.admin.entity.basic.*;
|
|
|
|
|
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.inout.*;
|
|
|
|
|
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.param.SyncDataBustypeEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.thrsys.*;
|
|
|
|
|
import com.glxp.sale.admin.req.auth.AuthAdminQueryRequest;
|
|
|
|
@ -270,8 +272,6 @@ public class SpsSyncDownloadService {
|
|
|
|
|
OrderService orderService;
|
|
|
|
|
@Resource
|
|
|
|
|
CodesService codesService;
|
|
|
|
|
@Resource
|
|
|
|
|
OrderDetailService orderDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) {
|
|
|
|
@ -284,45 +284,74 @@ public class SpsSyncDownloadService {
|
|
|
|
|
if (syncDataSetEntity.isOrderUnReceive()) {
|
|
|
|
|
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
|
|
|
|
|
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
|
|
|
|
|
orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes());
|
|
|
|
|
if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) {
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
orderEntities.addAll(temps);
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
|
|
|
|
|
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
|
|
|
|
|
List<String> filterList = new ArrayList<>();
|
|
|
|
|
filterList.add(syncDataBustypeEntity.getAction());
|
|
|
|
|
orderFilterRequest.setFilterActions(filterList);
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
for (OrderEntity orderEntity : temps) {
|
|
|
|
|
if (orderEntity.getFromType() != ConstantStatus.FROM_UDIWMS) {
|
|
|
|
|
orderEntity.setSyncOutChange(syncDataBustypeEntity.isOutChange());
|
|
|
|
|
orderEntities.add(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (syncDataSetEntity.isOrderUnCheck()) {
|
|
|
|
|
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
|
|
|
|
|
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
|
|
|
|
|
orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes());
|
|
|
|
|
if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) {
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
orderEntities.addAll(temps);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
|
|
|
|
|
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
|
|
|
|
|
List<String> filterList = new ArrayList<>();
|
|
|
|
|
filterList.add(syncDataBustypeEntity.getAction());
|
|
|
|
|
orderFilterRequest.setFilterActions(filterList);
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
for (OrderEntity orderEntity : temps) {
|
|
|
|
|
if (orderEntity.getFromType() != ConstantStatus.FROM_UDIWMS) {
|
|
|
|
|
orderEntity.setSyncOutChange(syncDataBustypeEntity.isOutChange());
|
|
|
|
|
orderEntities.add(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (syncDataSetEntity.isOrderScanFinish()) {
|
|
|
|
|
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
|
|
|
|
|
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
|
|
|
|
|
orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes());
|
|
|
|
|
if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) {
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
orderEntities.addAll(temps);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
|
|
|
|
|
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
|
|
|
|
|
List<String> filterList = new ArrayList<>();
|
|
|
|
|
filterList.add(syncDataBustypeEntity.getAction());
|
|
|
|
|
orderFilterRequest.setFilterActions(filterList);
|
|
|
|
|
orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS);
|
|
|
|
|
orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED);
|
|
|
|
|
List<OrderEntity> temps = orderService.findAllByTime(orderFilterRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(temps)) {
|
|
|
|
|
for (OrderEntity orderEntity : temps) {
|
|
|
|
|
if (orderEntity.getFromType() != ConstantStatus.FROM_UDIWMS) {
|
|
|
|
|
orderEntity.setSyncOutChange(syncDataBustypeEntity.isOutChange());
|
|
|
|
|
orderEntities.add(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|