Browse Source

1.干线基础数据开发

2.干线bug修复,代码优化
visual
zhenghaoyu 6 months ago
parent
commit
fbf3b81e7e
  1. 18
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 12
      blade-biz-common/src/main/java/org/springblade/common/model/NodeFanoutMsg.java
  3. 71
      blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java
  4. 163
      blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportPackageBasicEntity.java
  5. 119
      blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportPackageTrunklineEntity.java
  6. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  7. 44
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLinePhotoEntity.java
  8. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadClient.java
  9. 13
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CustmoerUnloadNumVO.java
  10. 5
      blade-service/logpm-aftersales/pom.xml
  11. 12
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAyscService.java
  12. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/ISendFanoutService.java
  13. 46
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  14. 103
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAyscServiceImpl.java
  15. 21
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/SendFanoutServiceImpl.java
  16. 27
      blade-service/logpm-aftersales/src/main/resources/application-dev.yml
  17. 27
      blade-service/logpm-aftersales/src/main/resources/application-prod.yml
  18. 26
      blade-service/logpm-aftersales/src/main/resources/application-test.yml
  19. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  20. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataStoreBrandMapper.java
  21. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataStoreBrandMapper.xml
  22. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java
  23. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  24. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  25. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  26. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageBasicMapper.java
  27. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageBasicMapper.xml
  28. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageTrunklineMapper.java
  29. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageTrunklineMapper.xml
  30. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  31. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  32. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportPackageBasicService.java
  33. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportPackageTrunklineService.java
  34. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageBasicServiceImpl.java
  35. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageTrunklineServiceImpl.java
  36. 21
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  37. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderDataVO.java
  38. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexOpenItemDataVO.java
  39. 45
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  40. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineCarsLoadClient.java
  41. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  42. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  43. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java
  44. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java
  45. 36
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java
  46. 19
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java
  47. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  48. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  49. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  50. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  51. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java
  52. 330
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  53. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  54. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  55. 236
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  56. 164
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  57. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  58. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  59. 99
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  60. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java
  61. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  62. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  63. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java
  64. 27
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

