diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java index ecb45b6f5..554222324 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java @@ -70,6 +70,13 @@ public interface RabbitConstant { String STOCKUP_SCAN_EXCHANGE = "stockup_scan_exchange"; String STOCKUP_SCAN_ROUTING = "stockup_scan_routing"; + /** + * 备货判断是否下架 + */ + String STOCKUP_STATE_UPDATE_QUEUE = "stockup_state_update_queue"; + String STOCKUP_STATE_UPDATE_EXCHANGE = "stockup_state_update_exchange"; + String STOCKUP_STATE_UPDATE_ROUTING = "stockup_state_update_routing"; + /****************test队列******************/ String TEST_RECEIVE_INFO_QUEUE = "test_receive_info_queue"; diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java index d09956628..2527ae6ad 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java @@ -8,7 +8,7 @@ package org.springblade.common.constant.printTemplate; */ public enum PrintTemplateStatusConstant { - daiqueren_1("配送任务打印模板","1"), + daiqueren_1("配送任务打印模板-市配","1"), daiqueren_2("配载计划打印模板","2"), daiqueren_3("运单票据打印模板","3"), daiqueren_4("托运单模板","4"), @@ -18,7 +18,8 @@ public enum PrintTemplateStatusConstant { daiqueren_8("货位码模板","8"), daiqueren_9("货架码模板","9"), daiqueren_10("包件模板","10"), - daiqueren_11("库存品包件模板","11"); + daiqueren_11("库存品包件模板","11"), + daiqueren_12("配送任务打印模板-商配","12"); /** diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java b/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java index 702cf1183..aee484626 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java @@ -28,24 +28,52 @@ public class TemplateUtil { * 通过远程URL地址获取模板 * 此方法可以通过URL加载存储在远程服务器上的模板 * - * @param template - * @param map - * @param url + * @param name 模板名称 + * @param map 填充内容 + * @param url 模板地址 * @return * @throws Exception */ - public static String getTemplateByUrl(String template, Map map, String url) throws Exception { + public static String getTemplateByUrl(String name, Map map, String url) throws Exception { Configuration cfg = new Configuration(Configuration.VERSION_2_3_30); ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader(); InputStream initialStream = getInputStreamByGet(url); - byteArrayTemplateLoader.putTemplate(template, + byteArrayTemplateLoader.putTemplate(name, IOUtils.toByteArray(initialStream)); cfg.setTemplateLoader(byteArrayTemplateLoader); cfg.setDefaultEncoding("UTF-8"); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); cfg.setLogTemplateExceptions(false); cfg.setClassicCompatible(true); - Template temp = cfg.getTemplate(template); + Template temp = cfg.getTemplate(name); + StringWriter stringWriter = new StringWriter(); + temp.process(map, stringWriter); + stringWriter.flush(); + stringWriter.close(); + String result = stringWriter.getBuffer().toString(); + return result; + } + + + /** + * 根据模板填充模板内容 + * @param name 模板名称 + * @param map 填充内容 + * @param temlate + * @return + * @throws Exception + */ + public static String popTemplate(String name, Map map, String temlate) throws Exception { + Configuration cfg = new Configuration(Configuration.VERSION_2_3_30); + ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader(); + byteArrayTemplateLoader.putTemplate(name, + temlate.getBytes()); + cfg.setTemplateLoader(byteArrayTemplateLoader); + cfg.setDefaultEncoding("UTF-8"); + cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + cfg.setLogTemplateExceptions(false); + cfg.setClassicCompatible(true); + Template temp = cfg.getTemplate(name); StringWriter stringWriter = new StringWriter(); temp.process(map, stringWriter); stringWriter.flush(); diff --git a/blade-gateway/Dockerfile b/blade-gateway/Dockerfile index 5ef47affd..13bab8721 100644 --- a/blade-gateway/Dockerfile +++ b/blade-gateway/Dockerfile @@ -12,4 +12,4 @@ ADD ./target/blade-gateway.jar ./app.jar ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] -CMD ["--spring.profiles.active=test"] +CMD ["--spring.profiles.active=dev"] diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java index fd065d387..970375b3f 100644 --- a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java @@ -146,4 +146,7 @@ public class BasicMaterialEntity extends TenantEntity { @ApiModelProperty(value = "包装数量") private String packageNum; + @ApiModelProperty(value = "图片") + private String picture; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java index 7d6c0885d..f0c418717 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java @@ -46,5 +46,4 @@ public interface IBasicdataCarrierClient { */ @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); - } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java index 5696f313f..f48e64e17 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java @@ -48,4 +48,7 @@ public interface IBasicdataVehicleClient { @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @GetMapping(API_PREFIX + "/getVehicleById") + BasicdataVehicleEntity getVehicleById(@RequestParam("id") Long id); + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java index 5bf504815..1a5e61d73 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java @@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; import java.util.Date; +import java.util.List; /** * 备货信息表 实体类 @@ -198,6 +199,10 @@ public class DistributionStockupEntity extends TenantEntity { @ApiModelProperty(value = "仓库Id") private Long warehouseId; + @ApiModelProperty(value = "仓库Id") + @TableField(exist = false) + private List warehouseIdList; + diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java index 14c647c0a..4c2436071 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java @@ -109,6 +109,10 @@ public interface IDistributionStockListClient { @GetMapping(API_PREFIX+"/getEntityByMarketIdAndMaterialCodeAndIncomingBatch") DistributionStockListEntity getEntityByMarketIdAndMaterialCodeAndIncomingBatch(@RequestParam("marketId") Long marketId, @RequestParam("materialCode") String materialCode, @RequestParam("incomingBatch") String incomingBatch); + @GetMapping(API_PREFIX+"/getListByMarketIdAndMaterialName") + List getListByMarketIdAndMaterialName(@RequestParam("marketId") Long marketId, @RequestParam("materialName") String materialName, @RequestParam("warehouseId") Long warehouseId); + + // /** // * 修改某个客户信息及物品信息 // * 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 497bc719f..b8fe2ea6f 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 @@ -51,5 +51,7 @@ public class DistributionAddvalueVO extends DistributionAddvalueEntity { private Double distance; + private Long addvalueDetailId; + } 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 c542c3222..97353ad13 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 @@ -280,6 +280,49 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "预约签收状态") private String reservationSigningStatus; + + /** + * 预约备货状态 + */ + @ApiModelProperty(value = "预约备货状态") + private String assignStatus; + + /** + * 预约备货区 + */ + @ApiModelProperty(value = "预约签收状态") + private String stockupArea; + + + /** + * 备货时间 + */ + @ApiModelProperty(value = "预约签收状态") + private Date stockupDate; + + /** + * 出库时间 + */ + @ApiModelProperty(value = "预约签收状态") + private Date outboundDate; + + /** + * 备货人 + */ + @ApiModelProperty(value = "预约签收状态") + private String forkliftName; + + /** + * 备货状态 + */ + @ApiModelProperty(value = "备货状态") + private String stockupStatusName; + + /** + * 指派状态 + */ + @ApiModelProperty(value = "指派状态") + private String assignStatusName; // /** // * 配送方式 // */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java index e913898f2..f0ba31fe4 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java @@ -46,6 +46,11 @@ public class DistributionReservationStocklistVO extends DistributionReservationS */ @ApiModelProperty(value = "货物名称") private String descriptionGoods; + /** + * 物料编号 + */ + @ApiModelProperty(value = "物料编号") + private String cargoNumber; /** /** diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java index 42878c3f3..d2da34338 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; import java.util.List; /** @@ -83,6 +84,26 @@ public class DistributionReservationVO extends DistributionReservationEntity { private String signingStatusName; + /** + * 仓库地址 + */ + @ApiModelProperty(value = "签收状态") + private String warehouseAddress; + + + /** + * 仓库经度 + */ + @ApiModelProperty(value = "签收状态") + private BigDecimal jingdu; + + /** + * 仓库纬度 + */ + @ApiModelProperty(value = "签收状态") + private BigDecimal weidu; + + /** diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java new file mode 100644 index 000000000..01525af34 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java @@ -0,0 +1,10 @@ +package com.logpm.distribution.vo; + + +import lombok.Data; + +@Data +public class DistributionStockAllocationVO { + private String positionCode;//完整货位 + private Long allocationId;//货位id +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java index 77eb9328d..3c41f3cf5 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java @@ -17,7 +17,7 @@ public class DistributionStockupOrderListVO implements Serializable { @ApiModelProperty(value = "订单编号") private String orderCode;//订单编号 @ApiModelProperty(value = "订单ID") - private Long stockArticleId;//订单ID + private String stockArticleId;//订单ID @ApiModelProperty(value = "托盘") private String pallet;//托盘 @ApiModelProperty(value = "整托状态") @@ -34,6 +34,8 @@ public class DistributionStockupOrderListVO implements Serializable { private Long areaId; //货区id private Long trayId; //托盘id private Long shelfId; //货架id + private Long parcelListId; //包件id + private Long stockId; //备货id private Long allocationId; //货位id } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java index f7f0da386..f4f5372d2 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java @@ -20,6 +20,7 @@ public class DistributionStockupSelfVO { private String orderPackageCode; // 包件码 private Long lwugId; // 货位ID private Long ldsId; // 扫码ID + private Long allocationId; // 货位ID } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java index e9fbfa4c5..ab5ad4865 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java @@ -15,6 +15,8 @@ public class PackageStockupVO implements Serializable { private String packageBarCode;//包条码 private Long parceListId;//包条Id + private Long stockId;//备货扫描Id + private Long stockupId;//备货IDId private Integer goodsType;//货物类型 private String goodsTypeStr;//货物类型 diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java index d92f1726f..5b09bdacb 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java @@ -46,5 +46,10 @@ public interface IWarehouseGoodsAllocationClient { */ @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + /** + * 跟新货位缓存 + */ + @GetMapping(TOP+ "/updateAllocationCache") + Boolean updateAllocationCache(@RequestParam("ids") String ids); } diff --git a/blade-service/logpm-basic/Dockerfile b/blade-service/logpm-basic/Dockerfile index 413e22c85..173c125e2 100644 --- a/blade-service/logpm-basic/Dockerfile +++ b/blade-service/logpm-basic/Dockerfile @@ -11,4 +11,4 @@ EXPOSE 8300 ADD ./target/logpm-basic.jar ./app.jar ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] -CMD ["--spring.profiles.active=test"] +CMD ["--spring.profiles.active=dev"] diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java index 73805b6a1..84a3ba2b8 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java @@ -92,6 +92,7 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>{}",basicMaterial); if(ObjectUtils.isNotNull(basicMaterial.getId())){ //记录修该日志 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java index f553ce560..190654f06 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java @@ -108,7 +108,7 @@ public class BasicdataTrayController extends BladeController { @ApiOperation(value = "库存品列表", notes = "传入BasicdataTray") public R> inventoryList(BasicdataTrayDTO BasicdataTray, Query query) { IPage list = trayService.getinventoryList(Condition.getPage(query), BasicdataTray); - return R.data(list); + return R.data(WarehouseStockListWrapper.build().pageVO(list)); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java index b95753049..01c808e64 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java @@ -50,4 +50,9 @@ public class BasicdataVehicleClient implements IBasicdataVehicleClient { return BladePage.of(page); } + @Override + public BasicdataVehicleEntity getVehicleById(Long id) { + return basicdataVehicleService.getOneById(id); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml index 4843b1bd8..d4305e43b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml @@ -200,37 +200,23 @@ sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml index d77e49548..a051f1bf8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml @@ -32,10 +32,10 @@ - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId} - DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + 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 a3f9cdbfc..d1044914d 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 @@ -20,6 +20,7 @@ import com.logpm.distribution.dto.DistributionParcelListDTO; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.vo.DistributionParcelListBaseVO; @@ -57,7 +58,7 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoList(@Param("reservationId") Long reservationId, @Param("stockArticleId") Long stockArticleId, @Param("stockupId") Long stockupId,@Param("trayId") Long trayId); + List selectOrderInfoList(@Param("param") StockupDTO stockupDTO); List selectWarehouseAreaByReservationId(@Param("reservationId") Long reservationId); @@ -88,7 +89,9 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoSelfList(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId, @Param("stockArticleId")Long stockArticleId); + List selectOrderInfoSelfList(@Param("param") StockupDTO stockupDTO); + + List selectOrderInfoAllocationList(@Param("param") StockupDTO stockupDTO); List findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId); 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 a7d0b1ea4..c0fd555d5 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 @@ -136,17 +136,41 @@ from logpm_distribution_parcel_list where stock_article_id = #{id} + @@ -199,15 +223,23 @@ and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation} and ldpl.pallet = #{pallet} and ldr.is_deleted = 0 --> - select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName, - lwug.allocation_title allocationTitle,lwtg.tray_code trayCode,lwug.position_code positionCode,lwug.allocation_id allocationId + select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName, + lwug.allocation_title allocationTitle,lwtg.tray_code trayCode,lwug.position_code positionCode,lwug.allocation_id allocationId,lds.id stockId,lds.stockup_id stockupId from logpm_distribution_reservation_package ldrp LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3' LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id =ldrp.parce_list_id and lwug.association_type = '3' + LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.reservation_id = ldrp.reservation_id - ldrp.reservation_id = #{reservationId} and ldrp.stock_article_id = #{stockArticleId} and ldrp.packet_bar_status in (1,3) - and lwtg.tray_id = #{trayId} + ldrp.reservation_id = #{param.reservationId} and ldrp.packet_bar_status in (1,3) + and lwtg.tray_id = #{param.trayId} + and ldrp.stock_article_id = #{param.stockArticleId} + + and ldrp.stock_article_id in + + #{a} + + @@ -248,7 +280,7 @@ from logpm_distribution_stockup_info ldsi LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id - LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id + LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id ldsi.stockup_id =#{id} @@ -441,7 +473,7 @@ LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 WHERE - ldpl.stock_article_id = #{stockArticleId} and ldpl.order_package_reservation_status in ('10','20') + 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/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index aca07f51d..460a435e6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -29,6 +29,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 预约列表 Mapper 接口 @@ -197,10 +198,27 @@ public interface DistributionReservationMapper extends BaseMapper selectStockupList(@Param("reservationIds")List ids); + /** * 根基配送ID 查询预约单信息 * @param id * @return */ - List findByDeliveryId(@Param("id")Long id); + List findByDeliveryId(@Param("id")Long id); + + List> findAllCategoryNum(@Param("id") Long reservationId); + + List getAllocationByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId); + + List getStockupAreaByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId); + + List getMaterialNameByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId); + + List> getCategoryByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 298775e06..f779ca5cd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -196,36 +196,13 @@ ldsa.order_code, ldrs.stock_article_id, ldpl.pallet --> - select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId, - lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId , - CASE WHEN lwug.id is null THEN - ( - (select COUNT(id) - from logpm_distribution_parcel_list - where stock_article_id = ldpl.stock_article_id) - ( - select COUNT(lwug.id) - from logpm_distribution_parcel_list dpl - LEFT JOIN logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id - where dpl.stock_article_id = ldpl.stock_article_id - ) - )ELSE ( - select COUNT(wug.id) - from logpm_distribution_reservation_stockarticle ldrs - LEFT JOIN logpm_distribution_parcel_list ldpl on ldrs.stock_article_id = ldpl.stock_article_id - LEFT JOIN logpm_warehouse_updown_goods wug on wug.association_id = ldpl.id - where ldrs.reservation_id = ldrp.reservation_id and ldrs.stock_article_id = ldpl.stock_article_id and wug.allocation_id = lwug.allocation_id - ) - END planNum, - ( - select COUNT(lds.id) - from logpm_distribution_reservation_package drp - LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = drp.parce_list_id - where drp.reservation_id = ldrp.reservation_id and drp.packet_bar_status in (1,3) and drp.stock_article_id = ldpl.stock_article_id - ) scanNum + select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId,ldpl.id parcelListId,lds.id stockId, + lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId from logpm_distribution_reservation_package ldrp LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwug.association_id + LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.reservation_id = ldrp.reservation_id ldrp.reservation_id = #{reservationId} and ldrp.packet_bar_status in (1,3) @@ -345,6 +322,7 @@ ldr.is_urgent, ldr.reservation_stock_list_num, ldr.waybill_no, + ldr.receiving_unit, ldr.waybill_id FROM logpm_distribution_delivery_list AS lddl @@ -753,6 +731,7 @@ ldpl.stock_article_id AS stockArticleId, ldpl.order_package_code AS orderPackageCode, ldpl.material_name AS materialName, + ldpl.order_code AS orderCode, ldpl.quantity AS quantity, 1 AS conditions, ldpl.create_user AS createUser, @@ -876,6 +855,52 @@ WHERE ldsi.reservation_id = #{reservationId} + + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 3ae58665e..3751c6496 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -659,11 +659,17 @@ lddl.id = ldl.delivery_id and ldl.signfor_state =2) ) signNubSr, ( select GROUP_CONCAT(ldr.consignee) from logpm_distribution_reservation ldr where ldr.id in (select lds.reservation_id from logpm_distribution_signfor lds where lds.delivery_id = lddl.id ) - ) consignee + ) consignee, + ( + select sum(reservation_num ) + from logpm_distribution_reservation_stocklist + where reservation_id = ldsf.reservation_id + ) inventoryNub FROM logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id - left join logpm_distribution_reservation ldr on ldr.id = lddl.reservation_id + left join logpm_distribution_signfor ldsf on ldsf.delivery_id = lddl.id + lddl.is_deleted =0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java index 9f3da15a0..1adf5ae3e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java @@ -84,4 +84,5 @@ public interface DistributionStockListMapper extends BaseMapper getListByMarketIdAndMaterialName(@Param("marketId") Long marketId, @Param("materialName") String materialName, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml index f05b18037..d0f08714c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml @@ -320,7 +320,7 @@ select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.cargo_number = #{materialCode} + and ldsl.cargo_number like concat('%',#{materialCode},'%') and ldsl.market_id = #{marketId} and ldsl.warehouse_id = #{warehouseId} @@ -329,9 +329,18 @@ select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.description_goods = #{materialName} + and ldsl.description_goods like concat('%',#{materialName},'%') and ldsl.market_id = #{marketId} and ldsl.warehouse_id = #{warehouseId} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java index b954df92d..94c9e1f47 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.entity.DistributionStockEntity; import com.logpm.distribution.excel.DistributionStockExcel; +import com.logpm.distribution.vo.DistributionStockAllocationVO; import com.logpm.distribution.vo.DistributionStockVO; import org.apache.ibatis.annotations.Param; @@ -76,4 +77,6 @@ public interface DistributionStockMapper extends BaseMapper + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index 678497fac..d1fb051fb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -183,5 +183,5 @@ public interface DistributionStockupMapper extends BaseMapper stockupOffShelf(StockupDTO stockupDTO); + List stockupOffShelf(@Param("param")StockupDTO stockupDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index 31ecaa7b0..0c9ac3a85 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -44,12 +44,21 @@ LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id ldsi.reservation_id = #{param.reservationId} and ldsi.stockup_id = #{param.stockupId} - and ldpl.order_package_code = #{param.packetBarCode} and ldpl.order_code =#{param.orderCode} + and ldpl.order_package_code = #{param.packetBarCode} + + and ldpl.order_code = #{param.orderCode} + + + and ldpl.order_code in + + #{a} + + @@ -153,6 +170,13 @@ and lds.forklift_name like concat('%', #{param.forkliftName},'%') and lds.loader_name like concat('%', #{param.loaderName},'%') and lds.type_service = #{param.typeService} + and lds.warehouse_id = #{param.warehouseId} + + and lds.warehouse_id in + + #{a} + + GROUP BY lds.id @@ -223,14 +247,14 @@ from logpm_distribution_stockup ds LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id and ldrp.packet_bar_status in (1,3) - LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id + LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id and ldsk.stockup_id =ds.id where ds.id = lds.id )+( select COUNT(DISTINCT ldsk.id) from logpm_distribution_stockup ds LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id LEFT JOIN logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldsi.reservation_id and ldrs.stock_list_status in (1,3) - LEFT JOIN logpm_distribution_stock ldsk on ldsk.stock_list_id = ldrs.stocklist_id + LEFT JOIN logpm_distribution_stock ldsk on ldsk.stock_list_id = ldrs.stocklist_id and ldsk.stockup_id =ds.id where ds.id = lds.id and ldsk.stockup_id = lds.id ) realNum from logpm_distribution_stockup lds diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java index a13ca7c26..556856e99 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java @@ -19,6 +19,7 @@ package com.logpm.distribution.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistrilbutionBillStockEntity; import com.logpm.distribution.excel.DistrilbutionBillStockExcel; import com.logpm.distribution.vo.*; @@ -58,7 +59,9 @@ public interface DistrilbutionBillStockMapper extends BaseMapper selectDistrilbutionBillSelf(@Param("reservationId")Long reservationId); - DistributionStockupSelfVO selectDistrilbutionBillPackSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId,@Param("allocationId") Long allocationId); + DistributionStockupSelfVO selectDistrilbutionBillPackSelf(@Param("param") StockupDTO stockupDTO); DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId); + + DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(@Param("param")StockupDTO stockupDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml index 2154ba222..713baf5e4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -17,7 +17,7 @@ FROM logpm_distribution_parcel_list lpl LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = lpl.id where - lpl.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{allocationId} + lpl.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{param.allocationId} ) planNum ,( SELECT COUNT(lt.id) FROM logpm_distribution_stock lt @@ -38,17 +38,43 @@ SELECT GROUP_CONCAT( DISTINCT lwug.allocation_title SEPARATOR ',') FROM logpm_distribution_parcel_list lp LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = lp.id and lwug.association_type = 3 - where lp.stock_article_id = ldbs.stock_article_id + where lp.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{param.allocationId} ) warehouseArea from logpm_distribution_stockup_info ldsi LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id + + ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId} + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java new file mode 100644 index 000000000..d23471843 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java @@ -0,0 +1,48 @@ +package com.logpm.distribution.receiver; + +import com.logpm.distribution.dto.app.StockupDTO; +import com.logpm.distribution.entity.DistributionStockEntity; +import com.logpm.distribution.service.IDistributionAsyncService; +import com.logpm.distribution.service.IDistributionStockService; +import com.rabbitmq.client.Channel; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.RabbitConstant; +import org.springframework.amqp.core.Message; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.Map; + + +/** + * 获取订单数据 处理器 + * + * @author yangkai.shen + */ +@Slf4j +@RabbitListener(queues = RabbitConstant.STOCKUP_STATE_UPDATE_QUEUE) +@Component +public class StockupStateUpdateHandler { + + @Autowired + private IDistributionAsyncService distributionAsyncService; + + + @RabbitHandler + public void stockupScanHandler(Map map, Message message, Channel channel) throws IOException, InterruptedException { + log.info("##################StockupStateUpdateHandler: 处理补全扫码作业其他数据"); + final long deliveryTag = message.getMessageProperties().getDeliveryTag(); + StockupDTO messageData = new StockupDTO(); + messageData.setStockupId((Long) map.get("stockupId")); + messageData.setTypeService(String.valueOf( map.get("typeService"))); + messageData.setReservationId((Long) map.get("reservationId")); + //查询是否货位数据是否该下架 + distributionAsyncService.stockupSelfOffShelf(messageData); + log.info("######STOCKUP_STATE_UPDATE_QUEUE:备货下架查询成功"); + + + } +} 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 5d683643b..52dafe1d4 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 @@ -163,8 +163,8 @@ public interface IDistributionAsyncService { void checkDeliverySignStatusByReservation(Long deliveryId); /** - * 判断自提包件是否该下架 + * 判断包件是否该下架 * @param stockupDTO */ - void stockupSelfOffShelf(StockupDTO stockupDTO); + void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException; } 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 0f0910523..23c790824 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 @@ -225,5 +225,7 @@ public interface IDistributionDeliveryListService extends BaseService printBatch(String ids,Integer type) throws Exception; + + void testData(String s) throws Exception; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index e33128cfa..40be0036a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -18,6 +18,7 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.vo.DistributionParcelListBaseVO; @@ -55,7 +56,7 @@ public interface IDistributionParcelListService extends BaseService selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId,Long trayId); + List selectOrderInfoList(StockupDTO stockupDTO); List selectWarehouseAreaByReservationId(Long reservationId); @@ -91,15 +92,19 @@ public interface IDistributionParcelListService extends BaseService selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId); + List selectOrderInfoSelfList(StockupDTO stockupDTO); List findALLNoUpShelfPackageByOrderCode(String orderCode,Long warehouseId); IPage pageOweList(IPage page,Map distributionParcelList); + + /** + * 查询已备货的数据 + * @param stockupDTO + * @return + */ + List selectOrderInfoAllocationList(StockupDTO stockupDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index fbb5841f6..1ab59540a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -84,6 +84,26 @@ public interface IDistributionReservationService extends BaseService getReservationAddr(String ids); + List getReservationAddr(String ids); /** * 批量转配送任务 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index de1503028..d4226fef0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -130,6 +130,9 @@ public interface IDistributionStockListService extends BaseService getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId); + + // /** // * 查询库存品详情 // * @param params diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java index 23135d6f0..be95a0ca4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.dto.DistributionStockDTO; import com.logpm.distribution.entity.DistributionStockEntity; import com.logpm.distribution.excel.DistributionStockExcel; +import com.logpm.distribution.vo.DistributionStockAllocationVO; import com.logpm.distribution.vo.DistributionStockVO; import org.springblade.core.mp.base.BaseService; @@ -74,4 +75,13 @@ public interface IDistributionStockService extends BaseService packageListIds = distributionAppAddvalueDTO.getPackageListIds(); + Integer isManual = distributionAppAddvalueDTO.getIsManual(); + List collect1 = parcelListEntityList.stream().filter(p -> packageListIds.contains(p.getId())).collect(Collectors.toList()); + if (collect1.size() == 1 ){ + return Resp.scanFail("重复扫描", "重复扫描"); + } + List collect2 = detailEntities.stream().filter(i -> packageListIds.contains(i.getId())).collect(Collectors.toList()); + if (collect2.size() == 1 ){ + return Resp.scanFail("重复扫描", "重复扫描"); + } List packageInfo = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distributionAppAddvalueDTO.getBarcode())).collect(Collectors.toList()); // DistributionAddvaluePackageEntity distributionAddvaluePackageEntiy = new DistributionAddvaluePackageEntity(); if (Func.isNotEmpty(packageInfo) && packageInfo.size() == 1) { @@ -115,7 +128,10 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl getAllPackageList(DistributionAppAddvalueDTO distributionAppAddvalueDTO) { - List packageEntityList = distributionAppAddvalueDTO.getPackageEntityList(); +// List packageEntityList = distributionAppAddvalueDTO.getPackageEntityList(); + List packageListIds = distributionAppAddvalueDTO.getPackageListIds(); Long reservationId = distributionAppAddvalueDTO.getReservationId(); List parcelListEntities = distributionReservationMapper.selectAppPackageListByReservationId(reservationId); List detailEntities = distributionReservationMapper.selectAppInventoryListByReservation(reservationId); @@ -247,72 +267,81 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl entityList = null; - if (Func.isNotEmpty(packageEntityList)) { - entityList = parcelListEntities.stream().filter(p1 -> packageEntityList.stream().noneMatch(p2 -> p2.equals(p1.getId()))).collect(Collectors.toList()); - if (Func.isEmpty(entityList)) { - log.error("################该客户下库存品包件信息:{}", detailEntities); - log.error("################该客户下包件信息:{}", parcelListEntities); - } - } else { - entityList = parcelListEntities; + if (Func.isNotEmpty(parcelListEntities)){ + parcelListEntities.stream().forEach(p->{p.setRecordType("1");}); } +// List entityList = null; +// if (Func.isNotEmpty(packageEntityList)) { +// entityList = parcelListEntities.stream().filter(p1 -> packageEntityList.stream().noneMatch(p2 -> p2.equals(p1.getId()))).collect(Collectors.toList()); +// if (Func.isEmpty(entityList)) { +// log.error("################该客户下库存品包件信息:{}", detailEntities); +// log.error("################该客户下包件信息:{}", parcelListEntities); +// } +// } else { +// entityList = parcelListEntities; +// } + - return entityList; + return parcelListEntities; } @Override + @Transactional public R updateAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) { List packageEntityList = distributionAppAddvalueDTO.getPackageEntityList(); + //这里需要查询出原来的增值服务项详情 DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity(); +// DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType()); + DistributionAddvalueDetailEntity detailEntity = distributionAddvalueDetailMapper.selectById(distributionAppAddvalueDTO.getAddvalueDetailId()); + +// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) { +// return Resp.scanFail("添加失败", "错误的包件数量"); +// }else { +// distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum()); +// } // 上楼 超区 平移 搬运 分拣 专车 switch (distributionAppAddvalueDTO.getAddvalueType()) { case "1": if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) { return Resp.scanFail("添加失败", "请输入楼层数"); } else { - distributionAddvalueDetailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum()); + detailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum()); } break; case "2": if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) { return Resp.scanFail("添加失败", "请输入超区公里数"); } else { - distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance()); + detailEntity.setDistance(distributionAppAddvalueDTO.getDistance()); } break; case "3": if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) { return Resp.scanFail("添加失败", "请输入平移距离"); } else { - distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance()); + detailEntity.setDistance(distributionAppAddvalueDTO.getDistance()); } break; case "4": + case "5": if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) { return Resp.scanFail("添加失败", "请输入件数"); } else { - distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum()); + detailEntity.setNum(distributionAppAddvalueDTO.getNum()); } break; -// case "5": -// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) { -// return Resp.scanFail("添加失败", "请输入件数"); -// } else { -// distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum()); -// } -// break; case "6": if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) { - return Resp.scanFail("添加失败", "请输入件数"); + return Resp.scanFail("添加失败", "错误的包件数量"); } else { - distributionAddvalueDetailEntity.setFee(distributionAppAddvalueDTO.getFee()); + detailEntity.setFee(distributionAppAddvalueDTO.getFee()); } break; default: return Resp.scanFail("添加失败", "服务器正忙"); } + distributionAddvalueDetailMapper.updateById(detailEntity); if (Func.isEmpty(packageEntityList) && packageEntityList.size() == 0) { //没有包件信息,对该增值服务进行清除 DistributionAddvalueEntity distributionAddvalueEntity = distributionAddvalueMapper.selectOne(Wrappers.query().lambda() @@ -329,7 +358,9 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(Func.toLongList(packageListIds)); + List distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.query().lambda() + .in(DistributionAddvaluePackageEntity::getPackageId,Func.toLongList(packageListIds)) + .eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,distributionAppAddvalueDTO.getAddvalueDetailId())); Map> oldPackageList = distributionAddvaluePackageEntities.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId)); Map> newPackageList = packageEntityList.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId)); newPackageList.forEach((k, v) -> { @@ -343,7 +374,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl { //进行删除 @@ -362,13 +393,14 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl longs = Func.toLongList(packageListIds); - List distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(longs); - addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities); + if (Func.isNotEmpty(addvalueVO)){ + String packageListIds = addvalueVO.getPackageListIds(); + if (Func.isNotEmpty(packageListIds)){ + List longs = Func.toLongList(packageListIds); + List distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.query().lambda().in(DistributionAddvaluePackageEntity::getPackageId,longs).eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,addvalueVO.getAddvalueDetailId())); + addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities); + } } - return R.data(addvalueVO); } 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 f18ca47e9..fc89c988d 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 @@ -26,6 +26,7 @@ import org.springblade.common.constant.order.OrderStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; +import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.reservation.*; import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.core.tool.utils.Func; @@ -39,6 +40,7 @@ import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; @Log4j2 @@ -519,8 +521,16 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (inventorySigningFlag && reservationSigningFlag) { r.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); } else { - r.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); + inventorySigningFlag = distributionReservationStocklistEntities.stream().allMatch(i -> !i.getSigningStatus().equals(ReservationInventorySigningStatusConstant.yiqianshou.getValue())); + reservationSigningFlag = parcelListEntities.stream().allMatch(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); + if (inventorySigningFlag && reservationSigningFlag){ + r.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); + + }else { + r.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); + } } + distributionReservationMapper.updateById(r); }); @@ -584,41 +594,70 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } /** - * 判断自提包件是否该下架 + * 判断包件是否该下架 * @param stockupDTO */ @Async @Override - public void stockupSelfOffShelf(StockupDTO stockupDTO) { + public void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException { //判断类型 List distributionStockupSelfVO = new ArrayList<>(); - if(stockupDTO.getTypeService().equals(DistributionTypeConstant.ziti.getValue())){ + if (stockupDTO.getTypeService().equals(DistributionTypeConstant.ziti.getValue())) { //自 - distributionStockupSelfVO = distributionStockupService.stockupSelfOffShelf(stockupDTO); - }else{ + Thread.sleep(300); + distributionStockupSelfVO = distributionStockupService.stockupSelfOffShelf(stockupDTO); + } else { //商 市 - distributionStockupSelfVO = distributionStockupService.stockupOffShelf(stockupDTO); + Thread.sleep(300); + distributionStockupSelfVO = distributionStockupService.stockupOffShelf(stockupDTO); } + //有 + List collectY = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); + collectY.stream().collect(Collectors.groupingBy(DistributionStockupSelfVO::getAllocationId)) + .forEach( (k,v) -> { + List list = new ArrayList<>(); + AtomicInteger a = new AtomicInteger(); + AtomicInteger b = new AtomicInteger(); + v.forEach(i -> { + if (ObjectUtils.isNotNull(i.getLwugId())) { + a.addAndGet(1); + if (ObjectUtils.isNotNull(i.getLdsId())) { + b.addAndGet(1); + list.add(i.getOrderPackageCode()); + } + } + }); + if (a.get() == b.get()) { + //下架 + list.forEach(i -> { + warehouseUpdownTypeClient.downPackage(i); + }); + } + + } ); + + //没有 + /*List collectW = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); + List list = new ArrayList<>(); AtomicInteger a = new AtomicInteger(); AtomicInteger b = new AtomicInteger(); - distributionStockupSelfVO.forEach( i -> { - if(ObjectUtils.isNotNull(i.getLwugId())){ + collectW.forEach(i -> { + if (ObjectUtils.isNull(i.getLwugId())) { a.addAndGet(1); - if(ObjectUtils.isNotNull(i.getLdsId())){ + if (ObjectUtils.isNotNull(i.getLdsId())) { b.addAndGet(1); list.add(i.getOrderPackageCode()); } } }); - if(a.get() == b.get()){ + if (a.get() == b.get()) { //下架 - list.forEach( i ->{ + list.forEach(i -> { warehouseUpdownTypeClient.downPackage(i); }); - } - + }*/ } @@ -908,7 +947,15 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override @Transactional(rollbackFor = Exception.class) public void stockupUpdateState(StockupDTO stockupDTO) { - + //修改包件备货状态 + List distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())); + // + if(!distributionParcelListEntities.isEmpty()){ + DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity(); + distributionParcelListEntity.setId(distributionParcelListEntities.get(0).getId()); + distributionParcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); + distributionParcelListMapper.updateById(distributionParcelListEntity); + } //备货中 //判断有几个预约 @@ -936,6 +983,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { int sum = distributionReservationStockarticleEntities.stream().mapToInt(DistributionReservationStockarticleEntity::getReservationNum).sum(); nu.set(nu.get() + sum); } + //修改预约备货状态 + if(nuy.get() == nu.get()){ + DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); + reservationEntity.setId(i.getReservationId()); + reservationEntity.setStockupStatus(ReservationStockupStatusConstant.yibeihuo.getValue()); + distributionReservationMapper.updateById(reservationEntity); + } //查询数量库存品 List distributionReservationStocklistEntities = distributionReservationStocklistMapper.selectList(Wrappers.query().lambda() 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 4875ad318..130271489 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 @@ -129,6 +129,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryorder(IPage page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) { List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionDeliveryInfoDTO); + for (DistributionStockArticleVO distributionDeliveryInfoVO : 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 c6f64ceb8..4eb6c5ba2 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 @@ -28,7 +28,9 @@ import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataCarrierClient; import com.logpm.basicdata.feign.IBasicdataDriverArteryClient; +import com.logpm.basicdata.feign.IBasicdataVehicleClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.bean.Resp; import com.logpm.distribution.dto.*; @@ -45,6 +47,7 @@ import com.logpm.distribution.wrapper.DistributionDeliveryListWrapper; import com.logpm.distribution.wrapper.DistributionParcelListWrapper; import com.logpm.distribution.wrapper.DistributionReservationWrapper; import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; +import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang.StringUtils; @@ -59,12 +62,15 @@ import org.springblade.common.constant.order.OrderStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; +import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; import org.springblade.common.constant.reservation.*; import org.springblade.common.constant.stockup.StockAssignStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.common.utils.CommonUtil; +import org.springblade.common.utils.QRCodeUtil; import org.springblade.common.utils.TemplateUtil; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; @@ -83,6 +89,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -134,7 +141,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { @@ -152,15 +162,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionDeliveryListEntities = baseMapper.selectDistributionDeliveryListPage(page, distributionDeliveryList); - - return page.setRecords(distributionDeliveryListEntities); } @Override public List exportDistributionDeliveryList(Wrapper queryWrapper) { - List distributionDeliveryListList = baseMapper.exportDistributionDeliveryList(queryWrapper); //distributionDeliveryListList.forEach(distributionDeliveryList -> { // distributionDeliveryList.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionDeliveryList.getType())); @@ -219,7 +226,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionStockupVOList = distributionStockupMapper.getMarketDeliveryStockupInfo(detail.getId()); //这里需要处理一下 if (distributionStockupVOList.size() > 1) { - Date outboundDate = distributionStockupVOList.stream().filter(o -> o.getOutboundDate() != null).max(Comparator.comparing(DistributionStockupVO::getOutboundDate)).get().getOutboundDate(); +// Date outboundDate = distributionStockupVOList.stream().filter(o -> o.getOutboundDate() != null).max(Comparator.comparing(DistributionStockupVO::getOutboundDate)).get().getOutboundDate(); HashSet forkliftName = new HashSet<>(); HashSet loaderName = new HashSet<>(); HashSet stockUser = new HashSet<>(); @@ -242,7 +249,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper().lambda() @@ -906,7 +914,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl list = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList()); List distributionParcelListEntityList = distributionParcelListService.list(new QueryWrapper().lambda().in(DistributionParcelListEntity::getId, list)); - List parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); List stockListDetailEntityList = disStockListDetailService.list(Wrappers.query().lambda() @@ -919,7 +926,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId())); @@ -1790,19 +1799,37 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl customList = distributionDeliveryInfoMapper.selectAppcustomListPage(page, distributionDeliveryList.getId()); for (DistributionAppReservationVO distributionAppReservationVO : customList) { - //查询备货是否完成 - int aLong = distributionStockMapper.selectCount(new QueryWrapper().lambda() - .eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId()) - .eq(DistributionStockEntity::getType, 1) - ).intValue(); - distributionAppReservationVO.setIsstock("是"); - distributionAppReservationVO.setIsload("是"); - if (aLong < distributionAppReservationVO.getReservationNum()) { + List parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppReservationVO.getId()); + List stockListDetailEntityList = distributionReservationMapper.selectInventoryListByReservation(distributionAppReservationVO.getId()); + boolean stockArticleStockupStatus = parcelListEntities.stream().allMatch(s -> Func.isNotEmpty(s.getOrderPackageStockupStatus()) && s.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue())); + boolean inventoryStockupStatus = stockListDetailEntityList.stream().allMatch(i -> Func.isNotEmpty(i.getStockPackageCode())); + if (stockArticleStockupStatus && inventoryStockupStatus ){ + distributionAppReservationVO.setIsstock("是"); + }else { distributionAppReservationVO.setIsstock("否"); } - if (distributionAppReservationVO.getLoadingNub() < distributionAppReservationVO.getReservationNum()) { + boolean stockArticleLoadingStatus = parcelListEntities.stream().allMatch(s -> Func.isNotEmpty(s.getOrderPackageLoadingStatus()) && s.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); + boolean inventoryLoadingStatus = stockListDetailEntityList.stream().allMatch(i -> Func.isNotEmpty(i.getStockPackageCode()) && i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); + if (stockArticleLoadingStatus && inventoryLoadingStatus){ + distributionAppReservationVO.setIsload("是"); + }else { distributionAppReservationVO.setIsload("否"); + } + +// //查询备货是否完成 +// int aLong = distributionStockMapper.selectCount(new QueryWrapper().lambda() +// .eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId()) +// .eq(DistributionStockEntity::getType, 1) +// ).intValue(); +// distributionAppReservationVO.setIsstock("是"); +// distributionAppReservationVO.setIsload("是"); +// if (aLong < distributionAppReservationVO.getReservationNum()) { +// distributionAppReservationVO.setIsstock("否"); +// } +// if (distributionAppReservationVO.getLoadingNub() < distributionAppReservationVO.getReservationNum()) { +// distributionAppReservationVO.setIsload("否"); +// } } return page.setRecords(customList); } @@ -1876,10 +1903,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl stockArticle = deliveryListDTO.getStockArticle(); DistributionReservationDTO reservation = deliveryListDTO.getReservation(); //根据运单号进行分组 - Map> newClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber)); + Map> newClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getConsigneeUnit)); //查询出该配送任务下的客户,并将这些客户根据运单号进行分组 List reservationEntityList = distributionReservationMapper.getDeliveryReservation(deliveryListEntity.getId()); - Map> oldClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getWaybillNo)); + Map> oldClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getReceivingUnit)); //订单总数量 AtomicInteger orderTotal = new AtomicInteger(); //配送任务仓库名称 @@ -2039,7 +2066,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.query().lambda() .eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()) @@ -2181,6 +2209,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntity.getId(), f); + DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntity.getId(), f); reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue()); distributionReservationMapper.updateById(reservationEntity); //这里还需要将减少的预约单下的所有订单、包件进行取消状态 @@ -2286,8 +2315,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl qw = new QueryWrapper<>(); - qw.lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, id); - List distributionDeliverySelfEntities = distributionDeliverySelfService.getBaseMapper().selectList(qw); - List deliverySelfVOS = new ArrayList<>(); - distributionDeliverySelfEntities.forEach(s -> { - DistributionDeliverySelfVO deliverySelfVO = Func.copy(s, DistributionDeliverySelfVO.class); - deliverySelfVOS.add(deliverySelfVO); - }); - deliveryListVO.setDeliverySelfVO(deliverySelfVOS); - break; - case "2": - QueryWrapper tqw = new QueryWrapper<>(); - tqw.lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, id); - DistributionDeliveryTripartiteEntity tripartiteEntity = distributionDeliveryTripartiteService.getBaseMapper().selectOne(tqw); - DistributionDeliveryTripartiteVO deliveryTripartiteVO = Func.copy(tripartiteEntity, DistributionDeliveryTripartiteVO.class); - deliveryListVO.setDeliveryTripartiteVO(deliveryTripartiteVO); - break; + if (Func.isNotEmpty(deliveryListVO)) { + switch (deliveryListEntity.getKind()) { + case "1": + //查询自主配送 + QueryWrapper qw = new QueryWrapper<>(); + qw.lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, id); + List distributionDeliverySelfEntities = distributionDeliverySelfService.getBaseMapper().selectList(qw); + List deliverySelfVOS = new ArrayList<>(); + distributionDeliverySelfEntities.forEach(s -> { + DistributionDeliverySelfVO deliverySelfVO = Func.copy(s, DistributionDeliverySelfVO.class); + deliverySelfVOS.add(deliverySelfVO); + }); + deliveryListVO.setDeliverySelfVO(deliverySelfVOS); + break; + case "2": + QueryWrapper tqw = new QueryWrapper<>(); + tqw.lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, id); + DistributionDeliveryTripartiteEntity tripartiteEntity = distributionDeliveryTripartiteService.getBaseMapper().selectOne(tqw); + DistributionDeliveryTripartiteVO deliveryTripartiteVO = Func.copy(tripartiteEntity, DistributionDeliveryTripartiteVO.class); + deliveryListVO.setDeliveryTripartiteVO(deliveryTripartiteVO); + break; + } } //查询备货信息进行数据回显 //2、查询出备货信息 - DistributionStockupVO stockupEntity = distributionStockupMapper.getDeliveryStockupInfo(id); - deliveryListVO.setStockupInfo(stockupEntity); +// DistributionStockupVO stockupEntity = distributionStockupMapper.getDeliveryStockupInfo(id); +// deliveryListVO.setStockupInfo(stockupEntity); List reservationVOS = distributionReservationMapper.getMarketReservationInfo(id); deliveryListVO.setReservationInfos(DistributionReservationWrapper.build().listVO(reservationVOS)); return deliveryListVO; @@ -2794,56 +2825,67 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl printBatch(String ids, Integer type) throws Exception { PrintPreviewVO printPreviewVO = new PrintPreviewVO(); - List data = new ArrayList<>(); - BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue()); - if (ObjectUtil.isEmpty(template)) { - throw new ServiceException("模板内容未找到"); - } - String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); - printPreviewVO.setTemplateHtml(html); - printPreviewVO.setTemplateId(template.getId()); + BasicPrintTemplateEntity template = getPrintTemplate(type); + String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); +// printPreviewVO.setTemplateHtml(html); +// printPreviewVO.setTemplateId(template.getId()); String[] idArray = ids.split(","); if (ObjectUtils.isNull(idArray)) { throw new ServiceException("参数错误"); + } + if (2 == type) { + return handleShiPeiData(template, idArray,html); + + + } else if (1 == type) { + return handleShangPeiData(template.getId(), idArray,html); + } else { + log.warn("###########printBatch: 未知的打印类型"); + throw new CustomerException(403, "未知的打印类型"); } + } + @Override + public void testData(String s) throws Exception { + String[] split = s.split(","); + handleShangPeiData(1111L, split,"111"); + } + + private List handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception { + List result = new ArrayList<>(); for (String id : idArray) { - // 获取需要的数据 + //查询对应配送单 + DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单 + if(Objects.isNull(deliveryListEntity)){ + log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}",id); + throw new CustomerException(403,"配送单信息不存在"); + } + Long deliveryListEntityId = deliveryListEntity.getId(); + String taskTime = deliveryListEntity.getTaskTime();//配送时间 + String kind = deliveryListEntity.getKind(); + String dirverName = ""; + String dirverPhone = ""; + String carNumber = ""; + + if("1".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliverySelfService.getOne(queryWrapper); + dirverName = deliverySelfEntity.getDriverName(); + dirverPhone = deliverySelfEntity.getDriverPhone(); + carNumber = deliverySelfEntity.getVehicleNub(); + }else if("2".equals(kind)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("delivery_id",deliveryListEntityId); + DistributionDeliveryTripartiteEntity deliveryTripartiteEntity = distributionDeliveryTripartiteService.getOne(queryWrapper); + dirverName = deliveryTripartiteEntity.getDriverName(); + dirverPhone = deliveryTripartiteEntity.getDriverPhone(); + carNumber = deliveryTripartiteEntity.getVehicleNum(); + } + + List distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId); + //循环查询出来的预约单 + for (DistributionReservationEntity reservationEntity:distributionReservationEntityList){ + Map map = new HashMap<>(); + map.put("配送单号", reservationEntity.getReservationCode()); + String fileTypeName = QRCodeUtil.createCodeToFile(reservationEntity.getReservationCode()); + map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + map.put("收货单单位",reservationEntity.getReceivingUnit());//收货单单位 + map.put("商场名称",reservationEntity.getStoreName());//商场名称 + map.put("收货人",reservationEntity.getConsignee());//收货人 + map.put("收货人电话",reservationEntity.getDeliveryPhone());//收货人电话 + map.put("收货人地址",reservationEntity.getDeliveryAddress());//收货人地址 + map.put("配送时间",taskTime);//配送时间 + map.put("承运商",deliveryListEntity.getDistributionCompany()); + map.put("配送仓库",deliveryListEntity.getWarehouseName()); + map.put("出库时间",deliveryListEntity.getWarehouseName()); + map.put("送货司机",dirverName+"/"+dirverPhone); + map.put("车牌号",carNumber); + + Long reservationId = reservationEntity.getId();//预约id + //通过预约id查询所有包件并按三级品类分组 + List> categoryList = distributionReservationMapper.findAllCategoryNum(reservationId); + //计算一个总计 + Map total = new HashMap<>(); + Integer totalNum = 0; + for (Map m:categoryList){ + Set set = m.keySet(); + String categoryName = ""; + Long num = 0L; + for (String s:set){ + if("num".equals(s)){ + num = (Long)m.get(s); + totalNum = totalNum + num.intValue(); + }else{ + categoryName = (String)m.get(s); + } + } + total.put(categoryName,num); + } + total.put("合计件数",totalNum); + + + + //先查询预约单对应有哪些订单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("reservation_id",reservationId); + List reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper); + List> ls = new ArrayList<>(); + BigDecimal totalPrice = BigDecimal.ZERO; + for (int i = 0; i < reservationStockarticleList.size(); i++) { + DistributionReservationStockarticleEntity reservationStockarticleEntity = reservationStockarticleList.get(i); + Long stockArticleId = reservationStockarticleEntity.getStockArticleId();//订单id + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId); + if(Objects.isNull(stockArticleEntity)){ + log.warn("#########handleShangPeiData: 订单信息不存在 stockArticleId={}",stockArticleId); + throw new CustomerException(403,"订单信息不存在"); + } + + Map orderMap = new HashMap<>(); + orderMap.put("序号",i+1); + orderMap.put("运单号",stockArticleEntity.getWaybillNumber()); + orderMap.put("合同号",stockArticleEntity.getOrderCode()); + + //通过订单id和预约id查询对应包件的库位信息 + List allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(stockArticleId,reservationId); + String allocationStr = StringUtils.join(allocationStrList, ","); + orderMap.put("货位",allocationStr); + //通过订单id和预约id查询对应包件的备货区信息 + List stockupAreaStrList = distributionReservationMapper.getStockupAreaByStockArticleIdAndReservationId(stockArticleId,reservationId); + String stockupAreaStr = StringUtils.join(stockupAreaStrList, ","); + orderMap.put("备货区",stockupAreaStr); + + //查询当前订单的品类数量 + List> mapList = distributionReservationMapper.getCategoryByStockArticleIdAndReservationId(stockArticleId,reservationId); + Map numObj = new HashMap<>(); + Integer tn = 0; + Set set = total.keySet(); + for (String key:set){ + if(!"合计件数".equals(key)){ + numObj.put(key,0); + for (Map m:mapList){ + String thirdProduct = (String)m.get("thirdProduct"); + Long num = (Long)m.get("num"); + if(thirdProduct.equals(key)){ + numObj.put(key,num); + tn = tn + num.intValue(); + } + } + } + } + numObj.put("合计数量",tn); + orderMap.put("产品明细",numObj); + + //通过订单id和预约id查询对应包件的物料信息 + List materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId,reservationId); + String materialNameStr = StringUtils.join(materialNameStrList, ","); + orderMap.put("物料名称",materialNameStr); + orderMap.put("到付运费",0);//todo 需要累加到totalPrice上 + ls.add(orderMap); + } + total.put("到付费用",totalPrice); + map.put("明细",ls); + map.put("合计",total); + String popHtml =TemplateUtil.popTemplate("商配配配送单",map,html); + PrintPreviewVO printPreviewVO = new PrintPreviewVO(); + printPreviewVO.setTemplateId(templateId); + printPreviewVO.setTemplateHtml(popHtml); + result.add(printPreviewVO); + } + } + return result; + } - Map map = new HashMap<>(); + /** + * 得到填充内容 + * @param template + * @param idArray + * @param html + * @return + * @throws Exception + */ + private List handleShiPeiData(BasicPrintTemplateEntity template, String[] idArray,String html) throws Exception { + + List result = new ArrayList<>(); + List data = new ArrayList<>(); + for (String id : idArray) { + + // 获取需要的数据 DistributionDeliveryListEntity byId = this.getById(id); + if (ObjectUtils.isNull(byId)) { + throw new ServiceException("未找到相关数据"); + } //查询这个配送下面的预约单 - List distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId()); - for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { + if (distributionReservationEntityList.isEmpty()) { + throw new ServiceException("未找到相关数据"); + } + for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { + Map map = new HashMap<>(); + log.debug(">>>> distributionReservationEntity {}",distributionReservationEntity); map.put("配送单号", distributionReservationEntity.getReservationCode()); - // todo 商场电话是否需要查询商场信息得到电话 + String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); + map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName)); + + // todo 查询运单的收货人电话 + map.put("商场名称", distributionReservationEntity.getMallName()); map.put("商场电话", distributionReservationEntity.getReservationCode()); map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); @@ -3187,44 +3409,52 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); - + List> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1); map.put("定制品集合", spaclOrderList); - map.put("备注", distributionReservationEntity.getRemarks()); - - + map.put("送货司机", byId.getVehicleName() + "/" + byId.getDriverName()); + data.add(map); + String popHtml =TemplateUtil.popTemplate("市配配送单",map,html); + PrintPreviewVO printPreviewVO = new PrintPreviewVO(); + printPreviewVO.setTemplateId(template.getId()); + printPreviewVO.setTemplateHtml(popHtml); + result.add(printPreviewVO); } - - - map.put("送货司机", byId.getTrainNumber() + "/" + byId.getDriverName()); - - - data.add(map); - - } + return result; + } - return printPreviewVO; + private BasicPrintTemplateEntity getPrintTemplate(Integer type) { + BasicPrintTemplateEntity template = null; + if (2 == type) { + template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue()); + } else if (1 == type) { + template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_12.getValue()); + } + if (ObjectUtil.isEmpty(template)) { + throw new ServiceException("模板内容未找到"); + } + return template; } + /** * 构建预约单下面的订单信息 * - * @param id 预约单ID + * @param distributionReservationEntity 预约单 * @param i 构建类型 1 表示订单 2 表示库存品 * @return List */ - private List> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) { + private List> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) { List distributionReservationStocklistEntities; List distributionReservationStockarticleEntityList; - List> result = new ArrayList<>(); + List> result = new ArrayList<>(); switch (i) { case 1: // 订单 @@ -3233,17 +3463,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl temp = new HashMap<>(); + Map temp = new HashMap<>(); DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(distributionReservationStockarticleEntity.getStockArticleId()); - temp.put("合同号",distributionStockArticleEntity.getOrderCode()); - temp.put("产品名称",distributionStockArticleEntity.getDescriptionGoods()); + temp.put("合同号", distributionStockArticleEntity.getOrderCode()); + temp.put("产品名称", distributionStockArticleEntity.getDescriptionGoods()); //todo 单位是否需要查询物料表 - temp.put("单位","件"); - temp.put("数量",distributionReservationStockarticleEntity.getReservationNum()); - temp.put("备货区",null); + temp.put("单位", "件"); + temp.put("数量", distributionReservationStockarticleEntity.getReservationNum()); + temp.put("备货区", null); //todo 这里还没完成 + temp.put("货位", null); result.add(temp); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index 22c2b6b5e..16f9aa6fc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionParcelListDTO; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.mapper.DistributionParcelListMapper; @@ -32,6 +33,7 @@ import com.logpm.distribution.service.IDistributionParcelListService; import com.logpm.distribution.vo.DistributionParcelListBaseVO; import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.PackageStockupVO; +import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import lombok.AllArgsConstructor; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.order.OrderStockupStatusConstant; @@ -57,6 +59,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl selectDistributionParcelListPage(IPage page, DistributionParcelListVO distributionParcelList) { List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); @@ -90,8 +94,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) { - return baseMapper.selectOrderInfoList(reservationId,stockArticleId,stockupId, trayId); + public List selectOrderInfoList(StockupDTO stockupDTO) { + return baseMapper.selectOrderInfoList(stockupDTO); } @Override @@ -118,6 +122,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) { - return baseMapper.selectOrderInfoSelfList(reservationId,stockupId,stockArticleId); + public List selectOrderInfoSelfList(StockupDTO stockupDTO) { + return baseMapper.selectOrderInfoSelfList(stockupDTO); } @Override @@ -207,6 +211,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl selectOrderInfoAllocationList(StockupDTO stockupDTO) { + return baseMapper.selectOrderInfoAllocationList(stockupDTO); + } + /** * * @param distributionParcelList 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 b00c2beaf..433d34837 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 @@ -40,6 +40,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.Inventory.*; +import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; import org.springblade.common.constant.delivery.DeliveryStatusConstant; import org.springblade.common.constant.order.OrderReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant; @@ -461,8 +462,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl getReservationAddr(String ids) { + public List getReservationAddr(String ids) { if (Func.isBlank(ids)) { return null; } - String[] split = ids.split(","); - List distributionReservationVOS = new ArrayList<>(); - if (split.length == 1) { - DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids); - distributionReservationVOS.add(reservationEntity); - } else { - for (String s : split) { - DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s); - distributionReservationVOS.add(reservationEntity); + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + List reservationVOList = null; + if (Func.isNotEmpty(myCurrentWarehouse)){ + List longs = Func.toLongList(ids); + List reservationEntityList = this.listByIds(longs); + reservationVOList = DistributionReservationWrapper.build().listVO(reservationEntityList); + BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(reservationVOList.get(0).getWarehouseId()); + if (Func.isNotEmpty(entityWarehouseId)){ + reservationVOList.stream().forEach(r->{r.setJingdu(entityWarehouseId.getLongitude());r.setWeidu(entityWarehouseId.getLatitude());}); } } - Page distributionReservationVOPage = new Page<>(); - Page resultPage = distributionReservationVOPage.setRecords(distributionReservationVOS); - return resultPage; + +// String[] split = ids.split(","); +// +// List distributionReservationVOS = new ArrayList<>(); +// if (split.length == 1) { +// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids); +// distributionReservationVOS.add(reservationEntity); +// } else { +// for (String s : split) { +// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s); +// distributionReservationVOS.add(reservationEntity); +// } +// } + + return reservationVOList; } @Override @@ -667,28 +750,36 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl ids = Func.toLongList(reservationIds); - DistributionStockupEntity distributionStockupEntity = Func.copy(stockup, DistributionStockupEntity.class); +// DistributionStockupEntity distributionStockupEntity = Func.copy(stockup, DistributionStockupEntity.class); Integer stockListTotal = distributionReservationStocklistMapper.getStockListTotal(ids); //这里判断是否选择了司机 - if (Func.isEmpty(stockupentity.getForkliftId())) { - //这里就是米有选择司机 - distributionStockupEntity.setAssignStatus(StockAssignStatusConstant.weizhipai.getValue()); - distributionStockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue()); - } else { - distributionStockupEntity.setAssignTime(new Date()); - distributionStockupEntity.setAssignStatus(StockAssignStatusConstant.yizhipai.getValue()); - distributionStockupEntity.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); - distributionStockupEntity.setForkliftId(stockup.getForkliftId()); - distributionStockupEntity.setForkliftName(stockup.getForkliftName()); - } +// if (Func.isEmpty(stockupentity.getForkliftId())) { +// //这里就是米有选择司机 +// distributionStockupEntity.setAssignStatus(StockAssignStatusConstant.weizhipai.getValue()); +// distributionStockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue()); +// } else { +// distributionStockupEntity.setAssignTime(new Date()); +// distributionStockupEntity.setAssignStatus(StockAssignStatusConstant.yizhipai.getValue()); +// distributionStockupEntity.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); +// distributionStockupEntity.if (Func.equals(reservationEntity.getStockupStatus(), ReservationStockupStatusConstant.weibeihuo.getValue())) { +// //如果预约已经备货 +// DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity(); +// stockupInfoEntity.setStockUpType(StockupTypeConstant.shipei.getValue()); +// stockupInfoEntity.setReservationId(ids.get(i)); +// stockupInfoEntity.setStockupId(distributionStockupEntity.getId()); +// distributionStockupInfoService.save(stockupInfoEntity); +// reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); +// }(stockup.getForkliftId()); +// distributionStockupEntity.setForkliftName(stockup.getForkliftName()); +// } DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); //设置车次号 - String today = DateUtil.today(); - String random = Func.random(7, RandomType.ALL); - distributionDeliveryListEntity.setTrainNumber(random + today); +// String today = DateUtil.today(); +// String random = Func.random(7, RandomType.ALL); + distributionDeliveryListEntity.setTrainNumber(trainNumberMa()); distributionDeliveryListEntity.setFee(BigDecimal.ZERO); distributionDeliveryListEntity.setPrice(BigDecimal.ZERO); distributionDeliveryListService.save(distributionDeliveryListEntity); @@ -708,11 +799,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl reservationEntityList = baseMapper.selectList(Wrappers.query().lambda().in(DistributionReservationEntity::getId, ids)); boolean flag = reservationEntityList.stream().anyMatch(s -> s.getStockupStatus().equals(ReservationStockupStatusConstant.weibeihuo.getValue())); + DistributionStockupEntity stockupEntity = null; if (flag) { - if (Func.isNotEmpty(stockup.getGoodsAreaName())) { - distributionStockupEntity.setStockupArea(stockup.getGoodsAreaName()); - distributionStockupEntity.setGoodsAreaId(stockup.getGoodsAreaId()); - } + stockupEntity = new DistributionStockupEntity(); + stockupEntity.setAssignStatus(StockAssignStatusConstant.weizhipai.getValue()); + stockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue()); + //这里就需要构建备货任务中间表 +// if (Func.isNotEmpty(stockup.getGoodsAreaName())) { +// distributionStockupEntity.setStockupArea(stockup.getGoodsAreaName()); +// distributionStockupEntity.setGoodsAreaId(stockup.getGoodsAreaId()); +// } // if (Func.isNotEmpty(stockup.getGoodsAreaName())) { // distributionStockupEntity.setStockupArea(stockup.getGoodsAreaName()); // distributionStockupEntity.setGoodsAreaId(stockup.getGoodsAreaId()); @@ -720,23 +816,26 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl warehouseNames = new HashSet<>(); for (int i = 0; i < ids.size(); i++) { @@ -746,12 +845,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 1) { // distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString()); // } @@ -1284,8 +1384,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl stockArticle = allocationDTO.getStockArticle(); //根据运单号进行分组 //TODO 这里先根据运单号进行运单信息查询,后期根据运单进行 - Map> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber)); + Map> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getConsigneeUnit)); //配送任务仓库名称 HashSet deliveryWarehouseName = new HashSet<>(); //订单总数量 @@ -1429,7 +1529,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl().lambda() .eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionSignfor.getDeliveryId()) ); - BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); + distributionDeliverySelfEntity= Func.copy(distributionDeliveryTripartiteEntity, DistributionDeliverySelfEntity.class); +// BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); @@ -1341,32 +1348,38 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl signforInventoryList(Long signforId) { List distributionReservationStocklistVOS = distributionSignforMapper.selectInventory(signforId); - distributionReservationStocklistVOS.forEach(i->{ - List list = disStockListDetailService.list(Wrappers.query().lambda().eq(DisStockListDetailEntity::getReservationId, i.getReservationId()).eq(DisStockListDetailEntity::getStockListId, i.getStocklistId())); - switch (i.getLoadingStatus()){ - case "10": - i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.weizhuangche.getName()); - break; - case "20": - i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getName()); - - break; - case "30": - i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.yizhuangche.getName()); - break; - } - switch (i.getSigningStatus()){ - case "10": - i.setSigningStatusName(ReservationInventorySigningStatusConstant.weiqianshou.getName()); - break; - case "20": - i.setSigningStatusName(ReservationInventorySigningStatusConstant.bufenqianshou.getName()); - break; - case "30": - i.setSigningStatusName(ReservationInventorySigningStatusConstant.yiqianshou.getName());; - } - i.setDetailVOS(DistributionDisStockListWrapper.build().listVO(list)); - }); + boolean flag = distributionReservationStocklistVOS.stream().allMatch(i -> Func.isEmpty(i.getStocklistId())); + if (flag){ + return null; + }else { + distributionReservationStocklistVOS.forEach(i->{ + if (Func.isNotEmpty(i)){ + List list = disStockListDetailService.list(Wrappers.query().lambda().eq(DisStockListDetailEntity::getReservationId, i.getReservationId()).eq(DisStockListDetailEntity::getStockListId, i.getStocklistId())); + switch (i.getLoadingStatus()){ + case "10": + i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.weizhuangche.getName()); + break; + case "20": + i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getName()); + break; + case "30": + i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.yizhuangche.getName()); + break; + } + switch (i.getSigningStatus()){ + case "10": + i.setSigningStatusName(ReservationInventorySigningStatusConstant.weiqianshou.getName()); + break; + case "20": + i.setSigningStatusName(ReservationInventorySigningStatusConstant.bufenqianshou.getName()); + break; + case "30": + i.setSigningStatusName(ReservationInventorySigningStatusConstant.yiqianshou.getName());; + } + i.setDetailVOS(DistributionDisStockListWrapper.build().listVO(list)); + } + }); + } return distributionReservationStocklistVOS; } 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 2ca99814a..e38a5ec55 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 @@ -681,7 +681,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 1){ stockArticleEntity.setWarehouseIdList(collect); - }else{ + }else if(collect.size() == 1){ stockArticleEntity.setWarehouseId(collect.get(0)); } IPage distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity); @@ -781,7 +781,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_code",orderCode) + queryWrapper.like("order_code",orderCode) .eq("warehouse_id",warehouseId) .eq("is_zero",1) .eq("is_deleted",0); @@ -791,7 +791,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl findListByWaybillNumberAndWarehouseId(String waybillNumber, Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("waybill_number",waybillNumber) + queryWrapper.like("waybill_number",waybillNumber) .eq("warehouse_id",warehouseId) .eq("is_zero",1) .eq("is_deleted",0); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 84f27d9b9..b89dfeb48 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -383,6 +383,11 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId) { + return baseMapper.getListByMarketIdAndMaterialName(marketId,materialName,warehouseId); + } + // @Override // public R selectInventoryDetail(Map params, IPage page) { // String reservationId = (String) params.get("reservationId"); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java index 6a53dfe4a..c6f002c7f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java @@ -29,6 +29,7 @@ import com.logpm.distribution.mapper.DistributionStockupMapper; import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.DistributionDeliveryDetailsVO; +import com.logpm.distribution.vo.DistributionStockAllocationVO; import com.logpm.distribution.vo.DistributionStockVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; @@ -329,4 +330,9 @@ public class DistributionStockServiceImpl extends BaseServiceImpl pageList(IPage page, Map distributionStockup) { DistributionStockupEntity distributionStockupEntity = JSON.parseObject(JSON.toJSONString(distributionStockup), DistributionStockupEntity.class); -// //获取当前登录人仓库 -// List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); -// //取出id -// List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if(ObjectUtils.isNotNull(myCurrentWarehouse)){ + //获取当前登录人仓库 + distributionStockupEntity.setWarehouseId(myCurrentWarehouse.getId()); + }else{ + //获取当前登录人仓库 + List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); + //取出id + List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + distributionStockupEntity.setWarehouseIdList(collect); + } distributionStockupEntity.setTenantId(AuthUtil.getTenantId()); if (distributionStockupEntity.getTypeService().equals("3")) { @@ -479,6 +489,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Predicate distinctByKey(Function keyExtractor){ + Map map=new ConcurrentHashMap<>(); + return t -> map.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null; + } @Override public List selectStockupOrderList(StockupDTO stockupDTO) { @@ -486,41 +500,237 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId); - //查询包件的库位的 - if(!list.isEmpty()){ - list.forEach( i ->{ - if(ObjectUtils.isNull(i.getAllocationId())){ - //查询包件信息 - List list1 = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId()) - ); - if(!list1.isEmpty()){ - list1.forEach( a ->{ - WarehouseUpdownGoodsLogEntity updownGoodsLog = new WarehouseUpdownGoodsLogEntity(); - updownGoodsLog.setAssociationType("3"); - updownGoodsLog.setAssociationId(a.getId()); - updownGoodsLog.setBindingType("2"); //下架 - BasicdataWarehouseEntity my = basicdataWarehouseClient.getMyCurrentWarehouse(); - updownGoodsLog.setWarehouseId(my.getId()); - WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLog); - if(ObjectUtils.isNotNull(updownGoods)){ - i.setAllocation(updownGoods.getPositionCode()); - i.setAllocationId(updownGoods.getAllocationId()); - i.setCompleteStact(true); + //获取有货位的数据 + List collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); + Set listYou = new HashSet<>(); + collect11.forEach( i -> { + if(listYou.size() > 0){ + boolean b = listYou.stream().anyMatch(o -> o.getAllocationId().equals(i.getAllocationId())); + if(b){ + listYou.forEach( y -> { + if(y.getAllocationId().equals(i.getAllocationId())){ + //相同 + y.setPlanNum(y.getPlanNum()+1); + if(ObjectUtils.isNotNull(i.getStockId())){ + y.setScanNum(y.getScanNum()+1); } - }); - + //t托盘信息 + if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(i.getTrayId())){ + y.setPallet(y.getPallet()+","+i.getPallet()); + } + } + } ); + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); } + listYou.add(i); + } + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); + } + listYou.add(i); + } + } ); + //获取没有货位的数据 + List collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); + if(!collect22.isEmpty()){ + collect22.forEach( i -> { + boolean b = listYou.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getAllocationId())); + if(b){ + listYou.forEach( wu -> { + if(ObjectUtils.isNull(wu.getAllocationId())){ + //相同 + wu.setPlanNum(wu.getPlanNum()+1); + if(ObjectUtils.isNotNull(i.getStockId())){ + wu.setScanNum(wu.getScanNum()+1); + } + //托盘信息 + if(ObjectUtils.isNotNull(wu.getTrayId()) && wu.getTrayId().equals(i.getTrayId())){ + wu.setPallet(wu.getPallet()+","+i.getPallet()); + } + if(wu.getPlanNum().equals(wu.getScanNum())){ + wu.setCompleteStact(true); + } + } + }); + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + }else{ + i.setScanNum(0); + } + listYou.add(i); } }); } - return list; +// List collect = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//不为空 +// List collect2 = collect.stream().filter(distinctByKey(person -> person.getAllocationId())).collect(Collectors.toList()); //去重 +// List collect1 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());//为空 + //查询包件的库位的 + return new ArrayList<>(listYou); } else { //商 市 //1.根据预约单id 查询到对应的数据 List list = distributionReservationService.selectStockupOrderList(reservationId); - return list; + List collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); //有货位 + Set listYou = new HashSet<>(); // + collect11.forEach( p ->{ + if(listYou.size() > 0){ + // + boolean b = listYou.stream().anyMatch(a -> a.getAllocationId().equals(p.getAllocationId())); + if(b){ + //有一样的 + listYou.forEach( y -> { + if(y.getAllocationId().equals(p.getAllocationId())){ + //相同 + y.setPlanNum(y.getPlanNum()+1); + if(ObjectUtils.isNotNull(p.getStockId())){ + y.setScanNum(y.getScanNum()+1); + } + //t托盘信息 + if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){ + y.setPallet(y.getPallet()+","+p.getPallet()); + } + } + } ); + }else{ + //没有 + p.setPlanNum(1); + if (ObjectUtils.isNull(p.getStockId())){ + p.setScanNum(0); + }else{ + p.setScanNum(1); + } + listYou.add(p); + } + }else{ + // + p.setPlanNum(1); + if (ObjectUtils.isNull(p.getStockId())){ + p.setScanNum(0); + }else{ + p.setScanNum(1); + } + + listYou.add(p); + } + }); + List collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); //无货位 + List listLi = new ArrayList<>(); //历史 + collect22.forEach(i ->{ + // 查询包件是否是货位 + DistributionStockAllocationVO stockAllocationVO = distributionStockService.selectAllocation(stockupDTO.getReservationId(),stockupDTO.getStockupId(),i.getParcelListId()); + if(ObjectUtils.isNotNull(stockAllocationVO)){ + //添加以扫货位信息 + i.setAllocation(stockAllocationVO.getPositionCode()); + i.setAllocationId(stockAllocationVO.getAllocationId()); + listLi.add(i); + }else{ + listLi.add(i); + } + }); + List collectYou = listLi.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//有 + List collectWu = listLi.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());//没有 + collectYou.forEach( p ->{ + if(listYou.size() > 0){ + // + boolean b = listYou.stream().anyMatch(a -> a.getAllocationId().equals(p.getAllocationId())); + if(b){ + //有一样的 + listYou.forEach( y -> { + if(y.getAllocationId().equals(p.getAllocationId())){ + //相同 + y.setPlanNum(y.getPlanNum()+1); + if(ObjectUtils.isNotNull(p.getStockId())){ + y.setScanNum(y.getScanNum()+1); + } + //t托盘信息 + if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){ + y.setPallet(y.getPallet()+","+p.getPallet()); + } + if(y.getPlanNum().equals(y.getScanNum())){ + y.setCompleteStact(true); + }else{ + y.setCompleteStact(false); + } + } + } ); + }else{ + //没有 + p.setPlanNum(1); + if (ObjectUtils.isNull(p.getStockId())){ + p.setScanNum(0); + }else{ + p.setScanNum(1); + p.setCompleteStact(true); + } + listYou.add(p); + } + }else{ + // + p.setPlanNum(1); + if (ObjectUtils.isNull(p.getStockId())){ + p.setScanNum(0); + }else{ + p.setScanNum(1); + p.setCompleteStact(true); + } + listYou.add(p); + } + }); + collectWu.forEach(i ->{ + boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId())); + if(b){ + listYou.forEach( wu -> { + if(ObjectUtils.isNull(wu.getAllocationId())){ + //相同 + wu.setPlanNum(wu.getPlanNum()+1); + if(ObjectUtils.isNotNull(i.getStockId())){ + wu.setScanNum(wu.getScanNum()+1); + } + //托盘信息 + if(ObjectUtils.isNotNull(wu.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){ + wu.setPallet(wu.getPallet()+","+i.getPallet()); + } + //订单自编号信息 + if(ObjectUtils.isNotNull(wu.getOrderCode()) && !wu.getOrderCode().equals(i.getOrderCode())){ + wu.setOrderCode(wu.getOrderCode()+","+i.getOrderCode()); + } + //订单id信息 + if(ObjectUtils.isNotNull(wu.getStockArticleId()) && !wu.getStockArticleId().equals(i.getStockArticleId())){ + wu.setStockArticleId(wu.getStockArticleId()+","+i.getStockArticleId()); + } + if(wu.getPlanNum().equals(wu.getScanNum())){ + wu.setCompleteStact(true); + }else{ + wu.setCompleteStact(false); + } + } + }); + }else{ + i.setPlanNum(1); + if(ObjectUtils.isNotNull(i.getStockId())){ + i.setScanNum(1); + i.setCompleteStact(true); + }else{ + i.setScanNum(0); + } + listYou.add(i); + } + + + }); + return new ArrayList<>(listYou); } } @@ -543,10 +753,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.selectOrderInfoList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId()); + List list = new ArrayList<>(); + if(stockupDTO.getStatus().equals(1)){ + + //查询已下架的数据 + list = distributionParcelListService.selectOrderInfoAllocationList(stockupDTO); + }else{ + //没有下架 + List packageStockupVOS = distributionParcelListService.selectOrderInfoList(stockupDTO); + list = packageStockupVOS.stream().filter(o -> ObjectUtils.isNull(o.getStockId())).collect(Collectors.toList()); + + } + // int size = list.size(); //数量 Integer size = 0; //数量 Integer scanNum = 0; @@ -560,13 +788,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list1 = distributionStockService.list(Wrappers.query().lambda() .eq(DistributionStockEntity::getCoding, vo.getPackageBarCode()) .eq(DistributionStockEntity::getParcelListId, vo.getParceListId()) + .eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId()) + .eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId()) ); allocationTitle = vo.getAllocationTitle(); trayCode = vo.getTrayCode(); @@ -649,29 +878,36 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId()) - ); + DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillOverPackWuSelf(stockupDTO); +// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId()); + if(!stockupDTO.getTypeService().equals("3")){ + queryWrapper.eq("order_package_reservation_status", OrderPackageReservationStatusConstant.yiyueyue.getValue()); + } + List list = distributionParcelListService.list(queryWrapper); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); List listPack = new ArrayList<>(); list.forEach( i ->{ WarehouseUpdownGoodsLogEntity updownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity(); updownGoodsLogEntity.setAssociationType("3"); - updownGoodsLogEntity.setAssociationId(stockupDTO.getAllocationId()); + updownGoodsLogEntity.setAssociationId(i.getId()); + updownGoodsLogEntity.setAllocationId(stockupDTO.getAllocationId()); updownGoodsLogEntity.setBindingType("2"); updownGoodsLogEntity.setWarehouseId(myCurrentWarehouse.getId()); - updownGoodsLogEntity.setAllocationId(i.getId()); +// updownGoodsLogEntity.setAllocationId(i.getId()); WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLogEntity); - PackageStockupVO packageStockupVO = new PackageStockupVO(); - packageStockupVO.setOrderCode(i.getOrderCode()); - packageStockupVO.setPackageBarCode(i.getOrderPackageCode()); - packageStockupVO.setGoodsType(1); - packageStockupVO.setGoodsTypeStr("定制品"); - packageStockupVO.setMaterialName(i.getMaterialName()); - packageStockupVO.setIsScanStr("已备货"); - packageStockupVO.setIsScan(2); - listPack.add(packageStockupVO); + if(ObjectUtils.isNotNull(updownGoods)){ + PackageStockupVO packageStockupVO = new PackageStockupVO(); + packageStockupVO.setOrderCode(i.getOrderCode()); + packageStockupVO.setPackageBarCode(i.getOrderPackageCode()); + packageStockupVO.setGoodsType(1); + packageStockupVO.setGoodsTypeStr("定制品"); + packageStockupVO.setMaterialName(i.getMaterialName()); + packageStockupVO.setIsScanStr("已备货"); + packageStockupVO.setIsScan(2); + listPack.add(packageStockupVO); + } }); DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); vo.setReservationId(stockupDTO.getReservationId()); //预约id @@ -690,13 +926,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId()); + List list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO); Iterator iterator = list.iterator(); if(Objects.isNull(stockupDTO.getAllocationId())){ @@ -706,7 +942,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl 0) { //存在 List list = distributionStockService.list(Wrappers.query().lambda() .eq(DistributionStockEntity::getCoding, packetBarCode) - .eq(DistributionStockEntity::getOrderSelfNumbering, orderCode) + .eq(StringUtils.isNotBlank(stockupDTO.getOrderCode()),DistributionStockEntity::getOrderSelfNumbering, orderCode) + .in(stockupDTO.getOrderCodeList().length > 0,DistributionStockEntity::getOrderSelfNumbering,stockupDTO.getOrderCodeList()) .eq(DistributionStockEntity::getStockupId, stockupId) .eq(DistributionStockEntity::getReservationId, reservationId) ); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java index 5fe91f481..9fc353d58 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java @@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistrilbutionBillStockEntity; import com.logpm.distribution.excel.DistrilbutionBillStockExcel; import com.logpm.distribution.mapper.DistrilbutionBillStockMapper; @@ -88,14 +89,11 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl params = new HashMap<>(); - params.put("ids","1686560469635727362"); - try { - OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); - System.out.println(orderPackgeCodeDataVO); - } catch (Exception e) { - e.printStackTrace(); - } +// Map params = new HashMap<>(); +// params.put("ids","1686560469635727362"); +// try { +// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params); +// System.out.println(orderPackgeCodeDataVO); +// } catch (Exception e) { +// e.printStackTrace(); +// } + List printPreviewVOS = distributionDeliveryListService.printBatch(ids,type); + } } diff --git a/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java new file mode 100644 index 000000000..d750cd869 --- /dev/null +++ b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java @@ -0,0 +1,30 @@ +package com.logpm.distribution; + +import com.logpm.distribution.service.IDistributionDeliveryListService; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springblade.core.test.BladeBootTest; +import org.springblade.core.test.BladeSpringExtension; +import org.springframework.beans.factory.annotation.Autowired; + +@ExtendWith(BladeSpringExtension.class) +@BladeBootTest(appName = "logpm-distribution", enableLoader = true) +public class TestService { + + @Autowired + private IDistributionDeliveryListService distributionDeliveryListService; + + @Test + public void test2() throws Exception { + +// List printPreviewVOS = distributionDeliveryListService.printBatch("1703958397055135745", 1); + + + distributionDeliveryListService.testData("1703958397055135745"); + + System.out.println(111111); + + } + +} + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java index 7be76e04f..27cd1ddce 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java @@ -53,12 +53,15 @@ public class OrderStatusDTO implements Serializable { @NotEmpty(message = "当前仓库不能为空") private String currentWarehouse;//当前仓库 - @NotEmpty(message = "目的仓库") + @NotEmpty(message = "目的仓库不能为空") private String destinationWarehouse;//目的仓库 - @NotEmpty(message = "状态") + @NotEmpty(message = "状态不能为空") private String status;//状态 + @NotEmpty(message = "送货任务ID不能为空") + private String distributionContactId; + /** * 验证参数是否都存在 @@ -92,6 +95,9 @@ public class OrderStatusDTO implements Serializable { if(StringUtil.isBlank(status)){ return false; } + if(StringUtil.isBlank(distributionContactId)){ + return false; + } return true; } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtQianShouStatusDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtQianShouStatusDTO.java new file mode 100644 index 000000000..2553f8975 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtQianShouStatusDTO.java @@ -0,0 +1,35 @@ +package com.logpm.factory.mt.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 梦天 + */ +@Data +public class MtQianShouStatusDTO implements Serializable { + + @JsonProperty("送货任务ID") + private String sendTaskId; + + @JsonProperty("发运单编号") + private String invoiceOrderCode; + + @JsonProperty("订单编号") + private String orderCode; + + @JsonProperty("仓库编号") + private String centerWarehouseCode; + + @JsonProperty("作业仓库") + private String destinationWarehouse; + + @JsonProperty("包条码") + private String unitNo; + + @JsonProperty("扫描时间") + private String operationTime; + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java index bdeb2db68..ae25e3b89 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java @@ -287,16 +287,81 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { logger.info("#############handleStatusData: orderStatusDTO={}", orderStatusDTO); String status = orderStatusDTO.getStatus(); - String orderNo = orderStatusDTO.getOrderNo(); - if ("1".equals(status) || "2".equals(status) || "3".equals(status) || "5".equals(status) || "6".equals(status) || "7".equals(status) || "8".equals(status) || "9".equals(status)) { + +// if ("1".equals(status) || "2".equals(status) || "3".equals(status) || "5".equals(status) || "6".equals(status) || "7".equals(status) || "8".equals(status) || "9".equals(status)) { +// +// } + + R rd = null; + if("4".equals(status)){ + rd = shouhuoruku(orderStatusDTO); + }else if("7".equals(status)){ + rd = qianshouScan(orderStatusDTO); + }else{ logger.info("#############handleStatusData: 当前数据的状态不推送 status={}", status); return Resp.fail(400, "当前数据的状态不推送"); } logger.info("##################orderStatusHandler: 异常tag={}", 0); + return rd; + + } + + private R qianshouScan(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException { + String unitNo = orderStatusDTO.getUnitNo(); + String orderNo = orderStatusDTO.getOrderNo(); + QueryWrapper packageInfoQueryWrapper = new QueryWrapper<>(); + packageInfoQueryWrapper.eq("package_code", unitNo); + MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper); + logger.info("#############one: {}", one); + + if (Objects.isNull(one)) { + logger.info("#############qianshouScan: 当前包条码未找到对应数据unitNo={}", unitNo); + return Resp.fail(400, "未找到包件数据"); + } + Long orderId = one.getOrderId(); + MtFactoryOrder mtFactoryOrder = mtFactoryOrderService.getById(orderId); + if (Objects.isNull(mtFactoryOrder)) { + logger.info("#############qianshouScan: 未找到对应订单orderId={}", orderId); + return Resp.fail(400, "未找到对应订单"); + } + Long mainId = mtFactoryOrder.getMainId(); + MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId); + if (Objects.isNull(mtFactoryOrderMain)) { + logger.info("#############qianshouScan: 未找到对应订单mainId={}", mainId); + return Resp.fail(400, "未找到对应订单"); + } + + String distributionContactId = orderStatusDTO.getDistributionContactId();//送货任务ID + String invoiceOrderCode = mtFactoryOrderMain.getInvoiceOrderCode();//发货单编号 + String orderCode = mtFactoryOrder.getOrderCode();//订单编号 + String centerWarehouseCode = mtFactoryOrderMain.getCenterWarehouseCode();//仓库编号 + String destinationWarehouse = orderStatusDTO.getDestinationWarehouse();//作业仓库 + String operationTime = orderStatusDTO.getOperationTime();//签收时间 + + //拼接参数 + MtQianShouStatusDTO mtQianShouStatusDTO = new MtQianShouStatusDTO(); + mtQianShouStatusDTO.setSendTaskId(distributionContactId); + mtQianShouStatusDTO.setInvoiceOrderCode(invoiceOrderCode); + mtQianShouStatusDTO.setOrderCode(orderCode); + mtQianShouStatusDTO.setCenterWarehouseCode(centerWarehouseCode); + mtQianShouStatusDTO.setDestinationWarehouse(destinationWarehouse); + mtQianShouStatusDTO.setUnitNo(unitNo); + mtQianShouStatusDTO.setOperationTime(operationTime); + + ObjectMapper objectMapper = new JsonMapper(); + + String s = objectMapper.writeValueAsString(mtQianShouStatusDTO); + + R rd = sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouScan", s, 1,unitNo); + return rd; + } + + private R shouhuoruku(OrderStatusDTO orderStatusDTO) throws JsonProcessingException, NoSuchAlgorithmException { //通过包件码查询是否是要推送的订单 String unitNo = orderStatusDTO.getUnitNo();//包件码 + String orderNo = orderStatusDTO.getOrderNo(); QueryWrapper packageInfoQueryWrapper = new QueryWrapper<>(); packageInfoQueryWrapper.eq("package_code", unitNo); MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper); @@ -369,13 +434,11 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { mtPushDataService.save(mtPushData); } - - return rd; - } + @Transactional @Override public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException, NoSuchAlgorithmException { @@ -468,7 +531,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { log.info("###########sendReceiveInfo: 处理签收返回数据完成 {}",s); - return sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouDan", s, 5,mtReceiveDTO.getSendTaskId()); + return sendMtFactoryData(mtFactoryProperties.getUrl() + "/ZXCFaHuoDan/QianShouDanNew", s, 5,mtReceiveDTO.getSendTaskId()); } diff --git a/blade-service/logpm-warehouse/Dockerfile b/blade-service/logpm-warehouse/Dockerfile index 06b6781f3..046e2ad64 100644 --- a/blade-service/logpm-warehouse/Dockerfile +++ b/blade-service/logpm-warehouse/Dockerfile @@ -11,4 +11,4 @@ EXPOSE 8800 ADD ./target/logpm-warehouse.jar ./app.jar ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] -CMD ["--spring.profiles.active=test"] +CMD ["--spring.profiles.active=dev"] diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java index 2ba459f8a..1825d8017 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java @@ -793,6 +793,42 @@ public class WarehouseTrayTypeApiController { } } + @ResponseBody + @PostMapping("/selectStockByMaterialNameAndMarketId") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询库存品", notes = "传入trayTypeDTO") + public R selectStockByMaterialNameAndMarketId(@RequestBody TrayTypeDTO trayTypeDTO) { + String method = "###########selectStockByMaterialNameAndMarketId: "; + log.info(method + "查询库存品 trayTypeDTO={}", trayTypeDTO); + Long marketId = trayTypeDTO.getMarketId(); +// String materialCode = trayTypeDTO.getMaterialCode(); + String materialName = trayTypeDTO.getMaterialName(); + try{ + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息不能为空"); + return R.fail(403,"仓库信息不能为空"); + } + + + if(Objects.isNull(marketId)){ + log.warn(method+"商场id不能为空 marketId={}",marketId); + return R.fail(403,"商场id不能为空"); + } + if(!StringUtil.hasLength(materialName)){ + log.warn(method+"物料名称不能为空 materialCode={}",materialName); + return R.fail(403,"物料名称不能为空"); + } + return warehouseTrayTypeService.selectStockByMaterialNameAndMarketId(marketId,materialName,myCurrentWarehouse.getId()); + }catch (CustomerException e){ + log.warn(e.message); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + @ResponseBody @PostMapping("/enterStockNoDataMaterialCode") @@ -834,6 +870,10 @@ public class WarehouseTrayTypeApiController { log.warn(method+"商场id不能为空 marketId={}",marketId); return R.fail(403,"商场id不能为空"); } + if(Objects.isNull(num)||num == 0){ + log.warn(method+"数量不正确 num={}",num); + return R.fail(403,"数量不正确"); + } return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num,incomingBatch,myCurrentWarehouse.getId()); }catch (CustomerException e){ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java index 6c7b85cd6..15da3f385 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java @@ -304,6 +304,14 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + for (UpShelfZeroOrderDTO dto:upShelfZeroOrderList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + if(Objects.isNull(allocationId)){ log.warn(method+"库位信息不能为空 allocationId={}",allocationId); return R.fail(403,"库位信息不能为空"); @@ -384,6 +392,15 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + + for (UpShelfStockDTO dto:upShelfStockList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + if(Objects.isNull(allocationId)){ log.warn(method+"库位信息不能为空 allocationId={}",allocationId); return R.fail(403,"库位信息不能为空"); @@ -511,6 +528,14 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + for (UpShelfZeroOrderDTO dto:upShelfZeroOrderList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + //查询该库位的货物信息 return warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList); }catch (CustomerException e){ @@ -577,6 +602,15 @@ public class WarehouseUpdownTypeApiController { log.warn(method+"没有处理的数据"); return R.fail(403,"无处理数据"); } + + for (UpShelfStockDTO dto:upShelfStockList){ + Integer enterNum = dto.getEnterNum(); + if(Objects.isNull(enterNum) || enterNum == 0){ + log.warn(method+"请输入正确的数量"); + return R.fail(403,"请输入正确的数量"); + } + } + //查询该库位的货物信息 return warehouseUpdownTypeService.downStock(upShelfStockList); }catch (CustomerException e){ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java index 45cbfbdfd..68bfe59bc 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java @@ -213,8 +213,7 @@ public class WarehouseGoodsAllocationController extends BladeController { R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -247,8 +246,7 @@ public class WarehouseGoodsAllocationController extends BladeController { } R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -273,8 +271,7 @@ public class WarehouseGoodsAllocationController extends BladeController { R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -298,8 +295,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //上架托盘 R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -324,8 +320,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; @@ -351,8 +346,7 @@ public class WarehouseGoodsAllocationController extends BladeController { //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { - String prefix = Url+"/*"; - bladeRedis.del(bladeRedis.keys(prefix)); + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); } return r; } @@ -370,7 +364,7 @@ public class WarehouseGoodsAllocationController extends BladeController { return R.data(bladeRedis.get(Url + "/" + warehouseGoodsAllocation.getGoodsShelfId())); } List pages = warehouseGoodsAllocationService.selectVisualization(warehouseGoodsAllocation); - bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 300L); + bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 600L); return R.data(pages); } @@ -402,7 +396,7 @@ public class WarehouseGoodsAllocationController extends BladeController { return R.data(bladeRedis.get(Url + "_cargoNub")); } List list = warehouseGoodsAllocationService.selectcargoNub(); - bladeRedis.setEx(Url + "_cargoNub", list, 360L); + bladeRedis.setEx(Url + "_cargoNub", list, 600L); return R.data(list); } @@ -637,6 +631,19 @@ public class WarehouseGoodsAllocationController extends BladeController { } + /** + * 货位 更新货位缓存 + */ + @GetMapping("/updateAllocationCache") + @ApiOperationSupport(order = 32) + @ApiOperation(value = "更新货位缓存", notes = "传入货位ids") + public R updateAllocationCache(String ids) { + log.info("更新货位缓存>>>>>>{}",ids); + Boolean b = warehouseGoodsAllocationService.updateAllocationCache(ids); + return R.status(b); + } + + /** * 导出数据 */ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java index bcad31b09..f431b3ed5 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java @@ -44,6 +44,7 @@ public class TrayTypeDTO implements Serializable { private String warehouseCode;//仓库编码 private String materialCode;//物料编码 + private String materialName;//物料名称 private Long marketId;//商场id private String incomingBatch;//批次号 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java index 419f7441c..e65dcfad7 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java @@ -50,4 +50,10 @@ public class WarehouseGoodsAllocationClient implements IWarehouseGoodsAllocation return BladePage.of(page); } + @Override + @GetMapping(TOP+ "/updateAllocationCache") + public Boolean updateAllocationCache(String ids) { + return warehouseGoodsAllocationService.updateAllocationCache(ids); + } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml index 0103f6792..2c7d0e9e9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml @@ -235,7 +235,7 @@ select lwug.* from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_list ldsl on ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch and ldsl.material_id = lwug.association_id and lwug.is_deleted = 0 - where ldsl.description_goods = #{materialName} + where ldsl.description_goods like concat('%',#{materialName},'%') and ldsl.market_id = #{marketId} @@ -244,7 +244,7 @@ ldsa.waybill_number waybillNumber from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0 - where lwug.association_value = #{orderCode} + where lwug.association_value like concat('%',#{orderCode},'%') and ldsa.warehouse_id = #{warehouseId} @@ -253,7 +253,7 @@ ldsa.waybill_number waybillNumber from logpm_warehouse_updown_goods lwug left join logpm_distribution_stock_article ldsa on ldsa.order_code = lwug.association_value and ldsa.is_deleted = 0 - where ldsa.waybill_number = #{waybillNumber} + where ldsa.waybill_number like concat('%',#{waybillNumber},'%') and ldsa.warehouse_id = #{warehouseId}