Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 2 years ago
parent
commit
52ce09344c
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java
  3. 40
      blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java
  4. 2
      blade-gateway/Dockerfile
  5. 3
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java
  6. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java
  7. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java
  8. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java
  9. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java
  10. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java
  11. 43
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java
  12. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
  13. 21
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  14. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockAllocationVO.java
  15. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java
  16. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java
  17. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java
  18. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java
  19. 2
      blade-service/logpm-basic/Dockerfile
  20. 1
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java
  21. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java
  22. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java
  23. 42
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  24. 25
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml
  25. 42
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  26. 2
      blade-service/logpm-distribution/Dockerfile
  27. 1
      blade-service/logpm-distribution/pom.xml
  28. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java
  29. 435
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  30. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java
  31. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  32. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  33. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  34. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java
  35. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  36. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java
  37. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml
  38. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml
  39. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  40. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  41. 60
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  42. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  43. 50
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  44. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  45. 133
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  46. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  47. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  48. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  49. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  50. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  51. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  52. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  53. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java
  54. 47
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  55. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java
  56. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  57. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  58. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  59. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  60. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  61. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java
  62. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java
  63. 114
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  64. 84
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  65. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  66. 469
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  67. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  68. 229
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  69. 73
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  70. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  71. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  72. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  73. 349
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  74. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java
  75. 18
      blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java
  76. 30
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
  77. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java
  78. 35
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtQianShouStatusDTO.java
  79. 75
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  80. 2
      blade-service/logpm-warehouse/Dockerfile
  81. 40
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  82. 34
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  83. 35
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  84. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java
  85. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java
  86. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  87. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java
  88. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  89. 69
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java
  90. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  91. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java
  92. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java
  93. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

7
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";

5
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");
/**

40
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<String, Object> map, String url) throws Exception {
public static String getTemplateByUrl(String name, Map<String, Object> 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<String, Object> 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();

2
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"]

3
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;
}

1
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<BasicdataCarrierEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

3
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<BasicdataVehicleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX + "/getVehicleById")
BasicdataVehicleEntity getVehicleById(@RequestParam("id") Long id);
}

5
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<Long> warehouseIdList;

4
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<DistributionStockListEntity> getListByMarketIdAndMaterialName(@RequestParam("marketId") Long marketId, @RequestParam("materialName") String materialName, @RequestParam("warehouseId") Long warehouseId);
// /**
// * 修改某个客户信息及物品信息
// *

2
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;
}

43
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;
// /**
// * 配送方式
// */

5
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;
/**
/**

21
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;
/**

10
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
}

4
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
}

1
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
}

2
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;//货物类型

5
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<WarehouseGoodsAllocationEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 跟新货位缓存
*/
@GetMapping(TOP+ "/updateAllocationCache")
Boolean updateAllocationCache(@RequestParam("ids") String ids);
}

2
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"]

1
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java

@ -92,6 +92,7 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl<BasicMaterialMappe
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveOrUpdateOwn(BasicMaterialEntity basicMaterial) {
log.info("basicMaterial>>>>>>>>>>>>>>>{}",basicMaterial);
if(ObjectUtils.isNotNull(basicMaterial.getId())){
//记录修该日志

2
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<IPage<WarehouseStockListVO>> inventoryList(BasicdataTrayDTO BasicdataTray, Query query) {
IPage<WarehouseStockListVO> list = trayService.getinventoryList(Condition.getPage(query), BasicdataTray);
return R.data(list);
return R.data(WarehouseStockListWrapper.build().pageVO(list));
}

5
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);
}
}

42
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',''));
</select>
<select id="exportWarehouseByallocation" resultType="com.logpm.basicdata.excel.BasicdatavisualizationSheetTwo">
SELECT positionInfo,
GROUP_CONCAT(DISTINCT firsts SEPARATOR '、') firsts,
GROUP_CONCAT(DISTINCT SECOND SEPARATOR '、') SECOND,
GROUP_CONCAT(DISTINCT thirdProduct SEPARATOR '、') thirdProduct,
GROUP_CONCAT(DISTINCT orderCode SEPARATOR '、') orderCode,
GROUP_CONCAT(DISTINCT materialName SEPARATOR '、') materialName,
SUM(num) num
FROM (
SELECT lwug.position_code AS positionInfo,
CONCAT(ldpl.firsts, '(', SUM(lwug.num), ')') AS firsts,
CONCAT(ldpl.SECOND, '(', SUM(lwug.num), ')') AS SECOND,
CONCAT(ldpl.third_product, '(', SUM(lwug.num), ')') AS thirdProduct,
CONCAT(ldpl.order_code, '(', SUM(lwug.num), ')') AS orderCode,
CONCAT(ldpl.material_name, '(', SUM(lwug.num), ')') AS materialName,
SUM(lwug.num) AS num
FROM
logpm_warehouse_updown_goods lwug
JOIN logpm_distribution_parcel_list ldpl
ON lwug.association_id = ldpl.id
SELECT
lwug.position_code AS positionInfo,
GROUP_CONCAT(ldpl.firsts SEPARATOR '、') AS firsts,
GROUP_CONCAT(ldpl.SECOND SEPARATOR '、') AS SECOND,
GROUP_CONCAT(ldpl.third_product SEPARATOR '、') AS thirdProduct,
GROUP_CONCAT(ldpl.order_code SEPARATOR '、') AS orderCode,
GROUP_CONCAT(ldpl.material_name SEPARATOR '、') AS materialName,
SUM(lwug.num) AS num
FROM
logpm_warehouse_updown_goods lwug
JOIN
logpm_distribution_parcel_list ldpl ON lwug.association_id = ldpl.id
<where>
ldpl.warehouse_id =#{areaId}
</where>
GROUP BY
lwug.position_code,
ldpl.firsts,
ldpl.SECOND,
ldpl.third_product,
ldpl.order_code,
ldpl.material_name
) AS subquery
GROUP BY positionInfo
GROUP BY
lwug.position_code;
</select>
<select id="exportWarehouseByStrip" resultType="com.logpm.basicdata.excel.BasicdatavisualizationSheetThree">
SELECT

25
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml

@ -107,7 +107,9 @@
ldpl.order_package_reservation_status orderPackageReservationStatus,
ldpl.order_package_loading_status orderPackageLoadingStatus,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_parcel_list ldpl ON lwtg.association_id = ldpl.id
@ -168,15 +170,18 @@
ldsl.cargo_number cargoNumber,
ldsl.cargo_unit cargoUnit,
ldsl.cargo_norms cargoNorms,
ldsl.shopping_mall shoppingMall,
ldsl.market_name marketName,
ldsl.warehouse_name warehouseName,
lwug.position_code positionCode,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.num num,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id
JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.material_id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id
<where>
ldsl.is_deleted = 0 and lwtg.is_deleted = 0 and lwtg.association_type = 4 and lwtg.tray_id = #{param.id}
<if test="param.cargoNumber !=null and param.cargoNumber != ''">
@ -208,7 +213,9 @@
ldsa.consignee_address consigneeAddress,
lwug.position_code positionCode,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_stock_article ldsa ON lwtg.association_id = ldsa.id
@ -309,7 +316,7 @@
ldsl.cargo_number cargoNumber,
ldsl.cargo_unit cargoUnit,
ldsl.cargo_norms cargoNorms,
ldsl.shopping_mall shoppingMall,
ldsl.market_name marketName,
ldsl.warehouse_name warehouseName,
lwug.position_code positionCode,
lwga.column_num columnNum,
@ -324,8 +331,8 @@
lwtgl.num num
FROM
logpm_warehouse_tray_goods_log lwtgl
JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id
JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.material_id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id
<where>
ldsl.is_deleted = 0 and lwtgl.is_deleted = 0 and lwtgl.association_type = 4 and lwtgl.tray_id = #{param.id}
<if test="param.sku !=null and param.sku != ''">

42
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java

@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
@ -57,10 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -327,6 +325,13 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
List<BasicdatavisualizationSheetOne> basicdatavisualizationSheetOnes = baseMapper.exportWarehouseByorderId(areaId);
//sheetTwo
List<BasicdatavisualizationSheetTwo> basicdatavisualizationSheetTwos = baseMapper.exportWarehouseByallocation(areaId);
basicdatavisualizationSheetTwos.forEach(e->{
if (StringUtils.isNotBlank(e.getFirsts())){e.setFirsts(this.countUniqueProperties(e.getFirsts())); }
if (StringUtils.isNotBlank(e.getSecond())){e.setSecond(this.countUniqueProperties(e.getSecond()));}
if (StringUtils.isNotBlank(e.getThirdProduct())){e.setThirdProduct(this.countUniqueProperties(e.getThirdProduct()));}
if (StringUtils.isNotBlank(e.getOrderCode())){e.setOrderCode(this.countUniqueProperties(e.getOrderCode()));}
if (StringUtils.isNotBlank(e.getMaterialName())){e.setMaterialName(this.countUniqueProperties(e.getMaterialName()));}
});
//sheetThree
List<BasicdatavisualizationSheetThree> basicdatavisualizationSheetThrees = baseMapper.exportWarehouseByStrip(areaId);
//转换上架人
@ -364,4 +369,33 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
//return warehouseGoodsAreaList;
}
public String countUniqueProperties(String initial){
// 对字段进行按逗号分割后的属性去重,并拼接去重后的数量
String[] propertyArray = initial.split("、");
List<String> uniqueProperties = new ArrayList<>();
HashMap<String, Integer> propertyCounts = new HashMap<>();
for (String prop : propertyArray) {
String trimmedProp = prop.trim();
if (!uniqueProperties.contains(trimmedProp)) {
uniqueProperties.add(trimmedProp);
}
propertyCounts.put(trimmedProp, propertyCounts.getOrDefault(trimmedProp, 0) + 1);
}
StringBuilder resultBuilder = new StringBuilder();
for (String prop : uniqueProperties) {
int propCount = propertyCounts.get(prop);
if (resultBuilder.length() > 0) {
resultBuilder.append("、");
}
resultBuilder.append(prop).append(" (").append(propCount).append(")");
}
return resultBuilder.toString();
}
}

2
blade-service/logpm-distribution/Dockerfile

@ -11,4 +11,4 @@ EXPOSE 8600
ADD ./target/logpm-distribution.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
CMD ["--spring.profiles.active=test"]
CMD ["--spring.profiles.active=dev"]

1
blade-service/logpm-distribution/pom.xml

@ -100,6 +100,7 @@
</dependencies>
<build>

27
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java

