Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 1 year ago
parent
commit
cbba8e66c8
  1. 8
      blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java
  2. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java
  3. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesDecreaseImageEntity.java
  4. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java
  5. 10
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  6. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java
  7. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java
  8. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  9. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java
  10. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  11. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  12. 14
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java
  13. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java
  14. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java
  15. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  16. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java
  17. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLineEntity.java
  18. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java
  19. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingPackageVO.java
  20. 12
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java
  21. 10
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestDetailVO.java
  22. 29
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/RetentionReservationVO.java
  23. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionRecordVO.java
  24. 11
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionScanVO.java
  25. 6
      blade-service/logpm-aftersales/pom.xml
  26. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesExchangeController.java
  27. 32
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  28. 18
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java
  29. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  30. 15
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  31. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesExchangeService.java
  32. 11
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  33. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesExchangeServiceImpl.java
  34. 126
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  35. 22
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  36. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  37. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  38. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java
  39. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  40. 74
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  41. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  42. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  43. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  44. 64
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  45. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml
  46. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  47. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java
  48. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  49. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  50. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  51. 96
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  52. 362
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  53. 60
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  54. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  55. 4
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
  56. 1
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java
  57. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  58. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java
  59. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml
  60. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java
  61. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java
  62. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  63. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  64. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java
  65. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java
  66. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  67. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.java
  68. 124
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml
  69. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  70. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  71. 69
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  72. 142
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  73. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

