From 43c7651026a56d0facb1c0aacf56ee63ac1b110b Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 19 May 2022 09:10:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E5=BA=93=E5=AD=98=EF=BC=8C=E6=89=AB=E7=A0=81=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8D=95=E6=8D=AE=E6=A0=B9=E6=8D=AE=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=BA=93=E5=AD=98=E5=88=86=E7=B1=BB=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E8=AE=BE=E7=BD=AE=E7=AD=89=E7=AD=89=EF=BC=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/BussinessOriginTypeController.java | 57 +++- .../basic/SpsSyncDownloadController.java | 289 +++++++++++------- .../controller/basic/UdiInfoController.java | 89 ++++-- .../basic/UdiRelevanceController.java | 13 +- .../inout/StockOrderController.java | 20 +- .../inout/StockOrderDetailController.java | 5 + .../controller/inout/WareHouseController.java | 19 ++ .../inout/utils/CheckOrderUtils.java | 75 ++--- .../inventory/InvPreInProductsController.java | 171 +++++++++++ .../inventory/InvWarehouseController.java | 7 - .../param/SyncDataSetController.java | 50 +++ .../dao/basic/BussinessOriginTypeDao.java | 3 + .../dao/inventory/InvPreInProductDao.java | 31 ++ .../inventory/InvPreInProductDetailDao.java | 31 ++ .../sale/admin/dao/param/SyncDataSetDao.java | 11 + .../basic/BussinessLocalTypeEntity.java | 1 + .../entity/basic/BussinessTypeEntity.java | 1 + .../entity/basic/UdiRelevanceEntity.java | 2 + .../info/CompanyProductRelevanceEntity.java | 4 +- .../admin/entity/inout/ErpOrderEntity.java | 2 +- .../sale/admin/entity/inout/OrderEntity.java | 1 + .../admin/entity/param/SyncDataSetEntity.java | 27 ++ .../sale/admin/req/inout/AddOrderRequest.java | 1 + .../admin/req/inout/OrderFilterRequest.java | 3 + .../admin/res/basic/BussinessTypResponse.java | 1 + .../CompanyProductRelevanceResponse.java | 1 + .../admin/res/param/SyncDataSetResponse.java | 29 ++ .../basic/BussinessOriginTypeService.java | 20 +- .../impl/BussinessOriginTypeServiceImpl.java | 80 +++-- .../InvPreInProductDetailService.java | 29 ++ .../inventory/InvPreInProductService.java | 26 ++ .../InvPreInProductDetailServiceImpl.java | 81 +++++ .../impl/InvPreInProductServiceImpl.java | 76 +++++ .../service/param/SyncDataSetService.java | 12 + .../param/impl/SyncDataSetServiceImpl.java | 46 +++ .../admin/service/receipt/SyncUdiService.java | 32 +- .../admin/thread/AsyncCompanyDlHelper.java | 4 +- .../sale/admin/thread/AsyncDiDlHelper.java | 28 +- .../sale/admin/thread/AsyncDiDlService.java | 5 +- .../sale/admin/thread/AsyncHeartTask.java | 45 ++- .../admin/thread/InvProductsTrService.java | 87 +++--- .../admin/thread/IoTransInoutService.java | 20 +- .../com/glxp/sale/admin/util/Constant.java | 4 +- .../src/main/resources/logback-spring.xml | 4 +- .../mapper/basic/BussinessLocalTypeDao.xml | 12 +- .../mapper/basic/BussinessOriginTypeDao.xml | 9 +- .../mybatis/mapper/basic/BussinessTypeDao.xml | 6 +- .../info/CompanyProductRelevanceDao.xml | 12 +- .../mybatis/mapper/inout/OrderDao.xml | 16 +- .../mybatis/mapper/inout/StockOrderDetail.xml | 19 +- .../mybatis/mapper/inout/WarehouseUserDao.xml | 3 + .../mapper/inventory/InvPreInProductDao.xml | 231 ++++++++++++++ .../inventory/InvPreInProductDetailDao.xml | 273 +++++++++++++++++ .../inventory/InvPreProductDetailDao.xml | 4 +- .../mybatis/mapper/param/SyncDataSetDao.xml | 40 +++ 55 files changed, 1800 insertions(+), 368 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/param/SyncDataSetController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDetailDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/param/SyncDataSetDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/entity/param/SyncDataSetEntity.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/res/param/SyncDataSetResponse.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductDetailService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductServiceImpl.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/param/SyncDataSetService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/param/impl/SyncDataSetServiceImpl.java create mode 100644 api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml create mode 100644 api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml create mode 100644 api-admin/src/main/resources/mybatis/mapper/param/SyncDataSetDao.xml diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessOriginTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessOriginTypeController.java index 3d577ef..7487da7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessOriginTypeController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessOriginTypeController.java @@ -2,19 +2,20 @@ package com.glxp.sale.admin.controller.basic; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.annotation.AuthRuleAnnotation; -import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity; -import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest; +import com.glxp.sale.admin.httpclient.ErpBasicClient; import com.glxp.sale.admin.req.basic.BussinessOriginTypeFilterRequest; +import com.glxp.sale.admin.req.inout.DeleteRequest; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse; -import com.glxp.sale.admin.service.basic.BussinessLocalTypeService; import com.glxp.sale.admin.service.basic.BussinessOriginTypeService; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @@ -23,9 +24,10 @@ import java.util.List; @RestController public class BussinessOriginTypeController { - @Resource private BussinessOriginTypeService bussinessOriginTypeService; + @Resource + ErpBasicClient erpBasicClient; @AuthRuleAnnotation("") @GetMapping("/udiwms/originBusType/filter") @@ -66,4 +68,51 @@ public class BussinessOriginTypeController { return ResultVOUtils.success(pageSimpleResponse); } + + @PostMapping("/udiwms/originBusType/update") + public BaseResponse updateBussinessType(@RequestBody BussinessOriginTypeEntity bussinessTypeEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (bussinessTypeEntity != null) { + bussinessOriginTypeService.updateBusOriginType(bussinessTypeEntity); + } else { + ResultVOUtils.error(999, "参数错误"); + } + return ResultVOUtils.success("更新成功"); + } + + @PostMapping("/udiwms/originBusType/add") + public BaseResponse addBussinessType(@RequestBody BussinessOriginTypeEntity bussinessTypeEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (bussinessTypeEntity != null) { + bussinessOriginTypeService.insertBusOriginType(bussinessTypeEntity); + } else { + return ResultVOUtils.error(999, "参数错误"); + } + return ResultVOUtils.success("更新成功"); + } + + @PostMapping("/udiwms/originBusType/delete") + public BaseResponse delBussinessType(@RequestBody DeleteRequest deleteRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (deleteRequest != null) { + bussinessOriginTypeService.deleteById(deleteRequest.getId()); + } else { + return ResultVOUtils.error(999, "参数错误"); + } + return ResultVOUtils.success("更新成功"); + } + + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java index 759fc09..d849ecf 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java @@ -10,6 +10,7 @@ import com.glxp.sale.admin.entity.inout.ErpOrderEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; import com.glxp.sale.admin.entity.inout.WarehouseEntity; import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; import com.glxp.sale.admin.entity.thrsys.*; import com.glxp.sale.admin.req.basic.*; @@ -24,12 +25,14 @@ import com.glxp.sale.admin.res.basic.SpsSyncDataResponse; import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse; import com.glxp.sale.admin.res.inout.DlOrderResponse; import com.glxp.sale.admin.res.inout.ErpOrderResponse; +import com.glxp.sale.admin.res.param.SyncDataSetResponse; import com.glxp.sale.admin.service.basic.*; import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.inout.CodesService; import com.glxp.sale.admin.service.inout.OrderDetailService; import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvWarehouseService; +import com.glxp.sale.admin.service.param.SyncDataSetService; import com.glxp.sale.admin.service.receipt.ProductInfoService; import com.glxp.sale.admin.service.thrsys.*; import com.glxp.sale.admin.util.BeanUtils; @@ -67,82 +70,97 @@ public class SpsSyncDownloadController { ThrOrderDetailService thrOrderDetailService; @Resource private CompanyProductRelevanceService companyProductRelevanceService; + @Resource + private SyncDataSetService syncDataSetService; @GetMapping("sps/sync/basic") public BaseResponse findProductInfo(SpsSyncDataRequest spsSyncDataRequest) { - //仓库字典 - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); - filterInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest); - - //耗材字典 - FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); - filterUdiInfoRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List udiRelevanceEntities = udiRelevanceService.filterUdiEntity(filterUdiInfoRequest); - List results = new ArrayList<>(); - udiRelevanceEntities.forEach( - item -> { - results.add(item.getUuid() + ""); - } - ); - List udiInfoEntities = new ArrayList<>(); - if (results.size() > 0) - udiInfoEntities = udiInfoDao.batchSelectByUuid(results); - - - //往来单位字典 - BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest(); - basicUnitMaintainFilterRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); - - - //第三方仓库信息 - FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); - filterThrInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest); - - - //第三方往来单位 - FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterThrCorpRequest); - List thrCorpEntities = thrCorpService.filterThrCorps(filterThrCorpRequest); - - //第三方产品信息 - FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterThrProductsRequest); - List thrProductsEntities = thrProductsService.filterThrProductsRequest(filterThrProductsRequest); - - //第三方业务单据 - FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterThrOrderRequest); - List allOrderDetailEntities = new ArrayList<>(); - List thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest); - for (ThrOrderEntity thrOrderEntity : thrOrderEntities) { - FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); - filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); - List thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest); - if (!thrOrderDetailEntities.isEmpty()) { - allOrderDetailEntities.addAll(thrOrderDetailEntities); - } + SpsSyncDataResponse syncDataResponse = new SpsSyncDataResponse(); + SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); + if (syncDataSetEntity.isBasicInv()) { + //仓库字典 + FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); + filterInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest); + syncDataResponse.setInvWarehouseEntities(invWarehouseEntities); } - //供应商产品信息关联表 - FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest); - List companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest); + if (syncDataSetEntity.isBasicProducts()) { + //耗材字典 + FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); + filterUdiInfoRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List udiRelevanceEntities = udiRelevanceService.filterUdiEntity(filterUdiInfoRequest); + List results = new ArrayList<>(); + udiRelevanceEntities.forEach( + item -> { + results.add(item.getUuid() + ""); + } + ); + List udiInfoEntities = new ArrayList<>(); + if (results.size() > 0) + udiInfoEntities = udiInfoDao.batchSelectByUuid(results); + //供应商产品信息关联表 + FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest); + List companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest); - SpsSyncDataResponse syncDataResponse = new SpsSyncDataResponse(); - syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities); - syncDataResponse.setInvWarehouseEntities(invWarehouseEntities); - syncDataResponse.setBasicUnitMaintainEntities(basicUnitMaintainEntities); - syncDataResponse.setThrCorpEntities(thrCorpEntities); - syncDataResponse.setThrInvWarehouseEntities(thrInvWarehouseEntities); - syncDataResponse.setThrOrderDetailEntities(allOrderDetailEntities); - syncDataResponse.setThrOrderEntities(thrOrderEntities); - syncDataResponse.setUdiInfoEntities(udiInfoEntities); - syncDataResponse.setThrProductsEntities(thrProductsEntities); - syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities); + syncDataResponse.setCompanyProductRelevanceEntities(companyProductRelevanceEntities); + syncDataResponse.setUdiInfoEntities(udiInfoEntities); + syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities); + } + + + if (syncDataSetEntity.isBasicCorp()) { + //往来单位字典 + BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest(); + basicUnitMaintainFilterRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); + syncDataResponse.setBasicUnitMaintainEntities(basicUnitMaintainEntities); + } + + if (syncDataSetEntity.isBasicThirdInv()) { + //第三方仓库信息 + FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); + filterThrInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest); + syncDataResponse.setThrInvWarehouseEntities(thrInvWarehouseEntities); + } + + + if (syncDataSetEntity.isBasicThirdCorp()) { + //第三方往来单位 + FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, filterThrCorpRequest); + List thrCorpEntities = thrCorpService.filterThrCorps(filterThrCorpRequest); + syncDataResponse.setThrCorpEntities(thrCorpEntities); + } + + if (syncDataSetEntity.isBasicThirdProducts()) { + //第三方产品信息 + FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, filterThrProductsRequest); + List thrProductsEntities = thrProductsService.filterThrProductsRequest(filterThrProductsRequest); + syncDataResponse.setThrProductsEntities(thrProductsEntities); + } + + if (syncDataSetEntity.isBasicThirdBusOrder()) { + //第三方业务单据 + FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, filterThrOrderRequest); + List allOrderDetailEntities = new ArrayList<>(); + List thrOrderEntities = thrOrderService.filterThrOrder(filterThrOrderRequest); + for (ThrOrderEntity thrOrderEntity : thrOrderEntities) { + FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); + filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); + List thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest); + if (!thrOrderDetailEntities.isEmpty()) { + allOrderDetailEntities.addAll(thrOrderDetailEntities); + } + } + syncDataResponse.setThrOrderDetailEntities(allOrderDetailEntities); + syncDataResponse.setThrOrderEntities(thrOrderEntities); + } return ResultVOUtils.success(syncDataResponse); } @@ -157,19 +175,27 @@ public class SpsSyncDownloadController { @GetMapping("sps/sync/busType") public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) { - BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest); - List bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest); - BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest); - List bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest); - BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, bussinessOriginTypeFilterRequest); - List bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest); + + SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse(); - spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities); - spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities); - spsSyncBusResponse.setBussinessOriginTypeEntities(bussinessOriginTypeEntities); + if (syncDataSetEntity.isTypeScan()) { + BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest); + List bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest); + spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities); + } + if (syncDataSetEntity.isTypeBus()) { + BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest); + List bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest); + spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities); + } + if (syncDataSetEntity.isTypeThird()) { + BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessOriginTypeFilterRequest); + List bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest); + spsSyncBusResponse.setBussinessOriginTypeEntities(bussinessOriginTypeEntities); + } return ResultVOUtils.success(spsSyncBusResponse); } @@ -185,30 +211,74 @@ public class SpsSyncDownloadController { @GetMapping("sps/sync/order") public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) { - OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); -// orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); - List orderEntities = orderService.findAllByTime(orderFilterRequest); - List allOrderDetailEntityList = new ArrayList<>(); - List warehouseEntityList = new ArrayList<>(); - if (CollUtil.isNotEmpty(orderEntities)) { - for (OrderEntity orderEntity : orderEntities) { - List orderDetailEntityList = orderDetailService.filterAllByOrderIdFk(orderEntity.getId()); - if (CollUtil.isNotEmpty(orderDetailEntityList)) { - allOrderDetailEntityList.addAll(orderDetailEntityList); + SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse(); + SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); + if (syncDataSetEntity.isOrderScanFinish()) { + List orderEntities = new ArrayList<>(); + + if (syncDataSetEntity.isOrderScanFinish()) { + OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } + } + + if (syncDataSetEntity.isOrderUnReceive()) { + OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } + } + + if (syncDataSetEntity.isOrderUnCheck()) { + OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } + } + + if (syncDataSetEntity.isOrderScanFinish()) { + OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); + BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); } - List codes = codesService.findByReceiptId(orderEntity.getId()); - if (CollUtil.isNotEmpty(codes)) { - warehouseEntityList.addAll(codes); + } + + + List allOrderDetailEntityList = new ArrayList<>(); + List warehouseEntityList = new ArrayList<>(); + if (CollUtil.isNotEmpty(orderEntities)) { + for (OrderEntity orderEntity : orderEntities) { + List orderDetailEntityList = orderDetailService.filterAllByOrderIdFk(orderEntity.getId()); + if (CollUtil.isNotEmpty(orderDetailEntityList)) { + allOrderDetailEntityList.addAll(orderDetailEntityList); + } + List codes = codesService.findByReceiptId(orderEntity.getId()); + if (CollUtil.isNotEmpty(codes)) { + warehouseEntityList.addAll(codes); + } } } + syncOrderResponse.setOrderEntities(orderEntities); + syncOrderResponse.setOrderDetailEntityList(allOrderDetailEntityList); + syncOrderResponse.setWarehouseEntityList(warehouseEntityList); } - SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse(); - syncOrderResponse.setOrderEntities(orderEntities); - syncOrderResponse.setOrderDetailEntityList(allOrderDetailEntityList); - syncOrderResponse.setWarehouseEntityList(warehouseEntityList); return ResultVOUtils.success(syncOrderResponse); } @@ -221,15 +291,18 @@ public class SpsSyncDownloadController { //udi同步数据 @GetMapping("sps/sync/syncUdis") public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) { - ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); - productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); - UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest(); - udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); - List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); SpSyncUdiResponse spSyncUdiResponse = new SpSyncUdiResponse(); - spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities); - spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList); + SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); + if (syncDataSetEntity.isDbDiProducts()) { + ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); + productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); + UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest(); + udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); + spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities); + spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList); + } return ResultVOUtils.success(spSyncUdiResponse); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java index df355ea..5dee868 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java @@ -1,5 +1,7 @@ package com.glxp.sale.admin.controller.basic; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.github.pagehelper.PageInfo; @@ -22,8 +24,10 @@ import com.glxp.sale.admin.res.basic.ErpProductsResponse; import com.glxp.sale.admin.service.basic.BasicThirdSysDetailService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.receipt.ProductInfoService; import com.glxp.sale.admin.service.receipt.SyncUdiService; import com.glxp.sale.admin.service.thrsys.ThrProductsService; +import com.glxp.sale.admin.thread.AsyncDiDlHelper; import com.glxp.sale.admin.util.FilterUdiUtils; import com.glxp.sale.admin.util.HttpClient; import com.glxp.sale.common.enums.ResultEnum; @@ -59,16 +63,16 @@ public class UdiInfoController { @Resource private ErpBasicClient erpBasicClient; @Resource - HttpClient httpClient; - @Resource SyncUdiService syncUdiService; + @Resource + AsyncDiDlHelper asyncDiDlHelper; + @Resource + ProductInfoService productInfoService; //获取同步库UDI信息 @AuthRuleAnnotation("") @GetMapping("udiwms/udiinfo/filterUdi") public BaseResponse filterUdi(FilterUdiInfoRequest filterUdiInfoRequest) { - Map paramMap = new HashMap<>(16); - String nameCode = null; if (filterUdiInfoRequest.getUdiCode() != null && !filterUdiInfoRequest.getUdiCode().equals("")) { UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiInfoRequest.getUdiCode()); @@ -79,28 +83,66 @@ public class UdiInfoController { } } else nameCode = filterUdiInfoRequest.getNameCode(); - -// paramMap.put("page", productInfoFilterRequest.getPage()); -// paramMap.put("limit", productInfoFilterRequest.getLimit()); -// paramMap.put("ylqxzcrbarmc", productInfoFilterRequest.getYlqxzcrbarmc()); -// paramMap.put("cpmctymc", productInfoFilterRequest.getCpmctymc()); -// paramMap.put("nameCode", nameCode); -// paramMap.put("ggxh", productInfoFilterRequest.getGgxh()); -// paramMap.put("zczbhhzbapzbh", productInfoFilterRequest.getZczbhhzbapzbh()); -// paramMap.put("uuid", productInfoFilterRequest.getUuid()); - - ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); BeanUtils.copyProperties(filterUdiInfoRequest, productInfoFilterRequest); productInfoFilterRequest.setNameCode(nameCode); -// String response = httpClient.mipsGetHead(udiUrl + "/udidl/device/filterUdi", paramMap); + try { + BaseResponse> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); + if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) { + List productInfoEntities = udiDlDeviceResponse.getData().getList(); + List udiInfoEntities = new ArrayList<>(); + if (productInfoEntities != null && productInfoEntities.size() > 0) { + for (ProductInfoEntity productInfoEntity : productInfoEntities) { + UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + List udiRelevanceEntities = udiRelevanceService.selectByUuid(productInfoEntity.getUuid()); + if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) { + BeanUtils.copyProperties(productInfoEntity, udiInfoEntity); + for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) { + if (udiRelevanceEntity.getThirdId() == null && + udiRelevanceEntity.getThirdId2() == null && udiRelevanceEntity.getThirdId1() == null && + udiRelevanceEntity.getThirdId3() == null && udiRelevanceEntity.getThirdId4() == null) { + //不能添加 + udiInfoEntity.setCheck(true); + break; + } else + udiInfoEntity.setCheck(false); + } + + } else { + udiInfoEntity.setCheck(false); + } + udiInfoEntities.add(udiInfoEntity); + } + } + } + return udiDlDeviceResponse; + } catch (Exception e) { + e.printStackTrace(); + return ResultVOUtils.error(500, "连接UDI数据下载服务出错!"); + } + } + + + @AuthRuleAnnotation("") + @GetMapping("udiwms/udiinfo/superSearch") + public BaseResponse superSearch(FilterUdiInfoRequest filterUdiInfoRequest) { + + if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode())) { + return ResultVOUtils.error(500, "DI不能为空!"); + } + ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); + productInfoFilterRequest.setNameCode(filterUdiInfoRequest.getNameCode()); try { -// BaseResponse> udiDlDeviceResponse = -// JSONObject.parseObject(response, new TypeReference>>() { -// }); BaseResponse> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); + if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) { + List productInfoEntityList = asyncDiDlHelper.dlByDi(filterUdiInfoRequest.getNameCode()); + if (CollUtil.isNotEmpty(productInfoEntityList)) { + productInfoService.insertProductInfos(productInfoEntityList); + udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); + } + } if (filterUdiInfoRequest.getIsCheck() != null && filterUdiInfoRequest.getIsCheck()) { List productInfoEntities = udiDlDeviceResponse.getData().getList(); List udiInfoEntities = new ArrayList<>(); @@ -141,17 +183,8 @@ public class UdiInfoController { @GetMapping("udiwms/udiinfo/filterCompany") public BaseResponse filterCompany(UdiCompanyRequest udiCompanyRequest) { -// Map paramMap = new HashMap<>(16); -// paramMap.put("page", productInfoFilterRequest.getPage()); -// paramMap.put("limit", productInfoFilterRequest.getLimit()); -// paramMap.put("ylqxzcrbarmc", productInfoFilterRequest.getYlqxzcrbarmc()); - -// String response = httpClient.mipsGetHead(udiUrl + "/udi/company/filter", paramMap); try { - BaseResponse> udiDlDeviceResponse = syncUdiService.filterCompany(udiCompanyRequest); - -// BaseResponse> udiDlDeviceResponse = (BaseResponse>) JSONObject.parseObject(response, BaseResponse.class); return udiDlDeviceResponse; } catch (Exception e) { e.printStackTrace(); 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 da70ac9..4b26a3d 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 @@ -231,9 +231,9 @@ public class UdiRelevanceController { } WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest(); warehouseQueryRequest.setRelId(ids); - if(StrUtil.isNotEmpty(ids)){ + if (StrUtil.isNotEmpty(ids)) { List warehouseEntityList = warehouseService.findByOrderId(warehouseQueryRequest); - if(CollUtil.isNotEmpty(warehouseEntityList)){ + if (CollUtil.isNotEmpty(warehouseEntityList)) { return ResultVOUtils.error(500, "该产品已被" + warehouseEntityList.get(0).getOrderId() + "订单关联不能删除"); } } @@ -267,6 +267,15 @@ public class UdiRelevanceController { } udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime()); udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + long customerId = customerService.getCustomerId(); + if (customerId != 110) { + if (StrUtil.isNotEmpty(udiRelevanceEntity.getPrice())) { + CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceEntity.getId(), customerId + ""); + companyProductRelevanceEntity.setPrice(udiRelevanceEntity.getPrice()); + companyProductRelevanceService.updateCompanyProductRelevance(companyProductRelevanceEntity); + } + } + return ResultVOUtils.success("更新成功"); } 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 69e5b77..ab76dc3 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 @@ -157,7 +157,7 @@ public class StockOrderController { if (StringUtils.isBlank(stockOrderEntity.getId())) { BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(stockOrderEntity.getBillType()); if (StrUtil.isEmpty(stockOrderPostRequest.getBillNo())) { - String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean("ZY" + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd")); + String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.BUS_ORDER + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd")); stockOrderPostRequest.setBillNo(orderNo); stockOrderEntity.setBillNo(orderNo); } @@ -254,9 +254,6 @@ public class StockOrderController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } List stockOrderEntityList; -// if (stockOrderFilterRequest.getStatus() == null) { -// stockOrderFilterRequest.setStatus(0 + ""); -// } if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCorpId())); @@ -309,7 +306,22 @@ public class StockOrderController { String customerId = getCustomerId(); if (customerId != null) { if (customerId.equals(Constant.SYSTEM_CUSTOMER_ID)) { + Integer userId = customerService.getUserId(); stockOrderFilterRequest.setUnitIdFk(null); + stockOrderFilterRequest.setUserId(userId); + 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, "请先选择当前仓库"); + } } else { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId)); stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java index c1d5da0..365d334 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.controller.inout; +import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.annotation.AuthRuleAnnotation; import com.glxp.sale.admin.constant.ConstantStatus; @@ -48,6 +49,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -286,6 +288,9 @@ public class StockOrderDetailController { stockOrderDetailEntity.setYlqxzcrbarmc(udiInfoEntity.getYlqxzcrbarmc()); stockOrderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh()); stockOrderDetailEntity.setAllowNoBatch(udiInfoEntity.isAllowNoBatch()); + if(StrUtil.isNotEmpty(udiInfoEntity.getPrice())){ + stockOrderDetailEntity.setPrice(new BigDecimal(udiInfoEntity.getPrice())); + } if (stockOrderIdsRequest.getUdiEntity() != null) { UdiEntity udiEntity = stockOrderIdsRequest.getUdiEntity(); stockOrderDetailEntity.setBatchNo(udiEntity.getBatchNo()); 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 78e4225..3ea0287 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 @@ -1,5 +1,6 @@ package com.glxp.sale.admin.controller.inout; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.github.pagehelper.PageInfo; @@ -13,6 +14,7 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; 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.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.exception.JsonException; @@ -20,6 +22,7 @@ import com.glxp.sale.admin.req.basic.CompanyProductRelevanceRequest; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest; import com.glxp.sale.admin.req.inout.*; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.basic.BussinessTypResponse; import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse; @@ -33,6 +36,7 @@ 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.InvPreInProductDetailService; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.thread.IoTransInoutService; import com.glxp.sale.admin.util.*; @@ -259,6 +263,7 @@ public class WareHouseController { orderEntity1.setFromCorpId(addOrderRequest.getFromCorpId()); orderEntity1.setLocStorageCode(addOrderRequest.getLocStorageCode()); orderEntity1.setOutChangeEnable(addOrderRequest.isOutChangeEnable()); + orderEntity1.setPreCheck(addOrderRequest.isPreCheck()); orderEntity1.setUpdateTime(new Date()); orderService.updateOrder(orderEntity1); WarehouseEntity warehouseEntity = new WarehouseEntity(); @@ -325,6 +330,9 @@ public class WareHouseController { } + @Resource + InvPreInProductDetailService invPreInProductDetailService; + //网页端数据上传调用接口 @AuthRuleAnnotation("") @PostMapping("warehouse/inout/addOrderWeb") @@ -387,6 +395,16 @@ public class WareHouseController { } + //预验收校验 + if (addOrderRequest.isPreCheck()) { + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setOriginCode(code); + List invProductDetailEntities = invPreInProductDetailService.filterInvProduct(filterInvProductDetailRequest); + if(CollUtil.isEmpty(invProductDetailEntities)){ + return ResultVOUtils.error(500, "该产品未入库!"); + } + } + String orderId = addOrderRequest.getOrderId(); if (addOrderRequest.getCustomerId() != null && (addOrderRequest.getFromCorpId() == null || "".equals(addOrderRequest.getFromCorpId()))) { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(addOrderRequest.getCustomerId())); @@ -494,6 +512,7 @@ public class WareHouseController { orderSaveRequest.setLocStorageCode(addOrderRequest.getLocStorageCode()); orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId()); orderSaveRequest.setFromCorp(addOrderRequest.getFromCorp()); + orderSaveRequest.setPreCheck(addOrderRequest.isPreCheck()); orderSaveRequest.setFromType(ConstantStatus.FROM_WEBNEW); orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); orderSaveRequest.setExportStatus(ConstantStatus.ORDER_EXPORT_UN); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java index 5bf39ca..55adc0d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java @@ -54,55 +54,58 @@ public class CheckOrderUtils { filterUdiInfoRequest.setNameCode(myErpOrder.getNameCode()); UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(myErpOrder.getBindRlFk()); for (ErpOrderEntity vailOrderEntity : vailOrderEntities) { - if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null - && checkBatchNo(vailOrderEntity, myErpOrder) == null - && checkProductDate(vailOrderEntity, myErpOrder) == null - && checkExpireDate(vailOrderEntity, myErpOrder) == null - && checkWarehouse(vailOrderEntity, myErpOrder) == null - && checkCount(vailOrderEntity, myErpOrder) == null - ) { - - myErpOrder.setErpOrderId(vailOrderEntity.getErpOrderId()); - myErpOrder.setErpCount(vailOrderEntity.getErpCount()); - myErpOrder.setReCount(vailOrderEntity.getReCount()); - myErpOrder.setGoodsname(vailOrderEntity.getGoodsname()); - myErpOrder.setGoodsid(vailOrderEntity.getGoodsid()); - myErpOrder.setStatus("success"); - vailOrderEntity.setStatus("success"); - orderDetailService.updateErpOrder(myErpOrder); - - break; - } else { - errMsg = checkBatchNo(vailOrderEntity, myErpOrder); - if (errMsg == null) { - errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity); + if(!vailOrderEntity.isCheckSuccess()){ + if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null + && checkBatchNo(vailOrderEntity, myErpOrder) == null + && checkProductDate(vailOrderEntity, myErpOrder) == null + && checkExpireDate(vailOrderEntity, myErpOrder) == null + && checkWarehouse(vailOrderEntity, myErpOrder) == null + && checkCount(vailOrderEntity, myErpOrder) == null + ) { + + myErpOrder.setErpOrderId(vailOrderEntity.getErpOrderId()); + myErpOrder.setErpCount(vailOrderEntity.getErpCount()); + myErpOrder.setReCount(vailOrderEntity.getReCount()); + myErpOrder.setGoodsname(vailOrderEntity.getGoodsname()); + myErpOrder.setGoodsid(vailOrderEntity.getGoodsid()); + myErpOrder.setStatus("success"); + vailOrderEntity.setStatus("success"); + vailOrderEntity.setCheckSuccess(true); + orderDetailService.updateErpOrder(myErpOrder); + break; + } else { + errMsg = checkBatchNo(vailOrderEntity, myErpOrder); if (errMsg == null) { - errMsg = checkProductDate(vailOrderEntity, myErpOrder); + errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity); if (errMsg == null) { - errMsg = checkExpireDate(vailOrderEntity, myErpOrder); + errMsg = checkProductDate(vailOrderEntity, myErpOrder); if (errMsg == null) { - errMsg = checkWarehouse(vailOrderEntity, myErpOrder); + errMsg = checkExpireDate(vailOrderEntity, myErpOrder); if (errMsg == null) { - errMsg = checkCount(vailOrderEntity, myErpOrder); - if (errMsg != null) { - myErpOrder.setErpCount(vailOrderEntity.getErpCount()); - myErpOrder.setReCount(vailOrderEntity.getReCount()); - myErpOrder.setGoodsname(vailOrderEntity.getGoodsname()); - myErpOrder.setGoodsid(vailOrderEntity.getGoodsid()); - myErpOrder.setStatus("fail"); - vailOrderEntity.setStatus("fail"); - orderDetailService.updateErpOrder(myErpOrder); - break; + errMsg = checkWarehouse(vailOrderEntity, myErpOrder); + if (errMsg == null) { + errMsg = checkCount(vailOrderEntity, myErpOrder); + if (errMsg != null) { + myErpOrder.setErpCount(vailOrderEntity.getErpCount()); + myErpOrder.setReCount(vailOrderEntity.getReCount()); + myErpOrder.setGoodsname(vailOrderEntity.getGoodsname()); + myErpOrder.setGoodsid(vailOrderEntity.getGoodsid()); + myErpOrder.setStatus("fail"); + vailOrderEntity.setStatus("fail"); + orderDetailService.updateErpOrder(myErpOrder); + break; + } } } } } } - } + } } + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java new file mode 100644 index 0000000..2be146f --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java @@ -0,0 +1,171 @@ +package com.glxp.sale.admin.controller.inventory; + +import cn.hutool.core.collection.CollUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.annotation.AuthRuleAnnotation; +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; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; +import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; +import com.glxp.sale.admin.res.PageSimpleResponse; +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.InvPreInProductDetailService; +import com.glxp.sale.admin.service.inventory.InvPreInProductService; +import com.glxp.sale.admin.util.Constant; +import com.glxp.sale.common.enums.ResultEnum; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@RestController +public class InvPreInProductsController { + + + @Resource + InvPreInProductService invProductService; + @Resource + InvPreInProductDetailService invProductDetailService; + @Resource + private CompanyService companyService; + + @AuthRuleAnnotation("") + @GetMapping("spms/prein/inv/products/filter") + public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) { + boolean showSup = false; + if (Constant.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; + pageInfo = new PageInfo<>(invProductResponses); + InvProductPageRespnonse pageSimpleResponse = new InvProductPageRespnonse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(invProductResponses); + pageSimpleResponse.setShowSup(showSup); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @AuthRuleAnnotation("") + @GetMapping("spms/prein/inv/products/isExist") + public BaseResponse isExistInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { + List invProductResponses = invProductDetailService.filterInvProduct(filterInvProductDetailRequest); + if (CollUtil.isNotEmpty(invProductResponses)) { + return ResultVOUtils.success("success"); + } + return ResultVOUtils.error(501, "库存不存在此产品"); + } + + @AuthRuleAnnotation("") + @GetMapping("spms/prein/inv/products/getAllCode") + public BaseResponse getAllCodees(FilterInvProductDetailRequest filterInvProductDetailRequest) { + List invProductResponses = invProductDetailService.findAllCode(filterInvProductDetailRequest); + if (CollUtil.isNotEmpty(invProductResponses)) { + return ResultVOUtils.success(invProductResponses); + } + return ResultVOUtils.error(501, "未入库"); + } + + + @AuthRuleAnnotation("") + @GetMapping("spms/prein/inv/products/filterDetail") + public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) { + if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { + filterInvProductRequest.setCustomerId(null); + } + List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(invProductDetailEntities); + List invProductDetailResponses = new ArrayList<>(); + if (invProductDetailEntities.size() > 0) { + for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { + InvProductDetailResponse invProductDetailResponse = new InvProductDetailResponse(); + BeanUtils.copyProperties(invProductDetailEntity, invProductDetailResponse); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailResponse.setMainActionStr("出库"); + invProductDetailResponse.setOutCount(invProductDetailEntity.getCount()); + } else { + invProductDetailResponse.setMainActionStr("入库"); + invProductDetailResponse.setInCount(invProductDetailEntity.getCount()); + } + invProductDetailResponses.add(invProductDetailResponse); + } + } + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(invProductDetailResponses); + return ResultVOUtils.success(pageSimpleResponse); + } + + @AuthRuleAnnotation("") + @PostMapping("spms/prein/inv/products/delete") + public BaseResponse deleteInvProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String id = deleteRequest.getId(); + InvProductEntity invProductEntity = invProductService.selectById(id); + if (invProductEntity != null) { + invProductService.deleteById(id); + FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest(); + detailRequest.setSupId(invProductEntity.getSupId()); + detailRequest.setBatchNo(invProductEntity.getBatchNo()); + detailRequest.setProductIdFk(invProductEntity.getRelIdFk()); + invProductDetailService.deleteByProductId(detailRequest); + return ResultVOUtils.success("删除成功"); + } else { + return ResultVOUtils.error(500, "删除失败!"); + } + } + + @AuthRuleAnnotation("") + @GetMapping("spms/prein/inv/products/stat") + public BaseResponse statInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { + + InvProductStatResponse invProductStatResponse = new InvProductStatResponse(); + //统计预入库数量 + FilterInvProductDetailRequest temp1 = new FilterInvProductDetailRequest(); + BeanUtils.copyProperties(filterInvProductDetailRequest, temp1); + temp1.setPurchaseType(ConstantStatus.PRUCHASE_ADVANCE); + invProductStatResponse.setAdvanceCount(invProductDetailService.statCount(temp1)); + //统计普通采购数量 + FilterInvProductDetailRequest temp2 = new FilterInvProductDetailRequest(); + BeanUtils.copyProperties(filterInvProductDetailRequest, temp2); + temp2.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + invProductStatResponse.setCommonCount(invProductDetailService.statCount(temp2)); + //统计入库数量 + FilterInvProductDetailRequest temp3 = new FilterInvProductDetailRequest(); + BeanUtils.copyProperties(filterInvProductDetailRequest, temp3); + temp3.setMainAction(ConstantType.TYPE_PUT); + invProductStatResponse.setInCount(invProductDetailService.statCount(temp3)); + //统计出库数量 + FilterInvProductDetailRequest temp4 = new FilterInvProductDetailRequest(); + BeanUtils.copyProperties(filterInvProductDetailRequest, temp4); + temp4.setMainAction(ConstantType.TYPE_OUT); + invProductStatResponse.setOutCount(invProductDetailService.statCount(temp4)); + return ResultVOUtils.success(invProductStatResponse); + } +} 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 918eb72..3601710 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 @@ -67,8 +67,6 @@ public class InvWarehouseController { @Resource InvProductDetailService invProductDetailService; @Resource - BussinessTypeService bussinessTypeService; - @Resource WarehouseBussinessTypeService warehouseBussinessTypeService; @@ -293,11 +291,6 @@ public class InvWarehouseController { } InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(request.getCode()); -// InvProductDetailEntity invProductDetailEntity = invProductDetailService.isExit(invWarehouseEntity.getCode()); -// if (invProductDetailEntity != null) { -// return ResultVOUtils.error(500, "该仓库已有库存,不能删除!"); -// } - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); filterInvWarehouseRequest.setCode(invWarehouseEntity.getCode()); List warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SyncDataSetController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SyncDataSetController.java new file mode 100644 index 0000000..cf2beca --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SyncDataSetController.java @@ -0,0 +1,50 @@ +package com.glxp.sale.admin.controller.param; + +import com.alibaba.fastjson.JSON; +import com.glxp.sale.admin.annotation.AuthRuleAnnotation; +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; +import com.glxp.sale.admin.res.param.SyncDataSetResponse; +import com.glxp.sale.admin.service.param.SyncDataSetService; +import com.glxp.sale.admin.util.BeanUtils; +import com.glxp.sale.common.enums.ResultEnum; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; + +@RestController +public class SyncDataSetController { + + + @Resource + private SyncDataSetService syncDataSetService; + + + @AuthRuleAnnotation("system/param/syncData/config") + @GetMapping("/system/param/syncData/config") + public BaseResponse list() { + return ResultVOUtils.success(syncDataSetService.selectSet()); + } + + @AuthRuleAnnotation("system/param/syncData/save") + @PostMapping("/system/param/syncData/save") + public BaseResponse save(@RequestBody @Valid SyncDataSetResponse syncDataSetResponse + ) { + + SyncDataSetEntity syncDataSetEntity = new SyncDataSetEntity(); + BeanUtils.copyProperties(syncDataSetResponse, syncDataSetEntity); + syncDataSetEntity.setBusTypes(JSON.toJSONString(syncDataSetResponse.getBusTypes())); + boolean b = syncDataSetService.insert(syncDataSetEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success(); + } + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessOriginTypeDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessOriginTypeDao.java index ffff169..3fbe818 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessOriginTypeDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessOriginTypeDao.java @@ -4,6 +4,7 @@ import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity; import com.glxp.sale.admin.req.basic.BussinessOriginTypeFilterRequest; import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,4 +20,6 @@ public interface BussinessOriginTypeDao { boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); + + boolean deleteById(@Param("id") String id); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDao.java new file mode 100644 index 0000000..509c22a --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDao.java @@ -0,0 +1,31 @@ +package com.glxp.sale.admin.dao.inventory; + +import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; +import com.glxp.sale.admin.res.inventory.InvProductResponse; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface InvPreInProductDao { + + List filterInvProduct(FilterInvProductRequest filterInvProductRequest); + + List filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); + + boolean insertInvProduct(InvProductEntity invProductEntity); + + 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); + + InvProductEntity selectExit(@Param("relIdFk") String id); + + boolean deleteById(@Param("id") String id); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDetailDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDetailDao.java new file mode 100644 index 0000000..0caad08 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/inventory/InvPreInProductDetailDao.java @@ -0,0 +1,31 @@ +package com.glxp.sale.admin.dao.inventory; + +import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; +import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface InvPreInProductDetailDao { + + List filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest); + + List filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); + + boolean insertInvProductDetail(InvProductDetailEntity invProductDetailEntity); + + boolean insertInvProductDetails(@Param("invProductDetailEntitys") List invProductDetailEntitys); + + boolean updateInvProductDetail(InvProductDetailEntity invProductDetailEntity); + + boolean deleteById(@Param("id") String id); + + boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest); + + int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest); + + List findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/param/SyncDataSetDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/param/SyncDataSetDao.java new file mode 100644 index 0000000..75b99ef --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/param/SyncDataSetDao.java @@ -0,0 +1,11 @@ +package com.glxp.sale.admin.dao.param; + +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SyncDataSetDao { + SyncDataSetEntity selectSet(); + + boolean insert(SyncDataSetEntity syncDataSetEntity); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java index 46c2a80..c559a18 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java @@ -28,4 +28,5 @@ public class BussinessLocalTypeEntity { private Date updateTime; private String prefix; private String localPrefix; + private boolean preIn; } 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 cdaab19..04e17aa 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 @@ -56,5 +56,6 @@ public class BussinessTypeEntity { private String prefix; private String localPrefix; + private boolean preIn; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java index 19e1567..294eb52 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java @@ -34,6 +34,8 @@ public class UdiRelevanceEntity { private String originUuid; private boolean allowNoBatch; + private String price; + public Integer getLockStatus() { if (lockStatus == null) return 1; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyProductRelevanceEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyProductRelevanceEntity.java index 0c813ea..ca8cf32 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyProductRelevanceEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyProductRelevanceEntity.java @@ -2,7 +2,9 @@ package com.glxp.sale.admin.entity.info; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import org.apache.poi.hpsf.Decimal; +import java.math.BigDecimal; import java.util.Date; @Data @@ -20,5 +22,5 @@ public class CompanyProductRelevanceEntity { private String productUuid; private Integer udiRlIdFk; private String unitFk; - + private String price; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/ErpOrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/ErpOrderEntity.java index 4197ddc..8be15f7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/ErpOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/ErpOrderEntity.java @@ -67,7 +67,7 @@ public class ErpOrderEntity { private String secSalesInvNo; private String invoiceDate; private BigDecimal price; - + private boolean checkSuccess; public Integer getBindStatus() { if (bindStatus == null) 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 553d55a..1952c7c 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 @@ -47,5 +47,6 @@ public class OrderEntity { private boolean outChangeEnable; private String originUllageSupNo; private Date updateTime; + private boolean preCheck; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/param/SyncDataSetEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/param/SyncDataSetEntity.java new file mode 100644 index 0000000..01b945f --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/param/SyncDataSetEntity.java @@ -0,0 +1,27 @@ +package com.glxp.sale.admin.entity.param; + +import lombok.Data; + +import java.util.List; + +@Data +public class SyncDataSetEntity { + private Integer id; + private boolean typeBus; + private boolean typeScan; + private boolean typeThird; + private boolean basicProducts; + private boolean basicCorp; + private boolean basicInv; + private boolean basicThirdProducts; + private boolean basicThirdCorp; + private boolean basicThirdInv; + private boolean basicThirdBusOrder; + private boolean dbDiProducts; + private boolean downstreamEnable; + private boolean orderScanFinish; + private boolean orderUnReceive; + private boolean orderUnCheck; + private String busTypes; + private Integer syncTime; +} 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 688f14f..24857df 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 @@ -23,4 +23,5 @@ public class AddOrderRequest { private boolean outChangeEnable; private boolean ignoreExpire; private boolean ignoreRecentExpire; + private boolean preCheck; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/OrderFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/OrderFilterRequest.java index 6eb4bd3..8c43c32 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/OrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/OrderFilterRequest.java @@ -3,6 +3,8 @@ package com.glxp.sale.admin.req.inout; import com.glxp.sale.admin.req.ListPageRequest; import lombok.Data; +import java.util.List; + @Data public class OrderFilterRequest extends ListPageRequest { @@ -33,4 +35,5 @@ public class OrderFilterRequest extends ListPageRequest { private String locStorageCode; private String lastUpdateTime; private Integer unionUser; + private List filterActions; } 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 6de93ab..9bf0208 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 @@ -57,4 +57,5 @@ public class BussinessTypResponse { private boolean expireTip; private String prefix; private String localPrefix; + private boolean preIn; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java index 04410e5..b9d9ac1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java @@ -66,5 +66,6 @@ public class CompanyProductRelevanceResponse { private String cpms; private String supName; private boolean allowNoBatch; + private String price; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/param/SyncDataSetResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/param/SyncDataSetResponse.java new file mode 100644 index 0000000..b2593f6 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/param/SyncDataSetResponse.java @@ -0,0 +1,29 @@ +package com.glxp.sale.admin.res.param; + +import lombok.Data; + +import java.util.List; + +@Data +public class SyncDataSetResponse { + private Integer id; + private boolean typeBus; + private boolean typeScan; + private boolean typeThird; + private boolean basicProducts; + private boolean basicCorp; + private boolean basicInv; + private boolean basicThirdProducts; + private boolean basicThirdCorp; + private boolean basicThirdInv; + private boolean basicThirdBusOrder; + private boolean dbDiProducts; + private boolean downstreamEnable; + private boolean orderScanFinish; + private boolean orderUnReceive; + private boolean orderUnCheck; + private List busTypes; + private Integer syncTime; + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java index df150ee..6015606 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java @@ -14,8 +14,20 @@ public interface BussinessOriginTypeService { BussinessOriginTypeEntity findByAction(String action); + BasicThirdSysDetailEntity findSysByAction(String action, String key); + List filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); + BussinessOriginTypeResponse finAllByAction(String action); + + + List filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); + + boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); + + boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); + + List filterJoinList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); BussinessOriginTypeResponse finByThirdAction(String action); @@ -24,12 +36,6 @@ public interface BussinessOriginTypeService { BussinessOriginTypeResponse finByMainAction(String action); - BasicThirdSysDetailEntity findSysByAction(String action, String key); - - List filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); - - boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); - - boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity); + boolean deleteById(String id); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java index d0912a1..6cbbf23 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java @@ -33,11 +33,57 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic return null; } + @Override + public BasicThirdSysDetailEntity findSysByAction(String action, String key) { + BussinessOriginTypeEntity bussinessOriginTypeEntity = findByAction(action); + if (bussinessOriginTypeEntity != null) { + BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey(key, bussinessOriginTypeEntity.getThirdSys()); +// basicThirdSysDetailEntity.setLocalAction(bussinessTypResponse.getLocalAction()); + return basicThirdSysDetailEntity; + } + + return null; + } + @Override public List filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) { return bussinessOriginTypeDao.filterEnableList(bussinessOriginTypeFilterRequest); } + @Override + public BussinessOriginTypeResponse finAllByAction(String action) { + BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); + bussinessOriginTypeFilterRequest.setAction(action); + List bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); + if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) { + return bussinessOriginTypeEntities.get(0); + } + return null; + } + + @Override + public List filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) { + if (bussinessOriginTypeFilterRequest == null) { + return Collections.emptyList(); + } + if (bussinessOriginTypeFilterRequest.getPage() != null) { + int offset = (bussinessOriginTypeFilterRequest.getPage() - 1) * bussinessOriginTypeFilterRequest.getLimit(); + PageHelper.offsetPage(offset, bussinessOriginTypeFilterRequest.getLimit()); + } + List data = bussinessOriginTypeDao.filterList(bussinessOriginTypeFilterRequest); + return data; + } + + @Override + public boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) { + return bussinessOriginTypeDao.updateBusOriginType(bussinessTypeEntity); + } + + @Override + public boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) { + return bussinessOriginTypeDao.insertBusOriginType(bussinessTypeEntity); + } + @Override public List filterJoinList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) { return bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); @@ -77,37 +123,7 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic } @Override - public BasicThirdSysDetailEntity findSysByAction(String action, String key) { - BussinessOriginTypeEntity bussinessOriginTypeEntity = findByAction(action); - if (bussinessOriginTypeEntity != null) { - BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey(key, bussinessOriginTypeEntity.getThirdSys()); -// basicThirdSysDetailEntity.setLocalAction(bussinessTypResponse.getLocalAction()); - return basicThirdSysDetailEntity; - } - - return null; - } - - @Override - public List filterList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) { - if (bussinessOriginTypeFilterRequest == null) { - return Collections.emptyList(); - } - if (bussinessOriginTypeFilterRequest.getPage() != null) { - int offset = (bussinessOriginTypeFilterRequest.getPage() - 1) * bussinessOriginTypeFilterRequest.getLimit(); - PageHelper.offsetPage(offset, bussinessOriginTypeFilterRequest.getLimit()); - } - List data = bussinessOriginTypeDao.filterList(bussinessOriginTypeFilterRequest); - return data; - } - - @Override - public boolean updateBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) { - return bussinessOriginTypeDao.updateBusOriginType(bussinessTypeEntity); - } - - @Override - public boolean insertBusOriginType(BussinessOriginTypeEntity bussinessTypeEntity) { - return bussinessOriginTypeDao.insertBusOriginType(bussinessTypeEntity); + public boolean deleteById(String id) { + return bussinessOriginTypeDao.deleteById(id); } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductDetailService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductDetailService.java new file mode 100644 index 0000000..e001fe7 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductDetailService.java @@ -0,0 +1,29 @@ +package com.glxp.sale.admin.service.inventory; + +import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; +import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse; + +import java.util.List; + +public interface InvPreInProductDetailService { + + List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); + + List filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); + + boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity); + + boolean insertInvProducts(List invProductDetailEntitys); + + boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity); + + boolean deleteById(String id); + + boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest); + + int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest); + + + List findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductService.java new file mode 100644 index 0000000..8a9fd0b --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreInProductService.java @@ -0,0 +1,26 @@ +package com.glxp.sale.admin.service.inventory; + +import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; +import com.glxp.sale.admin.res.inventory.InvProductResponse; + +import java.util.List; + +public interface InvPreInProductService { + + List filterInvProduct(FilterInvProductRequest filterInvProductRequest); + + List filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); + + InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode); + + InvProductEntity selectExit(String id); + + InvProductEntity selectById(String id); + + boolean insertInvProduct(InvProductEntity invProductEntity); + + boolean updateInvProduct(InvProductEntity invProductEntity); + + boolean deleteById(String id); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java new file mode 100644 index 0000000..16c71a9 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java @@ -0,0 +1,81 @@ +package com.glxp.sale.admin.service.inventory.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.sale.admin.dao.inventory.InvPreInProductDetailDao; +import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; +import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse; +import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService { + + @Resource + InvPreInProductDetailDao invPreInProductDetailDao; + + @Override + public List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { + if (filterInvProductDetailRequest == null) { + return Collections.emptyList(); + } + if (filterInvProductDetailRequest.getPage() != null) { + int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit()); + } + List data = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); + return data; + } + + @Override + public List filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { + if (filterInvProductDetailRequest == null) { + return Collections.emptyList(); + } + if (filterInvProductDetailRequest.getPage() != null) { + int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit()); + } + List data = invPreInProductDetailDao.filterJoinInvProduct(filterInvProductDetailRequest); + return data; + } + + @Override + public boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity) { + return invPreInProductDetailDao.insertInvProductDetail(invProductDetailEntity); + } + + @Override + public boolean insertInvProducts(List invProductDetailEntitys) { + return invPreInProductDetailDao.insertInvProductDetails(invProductDetailEntitys); + } + + @Override + public boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity) { + return invPreInProductDetailDao.updateInvProductDetail(invProductDetailEntity); + } + + @Override + public boolean deleteById(String id) { + return invPreInProductDetailDao.deleteById(id); + } + + @Override + public boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest) { + return invPreInProductDetailDao.deleteByProductId(filterInvProductDetailRequest); + } + + @Override + public int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest) { + return invPreInProductDetailDao.statCount(filterInvProductDetailRequest); + } + + @Override + public List findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) { + return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest); + } +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductServiceImpl.java new file mode 100644 index 0000000..542274d --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductServiceImpl.java @@ -0,0 +1,76 @@ +package com.glxp.sale.admin.service.inventory.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.sale.admin.dao.inventory.InvPreInProductDao; +import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; +import com.glxp.sale.admin.res.inventory.InvProductResponse; +import com.glxp.sale.admin.service.inventory.InvPreInProductService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; +@Service +public class InvPreInProductServiceImpl implements InvPreInProductService { + + @Resource + InvPreInProductDao invPreInProductDao; + + @Override + public List filterInvProduct(FilterInvProductRequest filterInvProductRequest) { + if (filterInvProductRequest == null) { + return Collections.emptyList(); + } + if (filterInvProductRequest.getPage() != null) { + int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvProductRequest.getLimit()); + } + List data = invPreInProductDao.filterInvProduct(filterInvProductRequest); + return data; + } + + @Override + public List filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest) { + if (filterInvProductRequest == null) { + return Collections.emptyList(); + } + if (filterInvProductRequest.getPage() != null) { + int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvProductRequest.getLimit()); + } + List data = invPreInProductDao.filterJoinInvProduct(filterInvProductRequest); + return data; + } + + @Override + public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) { + return invPreInProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode); + } + + @Override + public InvProductEntity selectExit(String id) { + return invPreInProductDao.selectExit(id); + } + + @Override + public InvProductEntity selectById(String id) { + return invPreInProductDao.selectById(id); + } + + @Override + public boolean insertInvProduct(InvProductEntity invProductEntity) { + return invPreInProductDao.insertInvProduct(invProductEntity); + } + + @Override + public boolean updateInvProduct(InvProductEntity invProductEntity) { + return invPreInProductDao.updateInvProduct(invProductEntity); + } + + @Override + public boolean deleteById(String id) { + return invPreInProductDao.deleteById(id); + } + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/param/SyncDataSetService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/param/SyncDataSetService.java new file mode 100644 index 0000000..2317015 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/param/SyncDataSetService.java @@ -0,0 +1,12 @@ +package com.glxp.sale.admin.service.param; + +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; +import com.glxp.sale.admin.res.param.SyncDataSetResponse; + +public interface SyncDataSetService { + SyncDataSetEntity findSet(); + + SyncDataSetResponse selectSet(); + + boolean insert(SyncDataSetEntity syncDataSetEntity); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/param/impl/SyncDataSetServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/param/impl/SyncDataSetServiceImpl.java new file mode 100644 index 0000000..60537bc --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/param/impl/SyncDataSetServiceImpl.java @@ -0,0 +1,46 @@ +package com.glxp.sale.admin.service.param.impl; + +import com.alibaba.fastjson.JSON; +import com.glxp.sale.admin.dao.param.SyncDataSetDao; +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; +import com.glxp.sale.admin.res.param.SyncDataSetResponse; +import com.glxp.sale.admin.service.param.SyncDataSetService; +import com.glxp.sale.admin.util.BeanUtils; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.lang.reflect.Type; +import java.util.List; + +@Service +public class SyncDataSetServiceImpl implements SyncDataSetService { + + @Resource + SyncDataSetDao syncDataSetDao; + + @Override + public SyncDataSetEntity findSet() { + SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet(); + return syncDataSetEntity; + } + + @Override + public SyncDataSetResponse selectSet() { + + SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet(); + SyncDataSetResponse syncDataSetResponse = new SyncDataSetResponse(); + BeanUtils.copyProperties(syncDataSetEntity, syncDataSetResponse); + List busTypes = JSON.parseArray(syncDataSetEntity.getBusTypes(), String.class); + syncDataSetResponse.setBusTypes(busTypes); + + + return syncDataSetResponse; + } + + + @Override + public boolean insert(SyncDataSetEntity syncDataSetEntity) { + return syncDataSetDao.insert(syncDataSetEntity); + } +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/SyncUdiService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/SyncUdiService.java index 2907582..88a9538 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/SyncUdiService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/SyncUdiService.java @@ -47,22 +47,27 @@ public class SyncUdiService { && StrUtil.isEmpty(productInfoFilterRequest.getNameCode()) && StrUtil.isEmpty(productInfoFilterRequest.getGgxh()) && StrUtil.isEmpty(productInfoFilterRequest.getUuid()) - && StrUtil.isEmpty(productInfoFilterRequest.getZczbhhzbapzbh())) - - + && StrUtil.isEmpty(productInfoFilterRequest.getZczbhhzbapzbh())) { if (productInfoFilterRequest.getNameCode() != null && !productInfoFilterRequest.getNameCode().equals("") && productInfoFilterRequest.getNameCode().length() < 10) { return ResultVOUtils.error(500, "请输入完整的最小销售单元标识!"); } - - if (productInfoFilterRequest.getYlqxzcrbarmc() != null && !productInfoFilterRequest.getYlqxzcrbarmc().equals("") && productInfoFilterRequest.getYlqxzcrbarmc().length() < 4) { - return ResultVOUtils.error(500, "请输入完整的医疗器械注册备案人名称!"); } - - if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals("")) - && (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals("")) - && (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals("")) - + if (StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc()) && StrUtil.isEmpty(productInfoFilterRequest.getNameCode())) { + if (StrUtil.isNotEmpty(productInfoFilterRequest.getCpmctymc())) { + return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); + } + if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) { + return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); + } + if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) { + return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); + } + } + if ( + StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc()) + && (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals("")) + && (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals("")) ) { if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) { return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); @@ -72,11 +77,8 @@ public class SyncUdiService { } } -// if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("")) { -// return ResultVOUtils.error(500, "请输入完整的产品通用名称!"); -// } productInfoFilterRequest.setIsNewest(1); -// productInfoFilterRequest.setDiType("1"); + productInfoFilterRequest.setDiType("1"); List productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(productInfoEntityList); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncCompanyDlHelper.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncCompanyDlHelper.java index 8c59b1d..9873fa8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncCompanyDlHelper.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncCompanyDlHelper.java @@ -17,8 +17,7 @@ public class AsyncCompanyDlHelper { @Resource UdiCompanyService udiCompanyService; @Resource - ProductInfoDao productInfoDao; - + AsyncDiDlHelper asyncDiDlHelper; @Value("${UDI_SERVER_URL}") private String udiUrl; @@ -27,7 +26,6 @@ public class AsyncCompanyDlHelper { @Async public void asyncDiByTime(String updateTime) { - AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper(); int page = 1; int limit = 300; while (true) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java index 2926667..4cef14a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java @@ -8,12 +8,17 @@ import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.util.HttpClient; import com.glxp.sale.common.res.BaseResponse; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; +@Service public class AsyncDiDlHelper { + @Value("${UDI_SERVER_URL}") + private String udiUrl; public List dlByTime(String udiUrl, int page, int limit, String updateTime) { Map paramMap = new HashMap<>(16); @@ -22,8 +27,6 @@ public class AsyncDiDlHelper { paramMap.put("updateTime", updateTime); String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncUdi", paramMap); try { -// BaseResponse> udiDlDeviceResponse = (BaseResponse>) JSONObject.parseObject(response, BaseResponse.class); - BaseResponse> udiDlDeviceResponse = JSONObject.parseObject(response, new TypeReference>>() { }); @@ -45,9 +48,6 @@ public class AsyncDiDlHelper { paramMap.put("updateTime", updateTime); String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncCompany", paramMap); try { -// BaseResponse> baseResponse = (BaseResponse>) JSONObject.parseObject(response, BaseResponse.class); - - BaseResponse> baseResponse = JSONObject.parseObject(response, new TypeReference>>() { }); @@ -61,4 +61,22 @@ public class AsyncDiDlHelper { } } + + public List dlByDi(String deviceId) { + Map paramMap = new HashMap<>(16); + paramMap.put("deviceId", deviceId); + String response = HttpClient.mipsGet(udiUrl + "/udidl/device/serchDlByDi", paramMap); + try { + BaseResponse> baseResponse = + JSONObject.parseObject(response, new TypeReference>>() { + }); + + List productInfoEntityList = baseResponse.getData(); + return productInfoEntityList; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlService.java index ee61f0d..39e40d4 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlService.java @@ -28,11 +28,12 @@ public class AsyncDiDlService { ProductInfoService productInfoService; @Resource ThrImportLogService udiInfoImportLogService; + @Resource + AsyncDiDlHelper asyncDiDlHelper; private static final Logger logger = LoggerFactory.getLogger(AsyncDiDlService.class); @Async public void asyncDiByTime(String updateTime) { - AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper(); int page = 1; int limit = 200; while (true) { @@ -69,6 +70,4 @@ public class AsyncDiDlService { } - - } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java index c44d826..e5c7d9b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java @@ -4,9 +4,12 @@ import com.glxp.sale.admin.constant.BasicProcessStatus; import com.glxp.sale.admin.dao.info.ScheduledDao; import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; import com.glxp.sale.admin.entity.info.ScheduledEntity; +import com.glxp.sale.admin.entity.param.SyncDataSetEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.req.udid.ScheduledRequest; +import com.glxp.sale.admin.res.param.SyncDataSetResponse; import com.glxp.sale.admin.service.basic.BasicExportService; +import com.glxp.sale.admin.service.param.SyncDataSetService; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.util.CustomUtil; import com.glxp.sale.admin.util.RedisUtil; @@ -30,13 +33,12 @@ public class AsyncHeartTask implements SchedulingConfigurer { @Resource protected ScheduledDao scheduledDao; @Resource - SystemParamConfigService systemParamConfigService; - @Resource RedisUtil redisUtil; @Resource - BasicExportService basicExportService; - @Resource BasicBackUpdateProductService backUpdateProductService; + @Resource + private SyncDataSetService syncDataSetService; + @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { @@ -57,29 +59,24 @@ public class AsyncHeartTask implements SchedulingConfigurer { private void process() { - - SystemParamConfigEntity downConnect = systemParamConfigService.selectByParamKey("sync_downstream_enable"); - if (downConnect.getParamValue().equals("1")) { - + SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); + if (syncDataSetEntity.isDownstreamEnable()) { //定时同步最近更新数据至任务表,等待下载 - SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("sps_sync_gen_data"); - long timeInterval = Long.parseLong(systemParamConfigEntity.getParamValue()) * 60 * 1000; - long curTime = System.currentTimeMillis(); - Long lastTime = (Long) redisUtil.get("SPS_SYNC_GEN_DATA"); - if (lastTime == null) { - lastTime = System.currentTimeMillis(); - redisUtil.set("SPS_SYNC_GEN_DATA", lastTime); + if (syncDataSetEntity.getSyncTime() != null) { + long timeInterval = syncDataSetEntity.getSyncTime() * 60 * 1000; + long curTime = System.currentTimeMillis(); + Long lastTime = (Long) redisUtil.get("SPS_SYNC_GEN_DATA"); + if (lastTime == null) { + lastTime = System.currentTimeMillis(); + redisUtil.set("SPS_SYNC_GEN_DATA", lastTime); + } + if (curTime - lastTime > timeInterval) { + + backUpdateProductService.syncUpdatetTime(); + redisUtil.set("SPS_SYNC_GEN_DATA", curTime); + } } - if (curTime - lastTime > timeInterval) { - - backUpdateProductService.syncUpdatetTime(); - redisUtil.set("SPS_SYNC_GEN_DATA", curTime); - } - - } - - } 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 78b7f83..4802916 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 @@ -53,6 +53,10 @@ public class InvProductsTrService { @Resource private InvPreProductService invPreProductService; @Resource + private InvPreInProductService invPreInProductService; + @Resource + private InvPreInProductDetailService invPreInProductDetailService; + @Resource private InvPreProductDetailService invPreProductDetailService; @Resource private BussinessChangeTypeService bussinessChangeTypeService; @@ -92,7 +96,25 @@ public class InvProductsTrService { List warehouseEntityList = codesService.findByReceiptId(orderId); for (WarehouseEntity warehouseEntity : warehouseEntityList) { ErpOrderEntity erpOrderEntity = getErpOrders(warehouseEntity, erpOrderEntities); - if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 + + if (bussinessTypeEntity.isPreIn()) { + InvProductEntity invPreProductEntity = + invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId() + , warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); + if (invPreProductEntity == null) { + invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); + invPreInProductService.insertInvProduct(invPreProductEntity); + } else { + int actCount = getActCount(warehouseEntity); + int count = actCount * warehouseEntity.getCount(); + if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invPreProductEntity.setOutCount(invPreProductEntity.getOutCount() + count); + } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invPreProductEntity.setInCount(invPreProductEntity.getInCount() + count); + } + invPreInProductService.updateInvProduct(invPreProductEntity); + } + } else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 InvProductEntity invPreProductEntity = invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId() , warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); @@ -145,10 +167,11 @@ public class InvProductsTrService { if (relId != null) { List invProductDetailEntities; if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 - invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 1, true); - + invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 1); + } else if (bussinessTypeEntity.isPreIn()) { + invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3); } else { - invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2, false); + invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2); } if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) { mInvProductDetailEntities.addAll(invProductDetailEntities); @@ -179,14 +202,14 @@ public class InvProductsTrService { List temps = filterMapCodes(datas); buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据 } else { - insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 + insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存 } } else { - insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 + insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存 } } else { - insetInv(bussinessTypeEntity.isAdvanceType(), mInvProductDetailEntities);//2.插入当前库存 + insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存 } } @@ -470,8 +493,8 @@ public class InvProductsTrService { outOrder.setFromCorp(invWarehouseEntity.getName()); outOrder.setFromCorpId(invWarehouseEntity.getCode()); outOrder.setLocStorageCode(defaultWarehouseEntity.getCode()); -// outOrder.setFromCorp(companyEntity.getCompanyName()); -// outOrder.setFromCorpId(companyEntity.getUnitIdFk()); + outOrder.setCreateUser(null); + outOrder.setReviewUser(null); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : preOutList) { warehouseEntity.setOrderId(outOrder.getId()); @@ -546,7 +569,8 @@ public class InvProductsTrService { orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); outOrder.setOriginUllageSupNo(orderEntity.getId()); - + outOrder.setCreateUser(null); + outOrder.setReviewUser(null); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); @@ -558,10 +582,7 @@ public class InvProductsTrService { warehouseEntity.setMainAction(ConstantType.TYPE_PUT); } codesTempService.insertCodesTemp(temps); -// ioTransInoutService.transInout(outOrder.getId()); } - - //无供应商,一个条码生成一个错误单据,到时候利用单据合并生成同一个单据 for (WarehouseEntity warehouseEntity : unkonwCorpList) { OrderEntity outOrder = new OrderEntity(); @@ -591,7 +612,8 @@ public class InvProductsTrService { orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); outOrder.setOriginUllageSupNo(orderEntity.getId()); - + outOrder.setCreateUser(null); + outOrder.setReviewUser(null); orderService.insertOrder(outOrder); warehouseEntity.setOrderId(outOrder.getId()); warehouseEntity.setId(null); @@ -661,7 +683,8 @@ public class InvProductsTrService { orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); outOrder.setOriginUllageSupNo(orderEntity.getId()); - + outOrder.setCreateUser(null); + outOrder.setReviewUser(null); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); @@ -738,7 +761,8 @@ public class InvProductsTrService { orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); outOrder.setOriginUllageSupNo(orderEntity.getId()); - + outOrder.setCreateUser(null); + outOrder.setReviewUser(null); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); @@ -750,7 +774,6 @@ public class InvProductsTrService { warehouseEntity.setMainAction(ConstantType.TYPE_PUT); } codesTempService.insertCodesTemp(temps); -// ioTransInoutService.transInout(outOrder.getId()); } @@ -786,7 +809,7 @@ public class InvProductsTrService { //生成库存条码 private List buildInvProductDetail(String orderId, ErpOrderEntity erpOrderEntity, - OrderEntity orderEntity, Integer purchaseType, boolean isPre) { + OrderEntity orderEntity, Integer purchaseType) { List mInvProductDetailEntities = new ArrayList<>(); List warehouseEntities = codesService.findByReceiptId(orderId); @@ -799,7 +822,6 @@ public class InvProductsTrService { invProductDetailEntity.setOriginCode(warehouseEntity.getCode()); invProductDetailEntity.setProductIdFk(erpOrderEntity.getGoodsid() + ""); int actCount = getActCount(warehouseEntity); - String code = warehouseEntity.getCode(); UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY @@ -826,27 +848,6 @@ public class InvProductsTrService { invProductDetailEntity.setUpdateTime(new Date()); invProductDetailEntity.setCustomerId(orderEntity.getCustomerId()); invProductDetailEntity.setSupId(warehouseEntity.getSupId()); -// if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { -// if (warehouseEntity.getSupId() != null) { -// invProductDetailEntity.setSupId(warehouseEntity.getSupId()); -// } else { -// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); -// filterInvProductDetailRequest.setMainAction(ConstantType.TYPE_PUT); -// filterInvProductDetailRequest.setCode(warehouseEntity.getCode()); -// List temps = null; -// if (isPre) { -// temps = invPreProductDetailService.filterInvProduct(filterInvProductDetailRequest); -// } else { -// temps = invProductDetailService.filterInvProduct(filterInvProductDetailRequest); -// } -// if (temps.size() > 0) { -// invProductDetailEntity.setSupId(temps.get(0).getSupId()); -// } -// } -// } else { -// invProductDetailEntity.setSupId(orderEntity.getFromCorpId()); -// } - mInvProductDetailEntities.add(invProductDetailEntity); } } @@ -855,9 +856,11 @@ public class InvProductsTrService { return mInvProductDetailEntities; } - public void insetInv(boolean isPre, List invProductDetailEntities) { - if (isPre) { + public void insetInv(BussinessTypeEntity bussinessTypeEntity, List invProductDetailEntities) { + if (bussinessTypeEntity.isAdvanceType()) { invPreProductDetailService.insertInvProducts(invProductDetailEntities); + } else if (bussinessTypeEntity.isPreIn()) { + invPreInProductDetailService.insertInvProducts(invProductDetailEntities); } else { invProductDetailService.insertInvProducts(invProductDetailEntities); } 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 f888e01..0ac9ad5 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 @@ -9,6 +9,7 @@ import com.glxp.sale.admin.controller.inout.utils.CheckOrderUtils; import com.glxp.sale.admin.controller.inout.utils.InoutUtils; import com.glxp.sale.admin.dao.inout.UdimsOrderDetailDao; import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity; +import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; @@ -23,10 +24,7 @@ import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest; import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse; import com.glxp.sale.admin.res.basic.UdiRelevanceResponse; -import com.glxp.sale.admin.service.basic.BasicUnitMaintainService; -import com.glxp.sale.admin.service.basic.BussinessTypeService; -import com.glxp.sale.admin.service.basic.UdiInfoService; -import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.basic.*; import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; @@ -58,7 +56,8 @@ public class IoTransInoutService { @Resource private OrderDetailService myErpOrderService; - + @Resource + BussinessLocalTypeService bussinessLocalTypeService; @Resource UdiRelevanceService udiRelevanceService; @Resource @@ -591,7 +590,6 @@ public class IoTransInoutService { public void unCheckFinish(OrderEntity orderEntity, List warehouseEntityList) { BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); genOrderDetail(warehouseEntityList); -// checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID orderEntity = orderService.findById(orderEntity.getId()); if (orderEntity.getContrastStatus() != ConstantStatus.ORDER_CHECK_FAIL) { List erpOrderEntities = myErpOrderService.filterAllByOrderIdFk(orderEntity.getId()); @@ -604,11 +602,6 @@ public class IoTransInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); -// orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_SUCCESS); -// if (orderEntity.getCustomerId() == null && orderEntity.getCustomerId().equals(Constant.SYSTEM_CUSTOMER_ID)) { -// -// } - printOrder(orderEntity.getId()); } } @@ -843,7 +836,10 @@ public class IoTransInoutService { public StockOrderEntity genStockOrder(OrderEntity orderEntity, BussinessTypeEntity bussinessTypeEntity) { //生成业务单据记录 StockOrderEntity stockOrderEntity = new StockOrderEntity(); - stockOrderEntity.setBillNo("ST" + CustomUtil.getId()); + + BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(bussinessTypeEntity.getLocalAction()); + String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.BUS_ORDER + MyStrUtil.trim(bussinessLocalTypeEntity.getLocalPrefix()), "yyyyMMdd")); + stockOrderEntity.setBillNo(orderNo); stockOrderEntity.setBillType(bussinessTypeEntity.getLocalAction());//todo stockOrderEntity.setBilldate(orderEntity.getActDate()); stockOrderEntity.setCustomerId(orderEntity.getCustomerId()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/util/Constant.java b/api-admin/src/main/java/com/glxp/sale/admin/util/Constant.java index 8d7f373..eec28b3 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/util/Constant.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/util/Constant.java @@ -18,7 +18,7 @@ public class Constant { public static final String SERIAL_CACHE_PREFIX = "serial_"; public static final String SERIAL_CACHE_PREFIX_ST = "serialst_"; - public static final String SCAN_ORDER = "MS"; - public static final String BUS_ORDER = "MY"; + public static final String SCAN_ORDER = "ZS"; + public static final String BUS_ORDER = "ZY"; } diff --git a/api-admin/src/main/resources/logback-spring.xml b/api-admin/src/main/resources/logback-spring.xml index 49b4b83..3fcecf1 100644 --- a/api-admin/src/main/resources/logback-spring.xml +++ b/api-admin/src/main/resources/logback-spring.xml @@ -38,7 +38,7 @@ - home/glxpdata/udiwms/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log + d://glxpdata/udiwms/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log 30 - home/glxpdata/udiwms/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log + d://glxpdata/udiwms/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log 30 @@ -143,10 +143,10 @@ replace INTO basic_bustype_local - (action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix) + (action, name, remark, originAction, advanceType, changeEnable, spUse,updateTime,prefix,preIn) values (#{action}, #{name}, - #{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse},#{updateTime},#{prefix}) + #{remark}, #{originAction}, #{advanceType}, #{changeEnable}, #{spUse},#{updateTime},#{prefix},#{preIn}) @@ -161,6 +161,8 @@ spUse = #{spUse}, updateTime = #{updateTime}, prefix = #{prefix}, + preIn = #{preIn}, + 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 f27bb0c..ea2f29d 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml @@ -46,7 +46,7 @@ AND basic_bustype_origin.action = #{thirdAction} - AND basic_bussiness_type.action = #{corpType} + AND basic_bussiness_type.corpType = #{corpType} @@ -96,9 +96,12 @@ thirdSys = #{thirdSys}, thirdSysName = #{thirdSysName}, remark = #{remark}, - WHERE id = #{id} - + + DELETE + FROM basic_bustype_origin + WHERE id = #{id} + 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 731df58..eafd4f3 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -18,7 +18,7 @@ basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne, basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix - localPrefix + localPrefix,basic_bustype_local.preIn FROM basic_bussiness_type LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = basic_bustype_local.action left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action @@ -82,7 +82,7 @@ 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,defaultUnit, basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip, - basic_bustype_local.prefix localPrefix from + basic_bustype_local.prefix localPrefix ,basic_bustype_local.preIn from basic_bussiness_type LEFT JOIN basic_third_sys on basic_bussiness_type.thirdSysFk = basic_third_sys.thirdId LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = @@ -131,7 +131,7 @@ basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit, basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix - localPrefix + localPrefix,basic_bustype_local.preIn FROM basic_bussiness_type LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = basic_bustype_local.action left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action diff --git a/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml b/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml index c229827..a572731 100644 --- a/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml @@ -49,7 +49,7 @@ basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence,basic_products.scbssfbhph, basic_products.scbssfbhxlh, basic_products.scbssfbhscrq, - basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid + basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,company_product_relevance.price FROM company_product_relevance inner JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id @@ -232,7 +232,7 @@ productUuid=#{productUuid}, udiRlIdFk=#{udiRlIdFk}, unitFk=#{unitFk}, - + price=#{price}, WHERE id = #{id} @@ -241,7 +241,7 @@ parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity"> replace INTO company_product_relevance(customerId,productId,enterpriseId,registrationId, - create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values + create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values ( #{customerId}, #{productId}, @@ -252,7 +252,7 @@ #{auditStatus}, #{productUuid}, #{udiRlIdFk}, - #{unitFk} + #{unitFk},#{price} ) @@ -261,7 +261,7 @@ parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity"> replace INTO company_product_relevance(id,customerId,productId,enterpriseId,registrationId, - create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values + create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values ( #{id}, #{customerId}, @@ -273,7 +273,7 @@ #{auditStatus}, #{productUuid}, #{udiRlIdFk}, - #{unitFk} + #{unitFk},#{price} ) diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml index 663eb95..4550487 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -34,7 +34,7 @@ fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus, receiveStatus, erpFk, stockCheckFk, customerId, supId, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, - outChangeEnable, originUllageSupNo) + outChangeEnable, originUllageSupNo,preCheck) values (#{id}, #{action}, #{corpOrderId}, @@ -53,7 +53,7 @@ #{erpFk}, #{stockCheckFk}, #{customerId}, #{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo} - , #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo}) + , #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},#{preCheck}) @@ -63,7 +63,7 @@ fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus, receiveStatus, erpFk, stockCheckFk, customerId, supId, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, - outChangeEnable, originUllageSupNo) + outChangeEnable, originUllageSupNo,preCheck) values ( #{id}, #{action}, @@ -91,7 +91,7 @@ #{createUser}, #{reviewUser}, #{outChangeEnable}, - #{originUllageSupNo} + #{originUllageSupNo},#{preCheck} ) @@ -127,6 +127,7 @@ updateTime=#{updateTime}, outChangeEnable=#{outChangeEnable}, originUllageSupNo=#{originUllageSupNo}, + preCheck=#{preCheck}, WHERE id = #{id} @@ -513,6 +514,13 @@ = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> + + action in + + #{item} + + + diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml b/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml index 867d8a2..2729fd0 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml @@ -5,7 +5,8 @@ @@ -33,7 +35,7 @@ basic_products.cpmctymc,basic_products.ggxh, stock_order_detail.batchNo,stock_order_detail.expireDate,stock_order_detail.productDate, stock_order_detail.count,stock_order_detail.reCount,stock_order_detail.sweepCount,stock_order_detail.relId, - basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,stock_order_detail.price,stock_order_detail.allowNoBatch + basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,stock_order_detail.price from stock_order_detail right JOIN basic_products ON stock_order_detail.productId = basic_products.uuid @@ -63,7 +65,8 @@ replace INTO stock_order_detail(id, orderIdFk,productId,productName,spec,batchNo,productDate, - expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate,allowNoBatch) + expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId, + manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate) values( #{id}, #{orderIdFk}, @@ -84,7 +87,7 @@ #{firstSalesInvNo}, #{secSalesInvNo}, #{secSalesListNo}, - #{invoiceDate},#{allowNoBatch} + #{invoiceDate} ) @@ -92,7 +95,8 @@ parameterType="com.glxp.sale.admin.entity.inout.StockOrderDetailEntity"> replace INTO stock_order_detail(id, orderIdFk,productId,productName,spec,batchNo,productDate, - expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId,manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate,allowNoBatch) + expireDate,count,reCount,sweepCount,ylqxzcrbarmc,zczbhhzbapzbh,price,relId, + manufactory,firstSalesInvNo,secSalesInvNo,secSalesListNo,invoiceDate) values @@ -109,7 +113,8 @@ #{item.reCount}, #{item.sweepCount}, #{item.ylqxzcrbarmc}, - #{item.zczbhhzbapzbh},#{item.price},#{item.relId},#{item.manufactory},#{item.firstSalesInvNo},#{item.secSalesInvNo},#{item.secSalesListNo},#{item.invoiceDate},#{item.allowNoBatch} + #{item.zczbhhzbapzbh},#{item.price},#{item.relId},#{item.manufactory},#{item.firstSalesInvNo},#{item.secSalesInvNo}, + #{item.secSalesListNo},#{item.invoiceDate} ) @@ -131,8 +136,6 @@ invoiceDate=#{invoiceDate}, relId=#{relId}, manufactory=#{manufactory}, - allowNoBatch=#{allowNoBatch}, - WHERE id = #{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/WarehouseUserDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/WarehouseUserDao.xml index b180eb7..a3a3a1d 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/WarehouseUserDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/WarehouseUserDao.xml @@ -257,6 +257,9 @@ AND code = #{code} + + and userId = #{userid} + AND isDirector = #{isDirector} diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml new file mode 100644 index 0000000..6ef485f --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + insert INTO inv_prein_product + (productsName, nameCode, relIdFk, ggxh, batchNo, + productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh, + inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode) + values (#{productsName}, #{nameCode}, + #{relIdFk}, #{ggxh}, #{batchNo}, + #{productionDate}, #{expireDate}, + #{ylqxzcrbarmc}, #{zczbhhzbapzbh}, + #{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk} + , #{invStorageCode}, #{invWarehouseCode}) + + + + + DELETE + FROM inv_prein_product + WHERE id = #{id} + + + + UPDATE inv_prein_product + + productsName=#{productsName}, + nameCode=#{nameCode}, + relIdFk=#{relIdFk}, + ggxh=#{ggxh}, + batchNo=#{batchNo}, + productionDate=#{productionDate}, + expireDate=#{expireDate}, + ylqxzcrbarmc=#{ylqxzcrbarmc}, + zczbhhzbapzbh=#{zczbhhzbapzbh}, + inCount=#{inCount}, + outCount=#{outCount}, + reCount=#{reCount}, + customerId=#{customerId}, + supId=#{supId}, + unitFk=#{unitFk}, + invStorageCode=#{invStorageCode}, + invWarehouseCode=#{invWarehouseCode}, + + WHERE id = #{id} + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml new file mode 100644 index 0000000..3005c66 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + insert INTO inv_prein_product_detail + (code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime, + purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode + , invStorageCode, invWarehouseCode) + values (#{code}, + #{productIdFk}, #{orderIdFk}, + #{customerId}, #{mainAction}, #{action}, #{count}, #{updateTime}, + #{purchaseType}, #{batchNo}, #{productionDate}, #{expireDate}, #{unitFk}, #{stockIdFk} + , #{supId}, #{originCode}, #{invStorageCode}, #{invWarehouseCode}) + + + + + insert INTO inv_prein_product_detail + (code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime, + purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId,originCode + , invStorageCode, invWarehouseCode) + values + + + ( + #{item.code}, + #{item.productIdFk},#{item.orderIdFk}, + #{item.customerId},#{item.mainAction},#{item.action},#{item.count},#{item.updateTime}, + #{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate}, + #{item.unitFk},#{item.stockIdFk},#{item.supId},#{item.originCode}, #{item.invStorageCode}, + #{item.invWarehouseCode} + ) + + + + + + + DELETE + FROM inv_prein_product_detail + WHERE id = #{id} + + + + DELETE + FROM inv_prein_product_detail + + + AND productIdFk = #{productIdFk} + + + AND batchNo = #{batchNo} + + + AND supId = #{supId} + + + + + + + UPDATE inv_prein_product_detail + + code=#{code}, + productIdFk=#{productIdFk}, + customerId=#{customerId}, + mainAction=#{mainAction}, + action=#{action}, + count=#{count}, + unitFk=#{unitFk}, + purchaseType=#{purchaseType}, + batchNo=#{batchNo}, + productionDate=#{productionDate}, + expireDate=#{expireDate}, + stockIdFk=#{stockIdFk}, + supId=#{supId}, + originCode=#{originCode}, + invStorageCode=#{invStorageCode}, + invWarehouseCode=#{invWarehouseCode}, + + WHERE id = #{id} + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml index 16a5342..34ec4bc 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml @@ -36,7 +36,9 @@ AND supId = #{supId} - + + AND code = #{code} + AND originCode = #{originCode} diff --git a/api-admin/src/main/resources/mybatis/mapper/param/SyncDataSetDao.xml b/api-admin/src/main/resources/mybatis/mapper/param/SyncDataSetDao.xml new file mode 100644 index 0000000..603fc0c --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/param/SyncDataSetDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + replace + INTO sync_data_set(id,typeBus, typeScan, + typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, basicThirdInv + , basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime, + orderUnReceive,orderUnCheck,busTypes) + values ( + #{id}, + #{typeBus}, + #{typeScan}, + #{typeThird}, + #{basicProducts}, + #{basicCorp}, + #{basicInv}, + #{basicThirdProducts}, + #{basicThirdCorp}, + #{basicThirdInv}, + #{basicThirdBusOrder}, + #{orderScanFinish}, + #{dbDiProducts}, + #{downstreamEnable}, + #{syncTime},#{orderUnReceive},#{orderUnCheck},#{busTypes} + ) + + + + \ No newline at end of file