From b1f14b710a489d50962f202716b883f5913301e3 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Wed, 2 Mar 2022 14:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=EF=BC=8C=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=80=E6=9D=A5=E4=BB=93=E5=BA=93=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E4=BB=93=E5=BA=93=EF=BC=8C=E8=B4=A7=E4=BD=8D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/admin/constant/ConstantStatus.java | 13 + .../basic/BussinessChangeTypeController.java | 18 +- .../basic/UdiRelevanceController.java | 2 +- .../inout/StockOrderController.java | 5 + .../controller/inout/WareHouseController.java | 7 +- .../inventory/InvPreProductsController.java | 8 + .../inventory/InvProductsController.java | 10 + .../inventory/InvWarehouseController.java | 7 + .../admin/dao/inventory/InvPreProductDao.java | 4 + .../admin/dao/inventory/InvProductDao.java | 7 +- .../basic/BussinessChangeTypeEntity.java | 1 + .../entity/basic/BussinessTypeEntity.java | 4 +- .../sale/admin/entity/inout/OrderEntity.java | 2 +- .../admin/entity/inout/StockOrderEntity.java | 1 + .../admin/entity/inout/WarehouseEntity.java | 7 +- .../sale/admin/req/inout/AddOrderRequest.java | 2 +- .../req/inout/StockOrderPostRequest.java | 3 +- .../admin/req/inout/WarehouseSaveRequest.java | 1 + .../FilterInvProductDetailRequest.java | 4 + .../inventory/FilterInvProductRequest.java | 2 + .../admin/res/basic/BussinessTypResponse.java | 4 +- .../res/inventory/InvProductResponse.java | 1 + .../inventory/InvPreProductService.java | 2 +- .../inventory/InvProductDetailService.java | 1 + .../service/inventory/InvProductService.java | 2 +- .../inventory/InvWarehouseService.java | 5 + .../impl/InvPreProductServiceImpl.java | 25 +- .../impl/InvProductDetailServiceImpl.java | 8 + .../inventory/impl/InvProductServiceImpl.java | 23 +- .../impl/InvWarehouseServiceImpl.java | 22 ++ .../admin/thread/InvProductsTrService.java | 348 +++++++++++++++--- .../thread/InvProductsTrService_back.java | 6 +- .../admin/thread/IoTransInoutService.java | 103 ++++-- .../main/resources/application-pro.properties | 4 +- .../mapper/basic/BussinessChangeTypeDao.xml | 6 +- .../mapper/basic/BussinessOriginTypeDao.xml | 2 +- .../mybatis/mapper/basic/BussinessTypeDao.xml | 11 +- .../mybatis/mapper/basic/UdiInfoDao.xml | 3 +- .../mybatis/mapper/inout/CodesDao.xml | 11 +- .../mybatis/mapper/inout/CodesTempDao.xml | 8 +- .../mybatis/mapper/inout/OrderDao.xml | 8 +- .../mybatis/mapper/inout/StockOrderDao.xml | 6 +- .../mapper/inventory/InvPreProductDao.xml | 50 ++- .../inventory/InvPreProductDetailDao.xml | 12 + .../mapper/inventory/InvProductDao.xml | 49 ++- .../mapper/inventory/InvProductDetailDao.xml | 13 +- 46 files changed, 698 insertions(+), 143 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java index cd4abad..83705dd 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java @@ -74,6 +74,12 @@ public class ConstantStatus { public static final int CORP_INTTERNAL = 3; //内部科室等 + //往来信息类型-单据 + public static final int CORP_TYPE_INPUT = 2; //病人 + public static final int CORP_TYPE_OUT = 0; //供应商 + public static final int CORP_TYPE_INNOR = 1; //内部科室等 + + //单据来源 public static final int FROM_UDIMS = 1; //1.UDIMS平台 public static final int FROM_WEBNEW = 2; //网页新增 @@ -90,4 +96,11 @@ public class ConstantStatus { public static final int DITYPE_OWN = 3; //本体标识 public static final int DITYPE_PACK = 4; //包装标识 + //流转单据类型 + public static final int ORDER_CHANGE_NORMAL_IN = 1; //补采购入库 + public static final int ORDER_CHANGE_NORMAL_ADV_IN = 2; //补寄售转入 + public static final int ORDER_CHANGE_ADVANCE_IN = 3; //补寄售入库 + public static final int ORDER_CHANGE_ADVANCE_OUT = 4; //补寄售出库 + + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java index 0d74bd3..bba8343 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java @@ -1,6 +1,7 @@ package com.glxp.sale.admin.controller.basic; import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.constant.ConstantType; import com.glxp.sale.admin.dao.basic.BussinessChangeTypeDao; import com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity; @@ -57,26 +58,35 @@ public class BussinessChangeTypeController { if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) { BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity(); bussinessChangeTypeEntity1.setIntro("入库自动补\"寄售出库单\""); + bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_OUT); bussinessChangeTypeEntity1.setIndex(1); bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction()); bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1); - - } else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) { - bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction()); + } else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) { BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity(); bussinessChangeTypeEntity1.setIntro("出库自动补\"采购入库单\""); + bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_NORMAL_IN); bussinessChangeTypeEntity1.setIndex(1); bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction()); bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1); + BussinessChangeTypeEntity bussinessChangeTypeEntity2 = new BussinessChangeTypeEntity(); + bussinessChangeTypeEntity2.setIntro("出库自动补\"寄售转入单\""); + bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_NORMAL_ADV_IN); + bussinessChangeTypeEntity2.setIndex(2); + bussinessChangeTypeEntity2.setAction(bussinessTypeFilterRequest.getAction()); + bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity2); + bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction()); } else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) { - bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction()); + BussinessChangeTypeEntity bussinessChangeTypeEntity1 = new BussinessChangeTypeEntity(); bussinessChangeTypeEntity1.setIntro("出库自动补\"寄售入库单\""); + bussinessChangeTypeEntity1.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_IN); bussinessChangeTypeEntity1.setIndex(1); bussinessChangeTypeEntity1.setAction(bussinessTypeFilterRequest.getAction()); bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity1); + bussinessTypeEntities = bussinessChangeTypeService.findByAction(bussinessTypeFilterRequest.getAction()); } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java index d83c77b..6903217 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java @@ -239,7 +239,7 @@ public class UdiRelevanceController { UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); if (udiInfoEntities == null || udiInfoEntities.isEmpty()) { udiInfoEntities = udiDlHttpClient.getUdiByUuid(key); - if (udiInfoEntities != null) { + if (udiInfoEntities != null && !udiInfoEntities.isEmpty()) { udiInfoService.insertUdiInfos(udiInfoEntities); } else { return ResultVOUtils.error(500, "连接UDI数据下载服务出错!"); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java index 3078bcf..2447553 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java @@ -187,6 +187,11 @@ public class StockOrderController { stockOrderEntity.setCorpId(companyEntity.getUnitIdFk()); stockOrderEntity.setCorpName(companyEntity.getCompanyName()); stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk()); + } else { + + stockOrderEntity.setCorpId(stockOrderPostRequest.getCorpId()); + stockOrderEntity.setCorpName(stockOrderPostRequest.getCorpName()); + stockOrderEntity.setUnitIdFk(stockOrderPostRequest.getUnitIdFk()); } stockOrderEntity.setCustomerId(stockOrderPostRequest.getCustomerId()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java index 1176b89..f1e0389 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java @@ -213,8 +213,8 @@ public class WareHouseController { @GetMapping("warehouse/inout/submitOrderWeb") public BaseResponse submitOrderWeb(AddOrderRequest orderEntity) { orderService.updateOrderStatus(orderEntity.getOrderId(), ConstantStatus.ORDER_STATUS_PROCESS); - saveOrderWeb(orderEntity); - return ResultVOUtils.success(); + return saveOrderWeb(orderEntity); +// return ResultVOUtils.success(); } @@ -225,6 +225,7 @@ public class WareHouseController { BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction()); orderEntity1.setAction(addOrderRequest.getAction()); orderEntity1.setMainAction(bussinessTypeEntity.getMainAction()); + orderEntity1.setLocStorageCode(addOrderRequest.getLocStorageCode()); orderService.updateOrder(orderEntity1); return ResultVOUtils.success(); } @@ -272,6 +273,7 @@ public class WareHouseController { orderSaveRequest.setAction(bussinessTypeEntity.getAction()); orderSaveRequest.setActor(addOrderRequest.getActor()); orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId()); + orderSaveRequest.setLocStorageCode(addOrderRequest.getLocStorageCode()); // orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId()); // orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp()); orderSaveRequest.setFromType(ConstantStatus.FROM_WEBNEW); @@ -311,6 +313,7 @@ public class WareHouseController { warehouseEntity.setNameCode(udiEntity.getUdi()); warehouseEntity.setExpireDate(udiEntity.getExpireDate()); warehouseEntity.setSerialNo(udiEntity.getSerialNo()); + warehouseEntity.setLocStorageCode(addOrderRequest.getLocStorageCode()); warehouseEntity.setCount(1); List warehouseEntityList = new ArrayList<>(); warehouseEntityList.add(warehouseEntity); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java index 571d29d..04a7a37 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java @@ -3,6 +3,7 @@ package com.glxp.sale.admin.controller.inventory; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.constant.ConstantType; +import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; import com.glxp.sale.admin.req.inout.DeleteRequest; @@ -13,6 +14,7 @@ import com.glxp.sale.admin.res.inventory.InvProductDetailResponse; import com.glxp.sale.admin.res.inventory.InvProductPageRespnonse; import com.glxp.sale.admin.res.inventory.InvProductResponse; import com.glxp.sale.admin.res.inventory.InvProductStatResponse; +import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inventory.InvPreProductDetailService; import com.glxp.sale.admin.service.inventory.InvPreProductService; import com.glxp.sale.admin.service.inventory.InvProductDetailService; @@ -39,6 +41,8 @@ public class InvPreProductsController { InvPreProductService invProductService; @Resource InvPreProductDetailService invProductDetailService; + @Resource + private CompanyService companyService; @GetMapping("spms/pre/inv/products/filter") public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) { @@ -46,6 +50,10 @@ public class InvPreProductsController { if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); showSup = true; + } else { + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId())); + filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); + filterInvProductRequest.setCustomerId(null); } List invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest); PageInfo pageInfo; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java index 3283379..537713e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java @@ -5,6 +5,7 @@ import com.glxp.sale.admin.constant.Constant; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.constant.ConstantType; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; +import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; @@ -22,6 +23,7 @@ import com.glxp.sale.admin.res.inventory.InvProductResponse; import com.glxp.sale.admin.res.inventory.InvProductStatResponse; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvProductDetailService; import com.glxp.sale.admin.service.inventory.InvProductService; @@ -57,6 +59,8 @@ public class InvProductsController { private UdiRelevanceService udiRelevanceService; @Resource private UdiInfoService udiInfoService; + @Resource + private CompanyService companyService; @GetMapping("spms/inv/products/filter") public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) { @@ -64,7 +68,12 @@ public class InvProductsController { if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); showSup = true; + } else { + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId())); + filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); + filterInvProductRequest.setCustomerId(null); } +// filterInvProductRequest.setGroupType("invStorageCode"); List invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(invProductResponses); @@ -81,6 +90,7 @@ public class InvProductsController { if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); } + filterInvProductRequest.setSupId(null); List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(invProductDetailEntities); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java index 4d6ba17..ae315b8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java @@ -50,6 +50,13 @@ public class InvWarehouseController { return ResultVOUtils.success(restMap); } + @GetMapping("spms/inv/warehouse/filterAll") + public BaseResponse filterAllInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest) { + filterInvWarehouseRequest.setPid(0); + List invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest); + return ResultVOUtils.success(invWarehouseEntities); + } + public List merge(List invWarehouseEntities, Integer pid) { List invWarehouseResponses = new ArrayList<>(); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreProductDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreProductDao.java index 9da9ced..66fde7f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreProductDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreProductDao.java @@ -20,6 +20,10 @@ public interface InvPreProductDao { boolean updateInvProduct(InvProductEntity invProductEntity); + InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo, + @Param("supId") String supId, @Param("invStorageCode") String invStorageCode, + @Param("invWarehouseCode") String invWarehouseCode); + InvProductEntity selectById(@Param("id") String id); boolean deleteById(@Param("id") String id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvProductDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvProductDao.java index 2d2da8d..8ed0582 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvProductDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvProductDao.java @@ -20,7 +20,12 @@ public interface InvProductDao { boolean updateInvProduct(InvProductEntity invProductEntity); - InvProductEntity selectById(@Param("id") String id); + InvProductEntity selectById(@Param("id") String id); + + InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo, + @Param("supId") String supId, @Param("invStorageCode") String invStorageCode, + @Param("invWarehouseCode") String invWarehouseCode); + boolean deleteById(@Param("id") String id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessChangeTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessChangeTypeEntity.java index 0dd6e1b..6c34360 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessChangeTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessChangeTypeEntity.java @@ -14,6 +14,7 @@ public class BussinessChangeTypeEntity { private Integer beforeTime; private String remark; private String name; + private Integer changeType; public Integer getBeforeTime() { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java index d4089af..02e4183 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java @@ -13,7 +13,7 @@ public class BussinessTypeEntity { private String thirdSysFk; private String localAction; private String localName; - private Boolean checkEnable; + private boolean checkEnable; private boolean advanceType; private boolean genUnit; private boolean innerOrder; @@ -35,5 +35,7 @@ public class BussinessTypeEntity { private boolean secCheckWebNew; private boolean secCheckChange; + private int corpType; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/OrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/OrderEntity.java index 7c906c5..92c3eb5 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/OrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/OrderEntity.java @@ -33,6 +33,6 @@ public class OrderEntity { private Integer dlCount; private String invStorageCode; private String invWarehouseCode; - + private String locStorageCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java index 866466d..c0c7051 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java @@ -27,4 +27,5 @@ public class StockOrderEntity { private String thirdOrderFk; private String orderIdFk; private BigDecimal totalPrice; + private String locStorageCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java index 2816a9f..e1213d6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java @@ -29,12 +29,13 @@ public class WarehouseEntity { private String invWarehouseCode; private String relId; private Integer status; + private String locStorageCode; public String getSupId() { - if (supId == null) { - return fromCorpId; - } +// if (supId == null) { +// return fromCorpId; +// } return supId; } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java index 3f4dce6..b6b257c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java @@ -17,7 +17,7 @@ public class AddOrderRequest { private Integer fromType; private String actDate; private String billType; - + private String locStorageCode; private String orderId; private String customerId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java index 57886be..b4f329b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java @@ -22,8 +22,9 @@ public class StockOrderPostRequest { private String type; private String sourceType; private String printStatus; + private String locStorageCode; private BigDecimal price; - + private String unitIdFk; private List subErpOrders; private String customerId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java index 43d0725..75d5b00 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java @@ -26,4 +26,5 @@ public class WarehouseSaveRequest { private String customerId; private String nameCode; + private String locStorageCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductDetailRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductDetailRequest.java index 55c3edc..74be048 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductDetailRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductDetailRequest.java @@ -23,4 +23,8 @@ public class FilterInvProductDetailRequest extends ListPageRequest { private String supId; private String originCode; + + private String invStorageCode; + private String invWarehouseCode; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java index 9ebd932..bb185a8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java @@ -22,4 +22,6 @@ public class FilterInvProductRequest extends ListPageRequest { private String unitFk; private String invStorageCode; private String invWarehouseCode; + + private String groupType; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java index f26be9f..f13ee53 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java @@ -20,7 +20,7 @@ public class BussinessTypResponse { private Boolean advanceType; //是否预入库 private Boolean changeEnable; private Boolean genUnit; - private Boolean innerOrder; +// private Boolean innerOrder; private Boolean spUse; private String localName; private Boolean secCheckEnable; @@ -39,5 +39,5 @@ public class BussinessTypResponse { private boolean secCheckPc; private boolean secCheckWebNew; private boolean secCheckChange; - + private int corpType; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/inventory/InvProductResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/inventory/InvProductResponse.java index 8eb31c7..9fb7d5c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/inventory/InvProductResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/inventory/InvProductResponse.java @@ -21,6 +21,7 @@ public class InvProductResponse { private String companyName; private String supId; private String unitFk; + private String invStorageName; public Integer getInCount() { if (inCount == null) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductService.java index ba08416..885435c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductService.java @@ -12,7 +12,7 @@ public interface InvPreProductService { List filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); - InvProductEntity selectByUuid(String uuid, String batchNo,String supId); + InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode); InvProductEntity selectById(String id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java index c911a54..265f970 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java @@ -10,6 +10,7 @@ import java.util.List; public interface InvProductDetailService { + List findByCode(String code); List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductService.java index 69f7195..c9f25f7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductService.java @@ -13,7 +13,7 @@ public interface InvProductService { List filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); - InvProductEntity selectByUuid(String uuid, String batchNo,String supId); + InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode); InvProductEntity selectById(String id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvWarehouseService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvWarehouseService.java index b951906..857c918 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvWarehouseService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvWarehouseService.java @@ -8,6 +8,9 @@ import java.util.List; public interface InvWarehouseService { + + InvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault); + List filterInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest); List filterGroupInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest); @@ -18,6 +21,8 @@ public interface InvWarehouseService { InvWarehouseEntity selectById(String id); + InvWarehouseEntity selectByCode(String code); + boolean deleteById(String id); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java index b73f170..6907923 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java @@ -49,16 +49,21 @@ public class InvPreProductServiceImpl implements InvPreProductService { } @Override - public InvProductEntity selectByUuid(String uuid, String batchNo, String supId) { - FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); - filterInvProductRequest.setRelIdFk(uuid); - filterInvProductRequest.setBatchNo(batchNo); - filterInvProductRequest.setSupId(supId); - List data = filterInvProduct(filterInvProductRequest); - if (data != null && data.size() > 0) { - return data.get(0); - } - return null; + public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) { + + return invPreProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode); + + // FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); +// filterInvProductRequest.setRelIdFk(uuid); +// filterInvProductRequest.setBatchNo(batchNo); +// filterInvProductRequest.setSupId(supId); +// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode); +// filterInvProductRequest.setInvStorageCode(invStorageCode); +// List data = filterInvProduct(filterInvProductRequest); +// if (data != null && data.size() > 0) { +// return data.get(0); +// } +// return null; } @Override diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java index 2b14883..f6aa540 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java @@ -19,6 +19,14 @@ public class InvProductDetailServiceImpl implements InvProductDetailService { @Resource InvProductDetailDao invProductDetailDao; + @Override + public List findByCode(String code) { + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setCode(code); + List invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); + return invProductDetailEntities; + } + @Override public List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { if (filterInvProductDetailRequest == null) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductServiceImpl.java index 4e62f2e..f102cc4 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductServiceImpl.java @@ -45,16 +45,19 @@ public class InvProductServiceImpl implements InvProductService { } @Override - public InvProductEntity selectByUuid(String uuid, String batchNo, String customerId) { - FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); - filterInvProductRequest.setRelIdFk(uuid); - filterInvProductRequest.setBatchNo(batchNo); - filterInvProductRequest.setSupId(customerId); - List data = filterInvProduct(filterInvProductRequest); - if (data != null && data.size() > 0) { - return data.get(0); - } - return null; + public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) { +// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); +// filterInvProductRequest.setRelIdFk(uuid); +// filterInvProductRequest.setBatchNo(batchNo); +// filterInvProductRequest.setSupId(supId); +// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode); +// filterInvProductRequest.setInvStorageCode(invStorageCode); +// List data = filterInvProduct(filterInvProductRequest); +// if (data != null && data.size() > 0) { +// return data.get(0); +// } +// return null; + return invProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode); } @Override diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvWarehouseServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvWarehouseServiceImpl.java index 9ab44a9..6808e3d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvWarehouseServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvWarehouseServiceImpl.java @@ -20,6 +20,18 @@ public class InvWarehouseServiceImpl implements InvWarehouseService { @Resource InvWarehouseDao invWarehouseDao; + @Override + public InvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault) { + + FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); + filterInvWarehouseRequest.setIsDefault(isDefault); + filterInvWarehouseRequest.setAdvanceType(advaceType); + List invWarehouseEntities = invWarehouseDao.filterInvWarehouse(filterInvWarehouseRequest); + if (invWarehouseEntities != null && invWarehouseEntities.size() > 0) + return invWarehouseEntities.get(0); + return null; + } + @Override public List filterInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest) { if (filterInvWarehouseRequest == null) { @@ -61,6 +73,16 @@ public class InvWarehouseServiceImpl implements InvWarehouseService { return invWarehouseDao.selectById(id); } + @Override + public InvWarehouseEntity selectByCode(String code) { + FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); + filterInvWarehouseRequest.setCode(code); + List invWarehouseEntities = invWarehouseDao.filterInvWarehouse(filterInvWarehouseRequest); + if (invWarehouseEntities != null && invWarehouseEntities.size() > 0) + return invWarehouseEntities.get(0); + return null; + } + @Override public boolean deleteById(String id) { return invWarehouseDao.deleteById(id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java index 810aeff..42f1aae 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java @@ -8,7 +8,9 @@ import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; +import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.res.basic.BussinessTypResponse; @@ -17,10 +19,7 @@ import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse; import com.glxp.sale.admin.service.basic.*; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; -import com.glxp.sale.admin.service.inventory.InvPreProductDetailService; -import com.glxp.sale.admin.service.inventory.InvPreProductService; -import com.glxp.sale.admin.service.inventory.InvProductDetailService; -import com.glxp.sale.admin.service.inventory.InvProductService; +import com.glxp.sale.admin.service.inventory.*; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.util.CustomUtil; import com.glxp.sale.admin.util.DateUtil; @@ -78,6 +77,8 @@ public class InvProductsTrService { SystemParamConfigService systemParamConfigService; @Resource IOOrderStatusService ioOrderStatusService; + @Resource + InvWarehouseService invWarehouseService; @Async public void genInvProducts(String orderId) { @@ -106,7 +107,8 @@ public class InvProductsTrService { ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities); if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 InvProductEntity invPreProductEntity = - invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()); + invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId() + , warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); if (invPreProductEntity == null) { invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invPreProductService.insertInvProduct(invPreProductEntity); @@ -121,7 +123,8 @@ public class InvProductsTrService { invPreProductService.updateInvProduct(invPreProductEntity); } } else { //普通出入库 - InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()); + InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), + warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); if (invProductEntity == null) { invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invProductEntity.setUnitFk(orderEntity.getFromCorpId()); @@ -168,24 +171,29 @@ public class InvProductsTrService { } //单据流转 - BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeService.findFirstByAction(bussinessLocalTypeEntity.getLocalAction()); - if (bussinessLocalTypeEntity.getChangeEnable() && bussinessChangeTypeEntity != null) { + List bussinessChangeTypeEntitys = bussinessChangeTypeService.findByAction(bussinessLocalTypeEntity.getLocalAction()); + if ((bussinessChangeTypeEntitys != null && bussinessChangeTypeEntitys.size() > 0) && bussinessLocalTypeEntity.getChangeEnable()) { //普通出库 if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) { - List datas = addOutOrder(orderEntity, mInvProductDetailEntities);//1.先计算现有库存, -// insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 - List temps = filterMapCodes(datas); - buildInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据 + + //补采购入库或寄售转入单 +// List datas = addOutOrder(orderEntity, mInvProductDetailEntities);//1.先计算现有库存, +// List temps = filterMapCodes(datas); + + addUseOutOrder(orderEntity, mInvProductDetailEntities, bussinessChangeTypeEntitys); + } else if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) //普通入库补单 { + BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0); List datas = addPutOrder(orderEntity, mInvProductDetailEntities); List temps = filterMapCodes(datas); // insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 buildPreOutOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据 } else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) { //寄售出库补单 + BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0); List datas = addPreOutOrder(orderEntity, mInvProductDetailEntities); List temps = filterMapCodes(datas); // insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 @@ -199,34 +207,136 @@ public class InvProductsTrService { } - //普通出库补单 - public List addOutOrder(OrderEntity orderEntity, List invProductDetailEntities) { + //普通出库补单-- //补采购入库或寄售转入单 + public void addUseOutOrder(OrderEntity orderEntity, List invProductDetailEntities, List bussinessChangeTypeEntities) { + + + List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); + List inList = new ArrayList<>(); + List preiInList = new ArrayList<>(); + for (WarehouseEntity warehouseEntity : warehouseEntities) { + + if (isAdavnce(warehouseEntity)) {//补寄售转入 + + //获取普通出入库结余数量 + int actCount = getActCount(warehouseEntity); + int count = 0; + UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); + String code = warehouseEntity.getCode(); + if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY + || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { + warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); + code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity); + count = actCount * warehouseEntity.getCount(); + } else { + count = warehouseEntity.getCount(); + } + int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId()); + if (invCount <= 0) { + invCount = getCountByOrder(null, code, warehouseEntity.getSupId()); + } + + if (invCount > 0) { + if (count > invCount) { + int lea = count - invCount; + warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); + preiInList.add(warehouseEntity); + } + } else { + warehouseEntity.setCount(count); + preiInList.add(warehouseEntity); + } + InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); + insetInvSingle(false, invProductDetailEntity); + warehouseEntity.setCode(code); + + } else { + //获取普通出入库结余数量 + int actCount = getActCount(warehouseEntity); + int count = 0; + UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); + String code = warehouseEntity.getCode(); + if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY + || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { + warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); + code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity); + count = actCount * warehouseEntity.getCount(); + } else { + count = warehouseEntity.getCount(); + } + int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId()); + if (invCount <= 0) { + invCount = getCountByOrder(null, code, warehouseEntity.getSupId()); + } + if (invCount > 0) { + if (count > invCount) { + int lea = count - invCount; + warehouseEntity.setCount(lea / getActCount(warehouseEntity)); + inList.add(warehouseEntity); + } + } else { + warehouseEntity.setCount(count); + inList.add(warehouseEntity); + } + InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); + insetInvSingle(false, invProductDetailEntity); + warehouseEntity.setCode(code); + } + + } + BussinessChangeTypeEntity advChangeTypeEntity = null; + BussinessChangeTypeEntity norChangeTypeEntity = null; + for (BussinessChangeTypeEntity bussinessChangeTypeEntity : bussinessChangeTypeEntities) { + if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_ADV_IN) { + advChangeTypeEntity = bussinessChangeTypeEntity; + } else if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_IN) { + norChangeTypeEntity = bussinessChangeTypeEntity; + } + } + if (inList.size() > 0) { + List temps = filterMapCodes(inList); + buildInOrder(norChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据 + } + + if (preiInList.size() > 0) { + List temps1 = filterMapCodes(preiInList); + buildNorPreInOrder(advChangeTypeEntity, temps1, orderEntity); //3.补寄售转入 + } + + + } + + + public List addOutOrder(OrderEntity + orderEntity, List invProductDetailEntities) { List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); List inList = new ArrayList<>(); for (WarehouseEntity warehouseEntity : warehouseEntities) { //获取普通出入库结余数量 int actCount = getActCount(warehouseEntity); + int count = 0; UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); String code = warehouseEntity.getCode(); if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity); -// warehouseEntity.setCode(code); -// warehouseEntity.setCount(actCount * warehouseEntity.getCount()); + count = actCount * warehouseEntity.getCount(); + } else { + count = warehouseEntity.getCount(); } int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId()); if (invCount <= 0) { invCount = getCountByOrder(null, code, warehouseEntity.getSupId()); } if (invCount > 0) { - int count = actCount * warehouseEntity.getCount(); if (count > invCount) { int lea = count - invCount; - warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); + warehouseEntity.setCount(lea / actCount); inList.add(warehouseEntity); } } else { + warehouseEntity.setCount(count); inList.add(warehouseEntity); } InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); @@ -237,21 +347,12 @@ public class InvProductsTrService { } //普通入库补单 - public List addPutOrder(OrderEntity orderEntity, List invProductDetailEntities) { + public List addPutOrder(OrderEntity + orderEntity, List invProductDetailEntities) { List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); List preOutList = new ArrayList<>(); for (WarehouseEntity warehouseEntity : warehouseEntities) { - //获取普通出入库结余数量 - FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); -// filterInvProductDetailRequest.setCode(warehouseEntity.getCode()); - filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId()); - filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId()); - List detailJoinResponseList - = invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest); - UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId()); - if ((detailJoinResponseList != null && detailJoinResponseList.size() > 0) - || (udiRelevanceEntity.getIsAdavence() != null && udiRelevanceEntity.getIsAdavence()) - ) { + if (isAdavnce(warehouseEntity)) { preOutList.add(warehouseEntity); } InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); @@ -261,21 +362,24 @@ public class InvProductsTrService { } //寄售出库补单 - public List addPreOutOrder(OrderEntity orderEntity, List invProductDetailEntities) { + public List addPreOutOrder(OrderEntity + orderEntity, List invProductDetailEntities) { List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); List prePutList = new ArrayList<>(); for (WarehouseEntity warehouseEntity : warehouseEntities) { -// int actCount = getActCount(warehouseEntity); + int actCount = getActCount(warehouseEntity); + int count = 0; String code = warehouseEntity.getCode(); UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity); -// warehouseEntity.setCode(code); -// warehouseEntity.setCount(actCount * warehouseEntity.getCount()); + count = actCount * warehouseEntity.getCount(); + } else { + count = warehouseEntity.getCount(); } //获取寄售出入库结余数量 int invCount = getPreCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId()); @@ -283,13 +387,13 @@ public class InvProductsTrService { invCount = getPreCountByOrder(null, code, warehouseEntity.getSupId()); } if (invCount > 0) { - int count = getActCount(warehouseEntity) * warehouseEntity.getCount(); if (count > invCount) { int lea = count - invCount; - warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); + warehouseEntity.setCount(lea / (getActCount(warehouseEntity.getCode()))); prePutList.add(warehouseEntity); } } else { + warehouseEntity.setCount(count); prePutList.add(warehouseEntity); } InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); @@ -320,6 +424,8 @@ public class InvProductsTrService { if (preOutList == null || preOutList.size() <= 0) { return; } + InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(orderEntity.getLocStorageCode()); + InvWarehouseEntity defaultWarehouseEntity = invWarehouseService.findDefault(true, true); //寄售出库生成单据 CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(Constant.SYSTEM_CUSTOMER_ID)); OrderEntity outOrder = new OrderEntity(); @@ -338,14 +444,18 @@ public class InvProductsTrService { outOrder.setErpFk(null); outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); outOrder.setId(CustomUtil.getId()); - outOrder.setFromCorp(companyEntity.getCompanyName()); - outOrder.setFromCorpId(companyEntity.getUnitIdFk()); + outOrder.setFromCorp(invWarehouseEntity.getName()); + outOrder.setFromCorpId(invWarehouseEntity.getCode()); + outOrder.setLocStorageCode(defaultWarehouseEntity.getCode()); +// outOrder.setFromCorp(companyEntity.getCompanyName()); +// outOrder.setFromCorpId(companyEntity.getUnitIdFk()); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : preOutList) { warehouseEntity.setOrderId(outOrder.getId()); - warehouseEntity.setFromCorp(orderEntity.getFromCorp()); - warehouseEntity.setFromCorpId(orderEntity.getFromCorpId()); + warehouseEntity.setFromCorp(invWarehouseEntity.getName()); + warehouseEntity.setFromCorpId(invWarehouseEntity.getCode()); warehouseEntity.setId(null); + warehouseEntity.setLocStorageCode(defaultWarehouseEntity.getCode()); warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); warehouseEntity.setMainAction(ConstantType.TYPE_OUT); } @@ -402,12 +512,14 @@ public class InvProductsTrService { BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName); outOrder.setFromCorp(basicUnitMaintainEntity.getName()); outOrder.setFromCorpId(corpName); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); warehouseEntity.setId(null); warehouseEntity.setFromCorp(outOrder.getFromCorp()); warehouseEntity.setFromCorpId(outOrder.getFromCorpId()); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); warehouseEntity.setMainAction(ConstantType.TYPE_PUT); } @@ -437,6 +549,7 @@ public class InvProductsTrService { outOrder.setFromCorp(null); outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); outOrder.setFromCorpId(null); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); orderService.insertOrder(outOrder); warehouseEntity.setOrderId(outOrder.getId()); warehouseEntity.setId(null); @@ -444,6 +557,7 @@ public class InvProductsTrService { warehouseEntity.setMainAction(ConstantType.TYPE_PUT); warehouseEntity.setFromCorp(null); warehouseEntity.setFromCorpId(null); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); codesTempService.insertCodesTempSingle(warehouseEntity); } @@ -459,7 +573,7 @@ public class InvProductsTrService { //采购入库生成单据 Map> filterSupMaps = new HashMap<>(); List unkonwCorpList = new ArrayList<>(); - +// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); //根据库存,过滤供应商,条码分组 for (WarehouseEntity warehouseEntity : useInList) { if (warehouseEntity.getSupId() != null) { @@ -491,6 +605,7 @@ public class InvProductsTrService { BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName); outOrder.setFromCorp(basicUnitMaintainEntity.getName()); outOrder.setFromCorpId(corpName); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); if ("1".equals(systemParamConfigEntity.getParamValue())) { outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); @@ -504,6 +619,7 @@ public class InvProductsTrService { warehouseEntity.setId(null); warehouseEntity.setFromCorp(outOrder.getFromCorp()); warehouseEntity.setFromCorpId(outOrder.getFromCorpId()); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); warehouseEntity.setMainAction(ConstantType.TYPE_PUT); } @@ -531,6 +647,7 @@ public class InvProductsTrService { outOrder.setErpFk(null); outOrder.setId(CustomUtil.getId()); outOrder.setFromCorp(null); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); outOrder.setFromCorpId(null); orderService.insertOrder(outOrder); warehouseEntity.setOrderId(outOrder.getId()); @@ -539,6 +656,109 @@ public class InvProductsTrService { warehouseEntity.setMainAction(ConstantType.TYPE_PUT); warehouseEntity.setFromCorp(null); warehouseEntity.setFromCorpId(null); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); + codesTempService.insertCodesTempSingle(warehouseEntity); + } + + + } + + + //生成寄售转入单据 + public void buildNorPreInOrder(BussinessChangeTypeEntity + bussinessChangeTypeEntity, List useInList, OrderEntity orderEntity) { + if (useInList.size() <= 0) { + return; + } + //采购入库生成单据 + Map> filterSupMaps = new HashMap<>(); + List unkonwCorpList = new ArrayList<>(); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true); + //根据库存,过滤供应商,条码分组 + for (WarehouseEntity warehouseEntity : useInList) { + if (warehouseEntity.getSupId() != null) { + if (filterSupMaps.get(warehouseEntity.getSupId()) == null) { + List temps = new ArrayList<>(); + temps.add(warehouseEntity); + filterSupMaps.put(warehouseEntity.getSupId(), temps); + } else { + filterSupMaps.get(warehouseEntity.getSupId()).add(warehouseEntity); + } + } else + unkonwCorpList.add(warehouseEntity); + } + + //有供应商生成采购入库单据 + for (String corpName : filterSupMaps.keySet()) { + List temps; + temps = filterSupMaps.get(corpName); + OrderEntity outOrder = new OrderEntity(); + BeanUtils.copyProperties(orderEntity, outOrder); + outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setAction(bussinessChangeTypeEntity.getScAction()); + outOrder.setMainAction(ConstantType.TYPE_PUT); + outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); + outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); + outOrder.setFromCorp(invWarehouseEntity.getName()); + outOrder.setFromCorpId(invWarehouseEntity.getCode()); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); + outOrder.setErpFk(null); + outOrder.setFromType(ConstantStatus.FROM_CHANGE); + outOrder.setId(CustomUtil.getId()); +// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName); +// outOrder.setFromCorp(basicUnitMaintainEntity.getName()); +// outOrder.setFromCorpId(corpName); + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); + if ("1".equals(systemParamConfigEntity.getParamValue())) { + outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); + } else { + outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); + } + + orderService.insertOrder(outOrder); + for (WarehouseEntity warehouseEntity : temps) { + warehouseEntity.setOrderId(outOrder.getId()); + warehouseEntity.setId(null); + warehouseEntity.setFromCorp(outOrder.getFromCorp()); + warehouseEntity.setFromCorpId(outOrder.getFromCorpId()); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); + warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); + warehouseEntity.setMainAction(ConstantType.TYPE_PUT); + } + codesTempService.insertCodesTemp(temps); +// ioTransInoutService.transInout(outOrder.getId()); + } + + + //无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据 + for (WarehouseEntity warehouseEntity : unkonwCorpList) { + OrderEntity outOrder = new OrderEntity(); + BeanUtils.copyProperties(orderEntity, outOrder); + outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setAction(bussinessChangeTypeEntity.getScAction()); + outOrder.setMainAction(ConstantType.TYPE_PUT); + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); + if ("1".equals(systemParamConfigEntity.getParamValue())) { + outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); + } else { + outOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); + } + + outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); + outOrder.setRemark("未选择供应商"); + outOrder.setErpFk(null); + outOrder.setId(CustomUtil.getId()); + outOrder.setFromCorp(invWarehouseEntity.getName()); + outOrder.setFromCorpId(invWarehouseEntity.getCode()); + outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); + orderService.insertOrder(outOrder); + warehouseEntity.setOrderId(outOrder.getId()); + warehouseEntity.setId(null); + warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); + warehouseEntity.setMainAction(ConstantType.TYPE_PUT); + warehouseEntity.setFromCorp(outOrder.getFromCorp()); + warehouseEntity.setFromCorpId(outOrder.getFromCorpId()); + warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); codesTempService.insertCodesTempSingle(warehouseEntity); } @@ -547,7 +767,8 @@ public class InvProductsTrService { //生成库存 - private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity orderEntity, WarehouseEntity warehouseEntity) { + private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity + orderEntity, WarehouseEntity warehouseEntity) { InvProductEntity invProductEntity = new InvProductEntity(); invProductEntity.setRelIdFk(relId); invProductEntity.setBatchNo(erpOrderEntity.getBatchNo()); @@ -560,6 +781,8 @@ public class InvProductsTrService { invProductEntity.setProductsName(erpOrderEntity.getCoName()); invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany()); invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode()); + invProductEntity.setInvStorageCode(warehouseEntity.getInvStorageCode()); + invProductEntity.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode()); int count = getActCount(warehouseEntity) * warehouseEntity.getCount(); if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { invProductEntity.setOutCount(count); @@ -600,6 +823,8 @@ public class InvProductsTrService { invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate()); invProductDetailEntity.setAction(warehouseEntity.getAction()); invProductDetailEntity.setMainAction(orderEntity.getMainAction()); + invProductDetailEntity.setInvStorageCode(warehouseEntity.getInvStorageCode()); + invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode()); invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId()); invProductDetailEntity.setCount(actCount * warehouseEntity.getCount()); if (purchaseType != null) { @@ -657,7 +882,8 @@ public class InvProductsTrService { } - public InvProductDetailEntity filterInvByCode(List invProductDetailEntities, String code) { + public InvProductDetailEntity filterInvByCode(List invProductDetailEntities, String + code) { for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { if (invProductDetailEntity.getOriginCode().equals(code)) { @@ -683,6 +909,22 @@ public class InvProductsTrService { return 1; } + public int getActCount(String code) { + UdiEntity udiEntity = FilterUdiUtils.getUdi(code); + UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); + if (udiInfoBean != null) { + if (udiInfoBean.getIsUseDy() == 1 && udiInfoBean.getDiType() != 2) { + if (udiInfoBean.getBhzxxsbzsl() == 0) + return udiInfoBean.getZxxsbzbhsydysl(); + else + return udiInfoBean.getZxxsbzbhsydysl() * udiInfoBean.getBhzxxsbzsl(); + } else { + return udiInfoBean.getBhzxxsbzsl(); + } + } + return 1; + } + public boolean isMutiPack(WarehouseEntity warehouseEntity) { UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode()); List udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid()); @@ -696,8 +938,6 @@ public class InvProductsTrService { UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode()); List udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid()); if (udiInfoBean != null) { - - for (UdiInfoEntity udiInfoEntity : udiInfoEntities) { if (udiInfoBean.getIsUseDy() == 1) { if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY) { @@ -827,4 +1067,22 @@ public class InvProductsTrService { return results; } + + //判断是否是寄售产品 + public boolean isAdavnce(WarehouseEntity warehouseEntity) { + //获取普通出入库结余数量 + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); +// filterInvProductDetailRequest.setCode(warehouseEntity.getCode()); + filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId()); + filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId()); + List detailJoinResponseList + = invPreProductDetailService.filterJoinInvProduct(filterInvProductDetailRequest); + UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId()); + if ((detailJoinResponseList != null && detailJoinResponseList.size() > 0) + || (udiRelevanceEntity.getIsAdavence() != null && udiRelevanceEntity.getIsAdavence()) + ) { + return true; + } else return false; + } + } \ No newline at end of file diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java index d488be6..95f2a0c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java @@ -95,7 +95,8 @@ public class InvProductsTrService_back { ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities); if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 InvProductEntity invPreProductEntity = - invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()); + invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), + warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); if (invPreProductEntity == null) { invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); // if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { @@ -125,7 +126,8 @@ public class InvProductsTrService_back { invPreProductService.updateInvProduct(invPreProductEntity); } } else { //普通出入库 - InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()); + InvProductEntity invProductEntity = invProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo() + , warehouseEntity.getSupId(), warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); if (invProductEntity == null) { invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); // if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java index 0bbc4dc..f222841 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java @@ -14,6 +14,8 @@ import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity; import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; import com.glxp.sale.admin.entity.inout.*; +import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.httpclient.ErpOrderClient; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; @@ -27,6 +29,8 @@ import com.glxp.sale.admin.service.basic.UdiRelevanceService; import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; +import com.glxp.sale.admin.service.inventory.InvProductDetailService; +import com.glxp.sale.admin.service.inventory.InvWarehouseService; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.service.thrsys.ThrDataService; import com.glxp.sale.admin.service.thrsys.ThrOrderService; @@ -85,6 +89,11 @@ public class IoTransInoutService { CompanyProductRelevanceService companyProductRelevanceService; @Resource CompanyService companyService; + @Resource + InvWarehouseService invWarehouseService; + + @Resource + InvProductDetailService invProductDetailService; //web端新增订单, @Async @@ -170,6 +179,7 @@ public class IoTransInoutService { orderSaveRequest.setCorpOrderId(warehouseEntity.getCorpOrderId()); orderSaveRequest.setFromCorpId(warehouseEntity.getFromCorpId()); orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId()); + orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode()); orderSaveRequest.setMainAction(warehouseEntity.getMainAction()); orderSaveRequest.setReceiveStatus(0); orderSaveRequest.setFromCorp(warehouseEntity.getFromCorp()); @@ -242,24 +252,43 @@ public class IoTransInoutService { orderService.updateOrder(orderEntity); basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity); } - if (!Constant.SYSTEM_CUSTOMER_ID.equals(orderEntity.getFromCorpId())) { - BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(orderEntity.getFromCorpId()); - if (basicUnitMaintainEntity == null) { - orderEntity.setRemark("往来单位不存在!"); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL); - orderService.updateOrder(orderEntity); - return; - } - } - +// if (!Constant.SYSTEM_CUSTOMER_ID.equals(orderEntity.getFromCorpId())) { +// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(orderEntity.getFromCorpId()); +// if (basicUnitMaintainEntity == null) { +// orderEntity.setRemark("往来单位不存在!"); +// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL); +// orderService.updateOrder(orderEntity); +// return; +// } +// } WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest(); warehouseQueryRequest.setOrderId(orderEntity.getId()); List filterList = codesTempService.findByOrderId(warehouseQueryRequest); List insertList = new ArrayList<>(); + orderEntity.setInvStorageCode(orderEntity.getLocStorageCode()); + orderService.updateOrder(orderEntity); + + if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INNOR) { + if (orderEntity.getInvStorageCode() == null) { + orderEntity.setRemark("未选择当前仓库信息"); + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_FAIL); + orderService.updateOrder(orderEntity); + } + + + } else if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { + if (orderEntity.getInvStorageCode() == null) { + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(bussinessTypeEntity.isAdvanceType(), true); + orderEntity.setInvStorageCode(invWarehouseEntity.getCode()); + orderService.updateOrder(orderEntity); + } + } + for (int j = 0; j < filterList.size(); j++) { WarehouseEntity warehouseEntity = filterList.get(j); + warehouseEntity.setInvStorageCode(orderEntity.getLocStorageCode()); String result = new InoutUtils().filterCode(warehouseService, warehouseEntity, systemParamConfigService); if (result == null) { insertList.add(warehouseEntity); @@ -300,7 +329,10 @@ public class IoTransInoutService { //转入正式表后,更换单据状态,等待校验或已完成 public void transStatus(String orderId) { //todo 改成等待校验,选择校验 + OrderEntity orderEntity = orderService.findById(orderId); + String action = orderEntity.getAction(); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(action); List warehouseEntityList = warehouseService.findByReceiptId(orderId); myErpOrderService.deleteByOrderId(orderEntity.getId()); //为所有条码关联基础信息关联表ID @@ -318,22 +350,33 @@ public class IoTransInoutService { warehouseEntity.setStatus(0); if (warehouseEntity.getRelId() == null) warehouseEntity.setRelId(udiRelevanceEntities.get(0).getId() + ""); - String originSupId = checkOriginExitSup(warehouseEntity); - String supId = null; - if (originSupId == null) - supId = checkExitSup(warehouseEntity.getRelId()); - else - supId = originSupId; - if (supId != null) {//&& !supId.equals("MUTI") + if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { + String originSupId = checkOriginExitSup(warehouseEntity); + String supId = null; + if (originSupId == null) { + supId = checkExitSup(warehouseEntity.getRelId()); + if (supId == null) { + supId = checkInvExitSup(warehouseEntity); + } + } else + supId = originSupId; + if (supId != null) {//&& !supId.equals("MUTI") + warehouseEntity.setSupId(supId); + } + } else { + String supId = checkExitSup(warehouseEntity.getRelId()); + if (supId == null) { + supId = checkInvExitSup(warehouseEntity); + } warehouseEntity.setSupId(supId); } + } warehouseService.updateCode(warehouseEntity); } - String action = orderEntity.getAction(); - BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(action); - if (!bussinessTypeEntity.getCheckEnable()) { + + if (!bussinessTypeEntity.isCheckEnable()) { orderEntity = orderService.findById(orderEntity.getId()); unCheckFinish(orderEntity, warehouseEntityList); } else { @@ -370,7 +413,7 @@ public class IoTransInoutService { } } genOrderDetail(warehouseEntityList); - checkMutiDi(orderEntity.getId()); //校验一个DI是否绑定多个产品ID + checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID orderEntity = orderService.findById(orderEntity.getId()); if (orderEntity.getContrastStatus() != ConstantStatus.ORDER_CHECK_FAIL) { orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_CHECK); @@ -379,8 +422,9 @@ public class IoTransInoutService { } public void unCheckFinish(OrderEntity orderEntity, List warehouseEntityList) { + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); genOrderDetail(warehouseEntityList); - checkMutiDi(orderEntity.getId()); //校验一个DI是否绑定多个产品ID + checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID orderEntity = orderService.findById(orderEntity.getId()); if (orderEntity.getContrastStatus() != ConstantStatus.ORDER_CHECK_FAIL) { List erpOrderEntities = myErpOrderService.filterAllByOrderIdFk(orderEntity.getId()); @@ -401,6 +445,7 @@ public class IoTransInoutService { } public String checkOriginExitSup(WarehouseEntity warehouseEntity) { + if (ConstantType.TYPE_PUT.equals(warehouseEntity.getMainAction())) { return warehouseEntity.getFromCorpId(); } else if (ConstantType.TYPE_OUT.equals(warehouseEntity.getMainAction())) { @@ -411,7 +456,6 @@ public class IoTransInoutService { return null; } - //校验是否存在供应商 public String checkExitSup(String relId) { //校验条码关联供应商 @@ -428,11 +472,19 @@ public class IoTransInoutService { return null; } + public String checkInvExitSup(WarehouseEntity warehouseEntity) { + List invProductDetailEntities = invProductDetailService.findByCode(warehouseEntity.getCode()); + if (invProductDetailEntities.size() > 0) { + return invProductDetailEntities.get(0).getSupId(); + } + return null; + } + public void genOrderDetail(List warehouseEntityList) { new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList); } - public void checkMutiDi(String orderId) { + public void checkMutiDi(String orderId, BussinessTypeEntity bussinessTypeEntity) { //校验是否di绑定多个产品ID OrderEntity orderEntity = orderService.findById(orderId); FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest(); @@ -441,7 +493,6 @@ public class IoTransInoutService { if (erpOrderEntities != null && erpOrderEntities.size() > 0) { for (ErpOrderEntity erpOrderEntity : erpOrderEntities) { - //校验DI是否绑定多个产品ID FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode()); @@ -454,7 +505,7 @@ public class IoTransInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); orderService.updateOrder(orderEntity); } else { - if (erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI")) { + if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT && (erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI"))) { if (erpOrderEntity.getSupId() == null) { erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_NONE); orderEntity.setRemark("该产品未绑定供应商"); diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index b6bea87..0b10735 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -33,9 +33,9 @@ logging.file=D:/1s/udiwms/udiwms.log file_path=D:/1s/udiwms #UDI\u6570\u636E\u4E0B\u8F7D UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df -#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test +UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test #UDI_SERVER_URL=http://127.0.0.1:9994 -UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server +#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server #UCLOD\u670D\u52A1 #UCLOD_SERVER_URL=http://127.0.0.1:9997 #UCLOD_SERVER_URL=http://127.0.0.1:8080/UDIC_UCLOUD_SERVER diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml index e35e9a4..82604e8 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml @@ -17,12 +17,12 @@ parameterType="com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity"> insert INTO basic_bustype_pre - (action, scAction, `index`, remark, beforeTime,intro) + (action, scAction, `index`, remark, beforeTime,intro,changeType) values (#{action}, #{scAction}, #{index}, #{remark}, - #{beforeTime},#{intro}) + #{beforeTime},#{intro},#{changeType}) @@ -34,6 +34,8 @@ beforeTime = #{beforeTime}, remark = #{remark}, intro = #{intro}, + changeType = #{changeType}, + WHERE id = #{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml index d740aec..3a7767f 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml @@ -23,7 +23,7 @@ select basic_bustype_origin.name, basic_bustype_origin.action thirdAction, basic_bussiness_type.action, - basic_bustype_local.action localAction + basic_bustype_local.action localAction, from basic_bustype_origin LEFT JOIN basic_bussiness_type on basic_bussiness_type.thirdAction = basic_bustype_origin.action LEFT JOIN basic_bustype_local on basic_bustype_local.originAction = basic_bustype_origin.action diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml index 904411b..62daa73 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -15,7 +15,7 @@ basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange, basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType, basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder, - basic_bustype_local.spUse + basic_bustype_local.spUse,corpType FROM basic_bussiness_type LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = basic_bustype_local.action @@ -83,7 +83,7 @@ (action,name,enable,remark,mainAction,localAction,thirdSysFk, checkEnable,genUnit,innerOrder,secCheckEnable, checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange - ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange) + ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange,corpType) values ( #{action}, @@ -108,7 +108,7 @@ #{secCheckPdaUn}, #{secCheckPc}, #{secCheckWebNew}, - #{secCheckChange} + #{secCheckChange},#{corpType} ) @@ -121,7 +121,7 @@ (`index`,action,name,enable,remark,mainAction,localAction,thirdSysFk, checkEnable,genUnit,innerOrder,secCheckEnable, checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange - ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange) + ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,secCheckChange,corpType) values ( #{index}, @@ -147,7 +147,7 @@ #{secCheckPdaUn}, #{secCheckPc}, #{secCheckWebNew}, - #{secCheckChange} + #{secCheckChange},#{corpType} ) @@ -178,6 +178,7 @@ secCheckWebNew=#{secCheckWebNew}, secCheckChange=#{secCheckChange}, index=#{index}, + corpType=#{corpType}, thirdSysFk=#{thirdSysFk}, WHERE id = #{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml index 65e75db..6e1eac7 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml @@ -116,8 +116,7 @@ nameCode,packRatio,packLevel,bhxjsl, bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey, cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber - ,diType,productType - ) + ,diType,productType) values ( #{nameCode}, diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml index 727163d..e410dd5 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml @@ -39,7 +39,7 @@ INSERT INTO io_codes(action, mainAction, code, corpOrderId, actor, actDate, fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo, count, packageLevel, warehouseCode, nameCode, supId, relId, status, - invStorageCode,invWarehouseCode) + invStorageCode, invWarehouseCode, locStorageCode) values (#{action}, #{mainAction}, #{code}, @@ -49,7 +49,7 @@ #{fromCorpId}, #{fromCorp}, #{orderId}, #{batchNo}, #{produceDate}, #{expireDate}, #{serialNo}, #{count}, #{packageLevel}, #{warehouseCode}, - #{nameCode}, #{supId}, #{relId}, #{status}, #{invStorageCode}, #{invWarehouseCode}) + #{nameCode}, #{supId}, #{relId}, #{status}, #{invStorageCode}, #{invWarehouseCode}, #{locStorageCode}) @@ -61,7 +61,8 @@ actor, actDate, fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate, - serialNo,count,packageLevel,warehouseCode,nameCode,supId, relId,status,invStorageCode,invWarehouseCode) + serialNo,count,packageLevel,warehouseCode,nameCode,supId, + relId,status,invStorageCode,invWarehouseCode,locStorageCode) VALUES @@ -81,7 +82,7 @@ ,#{item.serialNo} ,#{item.count} ,#{item.packageLevel} ,#{item.warehouseCode},#{item.nameCode},#{item.supId} - ,#{item.relId},#{item.status},#{item.invStorageCode},#{item.invWarehouseCode}) + ,#{item.relId},#{item.status},#{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode}) @@ -161,6 +162,8 @@ supId=#{supId}, invStorageCode=#{invStorageCode}, invWarehouseCode=#{invWarehouseCode}, + locStorageCode=#{locStorageCode}, + WHERE id=#{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml index 3cfa175..1a8add3 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml @@ -9,7 +9,7 @@ (action, mainAction,code, corpOrderId, actor,actDate, fromCorpId, fromCorp, orderId,batchNo,produceDate,expireDate,serialNo, - count,nameCode,supId,invStorageCode,invWarehouseCode) + count,nameCode,supId,invStorageCode,invWarehouseCode,locStorageCode) VALUES @@ -28,7 +28,7 @@ ,#{item.expireDate} ,#{item.serialNo} ,#{item.count},#{item.nameCode},#{item.supId}, - #{item.invStorageCode},#{item.invWarehouseCode} + #{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode} ) @@ -38,7 +38,7 @@ parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity"> INSERT INTO io_codes_temp(action, mainAction, code, corpOrderId, actor, actDate, fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo, - count, nameCode, supId, invStorageCode, invWarehouseCode) + count, nameCode, supId, invStorageCode, invWarehouseCode,locStorageCode) values (#{action}, #{mainAction}, #{code}, @@ -52,7 +52,7 @@ #{produceDate}, #{expireDate}, #{serialNo}, - #{count}, #{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode}) + #{count}, #{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode},#{locStorageCode}) + SELECT * + FROM inv_pre_product + + + relIdFk = #{relIdFk} + and invStorageCode = #{invStorageCode} + + AND supId = #{supId} + + + AND supId is NULL + + + AND invWarehouseCode = #{invWarehouseCode} + + + AND invWarehouseCode is NULL + + + + + + AND originCode = #{originCode} + + AND invStorageCode = #{invStorageCode} + + + AND invWarehouseCode = #{invWarehouseCode} + @@ -85,6 +91,12 @@ AND originCode = #{originCode} + + AND invStorageCode = #{invStorageCode} + + + AND invWarehouseCode = #{invWarehouseCode} + diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml index 47f8f8d..702f5a0 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml @@ -43,8 +43,17 @@ AND unitFk = #{unitFk} - + + AND invStorageCode = #{invStorageCode} + + + AND invWarehouseCode = #{invWarehouseCode} + + + + GROUP BY #{groupType} + + SELECT * + FROM inv_product + + relIdFk = #{relIdFk} + and invStorageCode = #{invStorageCode} + + AND supId = #{supId} + + + AND supId is NULL + + + AND invWarehouseCode = #{invWarehouseCode} + + + AND invWarehouseCode is NULL + + + + + diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml index 8a55353..19c3bc4 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml @@ -42,7 +42,12 @@ AND originCode = #{originCode} - + + AND invStorageCode = #{invStorageCode} + + + AND invWarehouseCode = #{invWarehouseCode} + @@ -87,6 +92,12 @@ AND originCode = #{originCode} + + AND invStorageCode = #{invStorageCode} + + + AND invWarehouseCode = #{invWarehouseCode} +