From 7f102602286c3a1a0d8419311cd1efeafc0d2770 Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Mon, 17 Jul 2023 17:42:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=85=8D=E9=80=81=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionLoadscaninvnEntity.java | 16 ++-- .../vo/DistributionDeliveryInfoVO.java | 15 +++ .../DistributionDeliveryListController.java | 23 +++++ .../dto/DistrilbutionloadingscanDTO.java | 10 ++ .../DistributionDeliveryInfoMapper.java | 13 +++ .../mapper/DistributionDeliveryInfoMapper.xml | 96 +++++++++++++------ .../DistributionDeliveryListMapper.java | 17 +++- .../mapper/DistributionDeliveryListMapper.xml | 31 +++++- .../IDistributionDeliveryInfoService.java | 17 ++++ .../DistributionDeliveryInfoServiceImpl.java | 13 +++ .../DistributionDeliveryListServiceImpl.java | 95 ++++++++++++++++-- 11 files changed, 294 insertions(+), 52 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java index f5ad01f54..72d9cfaa4 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java @@ -212,9 +212,9 @@ public class DistributionLoadscaninvnEntity extends TenantEntity { @ApiModelProperty(value = "客户表id(预约)") private Long reservationId; /** - * 库存品数量 + * 库存品id */ - @ApiModelProperty(value = "库存品数量") + @ApiModelProperty(value = "库存品id") private Long inventoryId; /** * 配送表id @@ -227,11 +227,6 @@ public class DistributionLoadscaninvnEntity extends TenantEntity { @ApiModelProperty(value = "装车数量") private Integer loadedNub; - /** - * 装车数量 - */ - @ApiModelProperty(value = "装车数量") - private Long packageId; /** * 订单编号 @@ -247,7 +242,12 @@ public class DistributionLoadscaninvnEntity extends TenantEntity { * (当前)装车表id */ @ApiModelProperty(value = "(当前)装车表id") - private Long loadingId; + private String loadingId; + /** + * 司机电话 + */ + @ApiModelProperty(value = "司机电话") + private String driverPhone; /** * 签收状态(1-未签收,2签收) */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java index 841467849..c677898bb 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java @@ -58,6 +58,11 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "包条码") private String packetBarCode; + /** + * 物品名称 + */ + @ApiModelProperty(value = "物品名称") + private String materialName; /** * 货位信息 */ @@ -183,6 +188,16 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "备注") private String remarks; + /** + * 签收件数 + */ + @ApiModelProperty(value = "签收件数") + private Integer receivedQuantity; + /** + * 签收状态 + */ + @ApiModelProperty(value = "签收状态") + private String signingStatus; /** * 时段 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 634baa7fe..141c51446 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 @@ -91,6 +91,29 @@ public class DistributionDeliveryListController extends BladeController { IPage pages = distributionDeliveryInfoService.selectDistributionDeliveryInfowrapPage(Condition.getPage(query), distributionDeliveryInfoDTO); return R.data(pages); } + + /** + * 查看包件详情 + */ + @GetMapping("/packdetail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查看包件详情", notes = "传入distributionDeliveryList") + public R> packdetail(DistributionDeliveryInfoDTO distributionDeliveryInfoDTO, Query query) { + IPage pages = distributionDeliveryInfoService.selectDistributionDeliveryInfopackdetail(Condition.getPage(query), distributionDeliveryInfoDTO); + return R.data(pages); + } + + + /** + * 查看库存品 + */ + @GetMapping("/inventory") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查看包件详情", notes = "传入distributionDeliveryList") + public R> inventory(DistributionDeliveryInfoDTO distributionDeliveryInfoDTO, Query query) { + IPage pages = distributionDeliveryInfoService.selectDistributionDeliveryinventory(Condition.getPage(query), distributionDeliveryInfoDTO); + return R.data(pages); + } /** * 配送管理 分页 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java index b6dbf1de2..ecf0b674e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java @@ -88,6 +88,16 @@ public class DistrilbutionloadingscanDTO { @ApiModelProperty(value = "扫描物品(1-手动输入,2-托盘)") // @NotEmpty(message = "扫描物品不能为空") private Integer inventorytype; + /** + * 库存品id + */ + @ApiModelProperty(value = "库存品id") + private Integer inventoryId; + /** + * 库存品数量 + */ + @ApiModelProperty(value = "库存品数量") + private Integer inventoryNub; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java index c45d81353..3dcca67d7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java @@ -23,6 +23,7 @@ import com.logpm.distribution.excel.DistributionDeliveryInfoExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.vo.DistributionStockListVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -88,4 +89,16 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper selectcustomListByOrderId(String orderId); + /** + * 通过配送包条 + * + * @return + */ + List selectDistributionDeliverypackdetailPage(IPage page,@Param("param") DistributionDeliveryInfoDTO distributionDeliveryInfoDTO); + /** + * 通过配送查询库存 + * + * @return + */ + List selectDistributionDeliveryinventoryPage(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO); } 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 0b97125b8..1b214e6aa 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 @@ -34,6 +34,7 @@ + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 055085e9d..a07253358 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -19,12 +19,9 @@ package com.logpm.distribution.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.DistrilbutionloadingscanDTO; -import com.logpm.distribution.entity.DistributionDeliveryListEntity; -import com.logpm.distribution.entity.DistributionReservationEntity; +import com.logpm.distribution.entity.*; import com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO; import com.logpm.distribution.vo.DistributionDeliveryListPrintRequestVO; -import com.logpm.distribution.entity.DistributionLoadscanEntity; -import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -144,4 +141,16 @@ public interface DistributionDeliveryListMapper extends BaseMapper selectRservationByDeliveryId(@Param("deliveryId") Long deliveryId); + /** + * 库存品扫描 + * + * @return + */ + List selectdeliveryworkVn(@Param("barcode") String barcode, @Param("deliveryId") Long deliveryId); + /** + * 通过预约查询库存 + * + * @return + */ + List selectdeliveryworkVnId(@Param("inventoryId") Integer inventoryId,@Param("deliveryId") Long deliveryId); } 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 4fddcb68c..63f3c89cd 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 @@ -297,7 +297,6 @@ join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id where ldrs.is_have_data = '2' and lds.is_deleted =0 and lddl.id = #{deliveryId} and ldpl.packet_bar_code =#{barcode} - + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java index 31b3fa072..ef0ef86fc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java @@ -22,6 +22,7 @@ import com.logpm.distribution.entity.DistributionDeliveryInfoEntity; import com.logpm.distribution.vo.DistributionDeliveryInfoVO; import com.logpm.distribution.excel.DistributionDeliveryInfoExcel; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.vo.DistributionStockListVO; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -57,4 +58,20 @@ public interface IDistributionDeliveryInfoService extends BaseService selectDistributionDeliveryInfowrapPage(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO); + /** + * 从配送查询包条自定义分页 + * + * @param page + * @param distributionDeliveryInfoDTO + * @return + */ + IPage selectDistributionDeliveryInfopackdetail(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO); + /** + * 从配送查看库存品 + * + * @param page + * @param distributionDeliveryInfoDTO + * @return + */ + IPage selectDistributionDeliveryinventory(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index 95e73394a..b0f7a4f42 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -22,6 +22,7 @@ import com.logpm.distribution.vo.DistributionDeliveryInfoVO; import com.logpm.distribution.excel.DistributionDeliveryInfoExcel; import com.logpm.distribution.mapper.DistributionDeliveryInfoMapper; import com.logpm.distribution.service.IDistributionDeliveryInfoService; +import com.logpm.distribution.vo.DistributionStockListVO; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -59,4 +60,16 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryInfopackdetail(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) { + List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliverypackdetailPage(page, distributionDeliveryInfoDTO); + return page.setRecords(distributionDeliveryInfoVOS); + } + + @Override + public IPage selectDistributionDeliveryinventory(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) { + List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryinventoryPage(page, distributionDeliveryInfoDTO); + return page.setRecords(distributionDeliveryInfoVOS); + } + } 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 953b9a13f..2fd4f1425 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 @@ -70,6 +70,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); - if (distributionLoadscanEntities.size() <= 0) { + List distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); + if (distributionLoadscanvnEntities.size() <= 0) { return R.fail(3001, "窜货"); } - for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { + for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) { //查询是否重复扫码 List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId()) @@ -375,11 +377,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); + if (distributionLoadscanvnEntities.size() <= 0) { + return R.fail(3001, "窜货"); + } for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { //查询是否重复扫码 List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() @@ -421,6 +428,35 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId()) + .eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode()) + .ne(DistributionLoadscanEntity::getScanStatus, 1) + ); + if (distributionLoadscanEntitiesflag.size() > 0) { + return R.fail(3002, "重复扫码"); + } + //依次插入该装车记录,设置车辆 + distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + distributionLoadscanEntity.setScanStatus(2); + distributionLoadscanEntity.setScanType("1"); + distributionLoadscanEntity.setScanTime(new Date()); + distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); + distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + if (null != distributionDeliverySelfEntity.getDriverPhone()) { + distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + } + distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + //查询本车次是否第一次扫码,没有则更新上车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新签收表的装车数量 + Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), 1); + } + distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities); } else if (distrilbutionloadingscanDTO.getType() == 3) { //订单扫描,查询该订单是否有数据 DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne( @@ -617,6 +653,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl().lambda() + .eq(DistributionLoadscaninvnEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) + .set(DistributionLoadscaninvnEntity::getScanStatus,3) + ); return R.status(update); } @@ -641,8 +682,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnId(distrilbutionloadingscanDTO.getInventoryId(), distrilbutionloadingscanDTO.getDeliveryId()); + if (distributionLoadscanvnEntities.size() <= 0) { + return R.fail(3001, "窜货"); + } + for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) { + //查询是否重复扫码 + List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId()) + .eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode()) + .ne(DistributionLoadscanEntity::getScanStatus, 1) + ); +// if (distributionLoadscanEntitiesflag.size() > 0) { +// return R.fail(3002, "重复货物"); +// } + //依次插入该装车记录,设置车辆 + distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + distributionLoadscanEntity.setScanStatus(2); + distributionLoadscanEntity.setScanType("1"); + distributionLoadscanEntity.setScanTime(new Date()); + distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); + distributionLoadscanEntity.setLoadedNub(distrilbutionloadingscanDTO.getInventoryNub()); + distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + if (null != distributionDeliverySelfEntity.getDriverPhone()) { + distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + } + distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + //查询本车次是否第一次扫码,没有则更新上车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新签收表的装车数量 + Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distrilbutionloadingscanDTO.getInventoryNub()); + + } + boolean b = distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities); + return R.status(b); }