Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 4 months ago
parent
commit
918faead03
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 6
      blade-biz-common/src/main/java/org/springblade/common/constant/report/ReportConstants.java
  3. 1
      blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java
  4. 2
      blade-biz-common/src/main/java/org/springblade/common/model/DistributionTaskVO.java
  5. 19
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  6. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java
  7. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  8. 2
      blade-service/logpm-business/src/main/resources/logback.xml
  9. 42
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  10. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  11. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java
  12. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml
  13. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillPlanReportListener.java
  14. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillReViewReportListener.java
  15. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillSignforReportListener.java
  16. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  17. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java
  18. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  19. 420
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java
  20. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  21. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java
  22. 82
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java
  23. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  24. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java
  25. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java
  26. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvaluePackageServiceImpl.java
  27. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  28. 363
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  29. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  30. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  31. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  32. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java
  33. 2
      blade-service/logpm-factory-data/logpm-factory-data-base/src/main/resources/logback.xml
  34. 2
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/resources/logback.xml
  35. 2
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/resources/logback.xml
  36. 2
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/resources/logback.xml
  37. 2
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/resources/logback.xml
  38. 2
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/resources/logback.xml
  39. 2
      blade-service/logpm-factory-data/logpm-factory-data-oupai/src/main/resources/logback.xml
  40. 2
      blade-service/logpm-factory-data/logpm-factory-data-pan/src/main/resources/logback.xml
  41. 2
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/logback.xml
  42. 2
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/logback.xml
  43. 2
      blade-service/logpm-patch/src/main/resources/logback.xml
  44. 2
      blade-service/logpm-report/src/main/resources/logback.xml
  45. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  46. 2
      blade-service/logpm-statisticsdata/src/main/resources/logback.xml
  47. 2
      blade-service/logpm-supervise/src/main/resources/logback.xml
  48. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  49. 84
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  50. 22
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  51. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  52. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  53. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  54. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  55. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