@ -38,7 +38,7 @@ import java.util.Map;
@RestController
@AllArgsConstructor
@RequestMapping("/app/addvalue")
@Api(value = "签收管理", tags = "签收管理App接口")
@Api(value = "配送管理", tags = "增值服务App接口")
public class DistributionAddvalueAppController {
private final DistributionAddvalueServiceImpl distributionAddvalueService;
@ -63,8 +63,8 @@ public class DistributionAddvalueAppController {
* 扫描接口
*/
@PostMapping("/scanAddvaluePackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "增值服务扫描、输入包件码", notes = "DistributionAppDeliveryListDTO")
public R scanAddvaluePackage(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.scanAddvaluePackage(distributionAppAddvalueDTO);
return r;
@ -76,19 +76,20 @@ public class DistributionAddvalueAppController {
* 全部包件
*/
@PostMapping("/getAllPackageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
public List<DistributionAddvaluePackageEntity> getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
@ApiOperationSupport(order = 3)
@ApiOperation(value = "查询该客户下的所有配送包件信息", notes = "DistributionAppDeliveryListDTO")
public R getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageEntity> allPackageList = distributionAddvalueService.getAllPackageList(distributionAppAddvalueDTO);
return allPackageList;
return R.data(200,allPackageList,"成功");
}
/**
* 保存增值服务
*/
@PostMapping("/saveAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "保存增值服务项", notes = "DistributionAppDeliveryListDTO")
public R saveAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.saveAddvalueInfo(distributionAppAddvalueDTO);
return r;
@ -99,8 +100,8 @@ public class DistributionAddvalueAppController {
* 编辑保存
*/
@PostMapping("/updateAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改增值服务项保存", notes = "DistributionAppDeliveryListDTO")
public R updateAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.updateAddvalueInfo(distributionAppAddvalueDTO);
return r;
@ -112,8 +113,8 @@ public class DistributionAddvalueAppController {
* 查询编辑增值服务数据
*/
@PostMapping("/editAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "查询编辑增值服务列表数据", notes = "DistributionAppDeliveryListDTO")
public R editAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.editAddvalueInfo(distributionAppAddvalueDTO);
return r;

435
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -48,6 +48,11 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;
@ -84,6 +89,9 @@ public class DistributionStockupAppController extends BladeController {
private final BladeRedis bladeRedis;
private final IDistributionStockListService iDistributionStockListService;
private DataSourceTransactionManager dataSourceTransactionManager;
private TransactionDefinition transactionDefinition;
/**
* 备货信息表 任务客户 分页列表
*/
@ -162,7 +170,7 @@ public class DistributionStockupAppController extends BladeController {
@ResponseBody
@PostMapping("/orderList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单列表", notes = "传入stockupDTO")
@ApiOperation(value = "客户下库位订单列表", notes = "传入stockupDTO")
public R<Map<String, Object>> orderList(@RequestBody StockupDTO stockupDTO) throws IllegalAccessException {
if (ObjectUtils.isNull(stockupDTO.getOrderStatus())) {
log.warn("++++缺少状态类型");
@ -176,6 +184,10 @@ public class DistributionStockupAppController extends BladeController {
log.warn("++++缺少预约类型");
return R.fail(3005, "参数缺少!!");
}
if (ObjectUtils.isNull(stockupDTO.getStockupId())) {
log.warn("++++缺少备货任务ID类型");
return R.fail(3005, "参数缺少!!");
}
Integer orderStatus = stockupDTO.getOrderStatus();
Map<String, Object> map = new HashMap<>();
@ -244,14 +256,11 @@ public class DistributionStockupAppController extends BladeController {
@ResponseBody
@PostMapping("/orderInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单列表", notes = "传入stockupDTO")
@ApiOperation(value = "客户订单包件列表", notes = "传入stockupDTO")
public R orderInfo(@RequestBody StockupDTO stockupDTO) {
log.info("##############orderInfo: {}", stockupDTO);
// Long reservationId = 1694647731085103105L;//预约单id
// Long stockArticleId = 1686560469463760898L;//订单id
// Long stockupId = 1694647730430791682L;//备货任务Id
Long reservationId = stockupDTO.getReservationId();//预约单id
Long stockArticleId = stockupDTO.getStockArticleId();//订单id
String stockArticleId = stockupDTO.getStockArticleId();//订单id
Long stockupId = stockupDTO.getStockupId();//备货任务Id
Integer orderStatus = stockupDTO.getOrderStatus();//1 客户订单 2库存品
@ -269,7 +278,7 @@ public class DistributionStockupAppController extends BladeController {
}
//查询自提还是商 市
DistributionStockupEntity byId = distributionStockupService.getById(stockupId);
//订单
if (orderStatus == 1) {
//查询客户订单详情
if (Objects.isNull(reservationId)) {
@ -284,12 +293,13 @@ public class DistributionStockupAppController extends BladeController {
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfoSelf(stockupDTO);
return R.data(infoVO);
} else {
//
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(stockupDTO);
return R.data(infoVO);
}
} else if (orderStatus == 2) {
} else if (orderStatus == 2) { //库存品
Long stockListId = stockupDTO.getStockListId();//库存品id
if (Objects.isNull(stockListId)) {
@ -400,151 +410,169 @@ public class DistributionStockupAppController extends BladeController {
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R stockupScan(@RequestBody StockupDTO stockupDTO) {
Integer scanType = stockupDTO.getScanType();//扫码类型
//手动
// TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
// try{
if (scanType == 1) {
//包件扫描
String orderCode = stockupDTO.getOrderCode();//订单自编号
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
Long stockupId = stockupDTO.getStockupId();//备货任务ID
Long reservationId = stockupDTO.getReservationId();//预约单id
if (StringUtil.isBlank(orderCode)) {
log.warn("##################stockupScan: 包件扫码,订单自编号为空");
return R.fail("包件扫码:订单自编号不能为空");
}
if (StringUtil.isBlank(packetBarCode)) {
log.warn("##################stockupScan: 包件扫码,包件码为空");
return R.fail("包件扫码:包件码不能为空");
}
if (ObjectUtils.isNull(stockupId)) {
log.warn("##################stockupId: 包件扫码,备货区为空");
return R.fail("包件扫码:备货任务ID不能为空");
}
if (Objects.isNull(reservationId)) {
log.warn("##################stockupScan: 包件扫码,预约单id为空");
return R.fail("包件扫码:预约单id不能为空");
}
if (scanType == 1) {
//包件扫描
String orderCode = stockupDTO.getOrderCode();//订单自编号
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
Long stockupId = stockupDTO.getStockupId();//备货任务ID
Long reservationId = stockupDTO.getReservationId();//预约单id
if (StringUtil.isBlank(orderCode)) {
log.warn("##################stockupScan: 包件扫码,订单自编号为空");
return R.fail("包件扫码:订单自编号不能为空");
}
if (StringUtil.isBlank(packetBarCode)) {
log.warn("##################stockupScan: 包件扫码,包件码为空");
return R.fail("包件扫码:包件码不能为空");
}
if (ObjectUtils.isNull(stockupId)) {
log.warn("##################stockupId: 包件扫码,备货区为空");
return R.fail("包件扫码:备货任务ID不能为空");
}
if (Objects.isNull(reservationId)) {
log.warn("##################stockupScan: 包件扫码,预约单id为空");
return R.fail("包件扫码:预约单id不能为空");
}
Integer integer = distributionStockupService.selectPackage(stockupDTO);
switch (integer) {
case 1:
DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId());
//正常
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
entity.setOrderSelfNumbering(orderCode);
entity.setCoding(packetBarCode);
// entity.setStockupArea(stockupArea);
entity.setStockupId(stockupId);
if (distributionStockupEntity.getTypeService().equals("3")) {
entity.setBillLadingId(reservationId);
Integer integer = distributionStockupService.selectPackage(stockupDTO);
switch (integer) {
case 1:
DistributionStockupEntity distributionStockupEntity = distributionStockupService.getById(stockupDTO.getStockupId());
//正常
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())
.eq(DistributionParcelListEntity::getOrderCode, stockupDTO.getOrderCode())
);
entity.setParcelListId(one.getId());
//修改包件备货状态
one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue());
//todo 待下架操作
entity.setOrderSelfNumbering(one.getOrderCode());
entity.setCoding(packetBarCode);
// entity.setStockupArea(stockupArea);
entity.setStockupId(stockupId);
if (distributionStockupEntity.getTypeService().equals("3")) {
entity.setBillLadingId(reservationId);
entity.setParcelListId(one.getId());
//修改包件备货状态
one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue());
//todo 待下架操作
// warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode());
distributionParcelListService.updateById(one);
}else{
entity.setReservationId(reservationId);
}
entity.setConditions("0");
entity.setType(2);
distributionStockService.save(entity);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("stockupId", stockupDTO.getStockupId());
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
//查询是否货位数据是否该下架
distributionAsyncService.stockupSelfOffShelf(stockupDTO);
return Resp.scanSuccess("扫描成功!", audioValue);
case 2:
//重复扫描
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2");
return Resp.scanFail("重复扫描!", audioValue2);
case 3:
//包件不存在
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3");
return Resp.scanFail("包件不存在!", audioValue3);
case 4:
//操作失败
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4");
return Resp.scanFail("操作失败!", audioValue4);
case 5:
//窜货
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5");
return Resp.scanFail("窜货!", audioValue5);
default:
log.warn("###备货扫描:未知错误");
return Resp.scanFail("未知错误!", "未知错误");
}
distributionParcelListService.updateById(one);
}else{
entity.setReservationId(reservationId);
}
entity.setConditions("0");
entity.setType(2);
distributionStockService.save(entity);
// dataSourceTransactionManager.commit(transactionStatus);//提交
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("stockupId", stockupDTO.getStockupId());
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
//查询是否货位数据是否该下架
Map<String, Object> mapState = new HashMap<>();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("scanType", scanType);
mapState.put("stockupId", stockupDTO.getStockupId());
mapState.put("typeService", stockupDTO.getTypeService());
mapState.put("reservationId", stockupDTO.getReservationId());
mapState.put("logId", entity.getId());
mapState.put("messageData", entity);
mapState.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
//查询是否货位数据是否该下架
// distributionAsyncService.stockupSelfOffShelf(stockupDTO);
return Resp.scanSuccess("扫描成功!", audioValue);
case 2:
//重复扫描
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2");
return Resp.scanFail("重复扫描!", audioValue2);
case 3:
//包件不存在
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3");
return Resp.scanFail("包件不存在!", audioValue3);
case 4:
//操作失败
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4");
return Resp.scanFail("操作失败!", audioValue4);
case 5:
//窜货
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5");
return Resp.scanFail("窜货!", audioValue5);
default:
log.warn("###备货扫描:未知错误");
return Resp.scanFail("未知错误!", "未知错误");
}
} else if (scanType == 2) {
//库存品扫描
Long reservationId = stockupDTO.getReservationId();
Long stockListId = stockupDTO.getStockListId();
String packetBarCode = stockupDTO.getPacketBarCode();
} else if (scanType == 2) {
//库存品扫描
Long reservationId = stockupDTO.getReservationId();
Long stockListId = stockupDTO.getStockListId();
String packetBarCode = stockupDTO.getPacketBarCode();
// String stockupArea = stockupDTO.getStockupArea();//备货区
Long stockupId = stockupDTO.getStockupId();//备货区
Integer stockPrint = stockupDTO.getStockPrint(); // 库存
Long stockupId = stockupDTO.getStockupId();//备货区
Integer stockPrint = stockupDTO.getStockPrint(); // 库存
if (StringUtil.isBlank(packetBarCode)) {
log.warn("##################stockupScan: 库存品扫码,包件码为空");
return R.fail("库存品扫码:包件码不能为空");
}
if (ObjectUtils.isNull(stockupId)) {
log.warn("##################stockupScan: 库存品扫码,备货区为空");
return R.fail("库存品扫码:备货任务ID不能为空");
}
if (Objects.isNull(stockListId)) {
log.warn("##################stockupScan: 库存品扫码,库存品id为空");
return R.fail("库存品扫码:库存品id不能为空");
}
if (Objects.isNull(reservationId)) {
log.warn("##################stockupScan: 库存品扫码,预约单id为空");
return R.fail("库存品扫码:预约单id不能为空");
}
if (Objects.isNull(stockPrint)) {
log.warn("##################stockupScan: 库存品扫码,类型为空");
return R.fail("库存品扫码:类型不能为空");
}
if (StringUtil.isBlank(packetBarCode)) {
log.warn("##################stockupScan: 库存品扫码,包件码为空");
return R.fail("库存品扫码:包件码不能为空");
}
if (ObjectUtils.isNull(stockupId)) {
log.warn("##################stockupScan: 库存品扫码,备货区为空");
return R.fail("库存品扫码:备货任务ID不能为空");
}
if (Objects.isNull(stockListId)) {
log.warn("##################stockupScan: 库存品扫码,库存品id为空");
return R.fail("库存品扫码:库存品id不能为空");
}
if (Objects.isNull(reservationId)) {
log.warn("##################stockupScan: 库存品扫码,预约单id为空");
return R.fail("库存品扫码:预约单id不能为空");
}
if (Objects.isNull(stockPrint)) {
log.warn("##################stockupScan: 库存品扫码,类型为空");
return R.fail("库存品扫码:类型不能为空");
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
case 1:
//绑定
Integer integer = distributionStockupService.selectPackage(stockupDTO);
switch (integer) {
case 1:
DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupDTO.getStockupId());
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
entity.setCoding(packetBarCode);
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
case 1:
//绑定
Integer integer = distributionStockupService.selectPackage(stockupDTO);
switch (integer) {
case 1:
DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupDTO.getStockupId());
//先保存扫码包件信息,后续由队列来出来余下补充信息
DistributionStockEntity entity = new DistributionStockEntity();
entity.setCoding(packetBarCode);
// entity.setStockupArea(stockupArea);
entity.setStockupId(stockupId);
if(stockupEntity.getTypeService().equals("3")){
entity.setBillLadingId(reservationId);
}else{
entity.setReservationId(reservationId);
}
entity.setStockupId(stockupId);
if(stockupEntity.getTypeService().equals("3")){
entity.setBillLadingId(reservationId);
}else{
entity.setReservationId(reservationId);
entity.setStockListId(stockListId);
//添加物料信息
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
if(ObjectUtils.isNotNull(byId.getMarketId())){
entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId());
//查询库位id
}
entity.setReservationId(reservationId);
entity.setStockListId(stockListId);
//添加物料信息
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
if(ObjectUtils.isNotNull(byId.getMarketId())){
entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId());
//查询库位id
// WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity();
// updownGoods.setAssociationId(byId.getId());
// updownGoods.setMarketId(byId.getMarketId());
@ -562,66 +590,73 @@ public class DistributionStockupAppController extends BladeController {
// list.add(jsonObject);
// warehouseUpdownTypeClient.downStock(list);
// }
}
entity.setConditions("0");
entity.setType(2);
distributionStockService.save(entity);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
return Resp.scanSuccess("扫描成功!",audioValue);
case 2:
//扫码失败
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2");
return Resp.scanFail("重复扫描!",audioValue2);
case 3:
//重复扫码
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3");
return Resp.scanFail("包件不存在!",audioValue3);
case 4:
//重复扫码
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4");
return Resp.scanFail("操作失败!", audioValue4);
case 5:
//重复扫码
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5");
return Resp.scanFail("窜货!", audioValue5);
case 6:
//重复扫码
String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "6");
return Resp.scanFail("已完成!", audioValue6);
case 7:
//重复扫码
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7");
return Resp.scanFail("包条码不存在!", audioValue7);
default:
log.warn("###备货扫描:未知错误");
return Resp.scanFail("未知错误!", "未知错误");
}
case 7:
//重复扫码
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7");
return Resp.scanFail("包条码不存在!", audioValue7);
case 8:
//重复扫码
String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8");
return Resp.scanFail("条码已使用!", audioValue8);
case 9:
//重复扫码
String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9");
return Resp.scanFail("没有待绑定的库存品信息!", audioValue9);
}
}
entity.setConditions("0");
entity.setType(2);
distributionStockService.save(entity);
// dataSourceTransactionManager.commit(transactionStatus);//提交
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("scanType", scanType);
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
return Resp.scanSuccess("扫描成功!",audioValue);
case 2:
//扫码失败
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2");
return Resp.scanFail("重复扫描!",audioValue2);
case 3:
//重复扫码
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3");
return Resp.scanFail("包件不存在!",audioValue3);
case 4:
//重复扫码
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4");
return Resp.scanFail("操作失败!", audioValue4);
case 5:
//重复扫码
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5");
return Resp.scanFail("窜货!", audioValue5);
case 6:
//重复扫码
String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "6");
return Resp.scanFail("已完成!", audioValue6);
case 7:
//重复扫码
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7");
return Resp.scanFail("包条码不存在!", audioValue7);
default:
log.warn("###备货扫描:未知错误");
return Resp.scanFail("未知错误!", "未知错误");
}
case 7:
//重复扫码
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7");
return Resp.scanFail("包条码不存在!", audioValue7);
case 8:
//重复扫码
String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8");
return Resp.scanFail("条码已使用!", audioValue8);
case 9:
//重复扫码
String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9");
return Resp.scanFail("没有待绑定的库存品信息!", audioValue9);
}
}
}
// }catch (TransactionException e){
// e.printStackTrace();
// log.error("######:备货扫描",e.getMessage());
// dataSourceTransactionManager.rollback(transactionStatus);
// }
log.warn("###################stockupScan: 未知的扫码类型 scanType={}", scanType);
return R.fail("未知的扫码类型");
}

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java

@ -92,6 +92,24 @@ public class RabbitMqConfiguration {
return BindingBuilder.bind(stockupScanQueue).to(stockupScanExchange).with(RabbitConstant.STOCKUP_SCAN_ROUTING).noargs();
}
/**
* 备货判断是否下架任务队列
*/
@Bean
public Queue stockupStateUpdateQueue() {
return new Queue(RabbitConstant.STOCKUP_STATE_UPDATE_QUEUE, true);
}
@Bean
public CustomExchange stockupStateUpdateExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding stockupStateUpdateBinding(Queue stockupStateUpdateQueue, CustomExchange stockupStateUpdateExchange) {
return BindingBuilder.bind(stockupStateUpdateQueue).to(stockupStateUpdateExchange).with(RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING).noargs();
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -345,11 +345,11 @@ public class DistributionDeliveryListController extends BladeController {
@PostMapping("/printBatch")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "批量打印", notes = "ids")
public R<PrintPreviewVO> printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
@ApiOperation(value = "批量打印")
public R<List<PrintPreviewVO>> printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) {
try {
PrintPreviewVO printPreviewVOS = distributionDeliveryListService.printBatch(ids);
List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch(ids,type);
return R.data(printPreviewVOS);
} catch (Exception e) {
throw new RuntimeException(e);

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -221,9 +221,9 @@ public class DistributionReservationController extends BladeController {
@GetMapping("/getReservationAddr")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "查询指定预约信息地址")
public R<IPage<DistributionReservationVO>> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) {
IPage<DistributionReservationEntity> result = reservationService.getReservationAddr(ids);
return R.data(DistributionReservationWrapper.build().pageVO(result));
public R<List<DistributionReservationVO>> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) {
List<DistributionReservationVO> result = reservationService.getReservationAddr(ids);
return R.data(result);
}
/**

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -124,9 +124,6 @@ public class DistributionStockArticleController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R<IPage<DistributionStockArticleVO>> selectStockArticleInfoList(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query) {
R r = distributionStockArticleService.selectStockArticleInfoList(distributionStockArticle,query);

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java

@ -46,6 +46,20 @@ public class DistributionAppAddvalueDTO extends TenantEntity {
private String barcode;
/**
* 扫描码
*/
@ApiModelProperty(value = "扫描码")
private List<Long> packageListIds;
/**
* 是否手动 1 - 2-
*/
@ApiModelProperty(value = "是否手动")
private Integer isManual;
/**
* 配送任务Id
*/
@ -121,6 +135,14 @@ public class DistributionAppAddvalueDTO extends TenantEntity {
private BigDecimal fee;
/**
* 公里数
*/
@ApiModelProperty(value = "公里数")
// @NotEmpty(message = "客户Id不能为空")
private Long addvalueDetailId;

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StockupDTO implements Serializable {
@ -24,7 +25,9 @@ public class StockupDTO implements Serializable {
private Long warehouseId;//仓库id
private String orderCode;//订单编码
private Long stockArticleId;//订单id
private String[] orderCodeList;//订单编码
private String stockArticleId;//订单id
private String[] stockArticleIdList;//订单id
private String descriptionGoods;//物料名称

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java

@ -149,5 +149,10 @@ public class DistributionStockListClient implements IDistributionStockListClient
return distributionStockListService.getOne(queryWrapper);
}
@Override
public List<DistributionStockListEntity> getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId) {
return distributionStockListService.getListByMarketIdAndMaterialName(marketId,materialName,warehouseId);
}
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml

@ -29,6 +29,7 @@
lda.addvalue_id,
group_concat(DISTINCT ldad.fee) AS fee,
group_concat(DISTINCT ldad.num) AS num,
group_concat(DISTINCT ldad.id) AS addvalueDetailId,
group_concat(DISTINCT ldad.flool_num) AS floolNum,
group_concat(DISTINCT ldad.distance) AS distance,
group_concat( ldap.id SEPARATOR ',' ) AS packageListIds
@ -60,6 +61,7 @@
ldad.num AS num,
ldad.flool_num AS floolNum,
ldad.distance AS distance,
ldad.id AS addvalueDetailId,
GROUP_CONCAT(ldap.package_id) AS packageListIds
FROM
logpm_distribution_addvalue AS lda
@ -67,7 +69,7 @@
INNER JOIN logpm_distribution_addvalue_package AS ldap ON ldad.id = ldap.addvalue_detail_id
WHERE
lda.ref_id = #{reservationId} and lda.addvalue_id = #{addvalueType}
GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance
GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance,ldad.id
</select>

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml

@ -32,10 +32,10 @@
<delete id="deleteAddvalueDetail">
</delete>
<delete id="deleteAddvaluePackageList">
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>
<delete id="deleteAddvaluePackage">
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}
</delete>
<select id="selectDistributionAddvaluePackagePage" resultMap="distributionAddvaluePackageResultMap">
select * from logpm_distribution_addvalue_package where is_deleted = 0

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -88,6 +88,22 @@
lds.loadedin_number inventoryNub,
lds.reservation_id reservationId,
lds.received_quantity receivedQuantity,
ldss.assign_status assignStatus,
ldss.stockup_area stockupArea,
ldss.stockup_date stockupDate,
ldss.outbound_date outboundDate,
ldss.forklift_name forkliftName,
ldss.stockup_status stockupStatus,
CASE
WHEN ldss.stockup_status ='10' THEN '待分配'
WHEN ldss.stockup_status ='20' THEN '待备货'
WHEN ldss.stockup_status ='30' THEN '备货中'
WHEN ldss.stockup_status ='40' THEN '已完成'
END stockupStatusName,
CASE
WHEN ldss.assign_status ='10' THEN '未指派'
WHEN ldss.assign_status ='20' THEN '已指派'
END assignStatusName,
CASE
WHEN ldr.is_urgent ='1' THEN '否'
else '是'
@ -103,6 +119,8 @@
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
JOIN logpm_distribution_stockup_info AS ldsi ON ldr.id = ldsi.reservation_id
JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id
<where>
lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40
</where>
@ -213,6 +231,9 @@
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.order_status,
ldsa.customer_name,
ldsa.customer_telephone,
ldsa.customer_address,
ldsa.description_goods descriptionGoods,
(

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java

@ -369,4 +369,12 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionReservationStocklistVO> getInventoryByDeliveryId(IPage<Object> page,@Param("deliveryListId") Long deliveryId);
/**
* 查询该配送计划下指定收货单位的预约信息
* @param deliveryListEntityId
* @param k
* @return
*/
DistributionReservationEntity selectReservationByDeliveryListIdAndCustomerUnit(@Param("deliveryListId")Long deliveryListEntityId,@Param("receivingUnit") String k);
}

60
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1347,5 +1347,65 @@
</if>
</where>
</select>
<select id="selectReservationByDeliveryListIdAndCustomerUnit"
resultType="com.logpm.distribution.entity.DistributionReservationEntity">
SELECT
ldr.id,
ldr.tenant_id,
ldr.create_user,
ldr.create_time,
ldr.update_user,
ldr.update_time,
ldr.status,
ldr.is_deleted,
ldr.create_dept,
ldr.stock_article_id,
ldr.mall_id,
ldr.mall_name,
ldr.store_id,
ldr.store_name,
ldr.consignee,
ldr.delivery_address,
ldr.reservation_date,
ldr.serve_type,
ldr.delivery_way,
ldr.delivery_type,
ldr.collect_fee,
ldr.other_fee,
ldr.replace_fee,
ldr.delivery_phone,
ldr.reservation_status,
ldr.order_source,
ldr.stockup_status,
ldr.goods_area_name,
ldr.goods_area_id,
ldr.reserve1,
ldr.reserve2,
ldr.reserve3,
ldr.reserve4,
ldr.reserve5,
ldr.remarks,
ldr.shopping_id,
ldr.period_of_time,
ldr.fee,
ldr.reservation_num,
ldr.reservation_stock_list_num,
ldr.reservation_code,
ldr.service_number,
ldr.cancel_reason,
ldr.is_urgent,
ldr.collection_fee
FROM
logpm_distribution_signfor AS lds
INNER JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
<where>
<if test="deliveryListId != '' and deliveryListId != null">
and lds.delivery_id = #{deliveryListId}
</if>
<if test="receivingUnit != '' and receivingUnit != null">
and ldr.receiving_unit = #{receivingUnit}
</if>
</where>
</select>
</mapper>

7
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<DistributionPar
int submitNumByOrderIdAndName(@Param("articleId") Long articleId,@Param("productName") String productName, @Param("num") Integer num);
List<PackageStockupVO> selectOrderInfoList(@Param("reservationId") Long reservationId, @Param("stockArticleId") Long stockArticleId, @Param("stockupId") Long stockupId,@Param("trayId") Long trayId);
List<PackageStockupVO> selectOrderInfoList(@Param("param") StockupDTO stockupDTO);
List<String> selectWarehouseAreaByReservationId(@Param("reservationId") Long reservationId);
@ -88,7 +89,9 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @param stockArticleId
* @return
*/
List<PackageStockupVO> selectOrderInfoSelfList(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId, @Param("stockArticleId")Long stockArticleId);
List<PackageStockupVO> selectOrderInfoSelfList(@Param("param") StockupDTO stockupDTO);
List<PackageStockupVO> selectOrderInfoAllocationList(@Param("param") StockupDTO stockupDTO);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId);

50
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}
</select>
<select id="selectOrderInfoAllocationList" resultType="com.logpm.distribution.vo.PackageStockupVO">
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName,
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,(
select GROUP_CONCAT( DISTINCT position_code)
from logpm_warehouse_updown_goods_log
where association_id = ldpl.id
) positionCode,lwug.allocation_id allocationId
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods_log lwug on lwug.association_id = ldpl.id
<where>
<if test="param.allocationId != null and param.allocationId != ''"> and lwug.allocation_id = #{param.allocationId} </if>
<if test="param.allocation != null and param.allocation != ''"> and lwug.position_code = #{param.allocation} </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id = #{param.stockArticleId} </if>
<if test="param.stockArticleIdList != null ">
and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")" >
#{a}
</foreach>
</if>
</where>
</select>
<select id="selectOrderInfoSelfList" resultType="com.logpm.distribution.vo.PackageStockupVO">
select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName,
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName,
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,(
select GROUP_CONCAT( DISTINCT position_code)
from logpm_warehouse_updown_goods
where association_id = ldpl.id
) positionCode
) positionCode,lwug.allocation_id allocationId
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
<where>
ldpl.stock_article_id = #{stockArticleId}
ldpl.stock_article_id = #{param.stockArticleId}
<if test="param.allocationId != null and param.allocationId != ''"> and lwug.allocation_id = #{param.allocationId} </if>
</where>
</select>
@ -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
<where>
ldrp.reservation_id = #{reservationId} and ldrp.stock_article_id = #{stockArticleId} and ldrp.packet_bar_status in (1,3)
<if test="trayId != null and trayId != ''"> and lwtg.tray_id = #{trayId}</if>
ldrp.reservation_id = #{param.reservationId} and ldrp.packet_bar_status in (1,3)
<if test="param.trayId != null and param.trayId != ''"> and lwtg.tray_id = #{param.trayId}</if>
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldrp.stock_article_id = #{param.stockArticleId}</if>
<if test="param.stockArticleIdList != null ">
and ldrp.stock_article_id in
<foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")">
#{a}
</foreach>
</if>
</where>
</select>
@ -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
<where>
ldsi.stockup_id =#{id}
</where>
@ -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'
</select>

20
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<DistributionRe
*/
DistributionStockupEntity selectStockup(@Param("reservationId")Long id);
/**
* 查询预约计划的备货任务
* @param id
* @return
*/
List<DistributionStockupEntity> selectStockupList(@Param("reservationIds")List<Long> ids);
/**
* 根基配送ID 查询预约单信息
* @param id
* @return
*/
List<DistributionReservationEntity> findByDeliveryId(@Param("id")Long id);
List<DistributionReservationEntity> findByDeliveryId(@Param("id")Long id);
List<Map<String, Object>> findAllCategoryNum(@Param("id") Long reservationId);
List<String> getAllocationByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<String> getStockupAreaByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<String> getMaterialNameByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<Map<String, Object>> getCategoryByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
}

133
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
<where>
ldrp.reservation_id = #{reservationId} and ldrp.packet_bar_status in (1,3)
<!-- and lwug.association_type = '3' and lwtg.association_type = '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}
</select>
<select id="selectStockupList" resultType="com.logpm.distribution.entity.DistributionStockupEntity">
SELECT
lds.id,
lds.tenant_id,
lds.create_user,
lds.create_time,
lds.update_user,
lds.update_time,
lds.STATUS,
lds.is_deleted,
lds.create_dept,
lds.reserve1,
lds.reserve2,
lds.reserve3,
lds.reserve4,
lds.reserve5,
lds.stockup_date,
lds.stockup_user,
lds.stockup_status,
lds.stockup_area,
lds.assign_status,
lds.stockip_allocation,
lds.goods_area_id,
lds.forklift_id,
lds.loader_id,
lds.team_responsibility,
lds.fix_time,
lds.assign_time,
lds.type_service,
lds.stockup_user_id,
lds.warehouse_id,
lds.forklift_name,
lds.loader_name,
lds.stockup_code,
lds.remarks,
lds.annulment,
lds.outbound_date
FROM
logpm_distribution_stockup_info AS ldsi
INNER JOIN logpm_distribution_stockup AS lds ON ldsi.stockup_id = lds.id
WHERE
ldsi.reservation_id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item.id}
</foreach>
</select>
<select id="findByDeliveryId"
resultMap="reservationResultMap">
@ -886,4 +911,60 @@
</select>
<select id="findAllCategoryNum" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdName,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{id}
and ldrp.packet_bar_status in (1,3)
group by IFNULL(ldpl.third_product,'其他')
</select>
<select id="getAllocationByStockArticleIdAndReservationId" resultType="java.lang.String">
select CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title)
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
and lwug.id is not null
</select>
<select id="getStockupAreaByStockArticleIdAndReservationId" resultType="java.lang.String">
select ldss.stockup_area
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
left join logpm_distribution_stockup_scan ldss on ldss.parcel_list_id = ldpl.id
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
and ldss.reservation_id = #{reservationId}
and ldss.id is not null
group by ldss.stockup_area
</select>
<select id="getMaterialNameByStockArticleIdAndReservationId" resultType="java.lang.String">
select CONCAT(ldpl.material_name,'(',count(ldpl.id),')')
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
group by ldpl.material_name
</select>
<select id="getCategoryByStockArticleIdAndReservationId" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdProduct,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
group by IFNULL(ldpl.third_product,'其他')
</select>
</mapper>

10
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
<!--left join logpm_distribution_reservation ldr on ldr.id = lddl.reservation_id-->
<where>
lddl.is_deleted =0
<if test="array != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(array)">

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -84,4 +84,5 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
DistributionStockupStockListInfoVO selectStockListInfoSelf(@Param("reservationId") Long reservationId,@Param("stockListId") Long stockListId);
List<DistributionStockListEntity> getListByMarketIdAndMaterialName(@Param("marketId") Long marketId, @Param("materialName") String materialName, @Param("warehouseId") Long warehouseId);
}

13
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}
</select>
@ -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}
</select>
<select id="getListByMarketIdAndMaterialName" resultType="com.logpm.distribution.entity.DistributionStockListEntity">
select ldsl.*
from logpm_distribution_stock_list ldsl
where ldsl.is_deleted = 0
and ldsl.description_goods like concat('%',#{materialName},'%')
and ldsl.market_id = #{marketId}
and ldsl.warehouse_id = #{warehouseId}
</select>
</mapper>

3
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<DistributionStockEnt
* @return
*/
DistributionStockVO selectStockupInfoSelf(@Param("pageId")Long pageId);
DistributionStockAllocationVO selectAllocation(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId,@Param("parcelListId") Long parcelListId);
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml

@ -96,6 +96,14 @@
where stockup_id = #{pageId}
)
</select>
<select id="selectAllocation" resultType="com.logpm.distribution.vo.DistributionStockAllocationVO">
select lwugl.position_code,lwugl.allocation_id
from logpm_distribution_stock lds
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2
where lds.reservation_id = #{reservationId} and lds.stockup_id = #{stockupId} and lds.parcel_list_id = #{parcelListId}
GROUP BY lwugl.create_time ,lwugl.position_code,lwugl.allocation_id
LIMIT 1
</select>
</mapper>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java