8
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_2("配载计划打印模板","2"),
daiqueren_3("运单票据打印模板","3"),
daiqueren_4("托运单模板","4"),
@ -19,9 +19,9 @@ public enum PrintTemplateStatusConstant {
daiqueren_9("货架码模板","9"),
daiqueren_10("包件模板","10"),
daiqueren_11("库存品包件模板","11"),
daiqueren_12("配送任务打印模板-商配","12");
daiqueren_12("配送任务打印模板-商配","12"),
peisongtask_ziti("配送任务打印模板-自提","13"),
daiqueren_1("配送任务打印模板-市配","1");
/**
* 状态
*/

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java

@ -65,7 +65,7 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
* 异常ID
*/
@ApiModelProperty(value = "异常ID")
private String workOrderId;
private Long workOrderId;
/**
* 数量
*/
@ -80,7 +80,7 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
/**
* 包件图片路径
*/

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesDecreaseImageEntity.java

@ -65,7 +65,7 @@ public class AftersalesDecreaseImageEntity extends TenantEntity {
* 异常工单Id
*/
@ApiModelProperty(value = "异常工单Id")
private String workOrderId;
private Long workOrderId;
/**
* 图片类型
*/
@ -85,6 +85,6 @@ public class AftersalesDecreaseImageEntity extends TenantEntity {
* 仓库id
*/
@ApiModelProperty(value = "仓库id")
private String warehouseId;
private Long warehouseId;
}

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java

@ -75,7 +75,7 @@ public class AftersalesProcessorEntity extends TenantEntity {
* 异常工单ID
*/
@ApiModelProperty(value = "异常工单ID")
private String workOrderId;
private Long workOrderId;
/**
* 状态
*/
@ -90,6 +90,6 @@ public class AftersalesProcessorEntity extends TenantEntity {
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
}

10
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -17,6 +17,7 @@
package com.logpm.aftersales.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -115,16 +116,19 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 送货时间
*/
@ApiModelProperty(value = "送货时间")
@JsonFormat(locale = "zh" ,timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date deliverGoodsTime;
/**
* 发现时间 库内作业环节,配送装车环节
*/
@ApiModelProperty(value = "发现时间 (库内作业环节,配送装车环节)")
@JsonFormat(locale="zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date discoveryTime;
/**
* 入库时间库内作业环节
*/
@ApiModelProperty(value = "入库时间(库内作业环节)")
@JsonFormat(locale="zh",timezone ="GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date warehousingTime;
/**
* 运单商场
@ -140,6 +144,7 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 配送时间(配送装车环节)
*/
@ApiModelProperty(value = "配送时间(配送装车环节)")
@JsonFormat(locale = "zh" ,timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss" )
private Date deliveryTime;
/**
* 配送司机(配送装车环节)
@ -170,6 +175,7 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 完结时间
*/
@ApiModelProperty(value = "完结时间")
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date overTime;
/**
* 异常问题描述
@ -180,7 +186,7 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
/**
* 责任人 库内作业环节
*/
@ -200,11 +206,13 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 审核时间
*/
@ApiModelProperty(value = "审核时间")
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
/**
* 财务入账时间
*/
@ApiModelProperty(value = "财务入账时间")
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date entryTime;
/**
* 操作人

6
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@ -38,8 +39,9 @@ import java.util.Date;
@ApiModel(value = "WarehouseWarehouse对象", description = "仓库")
@EqualsAndHashCode(callSuper = true)
public class BasicdataWarehouseEntity extends TenantEntity {
/**
@TableField(exist = false)
public Object var;
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java

@ -268,6 +268,13 @@ public class DistributionDeliveryListEntity extends TenantEntity {
@TableField(exist = false)
private String clineName;
/**
* 签收件数
*/
@ApiModelProperty(value = "客户名称")
@TableField(exist = false)
private Integer signingNumber;

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -25,14 +25,14 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 库存品详情信息 实体类
* PAD备货扫描记录 实体类
*
* @author cyz
* @since 2023-06-26
*/
@Data
@TableName("logpm_distribution_stock")
@ApiModel(value = "DistributionStock对象", description = "库存品详情信息")
@ApiModel(value = "DistributionStock对象", description = "PAD备货扫描记录")
@EqualsAndHashCode(callSuper = true)
public class DistributionStockEntity extends TenantEntity {

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java

@ -82,6 +82,9 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
*/
@ApiModelProperty(value = "提货人")
private String consignee;
@ApiModelProperty(value = "提货人电话")
private String consigneePhone;
/**
* 提货车牌
*/
@ -116,7 +119,6 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
private Map<String,String> fei;
@ApiModelProperty(value = "提货状态")
private String conditions; //提货状态
@ -129,6 +131,9 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
@ApiModelProperty(value = "仓库Id")
private Long warehouseId;
@ApiModelProperty(value = "备注")
private String remark;

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -97,6 +97,9 @@ public interface IDistributionDeliveryListClient {
@GetMapping(TOP+"/retentionDeliveryReservationZeroPackage")
boolean retentionDeliveryReservationZeroPackage(@RequestParam("deliveryId")Long deliveryId,@RequestParam("reservationId") Long reservationId,@RequestParam("orderPackageId") Long orderPackageId, @RequestParam("retentionQuantity")Integer retentionQuantity, @RequestParam("orderId")Long orderId);
@GetMapping(TOP+"/getRetentionDelivery")
DistributionDeliveryListVO getRetentionDelivery(@RequestParam("deliveryId")Long deliveryId);
// /**
// * 根据配送任务ID查询配送司机信息

11
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -18,6 +18,7 @@ package com.logpm.distribution.feign;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
@ -25,6 +26,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 预约列表 Feign接口类
*
@ -49,4 +52,12 @@ public interface IDistributionReservationClient {
@GetMapping(TOP)
BladePage<DistributionReservationEntity> reservationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 查询预约信息
* @param reservationIds
* @return
*/
@GetMapping(TOP+"/getReservationList")
List<DistributionReservationEntity> getReservationList(@RequestParam("reservationIds") String reservationIds);
}

14
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java

@ -84,5 +84,19 @@ public class DistributionRetentionScanVo {
*/
private String trainNumber;
/**
* 运单号
*/
private String waybillNumber;
/**
* 运单号
*/
private Long waybillId;
/**
* 零担滞留最大数
*/
private Integer maxQuantity;
}

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java

@ -79,6 +79,18 @@ public class DistributionSigndetailVO extends DistributionSigndetailEntity {
@ApiModelProperty(value = "订单自编号")
private String orderCode;
/**
* 司机名称
*/
@ApiModelProperty(value = "司机名称")
private String driverName;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private String vehicleName;
/**
* 签收数
*/

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java

@ -20,10 +20,10 @@ public class BillladingDTO extends TrunklineBillladingEntity {
private Integer type;//1开始提货 2提货完成 3取消完成
private String billladingCode;//批次号
private String driverName;//司机名称
private String driverPhone;//司机电话
private String carNumber;//车牌号
// private String billladingCode;//批次号
// private String driverName;//司机名称
// private String driverPhone;//司机电话
// private String carNumber;//车牌号
private String waybillNo;//运单号
private String orderPackageCode;//包件码
private String orderCode;//订单号

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -8,6 +8,7 @@ import java.io.Serializable;
public class LoadCarsDTO implements Serializable {
private Long loadId;
private String nodeType;
private Integer pageNum;
private Integer pageSize;
@ -16,4 +17,6 @@ public class LoadCarsDTO implements Serializable {
private Long warehouseId;
private Integer startCarType;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java

@ -105,6 +105,7 @@ public class TrunklineCarsLoadEntity extends TenantEntity {
@ApiModelProperty(name = "配载类型 配载类型:1=干线类型,2=支线类型,3=专车类型,4=外部中转,5=外围路线",notes = "")
private String loadType ;
/** 批次状态:1=已装车,2=已发车,-2=取消发车,3=网点到达,4=网点发车,5=终点到达,6=已卸车,7=已出库,8=已签收,9=出库到达 */
//0 未发车 10已发车 20网点到车 30网点发车
@ApiModelProperty(name = "批次状态:1=已装车,2=已发车,-2=取消发车,3=网点到达,4=网点发车,5=终点到达,6=已卸车,7=已出库,8=已签收,9=出库到达",notes = "")
private String loadStatus ;
/** 车辆满载率 */

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLineEntity.java

@ -53,7 +53,7 @@ public class TrunklineCarsLoadLineEntity extends TenantEntity {
@ApiModelProperty(name = "联系人地址",notes = "")
private String linkAddress ;
/** 节点状态 0未到达 1已到达 */
@ApiModelProperty(name = "节点状态 0未到达 1已到达",notes = "")
@ApiModelProperty(name = "节点状态 0未到达 10到车 11取消",notes = "")
private String nodeStatus ;
/** 排序 */
@ApiModelProperty(name = "排序",notes = "")

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java

@ -55,5 +55,8 @@ public class TrunklineCarsOrderEntity extends TenantEntity {
/** 计划件数 */
@ApiModelProperty(name = "计划件数",notes = "")
private Integer planNum ;
/** 是否是直发商家 0否 1是 */
@ApiModelProperty(name = "是否是直发商家 0否 1是",notes = "")
private String isCustomer ;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingPackageVO.java

@ -13,7 +13,6 @@ public class TrunklineBillladingPackageVO extends TrunklineBillladingPackageEnti
private String waybillNo;//运单号
private String orderCode;//订单号
private String destination;//到站
private Integer incomingType;//入库类型
private String trayName;//托盘名称
private String trayCode;//托盘编码
private String firstPickName;//一级品类

12
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java

@ -229,4 +229,16 @@ public class WarehouseRetentionScanEntity extends TenantEntity {
@ApiModelProperty(value = "取消状态 0-否 1-是")
private String cancelRetentionStatus;
/**
* 运单号
*/
@ApiModelProperty(value = "运单号")
private String waybillNumber;
/**
* 运单Id
*/
@ApiModelProperty(value = "运单Id")
private Long waybillId;
}

10
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestDetailVO.java

@ -84,6 +84,16 @@ public class QuestDetailVO extends QuestDetailEntity {
*/
@ApiModelProperty(value = "品牌")
private String brandName;
/**
* 盘点对象;1.定制品 2零担 3 库存品
*/
@ApiModelProperty(value = "盘点对象;1.定制品 2零担 3 库存品")
private Integer questTarget;
/**
* 在库数量
*/
@ApiModelProperty(value = "在库数量")
private Integer stockNum;
/**
* 一级品

29
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/RetentionReservationVO.java

@ -0,0 +1,29 @@
package com.logpm.warehouse.vo;
import lombok.Data;
/**
* 滞留预约信息
*/
@Data
public class RetentionReservationVO {
/**
* 预约ID
*/
private Long reservationId;
/**
* 预约单号
*/
private String reservationCode;
// //客户名称
// private String reservationId;
//
// //客户地址
// private String reservationId;
//
// //客户电话
// private String reservationId;
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionRecordVO.java

@ -16,6 +16,8 @@
*/
package com.logpm.warehouse.vo;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -38,4 +40,8 @@ public class WarehouseRetentionRecordVO extends WarehouseRetentionRecordEntity {
private String retentionTypeName;
private List<DistributionReservationEntity> reservationEntityList;
private DistributionDeliveryListVO deliveryListVO;
}

11
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionScanVO.java

@ -31,4 +31,15 @@ import lombok.EqualsAndHashCode;
public class WarehouseRetentionScanVO extends WarehouseRetentionScanEntity {
private static final long serialVersionUID = 1L;
/**
* 滞留方式
*/
private String retentionWayName;
/**
* 货物类型
*/
private String scanTypeName;
}

6
blade-service/logpm-aftersales/pom.xml

@ -39,6 +39,12 @@
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesExchangeController.java

@ -118,7 +118,7 @@ public class AftersalesExchangeController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersalesExchange")
public R submit(@Valid @RequestBody AftersalesExchangeEntity aftersalesExchange) {
return R.status(aftersalesExchangeService.saveOrUpdate(aftersalesExchange));
return R.status(aftersalesExchangeService.ownSaveOrUpdate(aftersalesExchange));
}
/**

32
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -16,6 +16,10 @@
*/
package com.logpm.aftersales.controller;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -23,6 +27,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -55,9 +60,11 @@ import javax.servlet.http.HttpServletResponse;
@AllArgsConstructor
@RequestMapping("/aftersalesWorkOrder")
@Api(value = "客服异常工单", tags = "客服异常工单接口")
@Slf4j
public class AftersalesWorkOrderController extends BladeController {
private final IAftersalesWorkOrderService aftersalesWorkOrderService;
private final IBasicdataWarehouseClient warehouseClient;
/**
* 客服异常工单 详情
@ -76,6 +83,10 @@ public class AftersalesWorkOrderController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入aftersalesWorkOrder")
public R<IPage<AftersalesWorkOrderVO>> list(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, Query query) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
}
IPage<AftersalesWorkOrderEntity> pages = aftersalesWorkOrderService.page(Condition.getPage(query), Condition.getQueryWrapper(aftersalesWorkOrder, AftersalesWorkOrderEntity.class));
return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
}
@ -117,10 +128,29 @@ public class AftersalesWorkOrderController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersalesWorkOrder")
public R submit(@Valid @RequestBody AftersalesWorkOrderEntity aftersalesWorkOrder) {
public R submit(@Valid @RequestBody AftersalesWorkOrderDTO aftersalesWorkOrder) {
log.info("工单创建的数据{}",aftersalesWorkOrder.toString());
return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder));
}
/**
* 客服异常工单 仓库查询待处理的异常工单
*/
@GetMapping("/pendingWorkOrder")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "仓库查询待处理的异常工单", notes = "传入aftersalesWorkOrder")
public R getPendingWorkOrder(AftersalesWorkOrderDTO aftersalesWorkOrder,Query query) {
log.info("工单创建的数据{}",aftersalesWorkOrder.toString());
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.setWarehouseId(myCurrentWarehouse.getId());
}
IPage<AftersalesWorkOrderVO> list= aftersalesWorkOrderService.getPendingWorkOrder(aftersalesWorkOrder,Condition.getPage(query));
return R.data(list);
}
/**
* 客服异常工单 删除
*/

18
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java

@ -16,10 +16,12 @@
*/
package com.logpm.aftersales.dto;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.entity.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 客服异常工单 数据传输对象实体类
*
@ -30,5 +32,19 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity {
private static final long serialVersionUID = 1L;
/**
* 包件
*/
private List<AftersalesAbnormalPackageEntity> packageEntityList;
/**
* 责任方和处理方
*/
private List<AftersalesProcessorEntity> processorEntityList;
/**
* 货损图片
*/
private List<AftersalesDecreaseImageEntity> decreaseImageEntityList;
}

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java

@ -16,6 +16,7 @@
*/
package com.logpm.aftersales.mapper;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
@ -51,4 +52,11 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
*/
List<AftersalesWorkOrderExcel> exportAftersalesWorkOrder(@Param("ew") Wrapper<AftersalesWorkOrderEntity> queryWrapper);
/**
* 查询待处理的异常工单数据
* @param page
* @param aftersalesWorkOrder
* @return
*/
IPage<AftersalesWorkOrderVO> getPendingWorkOrder(IPage<Object> page,@Param("param") AftersalesWorkOrderDTO aftersalesWorkOrder);
}

15
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -60,4 +60,19 @@
SELECT * FROM logpm_aftersales_work_order ${ew.customSqlSegment}
</select>
<select id="getPendingWorkOrder" resultType="com.logpm.aftersales.vo.AftersalesWorkOrderVO">
select law.id,law.work_order_type, law.initiation_identification,law.discovery_node,law.work_order_number,law.waybill_number,law.order_code, law.train_number, law.first,
law.secondary, law.vehicle_route,law.deliver_goods_time, law.discovery_time, law.warehousing_time, law.waybill_mall,law.remarks, law.delivery_time,law.delivery_driver
,law.work_order_status, law.customer_service_id, law.customer_service_name,law.waybill_mall_id,law.over_time, law.problem_description,law.warehouse_id, law.person_responsible,
law.process_number, law.reviewed_by, law.audit_time, law.entry_time, law.operator
from logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law on lap.work_order_id = law.id
<where>
lap.conditions != '3' and lap.is_deleted = 0
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.work_order_status}</if>
<if test="param.warehouseId != null and param.warehouseId != ''">and lap.business_id = #{param.warehouseId}</if>
</where>
</select>
</mapper>

6
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesExchangeService.java

@ -49,4 +49,10 @@ public interface IAftersalesExchangeService extends BaseService<AftersalesExchan
*/
List<AftersalesExchangeExcel> exportAftersalesExchange(Wrapper<AftersalesExchangeEntity> queryWrapper);
/**
* 添加或修改聊天记录
* @param aftersalesExchange
* @return
*/
boolean ownSaveOrUpdate(AftersalesExchangeEntity aftersalesExchange);
}

11
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -17,6 +17,7 @@
package com.logpm.aftersales.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
@ -54,5 +55,13 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param aftersalesWorkOrder
* @return
*/
boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder);
boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder);
/**
* 查询待处理的异常工单数据
* @param aftersalesWorkOrder
* @param page
* @return
*/
IPage<AftersalesWorkOrderVO> getPendingWorkOrder(AftersalesWorkOrderDTO aftersalesWorkOrder, IPage<Object> page);
}

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesExchangeServiceImpl.java

@ -51,4 +51,14 @@ public class AftersalesExchangeServiceImpl extends BaseServiceImpl<AftersalesExc
return aftersalesExchangeList;
}
/**
* 添加或修改数据记录
* @param aftersalesExchange
* @return
*/
@Override
public boolean ownSaveOrUpdate(AftersalesExchangeEntity aftersalesExchange) {
return false;
}
}

126
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -17,16 +17,38 @@
package com.logpm.aftersales.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesAbnormalPackageEntity;
import com.logpm.aftersales.entity.AftersalesDecreaseImageEntity;
import com.logpm.aftersales.entity.AftersalesProcessorEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.service.IAftersalesAbnormalPackageService;
import com.logpm.aftersales.service.IAftersalesDecreaseImageService;
import com.logpm.aftersales.service.IAftersalesProcessorService;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper;
import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.SimpleFormatter;
/**
* 客服异常工单 服务实现类
@ -35,8 +57,17 @@ import java.util.List;
* @since 2023-11-17
*/
@Service
@Slf4j
@AllArgsConstructor
public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWorkOrderMapper, AftersalesWorkOrderEntity> implements IAftersalesWorkOrderService {
private final IAftersalesAbnormalPackageService aftersalesAbnormalPackageService;
private final IAftersalesDecreaseImageService aftersalesDecreaseImageService;
private final IAftersalesProcessorService aftersalesProcessorService;
private final IBasicdataWarehouseClient warehouseClient;
@Override
public IPage<AftersalesWorkOrderVO> selectAftersalesWorkOrderPage(IPage<AftersalesWorkOrderVO> page, AftersalesWorkOrderVO aftersalesWorkOrder) {
return page.setRecords(baseMapper.selectAftersalesWorkOrderPage(page, aftersalesWorkOrder));
@ -52,22 +83,113 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return aftersalesWorkOrderList;
}
/**
* 生成异常工单号
* @return
*/
public String getWorkOrderNumber(String name) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
return "YC"+name+format.format(new Date());
}
/**
* 添加或修改
* @param aftersalesWorkOrder
* @return
*/
@Override
public boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder) {
@Transactional(rollbackFor = Exception.class)
public boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!!");
}
BladeUser user = AuthUtil.getUser();
if(ObjectUtils.isNull(aftersalesWorkOrder.getId())){
//新增
return baseMapper.insert(aftersalesWorkOrder) > 0 ? true : false;
aftersalesWorkOrder.setInitiationIdentification("PC");
aftersalesWorkOrder.setCreateUser(user.getUserId());
aftersalesWorkOrder.setCreateTime(new Date());
aftersalesWorkOrder.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesWorkOrder.setIsDeleted(0);
aftersalesWorkOrder.setStatus(1);
if(ObjectUtils.isNull(aftersalesWorkOrder.getWorkOrderNumber())){
aftersalesWorkOrder.setWorkOrderNumber(getWorkOrderNumber(myCurrentWarehouse.getWarehouseCode()));
}
baseMapper.insert(aftersalesWorkOrder);
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getPackageEntityList())){
//包件信息
List<AftersalesAbnormalPackageEntity> list = new ArrayList<>();
aftersalesWorkOrder.getPackageEntityList().stream().forEach(i ->{
AftersalesAbnormalPackageEntity packageEntity = new AftersalesAbnormalPackageEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesAbnormalPackageService.saveBatch(list);
}
}
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getDecreaseImageEntityList())){
//货损图片
List<AftersalesDecreaseImageEntity> list = new ArrayList<>();
aftersalesWorkOrder.getDecreaseImageEntityList().stream().forEach(i ->{
AftersalesDecreaseImageEntity packageEntity = new AftersalesDecreaseImageEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesDecreaseImageService.saveBatch(list);
}
}
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getProcessorEntityList())){
//责任方 处理方
List<AftersalesProcessorEntity> list = new ArrayList<>();
aftersalesWorkOrder.getProcessorEntityList().stream().forEach(i ->{
AftersalesProcessorEntity packageEntity = new AftersalesProcessorEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setConditions("1");//正常
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesProcessorService.saveBatch(list);
}
}
return true;
}else{
//修改
return baseMapper.updateById(aftersalesWorkOrder) > 0 ? true : false;
}
}
/**
* 查询待处理的异常工单数据
* @param aftersalesWorkOrder
* @param page
* @return
*/
@Override
public IPage<AftersalesWorkOrderVO> getPendingWorkOrder(AftersalesWorkOrderDTO aftersalesWorkOrder, IPage<Object> page) {
IPage<AftersalesWorkOrderVO> list = baseMapper.getPendingWorkOrder(page,aftersalesWorkOrder);
return list;
}
}

22
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -154,6 +154,16 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (ObjectUtils.isNull(basicdataClient.getPid())) {
basicdataClient.setPid(0L);
}
//查询客户编码和客户名称是否存在
BasicdataClientEntity basicdataClient1 = baseMapper.selectOne(Wrappers.<BasicdataClientEntity>query().lambda()
.eq(BasicdataClientEntity::getClientCode, basicdataClient.getClientCode())
.or()
.eq(BasicdataClientEntity::getClientName, basicdataClient.getClientName())
);
if(ObjectUtils.isNotNull(basicdataClient1)){
throw new ServiceException("客户编码或客户名称已存在");
}
//添加
this.save(basicdataClient);
// //绑定客户账号和客户关系
@ -291,6 +301,8 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
List<DictBiz> clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工
List<DictBiz> freightBiz = DictBizCache.getList(DictBizConstant.BASIC_FREIGHT_TYPE); //客 工
Set<String> set =new HashSet<>();
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
for (BasicdataClientExcel i : data) {
log.info("导入数据《》《》{}",i);
if(set.isEmpty()){
@ -301,10 +313,18 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
continue;
}
}
if(ObjectUtils.isNull(i.getClientCode()) || ObjectUtils.isNull(i.getClientName())){
throw new ServiceException("客户编码或客户名称不能为空!");
}
BasicdataClientEntity basicdataClient = new BasicdataClientEntity();
BeanUtil.copyProperties(i,basicdataClient);
//查询客户编码和客户名称是否存在
boolean b = basicdataClients.stream().anyMatch(ii -> ii.getClientCode().equals(basicdataClient.getClientCode())
|| ii.getClientName().equals(basicdataClient.getClientName()));
if(b){
throw new ServiceException("客户编码或客户名称已存在");
}
// Optional<DictBiz> first = dictBizs.stream().filter(ii -> ii.getDictValue().equals(i.getTypeService())).findFirst();
Optional<DictBiz> clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst();
// i.setTypeService(first.get().getDictValue());

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

@ -285,6 +285,9 @@ public class DistrilbutionBillLadingController extends BladeController {
}
/**
* 导出数据
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -76,5 +76,11 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
return distributionDeliveryListService.retentionDeliveryReservationZeroPackage(deliveryId,reservationId,orderPackageId,retentionQuantity,orderId);
}
@Override
public DistributionDeliveryListVO getRetentionDelivery(Long deliveryId) {
return distributionDeliveryListService.getRetentionDelivery(deliveryId);
}
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java

@ -24,10 +24,13 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 预约列表 Feign实现类
*
@ -51,6 +54,10 @@ public class DistributionReservationClient implements IDistributionReservationCl
return BladePage.of(page);
}
@Override
public List<DistributionReservationEntity> getReservationList(String reservationIds) {
return reservationService.getRetentionReservationList(reservationIds);
}
}

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

@ -453,4 +453,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
SignPushDataDTO selectPushOldDelivery(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId);
/**
* 查询滞留的配送任务信息
* @param deliveryId
* @return
*/
DistributionDeliveryListVO selectDeliveryById(Long deliveryId);
}

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

@ -188,6 +188,13 @@
WHERE
lddl.id = lds.delivery_id
) scannedNumber,
(SELECT
COALESCE (sum(lds.received_quantity), 0)
FROM
logpm_distribution_signfor lds
WHERE
lddl.id = lds.delivery_id
) signingNumber,
GROUP_CONCAT(DISTINCT ldr.consignee SEPARATOR ',') clineName
FROM logpm_distribution_delivery_list lddl
left JOIN logpm_distribution_signfor lds on lddl.id = lds.delivery_id
@ -1646,6 +1653,8 @@
ldpl.order_package_code AS orderPackageCode,
ldpl.quantity AS retentionQuantity,
1 AS conditions,
ldpl.waybill_number AS waybillNumber,
ldpl.waybill_id AS waybillId,
1 AS scanType
FROM
logpm_distribution_delivery_list AS lddl
@ -1670,6 +1679,10 @@
ldrs.reservation_num AS maxRetention,
ldrzp.parcel_list_id AS orderPackageId,
ldpl.firsts AS materialName,
ldpl.waybill_number AS waybillNumber,
ldpl.waybill_id AS waybillId,
ldrzp.quantity AS maxQuantity,
ldrzp.quantity AS retentionQuantity,
3 AS conditions,
2 AS scanType
FROM
@ -1734,5 +1747,66 @@
LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
</select>
<select id="selectDeliveryById" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO">
SELECT
id,
tenant_id,
create_user,
create_time,
update_user,
update_time,
status,
is_deleted,
create_dept,
reserve1,
reserve2,
reserve3,
reserve4,
reserve5,
train_number,
warehouse_name,
warehouse_id,
type,
forklift_id,
forklift_name,
kind,
vehicle_name,
driver_name,
vehicle_id,
driver_id,
distribution_company,
distribution_company_id,
delivery_status,
delivery_list_loading_status,
customers_number,
price,
added_services_id,
order_number,
delivery_number,
scanned_number,
loading_team_type,
loading_team_id,
loading_team_name,
reservation_id,
lead_time,
order_code,
order_id,
loading_time,
note_number,
source,
fee,
task_time,
inventory_nub,
preparation_time,
positioning,
positioning_adr,
remarks,
unloading_team_id,
unloading_team_name
FROM
logpm_distribution_delivery_list
WHERE
id = #{deliveryId}
</select>
</mapper>

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -113,4 +113,17 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<DistributionParcelListExcel> exportDistributionParcelList(@Param("paramMap")Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
void freezeByOrderCode(@Param("orderCode") String orderCode,@Param("freezeStatus") String freezeStatus);
/**
* 包件列表查询库位信息
* @param orderCodes
* @param warehouseId
* @return
*/
List<String> selectAllocationInforByOrderPackageCode(@Param("orderCodes") List<String> orderCodes,@Param("warehouseId") Long warehouseId);
}

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -835,6 +835,29 @@
</where>
</select>
<select id="selectAllocationInforByOrderPackageCode" resultType="string">
select DISTINCT lwga.qr_code
from
logpm_distribution_parcel_list ldpl
left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
LEFT JOIN logpm_warehouse_goods_allocation lwga on lwga.id=lwug.allocation_id
where ldpl.is_deleted = 0
and lwug.warehouse_id=#{warehouseId}
<if test="orderCodes != null and orderCodes != ''">
and ldpl.order_package_code in
<foreach collection="orderCodes" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<update id="freezeByOrderCode" >
update logpm_distribution_parcel_list
set order_package_freeze_status = #{freezeStatus}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -307,4 +307,11 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
int cancelReservationZeroPackage(Long reservationId, Long orderPackageId, Integer retentionQuantity);
/**
* 查询滞留任务预约信息
* @param reservationIds
* @return
*/
List<DistributionReservationEntity> getRetentionReservationList(@Param("ids") List<String> reservationIds);
}