18
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -7,9 +7,27 @@ import org.springblade.common.constant.ModuleNameConstant;
*/
public abstract class FanoutConstants {
// 干线
public interface trunkline {
// 数据入库
interface REPORTDATA {
// 交换机
String EXCHANGE = "fanout.trunkline.reportdata" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
// 保存基础数据
String REPORT_BASICDATA = "fanout.trunkline.reportdata.report.basicData" + ModuleNameConstant.DEVAUTH;
}
}
// 开单
interface OPENWAYBILL {

12
blade-biz-common/src/main/java/org/springblade/common/model/NodeFanoutMsg.java

@ -1,6 +1,5 @@
package org.springblade.common.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -40,10 +39,14 @@ public class NodeFanoutMsg<T> implements Serializable {
*/
private String operator;
/**
* 操作人id
*/
private Long operatorId;
/**
* 操作时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date operatorTime;
/**
@ -51,6 +54,11 @@ public class NodeFanoutMsg<T> implements Serializable {
*/
private String warehouse;
/**
* 当前仓id
*/
private Long warehouseId;
/**
* 当前仓ID
*/

71
blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java

@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
import org.springblade.common.enums.PackageTypeEnums;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
@ -29,10 +30,26 @@ public class PackageData implements Serializable {
* 订单号
*/
private String orderCode;
/**
* 服务号
*/
private String serviceNo;
/**
* 运单号
*/
private String waybillNumber;
/**
* 品类名称
*/
private String productName ;
/**
* 品类id
*/
private Long productId ;
/**
* 批次号
*/
@ -45,6 +62,10 @@ public class PackageData implements Serializable {
* 物料Code
*/
private String materialCode;
/**
* 物料id
*/
private Long materialId ;
/**
* 商场
*/
@ -53,6 +74,19 @@ public class PackageData implements Serializable {
* 数量
*/
private Integer number;
/**
* 数量
*/
private Integer num;
/**
* 重量
*/
private BigDecimal weight;
/**
* 体积
*/
private BigDecimal volume;
/**
* 包件类型 订制品库存品零担
*/
@ -68,16 +102,45 @@ public class PackageData implements Serializable {
* 品牌
*/
private String brand;
/**
* 客户车次号
*/
private String customerTrain ;
/**
* 结算品类
* 零担的开单品类
*
* 工厂商场编码
*/
private String productName;
private String dealerCode ;
/**
* 工厂商场名称
*/
private String dealerName ;
/**
* 合包码
*/
private String mergePackageCode ;
/**
* 入库类型
*/
private Integer incomingType ;
/**
* 品牌id
*/
private Long brandId ;
/**
* 品牌
*/
private String brandName ;
/**
* 订单来源
*/
private String systemType ;
}

163
blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportPackageBasicEntity.java

@ -0,0 +1,163 @@
package com.logpm.report.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_report_package_basic")
@ApiModel(value = "ReportPackageBasic对象", description = "报表基础信息类")
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ReportPackageBasicEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
@ApiModelProperty(name = "运单号",notes = "")
private String waybillNo ;
@ApiModelProperty(name = "服务号",notes = "")
private String serviceNo ;
@ApiModelProperty(name = "订单号",notes = "")
private String orderCode ;
@ApiModelProperty(name = "包件码",notes = "")
private String orderPackageCode ;
@ApiModelProperty(name = "品类名称",notes = "")
private String productName ;
@ApiModelProperty(name = "品类id",notes = "")
private Long productId ;
@ApiModelProperty(name = "数量",notes = "")
private Integer num ;
@ApiModelProperty(name = "重量",notes = "")
private BigDecimal weight ;
@ApiModelProperty(name = "体积",notes = "")
private BigDecimal volume ;
@ApiModelProperty(name = "入库时间",notes = "")
private Date incomingTime ;
@ApiModelProperty(name = "入库人",notes = "")
private String incomingUserName ;
@ApiModelProperty(name = "入库人id",notes = "")
private Long incomingUserId ;
@ApiModelProperty(name = "数据推送时间",notes = "")
private Date pushTime ;
@ApiModelProperty(name = "数据推送人",notes = "")
private String pushUserName ;
@ApiModelProperty(name = "数据推送人id",notes = "")
private Long pushUserId ;
@ApiModelProperty(name = "开单时间",notes = "")
private Date openTime ;
@ApiModelProperty(name = "开单人",notes = "")
private String openUserName ;
@ApiModelProperty(name = "开单人id",notes = "")
private Long openUserId ;
@ApiModelProperty(name = "数据类型 1订制品 2零担",notes = "")
private Integer dataType ;
@ApiModelProperty(name = "客户车次号",notes = "")
private String customerTrain ;
@ApiModelProperty(name = "物料名称",notes = "")
private String materialName ;
@ApiModelProperty(name = "物料id",notes = "")
private Long materialId ;
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
@ApiModelProperty(name = "发货单位名称",notes = "")
private String shipper;
@ApiModelProperty(name = "发货单位id",notes = "")
private Long shipperId;
@ApiModelProperty(name = "收货单位名称",notes = "")
private String consignee ;
@ApiModelProperty(name = "收货单位id",notes = "")
private Long consigneeId ;
@ApiModelProperty(name = "发站仓",notes = "")
private String departureWarehouseName ;
@ApiModelProperty(name = "发站仓id",notes = "")
private Long departureWarehouseId ;
@ApiModelProperty(name = "目的仓",notes = "")
private String destinationWarehouseName ;
@ApiModelProperty(name = "目的仓id",notes = "")
private Long destinationWarehouseId ;
@ApiModelProperty(name = "发站",notes = "")
private String departure ;
@ApiModelProperty(name = "到站",notes = "")
private String destination ;
@ApiModelProperty(name = "工厂商场编码",notes = "")
private String dealerCode ;
@ApiModelProperty(name = "工厂商场名称",notes = "")
private String dealerName ;
@ApiModelProperty(name = "合包码",notes = "")
private String mergePackageCode ;
@ApiModelProperty(name = "入库类型",notes = "")
private Integer incomingType ;
@ApiModelProperty(name = "品牌id",notes = "")
private Long brandId ;
@ApiModelProperty(name = "品牌",notes = "")
private String brand ;
@ApiModelProperty(name = "订单来源",notes = "")
private String systemType ;
@ApiModelProperty(name = "入库状态",notes = "")
private Integer incomingStatus ;
@ApiModelProperty(name = "是否改过单",notes = "")
private Integer isEditWaybill ;
}

119
blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportPackageTrunklineEntity.java

@ -0,0 +1,119 @@
package com.logpm.report.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_report_package_trunkline")
@ApiModel(value = "ReportPackageTrunkline对象", description = "报表干线信息类")
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ReportPackageTrunklineEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
@ApiModelProperty(name = "基础id",notes = "")
private Long basicId ;
@ApiModelProperty(name = "运单号",notes = "")
private String waybillNo ;
@ApiModelProperty(name = "服务号",notes = "")
private String serviceNo ;
@ApiModelProperty(name = "订单号",notes = "")
private String orderCode ;
@ApiModelProperty(name = "包件码",notes = "")
private String orderPackageCode ;
@ApiModelProperty(name = "品类名称",notes = "")
private String productName ;
@ApiModelProperty(name = "品类id",notes = "")
private Long productId ;
@ApiModelProperty(name = "品牌",notes = "")
private String brand ;
@ApiModelProperty(name = "品牌id",notes = "")
private Long brandId ;
@ApiModelProperty(name = "发站仓",notes = "")
private String departureWarehouseName ;
@ApiModelProperty(name = "发站仓id",notes = "")
private Long departureWarehouseId ;
@ApiModelProperty(name = "目的仓",notes = "")
private String destinationWarehouseName ;
@ApiModelProperty(name = "目的仓id",notes = "")
private Long destinationWarehouseId ;
@ApiModelProperty(name = "装车仓库id",notes = "")
private Long loadingWarehouseId ;
@ApiModelProperty(name = "装车仓库",notes = "")
private String loadingWarehouseName ;
@ApiModelProperty(name = "装车人id",notes = "")
private Long loadingUserId ;
@ApiModelProperty(name = "装车人名称",notes = "")
private String loadingUserName ;
@ApiModelProperty(name = "是否是始发仓",notes = "")
private Integer isStartWarehouse ;
@ApiModelProperty(name = "卸车仓库id",notes = "")
private Long unloadWarehouseId ;
@ApiModelProperty(name = "卸车仓库",notes = "")
private String unloadWarehouseName ;
@ApiModelProperty(name = "卸车人id",notes = "")
private Long unloadUserId ;
@ApiModelProperty(name = "卸车人名称",notes = "")
private String unloadUserName ;
@ApiModelProperty(name = "是否是目的仓仓",notes = "")
private Integer isEndWarehouse ;
@ApiModelProperty(name = "干线状态 1装车 2卸车 3签收",notes = "")
private Integer trunklineStatus ;
@ApiModelProperty(name = "是否是直发商家 0否 1是",notes = "")
private Integer isCustomer ;
@ApiModelProperty(name = "装车数量",notes = "")
private Integer loadingNum ;
@ApiModelProperty(name = "卸车数量",notes = "")
private Integer unloadNum ;
@ApiModelProperty(name = "签收数量",notes = "")
private Integer signNum ;
}

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

@ -221,4 +221,7 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
private String costCategoryName;//成本品类名称
@ApiModelProperty(name = "入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库", notes = "")
private Integer incomingType;
}

44
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLinePhotoEntity.java

@ -0,0 +1,44 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_trunkline_cars_load_line_photo")
@ApiModel(value = "TrunklineCarsLoadLinePhoto对象", description = "车辆配载节点图片表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineCarsLoadLinePhotoEntity extends TenantEntity{
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 车辆配载id */
@ApiModelProperty(name = "车辆配载id",notes = "")
private Long loadId ;
/** 车辆配载节点id */
@ApiModelProperty(name = "车辆配载节点id",notes = "")
private Long loadNodeId ;
/** 图片类型 1*/
@ApiModelProperty(name = "图片类型",notes = "")
private Integer type ;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadClient.java

@ -16,4 +16,6 @@ public interface ITrunklineCarsLoadClient {
@GetMapping(API_PREFIX+"/findEntityByCarsNo")
TrunklineCarsLoadEntity findEntityByCarsNo(@RequestParam String carsNo);
@GetMapping(API_PREFIX+"/findEntityByLoadId")
TrunklineCarsLoadEntity findEntityByLoadId(@RequestParam Long loadId);
}

13
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CustmoerUnloadNumVO.java

@ -0,0 +1,13 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class CustmoerUnloadNumVO implements Serializable {
private Integer loadingNum;
private Integer unloadNum;
}

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

@ -102,6 +102,11 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<!--mq-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
<build>
<plugins>

12
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAyscService.java

@ -0,0 +1,12 @@
package com.logpm.aftersales.service;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import org.springblade.common.model.PackageData;
import java.util.List;
public interface IAftersalesAyscService {
void sendReportPackageUnloadData(String nickName, Long userId, Long id, String name, AftersalesAbnormalRecordEntity abnormalRecordEntity, List<String> orderPackageCodeList);
void sendReportZeroUnloadData(Long userId, String nickName, Long id, String name, AftersalesAbnormalRecordEntity abnormalRecordEntity, List<PackageData> packageDataList);
}

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/ISendFanoutService.java

@ -0,0 +1,7 @@
package com.logpm.aftersales.service;
import org.springblade.common.model.FanoutMsg;
public interface ISendFanoutService {
void sendFanoutMsg(FanoutMsg fanoutMsg);
}

46
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -9,6 +9,7 @@ import com.logpm.aftersales.dto.AbnormalRecordDTO;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import com.logpm.aftersales.mapper.AftersalesAbnormalRecordMapper;
import com.logpm.aftersales.service.IAftersalesAyscService;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordService;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordZeroDetailService;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -29,6 +30,8 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.PackageData;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
@ -67,6 +70,8 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
private final ITrunklineScanZeroDetailClient scanZeroDetailClient;
private final IAftersalesAyscService aftersakesAyscService;
@Override
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) {
IPage<Object> page = new Page<>();
@ -117,6 +122,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
if("1".equals(abnormalType)){
Integer dealType = abnormalRecordDTO.getDealType();
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
String orderPackageCode = abnormalRecordEntity.getOrderPackageCode();
if(dealType.equals(1)){
//无效包条码
abnormalRecordEntity.setRemark("已确认为无效包条码("+upWarehouseName+" "+AuthUtil.getNickName()+")");
@ -131,10 +137,17 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
if(code != 200){
return r;
}
//发送异常列表包件入库
List<String> orderPackageCodeList = new ArrayList<>();
orderPackageCodeList.add(orderPackageCode);
aftersakesAyscService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abnormalRecordEntity,orderPackageCodeList);
}
}else if("4".equals(abnormalType)){
Integer dealType = abnormalRecordDTO.getDealType();
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
String orderPackageCode = abnormalRecordEntity.getOrderPackageCode();
if(dealType.equals(3)){
//本车次少货
abnormalRecordEntity.setRemark("本车次少货("+upWarehouseName+" "+AuthUtil.getNickName()+")");
@ -149,6 +162,12 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
//已入库
abnormalRecordEntity.setRemark("已入库("+upWarehouseName+" "+AuthUtil.getNickName()+")");
//发送异常列表包件入库
List<String> orderPackageCodeList = new ArrayList<>();
orderPackageCodeList.add(orderPackageCode);
aftersakesAyscService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abnormalRecordEntity,orderPackageCodeList);
}
}else if("5".equals(abnormalType)){
@ -183,6 +202,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
recordZeroDetailService.updateBatchById(recordZeroDetailEntities);
abnormalRecordEntity.setRemark("差异件数退回原仓");
}else if(dealType.equals(6)){
List<PackageData> packageDataList = new ArrayList<>();
//入库本仓
Integer enterNum = abnormalRecordDTO.getNum();
//把scanZeroDetailEntityList转化成以packageId为key的map
@ -296,6 +316,16 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
updateScanZeroDetailEntity.setId(scanZeroDetailEntity.getId());
updateScanZeroDetailEntity.setUnloadNum(scanZeroDetailEntity.getUnloadNum()+packageEnterNum);
updateScanZeroDetailEntityList.add(updateScanZeroDetailEntity);
PackageData packageData = new PackageData();
packageData.setOrderCode(orderCode);
packageData.setWaybillNumber(orderCode);
packageData.setProductId(goodsId);
packageData.setProductName(zeroPackageDTO.getGoodsName());
packageData.setNum(packageEnterNum);
packageData.setPackageType(PackageTypeEnums.INV);
packageDataList.add(packageData);
});
if(CollUtil.isNotEmpty(updateRecordZeroDetailList)){
recordZeroDetailService.updateBatchById(updateRecordZeroDetailList);
@ -306,6 +336,9 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
if(CollUtil.isNotEmpty(addParcelNumberEntityList)){
parcelNumberClient.addBatch(addParcelNumberEntityList);
}
}
}else{
Long orderId = currentStockArticleEntity.getId();
@ -358,6 +391,16 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
updateParceNumberEntity.setId(parcelNumberEntity.getId());
updateParceNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity()+packageNum);
updateParcelNumberEntityList.add(updateParceNumberEntity);
PackageData packageData = new PackageData();
packageData.setOrderCode(orderCode);
packageData.setWaybillNumber(orderCode);
packageData.setProductId(goodsId);
packageData.setProductName(goodsName);
packageData.setNum(packageNum);
packageData.setPackageType(PackageTypeEnums.INV);
packageDataList.add(packageData);
});
if(CollUtil.isNotEmpty(updateScanZeroDetailEntityList)){
@ -405,6 +448,9 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
addWaybillTrackDTO.setNickName(AuthUtil.getNickName());
trunklineWaybillTrackClient.addWaybillLog(addWaybillTrackDTO);
//发送零担异常卸车数据
aftersakesAyscService.sendReportZeroUnloadData(AuthUtil.getUserId(),AuthUtil.getNickName(),myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abnormalRecordEntity,packageDataList);
// if(warehouseId.equals(destinationWarehouseId)){
// TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
// if(!Objects.isNull(waybillOrderEntity)){

103
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAyscServiceImpl.java

@ -0,0 +1,103 @@
package com.logpm.aftersales.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.service.IAftersalesAyscService;
import com.logpm.aftersales.service.ISendFanoutService;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadClient;
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient;
import groovy.util.logging.Slf4j;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
public class AftersalesAyscServiceImpl implements IAftersalesAyscService {
@Resource
private ISendFanoutService sendFanoutService;
@Resource
private ITrunklineCarsLoadScanClient trunklineCarsLoadScanClient;
@Resource
private ITrunklineCarsLoadClient trunklineCarsLoadClient;
@LogpmAsync("asyncExecutor")
@Override
public void sendReportPackageUnloadData(String nickName, Long userId, Long warehouseId, String warehouseName, AftersalesAbnormalRecordEntity abnormalRecordEntity, List<String> orderPackageCodeList) {
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
TrunklineCarsLoadScanEntity trunklineCarsLoadScan = trunklineCarsLoadScanClient.findEntityById(carsLoadScanId);
Long loadId = trunklineCarsLoadScan.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = trunklineCarsLoadClient.findEntityByLoadId(loadId);
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
orderPackageCodeList.forEach(packageCode -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(packageCode);
packageData.setNum(1);
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public void sendReportZeroUnloadData(Long userId, String nickName, Long warehouseId, String warehouseName, AftersalesAbnormalRecordEntity abnormalRecordEntity, List<PackageData> packageDataList) {
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
TrunklineCarsLoadScanEntity trunklineCarsLoadScan = trunklineCarsLoadScanClient.findEntityById(carsLoadScanId);
Long loadId = trunklineCarsLoadScan.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = trunklineCarsLoadClient.findEntityByLoadId(loadId);
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
}

21
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/SendFanoutServiceImpl.java

@ -0,0 +1,21 @@
package com.logpm.aftersales.service.impl;
import com.logpm.aftersales.service.ISendFanoutService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import org.springblade.common.model.FanoutMsg;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Slf4j
@AllArgsConstructor
public class SendFanoutServiceImpl implements ISendFanoutService {
private final RabbitTemplate rabbitTemplate;
@Override
public void sendFanoutMsg(FanoutMsg fanoutMsg) {
rabbitTemplate.convertAndSend(fanoutMsg.getExchange(),null, fanoutMsg.getMsg());
}
}

27
blade-service/logpm-aftersales/src/main/resources/application-dev.yml

@ -10,6 +10,33 @@ server:
# password: ${blade.datasource.dev.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.46
port: 5672
username: admin
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

27
blade-service/logpm-aftersales/src/main/resources/application-prod.yml

@ -10,6 +10,33 @@ server:
# password: ${blade.datasource.prod.password}
spring:
#rabbitmq配置
rabbitmq:
host: 172.16.128.145
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

26
blade-service/logpm-aftersales/src/main/resources/application-test.yml

@ -10,6 +10,32 @@ server:
# password: ${blade.datasource.test.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.110
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -63,11 +63,9 @@
lbc.blade_region_province_id provinceId,
lbc.blade_region_city_id cityId,
lbc.blade_region_area_id areaId,
lbc.default_payment_methods defaultPayWay,
t.brand_id brandId
lbc.default_payment_methods defaultPayWay
from logpm_basicdata_client lbc
left join logpm_basicdata_store_contact lbsc on lbsc.shop_id = lbc.id
left join (select lbsb.client_id,max(lbsb.brand_id) brand_id from logpm_basicdata_store_brand lbsb group by lbsb.client_id) t on t.client_id = lbc.id
where lbc.is_deleted = 0
<if test="clientName != null and clientName != ''">
and lbc.client_name like CONCAT('%',#{clientName},'%')

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataStoreBrandMapper.java

@ -66,4 +66,6 @@ public interface BasicdataStoreBrandMapper extends BaseMapper<BasicdataStoreBran
* @return
*/
List<BasicdataStoreBrandVO> listNameBrand(@Param("ew") QueryWrapper<BasicdataStoreBrandEntity> queryWrapper);
List<BasicdataStoreBrandEntity> findListByClientIds(@Param("clientIds") List<Long> clientIds);
}

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataStoreBrandMapper.xml

@ -32,4 +32,13 @@
SELECT * FROM logpm_basicdata_store_brand ${ew.customSqlSegment}
</select>
<select id="findListByClientIds" resultType="com.logpm.basicdata.entity.BasicdataStoreBrandEntity">
select *
from logpm_basicdata_store_brand
where is_deleted = 0 and client_id in
<foreach collection="clientIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreBrandService.java

@ -79,4 +79,6 @@ public interface IBasicdataStoreBrandService extends BaseService<BasicdataStoreB
* @return
*/
R removeClientBrand(String ids);
List<BasicdataStoreBrandEntity> findListByClientIds(List<Long> clientIds);
}

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

@ -815,8 +815,19 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
public List<JSONObject> findListByClientName(String clientName, String linkMan, String linkPhone) {
List<ClientInfoVO> ls = baseMapper.findListByClientName(clientName, linkMan, linkPhone);
//把ls中所有元素的clientId放入一个list中
List<Long> clientIds = ls.stream().map(ClientInfoVO::getClientId).collect(Collectors.toList());
List<BasicdataStoreBrandEntity> storeBrandEntities = basicdataStoreBrandService.findListByClientIds(clientIds);
//把storeBrandEntities中所有元素通过clientId分组
Map<Long, List<BasicdataStoreBrandEntity>> collect = storeBrandEntities.stream().collect(Collectors.groupingBy(BasicdataStoreBrandEntity::getClientId));
List<JSONObject> list = new ArrayList<>();
for (ClientInfoVO clientInfoVO : ls) {
Long clientId = clientInfoVO.getClientId();
List<BasicdataStoreBrandEntity> storeBrandEntityList = collect.get(clientId);
if(storeBrandEntityList.size() == 1){
clientInfoVO.setBrandId(storeBrandEntityList.get(0).getBrandId());
}
list.add(JSON.parseObject(JSON.toJSONString(clientInfoVO)));
}
return list;

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java

@ -226,6 +226,11 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
return R.status(this.deleteLogic(list));
}
@Override
public List<BasicdataStoreBrandEntity> findListByClientIds(List<Long> clientIds) {
return baseMapper.findListByClientIds(clientIds);
}
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object, Boolean> seen = new ConcurrentHashMap<>(16);
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;

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

@ -2535,24 +2535,31 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// 订单号 生成二维码
String fileTypeName = QRCodeUtil.createCodeToFile(orderCode);
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
if (orderCode.equals(waybillNo)) {
map.put("product", descriptionGoods + "(" + totalNumber + ")");
} else {
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stock_article_id", Long.parseLong(orderId));
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
StringBuilder product = new StringBuilder();
for (DistributionParcelListEntity parcelListEntity : list) {
String firsts = parcelListEntity.getFirsts();
Integer quantity = parcelListEntity.getQuantity();
if (StringUtils.isBlank(product)) {
product.append(firsts).append("(").append(quantity).append(")");
} else {
product.append(",").append(firsts).append("(").append(quantity).append(")");
}
}
map.put("product", product.toString());
}
// if (orderCode.equals(waybillNo)) {
// map.put("product", descriptionGoods + "(" + totalNumber + ")");
// } else {
// QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("stock_article_id", Long.parseLong(orderId));
// List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
// StringBuilder product = new StringBuilder();
// for (DistributionParcelListEntity parcelListEntity : list) {
// String firsts = parcelListEntity.getFirsts();
// Integer quantity = parcelListEntity.getQuantity();
// if (StringUtils.isBlank(product)) {
// product.append(firsts).append("(").append(quantity).append(")");
// } else {
// product.append(",").append(firsts).append("(").append(quantity).append(")");
// }
// }
// map.put("product", product.toString());
// }
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
List<String> productsNumList = new ArrayList<>();
wayBillDetailList.forEach(wayBillDetail -> {
productsNumList.add(wayBillDetail.getProductName() + "(" + wayBillDetail.getNum() + ")");
});
map.put("product", String.join(",",productsNumList));
data.add(map);
}

12
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageBasicMapper.java

@ -0,0 +1,12 @@
package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.report.entity.ReportPackageBasicEntity;
import org.mapstruct.Mapper;
@Mapper
public interface ReportPackageBasicMapper extends BaseMapper<ReportPackageBasicEntity> {
}

7
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageBasicMapper.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.ReportPackageBasicMapper">
</mapper>

12
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageTrunklineMapper.java

@ -0,0 +1,12 @@
package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.report.entity.ReportPackageTrunklineEntity;
import org.mapstruct.Mapper;
@Mapper
public interface ReportPackageTrunklineMapper extends BaseMapper<ReportPackageTrunklineEntity> {
}

7
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportPackageTrunklineMapper.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.ReportPackageTrunklineMapper">
</mapper>

4
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -5,17 +5,17 @@ import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.IndexHandOrderDataVO;
import com.logpm.report.vo.IndexTrunklineCarsDataVO;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexOpenItemDataVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Mapper
public interface WarehouseIndexMapper {
int findTotalNum(@Param("param") IndexDTO indexDTO);
IndexOpenItemDataVO findTotalNum(@Param("param") IndexDTO indexDTO);
BigDecimal findTotalFee(@Param("param") IndexDTO indexDTO);

5
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -2,8 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.report.mapper.WarehouseIndexMapper">
<select id="findTotalNum" resultType="int">
select IFNULL(count(id),0)
<select id="findTotalNum" resultType="com.logpm.report.vo.indexCount.IndexOpenItemDataVO">
select IFNULL(count(id),0) totalNum,
IFNULL(sum(total_count),0) totalCount
from logpm_warehouse_waybill
where 1=1
<if test="param.startDate != null">

7
blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportPackageBasicService.java

@ -0,0 +1,7 @@
package com.logpm.report.service;
import com.logpm.report.entity.ReportPackageBasicEntity;
import org.springblade.core.mp.base.BaseService;
public interface IReportPackageBasicService extends BaseService<ReportPackageBasicEntity> {
}

7
blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportPackageTrunklineService.java

@ -0,0 +1,7 @@
package com.logpm.report.service;
import com.logpm.report.entity.ReportPackageTrunklineEntity;
import org.springblade.core.mp.base.BaseService;
public interface IReportPackageTrunklineService extends BaseService<ReportPackageTrunklineEntity> {
}

15
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageBasicServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.report.service.impl;
import com.logpm.report.entity.ReportPackageBasicEntity;
import com.logpm.report.mapper.ReportPackageBasicMapper;
import com.logpm.report.service.IReportPackageBasicService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class ReportPackageBasicServiceImpl extends BaseServiceImpl<ReportPackageBasicMapper, ReportPackageBasicEntity> implements IReportPackageBasicService {
}

15
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageTrunklineServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.report.service.impl;
import com.logpm.report.entity.ReportPackageTrunklineEntity;
import com.logpm.report.mapper.ReportPackageTrunklineMapper;
import com.logpm.report.service.IReportPackageTrunklineService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class ReportPackageTrunklineServiceImpl extends BaseServiceImpl<ReportPackageTrunklineMapper, ReportPackageTrunklineEntity> implements IReportPackageTrunklineService {
}

21
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -6,11 +6,10 @@ import com.logpm.report.mapper.WarehouseIndexMapper;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexOpenItemDataVO;
import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
@ -19,9 +18,11 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.MathContext;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@ -40,7 +41,9 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
return indexOpenOrderDataVO;
}
indexOpenOrderDataVO.setTotalNum(warehouseIndexMapper.findTotalNum(indexDTO));
IndexOpenItemDataVO indexOpenItemDataVO = warehouseIndexMapper.findTotalNum(indexDTO);
indexOpenOrderDataVO.setTotalNum(indexOpenItemDataVO.getTotalNum());
indexOpenOrderDataVO.setTotalCount(indexOpenItemDataVO.getTotalCount());
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
@ -54,7 +57,9 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
Date dayEnd = calendar.getTime();
indexDTO.setStartDate(dayStart);
indexDTO.setEndDate(dayEnd);
indexOpenOrderDataVO.setDayNum(warehouseIndexMapper.findTotalNum(indexDTO));
IndexOpenItemDataVO dayNumVO = warehouseIndexMapper.findTotalNum(indexDTO);
indexOpenOrderDataVO.setDayNum(dayNumVO.getTotalNum());
indexOpenOrderDataVO.setDayCount(dayNumVO.getTotalCount());
// 设置日为1,以获取当前月的第一天
calendar.set(Calendar.DAY_OF_MONTH, 1);
// 将小时、分钟、秒和毫秒设置为0,确保获取的是完整的第一天
@ -77,7 +82,9 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
Date lastDayOfMonth = calendar.getTime(); // 获取最后一天
indexDTO.setStartDate(firstDayOfMonth);
indexDTO.setEndDate(lastDayOfMonth);
indexOpenOrderDataVO.setMonthNum(warehouseIndexMapper.findTotalNum(indexDTO));
IndexOpenItemDataVO monthNumVO = warehouseIndexMapper.findTotalNum(indexDTO);
indexOpenOrderDataVO.setMonthNum(monthNumVO.getTotalNum());
indexOpenOrderDataVO.setMonthCount(monthNumVO.getTotalCount());
return indexOpenOrderDataVO;
}

5
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderDataVO.java

@ -12,4 +12,9 @@ public class IndexOpenOrderDataVO implements Serializable {
private int monthNum = 0;
private int dayNum = 0;
private int totalCount = 0;
private int monthCount = 0;
private int dayCount = 0;
}

13
blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexOpenItemDataVO.java

@ -0,0 +1,13 @@
package com.logpm.report.vo.indexCount;
import lombok.Data;
import java.io.Serializable;
@Data
public class IndexOpenItemDataVO implements Serializable {
private int totalNum = 0;
private int totalCount = 0;
}

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

@ -989,6 +989,51 @@ public class CarsLoadController {
}
@ResponseBody
@PostMapping("/unloadByLoadIdBefore")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "卸车确认之前", notes = "传入loadCarsDTO")
public R unloadByLoadIdBefore(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############unloadByLoadIdBefore: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
Integer unloadType = loadCarsDTO.getUnloadType();
try {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "多仓权限无法操作,请选择仓库");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if (Objects.isNull(loadId)) {
log.warn(method + "请选择一条配载计划 loadId={}", loadId);
return R.fail(405, "请选择一条配载计划");
}
if (Objects.isNull(unloadType)) {
log.warn(method + "卸车确认类型不能为空 unloadType={}", unloadType);
return R.fail(405, "卸车确认类型不能为空");
}
// if(startCarType != 1 && startCarType != 2){
// log.warn(method+"未知的发车类型 startCarType={}",startCarType);
// return R.fail(405,"未知的发车类型");
// }
return carsLoadService.unloadByLoadIdBefore(loadCarsDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, "系统异常");
}
}
@ResponseBody
@PostMapping("/unloadByLoadId")
@ApiOperationSupport(order = 1)

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