@ -260,6 +260,7 @@ public abstract class FanoutConstants {
interface DeliveryAndPlan {
String EXCHANGE = "fanout.distribution.plan" + ModuleNameConstant.DEVAUTH;
String EXCHANGE_DELAY = "fanout.distribution.plan.delay" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String REPORT = "fanout.distribution.plan.report" + ModuleNameConstant.DEVAUTH;

6
blade-biz-common/src/main/java/org/springblade/common/constant/report/ReportConstants.java

@ -16,6 +16,12 @@ public class ReportConstants {
public static final String REPORT_QUALITY_DELIVER_EXCHANGE = "report.quality.deliver.exchange" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_DELIVER_QUEUE = "report.quality.deliver.queue" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_DELIVER_ROUTINGKEY = "report.quality.deliver.key" + ModuleNameConstant.DEVAUTH;
/**
* 配送明细报表
*/
public static final String REPORT_QUALITY_DELIVER_ADD_EXCHANGE = "report.quality.deliver.add.exchange" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_DELIVER_ADD_QUEUE = "report.quality.deliver.add.queue" + ModuleNameConstant.DEVAUTH;
public static final String REPORT_QUALITY_DELIVER_ADD_ROUTINGKEY = "report.quality.deliver.add.key" + ModuleNameConstant.DEVAUTH;
/**
* 车辆车次报表

1
blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java

@ -13,6 +13,7 @@ public enum BizOperationEnums implements IDict<Integer> {
ADD(1, "新增"),
MODIFY(2, "修改"),
DELETE(3, "删除"),
REMOVE(4, "移除"),
;
BizOperationEnums(Integer code, String value) {

2
blade-biz-common/src/main/java/org/springblade/common/model/DistributionTaskVO.java

@ -26,6 +26,8 @@ public class DistributionTaskVO implements Serializable {
private String ynWholeVehicle;
/** 三方配送价格 */
private String price;
/** 配送任务备注 */
private String remark;
/** 司机和车辆信息 */
private List<PlanDriverbindCarVO> planDriverbindCars;

19
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -374,6 +374,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "配送公司")
private String distributionCompany;
/**
* 配送备注
*/
@ApiModelProperty(value = "配送备注")
private String deliveryRemark;
/**
* 配送是否整车计费
*/
@ -515,9 +520,9 @@ public class QualityDeliverEntity extends TenantEntity {
@ApiModelProperty(value = "到达地址")
private String arriveAddress;
/**
* 签收id
* 签收归属司机id
*/
@ApiModelProperty(value = "签收id")
@ApiModelProperty(value = "签收归属司机id")
private String signUserId;
/**
* 签收人
@ -559,6 +564,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "签收车辆id")
private Long signCarId;
/**
* 签收归属司机
*/
@ApiModelProperty(value = "签收归属司机")
private String signDriverName;
/**
* 签收类型按件签收 批量签收 补录
*/
@ -639,6 +649,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "上楼费成本")
private BigDecimal apstairsCost;
/**
* 平移米数
*/
@ApiModelProperty(value = "平移米数")
private Integer moveNumber;
/**
* 平移费成本
*/

14
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java

@ -45,6 +45,12 @@ public class ExpenseDispatchTrainDetailEntity extends TenantEntity {
@ApiModelProperty(value = "配送车辆")
@ExcelProperty("配送车辆")
private String deliveryVehicle;
/**
* 配送司机
*/
@ApiModelProperty(value = "配送司机")
@ExcelProperty("配送司机")
private String deliveryDriver;
/**
* 配送车型
*/
@ -106,11 +112,11 @@ public class ExpenseDispatchTrainDetailEntity extends TenantEntity {
@ExcelIgnore
private String carrierType;
/**
* 配送司机
* 配送备注
*/
@ApiModelProperty(value = "配送司机")
@ExcelProperty("配送司机")
private String deliveryDriver;
@ApiModelProperty(value = "配送备注")
@ExcelProperty("配送备注")
private String deliveryRemark;
/**
* 计划总件数
*/

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java

@ -102,4 +102,7 @@ public interface IWarehouseWaybillClient {
@PostMapping(API_PREFIX + "/findWaybillVOByWaybillNoSet")
List<WarehouseWaybillVO> findWaybillVOByWaybillNoSet(@RequestBody Set<String> allWaybillNoSet);
@GetMapping(API_PREFIX+"/updateWaybillCondigneeId")
void updateWaybillCondigneeIdToNull(@RequestParam Long waybillId);
}

2
blade-service/logpm-business/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="../data/logpm-warehouse/logs/logs.log"/>
<property name="log.path" value="../data/logpm-business/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

42
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -305,27 +305,27 @@ public class DistributionSignforAppController {
public R oneclick(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
distributionSignfor.setIsClerk(false);
R r = distributionSignforService.oneclickPDA(distributionSignfor);
List<String> packageCodes = (List<String>) r.getData();
try {
String orderPackageCodes = null;
for (String packageCode : packageCodes) {
if (StringUtils.isBlank(orderPackageCodes)) {
orderPackageCodes = packageCode;
} else {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
log.info("##############oneclick: 开始执行下架:{}", packageCodes);
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(orderPackageCodes!=null){
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托");
}
log.info("##############oneclick: 结束执行下架:{}", packageCodes);
} catch (Exception e) {
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes);
}
// List<String> packageCodes = (List<String>) r.getData();
// try {
// String orderPackageCodes = null;
// for (String packageCode : packageCodes) {
// if (StringUtils.isBlank(orderPackageCodes)) {
// orderPackageCodes = packageCode;
// } else {
// orderPackageCodes = orderPackageCodes + "," + packageCode;
// }
// }
// log.info("##############oneclick: 开始执行下架:{}", packageCodes);
//
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(orderPackageCodes!=null){
// updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托");
// }
// log.info("##############oneclick: 结束执行下架:{}", packageCodes);
//
// } catch (Exception e) {
// log.warn("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes);
// }
return r;
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -336,7 +336,6 @@ public class DistributionSignforController extends BladeController {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
R r = distributionSignforService.oneclick(distributionSignfor);
List<String> packageCodes = (List<String>)r.getData();
try{
Map<String,Object> data = (Map<String, Object>) r.getData();
if (Func.isNotEmpty(data)){
@ -345,19 +344,9 @@ public class DistributionSignforController extends BladeController {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
// distributionAsyncService.sendReviewFactory(signId,myCurrentWarehouse.getName() ,myCurrentWarehouse.getId()); PC对于的批量签收同样需要复核
}
String orderPackageCodes = null;
for (String packageCode : packageCodes) {
if(StringUtils.isBlank(orderPackageCodes)){
orderPackageCodes = packageCode;
}else{
orderPackageCodes = orderPackageCodes + "," +packageCode;
}
}
if(StringUtils.isNotBlank(orderPackageCodes)){
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"文员一键签收下架解托");
}
}catch (Exception e){
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}",packageCodes);
log.warn("##############oneclick: 更新包件下架状态失败 r={}",r);
}
return r;
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.mapper;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -24,6 +25,7 @@ import com.logpm.distribution.excel.DistributionAddvaluePackageExcel;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 增值服务包件表 Mapper 接口
@ -73,4 +75,6 @@ public interface DistributionAddvaluePackageMapper extends BaseMapper<Distributi
* @param addvalueDetailId
*/
void deleteAddvaluePackageByDetailId(@Param("reservationId")Long reservationId,@Param("packageId") Long id,@Param("addvalueDetailId") Long addvalueDetailId);
List<JSONObject> findMapByPackageCode(@Param("collect1") Set<String> collect1);
}

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

@ -47,4 +47,22 @@
resultType="com.logpm.distribution.excel.DistributionAddvaluePackageExcel">
SELECT * FROM logpm_distribution_addvalue_package ${ew.customSqlSegment}
</select>
<select id="findMapByPackageCode" resultType="cn.hutool.json.JSONObject">
select ldap.order_package_code orderPackageCode,
a.addvalue_id addvalueId,
case
when a.addvalue_id = '1' then ifnull(ad.flool_num, 0)
when a.addvalue_id = '3' then ifnull(ad.distance, 0)
end num
from logpm_distribution_addvalue_package ldap
left join logpm_distribution_addvalue_detail ad on ad.id = ldap.addvalue_detail_id and ad.is_deleted = 0
left join logpm_distribution_addvalue a on a.id = ad.addvalue_id
where ldap.is_deleted = 0
and ldap.order_package_code in
<foreach collection="collect1" item="item" open="(" close=")" index="index" separator=",">
#{item}
</foreach>
and a.addvalue_id in ('1', '3')
</select>
</mapper>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillPlanReportListener.java

@ -72,12 +72,15 @@ public class BillPlanReportListener implements ReportService {
}
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getMallName()) && StrUtil.isNotEmpty(item.getMaterielCode()) && StrUtil.isNotEmpty(item.getIncomingBatch()))
.collect(Collectors.groupingBy(item -> item.getMallName() + item.getMaterielCode() + item.getIncomingBatch()));
}
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillReViewReportListener.java

@ -69,12 +69,15 @@ public class BillReViewReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillSignforReportListener.java

@ -69,12 +69,15 @@ public class BillSignforReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}

37
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -174,7 +174,7 @@ public class DeliverFinishReportListener implements ReportService {
if (StrUtil.isNotEmpty(deliveryKind) && StrUtil.equals(deliveryKind, "自主配送")) {
if (StrUtil.isNotEmpty(qualityDeliverEntity.getDeliveryType())
&& (StrUtil.equals(qualityDeliverEntity.getDeliveryType(), "商配") || StrUtil.equals(qualityDeliverEntity.getDeliveryType(), "市配"))) {
if(StrUtil.isEmpty(qualityDeliverEntity.getSignCarType())){
if (StrUtil.isEmpty(qualityDeliverEntity.getSignCarType())) {
continue;
}
ExpenseDispatchClientDTO expenseDispatchClientDTO = expenseDispatchClient.findPriceByDriverId(qualityDeliverEntity.getWarehouseId(), driverId, qualityDeliverEntity.getSignCarTypeId(), qualityDeliverEntity.getDeliveryType());
@ -186,7 +186,7 @@ public class DeliverFinishReportListener implements ReportService {
// 整车计费,则车内的每个包件分摊整车成本费用
if (ynWholeVehicle) {
String wholeVehicleCost = priceVO.getWholeVehicleCost();
if(StrUtil.isNotEmpty(wholeVehicleCost)){
if (StrUtil.isNotEmpty(wholeVehicleCost)) {
BigDecimal div = NumberUtil.div(new BigDecimal(wholeVehicleCost), totalNum);
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
@ -207,6 +207,7 @@ public class DeliverFinishReportListener implements ReportService {
if (ObjectUtil.isEmpty(rule)) {
continue;
}
// 计算配送成本
if (CollUtil.isNotEmpty(priceList)) {
Map<Long, ExpenseDispatchPriceCategoryVO> priceMap = priceList.stream().collect(Collectors.toMap(ExpenseDispatchPriceCategoryVO::getCategoryId, v -> v));
// 车的总运费 用于计算是否触发保底
@ -283,10 +284,17 @@ public class DeliverFinishReportListener implements ReportService {
// 装卸费单价
String loadingUnloadingFee = expenseDispatchPriceCategoryVO.getLoadingUnloadingFee();
// 上楼层数
//
Integer stairsNumber = 0;
if (addvaluePackageMap.containsKey(entity.getOrderPackageCode())) {
stairsNumber = Convert.toInt(addvaluePackageMap.get(entity.getOrderPackageCode()));
if (addvaluePackageMap.containsKey(entity.getOrderPackageCode() + "1")) {
stairsNumber = Convert.toInt(addvaluePackageMap.get(entity.getOrderPackageCode() + "1"));
}
if (!NumberUtil.equals(stairsNumber, 0)) {
stairsNumber = stairsNumber - 1;
}
// 平移米数
Integer translationNumber = 0;
if (addvaluePackageMap.containsKey(entity.getOrderPackageCode() + "3")) {
translationNumber = Convert.toInt(addvaluePackageMap.get(entity.getOrderPackageCode() + "3"));
}
// 签收数量
Integer signNum = entity.getSignNum();
@ -294,15 +302,17 @@ public class DeliverFinishReportListener implements ReportService {
// 上楼费成本 = 上楼费单价 * 上楼层数 * 签收件数
QualityDeliverEntity qualityDeliverEntity1 = valueMap.get(entity.getId());
if (ObjectUtil.isNotEmpty(stairsNumber) && StrUtil.isNotEmpty(stairsCharge)) {
qualityDeliverEntity1.setApstairsCost(NumberUtil.mul(stairsNumber, new BigDecimal(stairsCharge)));
qualityDeliverEntity1.setStairsNumber(stairsNumber);
qualityDeliverEntity1.setApstairsCost(NumberUtil.mul(stairsNumber, new BigDecimal(stairsCharge), signNum));
}
// 分货费成本 = 分货费单价 * 签收件数
if (StrUtil.isNotEmpty(cargoSplittingFee)) {
qualityDeliverEntity1.setApartCost(NumberUtil.mul(signNum, new BigDecimal(cargoSplittingFee)));
}
// 平移费成本 = 平移费单价 * 签收件数
// 平移费成本 = 平移费单价 * 平移米数 * 签收件数
if (StrUtil.isNotEmpty(translationFee)) {
qualityDeliverEntity1.setMoveCost(NumberUtil.mul(signNum, new BigDecimal(translationFee)));
qualityDeliverEntity1.setMoveNumber(translationNumber);
qualityDeliverEntity1.setMoveCost(NumberUtil.mul(translationNumber, new BigDecimal(translationFee), signNum));
}
// 装卸费成本 = 装卸费单价 * 签收件数
if (StrUtil.isNotEmpty(loadingUnloadingFee)) {
@ -742,18 +752,25 @@ public class DeliverFinishReportListener implements ReportService {
}
}
// 是否点位补贴成本 是 计算成本
// 是否点位补贴成本 是 打卡点位数 * 单价 / 总件数
Integer ynSiteSubsidy = rule.getYnSiteSubsidy();
if (NumberUtil.equals(ynSiteSubsidy, BooleanZeroOneEnums.YES.getCode())) {
if (CollUtil.isEmpty(allRouteMap) || CollUtil.isEmpty(firstRouteMap)) {
initRule(value, allRouteMap, firstRouteMap);
}
Set<Long> longs = valueMap.keySet();
Integer dkp = 0;
if (CollUtil.isNotEmpty(allRouteMap)) {
dkp = allRouteMap.keySet().size();
}
if (!NumberUtil.equals(dkp, 0)) {
dkp = dkp - 1;
}
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
String siteSubsidyCost = priceVO.getSiteSubsidyCost();
if (StrUtil.isNotEmpty(siteSubsidyCost)) {
value2.setPointAllowCost(NumberUtil.div(NumberUtil.mul(longs.size(), new BigDecimal(siteSubsidyCost)), totalNum));
value2.setPointAllowCost(NumberUtil.div(NumberUtil.mul(dkp, new BigDecimal(siteSubsidyCost)), totalNum));
}
}
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java

@ -69,12 +69,15 @@ public class LoadingReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}

99
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -16,6 +17,7 @@ import com.logpm.factorydata.vo.SendMsg;
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.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
@ -29,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -74,20 +77,36 @@ public class PlanReportListener implements ReportService {
Map<String, List<QualityDeliverEntity>> cmpMap = new HashMap<>();
Map<String, List<QualityDeliverEntity>> ltlMap = new HashMap<>();
Map<String, List<QualityDeliverEntity>> invMap = new HashMap<>();
if(CollUtil.isNotEmpty(reservationCodeSet)){
if (CollUtil.isNotEmpty(reservationCodeSet)) {
List<QualityDeliverEntity> qualityDeliverEntities = qualityDeliverService.list(Wrappers.<QualityDeliverEntity>lambdaQuery().in(QualityDeliverEntity::getPlanReservationCode, reservationCodeSet));
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getPlanReservationCode() + item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getPlanReservationCode() + item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getPlanReservationCode()) && StrUtil.isNotEmpty(item.getMallName()) && StrUtil.isNotEmpty(item.getMaterielCode()))
.collect(Collectors.groupingBy(item -> item.getPlanReservationCode() + item.getMallName() + item.getMaterielCode()));
} else {
// 没有查询到,延迟10秒重新推送
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE_DELAY)
.routingKey(null)
.message(msg)
.delay(10000)
.build());
return;
}
}
Set<String> cmpSet = new HashSet<>();
Set<String> ltlSet = new HashSet<>();
Set<String> invSet = new HashSet<>();
Set<Long> invedSet = new HashSet<>();
for (ReservationVO reservationVO : reservationVOList) {
String reservationCode = reservationVO.getReservationCode();
List<PackageData> details = reservationVO.getPackageDataList();
@ -96,7 +115,6 @@ public class PlanReportListener implements ReportService {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.planTrainNumber(vo.getTrainNumber())
.deliveryTime(DateUtil.parseDate(vo.getTaskTime()))
.deliveryType(vo.getType())
@ -109,6 +127,7 @@ public class PlanReportListener implements ReportService {
.bizCode(reservationVO.getReservationCode())
.ynWholeVehicle(vo.getYnWholeVehicle())
.deliveryFee(vo.getPrice())
.deliveryRemark(vo.getRemark())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
@ -120,6 +139,9 @@ public class PlanReportListener implements ReportService {
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
}
if(StrUtil.isNotEmpty(detail.getPackageCode())){
cmpSet.add(reservationCode + detail.getPackageCode());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
@ -132,6 +154,9 @@ public class PlanReportListener implements ReportService {
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
}
if(StrUtil.isNotEmpty(detail.getProductName()) && StrUtil.isNotEmpty(detail.getOrderCode())){
ltlSet.add(reservationCode + detail.getProductName() + detail.getOrderCode());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setBizCode(reservationVO.getReservationCode());
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
@ -144,47 +169,48 @@ public class PlanReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
if (BizOperationEnums.DELETE.equals(bizOperation)) {
for (QualityDeliverEntity deliverEntity : qualityDeliverEntities) {
qualityDeliverEntity.setId(deliverEntity.getId());
sendReport(qualityDeliverEntity, BizOperationEnums.DELETE);
if(!invedSet.contains(deliverEntity.getId())){
qualityDeliverEntity.setId(deliverEntity.getId());
sendReport(qualityDeliverEntity, BizOperationEnums.DELETE);
}
invedSet.add(deliverEntity.getId());
}
} else {
for (QualityDeliverEntity deliverEntity : qualityDeliverEntities) {
qualityDeliverEntity.setId(deliverEntity.getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
if(!invedSet.contains(deliverEntity.getId())){
qualityDeliverEntity.setId(deliverEntity.getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
invedSet.add(deliverEntity.getId());
}
}
}
}
if(StrUtil.isNotEmpty(detail.getMallName()) && StrUtil.isNotEmpty(detail.getMaterialCode())){
invSet.add(reservationCode + detail.getMallName() + detail.getMaterialCode());
}
}
}
}
// 系统中有的包件在当前不存在,则删除
Set<String> cmpSet = details.stream()
.filter(item -> ObjectUtil.equals(item.getPackageType(), PackageTypeEnums.CMP))
.map(i-> reservationCode + i.getPackageCode()).collect(Collectors.toSet());
for (Map.Entry<String, List<QualityDeliverEntity>> entry : cmpMap.entrySet()) {
String key = entry.getKey();
if (!cmpSet.contains(key)) {
sendReport(entry.getValue().get(0), BizOperationEnums.DELETE);
}
}
for (Map.Entry<String, List<QualityDeliverEntity>> entry : cmpMap.entrySet()) {
String key = entry.getKey();
if (!cmpSet.contains(key)) {
sendReport(entry.getValue().get(0), BizOperationEnums.DELETE);
}
Set<String> ltlSet = details.stream().filter(item -> ObjectUtil.equals(item.getPackageType(), PackageTypeEnums.LTL))
.map(i -> reservationCode + i.getProductName() + i.getOrderCode()).collect(Collectors.toSet());
for (Map.Entry<String, List<QualityDeliverEntity>> entry : ltlMap.entrySet()) {
String key = entry.getKey();
if (!ltlSet.contains(key)) {
sendReport(entry.getValue().get(0), BizOperationEnums.DELETE);
}
}
for (Map.Entry<String, List<QualityDeliverEntity>> entry : ltlMap.entrySet()) {
String key = entry.getKey();
if (!ltlSet.contains(key)) {
sendReport(entry.getValue().get(0), BizOperationEnums.DELETE);
}
Set<String> invSet = details.stream().filter(item -> ObjectUtil.equals(item.getPackageType(), PackageTypeEnums.INV))
.map(i -> reservationCode + i.getMallName() + i.getMaterialCode()).collect(Collectors.toSet());
for (Map.Entry<String, List<QualityDeliverEntity>> entry : invMap.entrySet()) {
String key = entry.getKey();
if (!invSet.contains(key)) {
List<QualityDeliverEntity> value = entry.getValue();
for (QualityDeliverEntity entity : value) {
sendReport(entity, BizOperationEnums.DELETE);
}
}
for (Map.Entry<String, List<QualityDeliverEntity>> entry : invMap.entrySet()) {
String key = entry.getKey();
if (!invSet.contains(key)) {
List<QualityDeliverEntity> value = entry.getValue();
for (QualityDeliverEntity entity : value) {
sendReport(entity, BizOperationEnums.DELETE);
}
}
}
@ -197,11 +223,16 @@ public class PlanReportListener implements ReportService {
.operation(operationEnums)
.node(WorkNodeEnums.PLAN_DELIVERY.getValue())
.build();
String exchange = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE;
String routKey = ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY;
if (operationEnums.equals(BizOperationEnums.ADD)) {
exchange = ReportConstants.REPORT_QUALITY_DELIVER_ADD_EXCHANGE;
routKey = ReportConstants.REPORT_QUALITY_DELIVER_ADD_ROUTINGKEY;
}
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.exchange(exchange)
.routingKey(routKey)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}

420
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java

@ -0,0 +1,420 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataFactoryCategoryClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.pros.DistributionProperties;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListInfoService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Nullable;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
/**
* 配送明细基础表处理类
*
* @author zhaoqiaobo
* @create 2024-03-18 0:02
*/
@Slf4j
@Component
@AllArgsConstructor
public class QualityDeliverAddListener implements ReportService {
@Resource
private IQualityDeliverService qualityDeliverService;
@Resource
private IBasicdataWarehouseClient warehouseClient;
@Resource
private IDistributionParcelListService parcelListService;
@Resource
private IDistributionStockArticleService stockArticleService;
@Resource
private IWarehouseWaybillClient warehouseWaybillClient;
@Resource
private IDistributionStockListService stockListService;
@Resource
private IDistributionStockListInfoService stockListInfoService;
@Resource
private IBasicdataFactoryCategoryClient factoryCategoryClient;
@Resource
private ITrunklineAdvanceDetailClient advanceDetailClient;
@Resource
private IWarehouseWaybillDetailClient waybillDetailClient;
@Resource
private BladeRedis redisCache;
@Resource
private DistributionProperties destinationProperties;
@Transactional
public void buildReport(String msg) {
ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class);
String node = bean.getNode();
String data = bean.getData();
QualityDeliverEntity qualityDeliverEntity = JSONUtil.toBean(data, QualityDeliverEntity.class);
if (ObjectUtil.equals(bean.getOperation(), BizOperationEnums.ADD)) {
// 查询不存在时更新,存在时修改
saveOrUpdate(null, qualityDeliverEntity);
}
if (ObjectUtil.equals(bean.getOperation(), BizOperationEnums.MODIFY)) {
// 查询不存在时更新,存在时修改
qualityDeliverService.updateById(qualityDeliverEntity);
}
}
/**
* 构建库存品查询Wrapper
*
* @param qualityDeliverEntity
* @Return com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.logpm.distribution.entity.QualityDeliverEntity>
* @Author zqb 2024/9/10
**/
private static @Nullable LambdaQueryWrapper<QualityDeliverEntity> buildInvWrapper(QualityDeliverEntity qualityDeliverEntity) {
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.lt(QualityDeliverEntity::getBizStatus, 110);
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getId())) {
// 库存品更新优先按id更新
wrapper.eq(QualityDeliverEntity::getId, qualityDeliverEntity.getId());
} else {
if (StrUtil.isNotEmpty(qualityDeliverEntity.getOrderPackageCode())) {
// 没有id,按包条码更新
wrapper.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode());
} else {
if (StrUtil.isEmpty(qualityDeliverEntity.getMallName())) {
// 没有id,没有包条码。没有商场,不处理。
return null;
} else {
// 否则加上商场过滤
wrapper.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName());
}
if (StrUtil.isEmpty(qualityDeliverEntity.getMaterielCode()) && StrUtil.isEmpty(qualityDeliverEntity.getMaterielName())) {
// 没有id,没有包条码,没有商场,没有物料,不处理。
return null;
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getMaterielCode())) {
// 优先按物料编码更新
wrapper.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode());
} else {
// 按物料名称更新
wrapper.eq(QualityDeliverEntity::getMaterielName, qualityDeliverEntity.getMaterielName());
}
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getBizCode())) {
// 有预约单号时加上预约单号过滤:存在同一个库存品在多个预约单中,只根据库存品本身的信息无法查询出对应的数据的情况。
wrapper.eq(QualityDeliverEntity::getBizCode, qualityDeliverEntity.getBizCode());
}
}
return wrapper;
}
/**
* 修改或者新增
*
* @param wrapper
* @param qualityDeliverEntity
* @Return void
* @Author zqb 2024/9/10
**/
private void saveOrUpdate(LambdaQueryWrapper<QualityDeliverEntity> wrapper, QualityDeliverEntity qualityDeliverEntity) {
QualityDeliverEntity entity = null;
if (ObjectUtil.isNotEmpty(wrapper)) {
wrapper.select(QualityDeliverEntity::getId);
entity = qualityDeliverService.getOne(wrapper);
}
if (ObjectUtil.isNotEmpty(entity)) {
// 修改
qualityDeliverEntity.setId(entity.getId());
qualityDeliverService.updateById(qualityDeliverEntity);
} else {
// 新增
// 初始化基础数据
initBasicData(qualityDeliverEntity);
qualityDeliverService.save(qualityDeliverEntity);
}
}
private void initBasicData(QualityDeliverEntity qualityDeliverEntity) {
// 仓库信息
warehouseInfo(qualityDeliverEntity);
Integer conditions = qualityDeliverEntity.getConditions();
if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), conditions)) {
// 订制品
// 构建订制品基础信息
DistributionParcelListEntity parcelListEntity = getDistributionParcelListEntity(qualityDeliverEntity.getOrderPackageCode(), qualityDeliverEntity.getWarehouseId());
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity);
}
if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
// 库存品
buildInvBasicInfo(qualityDeliverEntity);
}
if (ObjectUtil.equals(PackageTypeEnums.LTL.getCode(), conditions)) {
// 零担
WarehouseWayBillDetail wayBillDetail = waybillDetailClient.findENtityByCodeAndName(qualityDeliverEntity.getOrderCode(), qualityDeliverEntity.getCategory());
if (ObjectUtil.isNotEmpty(wayBillDetail)) {
qualityDeliverEntity.setCostCategoryId(wayBillDetail.getProductId());
qualityDeliverEntity.setRevenueCategoryId(wayBillDetail.getProductId());
qualityDeliverEntity.setCostCategory(wayBillDetail.getProductName());
qualityDeliverEntity.setRevenueCategory(wayBillDetail.getProductName());
}
DistributionParcelListEntity parcelListEntity = parcelListService.findByOrderCodeAndCategory(qualityDeliverEntity.getOrderCode(), qualityDeliverEntity.getCategory(), qualityDeliverEntity.getWarehouseId());
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity);
// buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
}
}
private DistributionParcelListEntity getDistributionParcelListEntity(String orderPackageCode, Long warehouseId) {
DistributionParcelListEntity parcelListEntity = parcelListService.selectByOrderPackageCode(orderPackageCode, warehouseId);
return parcelListEntity;
}
private void buildInvBasicInfo(QualityDeliverEntity qualityDeliverEntity) {
String materielName = qualityDeliverEntity.getMaterielName();
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setIncomingBatch(qualityDeliverEntity.getIncomingBatch());
stockListEntity.setMallName(qualityDeliverEntity.getMallName());
stockListEntity.setCargoNumber((qualityDeliverEntity.getMaterielCode()));
stockListEntity.setDescriptionGoods(materielName);
stockListEntity.setWarehouseId(qualityDeliverEntity.getWarehouseId());
DistributionStockListEntity stockList = stockListService.findStockListByAttrAndWarehouseId(stockListEntity);
if (ObjectUtil.isNotEmpty(stockList)) {
String brandName = stockList.getBrandName();
String sourceType = stockList.getSourceType();
if (StrUtil.equals(sourceType, "1")) {
// 定制品转的库存品先查出包条码
List<DistributionStockListInfoEntity> list = stockListInfoService.list(Wrappers.<DistributionStockListInfoEntity>lambdaQuery().eq(DistributionStockListInfoEntity::getStockListId, stockList.getId()));
if (CollUtil.isNotEmpty(list)) {
DistributionStockListInfoEntity distributionStockListInfoEntity = list.get(0);
DistributionParcelListEntity parcelListEntity = getDistributionParcelListEntity(distributionStockListInfoEntity.getPackageCode(), qualityDeliverEntity.getWarehouseId());
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity);
}
} else {
qualityDeliverEntity.setBeginWarehouseName(stockList.getWarehouseName());
qualityDeliverEntity.setBeginWarehouseInTime(stockList.getWarehousingTime());
qualityDeliverEntity.setBrandName(brandName);
qualityDeliverEntity.setMallCode(stockList.getMarketCode());
qualityDeliverEntity.setMallId(stockList.getMarketId());
qualityDeliverEntity.setAssignedCustomerId(Convert.toStr(stockList.getMarketId()));
qualityDeliverEntity.setAssignedCustomer(stockList.getMarketName());
qualityDeliverEntity.setStoreCode(stockList.getStoreCode());
qualityDeliverEntity.setStoreName(stockList.getStoreName());
qualityDeliverEntity.setEndWarehouseInTime(stockList.getWarehousingTime());
}
// 品类
// if (StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)) {
// BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity();
// factoryCategoryEntity.setMaterielName(materielName);
// factoryCategoryEntity.setBrand(brandName);
// factoryCategoryEntity.setType(2);
// BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
// factoryCategoryEntity.setType(1);
// BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
// if (ObjectUtil.isNotEmpty(categoryEntity)) {
// qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId());
// qualityDeliverEntity.setCostCategory(categoryEntity.getCategory());
// }
// if (ObjectUtil.isNotEmpty(categoryEntity1)) {
// qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory());
// qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId());
// }
// TODO 从入库单上查询入库时间
// }
}
}
private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity, DistributionParcelListEntity parcelListEntity) {
if (ObjectUtil.isNotEmpty(parcelListEntity)) {
// 品牌
qualityDeliverEntity.setBrandName(parcelListEntity.getBrandName());
// 商场id
// qualityDeliverEntity.setMallId(parcelListEntity.getMallId());
// 订制品的物料从包件上取
if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), qualityDeliverEntity.getConditions())) {
// 物料名称
qualityDeliverEntity.setMaterielName(parcelListEntity.getMaterialName());
// 物料编码
qualityDeliverEntity.setMaterielCode(parcelListEntity.getMaterialCode());
}
// 包条码
if (StrUtil.isNotEmpty(parcelListEntity.getOrderPackageCode())) {
qualityDeliverEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
}
// 订单号
qualityDeliverEntity.setOrderCode(parcelListEntity.getOrderCode());
// 工厂车次号
qualityDeliverEntity.setTrainNumber(parcelListEntity.getTrainNumber());
// 一级品
qualityDeliverEntity.setFirstsProduct(parcelListEntity.getFirsts());
// 二级品
qualityDeliverEntity.setSecondProduct(parcelListEntity.getSecond());
// 三级品
qualityDeliverEntity.setThirdProduct(parcelListEntity.getThirdProduct());
// 体积
qualityDeliverEntity.setVolume(parcelListEntity.getVolume());
// 重量
qualityDeliverEntity.setWeight(parcelListEntity.getWeight());
// 运单号
String waybillNumber = parcelListEntity.getWaybillNumber();
qualityDeliverEntity.setWaybillNumber(parcelListEntity.getWaybillNumber());
// 始发仓
qualityDeliverEntity.setBeginWarehouseName(parcelListEntity.getSendWarehouseName());
// 当前仓入库时间
qualityDeliverEntity.setEndWarehouseInTime(parcelListEntity.getWarehouseEntryTimeEnd());
// 构建运单相关信息
buildWaybillInfo(qualityDeliverEntity, waybillNumber);
}
// 暂存单查询结算品类
// TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
// if (ObjectUtil.isNotEmpty(advanceDetailEntity)) {
// qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId());
// qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName());
// qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId());
// qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName());
// }
// 构建订单相关信息
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
}
private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) {
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticleEntity(warehouseId, orderCode);
if (ObjectUtil.isNotEmpty(stockArticleEntity)) {
qualityDeliverEntity.setOrderNumber(stockArticleEntity.getTotalNumber());
// 客户信息
qualityDeliverEntity.setCustomName(stockArticleEntity.getCustomerName());
qualityDeliverEntity.setCustomPhone(stockArticleEntity.getCustomerTelephone());
qualityDeliverEntity.setCustomAddress(stockArticleEntity.getCustomerAddress());
// 商场信息
qualityDeliverEntity.setMallName(stockArticleEntity.getMallName());
qualityDeliverEntity.setMallId(stockArticleEntity.getMallId());
qualityDeliverEntity.setMallCode(stockArticleEntity.getMallCode());
// 服务号
qualityDeliverEntity.setServiceNumber(stockArticleEntity.getServiceNumber());
// 经销商信息
qualityDeliverEntity.setDealerName(stockArticleEntity.getDealerName());
qualityDeliverEntity.setDealerCode(stockArticleEntity.getDealerCode());
// 门店信息
qualityDeliverEntity.setStoreCode(stockArticleEntity.getStoreCode());
qualityDeliverEntity.setStoreName(stockArticleEntity.getStoreName());
// 品牌
qualityDeliverEntity.setBrandName(stockArticleEntity.getBrand());
}
}
private DistributionStockArticleEntity getDistributionStockArticleEntity(Long warehouseId, String orderCode) {
String key = "report:qualityDeliver:stockArticle:" + warehouseId + "_" + orderCode;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, DistributionStockArticleEntity.class);
}
DistributionStockArticleEntity stockArticleEntity = stockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (ObjectUtil.isNotEmpty(stockArticleEntity)) {
redisCache.setEx(key, JSONUtil.toJsonStr(stockArticleEntity), 60 * 60L + RandomUtil.randomInt(600));
return stockArticleEntity;
}
return null;
}
private void buildWaybillInfo(QualityDeliverEntity qualityDeliverEntity, String waybillNumber) {
if (StrUtil.isNotEmpty(waybillNumber)) {
WarehouseWaybillEntity byWaybillNo = getWarehouseWaybillEntity(waybillNumber);
if (ObjectUtil.isNotEmpty(byWaybillNo)) {
qualityDeliverEntity.setOpenOrderTime(byWaybillNo.getDocumentMakingTime());
// 运单发货信息
qualityDeliverEntity.setShipperUnitId(byWaybillNo.getShipperId());
qualityDeliverEntity.setShipperUnit(byWaybillNo.getShipper());
qualityDeliverEntity.setShipperPerson(byWaybillNo.getShipperName());
qualityDeliverEntity.setShipperMobile(byWaybillNo.getShipperMobile());
qualityDeliverEntity.setShipperAddress(byWaybillNo.getShipperAddress());
// 运单收货信息
qualityDeliverEntity.setConsigneeUnitId(byWaybillNo.getConsigneeId());
qualityDeliverEntity.setConsigneeUnit(byWaybillNo.getConsignee());
qualityDeliverEntity.setConsigneePerson(byWaybillNo.getConsigneeName());
qualityDeliverEntity.setConsigneeMobile(byWaybillNo.getConsigneeMobile());
qualityDeliverEntity.setConsigneeAddress(byWaybillNo.getConsigneeAddress());
qualityDeliverEntity.setAssignedCustomerId(Convert.toStr(byWaybillNo.getConsigneeId()));
qualityDeliverEntity.setAssignedCustomer(byWaybillNo.getConsignee());
}
}
}
private WarehouseWaybillEntity getWarehouseWaybillEntity(String waybillNumber) {
String key = "report:qualityDeliver:waybill:" + waybillNumber;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, WarehouseWaybillEntity.class);
}
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNumber);
if (ObjectUtil.isNotEmpty(byWaybillNo)) {
redisCache.setEx(key, JSONUtil.toJsonStr(byWaybillNo), 60 * 60L + RandomUtil.randomInt(600));
return byWaybillNo;
}
return null;
}
private void warehouseInfo(QualityDeliverEntity qualityDeliverEntity) {
BasicdataWarehouseEntity warehouseEntity = getBasicdataWarehouseEntities(qualityDeliverEntity.getWarehouseId());
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
// 事业线
qualityDeliverEntity.setBusinessUnit(warehouseEntity.getBusinessLine());
qualityDeliverEntity.setWarehousePosition(StrUtil.concat(true, Convert.toStr(warehouseEntity.getLongitude()), ",", Convert.toStr(warehouseEntity.getLatitude())));
}
}
public BasicdataWarehouseEntity getBasicdataWarehouseEntities(Long warehouseId) {
String key = "report:qualityDeliver:warehouse:" + warehouseId;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, BasicdataWarehouseEntity.class);
}
List<BasicdataWarehouseEntity> warehouseEntities = warehouseClient.findWarehousesByIds(Arrays.asList(warehouseId));
if (CollUtil.isNotEmpty(warehouseEntities)) {
redisCache.setEx(key, JSONUtil.toJsonStr(warehouseEntities.get(0)), 60 * 60L + RandomUtil.randomInt(600));
return warehouseEntities.get(0);
}
return null;
}
}

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -97,39 +97,6 @@ public class QualityDeliverListener implements ReportService {
Integer conditions = qualityDeliverEntity.getConditions();
if (ObjectUtil.equals(bean.getOperation(), BizOperationEnums.MODIFY)) {
qualityDeliverService.updateById(qualityDeliverEntity);
// if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), conditions)) {
// // 定制品
// LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery();
// if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getId())) {
// wrapper.eq(QualityDeliverEntity::getId, qualityDeliverEntity.getId());
// } else {
// wrapper.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode());
// }
// wrapper.lt(QualityDeliverEntity::getBizStatus, 110);
// saveOrUpdate(wrapper, qualityDeliverEntity);
// } else if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
// // 库存品
// LambdaQueryWrapper<QualityDeliverEntity> wrapper = buildInvWrapper(qualityDeliverEntity);
// if (wrapper == null) {
// return;
// }
// // 查询不存在时更新,存在时修改
// saveOrUpdate(wrapper, qualityDeliverEntity);
// } else if (ObjectUtil.equals(PackageTypeEnums.LTL.getCode(), conditions)) {
// // 零担
// LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery();
// if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getId())) {
// wrapper.eq(QualityDeliverEntity::getId, qualityDeliverEntity.getId());
// } else {
// wrapper.eq(QualityDeliverEntity::getOrderCode, qualityDeliverEntity.getOrderCode())
// .eq(QualityDeliverEntity::getCategory, qualityDeliverEntity.getCategory());
// }
// wrapper.lt(QualityDeliverEntity::getBizStatus, 110);
// if (StrUtil.isNotEmpty(qualityDeliverEntity.getBizCode())) {
// wrapper.eq(QualityDeliverEntity::getBizCode, qualityDeliverEntity.getBizCode());
// }
// saveOrUpdate(wrapper, qualityDeliverEntity);
// }
}
if (ObjectUtil.equals(bean.getOperation(), BizOperationEnums.ADD)) {
// 查询不存在时更新,存在时修改

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java

@ -68,12 +68,15 @@ public class ReViewReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}

82
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java

@ -8,6 +8,7 @@ import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.model.workNode.FinishDistributionTrainVO;
import org.springframework.amqp.core.ExchangeTypes;
@ -54,6 +55,7 @@ public class ReportListener {
try {
selectReportService(BillPlanReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("自提任务生成明细报表失败: {}", e.getMessage());
}
}
@ -63,6 +65,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.DeliveryOfPickup.BillSignReview.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.DeliveryOfPickup.BillSignReview.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -80,6 +83,7 @@ public class ReportListener {
try {
selectReportService(BillReViewReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("自提复核生成明细报表失败: {}", e.getMessage());
}
}
@ -89,6 +93,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.DeliveryOfPickup.BillSign.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.DeliveryOfPickup.BillSign.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -106,6 +111,7 @@ public class ReportListener {
try {
selectReportService(BillSignforReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("自提签收扫描生成明细报表失败: {}", e.getMessage());
}
}
@ -115,6 +121,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndCarStart.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndCarStart.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -132,6 +139,7 @@ public class ReportListener {
try {
selectReportService(CarStartReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("发车生成明细报表失败: {}", e.getMessage());
}
}
@ -141,6 +149,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndConsigneeArrive.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndConsigneeArrive.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -158,6 +167,7 @@ public class ReportListener {
try {
selectReportService(ConsigneeArriveReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("配送到达生成明细报表失败: {}", e.getMessage());
}
}
@ -167,6 +177,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndFinish.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndFinish.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -194,6 +205,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndLoading.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndLoading.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -211,6 +223,7 @@ public class ReportListener {
try {
selectReportService(LoadingReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("装车生成明细报表失败: {}", e.getMessage());
}
}
@ -220,6 +233,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndPlan.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE, type = ExchangeTypes.FANOUT)
@ -237,6 +251,37 @@ public class ReportListener {
try {
selectReportService(PlanReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("配送计划生成明细报表失败: {}", e.getMessage());
}
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndPlan.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE_DELAY,
type = ExchangeTypes.FANOUT,
delayed = FactoryDataConstants.Mq.DELAYED)
), ackMode = "MANUAL")
public void planReportDelayListener(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
Boolean flag = Boolean.TRUE;
if (!destinationProperties.getReport().getPlanReport()) {
flag = Boolean.FALSE;
}
log.info("配送计划生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
flag = Boolean.FALSE;
}
if (flag) {
try {
selectReportService(PlanReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("配送计划生成明细报表失败: {}", e.getMessage());
}
}
@ -264,6 +309,7 @@ public class ReportListener {
try {
selectReportService(ReservationPlanReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("预约计划生成明细报表失败: {}", e.getMessage());
}
}
@ -291,6 +337,7 @@ public class ReportListener {
try {
selectReportService(ReturnWarehouseReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("回库生成明细报表失败: {}", e.getMessage());
}
}
@ -318,6 +365,7 @@ public class ReportListener {
try {
selectReportService(ReViewReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("文员复核生成明细报表失败: {}", e.getMessage());
}
}
@ -345,6 +393,7 @@ public class ReportListener {
try {
selectReportService(SignforReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("签收扫描生成明细报表失败: {}", e.getMessage());
}
}
@ -372,6 +421,7 @@ public class ReportListener {
try {
selectReportService(StockReportListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("备货生成明细报表失败: {}", e.getMessage());
}
}
@ -381,6 +431,7 @@ public class ReportListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_QUALITY_DELIVER_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE, type = ExchangeTypes.TOPIC),
@ -399,6 +450,7 @@ public class ReportListener {
try {
selectReportService(QualityDeliverListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("配送明细基础表处理失败: {}", e.getMessage());
}
}
@ -409,6 +461,35 @@ public class ReportListener {
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_QUALITY_DELIVER_ADD_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_DELIVER_ADD_EXCHANGE, type = ExchangeTypes.TOPIC),
key = ReportConstants.REPORT_QUALITY_DELIVER_ADD_ROUTINGKEY
), ackMode = "MANUAL")
public void qualityDeliverAddListener(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
Boolean flag = Boolean.TRUE;
if (!destinationProperties.getReport().getQualityDeliver()) {
flag = Boolean.FALSE;
}
log.info("配送明细基础表Add: {}", msg);
if (StrUtil.isEmpty(msg)) {
flag = Boolean.FALSE;
}
if (flag) {
try {
selectReportService(QualityDeliverAddListener.class).buildReport(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("配送明细基础表Add失败: {}", e.getMessage());
}
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_QUALITY_CAR_FINAL_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_CAR_FINAL_EXCHANGE, type = ExchangeTypes.TOPIC),
@ -421,6 +502,7 @@ public class ReportListener {
String trainNumber = vo.getTrainNumber();
qualityDeliverService.carExpenseDispatchDetailFinal(trainNumber);
} catch (Exception e) {
e.printStackTrace();
log.error("生成车辆车次成本报表失败: {}", e.getMessage());
}

32
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java

@ -70,13 +70,45 @@ public class ReservationPlanReportListener implements ReportService {
}
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getMallName()) && StrUtil.isNotEmpty(item.getMaterielCode()) && StrUtil.isNotEmpty(item.getIncomingBatch()))
.collect(Collectors.groupingBy(item -> item.getMallName() + item.getMaterielCode() + item.getIncomingBatch()));
// 移除指定包件
if (BizOperationEnums.REMOVE.equals(bizOperation)) {
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
if (cmpMap.containsKey(detail.getPackageCode())) {
QualityDeliverEntity qualityDeliverEntity = new QualityDeliverEntity();
qualityDeliverEntity.setId(cmpMap.get(detail.getPackageCode()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.DELETE);
}
}
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
if (ltlMap.containsKey(detail.getProductName() + detail.getOrderCode())) {
QualityDeliverEntity qualityDeliverEntity = new QualityDeliverEntity();
qualityDeliverEntity.setId(ltlMap.get(detail.getProductName() + detail.getOrderCode()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.DELETE);
}
}
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
if (invMap.containsKey(detail.getMallName() + detail.getMaterialCode() + detail.getPickupBatch())) {
QualityDeliverEntity qualityDeliverEntity = new QualityDeliverEntity();
qualityDeliverEntity.setId(invMap.get(detail.getMallName() + detail.getMaterialCode() + detail.getPickupBatch()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.DELETE);
}
}
}
}
return;
}
}
}
if (CollUtil.isNotEmpty(details)) {

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java

@ -70,12 +70,15 @@ public class SignforReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}
@ -86,6 +89,7 @@ public class SignforReportListener implements ReportService {
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.signUserId(vo.getDriverId())
.signDriverName(vo.getDriverName())
.signUserName(bean.getOperator())
.signTime(bean.getOperatorTime())
.signCarNumber(vo.getVehicleName())

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java

@ -65,12 +65,15 @@ public class StockReportListener implements ReportService {
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getMallName()) && StrUtil.isNotEmpty(item.getMaterielCode()))
.collect(Collectors.groupingBy(item -> item.getMallName() + item.getMaterielCode()));
}
}
@ -132,11 +135,11 @@ public class StockReportListener implements ReportService {
}
} else {
List<QualityDeliverEntity> collect = qualityDeliverEntities.stream()
.filter( i -> StrUtil.isEmpty(i.getStockupCode()))
.filter(i -> StrUtil.isEmpty(i.getStockupCode()))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(collect)) {
qualityDeliverEntity.setId(collect.get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
sendReport(qualityDeliverEntity, BizOperationEnums.ADD);
}
}
}
@ -152,11 +155,16 @@ public class StockReportListener implements ReportService {
.operation(operationEnums)
.node(WorkNodeEnums.STOCKING_OPERATION.getValue())
.build();
String exchange = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE;
String routKey = ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY;
if (operationEnums.equals(BizOperationEnums.ADD)) {
qualityDeliverService.updateById(qualityDeliverEntity);
return;
}
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.exchange(exchange)
.routingKey(routKey)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}

36
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvaluePackageServiceImpl.java

@ -17,10 +17,9 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionAddvalueDetailEntity;
import com.logpm.distribution.entity.DistributionAddvaluePackageEntity;
import com.logpm.distribution.excel.DistributionAddvaluePackageExcel;
import com.logpm.distribution.mapper.DistributionAddvaluePackageMapper;
@ -28,7 +27,6 @@ import com.logpm.distribution.service.IDistributionAddvalueDetailService;
import com.logpm.distribution.service.IDistributionAddvaluePackageService;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -36,7 +34,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 增值服务包件表 服务实现类
@ -68,29 +65,14 @@ public class DistributionAddvaluePackageServiceImpl extends BaseServiceImpl<Dist
@Override
public Map<String, String> findMapByPackageCode(Set<String> collect1) {
Map<String, String> result = new HashMap<>();
List<DistributionAddvaluePackageEntity> list = this.list(Wrappers.<DistributionAddvaluePackageEntity>lambdaQuery()
.select(DistributionAddvaluePackageEntity::getAddvalueDetailId, DistributionAddvaluePackageEntity::getOrderPackageCode)
.in(DistributionAddvaluePackageEntity::getOrderPackageCode, collect1));
if (CollUtil.isNotEmpty(list)) {
// 转map
Map<Long, String> map = list.stream()
.filter(it -> ObjectUtil.isNotEmpty(it.getAddvalueDetailId()))
.collect(Collectors.toMap(
DistributionAddvaluePackageEntity::getAddvalueDetailId,
DistributionAddvaluePackageEntity::getOrderPackageCode,
(existingValue, newValue) -> existingValue // 处理键冲突
));
List<DistributionAddvalueDetailEntity> list1 = addvalueDetailService.list(
Wrappers.<DistributionAddvalueDetailEntity>lambdaQuery()
.select(DistributionAddvalueDetailEntity::getFloolNum, DistributionAddvalueDetailEntity::getId)
.in(DistributionAddvalueDetailEntity::getId, map.keySet())
);
if (CollUtil.isNotEmpty(list1)) {
Map<Long, Integer> map1 = list1.stream().collect(Collectors.toMap(DistributionAddvalueDetailEntity::getId, DistributionAddvalueDetailEntity::getFloolNum));
map.forEach((k, v) -> {
result.put(v, map1.get(k) + "");
});
}
if(CollUtil.isEmpty(collect1)){
return null;
}
List<JSONObject> list = baseMapper.findMapByPackageCode(collect1);
if(CollUtil.isNotEmpty(list)){
list.stream().forEach(item -> {
result.put(item.getStr("orderPackageCode") + item.getStr("addvalueId"), item.getStr("num"));
});
}
return result;
}

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

@ -126,6 +126,7 @@ import org.springblade.common.constant.reservation.ReservationStockupStatusConst
import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -2154,8 +2155,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.eq(DistributionStockupInfoEntity::getReservationId, reservationId)
);
if (ObjectUtils.isNull(distributionStockupInfoEntity)) {
log.info("预约数据不存在!!");
throw new ServiceException("预约数据不存在!!");
log.warn("预约数据不存在!!");
// throw new ServiceException("预约数据不存在!!");
return ;
}
String stockUpType = distributionStockupInfoEntity.getStockUpType();
//维护备货时间
@ -2174,8 +2176,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.apply("inventory_status in (1,3)")
);
if (ObjectUtils.isNull(one)) {
log.info("自提库存品数据为空!!");
throw new ServiceException("自提库存品数据为空!!");
log.warn("自提库存品数据为空!!");
return ;
// throw new ServiceException("自提库存品数据为空!!");
}
DistributionDeliveryDetailsEntity entity = new DistributionDeliveryDetailsEntity();
entity.setId(one.getId());
@ -2196,8 +2200,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.apply("stock_list_status in (1,3)")
);
if (ObjectUtils.isNull(one1)) {
log.info("预约库存品数据为空!!");
throw new ServiceException("预约库存品数据为空!!");
log.warn("预约库存品数据为空!!");
return ;
// throw new CustomerException("预约库存品数据为空!!");
}
DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity();
reservationStocklistEntity.setId(one1.getId());
@ -3165,7 +3171,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
pushInstallDTO.setBalance_people("1");
pushInstallDTO.setBalance_type(client.getDefaultPaymentMethods());
} else {
log.error(method + ">>>>>>>>>>>>>查询客户信息失败" + reservationEntity.getReceivingUnit());
log.warn(method + ">>>>>>>>>>>>>查询客户信息失败" + reservationEntity.getReceivingUnit());
}
List<PushInstallDTO.Order> orderList = new ArrayList<>();

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