64
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -74,10 +74,10 @@
</delete>
<update id="cancelReservationZeroPackage">
UPDATE logpm_distribution_reservation_zero_package AS ldrzp
SET ldrzp.quantity = ( ldrzp.quantity - #{retentionQuantity}
SET ldrzp.quantity = ( ldrzp.quantity - #{retentionQuantity})
WHERE
ldrzp.zero_package_status != 2
AND retentionQuantity !=0
AND #{retentionQuantity} !=0
AND ldrzp.reservation_id = #{reservationId}
AND parcel_list_id = #{orderPackageId}
</update>
@ -1191,5 +1191,65 @@
WHERE
ldr.id = #{reservationId} AND ldrs.stocklist_id = #{stockListId}
</select>
<select id="getRetentionReservationList"
resultType="com.logpm.distribution.entity.DistributionReservationEntity">
SELECT id,
tenant_id,
create_user,
create_time,
update_user,
update_time,
status,
is_deleted,
create_dept,
stock_article_id,
mall_id,
mail_phone,
mall_name,
store_id,
store_name,
consignee,
delivery_address,
reservation_date,
serve_type,
delivery_way,
delivery_type,
collect_fee,
other_fee,
replace_fee,
delivery_phone,
reservation_status,
order_source,
stockup_status,
signing_status,
loading_status,
goods_area_name,
goods_area_id,
reserve1,
reserve2,
reserve3,
reserve4,
reserve5,
remarks,
shopping_id,
period_of_time,
fee,
reservation_num,
reservation_stock_list_num,
reservation_code,
service_number,
cancel_reason,
is_urgent,
collection_fee,
warehouse_name,
warehouse_id,
receiving_unit,
waybill_id,
waybill_no
FROM logpm_distribution_reservation WHERE id IN
<foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

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

@ -119,6 +119,11 @@
ldr.service_number serviceNumber,
ldsa.order_code orderCode,
lddl.train_number trainNumber,
case lddl.type
when 1 then '商配'
when 2 then '市配'
else ''
end serveType,
lddl.type type,
ldsa.mall_name mallName,
ldsa.warehouse warehouse,
@ -131,6 +136,9 @@
ldr.delivery_address deliveryAddress,
lds.signing_time signingTime,
lds.sjsigning_time sjsigningTime,
lddl.driver_name driverName,
lddl.vehicle_name vehicleName,
lddl.kind,
(SELECT GROUP_CONCAT(ldpl.material_name SEPARATOR ',') FROM logpm_distribution_parcel_list ldpl WHERE ldpl.stock_article_id = ldsa.id) materialName,
(SELECT COALESCE (count(*) ,0) FROM logpm_distribution_reservation_package ldrpp WHERE ldsa.id = ldrpp.stock_article_id and ldrpp.reservation_id =ldrs.reservation_id) totalNumber,
(select COALESCE (count(*) ,0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.signfor_state =2) signfornum

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

@ -28,7 +28,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 库存品详情信息 Mapper 接口
* PAD备货扫描记录 Mapper 接口
*
* @author cyz
* @since 2023-06-26

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/ClerkCheckPushDataQueueHandler.java

@ -167,23 +167,6 @@ public class ClerkCheckPushDataQueueHandler {
}
}
//得到客户对应的签收数据
// TODO 这里的数据需要查询 等TJJ 空了来帮我写
// // 得到签收订单数量
//
//// 调用方法 推送老系统 闭环
// SignPushDataDTO signPushDataDTO = new SignPushDataDTO();

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

@ -209,7 +209,7 @@ public interface IDistributionAsyncService {
* 维护订单预约装车状态
* @param parcelListEntity
*/
void checkReservationStatusAndLoadingStatusByPackage(DistributionParcelListEntity parcelListEntity);
void checkReservationStatusAndLoadingStatusByPackage(Long packageId);
/**
* 修改零担备货状态

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

@ -353,6 +353,13 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
boolean retentionDeliveryReservationZeroPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity,Long orderId);
/**
* 查询滞留配送任务
* @param deliveryId
* @return
*/
DistributionDeliveryListVO getRetentionDelivery(Long deliveryId);
// /**
// * 滞留取消配送
// * @param distributionRetentionScanVo

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

@ -234,4 +234,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
IPage<DistributionReservationVO> reservationList(IPage<DistributionReservationVO> page, Map<String, Object> distrbutionReservation);
/**
* 查询滞留预约信息
* @param reservationIds
* @return
*/
List<DistributionReservationEntity> getRetentionReservationList(String reservationIds);
}

96
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -886,34 +886,85 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
public void checkReservationStatusAndLoadingStatusByPackage(DistributionParcelListEntity parcelListEntity) {
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId()));
@Transactional
public void checkReservationStatusAndLoadingStatusByPackage(Long packageId) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
boolean reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue()));
if (reservationStatusFlag) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} else {
reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue()));
if (stockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()));
boolean reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue()));
if (reservationStatusFlag) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} else {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue()));
if (reservationStatusFlag) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
} else {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
}
}
}
boolean loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (loadingStatusFlag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else {
loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
boolean loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (loadingStatusFlag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (loadingStatusFlag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
}
distributionStockArticleService.updateById(stockArticleEntity);
}else {
List<DistributionParcelNumberEntity> parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getStockArticleId, stockArticleEntity.getId()));
if (Func.isNotEmpty(parcelNumberEntityList)){
parcelNumberEntityList.forEach(p->{
DistributionParcelListEntity zeroParcelListEntity = distributionParcelListService.getById(p.getParcelListId());
if (p.getOutboundQuantity() == p.getQuantity() && p.getOutboundQuantity() > 0){
//出库数量和总数量一致,此时包件处于装车状态
zeroParcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
}
if (p.getOutboundQuantity() == 0 ){
zeroParcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
}
distributionParcelListService.updateById(zeroParcelListEntity);
});
}
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()));
boolean reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue()));
if (reservationStatusFlag) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} else {
reservationStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue()));
if (reservationStatusFlag) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
} else {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
}
}
boolean loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (loadingStatusFlag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else {
loadingStatusFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (loadingStatusFlag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
}
distributionStockArticleService.updateById(stockArticleEntity);
}
distributionStockArticleService.updateById(stockArticleEntity);
}
/**
@ -1114,6 +1165,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
@Transactional
public void checkSignStatus(Long packageId, Long reservationId, Long deliveryId) {
if (Func.isNotEmpty(packageId)) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
@ -1136,15 +1188,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId);
checkReservationAndDeliverySigningStatus(reservationId, deliveryId);
//注意:这里对于异常装车的包件也需要进行统计
}
@Override
@Transactional
public void checkRetentionReservationAndDeliveryInfo(Long reservationId, Long deliveryId) {
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if (Func.isNotEmpty(distributionReservationEntity)) {
@ -1188,6 +1239,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
@Transactional
public void checkRetentionInventoryReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId) {
DisStockListDetailEntity disStockListDetail = disStockListDetailService.getById(orderPackageId);
if (Func.isNotEmpty(disStockListDetail)) {
@ -1217,9 +1269,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
@Transactional
public void checkRetentionZeroPackageReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId, Long orderId) {
//查询当前存在的对应零担包件信息
DistributionReservationStockarticleEntity distributionReservationStockarticle = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.eq(DistributionReservationStockarticleEntity::getStockArticleId, orderId)

362
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -154,6 +154,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final IDistributionParcelNumberService distributionParcelNumberService;
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
// 自提mapper
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
// 自提关联订单
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper;
// 自提关联包件
private final DistrilbutionBillPackageMapper distrilbutionBillPackageMapper;
private final DistributionParcelListMapper distributionParcelListMapper;
private final DistributionDeliveryChargeMapper distributionDeliveryChargeMapper;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -176,6 +189,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionDeliveryList.setWarehouseIdList(collect);
List<DistributionDeliveryListEntity> distributionDeliveryListEntities = baseMapper.selectDistributionDeliveryListPage(page, distributionDeliveryList);
return page.setRecords(distributionDeliveryListEntities);
}
@ -1416,6 +1430,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setVehicleName(finalDistributionDeliverySelfEntity.getVehicleNub());
loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
loadscanEntity.setOneClick(2);
loadscanEntity.setScanType(parcelListEntity.getConditions().toString());
loadscanEntity.setScanUser(user.getUserName());
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
@ -4540,6 +4555,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
/**
* @param ids 预览Id
* @param type 1 市配 2 商配 3 自提
* @return
* @throws Exception
*/
@Override
public List<PrintPreviewVO> printBatch(String ids, Integer type) throws Exception {
@ -4556,18 +4577,295 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
throw new ServiceException("参数错误");
}
if (2 == type) {
return handleShiPeiData(template, idArray, html);
} else if (1 == type) {
return handleShangPeiData(template.getId(), idArray, html);
} else if (3 == type) {
// 自提
return handleZiTiData(template, idArray, html);
} else {
log.warn("###########printBatch: 未知的打印类型");
throw new CustomerException(403, "未知的打印类型");
}
}
/**
* 自提配送单
*
* @param template
* @param idArray
* @param html
* @return
*/
private List<PrintPreviewVO> handleZiTiData(BasicPrintTemplateEntity template, String[] idArray, String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
for (String id : idArray) {
//查询自提预约单
DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = distrilbutionBillLadingMapper.selectById(Long.parseLong(id));
// 查询自提预约单下面的订单
LambdaQueryWrapper<DistrilbutionBillStockEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId());
List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities = distrilbutionBillStockMapper.selectList(queryWrapper);
// 查找自提预约单下面包件 排除取消的
LambdaQueryWrapper<DistrilbutionBillPackageEntity> distrilbutionBillStockEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
distrilbutionBillStockEntityLambdaQueryWrapper.eq(DistrilbutionBillPackageEntity::getBillLadingId, distrilbutionBillLadingEntity.getId());
distrilbutionBillStockEntityLambdaQueryWrapper.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2);
List<DistrilbutionBillPackageEntity> distrilbutionBillPackageEntities = distrilbutionBillPackageMapper.selectList(distrilbutionBillStockEntityLambdaQueryWrapper);
Set<Long> ids = new HashSet<Long>();
for (DistrilbutionBillPackageEntity distrilbutionBillPackageEntity : distrilbutionBillPackageEntities) {
ids.add(distrilbutionBillPackageEntity.getParceListId());
}
// 得到所以的订单列表
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectBatchIds(ids);
Map<String, Object> map = new HashMap<>();
map.put("自提单号", distrilbutionBillLadingEntity.getPickupBatch());
String fileTypeName = QRCodeUtil.createCodeToFile(map.get("自提单号").toString());
map.put("自提单二维码", QRCodeUtil.getEmpAutograph(fileTypeName));
// map.put("收货单单位", reservationEntity.getReceivingUnit());//收货单单位
// map.put("商场名称", reservationEntity.getStoreName());//商场名称
// 构建map集合中收货单和商场名称
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities,distrilbutionBillLadingEntity);
map.put("提货人", distrilbutionBillLadingEntity.getConsignee());//提货人
map.put("联系电话", distrilbutionBillLadingEntity.getConsigneePhone());//收货人电话
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(distrilbutionBillLadingEntity.getWarehouseId());
map.put("自提仓库", entityWarehouseId!=null?entityWarehouseId.getName():"");
map.put("自提时间", DateUtil.formatDateTime(distrilbutionBillLadingEntity.getPickUpTime()));
map.put("提货车牌号", distrilbutionBillLadingEntity.getPickUpPlate());
map.put("创建时间", DateUtil.formatDateTime(distrilbutionBillLadingEntity.getCreateTime()));
Map<String,Object> fua = new HashMap<>();
// 需要去查询费用明细
LambdaQueryWrapper<DistributionDeliveryChargeEntity> qu = new LambdaQueryWrapper<>();
qu.eq(DistributionDeliveryChargeEntity::getBillLading,distrilbutionBillLadingEntity.getId());
List<DistributionDeliveryChargeEntity> distributionDeliveryChargeEntities = distributionDeliveryChargeMapper.selectList(qu);
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
BigDecimal sumMoney =new BigDecimal("0.00");
// 构建费用明细
for (DistributionDeliveryChargeEntity distributionDeliveryChargeEntity : distributionDeliveryChargeEntities) {
String costName = distributionDeliveryChargeEntity.getCost();// 查询码表 得到类型
costName=DictBizCache.getValue("delivery_cost",costName);
BigDecimal costMoney = distributionDeliveryChargeEntity.getMoney();// 查询码表 得到类型
objectObjectHashMap.put(costName,costMoney);
sumMoney.add(costMoney);
}
fua.put("费用明细",objectObjectHashMap);
fua.put("费用合计",sumMoney);
map.put("费用统计",fua);
String popHtml = TemplateUtil.popTemplate("自提配送单", map, html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(template.getId());
printPreviewVO.setTemplateHtml(popHtml);
result.add(printPreviewVO);
}
return result;
}
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities,DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) {
// 查询订单集合
Set<Long> ids = new HashSet<Long>();
for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : distrilbutionBillStockEntities) {
ids.add(distrilbutionBillStockEntity.getStockArticleId());
}
// 得到所以的订单列表
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(ids);
// 获取订单中的商城和收货单位
StringBuilder consigneeUnit = new StringBuilder();
StringBuilder mailNames = new StringBuilder();
List<Map<String, Object>> ls = new ArrayList<>();
int a = 1;
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
List<Map<String, Object>> listMapTemp = new ArrayList<>();
Map<String, Object> m = new HashMap<>();
int hejiNum =0;
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if(StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())){
distributionParcelListEntity.setThirdProduct("其它");
}
if (m.containsKey(distributionParcelListEntity.getThirdProduct())) {
int o = (int) m.get(distributionParcelListEntity.getThirdProduct());
o = o + 1;
m.put(distributionParcelListEntity.getThirdProduct(), o);
} else {
m.put(distributionParcelListEntity.getThirdProduct(), 1);
}
}
// 加入到集合中的去 目的是为了获取分类头部
listMapTemp.add(m);
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
// 需要从所有的包件的
List<DistributionParcelListEntity> ts = new ArrayList<>();
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if (distributionParcelListEntity.getStockArticleId().equals(distributionStockArticleEntity.getId())){
ts.add(distributionParcelListEntity);
}
}
if (!mailNames.toString().contains(distributionStockArticleEntity.getMallName())) {
if (!mailNames.toString().equals("")) {
mailNames.append(",");
}
mailNames.append(distributionStockArticleEntity.getMallName());
}
if (!consigneeUnit.toString().contains(distributionStockArticleEntity.getConsigneeUnit())) {
if (!consigneeUnit.toString().equals("")) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockArticleEntity.getConsigneeUnit());
}
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("序号", a);
tempMap.put("运单号", distributionStockArticleEntity.getWaybillNumber());
tempMap.put("合同号", distributionStockArticleEntity.getOrderCode());
String materialNameStr = buildMaterialNameStr(distributionParcelListEntities);
tempMap.put("物料名称", materialNameStr);
// 构建产品明细 --对于每一个订单
buildProductDetail(tempMap, m, ts);
Map<String,Object> os = (Map<String, Object>) tempMap.get("产品明细");
Set<String> strings = os.keySet();
int sumNum =0;
for (String string : strings) {
Object o = os.get(string);
sumNum+=(o!=null)?(int)o:0;
}
tempMap.put("小计", sumNum);
hejiNum+=sumNum;
// 查询货物货位
//通过订单id和预约id查询对应包件的库位信息
List<String> orderPackageCodes = ts.stream()
.map(DistributionParcelListEntity::getOrderPackageCode) // 获取每个对象的orderPackageCode
.collect(Collectors.toList());
List<Long> orderPackageIds = ts.stream()
.map(DistributionParcelListEntity::getId) // 获取每个对象的包件ID
.collect(Collectors.toList());
List<String> allocationStrList = distributionParcelListMapper.selectAllocationInforByOrderPackageCode(orderPackageCodes, distrilbutionBillLadingEntity.getWarehouseId());
String allocationStr = StringUtils.join(allocationStrList, ",");
tempMap.put("货位", allocationStr);
//通过订单id和预约id查询对应包件的备货区信息
LambdaQueryWrapper<DistributionStockEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DistributionStockEntity::getBillLadingId,distrilbutionBillLadingEntity.getId()).in(DistributionStockEntity::getParcelListId,orderPackageIds);
List<DistributionStockEntity> distributionStockEntities = distributionStockMapper.selectList(lambdaQueryWrapper);
Set<String> stockupAreaStrList=distributionStockEntities.stream().map(DistributionStockEntity::getStockupArea).collect(Collectors.toSet());
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
tempMap.put("备货区", stockupAreaStr);
ls.add(tempMap);
a++;
}
map.put("收货单单位", consigneeUnit.toString());
map.put("商场名称", mailNames.toString());
map.put("明细", ls);
Map<String, Object> m1 = new HashMap<>();
m1.put("产品明细",m);
m1.put("合计数量",hejiNum);
map.put("合计", m1);
}
/**
* 构建分类明细
* @param tempMap
* @param m
* @param distributionParcelListEntities
*/
private void buildProductDetail(Map<String, Object> tempMap, Map<String, Object> m, List<DistributionParcelListEntity> distributionParcelListEntities) {
Set<String> strings = m.keySet();
Map<String, Object> newTempMap= new HashMap<>();
for (String string : strings) {
int count = buildCountNum(string, distributionParcelListEntities);
newTempMap.put(string, count);
}
tempMap.put("产品明细",newTempMap);
}
/**
* 统计分类对于件的数量
*
* @param string
* @param distributionParcelListEntities
* @return
*/
private int buildCountNum(String string, List<DistributionParcelListEntity> distributionParcelListEntities) {
int num = 0;
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if(StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())){
distributionParcelListEntity.setThirdProduct("其它");
}
if (distributionParcelListEntity.getThirdProduct().equals(string)) {
num++;
}
}
return num;
}
private String buildMaterialNameStr(List<DistributionParcelListEntity> distributionParcelListEntitie) {
StringBuffer sb = new StringBuffer();
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntitie) {
if(ObjectUtils.isNotNull(distributionParcelListEntity.getMallName())){
if (!sb.toString().equals("")) {
sb.append(",");
}
sb.append(distributionParcelListEntity.getMaterialName());
}
}
return sb.toString();
}
@Override
public void testData(String s) throws Exception {
String[] split = s.split(",");
@ -5147,7 +5445,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
// List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(loadscanEntityList)) {
if (loadscanEntityList.size() == 1) {
//包件存在装车才能进行滞留
@ -5182,27 +5480,27 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//如果均不存在则就该判断该货物是否属于当前的配送任务,如果属于则是未装车,如果不属于则此码无效
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectPackageListByDeliveryListId(deliveryListEntity.getId());
boolean flag = false;
if (Func.isNotEmpty(distributionParcelListEntities)){
if (Func.isNotEmpty(distributionParcelListEntities)) {
List<DistributionParcelListEntity> isHave = distributionParcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
if (Func.isNotEmpty(isHave)){
if (Func.isNotEmpty(isHave)) {
flag = isHave.size() == 1;
}
}else {
} else {
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(disStockListDetailEntities)){
if (Func.isNotEmpty(disStockListDetailEntities)) {
List<DisStockListDetailEntity> isHaveinven = disStockListDetailEntities.stream().filter(inven -> Func.isNotEmpty(inven.getStockPackageCode()) && inven.getStockPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
if (Func.isNotEmpty(isHaveinven)){
if (Func.isNotEmpty(isHaveinven)) {
flag = isHaveinven.size() == 1;
}
}
}
if (flag){
if (flag) {
//存在该订制品或者库存品包件信息但是未进行装车操作
return Resp.scanFail("包件未装车","包件未装车");
}else {
return Resp.scanFail("包件未装车", "包件未装车");
} else {
//该配送任务查询无该包件信息
return Resp.scanFail("此配送无该包件","此配送无该包件信息");
return Resp.scanFail("此配送无该包件", "此配送无该包件信息");
}
}
@ -5353,9 +5651,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//已经进行装车
loadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue());
distributionLoadscanService.updateById(loadscanEntity);
// 对应签收信息的装车数量要进行扣减
// 对应签收信息的装车数量要进行扣减
int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub());
distributionAsyncService.checkReservationStatusAndLoadingStatusByPackage(parcelListEntity);
distributionAsyncService.checkReservationStatusAndLoadingStatusByPackage(parcelListEntity.getId());
}
//进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护
distributionAsyncService.checkRetentionReservationAndDeliveryInfo(reservationId, deliveryId);
@ -5420,25 +5718,37 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//存在零担的信息
//校验零担滞留数量是否有效
DistributionParcelNumberVO distributionParcelNumberVO = zeroPackageMap.get(orderPackageId);
if (distributionParcelNumberVO.getReservationNum() < retentionQuantity) {
if (distributionParcelNumberVO.getQuantity() < retentionQuantity) {
//信息不合法
log.error("##############无效的滞留零担数量:{}", retentionQuantity);
return false;
}
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getStockArticleId, distributionParcelNumberVO.getStockArticleId())
.eq(DistributionParcelNumberEntity::getParcelListId, distributionParcelNumberVO.getParcelListId())
);
if (Func.isNotEmpty(distributionParcelNumberEntity)){
//这里滞留都是在装车之后进行 只需要维护出库数量和在库数量字段
distributionParcelNumberEntity.setOutboundQuantity(distributionParcelNumberEntity.getOutboundQuantity() - retentionQuantity);
distributionParcelNumberEntity.setHandQuantity(distributionParcelNumberEntity.getHandQuantity() + retentionQuantity);
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
}
//进行是否装车判断
if (Func.isNotEmpty(zeroLoadscanEntity)) {
//存在装车数据
int num = zeroLoadscanEntity.getLoadedNub() - retentionQuantity;
if (num < 0){
if (num > 0){
zeroLoadscanEntity.setLoadedNub(0);
zeroLoadscanEntity.setPackageNub(0);
} else {
zeroLoadscanEntity.setLoadedNub(0);
zeroLoadscanEntity.setPackageNub(0);
}else {
zeroLoadscanEntity.setLoadedNub(num);
zeroLoadscanEntity.setLoadedNub(num);
zeroLoadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue());
}
distributionLoadscanService.updateById(zeroLoadscanEntity);
//扣减装车数量
int a = distributionSignforMapper.deductionLoadingPacjageNum(zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getDeliveryId(), retentionQuantity);
distributionAsyncService.checkReservationStatusAndLoadingStatusByPackage(distributionParcelNumberEntity.getParcelListId());
}
distributionAsyncService.checkRetentionZeroPackageReservationAndDeliveryInfo(reservationId, deliveryId, orderPackageId,orderId);
return true;
@ -5449,13 +5759,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return false;
}
}else {
log.error("#############查询出多条零担包件信息:{}",row);
} else {
log.error("#############查询出多条零担包件信息:{}", row);
return false;
}
}
@Override
public DistributionDeliveryListVO getRetentionDelivery(Long deliveryId) {
//查询滞留的配送任务 这里需要注意配送任务可能会进行删除
return baseMapper.selectDeliveryById(deliveryId);
}
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {
Map<String, String> map = new HashMap<>();
String dirverName = null;
@ -5768,6 +6084,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue());
} else if (1 == type) {
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_12.getValue());
} else if (3 == type) {
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.peisongtask_ziti.getValue());
}
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");

