From 09f033a383a8b68f317c39cf310a8b71c8ae16ed Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Tue, 26 Sep 2023 20:00:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?1.=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/factory/oupai/receiver/OpReceivingDataHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java index 6ca99c06d..6535e1746 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java @@ -41,7 +41,7 @@ public class OpReceivingDataHandler { panFactoryDataService.handleDataToPlatform(orderPackageCode, receivingTime); } catch (Exception e) { - log.error("##################opReceivingDataHandler: 处理欧派收货数据到新系统,orderPackageCode:{},receivingTime{}", + log.error("##################opReceivingDataHandler: 处理欧派收货数据到新系统,orderPackageCode:{},receivingTime:{}", orderPackageCode,receivingTime); } From d543279ecf6cbc5d42bc1d486318cb1cc7441a1b Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 26 Sep 2023 20:33:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E8=A3=85=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LoadingAbnormalAuditingStatusConstant.java | 46 +++ .../DistributionLoadscanAbnormalEntity.java | 22 +- .../entity/DistributionLoadscanEntity.java | 4 +- .../vo/DistributionAddvalueVO.java | 2 + .../vo/app/DistributionAppReservationVO.java | 11 + .../DistributionAddvalueAppController.java | 2 +- .../DistributionDeliveryAppController.java | 16 + .../mapper/DistributionAddvalueMapper.xml | 3 +- .../DistributionDeliveryListMapper.java | 8 + .../mapper/DistributionDeliveryListMapper.xml | 66 ++++ .../service/IDistributionAsyncService.java | 19 ++ .../IDistributionDeliveryListService.java | 7 + .../impl/DistributionAddvalueServiceImpl.java | 5 + .../impl/DistributionAsyncServiceImpl.java | 153 ++++++++- .../DistributionDeliveryListServiceImpl.java | 317 ++++++++++++++---- .../DistributionReservationServiceImpl.java | 7 +- 16 files changed, 598 insertions(+), 90 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalAuditingStatusConstant.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalAuditingStatusConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalAuditingStatusConstant.java new file mode 100644 index 000000000..40111f1e1 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalAuditingStatusConstant.java @@ -0,0 +1,46 @@ +package org.springblade.common.constant.loading; + +/** + * 异常装车审核枚举 + * 对应码表 freeze_status + * @author TJJ + */ +public enum LoadingAbnormalAuditingStatusConstant { + + daishenhe("待审核",1), + yishenhe("已审核",2), + yichang("异常",3); + + + /** + * 状态 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + + private LoadingAbnormalAuditingStatusConstant(String name, Integer value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java index 55119db85..af42437a0 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java @@ -40,32 +40,32 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity { * 预约ID */ @ApiModelProperty(value = "预约ID") - private String reservationId; + private Long reservationId; /** * 配送管理ID */ @ApiModelProperty(value = "配送管理ID") - private String deliveryListId; + private Long deliveryListId; /** * 包件ID */ @ApiModelProperty(value = "包件ID") - private String packageId; + private Long packageId; /** * 订单ID */ @ApiModelProperty(value = "订单ID") - private String stockArticleId; + private Long stockArticleId; /** * 扫描操作人 */ @ApiModelProperty(value = "扫描操作人") - private String sacnUser; + private String scanUser; /** * 扫描操作时间 */ @ApiModelProperty(value = "扫描操作时间") - private String scanTime; + private Date scanTime; /** * 包条码 */ @@ -80,7 +80,7 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity { * 司机ID */ @ApiModelProperty(value = "司机ID") - private String driverId; + private Long driverId; /** * 司机名称 */ @@ -90,7 +90,7 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity { * 车辆ID */ @ApiModelProperty(value = "车辆ID") - private String vehicleId; + private Long vehicleId; /** * 车牌号 */ @@ -120,7 +120,7 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity { * 审核时间 */ @ApiModelProperty(value = "审核时间") - private String auditingTime; + private Date auditingTime; /** * 包件配送类型 1 - 商配 2-市配 */ @@ -135,12 +135,12 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity { * 审核状态 1-未审核 2- 已审核 3 - 异常 */ @ApiModelProperty(value = "审核状态 1-未审核 2- 已审核 3 - 异常") - private String auditingStatus; + private Integer auditingStatus; /** * 装车数量 */ @ApiModelProperty(value = "装车数量") - private String loadingQuantity; + private Integer loadingQuantity; /** * 预留1 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java index ea334bd45..6dfed5492 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java @@ -340,11 +340,11 @@ public class DistributionLoadscanEntity extends TenantEntity { * 是否异常签收 1-否 2-是 */ @ApiModelProperty(value = "是否异常签收 1-否 2-是") - private Long isAbnormalSigning; + private String isAbnormalSigning; /** * 是否异常装车 1-否 2-是 */ @ApiModelProperty(value = "是否异常装车 1-否 2-是") - private Long isAbnormalLoading; + private String isAbnormalLoading; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java index b8fe2ea6f..8659da66a 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java @@ -53,5 +53,7 @@ public class DistributionAddvalueVO extends DistributionAddvalueEntity { private Long addvalueDetailId; + private Integer isAll; + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java index 6ff9f47bc..ebed5d2bb 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java @@ -16,11 +16,15 @@ */ package com.logpm.distribution.vo.app; +import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionReservationEntity; +import com.logpm.distribution.vo.DistributionParcelListVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 预约列表 App视图实体类 * @@ -98,6 +102,13 @@ public class DistributionAppReservationVO extends DistributionReservationEntity private String goodsNames; + /** + * 包件信息 + */ + @ApiModelProperty(value = "包件信息") + private List packageList; + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java index 4cd2ed4d2..5ab81cf5a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java @@ -122,7 +122,7 @@ public class DistributionAddvalueAppController { /** - * 查询编辑增值服务数据 + * 查询增值服务数据 */ @PostMapping("/addvalueInfo") @ApiOperationSupport(order = 1) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java index 1594a06ec..f1c996ae6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java @@ -13,6 +13,7 @@ import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -36,6 +37,7 @@ public class DistributionDeliveryAppController { + /** * 配送管理 列表 */ @@ -80,6 +82,8 @@ public class DistributionDeliveryAppController { return R.data(pages); } + + /** * 配送 查看订单 */ @@ -136,6 +140,18 @@ public class DistributionDeliveryAppController { return msg; } + /** + * 异常装车 + */ + @PostMapping("/abnormalLoading") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO") + public R abnormalLoading(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + R r= distributionDeliveryListService.abnormalLoading(distrilbutionloadingscanDTO); + return r; + } + + /** * 配送管理 库存品装车 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml index 88c63d76c..cd9be75a7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml @@ -62,7 +62,8 @@ ldad.flool_num AS floolNum, ldad.distance AS distance, ldad.id AS addvalueDetailId, - GROUP_CONCAT(ldap.package_id) AS packageListIds + GROUP_CONCAT(ldap.package_id) AS packageListIds, + ldad.record_type AS isAll FROM logpm_distribution_addvalue AS lda INNER JOIN logpm_distribution_addvalue_detail AS ldad ON lda.id = ldad.addvalue_id 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 69f826328..378e5d088 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 @@ -377,4 +377,12 @@ public interface DistributionDeliveryListMapper extends BaseMapper + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java index 52dafe1d4..b9b8e3d83 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -167,4 +167,23 @@ public interface IDistributionAsyncService { * @param stockupDTO */ void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException; + + /** + * 检查维护装车状态 + * @param parcelListEntity + * @param deliveryId + */ + void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId); + + /** + * 托盘装车 维护装车状态 + * @param deliveryId + */ + void checkLoadingByDelivery(Long deliveryId); + + /** + * 维护包件、订单装车和出库状态 + * @param parcelListEntity + */ + void checkOrderLoadingStatus(DistributionParcelListEntity parcelListEntity); } 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 5f2f4e53b..ea4eb7a0c 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 @@ -257,4 +257,11 @@ public interface IDistributionDeliveryListService extends BaseService getAppDeliveryreservationTraysPage(IPage page, DistributionAppDeliveryListDTO distributionDeliveryList); + + /** + * 异常装车 + * @param distrilbutionloadingscanDTO + * @return + */ + R abnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java index dd248fe70..c6f619445 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java @@ -249,6 +249,11 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId()); + if (parcelListEntities.size() == packageEntityList.size()){ + distributionAddvalueDetailEntity.setRecordType(1); + } distributionAddvalueDetailService.save(distributionAddvalueDetailEntity); packageEntityList.stream().forEach(p->p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId())); distributionAddvaluePackageService.saveBatch(packageEntityList); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 6d79177b1..8c403479d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -660,6 +661,152 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { }*/ } + @Override + public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId) { + //首先能够进入这个检测方法那么此包件就是进行装车了,这里对包件装车状态再次进行维护 + if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){ + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); + parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + distributionParcelListService.updateById(parcelListEntity); + } + + //维护此包件对应的订单装车状态 + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); + if (Func.isNotEmpty(stockArticleEntity)){ + //查询订单的所有包件 + List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())); + boolean orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (orderLoadingFlag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + }else { + orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (!orderLoadingFlag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + } + distributionStockArticleService.updateById(stockArticleEntity); + } + //维护预约计划 + List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); + if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){ + for (DistributionReservationEntity reservationEntity : reservationEntityList) { + List reservationParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); + if (Func.isNotEmpty(reservationParcelListEntities)&& reservationParcelListEntities.size()>0){ + boolean reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (reservationLoadingFlag){ + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); + }else { + reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (reservationLoadingFlag){ + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); + }else { + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); + } + } + distributionReservationMapper.updateById(reservationEntity); + } + } + } + //维护配送计划 + DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); + if (Func.isNotEmpty(deliveryListEntity)){ + List deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); + if (Func.isNotEmpty(deliveryParcelListEntities) && deliveryParcelListEntities.size()>0){ + boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (deliveryLoadingFlag){ + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); + }else { + deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (deliveryLoadingFlag){ + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); + }else { + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); + } + } + distributionDeliveryListMapper.updateById(deliveryListEntity); + } + } + } + + + @Override + public void checkLoadingByDelivery(Long deliveryId) { + DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); + if (Func.isNotEmpty(deliveryListEntity)){ + List deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); + boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p->p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (deliveryLoadingFlag){ + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); + }else { + deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p->p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (deliveryLoadingFlag){ + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); + }else { + deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); + } + } + distributionDeliveryListMapper.updateById(deliveryListEntity); + } + List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); + if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){ + for (DistributionReservationEntity reservationEntity : reservationEntityList) { + List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); + Map> order = parcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId)); + order.forEach((k,v)->{ + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(k); + List stockArticlePackageList = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, k)); + if (stockArticlePackageList.size() == v.size()){ + boolean orderLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (orderLoadingFlag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + }else { + orderLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (!orderLoadingFlag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + } + }else { + boolean orderbufenLoadingFlag = v.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (orderbufenLoadingFlag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + } + distributionStockArticleService.updateById(stockArticleEntity); + }); + boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (reservationLoadingFlag){ + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); + }else { + reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (reservationLoadingFlag){ + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); + }else { + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); + } + } + distributionReservationMapper.updateById(reservationEntity); + } + + } + } + + @Override + public void checkOrderLoadingStatus(DistributionParcelListEntity parcelListEntity) { + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); + List parcelListEntityList = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); + boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + if (flag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + }else { + flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (!flag){ + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + } + distributionStockArticleService.updateById(stockArticleEntity); + } + /** * 自提签收片段是否签收完全 @@ -927,10 +1074,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { //这里表示所有的包件都是已装车,进行订单状态修改已出库 stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); } else { - flag = parcelListEntityList.stream().allMatch(pack -> pack.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue())); - if (flag) { + flag = parcelListEntityList.stream().allMatch(pack -> pack.getOrderPackageReservationStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); + if (!flag) { //全部未装车 - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); } else { //部分预约 stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); 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 638a00e91..80e3cc3d2 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 @@ -58,6 +58,7 @@ import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; import org.springblade.common.constant.delivery.DeliveryStatusConstant; +import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant; import org.springblade.common.constant.loading.LoadingIsInsertConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.order.OrderStatusConstant; @@ -78,6 +79,7 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -144,6 +146,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { @@ -422,33 +427,32 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); List parcelListEntityList = distributionParcelListEntities.stream().filter(p -> Func.equals(p.getOrderPackageCode(), distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList()); - if (parcelListEntityList.size() == 1){ + if (parcelListEntityList.size() == 1) { //在配送任务中存在该包件的计划 List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) .eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()) .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); - - if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1){ + if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1) { return Resp.scanSuccess("重复扫码", "重复扫码"); } DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); } DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0); @@ -460,15 +464,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue())); DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId()); - if (shangpeiFlag){ + if (shangpeiFlag) { List reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList()); //查看是否存在满足条件的预约单 - if (reservationEntities.size() == 1){ - return R.fail(5000,"异常装车"); + if (reservationEntities.size() == 1) { + return R.fail(5000, "异常装车"); // return Resp.scanFail("装车失败","程序出错,请联系张思雨"); - }else { - return Resp.scanFail("装车失败","窜货"); + } else { + return Resp.scanFail("装车失败", "窜货"); } - }else { + } else { shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue())); - if (shangpeiFlag){ + if (shangpeiFlag) { List reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r) && r.getConsignee().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList()); - if (reservationEntities.size() == 1){ - return R.fail(5000,"异常装车"); - }else { - return Resp.scanFail("装车失败","窜货"); + if (reservationEntities.size() == 1) { + return R.fail(5000, "异常装车"); + } else { + return Resp.scanFail("装车失败", "窜货"); } - }else { - log.error("配送计划预约类型错误:{}",reservationEntityList); + } else { + log.error("配送计划预约类型错误:{}", reservationEntityList); } } //不存在配送计划中,这里进行客户的判断 } - }else if (distrilbutionloadingscanDTO.getType() ==2){ + } else if (distrilbutionloadingscanDTO.getType() == 2) { TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(distrilbutionloadingscanDTO.getBarcode()); - if (Func.isNotEmpty(trayTypeDataVO)){ + if (Func.isNotEmpty(trayTypeDataVO)) { List voGoodsLsit = trayTypeDataVO.getGoodsLsit(); List trayGoodIds = voGoodsLsit.stream().filter(v -> v.getAssociationType().equals("3")).map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList()); //此时经过过滤后的包件ID和托盘上的所有包件ID数量一致,视为该托盘上的均为包件 - if (voGoodsLsit.size() == trayGoodIds.size()){ + if (voGoodsLsit.size() == trayGoodIds.size()) { List parcelListEntities = distributionParcelListService.listByIds(trayGoodIds); boolean trayLoadingStatus = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (trayLoadingStatus){ - return Resp.scanFail("托盘装车完毕","托盘装车完毕"); +// if (trayLoadingStatus){ +// return Resp.scanFail("托盘装车完毕","托盘货物已装车完毕"); +// } + List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + .ne(DistributionLoadscanEntity::getScanStatus, 1) + .eq(DistributionLoadscanEntity::getTrayNo, distrilbutionloadingscanDTO.getBarcode())); + if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0 && trayLoadingStatus) { + return Resp.scanFail("重复扫描", "重复扫描"); } - if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0){ - return Resp.scanFail("操作失败","该托盘上无货物信息"); + if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0) { + return Resp.scanFail("操作失败", "该托盘上无货物信息"); } - if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())){ + if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) { //存在客户 这里就是针对客户进行的整托装车 List parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); Map parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2)); boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId()))); - if (reservationFlag){ + if (reservationFlag) { List reservationLoadscanEntities = new ArrayList<>(); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { - if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){ + if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); distributionParcelListService.updateById(parcelListEntity); DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); } loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); @@ -572,51 +590,57 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl deliveryPackageList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); Map deliveryPackageMap = deliveryPackageList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2)); boolean delivaryFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(deliveryPackageMap.get(p.getId()))); - if (delivaryFlag){ + if (delivaryFlag) { List deliveryLoadscanEntities = new ArrayList<>(); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { - if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){ + if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { + //查询出这个包件属于哪个客户 + DistributionReservationEntity reservationEntity = distributionDeliveryListMapper.selectReservationByPackageAndDeliveryId(parcelListEntity.getOrderPackageCode(), distrilbutionloadingscanDTO.getDeliveryId()); parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); distributionParcelListService.updateById(parcelListEntity); DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); } - if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){ + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); } loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); + //查询出这个包件属于哪个客户 + loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId()); loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); + loadscanEntity.setPackageId(parcelListEntity.getId()); + loadscanEntity.setReservationId(reservationEntity.getId()); loadscanEntity.setScanTime(new Date()); BladeUser user = AuthUtil.getUser(); loadscanEntity.setScanUser(user.getUserName()); @@ -633,16 +657,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); List collect = null; - if (Func.isEmpty(barcode)){ + if (Func.isEmpty(barcode)) { //没有包件码 这里进行的是检测为装车操作 - collect = parcelListEntities.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList()); + collect = parcelListEntities.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList()); - }else { + } else { //查询该客户下的相关保健信息 List reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.query().lambda() .eq(DistributionReservationPackageEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) .like(DistributionReservationPackageEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode())); - if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size()>0){ + if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size() > 0) { List longs = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList()); - collect = distributionParcelListService.listByIds(longs); + collect = distributionParcelListService.listByIds(longs); } } - return R.data(200,collect,""); + return R.data(200, collect, ""); } @Override public R patchworkInventoryCode(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { List detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId()); List collect = null; - if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcode())){ + if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcode())) { //检测未装车的库存品信息 - collect = detailEntities.stream().filter(i -> Func.isNotEmpty(i.getStockPackageCode()) && i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList()); - }else { + collect = detailEntities.stream().filter(i -> Func.isNotEmpty(i.getStockPackageCode()) && i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList()); + } else { collect = disStockListDetailService.list(Wrappers.query().lambda().like(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()).eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())); } - return R.data(200,collect,""); + return R.data(200, collect, ""); } /** * 批量打印预约单 + * * @param ids * @return */ @@ -3517,11 +3544,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> printBatchByReservation:distributionReservationEntity {}",distributionReservationEntity); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> printBatchByReservation:distributionReservationEntity {}", distributionReservationEntity); Map map = new HashMap<>(); buildMapData(map, distributionReservationEntity); map.put("承运商", ""); - map.put("配送仓库",""); + map.put("配送仓库", ""); // TODO 查询配送单的时间 map.put("出库时间", ""); @@ -3547,9 +3574,158 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl getAppDeliveryreservationTraysPage(IPage page, DistributionAppDeliveryListDTO distributionDeliveryList) { // ---------------------------------2023-09-25 新增托盘详情--------------------------------------------------------------------------------------- List customList = distributionDeliveryInfoMapper.selectAppTarysListPage(page, Long.parseLong(distributionDeliveryList.getReservationId())); + customList.forEach(c -> { + TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(c.getTrayCode()); + List parcelListEntities = distributionParcelListService.listByIds(trayTypeDataVO.getGoodsLsit()); + c.setPackageList(DistributionParcelListWrapper.build().listVO(parcelListEntities)); + }); return page.setRecords(customList); } + + @Override + public R abnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); + if (Func.isEmpty(deliveryListEntity)) { + log.error("配送计划null:{}", deliveryListEntity); + return Resp.scanFail("操作失败", "服务器正忙..."); + } + List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); + if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1){ + DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0); + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); + if (Func.isEmpty(stockArticleEntity)){ + log.error("###############订单异常:{}",stockArticleEntity); + return Resp.scanFail("操作失败", "服务器正忙..."); + } + DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO(); + if (StringUtils.isBlank(distrilbutionloadingscanDTO.getLoadingId())) { + if (deliveryListEntity.getKind().equals("1")) { + distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper().lambda() + .eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES) + .eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + ); + } else { + DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper().lambda() + .eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + ); + BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); + } + } else { + if (deliveryListEntity.getKind().equals("1")) { + distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId()); + } else { + DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectById(distrilbutionloadingscanDTO.getLoadingId()); + BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); + } + } + + List loadscanAbnormalEntityList = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, distrilbutionloadingscanDTO.getDeliveryId()) + .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) + .ne(DistributionLoadscanAbnormalEntity::getAuditingStatus, "1")); + if (Func.isNotEmpty(loadscanAbnormalEntityList) && loadscanAbnormalEntityList.size() == 1){ + return Resp.scanFail("操作失败", "重复添加"); + } + DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); + BladeUser user = AuthUtil.getUser(); + DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); + DistributionReservationEntity reservationEntity = null; + switch (deliveryListEntity.getType()) { + case "1": + //商配 需要满足订单的收货单位和当前配送计划中的预约客户名称一样 + List shangpeiReservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); + Map reservationEntityMap = shangpeiReservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee())).collect(Collectors.toMap(DistributionReservationEntity::getReceivingUnit, Function.identity(), (k1, k2) -> k2)); + if (Func.isEmpty(reservationEntityMap.get(stockArticleEntity.getConsigneeUnit()))){ + return Resp.scanFail("操作失败", "配送任务无该客户"); + } + reservationEntity = reservationEntityMap.get(stockArticleEntity.getConsigneeUnit()); + //查询是否已经异常装车了 + //构建异常装车数据 + + //完成对该客户的异常装车数据和数量维护 + break; + case "2": + List shipeiReservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); + Map shipeiReservationEntityMap = shipeiReservationEntityList.stream().collect(Collectors.toMap(DistributionReservationEntity::getConsignee, Function.identity(), (k1, k2) -> k2)); + DistributionReservationEntity distributionReservationEntity = shipeiReservationEntityMap.get(stockArticleEntity.getCustomerName()); + if (Func.isEmpty(distributionReservationEntity)){ + return Resp.scanFail("操作失败","配送任务无该客户"); + } + if (distributionReservationEntity.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) + || stockArticleEntity.getCustomerTelephone().equals(distributionReservationEntity.getDeliveryPhone()) + || distributionReservationEntity.getMallName().equals(stockArticleEntity.getMallName())){ + return Resp.scanFail("操作失败","配送任务无该客户"); + } + reservationEntity = distributionReservationEntity; + //市配 + break; + } + distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); + distributionLoadscanAbnormalEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); + distributionLoadscanAbnormalEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); + distributionLoadscanAbnormalEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + distributionLoadscanAbnormalEntity.setDeliveryListId(deliveryListEntity.getId()); + distributionLoadscanAbnormalEntity.setReservationId(reservationEntity.getId()); + distributionLoadscanAbnormalEntity.setDeliveryType(deliveryListEntity.getType()); + distributionLoadscanAbnormalEntity.setScanUser(user.getUserName()); + distributionLoadscanAbnormalEntity.setScanTime(new Date()); + distributionLoadscanAbnormalEntity.setLoadingQuantity(parcelListEntity.getQuantity()); + distributionLoadscanAbnormalEntity.setPackageCode(parcelListEntity.getOrderPackageCode()); + distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId()); + distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity); + //修改包件状态 维护订单状态 + parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); + distributionParcelListService.updateById(parcelListEntity); + //添加包件数据至扫描表中 + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { + loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + } + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { + loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + } + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { + loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + } + if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { + loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + } + if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { + loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + } + loadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); + loadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); + loadscanEntity.setScanType("1"); + loadscanEntity.setOneClick(1); + loadscanEntity.setPackageId(parcelListEntity.getId()); + loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); + loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); +// DistributionReservationEntity reservationEntity = distributionDeliveryListMapper.selectReservationByPackageAndDeliveryId(parcelListEntity.getOrderPackageCode(), distrilbutionloadingscanDTO.getDeliveryId()); + loadscanEntity.setReservationId(reservationEntity.getId()); + loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); + loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); + loadscanEntity.setScanTime(new Date()); + loadscanEntity.setScanUser(user.getUserName()); + loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); + loadscanEntity.setIsAbnormalLoading("1"); + //出库 + warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode()); + //查询本车次是否第一次扫码,没有则更新上车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新签收表的装车数量 + Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); + //异步维护此异常装车包件的订单状态 + distributionAsyncService.checkOrderLoadingStatus(parcelListEntity); + }else { + log.error("#################出现相同的包件信息:{}",parcelListEntities); + return Resp.scanFail("操作失败", "服务器正忙..."); + } + return Resp.scanSuccess("操作成功","操作成功"); + } + public Map getDriverCar(String kind, Long deliveryListEntityId) { Map map = new HashMap<>(); String dirverName = null; @@ -3767,7 +3943,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>> distributionReservationEntity {}",distributionReservationEntity); + log.debug(">>>> distributionReservationEntity {}", distributionReservationEntity); buildMapData(map, distributionReservationEntity); map.put("承运商", byId.getDistributionCompany()); map.put("配送仓库", byId.getWarehouseName()); @@ -3797,13 +3973,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map,DistributionReservationEntity distributionReservationEntity ){ + private void buildMapData(Map map, DistributionReservationEntity distributionReservationEntity) { map.put("配送单号", distributionReservationEntity.getReservationCode()); String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); - map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + map.put("配送单二维码", QRCodeUtil.getEmpAutograph(fileTypeName)); // todo 查询运单的收货人电话 map.put("商场名称", distributionReservationEntity.getMallName()); 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 e322b7720..1e1559414 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 @@ -816,7 +816,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl Date: Tue, 26 Sep 2023 21:04:17 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E8=A3=85=E8=BD=A6?= =?UTF-8?q?=E5=B8=82=E9=85=8Dbug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 80e3cc3d2..88c206691 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 @@ -3620,7 +3620,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl loadscanAbnormalEntityList = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() .eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, distrilbutionloadingscanDTO.getDeliveryId()) .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) @@ -3643,7 +3642,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Tue, 26 Sep 2023 21:31:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/vo/app/queryOrderVO.java | 34 +++++++++ .../controller/BasicMaterialController.java | 1 + .../DistributionInQueryApiController.java | 50 +++++++++++++ .../distribution/dto/app/queryOrderDTO.java | 17 +++++ .../mapper/DistributionParcelListMapper.java | 8 +++ .../mapper/DistributionParcelListMapper.xml | 52 ++++++++++++++ .../DistributionStockArticleMapper.java | 5 ++ .../mapper/DistributionStockArticleMapper.xml | 25 +++++++ .../IDistributionStockArticleService.java | 11 +++ .../DistributionStockArticleServiceImpl.java | 70 +++++++++++++++++++ .../mapper/WarehouseUpdownGoodsLogMapper.xml | 1 - .../WarehouseWarehousingEntryServiceImpl.java | 3 + 12 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionInQueryApiController.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/queryOrderDTO.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java new file mode 100644 index 000000000..e8958026a --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java @@ -0,0 +1,34 @@ +package com.logpm.distribution.vo.app; + +import com.logpm.distribution.entity.DistributionParcelListEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class queryOrderVO extends DistributionParcelListEntity { + private static final long serialVersionUID = 1L; + + /** + * 包件列表 + */ + @ApiModelProperty(value = "包件列表") + private List list = new ArrayList<>(); + /** + * 定制品 + */ + @ApiModelProperty(value = "定制品数量") + private Integer wrapNum; + + /** + * 库存品数量 + */ + @ApiModelProperty(value = "定制品数量") + private Integer inventoryNum; + + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java index aec7feece..42ea59835 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java @@ -191,6 +191,7 @@ public class BasicMaterialController extends BladeController { basicMaterialExcel.setLogpmUnit("1"); basicMaterialExcel.setPackageNum("3"); basicMaterialExcel.setWeight(BigDecimal.valueOf(0)); + list.add(basicMaterialExcel); ExcelUtil.export(response, "物料基础信息数据模板" + DateUtil.time(), "物料基础信息数据模板表", list, BasicMaterialExcel.class); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionInQueryApiController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionInQueryApiController.java new file mode 100644 index 000000000..d84f9162a --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionInQueryApiController.java @@ -0,0 +1,50 @@ +package com.logpm.distribution.appcontroller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.distribution.dto.app.queryOrderDTO; +import com.logpm.distribution.service.IDistributionStockArticleService; +import com.logpm.distribution.vo.app.queryOrderVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Log4j2 +@RestController +@AllArgsConstructor +@RequestMapping("/app/distributionInQuery") +@Api(value = "库内查询", tags = "库内查询") +public class DistributionInQueryApiController { + + private final IDistributionStockArticleService distributionStockArticleService; + + + @ResponseBody + @PostMapping("/order") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询订单", notes = "传入trayTypeDTO") + public R order(@RequestBody queryOrderDTO queryrderDTO) { + if (null == queryrderDTO.getType()){ + return R.fail("查询类型为空"); + } + queryOrderVO q = distributionStockArticleService.queryOrder(queryrderDTO); + return R.data(q); + } + + @ResponseBody + @PostMapping("/fuzzy") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "模糊查询", notes = "传入trayTypeDTO") + public R fuzzy(@RequestBody queryOrderDTO queryrderDTO) { + if (null == queryrderDTO.getType()){ + return R.fail("查询类型为空"); + } + List q = distributionStockArticleService.queryFuzzy(queryrderDTO); + return R.data(q); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/queryOrderDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/queryOrderDTO.java new file mode 100644 index 000000000..a4e0a9aae --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/queryOrderDTO.java @@ -0,0 +1,17 @@ +package com.logpm.distribution.dto.app; + +import lombok.Data; + +@Data +public class queryOrderDTO { + + /** + * 查询条件 + */ + private String condition; + + /** + * 类型(1-包条,2-订单) + */ + private Integer type; +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index f5149bada..a29b41f06 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -28,6 +28,7 @@ import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.PackageStockupVO; import org.apache.ibatis.annotations.Param; +import java.util.ArrayList; import java.util.List; /** @@ -106,4 +107,11 @@ public interface DistributionParcelListMapper extends BaseMapper getPackageList(@Param("stockArticleId") Long id); + + + List selectListByOderId(@Param("id")Long id,@Param("collect") List collect); + + ArrayList selectorderPackageCodeByLike(@Param("condition") String condition,@Param("collect") List collect); + + ArrayList selectorderCodeByLike(@Param("condition") String condition,@Param("collect") List collect); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 050a05300..f236f2da1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -504,5 +504,57 @@ ldpl.stock_article_id = #{stockArticleId} and ldpl.order_package_reservation_status in ('10','20') and ldpl.order_package_reservation_status = '10' + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 1266cc291..5d4616057 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -25,6 +25,7 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.excel.DistributionStockArticleExcel; import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO; import com.logpm.distribution.vo.DistributionStockArticleVO; +import com.logpm.distribution.vo.app.queryOrderVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -92,4 +93,8 @@ public interface DistributionStockArticleMapper extends BaseMapper pageListOwe(IPage page,@Param("param")DistributionStockArticleOweDTO stockArticleEntity); + + queryOrderVO selectOneByWrap(@Param("condition") String condition,@Param("collect") List collect); + + queryOrderVO selectOneByOrder(@Param("condition") String condition,@Param("collect") List collect); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 6f10dcca6..a559f9b06 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -404,6 +404,31 @@ GROUP BY ldsa.id ,ldpl.id + + + update logpm_distribution_stock_article diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 638b81c60..b875438f3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -19,10 +19,12 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.dto.DistributionStockArticleDTO; +import com.logpm.distribution.dto.app.queryOrderDTO; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.excel.DistributionStockArticleExcel; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.OrderPackgeCodeDataVO; +import com.logpm.distribution.vo.app.queryOrderVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -135,4 +137,13 @@ public interface IDistributionStockArticleService extends BaseService distributionStockArticle, Query query); + /** + * 订单查询 + * @param queryrderDTO + */ + queryOrderVO queryOrder(queryOrderDTO queryrderDTO); + + queryOrderVO queryOrderVOCont(String condition,Integer i); + + List queryFuzzy(queryOrderDTO queryrderDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 304d5bc5f..be7830360 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -32,6 +32,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.dto.DistributionStockArticleOweDTO; +import com.logpm.distribution.dto.app.queryOrderDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionStockArticleExcel; import com.logpm.distribution.mapper.DistributionAddvalueMapper; @@ -43,6 +44,7 @@ import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.OrderPackgeCodeDataVO; +import com.logpm.distribution.vo.app.queryOrderVO; import com.logpm.distribution.wrapper.DistributionParcelListWrapper; import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; import lombok.AllArgsConstructor; @@ -779,6 +781,74 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl myWarehouseList = warehouseClient.getMyWatchWarehouse(); + List collect = myWarehouseList.stream() + .map(BasicdataWarehouseEntity::getId) + .collect(Collectors.toList()); + //查询包条所在订单 + queryOrderVO queryOrderVO; + if (i ==1){ + queryOrderVO = distributionStockArticleMapper.selectOneByWrap(condition,collect); + }else { + //根据订单自编码查询该订单 + queryOrderVO = distributionStockArticleMapper.selectOneByOrder(condition,collect); + } + if (null == queryOrderVO){ + return new queryOrderVO(); + } + Long id = queryOrderVO.getId(); + //查询订单下的所有包条 + List distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id,collect); + queryOrderVO.setWrapNum(distributionParcelListEntitys.size()); + queryOrderVO.setInventoryNum(0); + queryOrderVO.setList(distributionParcelListEntitys); + return queryOrderVO; + } + + @Override + public List queryFuzzy(queryOrderDTO queryrderDTO) { + ArrayList arrayList = new ArrayList<>(); + //获取当前登录人仓库 + List myWarehouseList = warehouseClient.getMyWatchWarehouse(); + List collect = myWarehouseList.stream() + .map(BasicdataWarehouseEntity::getId) + .collect(Collectors.toList()); + //查询类型 + switch (queryrderDTO.getType()){ + case 1: + //查询包条 + arrayList =distributionParcelListMapper.selectorderPackageCodeByLike(queryrderDTO.getCondition(),collect); + break; + case 2: + //查询订单 + arrayList =distributionParcelListMapper.selectorderCodeByLike(queryrderDTO.getCondition(),collect); + break; + + }; + return arrayList; + } + + @Override public DistributionStockArticleEntity findStockArticleByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml index 3a9c9b830..fe9137fd2 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml @@ -92,7 +92,6 @@ and lwup.binding_type = #{param.bindingType} - diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java index 2863feb68..4201ff66e 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java @@ -47,6 +47,7 @@ import com.logpm.warehouse.service.IWarehouseWarehousingDetailService; import com.logpm.warehouse.service.IWarehouseWarehousingEntryService; import com.logpm.warehouse.vo.WarehouseWarehousingEntryVO; import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; @@ -71,6 +72,7 @@ import java.util.stream.Collectors; */ @AllArgsConstructor @Service +@Log4j2 public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl implements IWarehouseWarehousingEntryService { private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService; private final IDistributionStockListClient distributionStockListClient; @@ -355,6 +357,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl>>>>>>>>>>>{}",one); if(ObjectUtils.isNotNull(one) && ObjectUtils.isNotNull(one.getId())){ List list = warehouseWarehousingDetailService.list(Wrappers.query().lambda() .eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, one.getId()) From d50d30b93d359bd637c46dbf22a9dcd62f96a720 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Tue, 26 Sep 2023 22:04:21 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E9=94=81=E7=9A=84redis=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionStockupAppController.java | 4 ++- .../distribution/config/RedissonConfig.java | 21 ++++++++++++-- .../src/main/resources/application-prod.yml | 26 ----------------- .../java/com/logpm/factory/TestService.java | 28 +++++++++++++++++++ 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index f9c08694d..b3731cd12 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -451,7 +451,9 @@ public class DistributionStockupAppController extends BladeController { // try{ //设置lockey String lockKey = stockupDTO.getPacketBarCode()+stockupDTO.getStockupId(); - RLock lock = new RedissonConfig().redisson().getLock(lockKey); + RLock lock = + + new RedissonConfig().redisson().getLock(lockKey); if(lock.isLocked()){ String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); return Resp.scanFail("重复扫描!", audioValue2); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java index 57f037c36..394536540 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java @@ -2,17 +2,34 @@ package com.logpm.distribution.config; import org.redisson.Redisson; import org.redisson.config.Config; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.tool.utils.SpringUtil; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.stereotype.Component; @Configuration public class RedissonConfig { + @Bean public Redisson redisson() { // 单机模式 Config config = new Config(); - config.useSingleServer().setAddress("redis://192.168.10.100:6379").setDatabase(0); - config.useSingleServer().setPassword("A0c415"); + + BladeRedis bean = SpringUtil.getBean(BladeRedis.class); + + RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory(); + + LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory; + + String hostName = factory.getHostName(); + int port = factory.getPort(); + String password = factory.getPassword(); + + config.useSingleServer().setAddress("redis://"+hostName+":"+port).setDatabase(1); + config.useSingleServer().setPassword(password); return (Redisson) Redisson.create(config); } diff --git a/blade-service/logpm-distribution/src/main/resources/application-prod.yml b/blade-service/logpm-distribution/src/main/resources/application-prod.yml index 3da290a43..1406c5b7a 100644 --- a/blade-service/logpm-distribution/src/main/resources/application-prod.yml +++ b/blade-service/logpm-distribution/src/main/resources/application-prod.yml @@ -55,29 +55,3 @@ spring: acknowledge-mode: manual template: mandatory: true - #rabbitmq配置 - rabbitmq: - host: 172.16.128.145 - port: 5672 - username: admin - password: Slwk@123654 - #虚拟host 可以不设置,使用server默认host - virtual-host: / - #确认消息已发送到队列(Queue) - publisher-returns: true - publisher-confirm-type: correlated - # 手动提交消息 - listener: - simple: - acknowledge-mode: auto - default-requeue-rejected: false - retry: - enabled: true # 开启消费者失败重试 - initial-interval: 1000 # 初识的失败等待时长为1秒 - multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval - max-attempts: 3 # 最大重试次数 - stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false - direct: - acknowledge-mode: manual - template: - mandatory: true 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 f5b5516b4..c010aee30 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 @@ -45,15 +45,20 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.FileLogsUtil; import org.springblade.core.oss.model.BladeFile; +import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.test.BladeBootTest; import org.springblade.core.test.BladeSpringExtension; import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.ResultCode; +import org.springblade.core.tool.utils.SpringUtil; import org.springblade.core.tool.utils.StringUtil; import org.springblade.resource.feign.IOssClient; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.http.MediaType; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; @@ -272,5 +277,28 @@ public class TestService { } + @Test + public void test6(){ + + BladeRedis bean = SpringUtil.getBean(BladeRedis.class); + + RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory(); + + LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory; + + String hostName = factory.getHostName(); + int port = factory.getPort(); + String password = factory.getPassword(); + + System.out.println(hostName); + System.out.println(port); + System.out.println(password); + + assert false; + + + + } + }