@ -20,4 +20,9 @@ public class TrunklineCarsLoadClient implements ITrunklineCarsLoadClient{
queryWrapper.eq("cars_no",carsNo);
return carsLoadService.getOne(queryWrapper);
}
@Override
public TrunklineCarsLoadEntity findEntityByLoadId(Long loadId) {
return carsLoadService.getById(loadId);
}
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -183,4 +183,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<SignPackageVO> findSignPackageListBySignOrderId(@Param("signOrderId") Long signOrderId);
List<Long> findAllIdListByLoadIdAndScanStatus(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus);
CustmoerUnloadNumVO findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -984,4 +984,14 @@
and scan_status = #{scanStatus}
</select>
<select id="findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId" resultType="com.logpm.trunkline.vo.CustmoerUnloadNumVO">
select IFNULL(sum(num),0) loadingNum,
IFNULL(sum(unload_num),0) unloadNum
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and unload_node_id = #{warehouseId}
and sign_order_id is not null
</select>
</mapper>

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java

@ -70,4 +70,5 @@ public interface TrunklineCarsOrderMapper extends BaseMapper<TrunklineCarsOrderE
List<SignScanOrderVO> findSignOrderListBySignOrderId(@Param("signOrderId") Long signOrderId);
List<SignScanOrderVO> findSignZeroOrderListBySignOrderId(@Param("signOrderId") Long signOrderId);
}

