From 92e5beb3ae5205b7bd0378ce37f24f974967ef6a Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 30 Jun 2022 14:46:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E7=A0=81=E5=8D=95=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=90=8C=E6=AD=A5=E6=97=B6udi=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE=E8=A2=AB=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=9A=E5=8A=A1=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=BC=9A=E6=9F=A5=E8=AF=A2=E5=85=A8=E9=83=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/StockOrderController.java | 31 ++++++++----------- .../controller/inout/OrderController.java | 3 -- .../inventory/InvSubWarehouseController.java | 3 ++ .../glxp/api/admin/thread/DlBasicService.java | 16 ++++++++-- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java index 72577538..db0e858e 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java @@ -278,25 +278,20 @@ public class StockOrderController { } List stockOrderEntityList; - if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) { - Integer userId = customerService.getUserId(); - stockOrderFilterRequest.setUnitIdFk(null); - stockOrderFilterRequest.setUserId(customerService.getUserId()); - if (StrUtil.isNotEmpty(stockOrderFilterRequest.getLocStorageCode())) { - InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderFilterRequest.getLocStorageCode()); - FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); - filterInvUserRequest.setCode(invWarehouseEntity.getCode()); - filterInvUserRequest.setUserid(userId.longValue()); - filterInvUserRequest.setIsDirector(true); - List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); - if (CollUtil.isEmpty(warehouseUserEntities)) { - stockOrderFilterRequest.setUnionUser(userId); - } - } else { - return ResultVOUtils.error(500, "请先选择当前仓库"); - } - stockOrderFilterRequest.setCorpId(null); + Integer userId = customerService.getUserId(); + stockOrderFilterRequest.setUnitIdFk(null); + stockOrderFilterRequest.setUserId(customerService.getUserId()); + if (StrUtil.isNotEmpty(stockOrderFilterRequest.getLocStorageCode())) { + InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderFilterRequest.getLocStorageCode()); + FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); + filterInvUserRequest.setCode(invWarehouseEntity.getCode()); + filterInvUserRequest.setUserid(userId.longValue()); + filterInvUserRequest.setIsDirector(true); + List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); + } else { + return ResultVOUtils.error(500, "请先选择当前仓库"); } + stockOrderFilterRequest.setCorpId(null); stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest); PageInfo pageInfo; diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java index c9306021..247d1d2b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java @@ -205,9 +205,6 @@ public class OrderController { filterInvUserRequest.setUserid(userId.longValue()); filterInvUserRequest.setIsDirector(true); List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); - if (CollUtil.isEmpty(warehouseUserEntities)) { - orderFilterRequest.setUnionUser(userId); - } } else { return ResultVOUtils.error(500, "请先选择当前仓库"); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java index 3487f651..c93f7f0b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java @@ -1,6 +1,7 @@ package com.glxp.api.admin.controller.inventory; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.glxp.api.admin.annotation.AuthRuleAnnotation; import com.glxp.api.admin.entity.auth.AuthAdmin; import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; @@ -57,6 +58,8 @@ public class InvSubWarehouseController { // return ResultVOUtils.error(500, "用户或仓库不能未空!"); // } + + AuthAdmin authAdmin = customerService.getUserBean(); if (filterInvWarehouseRequest.getFilter() == null || filterInvWarehouseRequest.getFilter() == 1) { filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue()); 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 16e4381b..13b0a9fc 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 @@ -32,6 +32,7 @@ import com.glxp.api.admin.res.basic.SpsSyncDataResponse; import com.glxp.api.admin.res.basic.SpsSyncOrderResponse; import com.glxp.api.admin.service.basic.BasicDownloadService; import com.glxp.api.admin.service.basic.BussinessChangeTypeService; +import com.glxp.api.admin.service.basic.BussinessTypeService; import com.glxp.api.admin.service.basic.EntrustReceService; import com.glxp.api.admin.service.info.SystemParamConfigService; import com.glxp.api.admin.service.inout.OrderService; @@ -89,6 +90,8 @@ public class DlBasicService { @Resource private BasicDownloadService basicDownloadService; @Resource + private BussinessTypeService bussinessTypeService; + @Resource private SystemParamConfigService systemParamConfigService; private static final Logger logger = LoggerFactory.getLogger(DlBasicService.class); @@ -355,8 +358,17 @@ public class DlBasicService { List bussinessTypeEntities = syncDataResponse.getBussinessTypeEntities(); BussinessTypeDao mapper = batchSession.getMapper(BussinessTypeDao.class); for (BussinessTypeEntity bussinessTypeEntity : bussinessTypeEntities) { - bussinessTypeEntity.setUpdateTime(null); - mapper.insertBussinessType(bussinessTypeEntity); + + //更新或覆盖 + BussinessTypeEntity tempEntity = bussinessTypeService.findBTByAction(bussinessTypeEntity.getAction()); + if (tempEntity != null) { + BeanUtils.copyProperties(bussinessTypeEntity, tempEntity); + bussinessTypeEntity.setUpdateTime(null); + mapper.insertBussinessType(tempEntity); + } else { + bussinessTypeEntity.setUpdateTime(null); + mapper.insertBussinessType(bussinessTypeEntity); + } } batchSession.commit(); remark.append("扫码单据类型:").append(syncDataResponse.getBussinessTypeEntities().size()).append("条\n");