60
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -202,7 +202,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private DistributionReservationZeroPackageMapper distributionReservationZeroPackageMapper;
@Autowired
private IBasicdataClientClient basicdataClientClient;
private IBasicdataClientClient basicdataClientClient;
@Override
@ -212,29 +212,30 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/**
* 预约导出
*
* @param distrbutionReservation
* @return
*/
@Override
public List<DistributionReservationExcel> exportDistrbutionReservation(Map<String, Object> distrbutionReservation) {
Object o = distrbutionReservation.get("ids");
if(ObjectUtils.isNotNull(o)){
if (ObjectUtils.isNotNull(o)) {
distrbutionReservation.remove("ids");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull()){
if (ObjectUtils.isNull()) {
throw new ServiceException("请选择仓库!");
}
QueryWrapper<DistributionReservationEntity> queryWrapper = Condition.getQueryWrapper(distrbutionReservation, DistributionReservationEntity.class);
queryWrapper.lambda().eq(DistributionReservationEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
if(ObjectUtils.isNotNull(o)){
queryWrapper.in("id",String.valueOf(o).split(","));
if (ObjectUtils.isNotNull(o)) {
queryWrapper.in("id", String.valueOf(o).split(","));
}
queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
queryWrapper.eq("warehouse_id", myCurrentWarehouse.getId());
// List<DistributionReservationExcel> distrbutionReservationList = baseMapper.exportDistrbutionReservation(queryWrapper);
List<DistributionReservationVO> distrbutionReservationList = baseMapper.exportDistrbutionReservation(queryWrapper);
List<DistributionReservationExcel> excelList = new ArrayList<>();
distrbutionReservationList.forEach( dis -> {
distrbutionReservationList.forEach(dis -> {
// distrbutionReservation.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistrbutionReservation.getType()));
DistributionReservationExcel reservationExcel = new DistributionReservationExcel();
reservationExcel.setReservationCode(dis.getReservationCode());
@ -249,7 +250,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationExcel.setReservationData(dis.getReservationDate());
String value3 = DictBizCache.getValue(DictBizConstant.PERIOD_OF_TIME, dis.getPeriodOfTime());
reservationExcel.setPeriodTimeName(value3); //时段
if(ObjectUtils.isNotNull(dis.getTypeService())){
if (ObjectUtils.isNotNull(dis.getTypeService())) {
String[] split = dis.getServeType().split(",");
StringBuffer sb = new StringBuffer();
for (String s : split) {
@ -258,7 +259,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
reservationExcel.setServeTypeName(String.valueOf(sb));
}
if(ObjectUtils.isNotNull(dis.getDeliveryType())){
if (ObjectUtils.isNotNull(dis.getDeliveryType())) {
String[] split = dis.getDeliveryType().split(",");
StringBuffer sb = new StringBuffer();
for (String s : split) {
@ -1706,7 +1707,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Integer newQuantityOccupied = distributionStockListEntity.getQuantityOccupied() - reservationNum;
distributionStockListEntity.setQuantityOccupied(newQuantityOccupied);
distributionStockListService.updateById(distributionStockListEntity);
disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getStocklistId(),distributionReservationStocklistEntity.getReservationId());
disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getStocklistId(), distributionReservationStocklistEntity.getReservationId());
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distributionReservationStocklistEntity.getReservationId()).eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId()));
list.forEach(l -> l.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()));
@ -1724,7 +1725,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setServeType(distributionReservationDTO.getServeType());
reservationEntity.setReservationNum(packTotal.get());
reservationEntity.setMallName(String.join(",", mallName));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
reservationEntity.setStoreName(String.join(",", storeName));
@ -2073,7 +2074,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setMailPhone(String.join(",", marketPhone));
reservationEntity.setMallName(String.join(",", mallName));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
reservationEntity.setStoreName(String.join(",", storeName));
@ -2797,7 +2798,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.fail("订单已预约!!!");
}
stockArticleList.forEach(s -> {
if (Func.isNotEmpty(s.getAllocation())){
if (Func.isNotEmpty(s.getAllocation())) {
s.setAllocation(null);
}
DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class);
@ -2882,7 +2883,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0);
if (Func.isNotEmpty(s.getAllocation())){
if (Func.isNotEmpty(s.getAllocation())) {
s.setAllocation(null);
}
distributionStockArticleService.updateById(s);
@ -3032,7 +3033,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// i.setQuantityOccupied(count);
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (i.getReservationNum() > keyongshuliang){
if (i.getReservationNum() > keyongshuliang) {
throw new RuntimeException("库存品库内数量不足!!!");
}
if (Func.isNotBlank(i.getServiceNumber())) {
@ -3108,7 +3109,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
reservationEntity.setWaybillNo(String.join(",", waybillNo));
reservationEntity.setWaybillId(String.join(",", waybillId));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
@ -3200,31 +3201,36 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationOrderPackageVO.setPackageList(allPackageList);
return R.data(reservationOrderPackageVO);
}
@Override
public IPage<DistributionReservationVO> reservationList(IPage<DistributionReservationVO> page, Map<String, Object> distrbutionReservation) {
// 查询登陆人 映射的商场ID
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId());
List clientIds =null;
if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){
List clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
}
if(ObjectUtil.isEmpty(clientIds)){
if (ObjectUtil.isEmpty(clientIds)) {
throw new ServiceException("当前登陆人无商场");
}
distrbutionReservation.put("clientIds",clientIds);
distrbutionReservation.put("clientIds", clientIds);
List<DistributionReservationEntity> distributionReservationEntities =baseMapper.reservationList(page,distrbutionReservation);
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.reservationList(page, distrbutionReservation);
List<DistributionReservationVO> distributionReservationVOS = DistributionReservationWrapper.build().listVO(distributionReservationEntities);
page.setRecords(distributionReservationVOS);
return page;
}
@Override
public List<DistributionReservationEntity> getRetentionReservationList(String reservationIds) {
log.info("查询ID>>>>>>>>>>>>>>>>:{}", reservationIds);
// List<Long> ids = Func.toLongList(",", reservationIds);
if (Func.isEmpty(reservationIds)) {
return null;
}
List<String> ids = Func.toLongList(",", reservationIds).stream().map(Objects::toString).collect(Collectors.toList());
List<DistributionReservationEntity> retentionReservationList = baseMapper.getRetentionReservationList(ids);
return retentionReservationList;
}
}

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

@ -305,6 +305,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//缺少一个异步维护包件签收的方法
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
} else {
//这里装车的数据需要进行补录
@ -396,7 +397,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
String str = checkSignNum(distrilbutionloadingscanDTO);
//查询出客户下的所有包件信息
// distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccess("签收成功", str);
}
@ -1020,6 +1021,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("########该客户下的库存品是否已备货:{}", isHaveCode);
return Resp.scanFail("操作失败", "操作失败");
}
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccess("签收成功", "签收成功");
@ -1792,7 +1794,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
if (Func.isEmpty(loadscanEntities)) {
//没有进行过装车操作
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
@ -1839,8 +1840,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(),loadscanEntity.getReservationId(),loadscanEntity.getDeliveryId());
distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
log.info("一件签收包件下架解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}",parcelListEntity.getOrderPackageCode());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
} else {
//存在装车数据
@ -1863,6 +1864,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收数量
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), loadscanEntities.getPackageNub());
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(),loadscanEntities.getReservationId(),loadscanEntities.getDeliveryId());
log.info("一件签收包件解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}",parcelListEntity.getOrderPackageCode());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
}
}
distributionParcelListService.updateById(parcelListEntity);
@ -2830,7 +2834,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
parcelNumberEntity.setHandQuantity(handQuantity.subtract(signNum).intValue());
parcelNumberEntity.setDeliveryQuantity(deliveryQuantity.subtract(signNum).intValue());
parcelNumberEntity.setOutboundQuantity(outboundQuantity.add(signNum).intValue());
}
}
}
@ -2870,7 +2873,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 得到signfor的ID 获取配送计划的的信息 和配送客户的信息
map.put("signfor_id",distributionSignfor.getId());
rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, map);
log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ",distributionSignfor);
//rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, map);
}

