diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java index 5340a534..a8c308e1 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/DlBasicService.java @@ -90,6 +90,9 @@ public class DlBasicService { for (InvWarehouseEntity invWarehouseEntity : syncDataResponse.getInvWarehouseEntities()) { invWarehouseEntity.setUpdateTime(null); + warehouseUserDao.deleteByCode(invWarehouseEntity.getCode()); + warehouseBussinessTypeDao.deleteByCode(invWarehouseEntity.getCode()); + } invWarehouseService.importInvWarehouse(syncDataResponse.getInvWarehouseEntities()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/UpBasicService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/UpBasicService.java index 75c15e14..2d48f21b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/UpBasicService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/UpBasicService.java @@ -90,21 +90,27 @@ public class UpBasicService { BeanUtils.copyProperties(spsSyncDataRequest, filterInvWarehouseRequest); List invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest); syncDataResponse.setInvWarehouseEntities(invWarehouseEntities); - if (CollUtil.isNotEmpty(invWarehouseEntities)) { - //仓库关联单据类型 - FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterInvBusTypeRequest); - List warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest); - syncDataResponse.setWarehouseBussinessTypeEntities(warehouseBussinessTypeEntities); - - //仓库关联用户 - FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterInvBusTypeRequest); - List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); - syncDataResponse.setWarehouseUserEntities(warehouseUserEntities); - } + List mWarehouseBussinessTypeEntities = new ArrayList<>(); + List mWarehouseUserEntities = new ArrayList<>(); + for (InvWarehouseEntity invWarehouseEntity : invWarehouseEntities) { + //仓库关联单据类型 + FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest(); + filterInvBusTypeRequest.setCode(invWarehouseEntity.getCode()); + List warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest); + mWarehouseBussinessTypeEntities.addAll(warehouseBussinessTypeEntities); + //仓库关联用户 + FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); + filterInvUserRequest.setCode(invWarehouseEntity.getCode()); + List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); + mWarehouseUserEntities.addAll(warehouseUserEntities); + + } + syncDataResponse.setWarehouseUserEntities(mWarehouseUserEntities); + syncDataResponse.setWarehouseBussinessTypeEntities(mWarehouseBussinessTypeEntities); + + } } @@ -308,8 +314,8 @@ public class UpBasicService { orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); List temps = orderService.findAllByTime(orderFilterRequest); if (CollUtil.isNotEmpty(temps)) { - for(OrderEntity orderEntity:temps){ - if(orderEntity.getFromType() != ConstantStatus.FROM_UDISP){ + for (OrderEntity orderEntity : temps) { + if (orderEntity.getFromType() != ConstantStatus.FROM_UDISP) { orderEntities.add(orderEntity); } }