@ -183,5 +183,5 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @param stockupDTO
* @return
*/
List<DistributionStockupSelfVO> stockupOffShelf(StockupDTO stockupDTO);
List<DistributionStockupSelfVO> stockupOffShelf(@Param("param")StockupDTO stockupDTO);
}

36
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
<where>
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}
<if test="param.orderCode != '' and param.orderCode != null">
and ldpl.order_code = #{param.orderCode}
</if>
<if test="param.orderCodeList != null">
and ldpl.order_code in
<foreach collection="param.orderCodeList" item="a" open="(" separator="," close=")" >
#{a}
</foreach>
</if>
</where>
</select>
<select id="stockupSelfOffShelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select lwug.id lwugId,lds.id ldsId,ldpl.order_package_code orderPackageCode
select lwug.id lwugId,lds.id ldsId,ldpl.order_package_code orderPackageCode,lwug.allocation_id allocationId
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = 3
@ -59,7 +68,7 @@
</where>
</select>
<select id="stockupOffShelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select lwug.id lwugId,lds.id ldsId,ldrp.packet_bar_code orderPackageCode
select lwug.id lwugId,lds.id ldsId,ldrp.packet_bar_code orderPackageCode,lwug.allocation_id allocationId
from logpm_distribution_reservation_package ldrp
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 lds.parcel_list_id = ldrp.parce_list_id
@ -97,7 +106,15 @@
<if test="param.forkliftName != null and param.forkliftName != '' "> and lds.forklift_name like concat('%', #{param.forkliftName},'%')</if>
<if test="param.loaderName != null and param.loaderName != '' "> and lds.loader_name like concat('%', #{param.loaderName},'%')</if>
<!-- <if test="param.groupName != null and param.groupName != '' "> and btg.group_name like concat('%', #{param.groupName},'%')</if>-->
<if test="param.typeService != null and param.typeService != '' "> and lds.type_service = #{param.typeService}</if>
<!--<if test="param.typeService != null and param.typeService != '' "> and lds.type_service = #{param.typeService}</if>-->
<if test="param.warehouseId != null and param.warehouseId != '' "> and lds.warehouse_id = #{param.warehouseId}</if>
<if test="param.warehouseIdList != null">
and lds.warehouse_id in
<foreach collection="param.warehouseIdList" item="a" open="(" separator="," close=")" >
#{a}
</foreach>
</if>
</where>
GROUP BY lds.id
</select>
@ -153,6 +170,13 @@
<if test="param.forkliftName != null and param.forkliftName != '' "> and lds.forklift_name like concat('%', #{param.forkliftName},'%')</if>
<if test="param.loaderName != null and param.loaderName != '' "> and lds.loader_name like concat('%', #{param.loaderName},'%')</if>
<if test="param.typeService != null and param.typeService != '' "> and lds.type_service = #{param.typeService}</if>
<if test="param.warehouseId != null and param.warehouseId != '' "> and lds.warehouse_id = #{param.warehouseId}</if>
<if test="param.warehouseIdList != null">
and lds.warehouse_id in
<foreach collection="param.warehouseIdList" item="a" open="(" separator="," close=")" >
#{a}
</foreach>
</if>
<!--<if test="param.groupName != null and param.groupName != '' "> and btg.group_name like concat('%', #{param.groupName},'%')</if> -->
</where>
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

5
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<DistrilbutionBi
List<DistributionStockupOrderListVO> 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);
}

47
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
<where>
ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId}
</where>
</select>
<select id="selectDistrilbutionBillOverPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select DISTINCT COUNT(lwugl.id) planNum ,(
SELECT COUNT(lt.id)
FROM logpm_distribution_stock lt
WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id
) scanNum,(
select stockup_area
from logpm_distribution_stockup
where id = ldsi.stockup_id
) consignee,(
SELECT GROUP_CONCAT(lwtg.tray_code SEPARATOR ',')
FROM logpm_warehouse_tray_goods lwtg
where lwtg.association_id = ldpl.id and lwtg.association_type = 3
) trays
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id and ldpl.order_package_grounding_status = 10
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on ldpl.id = lwugl.association_id and lwugl.binding_type = 2
<where>
ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId}
ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId}
<if test=" param.allocationId != '' and param.allocationId != null ">
and lwugl.allocation_id = #{param.allocationId}
</if>
</where>
GROUP BY ldpl.id,lwugl.id
</select>
<select id="selectDistrilbutionBillPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select CASE WHEN lwug.id is null THEN
select DISTINCT CASE WHEN lwug.id is null THEN
(
(select COUNT(id)
from logpm_distribution_parcel_list
@ -68,7 +94,7 @@
END planNum ,(
SELECT COUNT(lt.id)
FROM logpm_distribution_stock lt
WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id
WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id and lt.reservation_id = ldsi.reservation_id
) scanNum,(
select stockup_area
from logpm_distribution_stockup
@ -124,7 +150,7 @@
</where>
</select>
<select id="selectDistrilbutionBillSelf" resultType="com.logpm.distribution.vo.DistributionStockupOrderListVO">
select DISTINCT CONCAT( lwug.position_code ) allocation ,lwug.allocation_id allocationId , lwtg.tray_code pallet,lwtg.tray_id trayId,lwug.area_id areaId,
<!-- select DISTINCT CONCAT( lwug.position_code ) allocation ,lwug.allocation_id allocationId , lwtg.tray_code pallet,lwtg.tray_id trayId,lwug.area_id areaId,
lwug.shelf_id shelfId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId ,
CASE WHEN lwug.id is null THEN
(
@ -154,6 +180,15 @@
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id = ldpl.stock_article_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
where ldbs.bill_lading_id = #{reservationId} -->
select DISTINCT CONCAT( lwug.position_code ) allocation ,lwug.allocation_id allocationId , lwtg.tray_code pallet,lwtg.tray_id trayId,lwug.area_id areaId,
lwug.shelf_id shelfId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId ,ldpl.id parcelListId,lds.id stockId
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id = ldpl.stock_article_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.bill_lading_id = ldbs.bill_lading_id
where ldbs.bill_lading_id = #{reservationId}
</select>

48
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:备货下架查询成功");
}
}

4
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;
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -225,5 +225,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param ids
* @return
*/
PrintPreviewVO printBatch(String ids) throws Exception;
List<PrintPreviewVO> printBatch(String ids,Integer type) throws Exception;
void testData(String s) throws Exception;
}

19
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<Distribution
boolean submitNumByOrderIdAndName(Long articleId, String productName, Integer num);
List<PackageStockupVO> selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId,Long trayId);
List<PackageStockupVO> selectOrderInfoList(StockupDTO stockupDTO);
List<String> selectWarehouseAreaByReservationId(Long reservationId);
@ -91,15 +92,19 @@ public interface IDistributionParcelListService extends BaseService<Distribution
/**
* 自提查询订单包件信息
* @param reservationId
* @param stockArticleId
* @param stockupId
* @param trayId
* @return
*
* @param stockupDTO@return
*/
List<PackageStockupVO> selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId);
List<PackageStockupVO> selectOrderInfoSelfList(StockupDTO stockupDTO);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(String orderCode,Long warehouseId);
IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page,Map<String, Object> distributionParcelList);
/**
* 查询已备货的数据
* @param stockupDTO
* @return
*/
List<PackageStockupVO> selectOrderInfoAllocationList(StockupDTO stockupDTO);
}

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -84,6 +84,26 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
String bianMa();
/**
* 预约编码
* @return
*/
String reservationMa();
/**
* 配送编码
* @return
*/
String deliveryListMa();
/**
* 配送编码
* @return
*/
String trainNumberMa();
/**
* 批量预约转备货任务
* @param stockUpInfo 备货信息
@ -97,7 +117,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @param ids id字符串
* @return
*/
IPage<DistributionReservationEntity> getReservationAddr(String ids);
List<DistributionReservationVO> getReservationAddr(String ids);
/**
* 批量转配送任务

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -130,6 +130,9 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
DistributionStockupStockListInfoVO selectStockListInfoSelf(Long reservationId, Long stockListId);
List<DistributionStockListEntity> getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId);
// /**
// * 查询库存品详情
// * @param params

10
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<DistributionStock
Integer selectCount(Long id,Long parseLong);
/**
* 查询有无配货历史货位
* @param reservationId
* @param stockupId
* @param parcelListId
* @return
*/
DistributionStockAllocationVO selectAllocation(Long reservationId, Long stockupId, Long parcelListId);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.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.DistrilbutionBillStockEntity;
import com.logpm.distribution.excel.DistrilbutionBillStockExcel;
import com.logpm.distribution.vo.*;
@ -67,12 +68,11 @@ public interface IDistrilbutionBillStockService extends BaseService<Distrilbutio
/**
* 自提订单列表数据查询
*
* @param reservationId
* @param stockupId
* @param allocationId
* @return
* @param stockupDTO@return
*/
DistributionStockupSelfVO selectDistrilbutionBillPackSelf(Long reservationId, Long stockupId,Long allocationId);
DistributionStockupSelfVO selectDistrilbutionBillPackSelf(StockupDTO stockupDTO);
DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(Long reservationId, Long stockupId);
DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(StockupDTO stockupDTO);
}