4
blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@ExtendWith(BladeSpringExtension.class)
@BladeBootTest(appName = "logpm-distribution-pref", enableLoader = true)
@BladeBootTest(appName = "logpm-distribution-tjj", enableLoader = true)
public class TestService {
@Autowired
@ -32,7 +32,7 @@ public class TestService {
@Test
public void test3() throws Exception {
List<PrintPreviewVO> ls = distributionDeliveryListService.printBatch("1704390271891935233",2);
List<PrintPreviewVO> ls = distributionDeliveryListService.printBatch("1722884630824214530",3);
System.out.println(ls);

1
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java

@ -137,6 +137,7 @@ public class SyncWarehouseData {
entity.setAllocationStatus("1");
entity.setLayerNum(locationEntity.getFloor());
entity.setColumnNum(locationEntity.getRow());
entity.setQrCode(shelfEntity.getTitle()+"排"+locationEntity.getFloor()+"层"+locationEntity.getRow()+"列");
entity.setOldId(locationId);
Long newLocationId = basicdataGoodsAllocationClient.addLocation(entity);
if(Objects.isNull(newLocationId)){

16
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -62,6 +62,7 @@ public class CarsLoadController {
String method = "############startCarByLoadId: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
Integer startCarType = loadCarsDTO.getStartCarType();
try{
//当前登录人选择的仓库
@ -76,6 +77,21 @@ public class CarsLoadController {
return R.fail(405,"请选择一条配载计划");
}
if(Objects.isNull(startCarType)){
log.warn(method+"发车类型不能为空 startCarType={}",startCarType);
return R.fail(405,"发车类型不能为空");
}
if(startCarType != 1 && startCarType != 2){
log.warn(method+"未知的发车类型 startCarType={}",startCarType);
return R.fail(405,"未知的发车类型");
}
// if(StringUtil.isBlank(nodeType)){
// log.warn(method+"节点类型不能为空 nodeType={}",nodeType);
// return R.fail(405,"节点类型不能为空");
// }
carsLoadService.startCarByLoadId(loadCarsDTO);
return R.success("操作成功");
}catch (CustomerException e){

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java

@ -3,7 +3,13 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineCarsLoadLineMapper extends BaseMapper<TrunklineCarsLoadLineEntity> {
TrunklineCarsLoadLineEntity findStartNodeByLoadId(@Param("loadId") Long loadId);
TrunklineCarsLoadLineEntity findEndNodeByLoadId(@Param("loadId") Long loadId);
}

16
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml

@ -3,4 +3,20 @@
<mapper namespace="com.logpm.trunkline.mapper.TrunklineCarsLoadLineMapper">
<select id="findStartNodeByLoadId" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity">
select *
from logpm_trunkline_cars_load_line
where load_id = #{loadId}
order by sort asc
limit 1
</select>
<select id="findEndNodeByLoadId" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity">
select *
from logpm_trunkline_cars_load_line
where load_id = #{loadId}
order by sort desc
limit 1
</select>
</mapper>

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java

@ -4,4 +4,9 @@ import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineCarsLoadLineService extends BaseService<TrunklineCarsLoadLineEntity> {
TrunklineCarsLoadLineEntity findStartNodeByLoadId(Long loadId);
TrunklineCarsLoadLineEntity findEndNodeByLoadId(Long loadId);
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java

@ -12,4 +12,14 @@ import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class TrunklineCarsLoadLineServiceImpl extends BaseServiceImpl<TrunklineCarsLoadLineMapper, TrunklineCarsLoadLineEntity> implements ITrunklineCarsLoadLineService {
@Override
public TrunklineCarsLoadLineEntity findStartNodeByLoadId(Long loadId) {
return baseMapper.findStartNodeByLoadId(loadId);
}
@Override
public TrunklineCarsLoadLineEntity findEndNodeByLoadId(Long loadId) {
return baseMapper.findEndNodeByLoadId(loadId);
}
}

43
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -12,10 +12,13 @@ import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@ -48,9 +51,47 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
public void startCarByLoadId(LoadCarsDTO loadCarsDTO) {
log.info("############startCarByLoadId: 发车");
Long loadId = loadCarsDTO.getLoadId();
Integer startCarType = loadCarsDTO.getStartCarType();
Long warehouseId = loadCarsDTO.getWarehouseId();
//先查询该仓库
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("#############startCarByLoadId: 配载计划不存在 loadId={}",loadId);
throw new CustomerException(400,"配载计划不存在");
}
if(startCarType == 1){
//车辆配载发车
//查询发站仓节点信息
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findStartNodeByLoadId(loadId);
String nodeStatus = carsLoadLineEntity.getNodeStatus();//节点状态
Date startDate = carsLoadLineEntity.getStartDate();
if(!Objects.isNull(startDate)){
log.warn("#############startCarByLoadId: 车辆已发车 startDate={}",startDate);
throw new CustomerException(405,"车辆已发车");
}
if(!"0".equals(nodeStatus)){
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus);
throw new CustomerException(405,"车辆已发车");
}
}else if(startCarType == 2){
//到车管理的发车
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEndNodeByLoadId(loadId);
String nodeStatus = carsLoadLineEntity.getNodeStatus();//节点状态
if(!"0".equals(nodeStatus)){
log.warn("#############startCarByLoadId: 车辆已发车 nodeStatus={}",nodeStatus);
throw new CustomerException(405,"车辆已发车");
}
}

20
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -193,6 +193,26 @@ public class TaskQuestController extends BladeController {
return R.status(taskQuestService.updateByIdCustom(taskQuest));
}
/**
* 盘点任务 修改
*/
@PostMapping("/updateInfo")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入taskQuest")
public R updateInfo(@Valid @RequestBody TaskQuestDTO taskQuest) {
return R.status(taskQuestService.updateByInfo(taskQuest));
}
/**
* 盘点任务 盘点后的数据修改
*/
@PutMapping("/updateQuestChildInfo")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入taskQuest")
public R updateQuestInfo(@Valid @RequestBody List<QuestDetailDTO> questDetailDTO) {
return R.status(taskQuestService.updateQuestInfo(questDetailDTO));
}
/**
* 盘点任务 修改时间
*/

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import com.logpm.warehouse.wrapper.WarehouseRetentionRecordWrapper;
import io.swagger.annotations.Api;
@ -81,6 +82,15 @@ public class WarehouseRetentionRecordController extends BladeController {
return R.data(WarehouseRetentionRecordWrapper.build().pageVO(pages));
}
@GetMapping("/getRetentionPackageByType")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入warehouseRetentionRecord")
public R<List<WarehouseRetentionScanVO>> getRetentionPackageByType(@RequestParam Long retentionId, @RequestParam Integer type) {
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = warehouseRetentionRecordService.getRetentionPackageByType(retentionId,type);
return R.data(warehouseRetentionScanVOS);
}
/**
* 滞留记录 自定义分页
*/

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

@ -47,5 +47,8 @@ public class QuestDetailDTO extends QuestDetailEntity {
private String allocationId;//上架后的库位id
private String cargoName;//盘点的包件状态名称
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -198,6 +198,7 @@
<if test="param.questId != null and param.questId != ''">and quest_id =#{param.questId } </if>
<if test="param.questType != null and param.questType != ''">and quest_type =#{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.questStatus != null ">and quest_status =#{param.questStatus } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import org.apache.ibatis.annotations.Param;
@ -44,7 +45,7 @@ public interface WarehouseRetentionRecordMapper extends BaseMapper<WarehouseRete
* @param warehouseRetentionRecord
* @return
*/
List<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionRecordVO warehouseRetentionRecord);
List<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage page,@Param("par") WarehouseRetentionRecordVO warehouseRetentionRecord);
/**
* 滞留运单
@ -57,4 +58,15 @@ public interface WarehouseRetentionRecordMapper extends BaseMapper<WarehouseRete
List<WarehouseRetentionRecordExcel> exportWarehouseRetentionRecord(@Param("paramMap") Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
List<WarehouseRetentionScanVO> selectWarehouseRetentionScanVoList(@Param("rerentionId") Long id);
/**
* 查询指定类型的滞留包件列表
* @param retentionId
* @param type
* @return
*/
List<WarehouseRetentionScanVO> selectWarehouseRetentionScanVoListByType(@Param("rerentionId")Long retentionId,@Param("type") Integer type);
}

124
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml

@ -3,6 +3,33 @@
<mapper namespace="com.logpm.warehouse.mapper.WarehouseRetentionRecordMapper">
<!-- 通用查询映射结果 -->
<select id="selectWarehouseRetentionRecordPage" resultMap="warehouseRetentionRecordResultMap">
select * from logpm_warehouse_retention_record
<where>
is_deleted = 0
<if test="par.retentionWarehouseId != null and par.retentionWarehouseId != ''">
and retention_warehouse_id =#{par.retentionWarehouseId}
</if>
<if test="par.retentionCarNo != null and par.retentionCarNo != ''">
and retention_car_no like concat('%',#{par.retentionCarNo},'%')
</if>
<if test="par.retentionType != null and par.retentionType != ''">
and retention_type =#{par.retentionType}
</if>
<if test="par.retentionType != null and par.retentionType != ''">
and retention_type =#{par.retentionType}
</if>
<if test="par.assembleCarPersonName != null and par.assembleCarPersonName != ''">
and assemble_car_person_name like concat('%',#{par.retentionType},'%')
</if>
<if test="par.retentionCreateUserName != null and par.retentionCreateUserName != ''">
and retention_create_user_name like concat('%',#{par.retentionCreateUserName},'%')
</if>
</where>
</select>
<resultMap id="warehouseRetentionRecordResultMap" type="com.logpm.warehouse.entity.WarehouseRetentionRecordEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
@ -35,11 +62,6 @@
<result column="cancel_remark" property="cancelRemark"/>
</resultMap>
<select id="selectWarehouseRetentionRecordPage" resultMap="warehouseRetentionRecordResultMap">
select * from logpm_warehouse_retention_record where is_deleted = 0
</select>
<select id="selectWarehouseWaybillRecordPage" resultType="com.logpm.warehouse.vo.WarehouseWaybillDetentionVO">
SELECT lwrr.waybill_no waybillNo,GROUP_CONCAT( lwrr.retention_warehouse_name SEPARATOR ',' ) retentionWarehouseName FROM logpm_warehouse_retention_record lwrr GROUP BY lwrr.waybill_no
</select>
@ -90,6 +112,98 @@
</if>
</where>
</select>
<select id="selectWarehouseRetentionScanVoList"
resultType="com.logpm.warehouse.vo.WarehouseRetentionScanVO">
SELECT
lwrs.train_number,
lwrs.order_id,
lwrs.reservation_id,
lwrs.order_code,
lwrs.waybill_number,
lwrs.waybill_id,
lwrs.reservation_code,
lwrs.order_package_id,
lwrs.order_package_code,
lwrs.retention_scan_user_id,
lwrs.retention_scan_username,
lwrs.retention_scan_time,
lwrs.delivery_id,
lwrs.ref_id,
lwrs.tray_id,
lwrs.tray_code,
lwrs.tray_name,
lwrs.scan_type,
lwrs.retention_way,
lwrs.material_number,
lwrs.material_name,
lwrs.inventory_id,
CASE lwrs.conditions
WHEN 1 THEN '包件'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE
''
END scanTypeName,
CASE lwrs.retention_way
WHEN 1 THEN '扫描'
WHEN 2 THEN '托盘'
ELSE
''
END retentionWayName
FROM
logpm_warehouse_retention_record AS lwrr
LEFT JOIN logpm_warehouse_retention_scan AS lwrs ON lwrr.id = lwrs.ref_id
WHERE
lwrr.id=#{rerentionId} and lwrs.cancel_retention_status = 0
</select>
<select id="selectWarehouseRetentionScanVoListByType"
resultType="com.logpm.warehouse.vo.WarehouseRetentionScanVO">
SELECT
lwrs.train_number,
lwrs.order_id,
lwrs.reservation_id,
lwrs.order_code,
lwrs.waybill_number,
lwrs.waybill_id,
lwrs.reservation_code,
lwrs.order_package_id,
lwrs.order_package_code,
lwrs.retention_scan_user_id,
lwrs.retention_scan_username,
lwrs.retention_scan_time,
lwrs.delivery_id,
lwrs.ref_id,
lwrs.tray_id,
lwrs.tray_code,
lwrs.tray_name,
lwrs.scan_type,
lwrs.retention_way,
lwrs.material_number,
lwrs.retention_quantity,
lwrs.material_name,
lwrs.inventory_id,
CASE lwrs.conditions
WHEN 1 THEN '包件'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE
''
END scanTypeName,
CASE lwrs.retention_way
WHEN 1 THEN '扫描'
WHEN 2 THEN '托盘'
ELSE
''
END retentionWayName
FROM
logpm_warehouse_retention_record AS lwrr
LEFT JOIN logpm_warehouse_retention_scan AS lwrs ON lwrr.id = lwrs.ref_id
WHERE
lwrr.id=#{rerentionId} and lwrs.cancel_retention_status = 0
<if test="type!=null and type !=''">
and lwrs.conditions = #{type}
</if>
</select>
</mapper>

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -231,4 +231,18 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return
*/
R getMaterialName(TaskSearchDTO taskSearchDTO, IPage<Object> page);
/**
* 修改数据
* @param taskQuest
* @return
*/
Boolean updateByInfo(TaskQuestDTO taskQuest);
/**
* 盘点数据修改
* @param questDetailDTO
* @return
*/
boolean updateQuestInfo(List<QuestDetailDTO> questDetailDTO);
}

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java

@ -25,7 +25,9 @@ import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -88,4 +90,12 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
* @return
*/
WarehouseRetentionRecordVO getDetail(Long id);
/**
* 查询指定类型的滞留包件列表
* @param retentionId
* @param type
* @return
*/
List<WarehouseRetentionScanVO> getRetentionPackageByType(@Param("retentionId") Long retentionId,@Param("type") Integer type);
}

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

@ -1047,6 +1047,75 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.data(top);
}
/**
* 盘点任务修改数据
* @param taskQuest
* @return
*/
@Override
public Boolean updateByInfo(TaskQuestDTO taskQuest) {
return baseMapper.updateById(taskQuest) > 0 ? true : false;
}
/**
* 修改盘点后的数据
* @param questDetailDTO
* @return
*/
@Override
public boolean updateQuestInfo(List<QuestDetailDTO> questDetailDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!!");
}
BladeUser user = AuthUtil.getUser();
if(ObjectUtils.isNotNull(questDetailDTO)){
questDetailDTO.stream().forEach( i ->{
if(i.getStockNum() > 0 || i.getWornNum() > 0 || i.getLossNum() > 0 || i.getNoRepairNum() > 0 || i.getDeliveNum() > 0 || i.getNoReceivedNum()> 0){
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(i.getStockNum(),"10",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getWornNum(),"20",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getLossNum(),"30",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getNoRepairNum(),"40",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getDeliveNum(),"50",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getNoReceivedNum(),"60",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(i.getQuestNum()+"_child",childList);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(i.getQuestNum()+"_child",collect);
}
}
}
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1);
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getOrderCode())){
questDetail.setOrderCode(i.getOrderCode());
}
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
questDetail.setOrderPackageCode(i.getOrderPackageCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(i.getQuestNum(),list);
});
return true;
}else{
return false;
}
}
/**
* 查询货位上的数据
* @param taskSearchDTO

142
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -24,9 +24,12 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import com.logpm.distribution.feign.IDistributionLoadscanClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionReservationClient;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
@ -36,6 +39,7 @@ import com.logpm.warehouse.mapper.WarehouseRetentionRecordMapper;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.service.IWarehouseRetentionScanService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import com.logpm.warehouse.wrapper.WarehouseRetentionRecordWrapper;
import com.logpm.warehouse.wrapper.WarehouseRetentionScanWrapper;
@ -78,9 +82,23 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
private final IBasicdataWarehouseClient warehouseClient;
// private final IDistributionReservationClient distributionReservationClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
private final IDistributionReservationClient distributionReservationClient;
@Override
public IPage<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionRecordVO> page, WarehouseRetentionRecordVO warehouseRetentionRecord) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (AuthUtil.getUser().getUserName().equals("admin")){
if (Func.isNotEmpty(myCurrentWarehouse)){
warehouseRetentionRecord.setRetentionWarehouseId(myCurrentWarehouse.getId());
}
}else {
if (Func.isEmpty(myCurrentWarehouse)){
return null;
}
warehouseRetentionRecord.setRetentionWarehouseId(myCurrentWarehouse.getId());
}
return page.setRecords(baseMapper.selectWarehouseRetentionRecordPage(page, warehouseRetentionRecord));
}
@ -165,12 +183,15 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
log.error("############用户提交空滞留列表");
return Resp.scanFail("操作失败", "无滞留包件信息");
}
//对滞留订制品包件进行去重
BladeUser user = AuthUtil.getUser();
//TODO 保存车次数据还需要处理
WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity();
warehouseRetentionRecordEntity.setTaskId(warehouseRetentionRecordDTO.getDeliveryId());
// warehouseRetentionRecordEntity.setRemark(warehouseRetentionRecordDTO.getRemark());
warehouseRetentionRecordEntity.setRetentionCarNo(warehouseRetentionRecordDTO.getTrainNumber());
warehouseRetentionRecordEntity.setRetentionType(2);
warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId());
warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName());
@ -190,7 +211,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
.eq(WarehouseRetentionScanEntity::getOrderId, r.getOrderId())
.eq(WarehouseRetentionScanEntity::getOrderCode, r.getOrderCode())
.eq(WarehouseRetentionScanEntity::getScanType, r.getScanType())
.ne(WarehouseRetentionScanEntity::getCancelRetentionStatus, IsOrNoConstant.no.getValue())
.eq(WarehouseRetentionScanEntity::getCancelRetentionStatus, IsOrNoConstant.no.getValue())
);
//避免重复添加相同的滞留包件数据
if (Func.isEmpty(retentionScanServiceOne)) {
@ -201,9 +222,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
retentionTotal.getAndAdd(r.getRetentionQuantity());
r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId());
r.setRefId(warehouseRetentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(r, WarehouseRetentionScanEntity.class));
//进行滞留之后需要对包件进行取消配送的操作
Integer conditions = r.getConditions();
warehouseRetentionScanService.save(Func.copy(r, WarehouseRetentionScanEntity.class));
switch (conditions) {
case 1:
//订制品
@ -225,37 +246,14 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
if (saveFlah.get()){
warehouseRetentionRecordEntity.setRetentionQuantity(retentionTotal.get());
this.updateById(warehouseRetentionRecordEntity);
return Resp.scanSuccess("操作成功", "操作成功");
return Resp.scanSuccess("操作成功", retentionTotal.get()+"件");
}else {
throw new RuntimeException("服务器正忙...");
}
}
@Override
public List<WarehouseRetentionRecordExcel> exportWarehouseRetentionRecord(Map<String, Object> paramMap) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("没有仓库信息!");
}
// 用户勾选数据的ids
Object ids = paramMap.get("ids");
List<String> idArr = null;
if (null != ids && !ids.toString().equals("")) {
idArr = Arrays.asList(paramMap.get("ids").toString().split(","));
}
String tenantId = AuthUtil.getTenantId();
paramMap.put("warehouseId", myCurrentWarehouse.getId());
paramMap.put("tenantId", tenantId);
List<WarehouseRetentionRecordExcel> list = baseMapper.exportWarehouseRetentionRecord(paramMap, idArr);
list.forEach(li -> {
li.setRetentionType(DictBizCache.getValue(DictBizConstant.WAREHOUSE_RETENTION_TYPE, li.getRetentionType()));
});
return list;
}
@Override
public R updateRetentionList(WarehouseRetentionRecordDTO warehouseRetentionScanDTOS) {
// 获取当前登录的仓库信息
@ -273,6 +271,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
.eq(WarehouseRetentionScanEntity::getDeliveryId, warehouseRetentionScanDTOS.getDeliveryId())
.eq(WarehouseRetentionScanEntity::getRefId, warehouseRetentionScanDTOS.getId()));
WarehouseRetentionRecordEntity retentionRecordEntity = this.getById(warehouseRetentionScanDTOS.getId());
AtomicBoolean saveFlah = new AtomicBoolean(false);
if (Func.isNotEmpty(retentionScanEntityList)) {
BladeUser user = AuthUtil.getUser();
Map<Long, WarehouseRetentionScanEntity> retentionPackageMap = retentionScanEntityList.stream().collect(Collectors.toMap(WarehouseRetentionScanEntity::getOrderPackageId, Function.identity(), (k1, k2) -> k2));
@ -291,7 +290,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
//在原列表中查询不到,这里视为新增滞留包件
rs.setRetentionScanTime(new Date());
rs.setRetentionScanUserId(user.getUserId());
rs.setRetentionScanUsername(user.getUserName());
rs.setRetentionScanUsername(user.getNickName());
// rs.setRetentionQuantity(r.getRetentionQuantity());
// retentionTotal.getAndAdd(r.getRetentionQuantity());
rs.setDeliveryId(warehouseRetentionScanDTOS.getDeliveryId());
@ -300,15 +299,15 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
switch (rs.getConditions()){
case 1:
//订制品
distributionDeliveryListClient.retentionDeliveryReservationPackage(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId(), rs.getConditions());
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId(), rs.getConditions()));
break;
case 2:
//库存品
distributionDeliveryListClient.retentionDeliveryReservationInventory(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId());
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId()));
break;
case 3:
//零担
distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId(),rs.getRetentionQuantity(),rs.getOrderId());
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(rs.getDeliveryId(), rs.getReservationId(), rs.getOrderPackageId(),rs.getRetentionQuantity(),rs.getOrderId()));
break;
}
}
@ -320,12 +319,89 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
.eq(WarehouseRetentionScanEntity::getRefId, warehouseRetentionScanDTOS.getId())).stream().mapToInt(WarehouseRetentionScanEntity::getRetentionQuantity).sum();
retentionRecordEntity.setRetentionQuantity(retentionTotal);
this.updateById(retentionRecordEntity);
return Resp.scanSuccess("操作成功", "操作成功");
if (saveFlah.get()){
return Resp.scanSuccess("操作成功", retentionTotal+"件");
}else {
throw new RuntimeException("服务器正忙...");
}
}
@Override
public List<WarehouseRetentionRecordExcel> exportWarehouseRetentionRecord(Map<String, Object> paramMap) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("没有仓库信息!");
}
// 用户勾选数据的ids
Object ids = paramMap.get("ids");
List<String> idArr = null;
if (null != ids && !ids.toString().equals("")) {
idArr = Arrays.asList(paramMap.get("ids").toString().split(","));
}
String tenantId = AuthUtil.getTenantId();
paramMap.put("warehouseId", myCurrentWarehouse.getId());
paramMap.put("tenantId", tenantId);
List<WarehouseRetentionRecordExcel> list = baseMapper.exportWarehouseRetentionRecord(paramMap, idArr);
list.forEach(li -> {
li.setRetentionType(DictBizCache.getValue(DictBizConstant.WAREHOUSE_RETENTION_TYPE, li.getRetentionType()));
});
return list;
}
@Override
public WarehouseRetentionRecordVO getDetail(Long id) {
return null;
WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = this.getById(id);
WarehouseRetentionRecordVO warehouseRetentionRecordVO = Func.copy(warehouseRetentionRecordEntity, WarehouseRetentionRecordVO.class);
//查询滞留列表信息 然后这里需要对滞留包件进行分组处理
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = baseMapper.selectWarehouseRetentionScanVoList(id);
if (Func.isEmpty(warehouseRetentionScanVOS)){
log.info("##########查询滞留包件信息空:{}",id);
return null;
}
warehouseRetentionRecordVO.setRetentionScanVOList(warehouseRetentionScanVOS);
//查询配送信息
List<Long> deliveryIds = warehouseRetentionScanVOS.stream().filter(del -> Func.isNotEmpty(del.getDeliveryId())).map(WarehouseRetentionScanVO::getDeliveryId).distinct().collect(Collectors.toList());
if (deliveryIds.size() == 1){
DistributionDeliveryListVO deliveryDriverInfo = distributionDeliveryListClient.getRetentionDelivery(deliveryIds.get(0));
if (Func.isNotEmpty(deliveryDriverInfo)){
warehouseRetentionRecordVO.setDeliveryListVO(deliveryDriverInfo);
}
}else {
return null;
}
//获取客户信息
List<Long> reservationIds = warehouseRetentionScanVOS.stream().filter(f->Func.isNotEmpty(f.getReservationId())).map(WarehouseRetentionScanVO::getReservationId).collect(Collectors.toList());
if (Func.isNotEmpty(reservationIds)){
String ids = reservationIds.stream().map(Objects::toString).collect(Collectors.joining(","));
List<DistributionReservationEntity> reservationEntityList = distributionReservationClient.getReservationList(ids);
if (Func.isNotEmpty(reservationEntityList)){
//构造滞留所需要展示的预约信息
warehouseRetentionRecordVO.setReservationEntityList(reservationEntityList);
}else {
log.error("##########查询多个预约ID为空:{}",reservationIds);
return null;
}
}else {
return null;
}
return warehouseRetentionRecordVO;
}
@Override
public List<WarehouseRetentionScanVO> getRetentionPackageByType(Long retentionId, Integer type) {
if (type == 0){
type = null;
}
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = baseMapper.selectWarehouseRetentionScanVoListByType(retentionId,type);
return warehouseRetentionScanVOS;
}
}

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

@ -448,6 +448,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();
String filterValue = trayTypeEntity.getFilterValue();
if(StringUtil.isBlank(filterValue)){
filterValue = "";
}
Long trayTypeId = trayTypeEntity.getId();
Long trayTypeEntityWarehouseId = trayTypeEntity.getWarehouseId();
@ -642,6 +645,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();
String filterValue = trayTypeEntity.getFilterValue();
if(StringUtil.isBlank(filterValue)){
filterValue = "";
}
Long trayTypeId = trayTypeEntity.getId();
Long trayTypeEntityWarehouseId = trayTypeEntity.getWarehouseId();

Loading…
Cancel
Save