16
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java

@ -24,6 +24,7 @@ import com.logpm.trunkline.service.ITrunklineDetailProductService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
@ -32,12 +33,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* 监听工厂数据转暂存单
@ -176,6 +172,14 @@ public class AdvanceOrderListener {
//发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
detailProductService.saveBatch(detailProductEntityList);
//发送报表数据广播
Long warehouseId = advanceEntity.getWarehouseId();
String warehouseName = advanceEntity.getWarehouseName();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntityList,dealerCode,dealerName);
}
}
}

36
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.mq;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
@ -10,6 +11,7 @@ import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
@ -18,6 +20,8 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Slf4j
@AllArgsConstructor
@ -33,6 +37,7 @@ public class OpenOrderToLoadListener {
private final ITrunklineCarsLoadLineService carsLoadLineService;
private final ITrunklineWaybillOrderService waybillOrderService;
private final IInComingService inComingService;
private final ICarsLoadAsyncService carsLoadAsyncService;
@RabbitHandler
@Transactional(rollbackFor = Exception.class)
@ -40,6 +45,7 @@ public class OpenOrderToLoadListener {
String msg = (String) map.get("messageData");
log.info("###########openOrderToLoadScan: 开单补录包件运单信息 msg={}",msg);
if(StringUtil.isNotBlank(msg)){
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = new ArrayList<>();
JSONObject jsonObject = JSONUtil.parseObj(msg);
Long waybillId = jsonObject.getLong("waybillId");
String waybillNo = jsonObject.getStr("waybillNo");
@ -75,6 +81,7 @@ public class OpenOrderToLoadListener {
carsLoadScanEntity.setFromWarehouseId(advanceDetailEntity.getIncomingWarehouseId());
}
carsLoadScanService.updateById(carsLoadScanEntity);
carsLoadScanEntityList.add(carsLoadScanEntity);
Long loadId = carsLoadScanEntity.getLoadId();
Long warehouseId = carsLoadScanEntity.getWarehouseId();
@ -121,6 +128,35 @@ public class OpenOrderToLoadListener {
for (Long loadId : loadIds) {
carsLoadService.updateNumByLoadId(loadId);
}
if(CollUtil.isNotEmpty(carsLoadScanEntityList)){
//把carsLoadScanEntityList通过loadId进行分组
Map<Long, List<TrunklineCarsLoadScanEntity>> loadIdMap = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadId));
List<TrunklineCarsLoadEntity> trunklineCarsLoadEntities = carsLoadService.listByIds(loadIds);
//trunklineCarsLoadEntities转化成以id为key 的map
Map<Long, TrunklineCarsLoadEntity> loadIdMap1 = trunklineCarsLoadEntities.stream().collect(Collectors.toMap(TrunklineCarsLoadEntity::getId, Function.identity()));
loadIdMap.keySet().forEach(loadId -> {
List<TrunklineCarsLoadScanEntity> loadScanEntityList = loadIdMap.get(loadId);
//把loadScanEntityList所有元素通过warehouseId进行分组
Map<Long, List<TrunklineCarsLoadScanEntity>> warehouseIdMap = loadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getWarehouseId));
warehouseIdMap.keySet().forEach(warehouseId -> {
List<TrunklineCarsLoadScanEntity> scanEntityList = warehouseIdMap.get(warehouseId);
TrunklineCarsLoadEntity carsLoadEntity = loadIdMap1.get(loadId);
//发送干线发车广播
carsLoadAsyncService.sendReportCarsLoadSuppleFanout(AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,carsLoadEntity,scanEntityList);
});
});
}
}
}

19
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java

@ -1,9 +1,7 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import java.util.List;
@ -26,4 +24,17 @@ public interface ICarsLoadAsyncService {
void savaUnloadLogBatch(List<TrunklineCarsUnloadLogEntity> unloadLogList);
void sendRabbitMessageLoadScanData(List<TrunklineAdvanceEntity> data);
void sendReportCarsLoadStartFanout(Long userId, String nickName, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity);
void sendReportCancleStartData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity);
void sendReportRemoveScanData(Long userId, String nickName, Long warehouseId, String warehouseName, List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList, TrunklineCarsLoadEntity carsLoadEntity);
void sendReportPackageUnloadData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity, List<String> orderPackageCodeList);
void sendReportZeroPackageUnloadData(Long userId, String nickName, Long warehouseId, String warehouseName, List<TrunklineScanZeroDetailVO> sendList, TrunklineCarsLoadScanEntity carsLoadScanEntity,TrunklineCarsLoadEntity carsLoadEntity);
void sendReportCarsLoadSuppleFanout(Long userId, String nickName, Long warehouseId, TrunklineCarsLoadEntity carsLoadEntity, List<TrunklineCarsLoadScanEntity> scanEntityList);
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -7,6 +7,7 @@ import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -93,4 +94,10 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
void clearWaybillInfoByWaybillId(Long waybillId);
AdvancenceTotalNumberVO findTotalNumberByAdvanceIds(List<Long> advanceIds);
void sendReportBasicdataFanout(String nickName, Long userId, Long warehouseId, String warehouseName, Date date, List<TrunklineAdvanceDetailEntity> advanceDetailEntityList,String dealerCode,String dealerName);
void sendReportIncomingData(Long userId, String nickName, List<TrunklineAdvanceDetailEntity> sendAdvanceDetailEntityList, Long warehouseId, String warehouseName,Integer incomingType);
void sendReportAdvanceOpenData(String nickName, Long userId, Long warehouseId, String warehouseName, List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList, WarehouseWaybillEntity waybillEntity);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -37,7 +37,7 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
List<TrunklineAdvanceVO> findIncomingOrderList(InComingDTO inComingDTO);
List<String> incomingPackageBatch(Long advanceId, Long warehouseId, List<TrunklineAdvanceDetailEntity> detailList, Long userId, Long deptId, String tenantId, WarehouseWaybillEntity waybillEntity);
List<String> incomingPackageBatch(Long advanceId, Long warehouseId, List<TrunklineAdvanceDetailEntity> detailList, Long userId, Long deptId, String tenantId, WarehouseWaybillEntity waybillEntity,Integer incomingType);
List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(List<String> orderCodeSet);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -179,4 +179,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<SignPackageVO> findSignPackageListBySignOrderId(Long signOrderId);
List<Long> findAllIdListByLoadIdAndScanStatus(Long loadId, String scanStatus);
CustmoerUnloadNumVO findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId(Long loadId, Long warehouseId);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -230,4 +230,6 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findZeroDetailByCarsLoadScanId(Long carsLoadScanId);
R findZeroList(LoadCarsDTO loadCarsDTO);
R unloadByLoadIdBefore(LoadCarsDTO loadCarsDTO);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java

@ -67,4 +67,5 @@ public interface ITrunklineCarsOrderService extends BaseService<TrunklineCarsOrd
List<SignScanOrderVO> findSignOrderListBySignOrderId(Long signOrderId);
List<SignScanOrderVO> findSignZeroOrderListBySignOrderId(Long signOrderId);
}