114
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.db.Page;
import com.alibaba.druid.sql.visitor.functions.If;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.bean.Res;
@ -46,6 +47,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.locks.Condition;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -103,6 +105,17 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
//该客户不存在包件信息
return Resp.scanFail("客户信息有误!!!", "客户信息有误");
}
List<Long> packageListIds = distributionAppAddvalueDTO.getPackageListIds();
Integer isManual = distributionAppAddvalueDTO.getIsManual();
List<DistributionParcelListEntity> collect1 = parcelListEntityList.stream().filter(p -> packageListIds.contains(p.getId())).collect(Collectors.toList());
if (collect1.size() == 1 ){
return Resp.scanFail("重复扫描", "重复扫描");
}
List<DisStockListDetailEntity> collect2 = detailEntities.stream().filter(i -> packageListIds.contains(i.getId())).collect(Collectors.toList());
if (collect2.size() == 1 ){
return Resp.scanFail("重复扫描", "重复扫描");
}
List<DistributionParcelListEntity> 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<Distributio
distributionAddvaluePackageEntiy.setReservationId(distributionAppAddvalueDTO.getReservationId());
distributionAddvaluePackageEntiy.setStockArticleId(parcelListEntity.getStockArticleId());
distributionAddvaluePackageEntiy.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
distributionAddvaluePackageEntiy.setRecordType("1");
distributionAddvaluePackageEntiy.setRecordType("2");
if (isManual.equals(2)){
distributionAddvaluePackageEntiy.setRecordType("3");
}
return Res.scanSuccess("扫描成功", "扫描成功", distributionAddvaluePackageEntiy);
} else if (packageInfo.size() == 0) {
//包件列表不存在,这里查询看库存品是否存在?
@ -131,7 +147,10 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvaluePackageEntiy.setReservationId(distributionAppAddvalueDTO.getReservationId());
distributionAddvaluePackageEntiy.setStockArticleId(disStockListDetailEntity.getStockListId());
distributionAddvaluePackageEntiy.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode());
distributionAddvaluePackageEntiy.setRecordType("1");
distributionAddvaluePackageEntiy.setRecordType("2");
if (isManual.equals(2)){
distributionAddvaluePackageEntiy.setRecordType("3");
}
return Res.scanSuccess("扫描成功", "扫描成功", distributionAddvaluePackageEntiy);
} else if (inventoryInfo.size() == 0) {
//该客户下既不存在该包件,也不存在该库存品 ---
@ -173,7 +192,13 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
if (Func.isEmpty(packageEntityList)) {
return Resp.scanFail("请添加包件", "请添加包件");
}
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity();
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "错误的包件数量");
}else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
// 上楼 超区 平移 搬运 分拣 专车
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
@ -197,13 +222,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "4":
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "请输入件数");
} else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
break;
// case "4" :
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
@ -237,7 +256,8 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
public List<DistributionAddvaluePackageEntity> getAllPackageList(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageEntity> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
// List<DistributionAddvaluePackageEntity> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<Long> packageListIds = distributionAppAddvalueDTO.getPackageListIds();
Long reservationId = distributionAppAddvalueDTO.getReservationId();
List<DistributionAddvaluePackageEntity> parcelListEntities = distributionReservationMapper.selectAppPackageListByReservationId(reservationId);
List<DistributionAddvaluePackageEntity> detailEntities = distributionReservationMapper.selectAppInventoryListByReservation(reservationId);
@ -247,72 +267,81 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
log.error("################该客户下库存品包件信息:{}", detailEntities);
// return R.fail("服务器正忙....");
}
List<DistributionAddvaluePackageEntity> 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<DistributionAddvaluePackageEntity> 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<DistributionAddvaluePackageEntity> 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.<DistributionAddvalueEntity>query().lambda()
@ -329,7 +358,9 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)) {
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(Func.toLongList(packageListIds));
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.in(DistributionAddvaluePackageEntity::getPackageId,Func.toLongList(packageListIds))
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,distributionAppAddvalueDTO.getAddvalueDetailId()));
Map<Long, List<DistributionAddvaluePackageEntity>> oldPackageList = distributionAddvaluePackageEntities.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
Map<Long, List<DistributionAddvaluePackageEntity>> newPackageList = packageEntityList.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
newPackageList.forEach((k, v) -> {
@ -343,7 +374,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
oldPackageList.remove(k);
}
});
if (Func.isEmpty(oldPackageList)) {
if (Func.isNotEmpty(oldPackageList)) {
//进行删除,这里删除的时候需要考虑是否删除增值服务项,是否删除整个关于该客户的增值服务信息
oldPackageList.forEach((m, n) -> {
//进行删除
@ -362,13 +393,14 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
public R editAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)){
List<Long> longs = Func.toLongList(packageListIds);
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(longs);
addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities);
if (Func.isNotEmpty(addvalueVO)){
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)){
List<Long> longs = Func.toLongList(packageListIds);
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda().in(DistributionAddvaluePackageEntity::getPackageId,longs).eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,addvalueVO.getAddvalueDetailId()));
addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities);
}
}
return R.data(addvalueVO);
}