@ -39,126 +39,17 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO;
import com.logpm.distribution.dto.DistributionDeliveryExcelDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.DistributionDeliverySelfDTO;
import com.logpm.distribution.dto.DistributionDeliveryTripartiteDTO;
import com.logpm.distribution.dto.DistributionLoadingNumDTO;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.DistributionParcelNumberDTO;
import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.DistributionStockupDTO;
import com.logpm.distribution.dto.PushNotificationDTO;
import com.logpm.distribution.dto.*;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import com.logpm.distribution.entity.DistributionDeliveryChargeEntity;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionLoadscaninvnEntity;
import com.logpm.distribution.entity.DistributionPackadeliEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionPlanLogEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.entity.DistributionRetentionScanEntity;
import com.logpm.distribution.entity.DistributionSigndetailEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.entity.DistributionStockupInfoEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity;
import com.logpm.distribution.entity.DistrilbutionBillStockEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.logpm.distribution.mapper.DistributionDeliveryChargeMapper;
import com.logpm.distribution.mapper.DistributionDeliveryInfoMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
import com.logpm.distribution.mapper.DistributionDeliverySelfMapper;
import com.logpm.distribution.mapper.DistributionDeliveryTripartiteMapper;
import com.logpm.distribution.mapper.DistributionLoadscanMapper;
import com.logpm.distribution.mapper.DistributionLoadscaninvnMapper;
import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionReservationPackageMapper;
import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper;
import com.logpm.distribution.mapper.DistributionSignforMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.mapper.DistrilbutionBillPackageMapper;
import com.logpm.distribution.mapper.DistrilbutionBillStockMapper;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistributionBillLadingScanService;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import com.logpm.distribution.service.IDistributionDeliveryTripartiteService;
import com.logpm.distribution.service.IDistributionLoadscanAbnormalService;
import com.logpm.distribution.service.IDistributionNodeWorkService;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionPlanLogService;
import com.logpm.distribution.service.IDistributionReservationPackageService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionReservationStockarticleService;
import com.logpm.distribution.service.IDistributionReservationStocklistService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionStockupInfoService;
import com.logpm.distribution.vo.DisStockListDetailVO;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO;
import com.logpm.distribution.vo.DistributionDeliveryListPrintRequestVO;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.DistributionDeliveryTripartiteVO;
import com.logpm.distribution.vo.DistributionDeliveryWordVO;
import com.logpm.distribution.vo.DistributionOrderInfoVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionReservationOrderPackageVO;
import com.logpm.distribution.vo.DistributionReservationStocklistVO;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.DistributionStockupVO;
import com.logpm.distribution.vo.DistributionTrayRetentionVO;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO;
import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO;
import com.logpm.distribution.vo.app.DistributionAppDetailVO;
import com.logpm.distribution.vo.app.DistributionAppNewDeliveryListVO;
import com.logpm.distribution.vo.app.DistributionAppNewReservationVO;
import com.logpm.distribution.vo.app.DistributionAppParcelListVO;
import com.logpm.distribution.vo.app.DistributionAppReservationVO;
import com.logpm.distribution.vo.app.DistributionAppStockArticleVO;
import com.logpm.distribution.vo.app.DistributionAppStockListVO;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.vo.print.PrintPreviewVO;
import com.logpm.distribution.wrapper.DistributionDeliveryListWrapper;
import com.logpm.distribution.wrapper.DistributionDisStockListWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.distribution.wrapper.*;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
@ -168,13 +59,7 @@ import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseConfigClient;
import com.logpm.warehouse.feign.IWarehouseRetentionScanClient;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
@ -192,27 +77,10 @@ import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStartStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadScanSigningTypeStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalTypeConstant;
import org.springblade.common.constant.loading.LoadingIsInsertConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageGroundingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.loading.*;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.constant.reservation.ReservationInventoryStatusConstant;
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.reservation.ReservationStatusConstant;
import org.springblade.common.constant.reservation.ReservationStockupStatusConstant;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.retention.RetentionSourceTypeConstant;
import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
@ -220,13 +88,7 @@ import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.CarStartVO;
import org.springblade.common.model.DistributionLoadVO;
import org.springblade.common.model.DistributionTaskVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.PlanDriverbindCarVO;
import org.springblade.common.model.ReservationVO;
import org.springblade.common.model.*;
import org.springblade.common.model.workNode.FinishDistributionTrainVO;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
@ -263,17 +125,7 @@ import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -1274,8 +1126,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
if (CollUtil.isNotEmpty(pushList)) {
@ -1325,8 +1176,30 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanSuccessWithData("装车成功", carLaodNum + "件", carLaodNum);
}
/**
* 装车节点按照预约进行推送
* @param distributionDeliveryListEntity
* @param pushNodeList
*/
private void sendBuildNodeFanoutMsgByPackage(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList){
// 提供预约单
Map<Long, List<DistributionLoadscanEntity>> collect = pushNodeList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getReservationId));
if(collect.isEmpty()){
return ;
}
Set<Long> keys = collect.keySet();
for (Long key : keys) {
List<DistributionLoadscanEntity> list = collect.get(key);
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(key);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackageByReservationCode(distributionDeliveryListEntity, list, reservationEntity.getReservationCode());
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByPackage(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList) {
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByPackageByReservationCode(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList,String reservationCode) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
@ -1337,6 +1210,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
DistributionLoadVO distributionLoadVO = new DistributionLoadVO();
distributionLoadVO.setReservationCode(reservationCode);
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity);
@ -1444,7 +1318,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return jsonArray;
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> ts) {
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> ts,String reservationCode) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
@ -1456,7 +1330,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
// nodeFanoutMsg.setMain(taskVO);
DistributionLoadVO distributionLoadVO = new DistributionLoadVO();
distributionLoadVO.setReservationCode(reservationCode);
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity);
String driverName = distributionDeliveryListEntity.getDriverName();
@ -1514,33 +1388,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@NotNull
private PackageData getPackageData(DistributionParcelListEntity parcelListEntity) {
PackageData packageData = new PackageData();
packageData.setWaybillNumber(parcelListEntity.getWaybillNumber());
packageData.setBrand(parcelListEntity.getBrandName());
packageData.setPackageCode(parcelListEntity.getOrderPackageCode());
packageData.setMaterialCode(parcelListEntity.getMaterialCode());
packageData.setMaterialName(parcelListEntity.getMaterialName());
packageData.setNumber(1);
packageData.setOrderCode(parcelListEntity.getOrderCode());
packageData.setPackageType(PackageTypeEnums.CMP);
return packageData;
}
private void extracteOrderPackageStatus(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO, DistributionParcelListEntity parcelListEntity, BasicdataWarehouseEntity myCurrentWarehouse, DistributionReservationEntity reservationEntity) {
Map<String, Object> map = new HashMap<>();
map.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
map.put("warehouseId", myCurrentWarehouse.getId());
//包件配送下架
warehouseUpdownTypeClient.downDeliveryPackage(map);
//维护订单的信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
//维护预约的信息
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId());
//维护配送任务信息
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
}
private Integer getCarLaodNum(Long deliveryId) {
@ -1561,65 +1410,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class)
public void changeDeliveryListStatuss(String barcode, Long deliveryId) {
//这里需要查询出该包件
DistributionParcelListEntity parcelListEntity = distributionDeliveryListMapper.getLoadingPackageDetails(barcode, deliveryId);
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
//修改包件状态
distributionParcelListService.updateById(parcelListEntity);
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId));
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId()));
boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
//维护包件、订单扫描装车状态
if (flag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else {
flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (flag) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
}
distributionStockArticleService.updateById(stockArticleEntity);
//维护包件、预约的扫描状态
//查询出配送任务下的所有包件
List<DistributionParcelListEntity> deliveryParcelListEntityList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId);
boolean deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (deliveryLoadingFlag) {
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
} else {
deliveryLoadingFlag = deliveryParcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (deliveryLoadingFlag) {
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
} else {
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
}
}
distributionDeliveryListMapper.updateById(deliveryListEntity);
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId);
reservationEntityList.forEach(r -> {
//查询预约下的所有包件信息
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(r.getId());
boolean reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (reservationLoadingFlag) {
r.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
} else {
reservationLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (reservationLoadingFlag) {
r.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
} else {
r.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
}
}
distributionReservationMapper.updateById(r);
});
}
@Override
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
public R loadingack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
@ -2036,26 +1826,41 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionDeliveryListVO deliveryList = distributionDeliveryListService.getDeliveryList(distrilbutionloadingscanDTO.getDeliveryId());
// 发送 订制品
if(Func.isNotEmpty(dingzhis)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryList, dingzhis);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByPackage(deliveryList, dingzhis);
}
// 发库存
if(Func.isNotEmpty(kucuns)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryList, kucuns);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByStock(deliveryList, kucuns);
}
//发零担
if(Func.isNotEmpty(lingdans)){
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrder(deliveryList, lingdans);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByZeroOrder(deliveryList,lingdans);
}
return Resp.scanSuccess("操作成功", "装车成功");
}
private void sendBuildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> ts){
Map<Long, List<DistributionLoadscaninvnEntity>> collect = ts.stream().collect(Collectors.groupingBy(DistributionLoadscaninvnEntity::getReservationId));
if(collect.isEmpty()){
return;
}
Set<Long> keys = collect.keySet();
for (Long key : keys) {
List<DistributionLoadscaninvnEntity> list = collect.get(key);
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(key);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, list,reservationEntity.getReservationCode());
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
return Resp.scanSuccess("操作成功", "装车成功");
}
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
@Override
public R oneack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
@ -2268,9 +2073,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByStock(distributionDeliveryListEntity,ts);
String msg = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("扫描成功", msg);
}
@ -3938,7 +3741,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionTaskVO.setPrice(Convert.toStr(distributionDeliveryListEntity.getPrice()));
}
distributionTaskVO.setTaskTime(distributionDeliveryListEntity.getTaskTime());
distributionTaskVO.setRemark(distributionDeliveryListEntity.getRemarks());
List<ReservationVO> reservationVOList = distributionDeliveryListService.getDeliveryreBroadcastData(distributionDeliveryListEntity.getId(), distributionDeliveryListEntity.getWarehouseId());
distributionTaskVO.setReservationVOList(reservationVOList);
@ -6291,8 +6094,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 发送作业节点数据
if (CollUtil.isNotEmpty(pushNodeList)) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
distributionNodeWorkService.abnormalLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
}
return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件");
}
@ -6672,15 +6474,30 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (CollUtil.isNotEmpty(pushNodeList)) {
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrder(deliveryListEntity, pushNodeList);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByZeroOrder(deliveryListEntity, pushNodeList);
}
return Resp.scanSuccess("装车成功", str.toString());
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByZeroOrder(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList) {
private void sendBuildNodeFanoutMsgByZeroOrder(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList){
Map<Long, List<DistributionLoadscanEntity>> collect = pushNodeList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getReservationId));
if(collect.isEmpty()){
return;
}
Set<Long> keys = collect.keySet();
for (Long key : keys) {
List<DistributionLoadscanEntity> list = collect.get(key);
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(key);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrderByReservationCode(distributionDeliveryListEntity, list,reservationEntity.getReservationCode());
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByZeroOrderByReservationCode(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList,String reservationCode) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
@ -6689,10 +6506,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
DistributionLoadVO distributionLoadVO = new DistributionLoadVO();
distributionLoadVO.setReservationCode(reservationCode);
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity);
String driverName = distributionDeliveryListEntity.getDriverName();
@ -9423,8 +9238,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
inventoryJsonObject.put("remark", "装车下架");
jsonObjects.add(inventoryJsonObject);
if (CollUtil.isNotEmpty(ts)) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByStock(deliveryListEntity,ts);
}
break;
case 4:
@ -9581,8 +9395,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
if (CollUtil.isNotEmpty(pushNodeList)) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
sendBuildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
}
//维护订单数量
if (!orderCodes.isEmpty()) {

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

@ -46,14 +46,7 @@ import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupInfoMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionReservationOrderPackageVO;
import com.logpm.distribution.vo.DistributionReservationVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.DistributionStockupOrderListVO;
import com.logpm.distribution.vo.DistributionStockupStockListVO;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
@ -3966,6 +3959,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
List<Long> list = Func.toLongList(distributionCancelReservationPackageDTO.getPackageIds());
log.info(method + "取消包件>>>>:{}", distributionCancelReservationPackageDTO.getPackageIds());
Map<String,List> map = new HashMap<>();
List<DistributionReservationPackageEntity> allPackageEntityList = new ArrayList<>();
List<DistributionReservationZeroPackageEntity> allZeroPackageEntityList = new ArrayList<>();
List<DistributionReservationStocklistEntity> allStockListEntityList = new ArrayList<>();
switch (distributionCancelReservationPackageDTO.getType()) {
case 1:
@ -3996,6 +3995,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListMapper.updateById(parcelListEntity);
// 增加移除的包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
reservationPackageEntity.setParceListId(parcelListEntity.getId());
allPackageEntityList.add(reservationPackageEntity);
/**
* 取消指定预约下包件
*/
@ -4038,11 +4042,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
int QuantityOccupied = stockListEntity.getQuantityOccupied() - disStockListDetailEntity.getNum();
stockListEntity.setQuantityOccupied(QuantityOccupied);
distributionStockListService.updateById(stockListEntity);
DistributionReservationStocklistEntity reservationStocklistEntity =new DistributionReservationStocklistEntity();
reservationStocklistEntity.setStocklistId(disStockListDetailEntity.getStockListId());
reservationStocklistEntity.setReservationId(reservationEntity.getId());
allStockListEntityList.add(reservationStocklistEntity);
}
//维护对应库存品信息
distributionReservationStocklistService.maintenanceReservationStockList(distributionCancelReservationPackageDTO.getReservationId());
break;
}
if (!allPackageEntityList.isEmpty()) {
map.put("1",allPackageEntityList);
}
if (!allStockListEntityList.isEmpty()) {
map.put("3",allStockListEntityList);
}
//维护预约单状态
this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId());
//维护预约单数量
@ -4051,13 +4068,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListService.maintenanceDeliveryInfo(distributionCancelReservationPackageDTO.getDeliveryId());
//维护配送任务数量
distributionDeliveryListService.maintenanceDeliveryNum(distributionCancelReservationPackageDTO.getDeliveryId());
// 作业节点推送
DistributionDeliveryListEntity deliveryListEntity= distributionDeliveryListService.getById(distributionCancelReservationPackageDTO.getDeliveryId());
NodeFanoutMsg<DistributionTaskVO> nodeFanoutMsg = distributionDeliveryListService.buildNodeFanoutMsgForPlan(deliveryListEntity, AuthUtil.getUser(), BizOperationEnums.MODIFY);
distributionNodeWorkService.planDelivery(nodeFanoutMsg, AuthUtil.getUser());
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = buildNodeFanoutMsgByReservation(reservationEntity,map,BizOperationEnums.REMOVE);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser());
return R.status(true);
}

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

