From 28f5169d6f0c2ea1d21bbfe1ed1a778ff6db7af3 Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 28 Aug 2023 09:22:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B8=82=E9=85=8D=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicdata/vo/BasicdataWarehouseVO.java | 8 +++ .../BasicdataGoodsAreaController.java | 4 +- .../service/IBasicdataGoodsAreaService.java | 2 +- .../impl/BasicdataGoodsAreaServiceImpl.java | 37 +++++++++---- .../DistributionDeliveryListController.java | 4 +- .../DistributionReservationController.java | 10 +++- .../IDistributionDeliveryListService.java | 2 +- .../IDistributionReservationService.java | 2 +- .../DistributionDeliveryListServiceImpl.java | 13 +++-- .../DistributionReservationServiceImpl.java | 55 +++++++++++++++++-- .../DistributionParcelListWrapper.java | 16 +++++- 11 files changed, 119 insertions(+), 34 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java index 004a356f6..5de6f2289 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java @@ -17,6 +17,7 @@ package com.logpm.basicdata.vo; import com.baomidou.mybatisplus.annotation.TableField; +import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -36,5 +37,12 @@ public class BasicdataWarehouseVO extends BasicdataWarehouseEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "仓库货区") + private List children; + + + + + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java index 5827e65bf..eee07f906 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java @@ -90,8 +90,8 @@ public class BasicdataGoodsAreaController extends BladeController { * 货区 获取货区 */ @GetMapping("/getNode") - public R> getNode() { - List pages = basicdataGoodsAreaService.getNode(); + public R> getNode() { + List pages = basicdataGoodsAreaService.getNode(); log.info("pages>>>>>>>>>>>>>>{}",pages); return R.data(pages); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java index 6fed3bfdd..f8652fc3b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java @@ -90,5 +90,5 @@ public interface IBasicdataGoodsAreaService extends BaseService getNode(); + List getNode(); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java index 5d35355c0..30d008e18 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java @@ -17,7 +17,9 @@ package com.logpm.basicdata.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity; @@ -27,13 +29,18 @@ import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper; import com.logpm.basicdata.mapper.BasicdataGoodsAreaMapper; import com.logpm.basicdata.mapper.BasicdataGoodsShelfMapper; import com.logpm.basicdata.service.IBasicdataGoodsAreaService; +import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; import com.logpm.basicdata.vo.BasicdataNodeVO; import com.logpm.basicdata.vo.BasicdataWarehouseVO; +import com.logpm.basicdata.wrapper.WarehouseGoodsAreaWrapper; import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import lombok.AllArgsConstructor; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.system.feign.IUserClient; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -63,9 +70,11 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl selectWarehouseGoodsAreaPage(IPage page, BasicdataGoodsAreaVO basicdataGoodsAreaVO) { return page.setRecords(baseMapper.selectWarehouseGoodsAreaPage(page, basicdataGoodsAreaVO)); @@ -154,15 +163,23 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl getNode() { - //查询一级仓库节点信息 - List basicdataWarehouseVOList = baseMapper.selectFirstNode(); - //获取二节点的货区 - for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) { - List goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue()); - basicdataNodeVO.setChildren(goodeAreaNodes); - } - return basicdataWarehouseVOList; + public List getNode() { + //查询当前登陆用户能够操作的仓库列表 +// BladeUser user = AuthUtil.getUser(); + List myWarehouseList = basicdataWarehouseService.getMyWarehouseList(); + myWarehouseList.forEach(w->{ + LambdaQueryWrapper qw = Wrappers.query().lambda().eq(BasicdataGoodsAreaEntity::getWarehouseId, w.getId()); + List basicdataGoodsAreaEntities = basicdataGoodsAreaMapper.selectList(qw); + w.setChildren(basicdataGoodsAreaEntities); + }); +// //查询一级仓库节点信息 +// List basicdataWarehouseVOList = baseMapper.selectFirstNode(); +// //获取二节点的货区 +// for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) { +// List goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue()); +// basicdataNodeVO.setChildren(goodeAreaNodes); +// } + return myWarehouseList; } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 37aa8c62d..0c650d22f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -326,9 +326,9 @@ public class DistributionDeliveryListController extends BladeController { @GetMapping("/selectDiscussStockArticleInfoList") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "customArgs") - public R selectDiscussStockArticleInfoList(@ApiIgnore @RequestParam Map params, Query query) { + public R> selectDiscussStockArticleInfoList(@ApiIgnore @RequestParam Map params, Query query) { - List distributionStockArticle = distributionDeliveryListService.selectDiscussStockArticleInfoList(params,query); + IPage distributionStockArticle = distributionDeliveryListService.selectDiscussStockArticleInfoList(params,query); return R.data(distributionStockArticle); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index 5c87da2a8..76b6c50c3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -310,8 +310,12 @@ public class DistributionReservationController extends BladeController { @GetMapping("/selectUpdateAvailableStockArticle") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入distrbutionReservation") - public R selectUpdateAvailableStockArticle(@RequestParam Long id) { - List stockArticleVOS = reservationService.selectUpdateAvailableStockArticle(id); - return R.data(stockArticleVOS); + public R> selectUpdateAvailableStockArticle(@ApiIgnore @RequestParam Long id, Query query,@ApiIgnore @RequestParam Map distributionStockArticle) { + IPage page = Condition.getPage(query); + + List stockArticleVOS = reservationService.selectUpdateAvailableStockArticle(id,distributionStockArticle); + page.setRecords(stockArticleVOS); + page.setTotal(stockArticleVOS.size()); + return R.data(page); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index 8dfe1bd49..3a6e55d2c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -197,5 +197,5 @@ public interface IDistributionDeliveryListService extends BaseService selectDiscussStockArticleInfoList(Map params, Query query); + IPage selectDiscussStockArticleInfoList(Map params, Query query); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index fed7bd0d2..882bc3ebc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -173,7 +173,7 @@ public interface IDistributionReservationService extends BaseService selectUpdateAvailableStockArticle(Long reservationId); + List selectUpdateAvailableStockArticle(Long reservationId,Map distributionStockArticle); /** * 文员自主添加预约 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 5a6450229..5f904e695 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -1942,8 +1942,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDiscussStockArticleInfoList(Map params, Query query) { - + public IPage selectDiscussStockArticleInfoList(Map params, Query query) { + IPage page = Condition.getPage(query); //这里还需要查询出该配送任务下的订单信息,在进行编辑的时候进行回显 String deliveryId = (String) params.get("deliveryId"); List stockArticleEntityList = baseMapper.selectDiscussStockArticleList(deliveryId); @@ -1970,13 +1970,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl pages = distributionStockArticleService.page(Condition.getPage(query), lambdaQueryWrapper); IPage distributionStockArticleVOIPage = DistributionStockArticleWrapper.build().pageVO(pages); - List records = distributionStockArticleVOIPage.getRecords(); - records.forEach(r->{ +// List records = distributionStockArticleVOIPage.getRecords(); + distributionStockArticleVOIPage.getRecords().forEach(r->{ //查询包件情况 List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, r.getId())); r.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntityList)); }); - records.addAll(stockArticleVOList); - return records; +// records.addAll(stockArticleVOList); + + return distributionStockArticleVOIPage; } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index a347f5d52..d946a8a35 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -679,8 +679,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId())); //预约订单数量 - orderNum.getAndAdd(reservationEntity.getStockArticleId().split(",").length); + orderNum.getAndAdd(Integer.parseInt(count.toString())); //统计包件数量 packageNum.getAndAdd(reservationEntity.getReservationNum()); //TODO 设置是否齐套 @@ -692,7 +694,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q); List reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w); - //查询预约单下的包件信息 if (!Func.isEmpty(reservationStockarticleEntityList)) { @@ -1396,16 +1397,41 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl selectUpdateAvailableStockArticle(Long reservationId) { - + public List selectUpdateAvailableStockArticle(Long reservationId,Map distributionStockArticle) { //这里还需要查询出该预约单下的订单信息 //这里将该预约下的订单进行过滤 + String orderCode = (String) distributionStockArticle.get("orderCode"); + String mallName = (String) distributionStockArticle.get("mallName"); + String descriptionGoods = (String) distributionStockArticle.get("descriptionGoods"); + String brand = (String) distributionStockArticle.get("brand"); + String customerName = (String) distributionStockArticle.get("customerName"); + String customerTelephone = (String) distributionStockArticle.get("customerTelephone"); List reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)); List stockArticleVOArrayList = new ArrayList<>(); List list = new ArrayList<>(); reservationStockarticleEntityList.forEach(r -> { list.add(r.getStockArticleId().toString()); - List stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionStockArticleEntity::getId, r.getStockArticleId())); + LambdaQueryWrapper lambda = Wrappers.query().lambda(); + if (Func.isNotEmpty(orderCode)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,orderCode); + } + if (Func.isNotEmpty(mallName)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,mallName); + } + if (Func.isNotEmpty(descriptionGoods)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,descriptionGoods); + } + if (Func.isNotEmpty(brand)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,brand); + } + if (Func.isNotEmpty(customerName)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,customerName); + } + if (Func.isNotEmpty(customerTelephone)){ + lambda.like(DistributionStockArticleEntity::getOrderCode,customerTelephone); + } + lambda.eq(DistributionStockArticleEntity::getId,r.getStockArticleId()); + List stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(lambda); List stockArticleVOList = DistributionStockArticleWrapper.build().listVO(stockArticleEntities); stockArticleVOList.forEach(s -> { List parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId())); @@ -1429,6 +1455,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl stockArticleEntityList = distributionStockArticleService.getBaseMapper().selectList(qw); List stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList); stockArticleVOS.forEach(s -> { @@ -1441,6 +1485,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl { + + @Autowired private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; + public static DistributionParcelListWrapper build(){ return new DistributionParcelListWrapper(); } @@ -36,9 +44,11 @@ public class DistributionParcelListWrapper extends BaseEntityWrapper Date: Mon, 28 Aug 2023 10:24:30 +0800 Subject: [PATCH 2/5] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=95=86=E5=9C=BAid=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PanFactoryDataServiceImpl.java | 1 + .../api/WarehouseUpdownTypeApiController.java | 24 ++++++++++++ .../service/IWarehouseUpdownTypeService.java | 2 + .../impl/WarehouseUpdownTypeServiceImpl.java | 38 +++++++++++++++++++ 4 files changed, 65 insertions(+) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index 08f53810a..d7ffd480e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -440,6 +440,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity); if (!Objects.isNull(basicdataClientEntity)) { //商城 + distributionStockArticleEntity.setMallId(basicdataClientEntity.getId()); distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName()); distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java index ba6ca63f6..a957e6ca0 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java @@ -505,6 +505,30 @@ public class WarehouseUpdownTypeApiController { } } + @ResponseBody + @PostMapping("/downScanTrayCode") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "下架扫描托盘", notes = "传入trayTypeDTO") + public R downScanTrayCode(@RequestBody UpdownTypeDTO updownTypeDTO ) { + String method = "###########downScanTrayCode: "; + log.info(method + "下架扫描托盘 downScanTrayCode={}", updownTypeDTO); + String trayCode = updownTypeDTO.getTrayCode(); + try{ + if(StringUtil.isBlank(trayCode)){ + log.warn(method+"托盘码不能为空 trayCode={}",trayCode); + return R.fail(403,"托盘码不能为空"); + } + //查询该库位的货物信息 + return warehouseUpdownTypeService.downScanTrayCode(trayCode); + }catch (CustomerException e){ + log.warn(e.message); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + @ResponseBody @PostMapping("/downTrayCode") @ApiOperationSupport(order = 1) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java index 5d679d16e..2c1de7db5 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java @@ -59,4 +59,6 @@ public interface IWarehouseUpdownTypeService extends BaseService queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("tray_id",trayId) + .eq("is_deleted",0); + WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(queryWrapper); + if(Objects.isNull(trayTypeEntity)){ + log.warn("#################findUpShelfScanGoods: 托盘没有货物信息 trayCode={}",trayCode); + throw new CustomerException(403,"托盘没有货物信息"); + } + Long trayTypeId = trayTypeEntity.getId();//打托方式id + String type = trayTypeEntity.getType();//打托分类 + List listByTrayTypeId = null; + if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){ + listByTrayTypeId = warehouseTrayGoodsService.getUpListByTrayTypeId(trayTypeId); + }else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){ + listByTrayTypeId = warehouseTrayGoodsService.getZeroUpListByTrayTypeId(trayTypeId); + }else if(PalletProductTypeConstant.STOCKDATA.equals(type)){ + listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); + }else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){ + listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); + } + return R.data(listByTrayTypeId); + } + + private void saveUpdownGoodsLogPart(List updownGoodsList, int residue, String bindingType, Integer isAlltrays, String remark) { List updownGoodsLogList = new ArrayList<>(); for (WarehouseUpdownGoodsEntity updownGoodsEntity:updownGoodsList){ From fb46c1fc6bea60ec147dd9f1cb41c4dbdff1e12c Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Mon, 28 Aug 2023 10:59:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionDeliveryInfoMapper.xml | 14 +++++++------- .../mapper/DistributionDeliveryListMapper.xml | 11 +++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index c81661d34..db515e57e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -315,11 +315,11 @@ ldr.consignee consignee, ldr.reservation_num reservationNum, COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub, - (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id ) ordNub, + (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub, COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub FROM logpm_distribution_signfor lds - JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id + JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40' WHERE lds.is_deleted = 0 AND lds.delivery_id = #{id} @@ -337,12 +337,12 @@ lbm.logpm_unit logpmUnit FROM logpm_distribution_reservation ldr - join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id + join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id and ldrs.stock_article_status in (1,3) join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id - ldr.is_deleted = 0 + ldr.is_deleted = 0 and ldr.reservation_status != '40' AND ldr.id = #{param.reservationId} @@ -367,7 +367,7 @@ GROUP BY ldsa.id ) AS loading - JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id + JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3) JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id @@ -406,7 +406,7 @@ GROUP BY ldsa.id ) AS loading - JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id + JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3) JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id @@ -442,7 +442,7 @@ GROUP BY ldsa.id ) AS loading - JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id + JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3) JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 59619d254..198c3aa93 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -655,16 +655,15 @@ WHERE lds.delivery_id = lddl.id ) forkliftName, --> lddl.create_time createTime, - (SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_signfor lds WHERE lds.delivery_id =lddl.id) - customersNumber, + lddl.customers_number customersNumber, lddl.price price, lddl.added_services_id addedServicesId, (SELECT COALESCE (COUNT(*) ,0) FROM logpm_distribution_signfor lds - join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id + join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40' join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id =ldr.id - WHERE lds.delivery_id = lddl.id + WHERE lds.delivery_id = lddl.id and ldrs.stock_article_status in (1,3) ) orderNumber, (SELECT COALESCE (sum(ldr.reservation_num + ldr.reservation_stock_list_num) ,0) FROM @@ -689,7 +688,7 @@ (SELECT COALESCE (sum(ldr.reservation_stock_list_num) ,0) FROM logpm_distribution_signfor lds - join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id + join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40' WHERE lds.delivery_id = lddl.id) inventoryNub, (SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE lddl.id = lds.delivery_id) scannedNumber, @@ -699,7 +698,7 @@ where ldr.id in (select lds.reservation_id from logpm_distribution_signfor lds - where lds.delivery_id = lddl.id ) + where lds.delivery_id = lddl.id ) and ldr.reservation_status != '40' ) consignee FROM logpm_distribution_delivery_list lddl From eb7a038b0ebdcc2e45565eedd0067ac3809842c0 Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 28 Aug 2023 11:01:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=95=86=E9=85=8D=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListController.java | 1 - .../controller/DistributionReservationController.java | 1 - .../impl/DistributionDeliveryListServiceImpl.java | 11 +++++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 0c650d22f..0fb72b06d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -327,7 +327,6 @@ public class DistributionDeliveryListController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "customArgs") public R> selectDiscussStockArticleInfoList(@ApiIgnore @RequestParam Map params, Query query) { - IPage distributionStockArticle = distributionDeliveryListService.selectDiscussStockArticleInfoList(params,query); return R.data(distributionStockArticle); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index 76b6c50c3..9ef992ca9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -312,7 +312,6 @@ public class DistributionReservationController extends BladeController { @ApiOperation(value = "详情", notes = "传入distrbutionReservation") public R> selectUpdateAvailableStockArticle(@ApiIgnore @RequestParam Long id, Query query,@ApiIgnore @RequestParam Map distributionStockArticle) { IPage page = Condition.getPage(query); - List stockArticleVOS = reservationService.selectUpdateAvailableStockArticle(id,distributionStockArticle); page.setRecords(stockArticleVOS); page.setTotal(stockArticleVOS.size()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 5f904e695..4c660c7df 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -1384,7 +1384,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { + clientNum.getAndIncrement(); //判断原始客户中是否存在 if (Func.isEmpty(originalClient.get(k))) { //不存在,意味这里应该进行客户的新增 @@ -1417,6 +1420,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { + orderNum.getAndIncrement(); mallName.add(s.getMallName()); DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class); List packageListInfo = stockArticleDTO.getPackageListInfo(); @@ -1479,6 +1483,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationStockarticleEntityList = distributionDeliveryListMapper.selectStockArticleById(deliveryListEntityId,k); Map> oldStockArticle = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); v.forEach(s -> { + orderNum.getAndIncrement(); //根据配送和客户名称查询预约 AtomicInteger packageNum = new AtomicInteger(); AtomicInteger reduceNum = new AtomicInteger(); @@ -1628,6 +1633,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = originalClient.get(f); + reservationEntities.forEach(r->{ + distributionSignforMapper.deleteByReservationAndDeliveryId(r.getId(),deliveryListEntityId); + }); }); String kind = deliveryListEntity.getKind(); switch (kind) { @@ -1675,6 +1684,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Mon, 28 Aug 2023 11:02:57 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=97=A0=E5=85=B3=E7=AB=9F=E8=A6=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blade-service/logpm-distribution/pom.xml | 16 ++++-- .../service/impl/AsyncDataServiceImpl.java | 20 +++++-- .../java/com/logpm/factory/TestService.java | 56 ++++++++++++++++--- .../com/logpm/factory/excel/ExcelMode.java | 13 +++++ blade-service/logpm-warehouse/pom.xml | 15 +++-- 5 files changed, 99 insertions(+), 21 deletions(-) create mode 100644 blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java diff --git a/blade-service/logpm-distribution/pom.xml b/blade-service/logpm-distribution/pom.xml index b11ef77eb..1d290685d 100644 --- a/blade-service/logpm-distribution/pom.xml +++ b/blade-service/logpm-distribution/pom.xml @@ -12,7 +12,7 @@ org.springblade logpm-distribution - 3.1.0.RELEASE + ${bladex.project.version} @@ -35,7 +35,7 @@ org.springblade logpm-distribution-api - 3.1.0.RELEASE + ${bladex.project.version} org.springblade @@ -45,12 +45,12 @@ org.springblade logpm-basic-api - 3.1.0.RELEASE + ${bladex.project.version} org.springblade logpm-warehouse-api - 3.1.0.RELEASE + ${bladex.project.version} @@ -75,7 +75,7 @@ org.springblade logpm-basicdata-api - 3.1.0.RELEASE + ${bladex.project.version} compile @@ -85,6 +85,12 @@ ${bladex.project.version} + + org.springblade + blade-user-api + ${bladex.project.version} + + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index ed5f8bc5e..3e89a9097 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -12,12 +12,10 @@ import com.logpm.factory.mt.service.IMtFactoryOrderMainService; import com.logpm.factory.mt.service.IMtFactoryOrderService; import com.logpm.factory.mt.service.IMtPackageInfoService; import com.logpm.factory.oupai.entity.FactoryOrderEntity; +import com.logpm.factory.oupai.entity.FactoryPackageDetailEntity; import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.entity.ReceivingOrderEntity; -import com.logpm.factory.oupai.service.IFactoryOrderService; -import com.logpm.factory.oupai.service.IFactoryPackageService; -import com.logpm.factory.oupai.service.IOuPaiFactoryService; -import com.logpm.factory.oupai.service.IReceivingOrderService; +import com.logpm.factory.oupai.service.*; import com.logpm.factory.pan.service.IPanFactoryOrderService; import com.logpm.factory.pan.service.IPanPackageInfoService; import com.logpm.factory.pan.service.IPanPackageListService; @@ -93,6 +91,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService { private final IReceivingOrderService receivingOrderService; + private final IFactoryPackageDetailService factoryPackageDetailService; + //工厂查询 private final IOuPaiFactoryService ouPaiFactoryService; @@ -509,6 +509,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService { //更新包件 advanceDetailClient.updateAdvanceDetail(advanceDetailEntity); + + + + + } else { advanceDetailEntity = new AdvanceDetailEntity(); advanceDetailEntity.setAdvanceId(advanceEntity.getId());//预仓id @@ -556,6 +561,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService { advanceDetailEntity.setRemark("");//备注 advanceDetailEntity.setOldId(0);// Integer detailId = advanceDetailClient.addAdvanceDetail(advanceDetailEntity); + advanceDetailEntity.setId(detailId); + // 物料明细 + + List factoryPackageDetailEntities = factoryPackageDetailService.lambdaQuery().eq(FactoryPackageDetailEntity::getPackageId, factoryPackageEntity.getId()).list(); + + // todo 保存物料明细 + if (detailId > 0) { //修改数据状态 factoryPackageEntity.setTurnStatus(2); diff --git a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java index f048883a4..019d6d717 100644 --- a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java +++ b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java @@ -1,11 +1,21 @@ package com.logpm.factory; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import com.alibaba.excel.metadata.Sheet; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.logpm.factory.comfac.controller.FactoryCommonController; import com.logpm.factory.comfac.dto.UnloadCarDTO; +import com.logpm.factory.excel.ExcelMode; import com.logpm.factory.mt.entity.MtFactoryOrderMain; import com.logpm.factory.mt.entity.MtPushData; import com.logpm.factory.mt.service.IMtFactoryDataService; @@ -17,6 +27,7 @@ import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.rabbitmq.client.Channel; +import lombok.Data; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springblade.core.test.BladeBootTest; @@ -28,13 +39,12 @@ import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.beans.factory.annotation.Autowired; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.security.NoSuchAlgorithmException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @ExtendWith(BladeSpringExtension.class) @@ -47,10 +57,40 @@ public class TestService { // // // -// @Test -// public void test2() { + public void test2() { // ouPaiFactoryService.findOuPaiFactoryOrderDTOByCarCarNumber("LCD230505047"); -// -// } + + // 获取Excle + Sheet sheet = new Sheet(1, 1, ExcelMode.class); + + try { + List readList = EasyExcelFactory.read(new FileInputStream("f://order_status_log.xlsx"), sheet); + + + List list = new ArrayList(); + for (Object obj : readList) { + ExcelMode t = (ExcelMode) obj; + + JSONObject json = JSONObject.parseObject(t.getArgs()); + + System.out.println(json.getString("unitNo")); + //HttpResponse execute = HttpUtil.createPost("http://h5u.huitongys.com/api/logpm-factory/factory/common/sendOrderStatus").body(t.getArgs()).execute(); + //System.out.println(execute.body()); + + + } + + + + + + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + + + } } + diff --git a/blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java b/blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java new file mode 100644 index 000000000..260c65f5f --- /dev/null +++ b/blade-service/logpm-factory/src/test/java/com/logpm/factory/excel/ExcelMode.java @@ -0,0 +1,13 @@ +package com.logpm.factory.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import lombok.Data; + +@Data +public class ExcelMode extends BaseRowModel { + + @ExcelProperty(index = 1) + private String args; + +} diff --git a/blade-service/logpm-warehouse/pom.xml b/blade-service/logpm-warehouse/pom.xml index 2088f96b1..868b4ce8c 100644 --- a/blade-service/logpm-warehouse/pom.xml +++ b/blade-service/logpm-warehouse/pom.xml @@ -37,7 +37,7 @@ org.springblade logpm-warehouse-api - 3.1.0.RELEASE + ${bladex.project.version} compile @@ -48,13 +48,13 @@ org.springblade logpm-basicdata-api - 3.1.0.RELEASE + ${bladex.project.version} compile org.springblade logpm-distribution-api - 3.1.0.RELEASE + ${bladex.project.version} compile @@ -70,9 +70,16 @@ org.springblade logpm-old-project-api - 3.1.0.RELEASE + ${bladex.project.version} compile + + + org.springblade + blade-user-api + ${bladex.project.version} + +