84
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> 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<DistributionStockupSelfVO> collectY = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());
collectY.stream().collect(Collectors.groupingBy(DistributionStockupSelfVO::getAllocationId))
.forEach( (k,v) -> {
List<String> 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<DistributionStockupSelfVO> collectW = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());
List<String> 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<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>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<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationStocklistMapper.selectList(Wrappers.<DistributionReservationStocklistEntity>query().lambda()

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -129,6 +129,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionStockArticleVO> selectDistributionDeliveryorder(IPage<DistributionStockArticleVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) {
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionDeliveryInfoDTO);
for (DistributionStockArticleVO distributionDeliveryInfoVO : distributionDeliveryInfoVOS) {
//查询签收数量
//查询装车数量

469
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<Distrib
private final IBasicdataWarehouseClient warehouseClient;
private final IDisStockListDetailService disStockListDetailService;
private final DistributionStockListMapper distributionStockListMapper;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IBasicdataVehicleClient basicdataVehicleClient;
private final IBasicdataCarrierClient basicdataCarrierClient;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
@ -152,15 +162,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.collect(Collectors.toList());
distributionDeliveryList.setWarehouseIdList(collect);
List<DistributionDeliveryListEntity> distributionDeliveryListEntities = baseMapper.selectDistributionDeliveryListPage(page, distributionDeliveryList);
return page.setRecords(distributionDeliveryListEntities);
}
@Override
public List<DistributionDeliveryListExcel> exportDistributionDeliveryList(Wrapper<DistributionDeliveryListEntity> queryWrapper) {
List<DistributionDeliveryListExcel> 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<Distrib
List<DistributionStockupVO> 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<String> forkliftName = new HashSet<>();
HashSet<String> loaderName = new HashSet<>();
HashSet<String> stockUser = new HashSet<>();
@ -242,7 +249,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionStockupVO.setForkliftName(String.join(",", forkliftName));
distributionStockupVO.setStockupArea(String.join(",", goodsArea));
distributionStockupVO.setStockupUser(String.join(",", stockUser));
distributionStockupVO.setOutboundDate(outboundDate);
// distributionStockupVO.setOutboundDate(outboundDate);
distributionDeliveryListVO.setStockupInfo(distributionStockupVO);
} else {
@ -484,6 +491,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// }
// }
}
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode());
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// //找出该包条码
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper<DistributionParcelListEntity>().lambda()
@ -906,7 +914,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Long> list = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList());
List<DistributionParcelListEntity> distributionParcelListEntityList = distributionParcelListService.list(new QueryWrapper<DistributionParcelListEntity>().lambda().in(DistributionParcelListEntity::getId, list));
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
List<DisStockListDetailEntity> stockListDetailEntityList = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
@ -919,7 +926,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.fail("该客户存在库存品暂未备货 一键装车失败!!!");
}
if (packageLoadingFlag && inventoryLoadingFlag) {
//此时包件和库存品均已完成装车,这里不需要进行装车需要进行进行提示
//此时包件和库存品均已完成装车,这里不需要进行装车;需要进行进行提示
//这里需要对包件、库存品包件进行库位信息的解绑
} else {
if (!packageLoadingFlag) {
@ -974,6 +981,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanService.save(loadscanEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode());
//异步修改包件状态
distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
}
@ -1024,6 +1032,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscaninvnService.save(loadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
Integer j = distributionSignforMapper.updateloadByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// warehouseUpdownTypeClient.downStock()
//异步修改包件状态 //对于存在库存品的这里还需要将库存品从对应的信息中进行扣除
distributionAsyncService.changeMarketDeliveryListStatus(loadscaninvnEntity.getOrderPackageCode(), loadscaninvnEntity.getDeliveryId());
DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId()));
@ -1790,19 +1799,37 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询客户
List<DistributionAppReservationVO> customList = distributionDeliveryInfoMapper.selectAppcustomListPage(page, distributionDeliveryList.getId());
for (DistributionAppReservationVO distributionAppReservationVO : customList) {
//查询备货是否完成
int aLong = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
.eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId())
.eq(DistributionStockEntity::getType, 1)
).intValue();
distributionAppReservationVO.setIsstock("是");
distributionAppReservationVO.setIsload("是");
if (aLong < distributionAppReservationVO.getReservationNum()) {
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppReservationVO.getId());
List<DisStockListDetailEntity> 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<DistributionStockEntity>().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<Distrib
List<DistributionStockArticleDTO> stockArticle = deliveryListDTO.getStockArticle();
DistributionReservationDTO reservation = deliveryListDTO.getReservation();
//根据运单号进行分组
Map<String, List<DistributionStockArticleDTO>> newClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber));
Map<String, List<DistributionStockArticleDTO>> newClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getConsigneeUnit));
//查询出该配送任务下的客户,并将这些客户根据运单号进行分组
List<DistributionReservationEntity> reservationEntityList = distributionReservationMapper.getDeliveryReservation(deliveryListEntity.getId());
Map<String, List<DistributionReservationEntity>> oldClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getWaybillNo));
Map<String, List<DistributionReservationEntity>> oldClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getReceivingUnit));
//订单总数量
AtomicInteger orderTotal = new AtomicInteger();
//配送任务仓库名称
@ -2039,7 +2066,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else {
//根据配送计划和运单号查询出该预约
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);
//查询出该预约下的订单信息
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId())
@ -2181,6 +2209,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionReservationPackageService.updateById(p);
});
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
});
});
@ -2202,7 +2231,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
//删除预约
oldClient.forEach((f, g) -> {
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<Distrib
deliveryListEntity.setUnloadingTeamName(stockupInfo.getUnloaderName());
}
if (Func.isNotEmpty(stockupInfo.getLoaderId()) && Func.isNotEmpty(stockupInfo.getLoaderName())) {
deliveryListEntity.setUnloadingTeamId(stockupInfo.getLoaderId());
deliveryListEntity.setUnloadingTeamName(stockupInfo.getLoaderName());
deliveryListEntity.setLoadingTeamId(stockupInfo.getLoaderId());
deliveryListEntity.setLoadingTeamName(stockupInfo.getLoaderName());
}
deliveryListEntity.setOrderNumber(orderTotal.get());
deliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get());
@ -2672,31 +2701,33 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询配送下的预约信息和配送司机信息
DistributionDeliveryListEntity deliveryListEntity = this.getById(id);
DistributionDeliveryListVO deliveryListVO = Func.copy(deliveryListEntity, DistributionDeliveryListVO.class);
switch (deliveryListEntity.getKind()) {
case "1":
//查询自主配送
QueryWrapper<DistributionDeliverySelfEntity> qw = new QueryWrapper<>();
qw.lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, id);
List<DistributionDeliverySelfEntity> distributionDeliverySelfEntities = distributionDeliverySelfService.getBaseMapper().selectList(qw);
List<DistributionDeliverySelfVO> deliverySelfVOS = new ArrayList<>();
distributionDeliverySelfEntities.forEach(s -> {
DistributionDeliverySelfVO deliverySelfVO = Func.copy(s, DistributionDeliverySelfVO.class);
deliverySelfVOS.add(deliverySelfVO);
});
deliveryListVO.setDeliverySelfVO(deliverySelfVOS);
break;
case "2":
QueryWrapper<DistributionDeliveryTripartiteEntity> 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<DistributionDeliverySelfEntity> qw = new QueryWrapper<>();
qw.lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, id);
List<DistributionDeliverySelfEntity> distributionDeliverySelfEntities = distributionDeliverySelfService.getBaseMapper().selectList(qw);
List<DistributionDeliverySelfVO> deliverySelfVOS = new ArrayList<>();
distributionDeliverySelfEntities.forEach(s -> {
DistributionDeliverySelfVO deliverySelfVO = Func.copy(s, DistributionDeliverySelfVO.class);
deliverySelfVOS.add(deliverySelfVO);
});
deliveryListVO.setDeliverySelfVO(deliverySelfVOS);
break;
case "2":
QueryWrapper<DistributionDeliveryTripartiteEntity> 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<DistributionReservationEntity> reservationVOS = distributionReservationMapper.getMarketReservationInfo(id);
deliveryListVO.setReservationInfos(DistributionReservationWrapper.build().listVO(reservationVOS));
return deliveryListVO;
@ -2794,56 +2825,67 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString());
}
//查询出原来配送信息的备货任务
DistributionStockupVO deliveryStockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId());
// DistributionStockupVO deliveryStockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId());
//这里查询出该备货任务的执行情况,如果该任务处于已完成的状态需要创建新的备货任务,其他的备货状态则是进行备货任务的修改
DistributionStockupDTO stockupInfo = deliveryListDTO.getStockupInfo();
// DistributionStockupDTO stockupInfo = deliveryListDTO.getStockupInfo();
//前端进行校验这个备货任务是否发生改变,没有发生改变则不需要传递此参数
if (!Func.isEmpty(stockupInfo)) {
if (Func.isNotEmpty(stockupInfo.getForkliftName())) {
deliveryStockupInfo.setAssignStatusName(StockAssignStatusConstant.weizhipai.getValue());
deliveryStockupInfo.setStockupStatus(StockupStatusConstant.weibeihuo.getValue());
deliveryStockupInfo.setForkliftName(stockupInfo.getForkliftName());
deliveryStockupInfo.setForkliftId(stockupInfo.getForkliftId());
//不存在备货人员,此时该任务的状态处于未指派、待分配的状态
} else {
deliveryStockupInfo.setAssignStatusName(StockAssignStatusConstant.yizhipai.getValue());
}
if (Func.isNotEmpty(stockupInfo.getGoodsAreaId())) {
deliveryStockupInfo.setGoodsAreaId(stockupInfo.getGoodsAreaId());
deliveryStockupInfo.setStockupArea(stockupInfo.getGoodsAreaName());
}
// ---------------------------2023-09-06 取消班组职能字段维护------------------------------------
// if (Func.isNotEmpty(stockupInfo.getLoaderId())) {
// deliveryStockupInfo.setLoaderId(stockupInfo.getLoaderId());
// deliveryStockupInfo.setLoaderName(stockupInfo.getLoaderName());
// if (!Func.isEmpty(stockupInfo)) {
// if (Func.isNotEmpty(stockupInfo.getForkliftName())) {
// deliveryStockupInfo.setAssignStatusName(StockAssignStatusConstant.weizhipai.getValue());
// deliveryStockupInfo.setStockupStatus(StockupStatusConstant.weibeihuo.getValue());
// deliveryStockupInfo.setForkliftName(stockupInfo.getForkliftName());
// deliveryStockupInfo.setForkliftId(stockupInfo.getForkliftId());
// //不存在备货人员,此时该任务的状态处于未指派、待分配的状态
// } else {
// deliveryStockupInfo.setAssignStatusName(StockAssignStatusConstant.yizhipai.getValue());
// }
// if (Func.isNotEmpty(stockupInfo.getLoadAndUnload())) {
// deliveryStockupInfo.setTeamResponsibility(stockupInfo.getLoadAndUnload());
// if (Func.isNotEmpty(stockupInfo.getGoodsAreaId())) {
// deliveryStockupInfo.setGoodsAreaId(stockupInfo.getGoodsAreaId());
// deliveryStockupInfo.setStockupArea(stockupInfo.getGoodsAreaName());
// }
//// ---------------------------2023-09-06 取消班组职能字段维护------------------------------------
//// if (Func.isNotEmpty(stockupInfo.getLoaderId())) {
//// deliveryStockupInfo.setLoaderId(stockupInfo.getLoaderId());
//// deliveryStockupInfo.setLoaderName(stockupInfo.getLoaderName());
//// }
//// if (Func.isNotEmpty(stockupInfo.getLoadAndUnload())) {
//// deliveryStockupInfo.setTeamResponsibility(stockupInfo.getLoadAndUnload());
//// }
// if (Func.isNotEmpty(stockupInfo.getStockupDate())) {
// deliveryStockupInfo.setStockupDate(stockupInfo.getStockupDate());
// }
if (Func.isNotEmpty(stockupInfo.getStockupDate())) {
deliveryStockupInfo.setStockupDate(stockupInfo.getStockupDate());
}
if (Func.isNotEmpty(stockupInfo.getRemarks())) {
deliveryStockupInfo.setRemarks(stockupInfo.getRemarks());
}
// if (Func.isNotEmpty(stockupInfo.getRemarks())) {
// deliveryStockupInfo.setRemarks(stockupInfo.getRemarks());
// }
deliveryStockupInfo.setOutboundDate(stockupInfo.getOutboundDate());
distributionStockupMapper.updateById(deliveryStockupInfo);
}
//// if (Func.isNotEmpty(stockupInfo.getRemarks())) {
//// deliveryStockupInfo.setRemarks(stockupInfo.getRemarks());
//// }
// deliveryStockupInfo.setOutboundDate(stockupInfo.getOutboundDate());
// distributionStockupMapper.updateById(deliveryStockupInfo);
// }
if (Func.isNotEmpty(deliveryListDTO.getRemarks())) {
deliveryListEntity.setRemarks(deliveryListDTO.getRemarks());
}
if (Func.isNotEmpty(stockupInfo.getUnloaderName()) && Func.isNotEmpty(stockupInfo.getUnloaderId())) {
deliveryListEntity.setUnloadingTeamId(stockupInfo.getUnloaderId());
deliveryListEntity.setUnloadingTeamName(stockupInfo.getUnloaderName());
if (Func.isNotEmpty(deliveryListDTO.getUnloadingTeamId())) {
deliveryListEntity.setUnloadingTeamId(deliveryListDTO.getUnloadingTeamId());
}
if (Func.isNotEmpty(stockupInfo.getLoaderId()) && Func.isNotEmpty(stockupInfo.getLoaderName())) {
deliveryListEntity.setUnloadingTeamId(stockupInfo.getLoaderId());
deliveryListEntity.setUnloadingTeamName(stockupInfo.getLoaderName());
if (Func.isNotEmpty(deliveryListDTO.getUnloadingTeamName())) {
deliveryListEntity.setUnloadingTeamName(deliveryListDTO.getUnloadingTeamName());
}
deliveryListEntity.setTaskTime(deliveryListDTO.getTaskTime());
if (Func.isNotEmpty(deliveryListDTO.getTaskTime())) {
deliveryListEntity.setTaskTime(deliveryListDTO.getTaskTime());
}
if (Func.isNotEmpty(deliveryListDTO.getFee())) {
deliveryListEntity.setTaskTime(deliveryListDTO.getTaskTime());
}
// if (Func.isNotEmpty(stockupInfo.getUnloaderName()) && Func.isNotEmpty(stockupInfo.getUnloaderId())) {
// deliveryListEntity.setUnloadingTeamId(stockupInfo.getUnloaderId());
// deliveryListEntity.setUnloadingTeamName(stockupInfo.getUnloaderName());
// }
// if (Func.isNotEmpty(stockupInfo.getLoaderId()) && Func.isNotEmpty(stockupInfo.getLoaderName())) {
// deliveryListEntity.setUnloadingTeamId(stockupInfo.getLoaderId());
// deliveryListEntity.setUnloadingTeamName(stockupInfo.getLoaderName());
// }
deliveryListEntity.setCustomersNumber(clientTotal.get());
//对配送进行更改
this.updateById(deliveryListEntity);
@ -3140,42 +3182,222 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public PrintPreviewVO printBatch(String ids) throws Exception {
public List<PrintPreviewVO> printBatch(String ids, Integer type) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
List<Map> 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<PrintPreviewVO> handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception {
List<PrintPreviewVO> 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<DistributionDeliverySelfEntity> 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<DistributionDeliveryTripartiteEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("delivery_id",deliveryListEntityId);
DistributionDeliveryTripartiteEntity deliveryTripartiteEntity = distributionDeliveryTripartiteService.getOne(queryWrapper);
dirverName = deliveryTripartiteEntity.getDriverName();
dirverPhone = deliveryTripartiteEntity.getDriverPhone();
carNumber = deliveryTripartiteEntity.getVehicleNum();
}
List<DistributionReservationEntity> distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId);
//循环查询出来的预约单
for (DistributionReservationEntity reservationEntity:distributionReservationEntityList){
Map<String,Object> 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<Map<String,Object>> categoryList = distributionReservationMapper.findAllCategoryNum(reservationId);
//计算一个总计
Map<String,Object> total = new HashMap<>();
Integer totalNum = 0;
for (Map<String,Object> m:categoryList){
Set<String> 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<DistributionReservationStockarticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("reservation_id",reservationId);
List<DistributionReservationStockarticleEntity> reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper);
List<Map<String,Object>> 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<String,Object> orderMap = new HashMap<>();
orderMap.put("序号",i+1);
orderMap.put("运单号",stockArticleEntity.getWaybillNumber());
orderMap.put("合同号",stockArticleEntity.getOrderCode());
//通过订单id和预约id查询对应包件的库位信息
List<String> allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(stockArticleId,reservationId);
String allocationStr = StringUtils.join(allocationStrList, ",");
orderMap.put("货位",allocationStr);
//通过订单id和预约id查询对应包件的备货区信息
List<String> stockupAreaStrList = distributionReservationMapper.getStockupAreaByStockArticleIdAndReservationId(stockArticleId,reservationId);
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
orderMap.put("备货区",stockupAreaStr);
//查询当前订单的品类数量
List<Map<String,Object>> mapList = distributionReservationMapper.getCategoryByStockArticleIdAndReservationId(stockArticleId,reservationId);
Map<String,Object> numObj = new HashMap<>();
Integer tn = 0;
Set<String> set = total.keySet();
for (String key:set){
if(!"合计件数".equals(key)){
numObj.put(key,0);
for (Map<String,Object> 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<String> 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<String, Object> map = new HashMap<>();
/**
* 得到填充内容
* @param template
* @param idArray
* @param html
* @return
* @throws Exception
*/
private List<PrintPreviewVO> handleShiPeiData(BasicPrintTemplateEntity template, String[] idArray,String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
List<Map> data = new ArrayList<>();
for (String id : idArray) {
// 获取需要的数据
DistributionDeliveryListEntity byId = this.getById(id);
if (ObjectUtils.isNull(byId)) {
throw new ServiceException("未找到相关数据");
}
//查询这个配送下面的预约单
List<DistributionReservationEntity> distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId());
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) {
if (distributionReservationEntityList.isEmpty()) {
throw new ServiceException("未找到相关数据");
}
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) {
Map<String, Object> 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<Distrib
map.put("送货地址", distributionReservationEntity.getDeliveryAddress());
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
List<Map<String,Object>> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1);
List<Map<String, Object>> 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<Map<String,Object>> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) {
private List<Map<String, Object>> buildSpaclOrders(DistributionReservationEntity distributionReservationEntity, int i) {
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities;
List<DistributionReservationStockarticleEntity> distributionReservationStockarticleEntityList;
List<Map<String,Object>> result = new ArrayList<>();
List<Map<String, Object>> result = new ArrayList<>();
switch (i) {
case 1:
// 订单
@ -3233,17 +3463,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 取值
for (DistributionReservationStockarticleEntity distributionReservationStockarticleEntity : distributionReservationStockarticleEntityList) {
Map<String,Object> temp = new HashMap<>();
Map<String, Object> 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);

32
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<Distribut
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@Override
public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
@ -90,8 +94,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}
@Override
public List<PackageStockupVO> selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) {
return baseMapper.selectOrderInfoList(reservationId,stockArticleId,stockupId, trayId);
public List<PackageStockupVO> selectOrderInfoList(StockupDTO stockupDTO) {
return baseMapper.selectOrderInfoList(stockupDTO);
}
@Override
@ -118,6 +122,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if(ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())){
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.STOCKUP_STATUS,i.getStockupStatus()));
}
//出现货位信息
String s = warehouseUpdownGoodsClient.selectMsgBywrap(i.getId());
i.setGoodsAllocation(s);
});
return parcelListOwn;
}
@ -176,15 +183,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/**
* 自提查询订单包件信息
* @param reservationId
* @param stockArticleId
* @param stockupId
* @param trayId
* @return
*
* @param stockupDTO@return
*/
@Override
public List<PackageStockupVO> selectOrderInfoSelfList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) {
return baseMapper.selectOrderInfoSelfList(reservationId,stockupId,stockArticleId);
public List<PackageStockupVO> selectOrderInfoSelfList(StockupDTO stockupDTO) {
return baseMapper.selectOrderInfoSelfList(stockupDTO);
}
@Override
@ -207,6 +211,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.pageOweList(page,distributionParcelListDTO);
}
/**
* 查询已备货的数据
* @param stockupDTO
* @return
*/
@Override
public List<PackageStockupVO> selectOrderInfoAllocationList(StockupDTO stockupDTO) {
return baseMapper.selectOrderInfoAllocationList(stockupDTO);
}
/**
*
* @param distributionParcelList

229
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<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
String random = Func.random(13, RandomType.ALL);
reservationEntity.setReservationCode(random);
reservationEntity.setReservationCode(reservationMa());
//设置预约为市配
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue());
reservationEntity.setReservationNum(packageTotal.get());
@ -511,11 +511,83 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return sb.toString();
}
@Override
public String reservationMa() {
StringBuilder sb = new StringBuilder();
sb.append("YY");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "YY" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "YY" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
@Override
public String deliveryListMa() {
StringBuilder sb = new StringBuilder();
sb.append("PS");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "PS" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "PS" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
@Override
public String trainNumberMa() {
StringBuilder sb = new StringBuilder();
sb.append("PSCC");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "PSCC" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "PSCC" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
private String jiShuan(String s) {
String n = "00001";
if (Func.notNull(bladeRedis.get(s))) {
Object o1 = bladeRedis.get(s);
int anInt = Integer.parseInt(String.valueOf(o1));
if (anInt < 10) {
if (anInt + 1 == 10) {
@ -529,7 +601,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} else {
n = String.format("000%d", anInt + 1);
}
} else if (anInt < 1000) {
if (anInt + 1 == 1000) {
n = String.format("0%d", anInt + 1);
@ -610,7 +681,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//构建中间表信息
DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();
reservationStockupEntity.setStockupId(id);
reservationStockupEntity.setStockUpType(StockupTypeConstant.shangpei.getValue());
reservationStockupEntity.setStockUpType(StockupTypeConstant.shipei.getValue());
reservationStockupEntity.setReservationId(reservationEntity.getId());
result = distributionStockupInfoService.save(reservationStockupEntity);
if (!result) {
@ -628,26 +699,38 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public IPage<DistributionReservationEntity> getReservationAddr(String ids) {
public List<DistributionReservationVO> getReservationAddr(String ids) {
if (Func.isBlank(ids)) {
return null;
}
String[] split = ids.split(",");
List<DistributionReservationEntity> 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<DistributionReservationVO> reservationVOList = null;
if (Func.isNotEmpty(myCurrentWarehouse)){
List<Long> longs = Func.toLongList(ids);
List<DistributionReservationEntity> 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<DistributionReservationEntity> distributionReservationVOPage = new Page<>();
Page<DistributionReservationEntity> resultPage = distributionReservationVOPage.setRecords(distributionReservationVOS);
return resultPage;
// String[] split = ids.split(",");
//
// List<DistributionReservationEntity> 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<Distribu
String reservationIds = allocationDTO.getReservationIds();
//创建备货任务
DistributionStockupDTO stockup = allocationDTO.getStockup();
DistributionStockupEntity stockupentity = Func.copy(stockup, DistributionStockupEntity.class);
// DistributionStockupEntity stockupentity = Func.copy(stockup, DistributionStockupEntity.class);
List<Long> 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<Distribu
//查询根据预约ID查询这些预约的备货状态
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectList(Wrappers.<DistributionReservationEntity>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<Distribu
// if (Func.isNotEmpty(stockup.getLoadAndUnload())) {
// distributionStockupEntity.setTeamResponsibility(stockup.getLoadAndUnload());
// }
if (Func.isNotEmpty(stockup.getOutboundDate())) {
distributionStockupEntity.setOutboundDate(stockup.getOutboundDate());
}
if (Func.isNotEmpty(stockup.getStockupDate())) {
distributionStockupEntity.setStockupDate(stockup.getStockupDate());
}
// if (Func.isNotEmpty(stockup.getOutboundDate())) {
// distributionStockupEntity.setOutboundDate(stockup.getOutboundDate());
// }
// if (Func.isNotEmpty(stockup.getStockupDate())) {
// distributionStockupEntity.setStockupDate(stockup.getStockupDate());
// }
// if (Func.isNotEmpty(stockup.getLoadAndUnload())) {
// distributionStockupEntity.setTeamResponsibility(stockup.getLoadAndUnload());
// }
// distributionStockupEntity.setStockupUser(user.getUserName());
// distributionStockupEntity.setStockupUserId(user.getUserId());
BladeUser user = AuthUtil.getUser();
distributionStockupEntity.setStockupUser(user.getUserName());
distributionStockupEntity.setStockupUserId(user.getUserId());
distributionStockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue());
stockupEntity.setTypeService(DistributionTypeConstant.shipie.getValue());
//编码生成规则 BH+仓库编码+年月日+序号00001
distributionStockupEntity.setStockupCode(bianMa());
distributionStockupEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionStockupService.save(distributionStockupEntity);
stockupEntity.setStockupCode(bianMa());
stockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue());
stockupEntity.setStockupDate(new Date());
// stockupEntity.setOutboundDate(new Date());
stockupEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionStockupService.save(stockupEntity);
}
HashSet<String> warehouseNames = new HashSet<>();
for (int i = 0; i < ids.size(); i++) {
@ -746,12 +845,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity();
stockupInfoEntity.setStockUpType(StockupTypeConstant.shipei.getValue());
stockupInfoEntity.setReservationId(ids.get(i));
stockupInfoEntity.setStockupId(distributionStockupEntity.getId());
stockupInfoEntity.setStockupId(stockupEntity.getId());
distributionStockupInfoService.save(stockupInfoEntity);
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
}
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setTrainNumber(random);
distributionSignforEntity.setTrainNumber(trainNumberMa());
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId());
distributionSignforEntity.setSigningStatus(SignforStatusConstant.daiqianshou.getValue());
@ -895,7 +994,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setType(DistributionTypeConstant.shipie.getValue());
distributionDeliveryListEntity.setOrderCode(String.join(",", hashSet));
// distributionDeliveryListEntity.setTaskTime(allocationDTO.getTaskTime());
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
distributionDeliveryListEntity.setNoteNumber(deliveryListMa());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
String taskTime = allocationDTO.getTaskTime();
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date parse = null;
@ -908,7 +1008,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks());
}
distributionDeliveryListEntity.setTaskTime(taskTime);
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
// distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
// if (orderIds.length() > 1) {
// distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString());
// }
@ -1284,8 +1384,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionStockupService.save(stockupEntity);
//4、维护配送表数据
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity();
String str = Func.random(7, RandomType.ALL) + DateUtil.today();
distributionDeliveryListEntity.setTrainNumber(str);
// String str = Func.random(7, RandomType.ALL) + DateUtil.today();
distributionDeliveryListEntity.setTrainNumber(trainNumberMa());
distributionDeliveryListEntity.setType(DistributionTypeConstant.shangpei.getValue());
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue());
distributionDeliveryListEntity.setPrice(BigDecimal.ZERO);
@ -1295,7 +1395,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionStockArticleDTO> stockArticle = allocationDTO.getStockArticle();
//根据运单号进行分组
//TODO 这里先根据运单号进行运单信息查询,后期根据运单进行
Map<String, List<DistributionStockArticleDTO>> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getWaybillNumber));
Map<String, List<DistributionStockArticleDTO>> mallClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getConsigneeUnit));
//配送任务仓库名称
HashSet<String> deliveryWarehouseName = new HashSet<>();
//订单总数量
@ -1429,7 +1529,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setReservationDate(date);
// -----------------------预约信息完善----------------------------
reservationEntity.setReservationCode(Func.random(11,RandomType.INT));
reservationEntity.setReservationCode(reservationMa());
// reservationEntity.setDeliveryWay();
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue());
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
@ -1447,7 +1547,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setTrainNumber(str);
distributionSignforEntity.setTrainNumber(trainNumberMa());
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId());
distributionSignforService.save(distributionSignforEntity);
deliveryWarehouseName.add(reservationEntity.getWarehouseName());
@ -1518,13 +1618,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
}
distributionDeliveryListEntity.setWarehouseName(String.join(",", deliveryWarehouseName));
// distributionDeliveryListEntity.setOrderCode(String.join(",", orderNumber));
distributionDeliveryListEntity.setOrderNumber(orderTotal.get());
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get());
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
distributionDeliveryListEntity.setNoteNumber(deliveryListMa());
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
return R.status(true);
@ -1955,7 +2055,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Func.copy(distributionReservationDTO, reservationEntity);
reservationEntity.setWarehouseId(myCurrentWarehouse.getId());
//新建预约单为待确认状态
reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue());
reservationEntity.setReservationStatus(ReservationStatusConstant.yiqueren.getValue());
//新建预约单订单处于未备货状态
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.weibeihuo.getValue());
this.save(reservationEntity);
@ -2165,8 +2265,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
String random = Func.random(13, RandomType.ALL);
reservationEntity.setReservationCode(random);
reservationEntity.setReservationCode(reservationMa());
//设置预约为市配
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue());
reservationEntity.setReservationNum(packageTotal.get());
@ -2176,7 +2275,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String s = String.join(",", serviceNumber);
reservationEntity.setServiceNumber(s);
}
reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
// reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
reservationEntity.setOrderSource(ReservationOrderSourceConstant.zijian.getValue());
if (Func.isNotEmpty(distributionReservationDTO.getServeType())){
reservationEntity.setServeType(distributionReservationDTO.getServeType());

73
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -233,15 +233,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setPackageId(collect.get(0).getId());
distributionLoadscanEntity.setOrderPackageCode(distrilbutionloadingscanDTO.getBarcode());
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setReceivedQuantity(collect.get(0).getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setPackageNub(collect.get(0).getQuantity());
distributionLoadscanEntity.setOrderId(collect.get(0).getStockArticleId());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
@ -765,7 +771,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer aLong2 = 0;
distributionAppDeliveryListVO.setVehicleStatus_name("已配车");
distributionAppDeliveryListVO.setDeliStatus_name("配送中");
if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) {
if (distributionAppDeliveryListVO.getDeliveryStatus().equals("3")) {
distributionAppDeliveryListVO.setDeliStatus_name("完成");
}
if (distributionAppDeliveryListVO.getKind().equals("1")) {
@ -881,7 +887,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().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<Distribution
@Override
public List<DistributionReservationStocklistVO> signforInventoryList(Long signforId) {
List<DistributionReservationStocklistVO> distributionReservationStocklistVOS = distributionSignforMapper.selectInventory(signforId);
distributionReservationStocklistVOS.forEach(i->{
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>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<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>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;
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -681,7 +681,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if(collect.size() > 1){
stockArticleEntity.setWarehouseIdList(collect);
}else{
}else if(collect.size() == 1){
stockArticleEntity.setWarehouseId(collect.get(0));
}
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity);
@ -781,7 +781,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public DistributionStockArticleEntity findStockArticleByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) {
QueryWrapper<DistributionStockArticleEntity> 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<Distrib
@Override
public List<DistributionStockArticleEntity> findListByWaybillNumberAndWarehouseId(String waybillNumber, Long warehouseId) {
QueryWrapper<DistributionStockArticleEntity> 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);

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -383,6 +383,11 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return baseMapper.selectStockListInfoSelf(reservationId,stockListId);
}
@Override
public List<DistributionStockListEntity> getListByMarketIdAndMaterialName(Long marketId, String materialName, Long warehouseId) {
return baseMapper.getListByMarketIdAndMaterialName(marketId,materialName,warehouseId);
}
// @Override
// public R selectInventoryDetail(Map<String, Object> params, IPage<Object> page) {
// String reservationId = (String) params.get("reservationId");

6
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<DistributionSt
).intValue();
}
@Override
public DistributionStockAllocationVO selectAllocation(Long reservationId, Long stockupId, Long parcelListId) {
return baseMapper.selectAllocation(reservationId,stockupId,parcelListId);
}
}

349
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -39,12 +39,11 @@ import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsLogEntity;
import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CodeDesEnum;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.stocklist.StockLockingStatusConstant;
import org.springblade.common.constant.stocklist.StockSignfoStatusConstant;
@ -64,9 +63,13 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.xml.ws.BindingType;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* 备货信息表 服务实现类
@ -223,10 +226,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public IPage<DistributionStockupEntity> pageList(IPage<Object> page, Map<String, Object> distributionStockup) {
DistributionStockupEntity distributionStockupEntity = JSON.parseObject(JSON.toJSONString(distributionStockup), DistributionStockupEntity.class);
// //获取当前登录人仓库
// List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
// //取出id
// List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
//获取当前登录人仓库
distributionStockupEntity.setWarehouseId(myCurrentWarehouse.getId());
}else{
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
//取出id
List<Long> 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<Distribution
}
private static <T> Predicate<T> distinctByKey(Function<? super T,?> keyExtractor){
Map<Object,Boolean> map=new ConcurrentHashMap<>();
return t -> map.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null;
}
@Override
public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) {
@ -486,41 +500,237 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (stockupDTO.getTypeService().equals("3")) {
//查询客户数据 自
List<DistributionStockupOrderListVO> list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId);
//查询包件的库位的
if(!list.isEmpty()){
list.forEach( i ->{
if(ObjectUtils.isNull(i.getAllocationId())){
//查询包件信息
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>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<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());
Set<DistributionStockupOrderListVO> 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<DistributionStockupOrderListVO> 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<DistributionStockupOrderListVO> collect = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//不为空
// List<DistributionStockupOrderListVO> collect2 = collect.stream().filter(distinctByKey(person -> person.getAllocationId())).collect(Collectors.toList()); //去重
// List<DistributionStockupOrderListVO> collect1 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());//为空
//查询包件的库位的
return new ArrayList<>(listYou);
} else {
//商 市
//1.根据预约单id 查询到对应的数据
List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId);
return list;
List<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); //有货位
Set<DistributionStockupOrderListVO> 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<DistributionStockupOrderListVO> collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); //无货位
List<DistributionStockupOrderListVO> 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<DistributionStockupOrderListVO> collectYou = listLi.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//有
List<DistributionStockupOrderListVO> 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<Distribution
@Override
public DistributionStockupOrderInfoVO selectOrderInfo(StockupDTO stockupDTO) {
if(stockupDTO.getAllocation().equals("null")){
stockupDTO.setAllocation(null);
}
if(stockupDTO.getStockArticleId().contains(",")){
stockupDTO.setStockArticleIdList(stockupDTO.getStockArticleId().split(","));
stockupDTO.setStockArticleId(null);
}
//查询客户信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); //预约信息
//通过订单id和预约id,托盘信息查询对应的包件列表
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId());
List<PackageStockupVO> list = new ArrayList<>();
if(stockupDTO.getStatus().equals(1)){
//查询已下架的数据
list = distributionParcelListService.selectOrderInfoAllocationList(stockupDTO);
}else{
//没有下架
List<PackageStockupVO> 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<Distribution
while (iterator.hasNext()){
PackageStockupVO vo = iterator.next();
if(ObjectUtils.isNull(vo.getPositionCode()) || ObjectUtils.isNotNull(vo.getAllocationId()) && !vo.getAllocationId().equals(stockupDTO.getAllocationId()) ){
iterator.remove();
continue;
}
List<DistributionStockEntity> list1 = distributionStockService.list(Wrappers.<DistributionStockEntity>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<Distribution
public DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO) {
DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockupDTO.getStockArticleId());
if(stockupDTO.getStatus().equals(1)){
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId())
);
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillOverPackWuSelf(stockupDTO);
// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
QueryWrapper<DistributionParcelListEntity> 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<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
List<PackageStockupVO> 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<Distribution
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO();
if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){
//查询订单数量 有库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId(),stockupDTO.getAllocationId());
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO);
}else{
//查询订单数量 无库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
}
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId());
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO);
Iterator<PackageStockupVO> iterator = list.iterator();
if(Objects.isNull(stockupDTO.getAllocationId())){
@ -706,7 +942,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
iterator.remove();
continue;
}
if (ObjectUtils.isNotNull(next.getIsScan())) {
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) {
next.setIsScanStr("已备货");
next.setIsScan(2);
} else {
@ -721,7 +957,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
iterator.remove();
continue;
}
if (ObjectUtils.isNotNull(next.getIsScan())) {
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) {
next.setIsScanStr("已备货");
next.setIsScan(2);
} else {
@ -1106,13 +1342,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 1:
//订单
String orderCode = stockupDTO.getOrderCode();
if(stockupDTO.getOrderCode().contains(",")){
stockupDTO.setOrderCodeList(stockupDTO.getOrderCode().split(","));
stockupDTO.setOrderCode(null);
}
String packetBarCode = stockupDTO.getPacketBarCode();
Integer integer = baseMapper.selectPackageExist(stockupDTO);
if (ObjectUtils.isNotNull(integer) && integer > 0) {
//存在
List<DistributionStockEntity> list = distributionStockService.list(Wrappers.<DistributionStockEntity>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)
);

15
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<Distrilbu
}
/**
* @param reservationId
* @param stockupId
* @param allocationId
* @return
* @param stockupDTO@return
*/
@Override
public DistributionStockupSelfVO selectDistrilbutionBillPackSelf(Long reservationId, Long stockupId, Long allocationId) {
return baseMapper.selectDistrilbutionBillPackSelf(reservationId,stockupId,allocationId);
public DistributionStockupSelfVO selectDistrilbutionBillPackSelf(StockupDTO stockupDTO) {
return baseMapper.selectDistrilbutionBillPackSelf(stockupDTO);
}
@Override
@ -103,4 +101,9 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
return baseMapper.selectDistrilbutionBillPackWuSelf(reservationId,stockupId);
}
@Override
public DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(StockupDTO stockupDTO) {
return baseMapper.selectDistrilbutionBillOverPackWuSelf(stockupDTO);
}
}