@ -193,10 +193,7 @@ import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.ConsigneeArriveVO;
import org.springblade.common.model.GAddressVo;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.*;
import org.springblade.common.node.BillLadingNode;
import org.springblade.common.node.DeliveryNode;
import org.springblade.common.node.ReservationNode;
@ -383,7 +380,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private ITrunklineWaybillTrackClient trunklineWaybillTrackClient;
@Autowired
private IDistributionNodeWorkService iDistributionNodeWorkService;
private IDistributionNodeWorkService distributionNodeWorkService;
@Autowired
private ILogClient logClient;
@ -404,6 +401,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IDistributionPlanLogService distributionPlanLogService;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -840,7 +838,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 推送作业节点数据
NodeFanoutMsg<org.springblade.common.model.DistributionReCheckSignVO> nodeFanoutMsg = buildNodeFanoutMsgByReCheck(deliveryListEntity,reservationEntity);
iDistributionNodeWorkService.signForCheck(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signForCheck(nodeFanoutMsg, AuthUtil.getUser());
// // 复核作业节点推送
// iDistributionNodeWorkService.signForCheck(DistributionSignforEntity distributionSignforEntity,DistributionReservationEntity reservationEntity);
@ -1167,7 +1165,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
// 增加PC库存品签收
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.CLERK);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
//维护签收数量
@ -1546,7 +1544,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 发送作业节点
// 作业节点推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList,OperatModeConstant.BATCH);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
//查询计划和是否进行装车
@ -1845,6 +1843,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "DeliveryId参数缺失");
return R.fail("请联系管理员维护!!!");
}
Map<String,List> map = new HashMap<>();
List<Long> list = Func.toLongList(distrilbutionloadingscanDTO.getZeroPackageIds());
//查询是否进行装车或者签收
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
@ -1868,6 +1868,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Map<Long, List<DistributionReservationZeroPackageEntity>> planMap;
if (Func.isNotEmpty(planZeroPackageEntities)) {
planMap = planZeroPackageEntities.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getStockArticleId));
map.put("2", planZeroPackageEntities);
} else {
planMap = null;
}
@ -1921,6 +1923,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
deliveryListEntity.setOrderNumber(newOrderDeliveryNumber);
deliveryListEntity.setCustomersNumber(newCustomersNumber);
distributionDeliveryListService.updateById(deliveryListEntity);
// 发送零担作业节点
// 作业节点推送
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity,map,BizOperationEnums.REMOVE);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser());
} else {
log.error(method + "查询原计划零担信息错误reservationId:{},ids:{}", distrilbutionloadingscanDTO.getReservationId(), list);
return R.fail("计划查询错误");
@ -3165,7 +3175,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
@ -3195,7 +3205,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getDriverId()));
if (StringUtil.isNotBlank(distributionLoadscanEntity.getVehicleName())) {
// 获取车辆类型
@ -3265,7 +3275,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getDriverId()));
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
if (StringUtil.isNotBlank(distributionLoadscanEntity.getVehicleName())) {
@ -3329,7 +3339,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
iDistributionNodeWorkService.signFor(parcelListEntity, distributionReservationEntity.getId(), singleTime, myCurrentWarehouse.getName());
distributionNodeWorkService.signFor(parcelListEntity, distributionReservationEntity.getId(), singleTime, myCurrentWarehouse.getName());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 签收作业节点广播报错", e);
@ -3637,7 +3647,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas, OperatModeConstant.CLERK);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return R.data(orderpackages, "签收成功");
} catch (Exception e) {
@ -4078,7 +4088,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("操作成功", s);
} else {
@ -4471,7 +4481,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("签收成功", str);
@ -5000,7 +5010,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//进行打卡信息保存
distributionPositioningService.save(distributionPositioning);
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg = buildConsigneeArriveVO(deliveryListEntity, reservationEntity, add, user);
iDistributionNodeWorkService.carArrived(nodeFanoutMsg, user);
distributionNodeWorkService.carArrived(nodeFanoutMsg, user);
return Resp.scanSuccess("打卡成功", "打卡成功");
} else {
return Resp.scanSuccess("打卡失败", "打卡失败,请重试");
@ -5528,7 +5538,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 推送作业节点
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return R.data(map);
}
@ -6104,7 +6114,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":reservationId:", distributionSignfor.getReservationId(), 60L);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
Integer num = baseMapper.signforNum(distributionSignforEntity.getReservationId());
return Resp.scanSuccess(num + "件", num + "件");
}
@ -7153,7 +7163,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("签收成功", str);
@ -7174,9 +7184,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionLoadscanEntity distributionLoadscanEntity = pushList.get(0);
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setDriverId(distributionLoadscanEntity.getDriverId());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setVehicleId(distributionLoadscanEntity.getVehicleId());
distributionLoadVO.setDriverId(Convert.toStr(distributionLoadscanEntity.getSigningUserId()));
distributionLoadVO.setOperatMode(operatMode);
DistributionReservationEntity byId = distributionReservationService.getById(distributionLoadscanEntity.getReservationId());
if (!Func.isEmpty(byId)) {
@ -8514,12 +8524,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!pushInventoryList.isEmpty()) {
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!pushList.isEmpty()) {
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!orderCodes.isEmpty()) {
String collect = orderCodes.stream().distinct().collect(Collectors.joining(","));

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

@ -4537,7 +4537,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return nodeFanoutMsg;
} catch (Exception e) {
log.error("备货扫描:发送备货节点消息失败", e);
log.warn("备货扫描:发送备货节点消息失败", e);
}
return null;

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