330
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -3,6 +3,8 @@ package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient;
@ -24,8 +26,15 @@ import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.cache.DictBizCache;
@ -38,6 +47,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Slf4j
@ -75,6 +85,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
private IOpenOrderAsyncService openOrderAsyncService;
@Autowired
private IAftersalesAbnormalRecordZeroDetailClient abnormalRecordZeroDetailClient;
@Autowired
private ISendFanoutService sendFanoutService;
@LogpmAsync("asyncExecutor")
@Override
@ -670,4 +682,322 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
}
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportCarsLoadStartFanout(Long userId, String nickName, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity) {
Long loadId = carsLoadEntity.getId();
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id", loadId)
.eq("warehouse_id",warehouseId)
.eq("scan_status","1");
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper);
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.INITIAL_WAREHOUSE_DEPART);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
//把carsLoadScanEntityList通过type进行分组
Map<Integer, List<TrunklineCarsLoadScanEntity>> collect = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType));
List<PackageData> packageDataList = new ArrayList<>();
collect.keySet().forEach(type -> {
List<TrunklineCarsLoadScanEntity> list = collect.get(type);
if(CollUtil.isNotEmpty(list)){
if(type.equals("1")){
list.forEach(entity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(entity.getScanCode());
packageData.setOrderCode(entity.getOrderCode());
packageData.setWaybillNumber(entity.getWaybillNo());
packageData.setNum(entity.getNum());
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
}else if(type.equals("2")){
//把list中所有id放入一个List集合
List<Long> carsLoadScanIds = list.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
//把list转化成以id为key的Map
Map<Long, TrunklineCarsLoadScanEntity> carsLoadScanEntityMap = carsLoadScanEntityList.stream().collect(Collectors.toMap(TrunklineCarsLoadScanEntity::getId, Function.identity()));
List<TrunklineScanZeroDetailVO> zeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
zeroDetailVOList.forEach(zeroDetailVO -> {
Long scanId = zeroDetailVO.getScanId();
TrunklineCarsLoadScanEntity carsLoadScanEntity = carsLoadScanEntityMap.get(scanId);
PackageData packageData = new PackageData();
packageData.setOrderCode(carsLoadScanEntity.getOrderCode());
packageData.setNum(zeroDetailVO.getLoadingNum());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setWaybillNumber(carsLoadScanEntity.getWaybillNo());
packageData.setProductId(zeroDetailVO.getGoodsId());
packageData.setProductName(zeroDetailVO.getGoodsName());
packageDataList.add(packageData);
});
}
}
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportCancleStartData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity) {
Long loadId = carsLoadEntity.getId();
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id", loadId)
.eq("warehouse_id",warehouseId)
.eq("scan_status","1");
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper);
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_DEPART);
nodeFanoutMsg.setBizOperation(BizOperationEnums.DELETE);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
//把carsLoadScanEntityList通过type进行分组
Map<Integer, List<TrunklineCarsLoadScanEntity>> collect = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType));
List<PackageData> packageDataList = new ArrayList<>();
collect.keySet().forEach(type -> {
List<TrunklineCarsLoadScanEntity> list = collect.get(type);
if(CollUtil.isNotEmpty(list)){
if(type.equals("1")){
list.forEach(entity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(entity.getScanCode());
packageData.setOrderCode(entity.getOrderCode());
packageData.setWaybillNumber(entity.getWaybillNo());
packageData.setNum(entity.getNum());
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
}else if(type.equals("2")){
//把list中所有id放入一个List集合
List<Long> carsLoadScanIds = list.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
//把list转化成以id为key的Map
Map<Long, TrunklineCarsLoadScanEntity> carsLoadScanEntityMap = carsLoadScanEntityList.stream().collect(Collectors.toMap(TrunklineCarsLoadScanEntity::getId, Function.identity()));
List<TrunklineScanZeroDetailVO> zeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
zeroDetailVOList.forEach(zeroDetailVO -> {
Long scanId = zeroDetailVO.getScanId();
TrunklineCarsLoadScanEntity carsLoadScanEntity = carsLoadScanEntityMap.get(scanId);
PackageData packageData = new PackageData();
packageData.setOrderCode(carsLoadScanEntity.getOrderCode());
packageData.setNum(zeroDetailVO.getLoadingNum());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setWaybillNumber(carsLoadScanEntity.getWaybillNo());
packageData.setProductId(zeroDetailVO.getGoodsId());
packageData.setProductName(zeroDetailVO.getGoodsName());
packageDataList.add(packageData);
});
}
}
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportRemoveScanData(Long userId, String nickName, Long warehouseId, String warehouseName, List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList, TrunklineCarsLoadEntity carsLoadEntity) {
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_LOADING);
nodeFanoutMsg.setBizOperation(BizOperationEnums.DELETE);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
//把carsLoadScanEntityList通过type进行分组
Map<Integer, List<TrunklineCarsLoadScanEntity>> collect = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType));
List<PackageData> packageDataList = new ArrayList<>();
collect.keySet().forEach(type -> {
List<TrunklineCarsLoadScanEntity> list = collect.get(type);
if(CollUtil.isNotEmpty(list)){
if(type.equals("1")){
list.forEach(entity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(entity.getScanCode());
packageData.setOrderCode(entity.getOrderCode());
packageData.setWaybillNumber(entity.getWaybillNo());
packageData.setNum(entity.getNum());
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
}else if(type.equals("2")){
//把list中所有id放入一个List集合
List<Long> carsLoadScanIds = list.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
//把list转化成以id为key的Map
Map<Long, TrunklineCarsLoadScanEntity> carsLoadScanEntityMap = carsLoadScanEntityList.stream().collect(Collectors.toMap(TrunklineCarsLoadScanEntity::getId, Function.identity()));
List<TrunklineScanZeroDetailVO> zeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
zeroDetailVOList.forEach(zeroDetailVO -> {
Long scanId = zeroDetailVO.getScanId();
TrunklineCarsLoadScanEntity carsLoadScanEntity = carsLoadScanEntityMap.get(scanId);
PackageData packageData = new PackageData();
packageData.setOrderCode(carsLoadScanEntity.getOrderCode());
packageData.setNum(zeroDetailVO.getLoadingNum());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setWaybillNumber(carsLoadScanEntity.getWaybillNo());
packageData.setProductId(zeroDetailVO.getGoodsId());
packageData.setProductName(zeroDetailVO.getGoodsName());
packageDataList.add(packageData);
});
}
}
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportPackageUnloadData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity, List<String> orderPackageCodeList) {
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
orderPackageCodeList.forEach(packageCode -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(packageCode);
packageData.setNum(1);
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")
@Override
public void sendReportZeroPackageUnloadData(Long userId, String nickName, Long warehouseId, String warehouseName, List<TrunklineScanZeroDetailVO> sendList, TrunklineCarsLoadScanEntity carsLoadScanEntity,TrunklineCarsLoadEntity carsLoadEntity) {
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
sendList.forEach(zeroDetailVO -> {
PackageData packageData = new PackageData();
packageData.setOrderCode(carsLoadScanEntity.getOrderCode());
packageData.setNum(zeroDetailVO.getUnloadNum());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setWaybillNumber(carsLoadScanEntity.getWaybillNo());
packageData.setProductId(zeroDetailVO.getGoodsId());
packageData.setProductName(zeroDetailVO.getGoodsName());
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public void sendReportCarsLoadSuppleFanout(Long userId, String nickName, Long warehouseId, TrunklineCarsLoadEntity carsLoadEntity, List<TrunklineCarsLoadScanEntity> scanEntityList) {
BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId);
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.INITIAL_WAREHOUSE_LOADING);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseEntity.getName());
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(carsLoadEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
scanEntityList.forEach(scanEntity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(scanEntity.getScanCode());
packageData.setNum(1);
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
}

29
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -198,10 +198,13 @@ public class InComingServiceImpl implements IInComingService {
@Transactional(rollbackFor = Exception.class)
public R incomingPackage(InComingDTO inComingDTO) {
AtomicReference<String> audio = new AtomicReference<>();
try {
String orderPackageCode = inComingDTO.getOrderPackageCode();//包件码
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
String warehouseName = inComingDTO.getWarehouseName();
List<TrunklineAdvanceDetailEntity> sendAdvanceDetailEntityList = new ArrayList<>();
String orderPackageCode = inComingDTO.getOrderPackageCode();//包件码
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
String warehouseName = inComingDTO.getWarehouseName();
Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库
try{
if (StringUtil.isBlank(warehouseName)) {
BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId);
if (!Objects.isNull(warehouseEntity)) {
@ -209,7 +212,6 @@ public class InComingServiceImpl implements IInComingService {
}
}
Long billladingId = inComingDTO.getBillladingId();//提货单id
Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库
String trayCode = inComingDTO.getTrayCode();//托盘码
String trayType = inComingDTO.getTrayType();//打托方式
String customerTrain = inComingDTO.getCustomerTrain();//车次号
@ -273,6 +275,7 @@ public class InComingServiceImpl implements IInComingService {
advanceDetailEntities.forEach(advanceDetailEntity -> {
advanceIds.add(advanceDetailEntity.getId());
advanceDetailEntity.setPackageStatus("1");
advanceDetailEntity.setIncomingType(incomingType);
advanceDetailEntity.setIncomingTime(new Date());
advanceDetailEntity.setIncomingWarehouseId(warehouseId);
advanceDetailEntity.setIncomingWarehouseName(finalWarehouseName);
@ -435,6 +438,8 @@ public class InComingServiceImpl implements IInComingService {
advanceDetailService.updateBatchById(updateAdvanceDetailList);
sendAdvanceDetailEntityList.addAll(updateAdvanceDetailList);
} else if ("1".equals(packageStatus)) {
//已入库包件
if (incomingType != 1) {
@ -516,6 +521,10 @@ public class InComingServiceImpl implements IInComingService {
throw e;
}
if(CollUtil.isNotEmpty(sendAdvanceDetailEntityList)){
advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(),AuthUtil.getNickName(),sendAdvanceDetailEntityList,warehouseId,warehouseName,incomingType);
}
String a = audio.get();
if (StringUtil.isNotBlank(a)) {
return Resp.scanFail(200, a, a);
@ -756,6 +765,8 @@ public class InComingServiceImpl implements IInComingService {
String tenantId = inComingDTO.getTenantId();
String nickName = inComingDTO.getNickName();
List<TrunklineAdvanceDetailEntity> sendAdvanceDetailEntityList = new ArrayList();
Integer total = 0;
for (Long advanceId : advanceIds) {
QueryWrapper<TrunklineAdvanceDetailEntity> queryWrapper = new QueryWrapper<>();
@ -764,10 +775,12 @@ public class InComingServiceImpl implements IInComingService {
//查询所有包件
List<TrunklineAdvanceDetailEntity> detailList = advanceDetailService.list(queryWrapper);
List<String> orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId, waybillEntity);
List<String> orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId, waybillEntity,incomingType);
advanceDetailService.updateBatchById(detailList);
sendAdvanceDetailEntityList.addAll(detailList);
List<String> incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId);
advanceService.updateIncomingWarehouseName(String.join(",", incomingWarehouseNames), advanceId);
@ -813,6 +826,10 @@ public class InComingServiceImpl implements IInComingService {
}
if(CollUtil.isNotEmpty(sendAdvanceDetailEntityList)){
advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(),AuthUtil.getNickName(),sendAdvanceDetailEntityList,warehouseId,warehouseName,incomingType);
}
// DynamicDataSourceContextHolder.clear();
return R.success("入库成功" + total + "件");
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -635,9 +635,9 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("totalWeight",detail.getWeight());
json.put("totalVolume",detail.getVolume());
json.put("freightFee",detail.getSubtotalFreight());
openPrice = openPrice.add(detail.getSubtotalFreight());
openPrice = openPrice.add(Objects.isNull(detail.getSubtotalFreight())?BigDecimal.ZERO:detail.getSubtotalFreight());
json.put("deliveryFee",detail.getSubtotalDeliveryFee());
openPrice = openPrice.add(detail.getSubtotalDeliveryFee());
openPrice = openPrice.add(Objects.isNull(detail.getSubtotalDeliveryFee())?BigDecimal.ZERO:detail.getSubtotalDeliveryFee());
json.put("warehouseServiceFee",BigDecimal.ZERO);
json.put("warehouseFee",BigDecimal.ZERO);
json.put("warehouseManageFee",BigDecimal.ZERO);

236
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1,6 +1,7 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
@ -38,11 +39,17 @@ import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.order.*;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -102,6 +109,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
private final IDistributionReservationStockarticleClient reservationStockarticleClient;
private final ISendFanoutService sendFanoutService;
private final IOrderInfoClient orderInfoClient;
private final BladeRedis bladeRedis;
@Override
@ -306,12 +314,29 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
//组装货物数据
List<AdvanceDetailGoodsVO> goodsList = advanceDetailService.findGoodsListByAdvanceIds(advanceIds);
BasicdataFreightApiVO basicdataFreightApiVO = new BasicdataFreightApiVO();
basicdataFreightApiVO.setItemName(openOrderVO.getConsigneeClientId() + "");
basicdataFreightApiVO.setIssueWarehouse(openOrderVO.getDepartureWarehouseId() + "");
basicdataFreightApiVO.setDestination(openOrderVO.getDestinationCode());
basicdataFreightApiVO.setArrivalWarehouse(openOrderVO.getDestinationWarehouseId() + "");
List<AdvanceDetailGoodsVO> goodsList = new ArrayList<>();
// BasicdataFreightApiVO basicdataFreightApiVO = new BasicdataFreightApiVO();
// basicdataFreightApiVO.setItemName(openOrderVO.getConsigneeClientId() + "");
// basicdataFreightApiVO.setIssueWarehouse(openOrderVO.getDepartureWarehouseId() + "");
// basicdataFreightApiVO.setDestination(openOrderVO.getDestinationCode());
// basicdataFreightApiVO.setArrivalWarehouse(openOrderVO.getDestinationWarehouseId() + "");
Integer hasPackage = list.get(0).getHasPackage();
if(hasPackage == 0){
List<AdvanceDetailGoodsVO> addList = new ArrayList<>();
list.forEach(t -> {
String packName = t.getPackName();
AdvanceDetailGoodsVO goodsVO = new AdvanceDetailGoodsVO();
goodsVO.setGoodsName(packName);
goodsVO.setNum(t.getTotalNum());
addList.add(goodsVO);
});
goodsList.addAll(addList);
}else{
goodsList = advanceDetailService.findGoodsListByAdvanceIds(advanceIds);
}
// if (goodsList.isEmpty()) {
// List<AdvanceDetailGoodsVO> ls = new ArrayList<>();
@ -680,6 +705,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//发布开单广播
// openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, advanceIds);
advanceDetailService.sendReportAdvanceOpenData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,updateAdvanceDetailList,waybillEntity);
Map<String, Object> map = new HashMap<>();
map.put("waybillId", waybillId);
@ -901,11 +927,61 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//发布开单广播
openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, null);
//发送零担开单广播
sendOpenZeroWaybillFanout(AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,waybillEntity,details);
Map<String,Object> map = new HashMap<>();
map.put("waybillId",waybillId);
return R.data(map);
}
private void sendOpenZeroWaybillFanout(Long userId, String nickName, Long warehouseId, String warehouseName, WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details) {
// String key = AuthUtil.getTenantId()+":brandList";
//
// Map<String, Long> brandMap = bladeRedis.hGetAll(key);
//
// if(CollUtil.isEmpty(brandMap)){
// List<JSONObject> allList = basicdataBrandClient.findAllList();
// Map<String, Long> brandIdMap = new HashMap<>();
// allList.forEach(jsonObject -> {
// brandIdMap.put(jsonObject.getString("brandName"),jsonObject.getLong("brandId"));
// });
// brandMap.putAll(brandIdMap);
// }
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.OPEN_ORDER);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(waybillEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
details.forEach(detailEntity -> {
PackageData packageData = new PackageData();
packageData.setOrderCode(detailEntity.getWaybillNo());
packageData.setProductId(detailEntity.getProductId());
packageData.setProductName(detailEntity.getProductName());
packageData.setNum(detailEntity.getNum());
packageData.setWeight(detailEntity.getWeight());
packageData.setVolume(detailEntity.getVolume());
packageData.setPackageType(PackageTypeEnums.LTL);
packageData.setWaybillNumber(detailEntity.getWaybillNo());
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public void updateCustomerInfo(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
@ -1204,6 +1280,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// detailEntities.add(advanceDetailEntity);
// }
advanceDetailService.saveBatch(detailEntities);
//发送报表基础数据广播
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),openLabelDTO.getWarehouseId(),openLabelDTO.getWarehouseName(),new Date(),detailEntities,advanceEntity.getDealerCode(),advanceEntity.getDealerName());
return R.success("保存成功");
}
@ -1359,7 +1439,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setCustomerName(pacakgeDetailExcelDTO.getCustomerName());
advanceEntity.setCustomerPhone(pacakgeDetailExcelDTO.getCustomerTelephone());
advanceEntity.setCustomerAddress(pacakgeDetailExcelDTO.getCustomerAddress());
advanceEntity.setSystemType("线");
advanceEntity.setSystemType("线");
advanceEntity.setServiceNum(pacakgeDetailExcelDTO.getServiceNum());
advanceEntity.setMatingType("1");
advanceEntity.setTrainNumber(trainNumber);
@ -1429,12 +1509,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Map<Long, List<String>> map = advanceDetailEntityList.parallelStream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId, Collectors.mapping(TrunklineAdvanceDetailEntity::getOrderPackageCode, Collectors.toList())));
Map<String, Long> materialMap = new HashMap<>();
Map<Long,TrunklineAdvanceEntity> advanceMapByAdvanceId = new HashMap<>();
listMap.keySet().forEach(str -> {
List<PacakgeDetailExcelDTO> pacakgeDetailExcelList = listMap.get(str);
TrunklineAdvanceEntity advanceEntity = advanceEntityMap.get(str);
if (!Objects.isNull(advanceEntity)) {
Long advanceId = advanceEntity.getId();
advanceMapByAdvanceId.put(advanceId, advanceEntity);
String orderCode = advanceEntity.getOrderCode();
List<String> orderPackageCodes = map.get(advanceId);
pacakgeDetailExcelList.forEach(pacakgeDetailExcelDTO -> {
@ -1452,7 +1533,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
brandEntity = brandMap.get("其他");
advanceDetailModel.setBrand(brandEntity.getBrandName());
}
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSystemType("线");
advanceDetailModel.setTrainNumber(advanceEntity.getTrainNumber());
String firsts = pacakgeDetailExcelDTO.getFirsts();
advanceDetailModel.setFirstPackName(firsts);
@ -1544,6 +1625,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
carsLoadAsyncService.sendRabbitMessageLoadScanData(advanceEntityList);
}
//发送报表基础数据广播
//把advanceDetailEntities通过advanceId进行分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
advanceDetailEntityMap.keySet().forEach(advanceId ->{
TrunklineAdvanceEntity advanceEntity = advanceMapByAdvanceId.get(advanceId);
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,advanceEntity.getDealerCode(),advanceEntity.getDealerName());
});
int successNum = advanceDetailEntities.size();
return R.success("成功处理包件"+successNum+"件");
@ -1695,7 +1786,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setCustomerName(importCustomizedOuPaiDTO.getCustomerName());
advanceEntity.setCustomerPhone(importCustomizedOuPaiDTO.getCustomerPhone());
advanceEntity.setCustomerAddress(importCustomizedOuPaiDTO.getCustomerAddress());
advanceEntity.setSystemType("线");
advanceEntity.setSystemType("线");
advanceEntity.setServiceNum(importCustomizedOuPaiDTO.getServiceNum());
advanceEntity.setMatingType("1");
advanceEntity.setWaybillStatus("0");
@ -1765,13 +1856,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//把advanceDetailEntityList通过advanceId分组并且把集合转化为orderPackageCode的集合
Map<Long, List<String>> map = advanceDetailEntityList.parallelStream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId, Collectors.mapping(TrunklineAdvanceDetailEntity::getOrderPackageCode, Collectors.toList())));
Map<Long,TrunklineAdvanceEntity> advanceMapByAdvanceId = new HashMap<>();
listMap.keySet().forEach(str -> {
List<ImportCustomizedOuPaiDTO> importCustomizedOuPaiDTOList = listMap.get(str);
TrunklineAdvanceEntity advanceEntity = advanceEntityMap.get(str);
if(!Objects.isNull(advanceEntity)){
Long advanceId = advanceEntity.getId();
advanceMapByAdvanceId.put(advanceId,advanceEntity);
String orderCode = advanceEntity.getOrderCode();
List<String> orderPackageCodes = map.get(advanceId);
importCustomizedOuPaiDTOList.forEach(importCustomizedOuPaiDTO -> {
@ -1784,7 +1876,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setOrderCode(orderCode);
advanceDetailModel.setOrderPackageCode(orderPackageCode);
advanceDetailModel.setBrand(advanceEntity.getBrand());
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSiteName(importCustomizedOuPaiDTO.getSiteName());
advanceDetailModel.setSupple(importCustomizedOuPaiDTO.getSupple());
advanceDetailModel.setManifest(importCustomizedOuPaiDTO.getManifest());
@ -1840,6 +1932,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
carsLoadAsyncService.sendRabbitMessageLoadScanData(advanceEntityList);
}
//发送报表基础数据广播
//把advanceDetailEntities通过advanceId进行分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
advanceDetailEntityMap.keySet().forEach(advanceId ->{
TrunklineAdvanceEntity advanceEntity = advanceMapByAdvanceId.get(advanceId);
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,advanceEntity.getDealerCode(),advanceEntity.getDealerName());
});
return R.success("成功导入"+size+"条");
}
@ -2009,7 +2110,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setCustomerPhone(importStandardOuPaiDTO.getCustomerPhone());
advanceEntity.setCustomerAddress(importStandardOuPaiDTO.getCustomerAddress());
advanceEntity.setSenderFactory(importStandardOuPaiDTO.getSendFactory());
advanceEntity.setSystemType("线");
advanceEntity.setSystemType("线");
advanceEntity.setMatingType("1");
advanceEntity.setWaybillStatus("0");
advanceEntity.setTrainNumber(importStandardOuPaiDTO.getTrainNumber());
@ -2076,12 +2177,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Map<Long, List<String>> map = advanceDetailEntityList.parallelStream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId, Collectors.mapping(TrunklineAdvanceDetailEntity::getOrderPackageCode, Collectors.toList())));
Map<String,Long> materialMap = new HashMap<>();
Map<Long,TrunklineAdvanceEntity> advanceMapByAdvanceId = new HashMap<>();
listMap.keySet().forEach(str -> {
List<ImportStandardOuPaiDTO> importStandardOuPaiDTOList = listMap.get(str);
TrunklineAdvanceEntity advanceEntity = advanceEntityMap.get(str);
if(!Objects.isNull(advanceEntity)){
Long advanceId = advanceEntity.getId();
advanceMapByAdvanceId.put(advanceId,advanceEntity);
String orderCode = advanceEntity.getOrderCode();
String brand = advanceEntity.getBrand();
List<String> orderPackageCodes = map.get(advanceId);
@ -2095,7 +2198,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setOrderCode(orderCode);
advanceDetailModel.setOrderPackageCode(orderPackageCode);
advanceDetailModel.setBrand(brand);
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSiteName(importStandardOuPaiDTO.getSiteName());
advanceDetailModel.setReturnNum(importStandardOuPaiDTO.getReturnNum());
advanceDetailModel.setSendDateStr(importStandardOuPaiDTO.getSendDateStr());
@ -2203,6 +2306,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailService.updateBatchById(updateMaterialList);
}
//发送报表基础数据广播
//把advanceDetailEntities通过advanceId进行分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
advanceDetailEntityMap.keySet().forEach(advanceId ->{
TrunklineAdvanceEntity advanceEntity = advanceMapByAdvanceId.get(advanceId);
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,advanceEntity.getDealerCode(),advanceEntity.getDealerName());
});
int successNum = advanceDetailEntities.size();
return R.success("成功导入"+successNum+"条");
@ -2271,6 +2384,37 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId);
return R.fail(405, "运单已作废");
}
Integer waybillType = waybillEntity.getWaybillType();
if(waybillType.equals(2)){
//零担改单限制
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
Integer totalCount = waybillEntity.getTotalCount();
DistributionStockArticleEntity startStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, departureWarehouseId);
if(Objects.isNull(startStockArticleEntity)){
log.warn("#############updateWaybill: 订单信息不存在 waybillId={}", waybillId);
return R.fail(405, "订单信息不存在");
}
Integer handQuantity = startStockArticleEntity.getHandQuantity();
if(NumberUtil.equals(handQuantity,0)){
DistributionStockArticleEntity endStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, destinationWarehouseId);
if(Objects.isNull(endStockArticleEntity)){
log.warn("#############updateWaybill: 订单信息不存在! waybillId={}", waybillId);
return R.fail(405, "订单信息不存在!");
}
handQuantity = endStockArticleEntity.getHandQuantity();
if(!NumberUtil.equals(handQuantity,totalCount)){
log.warn("#############updateWaybill: 目的仓数据还未完全到达 waybillId={}", waybillId);
return R.fail(405, "目的仓数据还未完全到达");
}
}else{
if(!NumberUtil.equals(handQuantity,totalCount)){
log.warn("#############updateWaybill: 始发仓数据已发运 waybillId={}", waybillId);
return R.fail(405, "始发仓数据已发运");
}
}
}
//验证运单是否有配送任务
//查询运单下所有订单号
@ -2300,7 +2444,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
Integer waybillType = waybillEntity.getWaybillType();
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
String consigneeName = waybillEntity.getConsigneeName();
@ -2403,6 +2546,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<DistributionStockArticleEntity> orderList = distributionStockArticleClient.findListByWaybillNumber(waybillNo);
orderList.forEach(stockArticleEntity -> {
stockArticleEntity.setMallId(consigneeId);
stockArticleEntity.setTotalNumber(totalCount);
if(!Objects.isNull(basicdataClientEntity)){
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
}else{
@ -2417,6 +2561,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
stockArticleEntity.setSendWarehouseName(departureWarehouseName);
stockArticleEntity.setAcceptWarehouseId(destinationWarehouseId);
stockArticleEntity.setAcceptWarehouseName(destinationWarehouseName);
String orderCode = stockArticleEntity.getOrderCode();
if(orderCode.equals(waybillNo)){
stockArticleEntity.setCustomerName(consigneeName);
stockArticleEntity.setCustomerTelephone(consigneeMobile);
stockArticleEntity.setCustomerAddress(consigneeAddress);
}
});
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findByWaybillNumber(waybillNo);
@ -2445,10 +2595,47 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);
sendUpdateWaybillFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,waybillEntity);
// openOrderAsyncService.sendUpdateWaybillFanout(waybillEntity,wayBillDetailList,advanceIds,oldConsignee);
return R.success("改单成功");
}
private void sendUpdateWaybillFanout(String nickName, Long userId, Long warehouseId, String warehouseName, WarehouseWaybillEntity waybillEntity) {
String key = AuthUtil.getTenantId()+":brandList";
Map<String, Long> brandMap = bladeRedis.hGetAll(key);
if(CollUtil.isEmpty(brandMap)){
List<JSONObject> allList = basicdataBrandClient.findAllList();
Map<String, Long> brandIdMap = new HashMap<>();
allList.forEach(jsonObject -> {
brandIdMap.put(jsonObject.getString("brandName"),jsonObject.getLong("brandId"));
});
brandMap.putAll(brandIdMap);
}
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.CHANGE_ORDER);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(waybillEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public R updateWaybillVerify(OpenOrderDTO openOrderDTO) {
Long waybillId = openOrderDTO.getWaybillId();
@ -2582,7 +2769,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setSenderPhone(importOrderNoPackageExcelDTO.getShipperMobile());
advanceEntity.setSenderAddress(importOrderNoPackageExcelDTO.getShipperAddress());
advanceEntity.setTrainNumber(importOrderNoPackageExcelDTO.getTrainNumber());
advanceEntity.setSystemType("线");
advanceEntity.setSystemType("线");
advanceEntity.setMatingType("1");
advanceEntity.setWaybillStatus("0");
advanceEntity.setFreezeStatus("0");
@ -2611,7 +2798,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setAdvanceId(advanceEntity.getId());
advanceDetailModel.setOrderCode(advanceEntity.getOrderCode());
advanceDetailModel.setBrand(advanceEntity.getBrand());
advanceDetailModel.setSystemType("线");
advanceDetailModel.setSystemType("线");
advanceDetailModel.setFirstPackName(firsts);
String sencods = importOrderNoPackageExcelDTO.getSeconds();
@ -2679,6 +2866,19 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
CompletableFuture.allOf(comlist.toArray(new CompletableFuture[0])).join();
}
//发送报表基础数据广播
//把advanceDetailEntities通过advanceId进行分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
list.forEach(advanceEntity -> {
Long advanceId = advanceEntity.getId();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,dealerCode,dealerName);
});
return R.success("添加成功");
}
@ -2853,7 +3053,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setSenderPhone(importOrderNoPackageExcelDTO.getShipperMobile());
advanceEntity.setSenderAddress(importOrderNoPackageExcelDTO.getShipperAddress());
advanceEntity.setTrainNumber(importOrderNoPackageExcelDTO.getTrainNumber());
advanceEntity.setSystemType("线");
advanceEntity.setSystemType("线");
advanceEntity.setMatingType("1");
advanceEntity.setWaybillStatus("0");
advanceEntity.setFreezeStatus("0");

164
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -3,12 +3,14 @@ package com.logpm.trunkline.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.feign.IBasicdataBrandClient;
import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDTO;
@ -18,18 +20,28 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ISendFanoutService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
@ -49,6 +61,12 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IBasicdataBrandClient basicdataBrandClient;
private final BladeRedis bladeRedis;
private final ISendFanoutService sendFanoutService;
@Override
public void updatePackageStatusById(String packageStatus, Long advanceDetailId, Long warehouseId, String warehouseName, Date incomingTime) {
baseMapper.updatePackageStatusById(packageStatus, advanceDetailId, warehouseId, warehouseName, incomingTime);
@ -372,4 +390,150 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public AdvancenceTotalNumberVO findTotalNumberByAdvanceIds(List<Long> advanceIds) {
return baseMapper.findTotalNumberByAdvanceIds(advanceIds);
}
@Override
public void sendReportBasicdataFanout(String nickName, Long userId, Long warehouseId, String warehouseName, Date date, List<TrunklineAdvanceDetailEntity> advanceDetailEntityList,String dealerCode,String dealerName) {
String key = AuthUtil.getTenantId()+":brandList";
Map<String, Long> brandMap = bladeRedis.hGetAll(key);
if(CollUtil.isEmpty(brandMap)){
List<JSONObject> allList = basicdataBrandClient.findAllList();
Map<String, Long> brandIdMap = new HashMap<>();
allList.forEach(jsonObject -> {
brandIdMap.put(jsonObject.getString("brandName"),jsonObject.getLong("brandId"));
});
brandMap.putAll(brandIdMap);
}
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.INITIAL_DATA_ENTRY);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(date);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
advanceDetailEntityList.forEach(detailEntity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(detailEntity.getOrderPackageCode());
packageData.setOrderCode(detailEntity.getOrderCode());
packageData.setServiceNo(detailEntity.getServiceNum());
packageData.setMaterialId(detailEntity.getMaterialId());
packageData.setMaterialCode(detailEntity.getMaterialCode());
packageData.setMaterialName(detailEntity.getMaterialName());
packageData.setNum(detailEntity.getQuantity());
packageData.setWeight(detailEntity.getWeight());
packageData.setVolume(detailEntity.getVolume());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setCustomerTrain(detailEntity.getTrainNumber());
packageData.setDealerCode(dealerName);
packageData.setDealerName(dealerCode);
String brand = detailEntity.getBrand();
packageData.setBrandId(brandMap.get(brand));
packageData.setBrandName(brand);
packageData.setSystemType(detailEntity.getSystemType());
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public void sendReportIncomingData(Long userId, String nickName, List<TrunklineAdvanceDetailEntity> sendAdvanceDetailEntityList, Long warehouseId, String warehouseName,Integer incomingType) {
String key = AuthUtil.getTenantId()+":brandList";
Map<String, Long> brandMap = bladeRedis.hGetAll(key);
if(CollUtil.isEmpty(brandMap)){
List<JSONObject> allList = basicdataBrandClient.findAllList();
Map<String, Long> brandIdMap = new HashMap<>();
allList.forEach(jsonObject -> {
brandIdMap.put(jsonObject.getString("brandName"),jsonObject.getLong("brandId"));
});
brandMap.putAll(brandIdMap);
}
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
sendAdvanceDetailEntityList.forEach(detailEntity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(detailEntity.getOrderPackageCode());
packageData.setOrderCode(detailEntity.getOrderCode());
packageData.setServiceNo(detailEntity.getServiceNum());
packageData.setNum(detailEntity.getQuantity());
packageData.setWeight(detailEntity.getWeight());
packageData.setVolume(detailEntity.getVolume());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setCustomerTrain(detailEntity.getTrainNumber());
packageData.setIncomingType(incomingType);
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@Override
public void sendReportAdvanceOpenData(String nickName, Long userId, Long warehouseId, String warehouseName, List<TrunklineAdvanceDetailEntity> advanceDetailList, WarehouseWaybillEntity waybillEntity) {
String key = AuthUtil.getTenantId()+":brandList";
Map<String, Long> brandMap = bladeRedis.hGetAll(key);
if(CollUtil.isEmpty(brandMap)){
List<JSONObject> allList = basicdataBrandClient.findAllList();
Map<String, Long> brandIdMap = new HashMap<>();
allList.forEach(jsonObject -> {
brandIdMap.put(jsonObject.getString("brandName"),jsonObject.getLong("brandId"));
});
brandMap.putAll(brandIdMap);
}
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.OPEN_ORDER);
nodeFanoutMsg.setBizOperation(BizOperationEnums.MODIFY);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setMain(waybillEntity);
//组装包件数据
List<PackageData> packageDataList = new ArrayList<>();
advanceDetailList.forEach(detailEntity -> {
PackageData packageData = new PackageData();
packageData.setPackageCode(detailEntity.getOrderPackageCode());
packageData.setOrderCode(detailEntity.getOrderCode());
packageData.setServiceNo(detailEntity.getServiceNum());
packageData.setNum(detailEntity.getQuantity());
packageData.setWeight(detailEntity.getWeight());
packageData.setVolume(detailEntity.getVolume());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setWaybillNumber(waybillEntity.getWaybillNo());
packageDataList.add(packageData);
});
nodeFanoutMsg.setDetails(packageDataList);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.REPORTDATA.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -425,7 +425,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
@Override
public List<String> incomingPackageBatch(Long advanceId, Long warehouseId, List<TrunklineAdvanceDetailEntity> detailList, Long userId, Long deptId, String tenantId, WarehouseWaybillEntity waybillEntity) {
public List<String> incomingPackageBatch(Long advanceId, Long warehouseId, List<TrunklineAdvanceDetailEntity> detailList, Long userId, Long deptId, String tenantId, WarehouseWaybillEntity waybillEntity,Integer incomingType) {
Date date = new Date();
@ -675,6 +675,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelListEntityList.add(parcelList);
advanceDetailEntity.setPackageStatus("1");
advanceDetailEntity.setIncomingType(incomingType);
advanceDetailEntity.setWaybillNo(waybillNo);
advanceDetailEntity.setIncomingWarehouseId(warehouseId);
advanceDetailEntity.setIncomingWarehouseName(warehouseName);

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -460,4 +459,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findAllIdListByLoadIdAndScanStatus(loadId,scanStatus);
}
@Override
public CustmoerUnloadNumVO findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId(Long loadId, Long warehouseId) {
return baseMapper.findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId(loadId,warehouseId);
}
}

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

@ -221,6 +221,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("#############startCarByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
String warehouseName = warehouseEntity.getName();
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
@ -445,6 +446,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.error("同步工厂数据失败", e);
}
//发送干线发车广播
carsLoadAsyncService.sendReportCarsLoadStartFanout(AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,carsLoadEntity);
log.info("##############startCarByLoadId: 发车成功 loadId={} startCarType={} warehouseId={}", loadId, startCarType, warehouseId);
}
@ -715,6 +719,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
throw new CustomerException(400, "仓库信息不存在");
}
String warehouseName = warehouseEntity.getName();
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -855,6 +861,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.error("#############cancelStartCarByLoadId: 处理取消节点签收单 和 发车数量失败", e);
}
//发送取消发车广播
carsLoadAsyncService.sendReportCancleStartData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity);
}
@ -1376,6 +1384,27 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
waybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
});
//把carsLoadScanEntityList中所有id放入一个List
List<Long> scanIds = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(scanIds);
//把zeroDetailVOList中所有元素通过scanId进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> mapByScanId = zeroDetailVOList.stream()
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
carsLoadScanEntityList.forEach(carsLoadScanEntity -> {
Long scanId = carsLoadScanEntity.getId();
List<TrunklineScanZeroDetailVO> list = mapByScanId.get(scanId);
carsLoadAsyncService.sendReportZeroPackageUnloadData(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseEntity.getName(),list,carsLoadScanEntity,carsLoadEntity);
});
}
//无装车记录异常日志记录
@ -1766,6 +1795,23 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(zeroList);
}
@Override
public R unloadByLoadIdBefore(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
CustmoerUnloadNumVO custmoerUnloadNumVO = trunklineCarsLoadScanService.findCarsLoadCustomeNumByLoadIdAndUnloadWarehouseId(loadId,warehouseId);
Integer loadingNum = custmoerUnloadNumVO.getLoadingNum();
Integer unloadNum = custmoerUnloadNumVO.getUnloadNum();
if(NumberUtil.equals(loadingNum,unloadNum)){
return R.status(true);
}else{
return R.status(false);
}
}
@Transactional(rollbackFor = Exception.class)
@Override
@ -3198,6 +3244,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer planNum = null;
Integer difficult = 0;
Long finalNodeId = null;
Long signOrderId = null;
String finalNodeName = null;
String loadCode = carsLoadEntity.getCarsNo();
String audio = "";
@ -3213,6 +3260,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
remark = "有数据,无计划,异常装车";
audio = "无计划装车";
} else {
signOrderId = carsOrderEntity.getSignOrderId();
finalNodeId = carsOrderEntity.getFinalNodeId();
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if (!Objects.isNull(finalNode)) {
@ -3269,6 +3317,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setRemark(remark);
carsLoadScanEntity.setFromWarehouseId(warehouseId);
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName());
@ -5599,20 +5648,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<SignScanOrderVO> signScanZeroOrderList = trunklineCarsOrderService.findSignZeroOrderListBySignOrderId(signOrderId);
List<SignPackageVO> signZeroPackageList = trunklineCarsLoadScanService.findSignPackageListBySignOrderId(signOrderId);
// 创建一个包含所有carsLoadScanId的新列表
List<Long> carsLoadScanIds = signZeroPackageList.stream()
.map(SignPackageVO::getCarsLoadScanId)
.collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> scanZeroDetailList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
//把scanZeroDetailList中所有元素通过id进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailMap = scanZeroDetailList.stream()
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
signZeroPackageList.forEach(signPackageVO -> {
Long carsLoadScanId = signPackageVO.getCarsLoadScanId();
List<TrunklineScanZeroDetailVO> list = scanZeroDetailMap.get(carsLoadScanId);
signPackageVO.setScanZeroDetailList(list);
});
if(CollUtil.isNotEmpty(signZeroPackageList)){
// 创建一个包含所有carsLoadScanId的新列表
List<Long> carsLoadScanIds = signZeroPackageList.stream()
.map(SignPackageVO::getCarsLoadScanId)
.collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> scanZeroDetailList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
//把scanZeroDetailList中所有元素通过id进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailMap = scanZeroDetailList.stream()
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
signZeroPackageList.forEach(signPackageVO -> {
Long carsLoadScanId = signPackageVO.getCarsLoadScanId();
List<TrunklineScanZeroDetailVO> list = scanZeroDetailMap.get(carsLoadScanId);
signPackageVO.setScanZeroDetailList(list);
});
}
for (SignScanOrderVO signScanOrderVO : signScanZeroOrderList) {
String waybillNo = StringUtil.isBlank(signScanOrderVO.getWaybillNo())?"null":signScanOrderVO.getWaybillNo();
@ -6346,6 +6397,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer planNum = e.getPlanNum();
String waybillNo = e.getWaybillNo();
Long finalNodeId = e.getFinalNodeId();
Long signOrderId = e.getSignOrderId();
String finalNodeName = null;
BasicdataWarehouseEntity finalNodeWarehouse = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if (Objects.nonNull(finalNodeWarehouse)) {
@ -6384,6 +6436,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setIsSupple(0);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
if(!Objects.isNull(stockArticle)){
@ -6454,7 +6507,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer i = loadingZeroFlag.get();
if(i == 1){
return R.success("装车完成,但存在零担未装车,请去PDA确认装车数量");
return R.success("装车完成,但存在零担未装车,请去确认装车数量");
}else{
return R.success("装车完成");
}
@ -7579,7 +7632,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把loadScanEntityList2中所有元素的id放入一个List
List<Long> carsLoadScanIdList = loadScanEntityList2.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIdList);
//把zeroDetailVOList所有元素通过packageId进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> groupedByPackageId = zeroDetailVOList.stream().filter(trunklineScanZeroDetailVO-> !Objects.isNull(trunklineScanZeroDetailVO.getPackageId()))
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getPackageId));
@ -7641,6 +7694,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
}
Long loadId = loadIdSet.stream().findFirst().get();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
carsLoadAsyncService.sendReportRemoveScanData(AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,carsLoadScanEntityList,carsLoadEntity);
// Long loadId = null;
// for (String str : split) {
@ -8653,6 +8711,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
audio.append("异常卸车").append(abnormalUnloadNum).append("件");
}
List<String> orderPackageCodeList = new ArrayList<>();
orderPackageCodeList.add(orderPackageCode);
carsLoadAsyncService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity,orderPackageCodeList);
if (isData == 0) {
return Resp.scanSuccess("卸车成功", "系统无编码");
}
@ -9331,6 +9393,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
audio.append("异常卸车").append(abnormalUnloadNum).append("件");
}
List<String> orderPackageCodeList = new ArrayList<>();
orderPackageCodeList.add(orderPackageCode);
carsLoadAsyncService.sendReportPackageUnloadData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity,orderPackageCodeList);
if (isData == 0) {
return Resp.scanSuccess("卸车成功", "系统无编码");
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java

@ -12,7 +12,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Slf4j

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java

@ -19,8 +19,6 @@ import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;

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

@ -244,12 +244,14 @@ public class WarehouseWaybillController extends BladeController {
log.info(method + "请求参数{}", waybillDTO);
try{
//当前登录人选择的仓库
List<Long> warehouseIds = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
if(!Objects.isNull(myCurrentWarehouse)){
warehouseIds.add(myCurrentWarehouse.getId());
}else{
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> warehouseIds.add(warehouseEntity.getId()));
}
waybillDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<WarehouseWaybillVO> pages = warehouseWaybillService.pageList(waybillDTO);
@ -272,12 +274,14 @@ public class WarehouseWaybillController extends BladeController {
log.info(method + "请求参数{}", waybillDTO);
try{
//当前登录人选择的仓库
List<Long> warehouseIds = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
throw new CustomerException(403,"仓库信息为空");
if(!Objects.isNull(myCurrentWarehouse)){
warehouseIds.add(myCurrentWarehouse.getId());
}else{
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> warehouseIds.add(warehouseEntity.getId()));
}
waybillDTO.setWarehouseId(myCurrentWarehouse.getId());
List<ExportWarehouseWaybillVO> list = warehouseWaybillService.exportWaybillList(waybillDTO);

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java

@ -37,6 +37,7 @@ public class WarehouseWaybillDTO extends WarehouseWaybillEntity {
private List<Long> departureWarehouseIds;
private List<Long> destinationWarehouseIds;
private List<Long> warehouseIds;
private Integer pageNum;
private Integer pageSize;

27
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -148,7 +148,6 @@
<select id="pageList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select lww.*
from logpm_warehouse_waybill lww
left join (select ltwt.waybill_id,GROUP_CONCAT(DISTINCT ltwt.warehouse_id) warehouse_ids from logpm_trunkline_waybill_track ltwt group by ltwt.waybill_id) t on t.waybill_id = lww.id
where lww.is_deleted = 0
<if test="param.waybillNoList != null">
and lww.waybill_no not in
@ -156,8 +155,17 @@
#{item}
</foreach>
</if>
<if test="param.warehouseId != null">
and Locate(#{param.warehouseId},t.warehouse_ids) > 0
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and (
lww.departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or lww.destination_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},lww.waybill_no) > 0
@ -840,8 +848,17 @@
#{item}
</foreach>
</if>
<if test="param.warehouseId != null">
and Locate(#{param.warehouseId},t.warehouse_ids) > 0
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and (
lww.departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or lww.destination_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},lww.waybill_no) > 0

Loading…
Cancel
Save