18
blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java

@ -42,14 +42,16 @@ public class MyTest {
@Test
public void te(){
Map<String, Object> params = new HashMap<>();
params.put("ids","1686560469635727362");
try {
OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params);
System.out.println(orderPackgeCodeDataVO);
} catch (Exception e) {
e.printStackTrace();
}
// Map<String, Object> params = new HashMap<>();
// params.put("ids","1686560469635727362");
// try {
// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params);
// System.out.println(orderPackgeCodeDataVO);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch(ids,type);
}
}

30
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<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch("1703958397055135745", 1);
distributionDeliveryListService.testData("1703958397055135745");
System.out.println(111111);
}
}

10
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;
}

35
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;
}

75
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<MtPackageInfo> 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<MtPackageInfo> 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());
}

2
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"]

40
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){

34
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){

35
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<WarehouseGoodsAllocationVO> 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<WarehouseCargoSumVO> 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);
}
/**
* 导出数据
*/

1
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;//批次号

6
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);
}
}

6
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}
</select>
@ -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}
</select>
@ -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}
</select>
<select id="getNumByZation" resultType="java.lang.Integer">

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.excel.WarehouseGoodsAllocationExcel;
import com.logpm.warehouse.vo.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
@ -110,4 +111,8 @@ public interface IWarehouseGoodsAllocationService extends BaseService<WarehouseG
* 货位 统计每个货区数量
*/
List<WarehouseCargoSumVO> selectcargoNub();
/**
* 更新货位 缓存
*/
Boolean updateAllocationCache(String ids);
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -82,4 +82,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R moveTrayScanPackage(String orderPackageCode,String trayCode,Long warehouseId);
R moveTrayPackages(List<Long> trayGoodsIds,String trayCode);
R selectStockByMaterialNameAndMarketId(Long marketId, String materialName, Long warehouseId);
}