@ -130,7 +130,8 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl<QualityDeliverMap
trainDetailEntity.setDistributionType(deliveryType);
}
trainDetailEntity.setDestinationWarehouse(qualityDeliverEntity.getWarehouseName());
trainDetailEntity.setDeliveryDriver(qualityDeliverEntity.getSignUserName());
trainDetailEntity.setDeliveryDriver(qualityDeliverEntity.getSignDriverName());
trainDetailEntity.setDeliveryRemark(qualityDeliverEntity.getDeliveryRemark());
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getPlanNum())) {
totalPlanNumber = NumberUtil.add(totalPlanNumber, qualityDeliverEntity.getPlanNum());
}

2
blade-service/logpm-factory-data/logpm-factory-data-base/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-base/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-jinpai/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-linsy/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-mengtian/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-mwh/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-olo/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-oupai/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-oupai/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-pan/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-pan/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-suofeiya/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-factory-data-zbom/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-patch/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="../data/applogs/ogpm-patch-xxljob/xxl-job-executor-sample-springboot.log"/>
<property name="log.path" value="../data/applogs/ogpm-patch/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-report/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-report/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -105,7 +105,7 @@
and Locate(#{param.shipperMoblie},lww.shipper_mobile) > 0
</if>
<if test="param.consigneePerson != null and param.consigneePerson != '' ">
and Locate(#{param.consigneePerson},lww.consignee_person) > 0
and Locate(#{param.consigneePerson},lww.consignee_name) > 0
</if>
<if test="param.consigneeMobile != null and param.consigneeMobile != '' ">
and Locate(#{param.consigneeMobile},lww.consignee_mobile) > 0

2
blade-service/logpm-statisticsdata/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="../data/applogs/ogpm-factory-xxljob/xxl-job-executor-sample-springboot.log"/>
<property name="log.path" value="../data/applogs/logpm-statisticsdata/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

2
blade-service/logpm-supervise/src/main/resources/logback.xml

@ -2,7 +2,7 @@
<configuration scan="false" debug="false">
<contextName>logback</contextName>
<property name="log.path" value="./data/logpm-basic/logs/logs.log"/>
<property name="log.path" value="./data/logpm-supervise/logs/logs.log"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -999,6 +999,13 @@ public class OpenOrderController {
log.warn("#################openOrderParamVerify: 发货单位不能为空 shipper={} ", shipper);
throw new CustomerException(405, "发货单位不能为空");
}
// Long consigneeId = openOrderDTO.getConsigneeId();
// if(Objects.isNull(consigneeId)){
// log.warn("#################openOrderParamVerify: 请先维护收货单位 consigneeId={} ", consigneeId);
// throw new CustomerException(405, "请先维护收货单位");
// }
String consignee = openOrderDTO.getConsignee();
if (StringUtil.isBlank(consignee)) {
log.warn("#################openOrderParamVerify: 收货单位不能为空 consignee={} ", consignee);
@ -1401,12 +1408,13 @@ public class OpenOrderController {
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(403, "多仓权限无法操作,请选择仓库");
if (!Objects.isNull(myCurrentWarehouse)) {
// log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
// return R.fail(403, "多仓权限无法操作,请选择仓库");
openOrderDTO.setWarehouseId(myCurrentWarehouse.getId());
openOrderDTO.setWarehouseName(myCurrentWarehouse.getName());
}
openOrderDTO.setWarehouseId(myCurrentWarehouse.getId());
openOrderDTO.setWarehouseName(myCurrentWarehouse.getName());
if (Objects.isNull(waybillId)) {
log.warn(method + "运单号id为空 waybillId={}", waybillId);

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

@ -631,9 +631,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setCustomerTrain(openOrderDTO.getTrainNumber());
waybillEntity.setGoodsCode(openOrderDTO.getGoodsCode());
Long shipperId = openOrderDTO.getShipperId();
String shipper = openOrderDTO.getShipper();
if (Objects.isNull(shipperId)) {
//如果发货单位没有id值,则把发货单位信息自动添加到client中
shipperId = saveNewClient(openOrderDTO.getShipper(), openOrderDTO.getShipperName(), openOrderDTO.getShipperMobile(), openOrderDTO.getShipperAddress(), "6");
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(shipper);
if(Objects.isNull(clientEntity)){
shipperId = saveNewClient(openOrderDTO.getShipper(), openOrderDTO.getShipperName(), openOrderDTO.getShipperMobile(), openOrderDTO.getShipperAddress(), "6");
}else{
shipperId = clientEntity.getId();
}
}
waybillEntity.setShipperId(shipperId);
waybillEntity.setShipper(openOrderDTO.getShipper());
@ -642,10 +649,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setShipperAddress(openOrderDTO.getShipperAddress());
Long consigneeId = openOrderDTO.getConsigneeId();//收货单位id
String consignee = openOrderDTO.getConsignee();
if (Objects.isNull(consigneeId)) {
//如果收货单位没有id值,则把收货单位信息自动添加到client中
consigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(consignee);
if(Objects.isNull(clientEntity)){
consigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
}else{
consigneeId = clientEntity.getId();
}
}
waybillEntity.setConsigneeId(consigneeId);
waybillEntity.setConsignee(openOrderDTO.getConsignee());
@ -988,9 +1000,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setReplacePrice(openOrderDTO.getReplacePrice());
waybillEntity.setOrderNo(openOrderDTO.getOrderCode());
Long shipperId = openOrderDTO.getShipperId();
String shipper = openOrderDTO.getShipper();
if (Objects.isNull(shipperId)) {
//如果发货单位没有id值,则把发货单位信息自动添加到client中
shipperId = saveNewClient(openOrderDTO.getShipper(), openOrderDTO.getShipperName(), openOrderDTO.getShipperMobile(), openOrderDTO.getShipperAddress(), "6");
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(shipper);
if(Objects.isNull(clientEntity)){
shipperId = saveNewClient(openOrderDTO.getShipper(), openOrderDTO.getShipperName(), openOrderDTO.getShipperMobile(), openOrderDTO.getShipperAddress(), "6");
}else{
shipperId = clientEntity.getId();
}
}
waybillEntity.setShipperId(shipperId);
waybillEntity.setShipper(openOrderDTO.getShipper());
@ -999,9 +1018,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setShipperAddress(openOrderDTO.getShipperAddress());
Long consigneeId = openOrderDTO.getConsigneeId();//收货单位id
String consignee = openOrderDTO.getConsignee();
if (Objects.isNull(consigneeId)) {
//如果收货单位没有id值,则把收货单位信息自动添加到client中
consigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(consignee);
if(Objects.isNull(clientEntity)){
consigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
}else{
consigneeId = clientEntity.getId();
}
}
waybillEntity.setConsigneeId(consigneeId);
waybillEntity.setConsignee(openOrderDTO.getConsignee());
@ -2936,6 +2961,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// 得到改单之前的收货单位
oldConsignee = waybillEntity.getConsignee();
// Long newConsigneeId = openOrderDTO.getConsigneeId();
//
// if(Objects.isNull(newConsigneeId)){
// if(waybillType == 1){
// log.warn("#############updateWaybill: 运单收货单位id为空 waybillId={} newConsigneeId={}", waybillId,newConsigneeId);
// return R.fail(405, "请先维护收货单位信息");
// }else if(waybillType == 2){
// newConsigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
// openOrderDTO.setConsigneeId(newConsigneeId);
// }
// }
String updateMsg = verifyUpdateData(openOrderDTO, waybillEntity);
warehouseWaybillClient.updateEntity(waybillEntity);
@ -4862,6 +4899,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
editOrderMsgVO.setOldValue(consignee);
editOrderMsgVO.setNewValue(newConsignee);
msgList.add(editOrderMsgVO);
}else{
if (!ObjectUtil.equals(consignee, newConsignee)) {
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("收货单位");
editOrderMsgVO.setOldValue(consignee);
editOrderMsgVO.setNewValue(newConsignee);
msgList.add(editOrderMsgVO);
}
}
String newConsigneeName = openOrderDTO.getConsigneeName();
@ -5427,6 +5472,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
stringBuilder.append("发货单位:").append(shipper).append("-->").append(newShipper).append(";");
waybillEntity.setShipper(newShipper);
waybillEntity.setShipperId(newShipperId);
if(Objects.isNull(newShipperId)){
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(newShipper);
if(Objects.isNull(clientEntity)){
newShipperId = saveNewClient(openOrderDTO.getShipper(), openOrderDTO.getShipperName(), openOrderDTO.getShipperMobile(), openOrderDTO.getShipperAddress(), "6");
}else{
newShipperId = clientEntity.getId();
}
waybillEntity.setConsigneeId(newShipperId);
}
}
String newShipperName = openOrderDTO.getShipperName();
String shipperName = waybillEntity.getShipperName();
@ -5457,9 +5511,23 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
stringBuilder.append("收货单位:").append(consignee).append("-->").append(newConsignee).append(";");
waybillEntity.setConsignee(newConsignee);
waybillEntity.setConsigneeId(newConsigneeId);
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(newConsigneeId);
if(!Objects.isNull(basicdataClient)){
waybillEntity.setServiceType(basicdataClient.getTypeService());
if(Objects.isNull(newConsigneeId)){
waybillEntity.setServiceType(1);
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(newConsignee);
if(Objects.isNull(clientEntity)){
newConsigneeId = saveNewClient(openOrderDTO.getConsignee(), openOrderDTO.getConsigneeName(), openOrderDTO.getConsigneeMobile(), openOrderDTO.getConsigneeAddress(), "2");
}else{
newConsigneeId = clientEntity.getId();
waybillEntity.setServiceType(clientEntity.getTypeService());
}
waybillEntity.setConsigneeId(newConsigneeId);
}else{
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(newConsigneeId);
if(!Objects.isNull(basicdataClient)){
waybillEntity.setServiceType(basicdataClient.getTypeService());
}else{
waybillEntity.setServiceType(1);
}
}
}

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

@ -1498,17 +1498,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
//MQ卸车确认推送工厂
JSONObject jsonObject = new JSONObject();
jsonObject.put("loadId", loadId);
jsonObject.put("carsNo", carsLoadEntity.getCarsNo());
jsonObject.put("warehouseId", warehouseId);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("messageData", jsonObject);
map.put("createTime", System.currentTimeMillis());
map.put("flagType", "TrunklineUnloadConfirm");
rabbitTemplate.convertAndSend(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE, RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_ROUTING, map);
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("loadId", loadId);
// jsonObject.put("carsNo", carsLoadEntity.getCarsNo());
// jsonObject.put("warehouseId", warehouseId);
//
// Map<String, Object> map = new HashMap<>();
// map.put("messageId", CommonUtil.getUUID());
// map.put("messageData", jsonObject);
// map.put("createTime", System.currentTimeMillis());
// map.put("flagType", "TrunklineUnloadConfirm");
// rabbitTemplate.convertAndSend(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE, RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_ROUTING, map);
try {
List<LoadScanBrandDTO> brands = this.baseMapper.fingPackageCodeByLoadId(loadId, warehouseId);

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java

@ -10,13 +10,11 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@ -131,4 +129,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient {
public List<WarehouseWaybillVO> findWaybillVOByWaybillNoSet(Set<String> allWaybillNoSet) {
return warehouseWaybillService.findWaybillVOByWaybillNoSet(allWaybillNoSet);
}
@Override
public void updateWaybillCondigneeIdToNull(Long waybillId) {
warehouseWaybillService.updateWaybillCondigneeIdToNull(waybillId);
}
}

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

@ -79,4 +79,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
void deleteByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
List<WarehouseWaybillVO> findWaybillVOByWaybillNoSet(@Param("waybillNos") Set<String> allWaybillNoSet);
void updateWaybillCondigneeIdToNull(@Param("waybillId") Long waybillId);
}

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

@ -1276,4 +1276,8 @@
group by lww.id
</select>
<update id="updateWaybillCondigneeIdToNull">
update logpm_warehouse_waybill set consignee_id = null where id = #{waybillId}
</update>
</mapper>

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

@ -91,4 +91,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
void deleteByWaybillIds(List<Long> waybillIds);
List<WarehouseWaybillVO> findWaybillVOByWaybillNoSet(Set<String> allWaybillNoSet);
void updateWaybillCondigneeIdToNull(Long waybillId);
}

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

@ -1224,4 +1224,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
public List<WarehouseWaybillVO> findWaybillVOByWaybillNoSet(Set<String> allWaybillNoSet) {
return baseMapper.findWaybillVOByWaybillNoSet(allWaybillNoSet);
}
@Override
public void updateWaybillCondigneeIdToNull(Long waybillId) {
baseMapper.updateWaybillCondigneeIdToNull(waybillId);
}
}

Loading…
Cancel
Save