69
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

@ -38,6 +38,8 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
@ -56,12 +58,16 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<WarehouseGoodsAllocationMapper, WarehouseGoodsAllocationEntity> implements IWarehouseGoodsAllocationService {
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IWarehouseTrayGoodsService warehouseTrayGoodsService;
private final BladeRedis bladeRedis;
private static String Url = "warehouseGoodsAllocation";
@Override
public IPage<WarehouseGoodsAllocationVO> selectWarehouseGoodsAllocationPage(IPage<WarehouseGoodsAllocationVO> page, WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
@ -100,21 +106,9 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
// if (!map.containsKey(layerNum)) {
// map.put(layerNum, new ArrayList<>());
// }
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = new WarehouseGoodsAllocationVO();
Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO);
//查询数量
WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum());
warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum());
warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum());
warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum());
//查询包条信息
List<WarehouseVisualizationVO> list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setServeNub(list);
//查询库存品
List<WarehouseMaterialEntity>listCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setInventoryName(listCopyVOS);
// map.get(layerNum).add(warehouseGoodsAllocationVO);
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
log.info("List>>>>>>>>>>>>>>>>>{}",warehouseGoodsAllocationVO);
// map.get(layerNum).add(warehouseGoodsAllocationVO);
warehouseGoodsAllocationVOS.add(warehouseGoodsAllocationVO);
}
// ArrayList<List<WarehouseGoodsAllocationVO>> arrayListTwo = new ArrayList<>(map.values());
@ -357,6 +351,31 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return list;
}
@Override
public Boolean updateAllocationCache(String ids) {
//查询货位
List<WarehouseGoodsAllocationEntity> warehouseGoodsAllocationEntities = baseMapper.selectList(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted,0)
.in(WarehouseGoodsAllocationEntity::getId,ids)
);
for (WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity : warehouseGoodsAllocationEntities) {
if (null != bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId())) {
//转换当前货位的信息
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
List<WarehouseGoodsAllocationVO> warehouseGoodsAllocationVOList = bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId());
//替换货位
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream()
.map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj)
.collect(Collectors.toList());
//重新存入缓存
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocationEntity.getGoodsShelfId(), warehouseGoodsAllocationVOList, 600L);
log.info("货位缓存更新成功");
}
}
return true;
}
public List<Long> getMyWatchWarehouseIds(){
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
@ -366,4 +385,22 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return collect;
}
public WarehouseGoodsAllocationVO convert(WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity){
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = new WarehouseGoodsAllocationVO();
Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO);
//查询数量
WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum());
warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum());
warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum());
warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum());
//查询包条信息
List<WarehouseVisualizationVO> list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setServeNub(list);
//查询库存品
List<WarehouseMaterialEntity>listCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setInventoryName(listCopyVOS);
return warehouseGoodsAllocationVO;
}
}

33
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -673,7 +673,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
IPage<WarehouseTrayTypeVO> warehouseTrayTypeVOIPage = WarehouseTrayTypeWrapper.build().pageVO(pageList);
List<WarehouseTrayTypeVO> records = warehouseTrayTypeVOIPage.getRecords();
for (WarehouseTrayTypeVO warehouseTrayTypeVO:records){
String value = DictBizCache.getValue(DictBizConstant.PALLET_STOCK_TYPE, warehouseTrayTypeVO.getTrayType());
String value = DictBizCache.getValue(DictBizConstant.PALLET_ZERO_TYPE, warehouseTrayTypeVO.getTrayType());
warehouseTrayTypeVO.setTrayTypeName(value);
}
warehouseTrayTypeVOIPage.setRecords(records);
@ -755,7 +755,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String orderCode = zeroOrderVO.getOrderCode();//订单自编码
Long orderId = zeroOrderVO.getOrderId();
Integer num = zeroOrderVO.getNum();
if(num == 0){
if(num == 0 || Objects.isNull(num)){
log.warn("#########enterZeroOrderByTrayCode: 请输入正确的数量 orderCode={} num={}",orderCode,num);
return R.fail(403,"请输入正确的数量");
}
@ -1951,6 +1951,35 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return Resp.scanSuccess("移托成功","成功移托"+allNum+"件");
}
@Override
public R selectStockByMaterialNameAndMarketId(Long marketId, String materialName, Long warehouseId) {
List<StockListVO> ls = new ArrayList<>();
//根据商场id和物料编码查询对应的库存品
List<DistributionStockListEntity> stockListEntityList = distributionStockListClient.getListByMarketIdAndMaterialName(marketId, materialName,warehouseId);
if(Objects.isNull(stockListEntityList) || stockListEntityList.size() == 0){
log.warn("################selectStockByMaterialNameAndMarketId: 库存品不存在 marketId={} materialName={}",marketId,materialName);
return R.fail(403,"库存品不存在");
}
for(DistributionStockListEntity stockListEntity:stockListEntityList){
StockListVO stockListVO = new StockListVO();
BeanUtil.copy(stockListEntity,stockListVO);
Integer quantityStock = stockListEntity.getQuantityStock();//在数量
String incomingBatch = stockListEntity.getIncomingBatch();
String cargoNumber = stockListEntity.getCargoNumber();
List<PositionVO> updownGoodsByStock = warehouseUpdownGoodsService.getUpdownGoodsByStock(marketId,cargoNumber,incomingBatch);
List<PositionVO> traynGoodsByStock = warehouseTrayGoodsService.getTrayGoodsByStockNoAllocationId(marketId,cargoNumber,incomingBatch);
updownGoodsByStock.addAll(traynGoodsByStock);
for (PositionVO positionVO:updownGoodsByStock){
Integer num = positionVO.getNum();
quantityStock = quantityStock - num;
}
stockListVO.setQuantityStock(quantityStock);
stockListVO.setPositionList(updownGoodsByStock);
ls.add(stockListVO);
}
return R.data(ls);
}
private R moveTrayOrderPackageCode(WarehouseTrayTypeEntity trayTypeEntity, String orderPackageCode) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(orderPackageCode);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1106,7 +1106,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//1物料编码
String materialCode = code;
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",materialCode)
queryWrapper.like("association_value",materialCode)
.eq("market_id",marketId);
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
return R.data(list);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -110,7 +110,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
List<Long> detailEntityList = new ArrayList<>();
List<WarehouseWarehousingDetailEntity> list1 = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
.apply("conditions in ( 1,2) ")
.apply("conditions in (1,2) ")
);//查询不是确定的数据
if(list1.size() > 0){
AtomicReference<Integer> num = new AtomicReference<>(0);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

@ -42,7 +42,9 @@ public class WarehouseStockVOWrapper extends BaseEntityWrapper<WarehouseScanReco
@Override
public WarehouseScanRecordVO entityVO(WarehouseScanRecordVO WarehouseStock) {
if (null != WarehouseStock.getOperatorId() && 0 !=WarehouseStock.getOperatorId()){
WarehouseStock.setOperatorName(userCliient.userInfoById(WarehouseStock.getOperatorId()).getData().getName());
}
WarehouseStock.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, WarehouseStock.getOrderPackageStatus()));
WarehouseStock.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, WarehouseStock.getOrderPackageFreezeStatus()));
WarehouseStock.setOrderPackageGroundingStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_GROUNDING_STATUS, WarehouseStock.getOrderPackageGroundingStatus()));

Loading…
Cancel
Save