Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
zhaoqiaobo 9 months ago
parent
commit
7f8f6486f9
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 8
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  3. 21
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  4. 2
      blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  5. 60
      blade-biz-common/src/main/java/org/springblade/common/model/BroadcastNodeData.java
  6. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  7. 6
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsOrderVO.java
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  10. 151
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  11. 76
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockOrdercodeRecoServiceImpl.java
  13. 42
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  14. 114
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 125
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  16. 160
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java
  17. 135
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  18. 102
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  19. 4
      blade-service/logpm-distribution/src/main/resources/application-dev.yml
  20. 54
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/NodeWorkHandler.java
  21. 4
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  22. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  23. 4
      blade-service/logpm-statisticsdata/src/main/resources/application-dev.yml
  24. 28
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java
  25. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  26. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  27. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  28. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  29. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java
  30. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  31. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java
  32. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  33. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml
  34. 65
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenWaybillToBusinessListener.java
  35. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java
  36. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  37. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java
  38. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineLoadSignOrderService.java
  39. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  40. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  41. 40
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  42. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  43. 248
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  44. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java
  45. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineLoadSignOrderServiceImpl.java
  46. 4
      blade-service/logpm-trunkline/src/main/resources/application-dev.yml
  47. 4
      blade-service/logpm-warehouse/src/main/resources/application-dev.yml

4
blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -45,7 +45,7 @@ public interface LauncherConstant {
/**
* nacos dev 地址
*/
String NACOS_DEV_ADDR = "192.168.3.100:8848";
String NACOS_DEV_ADDR = "192.168.2.46:8848";
/**
@ -77,7 +77,7 @@ public interface LauncherConstant {
/**
* seata dev 地址
*/
String SEATA_DEV_ADDR = "192.168.3.100:8091";
String SEATA_DEV_ADDR = "192.168.2.46:8091";
/**

8
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -171,14 +171,6 @@ public interface RabbitConstant {
String OPEN_ORDER_LOAD_SCAN_ROUTING = "open_order_load_scan_routing" + ModuleNameConstant.DEVAUTH;
/****************运单创建推送商家数据start *************************/
String OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE = "open_waybill_to_business_data_queue" + ModuleNameConstant.DEVAUTH;
String OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE = "open_waybill_to_business_data_exchange" + ModuleNameConstant.DEVAUTH;
String OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING = "open_waybill_to_business_data_routing" + ModuleNameConstant.DEVAUTH;
/****************运单创建推送商家数据end *************************/
/****************库内入库推送商家数据start *************************/

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

@ -19,7 +19,9 @@ public abstract class FanoutConstants {
interface QUEUE {
String STATISTICSDATA_CREATEPACKAGEINFO = "fanout.trunkline.openWaybill.statisticsdata.createPackageinfo" + ModuleNameConstant.DEVAUTH;
// 开单检测数据 --商家端
String SEND_BUSINESS_DATA_BY_OPENWAYBILL_DATA = "fanout.trunkline.openWaybill.send_business_data.open" + ModuleNameConstant.DEVAUTH;
// 改单数据 --商家端
}
}
@ -33,6 +35,7 @@ public abstract class FanoutConstants {
interface QUEUE {
String STATISTICSDATA_UPDATEPACKAGEINFO = "fanout.trunkline.updatewaybill.statisticsdata.updatePackageinfo" + ModuleNameConstant.DEVAUTH;
String SEND_BUSINESS_DATA_BY_UPDATEWAYBILL_DATA = "fanout.trunkline.openWaybill.send_business_data.update" + ModuleNameConstant.DEVAUTH;
}
@ -155,4 +158,20 @@ public abstract class FanoutConstants {
}
/**
* 配送
*/
public interface distribution {
interface signfor{
String EXCHANGE = "fanout.distribution.signfor" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String FACTORY_NODE_WORK_DISTRIBUTION_SIGNFOR_QUERY = "fanout.factory.nodework.distribution.signforquery"+ ModuleNameConstant.DEVAUTH;
}
}
}
}

2
blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@ -41,7 +41,7 @@ public class LauncherServiceImpl implements LauncherService {
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
// 开启elk日志
// PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile));
PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile));

60
blade-biz-common/src/main/java/org/springblade/common/model/BroadcastNodeData.java

@ -0,0 +1,60 @@
package org.springblade.common.model;
import com.alibaba.fastjson.JSONObject;
/**
* 节点作业数据传输对象
*/
public class BroadcastNodeData extends JSONObject {
/**
* 当前作业租户ID
*/
private String tenantId;
/**
* 作业人名称
*/
private String userName;
/**
* 操作时间
*/
private String operationTime;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getOperationTime() {
return operationTime;
}
public void setOperationTime(String operationTime) {
this.operationTime = operationTime;
}
@Override
public String toJSONString() {
// 需要 将当前类的属性增加的到json的输出
this.put("tenantId", tenantId);
this.put("userName", userName);
this.put("operationTime", operationTime);
return super.toJSONString();
}
}

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

@ -31,12 +31,19 @@ public class LoadCarsDTO implements Serializable {
private String loadCarsNo;
private String loadStatus;
private String carrierName;
private String carrierOrderCode;
private String startWarehouseName;
private String deliveryType;
private String operator;
private String settlementPerson;
private Long warehouseId;
private Integer startCarType;
private Integer loadingType;
private Integer unloadType;
private Integer isSettlement;
private List<TrunklineCarsOrderDTO> carsOrderList = new ArrayList<>();
@ -63,6 +70,7 @@ public class LoadCarsDTO implements Serializable {
private Integer isZero;
private String scanCode;
private String scanStatus;
private String payMethod;
private List<LoadingPackageDTO> packageList = new ArrayList<>();
private List<LoadingZeroDTO> zeroList = new ArrayList<>();

6
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsOrderVO.java

@ -5,4 +5,10 @@ import lombok.Data;
@Data
public class TrunklineCarsOrderVO extends TrunklineCarsOrderEntity {
private String mallName;
private String mallPerson;
private String mallMobile;
private String mallAddress;
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -1329,6 +1329,7 @@ public class DistributionStockupAppController extends BladeController {
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId());
warehouseUpdownGoodsEntity.setAssociationValue(byId.getCargoNumber());
warehouseUpdownGoodsEntity.setAssociationType("4");
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId());
locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
@ -1346,10 +1347,10 @@ public class DistributionStockupAppController extends BladeController {
//查询包件信息
if (ObjectUtils.isNotNull(list) && list.size() > 1) {
return Resp.scanFail("查询到重复包条信息!!", "查询到重复包条信息!!");
return Resp.scanFail("查询到重复包条信息!!", "查询到重复包条信息!!");
}
if (ObjectUtils.isNull(list)) {
return Resp.scanFail("没有查询到包件信息 ! ", "没有查询到包件信息 ! ");
return Resp.scanFail("没有查询到包件信息!", "没有查询到包件信息 ! ");
}
log.info(">>>>> obj {}", list.get(0).getConditions());

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

@ -314,7 +314,7 @@ public class DistributionSignforController extends BladeController {
List<Long> packageIds = (List<Long>) data.get("packageIds");
Long signId = (Long) data.get("signId");
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
distributionAsyncService.sendReviewFactory(signId,myCurrentWarehouse.getName() ,myCurrentWarehouse.getId());
// distributionAsyncService.sendReviewFactory(signId,myCurrentWarehouse.getName() ,myCurrentWarehouse.getId()); PC对于的批量签收同样需要复核
}
String orderPackageCodes = null;
for (String packageCode : packageCodes) {

151
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml

@ -2,154 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionLoadscanMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionLoadscanResultMap" type="com.logpm.distribution.entity.DistributionLoadscanEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="reserve1" property="reserve1"/>
<result column="id" property="id"/>
<result column="reserve2" property="reserve2"/>
<result column="tenant_id" property="tenantId"/>
<result column="reserve3" property="reserve3"/>
<result column="create_user" property="createUser"/>
<result column="reserve4" property="reserve4"/>
<result column="create_time" property="createTime"/>
<result column="reserve5" property="reserve5"/>
<result column="update_user" property="updateUser"/>
<result column="scan_type" property="scanType"/>
<result column="update_time" property="updateTime"/>
<result column="tray_id" property="trayId"/>
<result column="status" property="status"/>
<result column="brand_id" property="brandId"/>
<result column="is_deleted" property="isDeleted"/>
<result column="brand_name" property="brandName"/>
<result column="create_dept" property="createDept"/>
<result column="tray_no" property="trayNo"/>
<result column="reserve1" property="reserve1"/>
<result column="train_number" property="trainNumber"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="reserve3" property="reserve3"/>
<result column="driver_id" property="driverId"/>
<result column="reserve4" property="reserve4"/>
<result column="vehicle_name" property="vehicleName"/>
<result column="reserve5" property="reserve5"/>
<result column="driver_name" property="driverName"/>
<result column="scan_type" property="scanType"/>
<result column="warehouse_id" property="warehouseId"/>
<result column="tray_id" property="trayId"/>
<result column="warehouse_name" property="warehouseName"/>
<result column="brand_id" property="brandId"/>
<result column="package_id" property="packageId"/>
<result column="brand_name" property="brandName"/>
<result column="packet_bar_code" property="packetBarCode"/>
<result column="tray_no" property="trayNo"/>
<result column="scan_status" property="scanStatus"/>
<result column="train_number" property="trainNumber"/>
<result column="confirm_time" property="confirmTime"/>
<result column="id" property="id"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="scan_time" property="scanTime"/>
<result column="tenant_id" property="tenantId"/>
<result column="driver_id" property="driverId"/>
<result column="kitting" property="kitting"/>
<result column="create_user" property="createUser"/>
<result column="vehicle_name" property="vehicleName"/>
<result column="type" property="type"/>
<result column="create_time" property="createTime"/>
<result column="driver_name" property="driverName"/>
<result column="detention_person" property="detentionPerson"/>
<result column="update_user" property="updateUser"/>
<result column="warehouse_id" property="warehouseId"/>
<result column="un_warehouse_id" property="unWarehouseId"/>
<result column="update_time" property="updateTime"/>
<result column="warehouse_name" property="warehouseName"/>
<result column="un_warehouse_name" property="unWarehouseName"/>
<result column="status" property="status"/>
<result column="package_id" property="packageId"/>
<result column="un_administrators_id" property="unAdministratorsId"/>
<result column="is_deleted" property="isDeleted"/>
<result column="packet_bar_code" property="packetBarCode"/>
<result column="un_administrators_name" property="unAdministratorsName"/>
<result column="create_dept" property="createDept"/>
<result column="scan_status" property="scanStatus"/>
<result column="is_insert" property="isInsert"/>
<result column="reserve1" property="reserve1"/>
<result column="confirm_time" property="confirmTime"/>
<result column="scan_state" property="scanState"/>
<result column="scan_time" property="scanTime"/>
<result column="scan_synchronous" property="scanSynchronous"/>
<result column="reserve3" property="reserve3"/>
<result column="kitting" property="kitting"/>
<result column="plan_destination_id" property="planDestinationId"/>
<result column="reserve4" property="reserve4"/>
<result column="type" property="type"/>
<result column="msg" property="msg"/>
<result column="reserve5" property="reserve5"/>
<result column="detention_person" property="detentionPerson"/>
<result column="unload_time" property="unloadTime"/>
<result column="scan_type" property="scanType"/>
<result column="un_warehouse_id" property="unWarehouseId"/>
<result column="order_id" property="orderId"/>
<result column="tray_id" property="trayId"/>
<result column="un_warehouse_name" property="unWarehouseName"/>
<result column="reservation_id" property="reservationId"/>
<result column="brand_id" property="brandId"/>
<result column="un_administrators_id" property="unAdministratorsId"/>
<result column="delivery_id" property="deliveryId"/>
<result column="brand_name" property="brandName"/>
<result column="un_administrators_name" property="unAdministratorsName"/>
<result column="loaded_nub" property="loadedNub"/>
<result column="tray_no" property="trayNo"/>
<result column="is_insert" property="isInsert"/>
<result column="package_nub" property="packageNub"/>
<result column="train_number" property="trainNumber"/>
<result column="scan_state" property="scanState"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="scan_synchronous" property="scanSynchronous"/>
<result column="driver_id" property="driverId"/>
<result column="plan_destination_id" property="planDestinationId"/>
<result column="vehicle_name" property="vehicleName"/>
<result column="msg" property="msg"/>
<result column="driver_name" property="driverName"/>
<result column="unload_time" property="unloadTime"/>
<result column="warehouse_id" property="warehouseId"/>
<result column="order_id" property="orderId"/>
<result column="warehouse_name" property="warehouseName"/>
<result column="reservation_id" property="reservationId"/>
<result column="package_id" property="packageId"/>
<result column="delivery_id" property="deliveryId"/>
<result column="packet_bar_code" property="packetBarCode"/>
<result column="loaded_nub" property="loadedNub"/>
<result column="scan_status" property="scanStatus"/>
<result column="package_nub" property="packageNub"/>
<result column="confirm_time" property="confirmTime"/>
<result column="scan_time" property="scanTime"/>
<result column="kitting" property="kitting"/>
<result column="type" property="type"/>
<result column="detention_person" property="detentionPerson"/>
<result column="un_warehouse_id" property="unWarehouseId"/>
<result column="un_warehouse_name" property="unWarehouseName"/>
<result column="un_administrators_id" property="unAdministratorsId"/>
<result column="un_administrators_name" property="unAdministratorsName"/>
<result column="is_insert" property="isInsert"/>
<result column="scan_state" property="scanState"/>
<result column="scan_synchronous" property="scanSynchronous"/>
<result column="plan_destination_id" property="planDestinationId"/>
<result column="msg" property="msg"/>
<result column="unload_time" property="unloadTime"/>
<result column="order_id" property="orderId"/>
<result column="reservation_id" property="reservationId"/>
<result column="delivery_id" property="deliveryId"/>
<result column="loaded_nub" property="loadedNub"/>
<result column="package_nub" property="packageNub"/>
</resultMap>
<update id="updatecutSumById">
@ -203,7 +56,7 @@
</update>
<select id="selectDistributionLoadscanPage" resultMap="distributionLoadscanResultMap">
<select id="selectDistributionLoadscanPage" resultType="com.logpm.distribution.vo.DistributionLoadscanVO">
select * from logpm_distribution_loadscan where is_deleted = 0
</select>

76
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java

@ -0,0 +1,76 @@
package com.logpm.distribution.service;
import com.logpm.distribution.entity.DistributionParcelListEntity;
/**
* <p>
* 配送作业节点 推送给服务
* </p>
*/
public interface IDistributionNodeWorkService {
// 签收作业节点
/**
* 装车
*/
void nodeLoad();
/**
* 异常装车
*/
void abnormalLoading();
/**
* 取消装车
*/
void cancelLoading();
/**
* 发车
*/
void carStart();
/**
* 配送到达
*/
void carArrived();
/**
* 签收
*/
void signFor(DistributionParcelListEntity parcelListEntity, Long taskId, String operationTime, String destinationWarehouse);
/**
* 签收复核
*/
void signForCheck();
/**
* 自提签收扫描
*/
void billofladingSignfor(DistributionParcelListEntity parcelListEntity,Long taskId,String operationTime, String destinationWarehouse);
/**
* 自提签收复核
*/
void billofladingSignforCheck();
/**
* 滞留
*/
void retention();
/**
* 异常签收
*/
void abnormalSignfor();
/**
* 配送失败
*/
void fail();
}

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

@ -90,14 +90,14 @@ public class DisStockOrdercodeRecoServiceImpl extends BaseServiceImpl<DisStockOr
warehouseUpdownGoodsEntity.setAssociationType("4");
warehouseUpdownGoodsEntity.setAssociationValue(cargoNumber);
warehouseUpdownGoodsEntity.setMarketName(mallName);
warehouseUpdownGoodsEntity.setAllocationId(allocationId);
List<WarehouseUpdownGoodsEntity> locationStockListInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if (Func.isNotEmpty(locationStockListInformation)){
List<String> IncomingBatchs = locationStockListInformation.stream().map(WarehouseUpdownGoodsEntity::getIncomingBatch).collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntity = distributionStockListMapper.selectList(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getCargoNumber, cargoNumber)
.eq(DistributionStockListEntity::getMarketName,mallName)
.eq(DistributionStockListEntity::getMarketName,mallName)
.in(DistributionStockListEntity::getIncomingBatch, IncomingBatchs)
.orderByAsc(DistributionStockListEntity::getCreateTime)
);
if (Func.isNotEmpty(distributionStockListEntity)){

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

@ -1535,29 +1535,15 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
if (Func.isNotEmpty(brand.get("欧派"))) {
// 重新筛选出欧派的包件
for (DistributionReservationStockarticleEntity distributionReservationStockarticleEntity : distributionReservationStockarticleEntities) {
// 查询预约单下面的包件信息
log.info(">>>>>>>>>>>>>>>>>>>>> 欧派循环包件信息 {} ", distributionReservationStockarticleEntity);
List<DistributionParcelListEntity> distributionParcelListEntities = buildOpByReservationId(distributionReservationStockarticleEntity);
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
// todo 查询签收信息
DistributionSignforEntity distributionSignfor = distributionSignforMapper.getByReservationId(distributionReservationStockarticleEntity.getReservationId());
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
orderStatusDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode()); //单号
orderStatusDTO.setUsername(distributionSignfor.getSigneeName()); //操作人名称
orderStatusDTO.setStatus("7");
orderStatusDTO.setOperationTime(distributionSignfor.getSigningTime()); //时间
ouPaiFactoryClinet.newSystemHandleStatusData(orderStatusDTO);
log.info(">>>>>>>>>>>>>>>>>进入newSystemHandleStatusData orderStatusDTO值 :{}", orderStatusDTO);
}
List<MtReceiveContentDTO> oupai = brand.get("欧派");
for (MtReceiveContentDTO mtReceiveContentDTO : oupai) {
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
orderStatusDTO.setUnitNo(mtReceiveContentDTO.getUnitNo()); //包条
orderStatusDTO.setUsername(distributionSignforEntity.getSigneeName()); //操作人名称
orderStatusDTO.setStatus("7");
orderStatusDTO.setOperationTime(distributionSignforEntity.getSigningTime()); //时间
ouPaiFactoryClinet.newSystemHandleStatusData(orderStatusDTO);
}
// orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
}
if (Func.isNotEmpty(brand.get("志邦"))) {
List<MtReceiveContentDTO> zb = brand.get("志邦");
@ -1599,7 +1585,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
} catch (Exception e) {
log.error("入库推送失败:{}", e);
log.error("入库推送失败", e);
}
}
}
@ -1629,8 +1615,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//....工厂
} catch (Exception e) {
log.error("sendReviewFactory ", e);
throw new RuntimeException(e);
log.error("复核推送工厂信息错误 ", e);
// throw new RuntimeException(e);
}
}
@ -3021,7 +3007,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
orderList.add(order);
if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){
if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//构建包件信息
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationEntity.getId(), distributionStockArticleEntity.getId(), distributionStockArticleEntity.getWarehouseId());
if (!distributionParcelListEntities.isEmpty()) {
@ -3040,7 +3026,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
}
}else {
} else {
//整理零担的数据
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(distributionStockArticleEntity.getId(), reservationEntity.getId());
if (!distributionParcelNumberVOS.isEmpty()) {
@ -3115,7 +3101,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
pushInstallDTO.setOrder(orderList);
pushInstallDTO.setOrder_detail(orderDetailList);
log.info(">>>>>>>>>>>>>>安装推送整理数据:{}",JSONObject.toJSON(pushInstallDTO));
log.info(">>>>>>>>>>>>>>安装推送整理数据:{}", JSONObject.toJSON(pushInstallDTO));
String jsonString = JSONObject.toJSONString(pushInstallDTO);
rabbitTemplate.convertAndSend(RabbitConstant.PUSH_INSTALL_PLATFORM_EXCHANGE, RabbitConstant.PUSH_INSTALL_PLATFORM_ROUTING, jsonString);

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

@ -260,6 +260,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IWarehouseRetentionScanClient warehouseRetentionScanClient;
@Autowired
private IDistributionBillLadingScanService distributionBillLadingScanService;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -4971,7 +4974,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
map.put("费用统计", fua);
String popHtml = TemplateUtil.popTemplate("自提配送单", map, html);
String popHtml = TemplateUtil.popTemplate("自提单", map, html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(template.getId());
printPreviewVO.setTemplateHtml(popHtml);
@ -5001,50 +5004,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
.ne(DistributionDeliveryDetailsEntity::getStockStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (!detailsEntities.isEmpty()) {
Map<Long, List<DistributionDeliveryDetailsEntity>> inventoryMap = detailsEntities.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId));
List<Long> inventoryIds = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(inventoryIds);
if (!distributionStockListEntities.isEmpty()) {
for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("序号", a);
tempMap.put("运单号", distributionStockListEntity.getIncomingBatch());
tempMap.put("合同号", distributionStockListEntity.getOrderCode());
tempMap.put("物料名称", distributionStockListEntity.getDescriptionGoods());
//构建产品明细
Map<String, Object> map1 = new HashMap<>();
map1.put("物料编码", distributionStockListEntity.getCargoNumber());
map1.put("物料单位", distributionStockListEntity.getCargoUnit());
map1.put("物料规格", distributionStockListEntity.getCargoNorms());
//查询此订制品库位信息
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = inventoryMap.get(distributionStockListEntity.getId()).get(0);
Integer quantity = distributionDeliveryDetailsEntity.getQuantity();
map1.put("计划数量", quantity);
hejiNum += quantity;
tempMap.put("小计", quantity);
tempMap.put("货位", "");
tempMap.put("产品明细", map1);
tempMap.put("备货区", "");
ls.add(tempMap);
a++;
if (!mailNames.toString().contains(distributionStockListEntity.getMarketName())) {
if (!mailNames.toString().isEmpty()) {
mailNames.append(",");
}
mailNames.append(distributionStockListEntity.getMarketName());
}
if (!consigneeUnit.toString().contains(distributionStockListEntity.getMarketName())) {
if (!consigneeUnit.toString().isEmpty()) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockListEntity.getMarketName());
}
}
}
}
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
@ -5098,6 +5059,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
tempMap.put("合同号", distributionStockArticleEntity.getOrderCode());
String materialNameStr = buildMaterialNameStr(distributionParcelListEntities);
tempMap.put("物料名称", materialNameStr);
tempMap.put("签收件数", 0);
// 构建产品明细 --对于每一个订单
@ -5141,6 +5103,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
tempMap.put("备货区", stockupAreaStr);
}
//查询签收件数
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
.eq(DistributionBillLadingScanEntity::getStockArticleId, distributionStockArticleEntity.getId())
);
if (!ladingScanEntities.isEmpty()) {
int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum();
tempMap.put("签收件数", sum);
}
ls.add(tempMap);
a++;
@ -5148,6 +5119,62 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
if (!detailsEntities.isEmpty()) {
Map<Long, List<DistributionDeliveryDetailsEntity>> inventoryMap = detailsEntities.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId));
List<Long> inventoryIds = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(inventoryIds);
if (!distributionStockListEntities.isEmpty()) {
List<Map<String, Object>> iList = new ArrayList<>();
for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("序号", a);
tempMap.put("批次号", distributionStockListEntity.getIncomingBatch());
tempMap.put("产品名称", distributionStockListEntity.getDescriptionGoods());
tempMap.put("单位", distributionStockListEntity.getCargoUnit());
tempMap.put("物料编码", distributionStockListEntity.getCargoNumber());
tempMap.put("物料单位", distributionStockListEntity.getCargoUnit());
tempMap.put("物料规格", distributionStockListEntity.getCargoNorms());
//构建产品明细
//查询此订制品库位信息
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = inventoryMap.get(distributionStockListEntity.getId()).get(0);
Integer quantity = distributionDeliveryDetailsEntity.getQuantity();
//查询签收数量
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distributionDeliveryDetailsEntity.getBillLadingId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
tempMap.put("签收件数", 0);
if (!list.isEmpty()) {
int sum = list.stream().filter(l -> InventorySigningStatusConstant.yiqianshou.getValue().equals(l.getStockSignfoStatus())).mapToInt(DisStockListDetailEntity::getNum).sum();
tempMap.put("签收件数", sum);
}
tempMap.put("数量", quantity);
hejiNum += quantity;
tempMap.put("小计", quantity);
//这里只进行计划指定的批次库位进行整理
tempMap.put("货位", distributionStockListEntity.getStorageLocation());
tempMap.put("备货区", "");
tempMap.put("备货件数",distributionDeliveryDetailsEntity.getRealityQuantity());
iList.add(tempMap);
a++;
if (!mailNames.toString().contains(distributionStockListEntity.getMarketName())) {
if (!mailNames.toString().isEmpty()) {
mailNames.append(",");
}
mailNames.append(distributionStockListEntity.getMarketName());
}
if (!consigneeUnit.toString().contains(distributionStockListEntity.getMarketName())) {
if (!consigneeUnit.toString().isEmpty()) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockListEntity.getMarketName());
}
}
if (!iList.isEmpty()) {
map.put("库存品集合",iList);
}
}
}
map.put("收货单单位", consigneeUnit.toString());
map.put("商场名称", mailNames.toString());
@ -5160,6 +5187,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
m1.put("合计数量", hejiNum);
map.put("合计", m1);
}

125
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -0,0 +1,125 @@
package com.logpm.distribution.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.service.IDistributionNodeWorkService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.model.BroadcastNodeData;
import org.springblade.common.model.FanoutMsg;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkService {
private final RabbitTemplate rabbitTemplate;
@Override
public void nodeLoad() {
}
@Override
public void abnormalLoading() {
}
@Override
public void cancelLoading() {
}
@Override
public void carStart() {
}
@Override
public void carArrived() {
}
@Override
public void signFor(DistributionParcelListEntity parcelListEntity, Long taskId, String operationTime, String destinationWarehouse) {
log.info(">>>>>>>>>> signFor 签收扫描 {}", parcelListEntity.getOrderPackageCode());
BroadcastNodeData broadcastNodeData = new BroadcastNodeData();
broadcastNodeData.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
broadcastNodeData.put("distributionContactId", taskId);
// broadcastNodeData.put("distributionContactCode", distributionReservationEntity.getReservationCode());
broadcastNodeData.put("destinationWarehouse", destinationWarehouse);
broadcastNodeData.put("brand", parcelListEntity.getBrandName());
broadcastNodeData.setOperationTime(operationTime);
broadcastNodeData.setUserName(AuthUtil.getUserName());
broadcastNodeData.setTenantId(AuthUtil.getTenantId());
FanoutMsg build = FanoutMsg.builder().msg(broadcastNodeData.toJSONString())
.exchange(FanoutConstants.distribution.signfor.EXCHANGE).build();
sendFanoutMsg(build);
}
@Override
public void signForCheck() {
}
@Override
public void billofladingSignfor(DistributionParcelListEntity parcelListEntity,Long taskId,String operationTime, String destinationWarehouse) {
log.info(">>>>>>>>>> billofladingSignfor 自提扫描 {}", parcelListEntity.getOrderPackageCode());
BroadcastNodeData broadcastNodeData = new BroadcastNodeData();
broadcastNodeData.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
broadcastNodeData.put("distributionContactId", taskId);
// broadcastNodeData.put("distributionContactCode", distributionReservationEntity.getReservationCode());
broadcastNodeData.put("destinationWarehouse", destinationWarehouse);
broadcastNodeData.put("brand", parcelListEntity.getBrandName());
broadcastNodeData.setOperationTime(operationTime);
broadcastNodeData.setUserName(AuthUtil.getUserName());
broadcastNodeData.setTenantId(AuthUtil.getTenantId());
FanoutMsg build = FanoutMsg.builder().msg(broadcastNodeData.toJSONString())
.exchange(FanoutConstants.distribution.signfor.EXCHANGE).build();
sendFanoutMsg(build);
}
@Override
public void billofladingSignforCheck() {
}
@Override
public void retention() {
}
@Override
public void abnormalSignfor() {
}
@Override
public void fail() {
}
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(value = 3000, multiplier = 1.5))
private void sendFanoutMsg(FanoutMsg fanoutMsg) {
rabbitTemplate.convertAndSend(fanoutMsg.getExchange(), null, fanoutMsg.getMsg());
}
}

160
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java

@ -56,95 +56,95 @@ import java.util.stream.Collectors;
public class DistributionReservationStockarticleServiceImpl extends BaseServiceImpl<DistributionReservationStockarticleMapper, DistributionReservationStockarticleEntity> implements IDistributionReservationStockarticleService {
private final DistributionReservationMapper distributionReservationMapper;
private final DistributionReservationMapper distributionReservationMapper;
@Override
public IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticlePage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle) {
return page.setRecords(baseMapper.selectDistributionReservationStockarticlePage(page, distributionReservationStockarticle));
}
@Override
public IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticlePage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle) {
return page.setRecords(baseMapper.selectDistributionReservationStockarticlePage(page, distributionReservationStockarticle));
}
@Override
public List<DistributionReservationStockarticleExcel> exportDistributionReservationStockarticle(Map<String, Object> distributionReservationStockarticle) {
@Override
public List<DistributionReservationStockarticleExcel> exportDistributionReservationStockarticle(Map<String, Object> distributionReservationStockarticle) {
// QueryWrapper<DistributionReservationStockarticleEntity> queryWrapper = Condition.getQueryWrapper(distributionReservationStockarticle, DistributionReservationStockarticleEntity.class);
// queryWrapper.lambda().eq(DistributionReservationStockarticleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
// queryWrapper.apply("stock_article_status in (1,3)");
DistributionReservationStockarticleDTO reservationStockarticleDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionReservationStockarticle), DistributionReservationStockarticleDTO.class);
DistributionReservationStockarticleDTO reservationStockarticleDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionReservationStockarticle), DistributionReservationStockarticleDTO.class);
List<DistributionReservationStockarticleExcel> distributionReservationStockarticleList = baseMapper.exportDistributionReservationStockarticle(reservationStockarticleDTO);
distributionReservationStockarticleList.forEach(d -> {
d.setDeliveryType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE,d.getDeliveryType()));
List<DistributionReservationStockarticleExcel> distributionReservationStockarticleList = baseMapper.exportDistributionReservationStockarticle(reservationStockarticleDTO);
distributionReservationStockarticleList.forEach(d -> {
d.setDeliveryType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()));
// distributionReservationStockarticle.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionReservationStockarticle.getType()));
});
return distributionReservationStockarticleList;
}
@Override
public IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticleorderPage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle) {
return page.setRecords(baseMapper.selectDistributionReservationStockarticleorderPage(page, distributionReservationStockarticle));
}
@Override
public void maintenanceReservationStockArticle(Long reservationId,Long warehouseId) {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntities = this.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntities)){
List<DistributionReservationStockarticleEntity> reservationOrderList = reservationStockarticleEntities.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(reservationOrderList)){
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationOrderList) {
if (IsOrNoConstant.yes.getValue().equals(reservationStockarticleEntity.getIsZero())){
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, reservationStockarticleEntity.getStockArticleId(),warehouseId);
if (Func.isNotEmpty(distributionParcelListEntities)){
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
if (sum == 0){
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
//标识任务取消
reservationStockarticleEntity.setCancelStatus(1);
this.updateById(reservationStockarticleEntity);
}
}
}else {
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(reservationStockarticleEntity.getStockArticleId(), reservationId);
if (Func.isNotEmpty(distributionParcelNumberVOS)){
int sum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getReservationNum).sum();
if (0 == sum){
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
this.updateById(reservationStockarticleEntity);
}
}
}
}
}
}
}
@Override
public void maintenanceReservationStockArticleNum(Long reservationId, Long orderId,Long warehouseId) {
DistributionReservationStockarticleEntity reservationStockarticleEntity = this.getOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.eq(DistributionReservationStockarticleEntity::getStockArticleId, orderId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntity)){
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId);
if (Func.isNotEmpty(distributionParcelListEntities)){
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
reservationStockarticleEntity.setReservationNum(sum);
}else {
reservationStockarticleEntity.setReservationNum(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
}
this.updateById(reservationStockarticleEntity);
}
}
});
return distributionReservationStockarticleList;
}
@Override
public IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticleorderPage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle) {
return page.setRecords(baseMapper.selectDistributionReservationStockarticleorderPage(page, distributionReservationStockarticle));
}
@Override
public void maintenanceReservationStockArticle(Long reservationId, Long warehouseId) {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntities = this.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntities)) {
List<DistributionReservationStockarticleEntity> reservationOrderList = reservationStockarticleEntities.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(reservationOrderList)) {
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationOrderList) {
if (IsOrNoConstant.no.getValue().equals(reservationStockarticleEntity.getIsZero())) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, reservationStockarticleEntity.getStockArticleId(), warehouseId);
int sum = 0;
if (!distributionParcelListEntities.isEmpty()) {
sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
}
if (sum == 0) {
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
//标识任务取消
reservationStockarticleEntity.setCancelStatus(1);
this.updateById(reservationStockarticleEntity);
}
} else {
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(reservationStockarticleEntity.getStockArticleId(), reservationId);
if (Func.isNotEmpty(distributionParcelNumberVOS)) {
int sum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getReservationNum).sum();
if (0 == sum) {
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
this.updateById(reservationStockarticleEntity);
}
}
}
}
}
}
}
@Override
public void maintenanceReservationStockArticleNum(Long reservationId, Long orderId, Long warehouseId) {
DistributionReservationStockarticleEntity reservationStockarticleEntity = this.getOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.eq(DistributionReservationStockarticleEntity::getStockArticleId, orderId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntity)) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
reservationStockarticleEntity.setReservationNum(sum);
} else {
reservationStockarticleEntity.setReservationNum(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
}
this.updateById(reservationStockarticleEntity);
}
}
}

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

@ -242,6 +242,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private IDistributionNodeWorkService iDistributionNodeWorkService;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -683,7 +686,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag) {
this.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse, AuthUtil.getUser(), deliveryListEntity.getTrainNumber());
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse, AuthUtil.getUser(), deliveryListEntity.getTrainNumber());
}
//查看是否需要进行安装
if (reservationEntity.getIsInstall() == 2) {
@ -691,6 +694,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//开启异步查询此配送客户需要推送至安装平台数据
distributionAsyncService.sendInstallToPlatform(reservationEntity);
}
// // 复核作业节点推送
// iDistributionNodeWorkService.signForCheck(DistributionSignforEntity distributionSignforEntity,DistributionReservationEntity reservationEntity);
// sendNodeWorkDataBroadcast();
return R.success("操作成功");
}
@ -2490,6 +2500,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
@Transactional(rollbackFor = Exception.class)
public R signfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String nickName = null;
Long userId = null;
//思路: 在于一个客户下不会出现重复的包条码
@ -2498,10 +2510,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.fail(403, "仓库信息不能为空");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "配送任务错误");
}
//查询是否完成复核
//查询是否完成复核
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
);
@ -2523,13 +2532,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
String singleTime = simpleDateFormat.format(new Date());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (Func.isEmpty(parcelListEntity)) {
return Resp.scanFail("系统无编码", "系统无编码");
}
if (parcelListEntity.equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
return Resp.scanFail("包件已签收", "包件已签收");
}
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId());
@ -2591,7 +2600,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//存在装车记录,进行修改即可
//进行签收记录数据的维护
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
loadscanEntity.setSigningTime(singleTime);
loadscanEntity.setSignforState(2);
loadscanEntity.setOneClick(1);
loadscanEntity.setOneQclick(1);
@ -2704,8 +2713,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionParcelListService.updateById(updatePackage);
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(collect.get(0).getOrderCode(), myCurrentWarehouse.getId());
//推送信息至工厂
distributionAsyncService.sendFactory(collect.get(0), simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
orderPackageCodes.add(updatePackage.getOrderPackageCode());
//进行备货库位下架
List<JSONObject> jsonObjects = new ArrayList<>();
@ -2722,12 +2730,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} else if (Func.isEmpty(collect)) {
//这里就需要对该包件信息是否属于该配送计划进行判定。如果属于该配送计划则是串货。不是那么则需要提示是否异常签收或者返回的操作
//查询配送计划中是否存在该包件
DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (Func.isNotEmpty(one) && one.getConditions() == 2) {
log.warn("#####################此包件不是定制品 {}", one.getConditions());
if (Func.isNotEmpty(parcelListEntity) && parcelListEntity.getConditions() == 2) {
log.warn("#####################此包件不是定制品 {}", parcelListEntity.getConditions());
return Resp.scanFail("此包件不是定制品", "此包件不是定制品");
}
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
@ -2796,15 +2800,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// 推送
try {
sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 签收推送报错", e);
}
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, singleTime, myCurrentWarehouse);
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
@ -2814,6 +2811,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
private void sendNodeWorkDataBroadcast(DistributionParcelListEntity parcelListEntity, DistributionReservationEntity distributionReservationEntity, String singleTime, BasicdataWarehouseEntity myCurrentWarehouse) {
try {
//推送信息至工厂
// distributionAsyncService.sendFactory(parcelListEntity, singleTime, distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
// 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());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 签收作业节点广播报错", e);
}
}
/**
* @param orderPackageCode
* @param reservationCode
@ -2944,38 +2955,38 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//存在则查询该包件是否进行装车
DistributionParcelListEntity parcelListEntity = collect.get(0);
JSONObject trunklinePackageTrackLog = new JSONObject();
DistributionLoadscanEntity loadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.ne(DistributionLoadscanEntity::getScanStatus, 1)
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, parcelListEntity.getOrderPackageCode()));
if (Func.isNotEmpty(loadscanEntity)) {
if (loadscanEntity.getSignforState().equals(2)) {
if (Func.isNotEmpty(distributionLoadscanEntity)) {
if (distributionLoadscanEntity.getSignforState().equals(2)) {
return Resp.scanFail("重复扫描", "重复扫描");
}
//存在装车记录,进行修改即可
//进行签收记录数据的维护
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
loadscanEntity.setSignforState(2);
loadscanEntity.setReceivedQuantity(loadscanEntity.getLoadedNub());
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub());
loadscanEntity.setSigningUser(nickName);
loadscanEntity.setSigningUserId(userId);
loadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanEntity.setSigningUser(nickName);
distributionLoadscanEntity.setSigningUserId(userId);
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue());
distributionLoadscanService.updateById(loadscanEntity);
packageLockIds.add(loadscanEntity.getPackageId());
distributionLoadscanService.updateById(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
//缺少一个异步维护包件签收的方法
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), loadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
@ -2999,7 +3010,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("服务器正忙...", "服务器正忙");
}
//查询配送计划的计划司机
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity();
distributionLoadscanEntity = new DistributionLoadscanEntity();
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
@ -3074,21 +3085,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
//推送信息至工厂
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse);
//收集包件
orderpackages.add(updatePackage.getOrderPackageCode());
// 推送商家端
// 推送
try {
sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 签收推送报错", e);
}
// try {
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
// } catch (Exception e) {
//// throw new RuntimeException(e);
// log.error(">>>> 签收推送报错", e);
// }
} else {
//一个客户下出现重复包条码
@ -3363,6 +3376,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setIsAbnormalLoading(2);
distributionLoadscanEntity.setIsAbnormalSigning(2);
distributionLoadscanEntity.setAbnormalNote("异常签收");
loadscanEntity =distributionLoadscanEntity;
log.info("异常签收>>>>>>>>>>>>>>>reservationId:{},deliveryId:{},orderPackageCode:{}", distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getOrderPackageCode());
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
@ -3519,6 +3533,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要维护包件状态
distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
//推送信息至工厂
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, simpleDateFormat.format(new Date()), myCurrentWarehouse);
} else {
log.error("############出现相同的包件码:{}", distrilbutionloadingscanDTO.getBarcode());
return Resp.scanFail("操作失败", "包件信息有误");
@ -4843,9 +4861,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(), loadscanEntities.getReservationId(), loadscanEntities.getDeliveryId());
}
}
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
packageIds.add(parcelListEntity.getId());
orderCodes.add(parcelListEntity.getOrderCode());
//distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, signingTime, myCurrentWarehouse);
}
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)) {
@ -4980,7 +5000,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//处理库存品
//查询出该客户下的库存品信息
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId());
if (detailEntities.size() > 0 && Func.isNotEmpty(detailEntities)) {
if (!detailEntities.isEmpty() && Func.isNotEmpty(detailEntities)) {
loadingInventoryNum += detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum();
signingInventoryNum += detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum();
boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode()));
@ -5308,9 +5328,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("num", 1);
jsonObject.put("remark", "批量签收下架");
jsonObjects.add(jsonObject);
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "司机司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse);
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
@ -5329,8 +5350,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
//推送扫描记录
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
// distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse);
}
}

102
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -38,48 +38,14 @@ import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.OrderStatusDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
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.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionPrintEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
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.DistributionStockupScanEntity;
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.DistributionBillInventoryExcel;
import com.logpm.distribution.excel.DistributionBillOrderExcel;
import com.logpm.distribution.excel.DistributionBillOrderPackExcel;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistributionBillLadingScanService;
import com.logpm.distribution.service.IDistributionDeliveryChargeService;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionPrintService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionStockService;
import com.logpm.distribution.service.IDistributionStockupInfoService;
import com.logpm.distribution.service.IDistributionStockupScanService;
import com.logpm.distribution.service.IDistributionStockupService;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import com.logpm.distribution.service.IDistrilbutionBillPackageService;
import com.logpm.distribution.service.IDistrilbutionBillStockService;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
@ -247,6 +213,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private IDistributionNodeWorkService iDistributionNodeWorkService;
@Override
@ -1159,7 +1128,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
Map<Integer, List<DistributionParcelListEntity>> packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
List<DistributionBillLadingScanEntity> ladingScanEntities = new ArrayList<>();
if (!packageMap.isEmpty()) {
ladingScanEntities = handleSignPackage(packageMap, distrilbutionBillLading.getId(), myCurrentWarehouse.getId());
ladingScanEntities = handleSignPackage(packageMap, distrilbutionBillLading.getId(), myCurrentWarehouse);
if (!ladingScanEntities.isEmpty()) {
// 进行签收扫描数据补录
distributionBillLadingScanService.saveBatch(ladingScanEntities);
@ -1382,7 +1351,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
public List<DistributionBillLadingScanEntity> handleSignPackage(Map<Integer, List<DistributionParcelListEntity>> packageMap, Long id, Long warehouseId) {
public List<DistributionBillLadingScanEntity> handleSignPackage(Map<Integer, List<DistributionParcelListEntity>> packageMap, Long id, BasicdataWarehouseEntity myCurrentWarehouse) {
String method = "###################DistributionBillLadingServiceImpl.handleSignPackage";
List<DistributionBillLadingScanEntity> ladingScanEntities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
@ -1402,7 +1371,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionBillLadingScanEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionBillLadingScanEntity.setStockArticleId(parcelListEntity.getStockArticleId());
distributionBillLadingScanEntity.setBillLadingId(id);
distributionBillLadingScanEntity.setWarehouseId(warehouseId);
distributionBillLadingScanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionBillLadingScanEntity.setMaterialType("2");
distributionBillLadingScanEntity.setQuantity(parcelListEntity.getQuantity());
ladingScanEntities.add(distributionBillLadingScanEntity);
@ -1415,6 +1384,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
);
//维护订单
orderCodes.add(parcelListEntity.getOrderCode());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
String singleTime = simpleDateFormat.format(new Date());
// 推送自提作业节点数据
sendNodeWorkDataBroadcast(parcelListEntity,id,singleTime,myCurrentWarehouse);
}
break;
case 2:
@ -1440,7 +1415,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
DistributionBillLadingScanEntity distributionBillLadingScanEntity = new DistributionBillLadingScanEntity();
distributionBillLadingScanEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
distributionBillLadingScanEntity.setScanType(3);
distributionBillLadingScanEntity.setWarehouseId(warehouseId);
distributionBillLadingScanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionBillLadingScanEntity.setParcelListId(parcelListEntity.getId());
distributionBillLadingScanEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionBillLadingScanEntity.setStockArticleId(parcelListEntity.getStockArticleId());
@ -1490,7 +1465,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (!orderCodes.isEmpty()) {
String collect = orderCodes.stream().distinct().collect(Collectors.joining(","));
log.info(method + "维护订单,orderCodes:{}", collect);
distributionStockArticleService.maintenanceOrderInfo(collect, warehouseId);
distributionStockArticleService.maintenanceOrderInfo(collect, myCurrentWarehouse.getId());
}
return ladingScanEntities;
}
@ -3295,20 +3270,24 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionBillLadingScan.setQuantity(1);
distributionBillLadingScan.setBillLadingId( billLadingId);
String signTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date());
sendNodeWorkDataBroadcast(distributionParcelListEntity,billLadingId,signTime, myCurrentWarehouse);
//推送梦天
if (distributionParcelListEntity.getBrandName().equals("梦天")){
Map<String, Object> pushMap = new HashMap<>();
pushMap.put("orderPackageCode", coding);
pushMap.put("operationTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
pushMap.put("distributionContactId", billLadingId);
pushMap.put("destinationWarehouse", myCurrentWarehouse.getName());
rabbitTemplate.convertAndSend(RabbitConstant.MT_BUSINESS_DATA_2_FACTORY_EXCHANGE, RabbitConstant.MT_BUSINESS_DATA_2_FACTORY_ROUTING, pushMap, message -> {
message.getMessageProperties()
.setHeader("x-delay", 3000);
return message;
});
}
// if (distributionParcelListEntity.getBrandName().equals("梦天")){
// Map<String, Object> pushMap = new HashMap<>();
// pushMap.put("orderPackageCode", coding);
// pushMap.put("operationTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
// pushMap.put("distributionContactId", billLadingId);
// pushMap.put("destinationWarehouse", myCurrentWarehouse.getName());
//
// rabbitTemplate.convertAndSend(RabbitConstant.MT_BUSINESS_DATA_2_FACTORY_EXCHANGE, RabbitConstant.MT_BUSINESS_DATA_2_FACTORY_ROUTING, pushMap, message -> {
// message.getMessageProperties()
// .setHeader("x-delay", 3000);
// return message;
// });
// }
}
@ -3335,6 +3314,21 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return Resp.scanSuccess("签收成功", "签收成功");
}
/**
* 自提签收节点作业推送
* @param parcelListEntity
* @param billLadingId
* @param singleTime
* @param myCurrentWarehouse
*/
private void sendNodeWorkDataBroadcast(DistributionParcelListEntity parcelListEntity, Long billLadingId, String singleTime, BasicdataWarehouseEntity myCurrentWarehouse) {
try {
iDistributionNodeWorkService.billofladingSignfor(parcelListEntity, billLadingId, singleTime, myCurrentWarehouse.getName());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 自提签收作业节点广播报错", e);
}
}
/**
* pda扫描

4
blade-service/logpm-distribution/src/main/resources/application-dev.yml

@ -15,10 +15,10 @@ server:
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.3.100
host: 192.168.2.46
port: 5672
username: admin
password: 123456
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)

54
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/NodeWorkHandler.java

@ -0,0 +1,54 @@
package com.logpm.factory.receiver;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
* 作业节点数据监听
*/
@Slf4j
@AllArgsConstructor
@Component
public class NodeWorkHandler {
private final IMtFactoryDataService mtFactoryDataService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.signfor.QUEUE.FACTORY_NODE_WORK_DISTRIBUTION_SIGNFOR_QUERY),
exchange = @Exchange(name = FanoutConstants.distribution.signfor.EXCHANGE, type = ExchangeTypes.FANOUT)
))
public void distributionSignforQuery(String message) {
try {
JSONObject jsonObject = JSONUtil.parseObj(message);
String orderPackageCode = jsonObject.getStr("orderPackageCode");
String operationTime = jsonObject.getStr("operationTime");
String distributionContactId = jsonObject.getStr("distributionContactId");
String destinationWarehouse = jsonObject.getStr("destinationWarehouse");
// 获取品牌BrandEnums.MTMM.getValue()
String o = jsonObject.getStr("brand");
switch (o) {
case "梦天" :
log.info("工厂节点数据监听:1");
mtFactoryDataService.qianshouScanForNewSystem(orderPackageCode, operationTime, distributionContactId, destinationWarehouse);
break;
default:
log.info("签收扫描没有找到品牌: {}",o);
}
}catch (Exception e){
log.error("工厂节点数据监听异常", e);
}
}
}

4
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -212,9 +212,9 @@ public class DistributionDatarepair {
@XxlJob("pushBillNotification")
public ReturnT<String> pushBillNotification(String params) {
// 得到当前仓库所有的签收任务
Integer parmeId = null;
Long parmeId = null;
if(StringUtil.isNotBlank(params)){
parmeId = Integer.parseInt(params);
parmeId = Long.parseLong(params);
}
List<JSONObject> allSignfor = warehouseMappingDataMapper.findAllBillSign(parmeId);
for (JSONObject entries : allSignfor) {

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -96,7 +96,7 @@ public interface WarehouseMappingDataMapper {
void updateClearSignforStatus(@Param("singnforId") Long singnforId, @Param("warehouseId") Long warehouseId, @Param("dealStatus") Integer dealStatus);
void updateClearBillSignforStatus(@Param("singnforId") Long singnforId, @Param("warehouseId") Long warehouseId, @Param("dealStatus") Integer dealStatus);
List<JSONObject> findAllBillSign(@Param("id") Integer id);
List<JSONObject> findAllBillSign(@Param("id") Long id);
List<String> findExceptionTrayType();

4
blade-service/logpm-statisticsdata/src/main/resources/application-dev.yml

@ -12,10 +12,10 @@ server:
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.3.100
host: 192.168.2.46
port: 5672
username: admin
password: 123456
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)

28
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java

@ -104,32 +104,4 @@ public class RabbitMqConfiguration {
return BindingBuilder.bind(hwyOpenOrderLoadScanQueue).to(hwyOpenOrderLoadScanExchange).with(RabbitConstant.HWY_ORDER_STATUS_ROUTING).noargs();
}
@Bean
public Queue openWaybillToBusinessQueue() {
return new Queue(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE, true);
}
@Bean
public CustomExchange openWaybillToBusinessExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding openWaybillToBusinessBinding(Queue openWaybillToBusinessQueue, CustomExchange openWaybillToBusinessExchange) {
return BindingBuilder.bind(openWaybillToBusinessQueue).to(openWaybillToBusinessExchange).with(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING).noargs();
}
}

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

@ -1011,8 +1011,15 @@ public class OpenOrderController {
log.warn(method+"订单号为空 orderCode={}",orderCode);
throw new CustomerException(405,"订单号为空");
}
String brand = openLabelDTO.getBrand();
if(StringUtil.isBlank(brand)){
log.warn(method+"品牌为空 brand={}",brand);
throw new CustomerException(405,"品牌为空");
}
Integer totalNumber = openLabelDTO.getTotalNumber();
if(totalNumber == 0){
if(totalNumber == 0 && !"曼好家".equals(brand)){
log.warn(method+"总数量不正确 totalNumber={}",totalNumber);
throw new CustomerException(405,"总数量不正确");
}
@ -1021,11 +1028,7 @@ public class OpenOrderController {
log.warn(method+"一级品类为空 firsts={}",firsts);
throw new CustomerException(405,"一级品类为空");
}
String brand = openLabelDTO.getBrand();
if(StringUtil.isBlank(brand)){
log.warn(method+"品牌为空 brand={}",brand);
throw new CustomerException(405,"品牌为空");
}
String dealerName = openLabelDTO.getDealerName();
if(StringUtil.isBlank(dealerName)){
log.warn(method+"商场为空 dealerName={}",dealerName);

27
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -400,6 +400,33 @@
<if test="param.loadCarsNo != null and param.loadCarsNo != ''">
and Locate(#{param.loadCarsNo},ltcl.cars_no) > 0
</if>
<if test="param.carrierName != null and param.carrierName != ''">
and Locate(#{param.carrierName},ltcl.carrier_name) > 0
</if>
<if test="param.payMethod != null">
and ltcl.pay_method = #{param.payMethod}
</if>
<if test="param.carrierOrderCode != null and param.carrierOrderCode != ''">
and Locate(#{param.carrierOrderCode},ltcl.carrier_order_code) > 0
</if>
<if test="param.startWarehouseName != null and param.startWarehouseName != ''">
and Locate(#{param.startWarehouseName},ltcl.start_warehouse_name) > 0
</if>
<if test="param.loadStatus != null">
and ltcl.load_status = #{param.loadStatus}
</if>
<if test="param.isSettlement != null">
and ltcl.is_settlement = #{param.isSettlement}
</if>
<if test="param.deliveryType != null">
and ltcl.delivery_type = #{param.deliveryType}
</if>
<if test="param.operator != null and param.operator != ''">
and Locate(#{param.operator},ltcl.operator) > 0
</if>
<if test="param.settlementPerson != null and param.settlementPerson != ''">
and Locate(#{param.settlementPerson},ltcl.settlement_person) > 0
</if>
group by ltcl.id
order by ltcl.create_time desc
</select>

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

@ -118,7 +118,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<String> findUnloadByLoadIdAndWarehouseId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
void updateScanStatusByLoadId(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime);
void updateScanStatusByLoadId(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime,@Param("signUserName") String signUserName);
List<String> findSignListOrderPackageCodes(@Param("loadId") Long loadId);
@ -162,4 +162,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
void deleteListByCarsLoadScanIds(@Param("carsLoadScanIdList") List<Long> carsLoadScanIdList);
void clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
void addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(@Param("loadId") Long finalLoadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo, @Param("signOrderId") Long signOrderId);
}

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

@ -473,12 +473,7 @@
set scan_status = #{scanStatus},
sign_time = #{unloadTime},
sign_user_name = #{signUserName},
unload_abnormal = 0,
unload_num = num,
unload_user_name = #{signUserName},
unload_time = #{unloadTime},
unload_node_id = #{warehouseId},
unload_node_name = #{warehouseName}
sign_abnormal = 0
where 1=1
<if test="loadScanIds != null and loadScanIds.size() > 0">
and id in
@ -590,7 +585,9 @@
<update id="updateScanStatusByLoadId" >
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus},
sign_time = #{unloadTime}
sign_time = #{unloadTime},
sign_user_name = #{signUserName},
sign_abnormal = 0
where load_id = #{loadId}
</update>
@ -856,4 +853,24 @@
</foreach>
</delete>
<update id="clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo">
update logpm_trunkline_cars_load_scan
set sign_order_id = null
where load_id = #{loadId}
and warehouse_id = #{nodeId}
and order_code = #{orderCode}
and waybill_no = #{waybillNo}
and scan_status = '1'
</update>
<update id="addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo">
update logpm_trunkline_cars_load_scan
set sign_order_id = #{signOrderId}
where load_id = #{loadId}
and warehouse_id = #{nodeId}
and order_code = #{orderCode}
and waybill_no = #{waybillNo}
and scan_status = '1'
</update>
</mapper>

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

@ -60,4 +60,8 @@ public interface TrunklineCarsOrderMapper extends BaseMapper<TrunklineCarsOrderE
List<TrunklineCarsOrderEntity> findLoadingList(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);
Integer findLoadingNumBySignOrderId(@Param("signOrderId") Long signOrderId);
void updateNoCustomer(@Param("updateCarsOrderIdList") List<Long> updateCarsOrderIdList);
List<TrunklineCarsOrderVO> findMallOrderList(@Param("carsOrderIdList") List<Long> carsOrderIdList);
}

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

@ -225,11 +225,13 @@
lww.id belongToWarehouseId,
lww.name belongToWarehouseName,
ltco.final_node_id finalNodeId,
0 signNum,
'0' signStatus,
case when sum(ltco.sign_num) >= sum(ltco.real_num) and sum(ltco.sign_num) > 0 then '20'
when sum(ltco.sign_num) = 0 then '0'
else '10' end signStatus,
GROUP_CONCAT(distinct ldsa.consignee_person) mallPerson,
GROUP_CONCAT(distinct ldsa.consignee_mobile) mallMobile,
GROUP_CONCAT(distinct ldsa.consignee_address) mallAddress,
sum(ltco.sign_num) signNum,
sum(ltco.plan_num) planNum,
sum(ltco.real_num) loadingNum
from logpm_trunkline_cars_order ltco
@ -322,5 +324,30 @@
where sign_order_id = #{signOrderId}
</select>
<update id="updateNoCustomer" >
update logpm_trunkline_cars_order
set is_customer = '0',
sign_order_id = null
where id in
<foreach collection="updateCarsOrderIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and sign_num = 0
</update>
<select id="findMallOrderList" resultType="com.logpm.trunkline.vo.TrunklineCarsOrderVO">
select ltco.*,
ldsa.mall_name mallName,
ldsa.consignee_person mallPerson,
ldsa.consignee_mobile mallMobile,
ldsa.consignee_address mallAddress
from logpm_trunkline_cars_order ltco
left join logpm_distribution_stock_article ldsa on ldsa.order_code = ltco.order_code and ldsa.warehouse_id = ltco.node_id
where ltco.id in
<foreach collection="carsOrderIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java

@ -26,4 +26,7 @@ public interface TrunklineLoadSignOrderMapper extends BaseMapper<TrunklineLoadSi
void updateBelongToWarehouse(@Param("signOrderId") Long signOrderId, @Param("warehouseId") Long warehouseId, @Param("warehouseName") String warehouseName);
IPage<TrunklineLoadSignOrderVO> findSignOrderPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
void deleteListBySignOrderIds(@Param("delSignOrderList") List<Long> delSignOrderList);
}

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml

@ -152,4 +152,13 @@
GROUP BY ltlso.id
</select>
<delete id="deleteListBySignOrderIds" >
delete from logpm_trunkline_load_sign_order
where id in
<foreach collection="delSignOrderList" item="signOrderId" open="(" separator="," close=")">
#{signOrderId}
</foreach>
</delete>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml

@ -23,7 +23,8 @@
</select>
<select id="findUpdateWaybillList" resultType="com.logpm.trunkline.vo.TrunklineWaybillTrackVO">
select ltwt.waybill_no waybillNo,
select lww.id waybillId,
ltwt.waybill_no waybillNo,
lww.departure_warehouse_name openWarehouseName,
ltwt.check_status checkStatus,
lww.waybill_type waybillType,

65
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenWaybillToBusinessListener.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.mq;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
@ -22,15 +24,17 @@ import jodd.util.ArraysUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@ -51,9 +55,8 @@ import java.util.stream.Collectors;
@Slf4j
@AllArgsConstructor
@Component
@RabbitListener(queues = RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE)
public class
OpenWaybillToBusinessListener {
//@RabbitListener(queues = RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE)
public class OpenWaybillToBusinessListener {
private final IWarehouseWaybillClient warehouseWaybillClient;
@ -73,18 +76,58 @@ OpenWaybillToBusinessListener {
private ITrunklineWaybillTrackService trunklineWaybillTrackService;
@RabbitHandler
public void openWaybillToBusinessDataHandler(Map map, Message message, Channel channel) {
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.OPENWAYBILL.QUEUE.SEND_BUSINESS_DATA_BY_OPENWAYBILL_DATA),
exchange = @Exchange(name = FanoutConstants.trunkline.OPENWAYBILL.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void openWaybillToBusinessDataHandler(String message) {
Long waybillId = (Long) map.get("messageData");
JSONObject jsonObject = JSONUtil.parseObj(message);
Long waybillId = jsonObject.getLong("waybillId");
if (ObjectUtil.isEmpty(waybillId)) {
log.warn("运单ID为null");
return;
}
WarehouseWaybillEntity byWaybillId = warehouseWaybillClient.findByWaybillId(waybillId);
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
for (Tenant datum : data) {
if (datum.getTenantType() == 2 && datum.getTenantName().equals(byWaybillId.getConsignee().trim())) {
tenant = datum;
break;
}
}
}
if (tenant != null) {
extractedTenant(tenant, byWaybillId);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.UPDATEWAYBILL.QUEUE.SEND_BUSINESS_DATA_BY_UPDATEWAYBILL_DATA),
exchange = @Exchange(name = FanoutConstants.trunkline.UPDATEWAYBILL.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void updateWaybillToBusinessDataHandler(String message) {
JSONObject jsonObject = JSONUtil.parseObj(message);
Long waybillId = jsonObject.getLong("waybillId");
if (ObjectUtil.isEmpty(waybillId)) {
log.warn("运单ID为null");
return;
}
WarehouseWaybillEntity byWaybillId = warehouseWaybillClient.findByWaybillId(waybillId);
String oldConsignee = (String) map.get("oldConsignee");
String oldConsignee = (String) jsonObject.get("oldConsignee");
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
@ -96,7 +139,7 @@ OpenWaybillToBusinessListener {
tenant = datum;
}
if (datum.getTenantType() == 2 && datum.getTenantName().equals(oldConsignee.trim())) {
if (oldConsignee!=null && datum.getTenantType() == 2 && datum.getTenantName().equals(oldConsignee.trim())) {
oldTenant = datum;
}
@ -124,6 +167,8 @@ OpenWaybillToBusinessListener {
}
private void extractedTenant(Tenant tenant, WarehouseWaybillEntity byWaybillId) {
List<Long> waybillIds = new ArrayList<>();

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

@ -25,7 +25,7 @@ public interface IOpenOrderAsyncService {
void sendOpenWaybillFanout(WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details, List<Long> advanceIds);
void sendUpdateWaybillFanout(WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details, List<Long> advanceIds);
void sendUpdateWaybillFanout(WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details, List<Long> advanceIds,String oldConsignee);
void dealwithBillladingInfo(List<Long> advanceIds,Long warehouseId,String warehouseName,Long waybillId,String waybillNo);
}

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

@ -113,7 +113,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<String> findUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId);
void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime);
void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime,String signUserName);
List<String> findSignListOrderPackageCodes(Long loadId);
@ -157,4 +157,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
void deleteListByCarsLoadScanIds(List<Long> carsLoadScanIdList);
void clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(Long finalLoadId1, Long nodeId, String orderCode, String waybillNo);
void addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long finalLoadId, Long nodeId, String orderCode, String waybillNo, Long signOrderId);
}

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

@ -57,4 +57,8 @@ public interface ITrunklineCarsOrderService extends BaseService<TrunklineCarsOrd
List<TrunklineCarsOrderEntity> findLoadingList(Long loadId, Long nodeId);
Integer findLoadingNumBySignOrderId(Long signOrderId);
void updateNoCustomer(List<Long> updateCarsOrderIdList);
List<TrunklineCarsOrderVO> findMallOrderList(List<Long> carsOrderIdList);
}

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

@ -23,4 +23,8 @@ public interface ITrunklineLoadSignOrderService extends BaseService<TrunklineLoa
void updateBelongToWarehouse(Long signOrderId, Long warehouseId, String warehouseName);
IPage<TrunklineLoadSignOrderVO> findSignOrderPageList(IPage<Object> page, LoadCarsDTO loadCarsDTO);
void deleteListBySignOrderIds(List<Long> delSignOrderList);
List<TrunklineLoadSignOrderEntity> findSignOrderListByLoadId(Long loadId);
}

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

@ -411,7 +411,7 @@ public class InComingServiceImpl implements IInComingService {
//已入库包件
if (incomingType != 1) {
log.warn("############incomingPackage: 包件已入库 orderPackageCodes={} warehouseId={}", orderPackageCodes, warehouseId);
throw new CustomerException(405, "包件" + orderPackageCodes + "已入库");
throw new CustomerException(405, "包件已入库");
} else {
// if (!Objects.isNull(billladingId)) {
// //先判断该包件是否已经有提货记录了
@ -723,7 +723,7 @@ public class InComingServiceImpl implements IInComingService {
waybillEntityList.forEach(wb -> {
Integer totalCount = wb.getTotalCount();
Integer stockCount = wb.getStockCount();
openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "20", "已入库", "运单入库:"+stockCount+"/"+totalCount+",入库类型:【"+IncomingTypeEnum.getValue(incomingType)+"】,入库时间:"+ CommonUtil.dateToStringGeneral(new Date()), AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
openOrderAsyncService.saveLog(wb.getId(), wb.getWaybillNo(), "20", "已入库", "运单入库:"+stockCount+"/"+totalCount+",入库类型:【"+IncomingTypeEnum.getValue(incomingType)+"】,入库时间:"+ CommonUtil.dateToStringGeneral(new Date()), AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
});
}

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

@ -609,7 +609,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
@LogpmAsync("asyncExecutor")
@Override
public void sendUpdateWaybillFanout(WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details,List<Long> advanceIds) {
public void sendUpdateWaybillFanout(WarehouseWaybillEntity waybillEntity, List<WarehouseWayBillDetail> details,List<Long> advanceIds,String oldConsignee) {
Integer waybillType = waybillEntity.getWaybillType();
String waybillNo = waybillEntity.getWaybillNo();
@ -620,6 +620,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
jsonObject.put("waybillId",waybillEntity.getId());
jsonObject.put("waybillNo",waybillNo);
jsonObject.put("waybillType",waybillType);
jsonObject.put("oldConsignee",oldConsignee);
Long consigneeId = waybillEntity.getConsigneeId();
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId);
if(Objects.isNull(basicdataClientEntity)){
@ -844,6 +845,9 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
Map<Long, BillladingPackageVO> billladingPackageMap = billladingPackageList.stream().collect(Collectors.toMap(BillladingPackageVO::getBillladingId, Function.identity()));
List<Long> billladingIds = new ArrayList<>(billladingPackageMap.keySet());
if(billladingIds.isEmpty()){
return;
}
QueryWrapper<TrunklineBillladingEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", billladingIds)

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

@ -616,22 +616,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
openOrderAsyncService.sendOpenWaybillFanout(waybillEntity, details, advanceIds);
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", waybillId);
mapState.put("createTime", System.currentTimeMillis());
try {
rabbitTemplate.convertAndSend(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
}
Map<String, Object> map = new HashMap<>();
map.put("waybillId", waybillId);
return R.data(map);
@ -2144,13 +2128,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//异步存入日志
openOrderAsyncService.saveUpdateLog(waybillId, waybillNo, "888", editReson, "备注:"+refer+" 修改内容:"+updateMsg, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName,waybillEntity);
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
List<Long> waybillIds = new ArrayList<>();
waybillIds.add(waybillId);
List<Long> advanceIds = trunklineWaybillOrderService.findAdvanceIdsByWaybillIds(waybillIds);
openOrderAsyncService.sendUpdateWaybillFanout(waybillEntity,wayBillDetailList,advanceIds);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findAllParcelListByAdvanceIds(advanceIds);
@ -2206,23 +2188,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
}
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", waybillId);
mapState.put("oldConsignee", oldConsignee);
mapState.put("createTime", System.currentTimeMillis());
try {
rabbitTemplate.convertAndSend(RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
}
openOrderAsyncService.sendUpdateWaybillFanout(waybillEntity,wayBillDetailList,advanceIds,oldConsignee);
return R.success("改单成功");
}
@ -3368,12 +3334,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Long newDestinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String newDestinationWarehouseName = openOrderDTO.getDestinationWarehouseName();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
if(!ObjectUtil.equals(destinationWarehouseId,newDestinationWarehouseId)){
// stringBuilder.append("目的仓:").append(departureWarehouseName).append("-->").append(newDestinationWarehouseName).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("目的仓");
editOrderMsgVO.setOldValue(departureWarehouseName);
editOrderMsgVO.setOldValue(destinationWarehouseName);
editOrderMsgVO.setNewValue(newDestinationWarehouseName);
msgList.add(editOrderMsgVO);
}

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

@ -269,8 +269,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
}
@Override
public void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime) {
baseMapper.updateScanStatusByLoadId(loadId,scanStatus,unloadTime);
public void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime, String signUserName) {
baseMapper.updateScanStatusByLoadId(loadId,scanStatus,unloadTime,signUserName);
}
@Override
@ -378,4 +378,14 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
baseMapper.deleteListByCarsLoadScanIds(carsLoadScanIdList);
}
@Override
public void clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(Long finalLoadId1, Long nodeId, String orderCode, String waybillNo) {
baseMapper.clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(finalLoadId1,nodeId,orderCode,waybillNo);
}
@Override
public void addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long finalLoadId, Long nodeId, String orderCode, String waybillNo, Long signOrderId) {
baseMapper.addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(finalLoadId,nodeId,orderCode,waybillNo,signOrderId);
}
}

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

@ -1230,6 +1230,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setIsSettlement("1");
carsLoadEntity.setCostAllocationType("0");
carsLoadEntity.setIsAbnormal(0);
carsLoadEntity.setIsCustomer("2");
boolean saveCarsLoad = save(carsLoadEntity);
if (!saveCarsLoad) {
log.warn("##############saveNew: 保存配载计划失败");
@ -2188,7 +2189,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setLoadStatus("90");
updateById(carsLoadEntity);
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date());
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date(),AuthUtil.getNickName());
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue());
@ -2226,13 +2227,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
throw new CustomerException(400, "暂未有权限进行操作");
}
TrunklineCarsLoadLineEntity carsLoadLine = trunklineCarsLoadLineService.findStartNodeByLoadId(loadId);
carsLoadEntity.setIsSettlement("2");
carsLoadEntity.setSettlementValue(settlementValue);
carsLoadEntity.setSettlementPerson(AuthUtil.getUserName());
carsLoadEntity.setSettlementPerson(AuthUtil.getNickName());
carsLoadEntity.setSettlementPersonId(AuthUtil.getUserId());
updateById(carsLoadEntity);
trunklineCarsLoadLogService.saveLog(carsLoadEntity, null, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SETTLEMENT.getValue());
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLine, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SETTLEMENT.getValue());
return R.success("结算成功");
}
@ -2255,7 +2259,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R loadingScan(Long loadId, Long warehouseId, String orderPackageCode, String trayCode, String remark) {
public R loadingScan(Long loadId, Long warehouseId, String orderPackageCode, String trayCode, String remark) {
log.info("#################loadingScan: 装车扫描");
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
@ -2470,6 +2474,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
isAbnormal = 1;
remark = "有数据,在本仓,不在配载计划中,异常装车";
audio = "无计划装车";
String loadType = carsLoadEntity.getLoadType();
if("4".equals(loadType)){
carsLoadScanEntity.setFinalNodeId(warehouseId);
carsLoadScanEntity.setFinalNodeName(warehouseName);
}
} else {
//有计划
Integer planNum = carsOrderEntity.getPlanNum();
@ -2491,8 +2500,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (!Objects.isNull(finalNode)) {
finalNodeName = finalNode.getName();
}
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
String loadType = carsLoadEntity.getLoadType();
if("4".equals(loadType)){
carsLoadScanEntity.setFinalNodeId(warehouseId);
carsLoadScanEntity.setFinalNodeName(warehouseName);
}else{
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
}
}
distributionParcelListClient.updateOrderPackageCodeById(packageId, "60");
distributionStockArticleClient.submitHandleNumByOrderId(1, articleId);
@ -2680,6 +2695,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setNum(enterNum);
carsLoadScanEntity.setIsSupple(0);
carsLoadScanEntity.setLoadingAbnormal(isAbnormal);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setType(2);
carsLoadScanEntity.setIsData(isData);
carsLoadScanEntity.setTrayId(trayId);
@ -3706,6 +3723,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadNum(carsLoadScanEntity.getNum());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setScanStatus("2");
trayCode = carsLoadScanEntity.getTrayCode();
if (!StringUtil.isBlank(trayCode)) {
@ -4374,7 +4392,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
String warehouseName = warehouseEntity.getName();
String warehouseCode = warehouseEntity.getWarehouseCode();
String[] split = carsOrderIds.split(",");
List<Long> carsOrderIdList = new ArrayList<>();
@ -4389,18 +4409,200 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(Objects.isNull(carsLoadEntity)){
log.warn("###########updateWaybillOrderIsCustemer: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
baseMapper.updateWaybillOrderIsCustemer(carsOrderIdList, isCustomer);
//取消节点的签收单
cancleCustomerSignOrder(loadId, warehouseId);
carsLoadEntity.setIsCustomer("2");
updateById(carsLoadEntity);
if("1".equals(isCustomer)){
//直发商家添加
List<TrunklineCarsOrderVO> addCarsOrderEntityList = trunklineCarsOrderService.findMallOrderList(carsOrderIdList);
//把addCarsOrderEntityList中所有元素以mallName和nodeId作为key进行分组
Map<String, List<TrunklineCarsOrderVO>> addCarsOrderEntityMap = addCarsOrderEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsOrderVO -> TrunklineCarsOrderVO.getMallName()+"&&"+TrunklineCarsOrderVO.getNodeId()));
List<TrunklineLoadSignOrderEntity> signOrderEntityList = trunklineLoadSignOrderService.findAllLoadSignOrderList(loadId, warehouseId);
//把signOrderEntityList中所有元素转化成mallName和warehouseId作为key的map
Map<String, TrunklineLoadSignOrderEntity> signOrderEntityMap = signOrderEntityList.stream().collect(Collectors.toMap(TrunklineLoadSignOrderEntity -> TrunklineLoadSignOrderEntity.getMallName()+"&&"+TrunklineLoadSignOrderEntity.getWarehouseId(), Function.identity(), (k1, k2) -> k1));
List<TrunklineCarsOrderEntity> updateCarsOrderList = new ArrayList<>();
Long finalLoadId = loadId;
addCarsOrderEntityMap.keySet().forEach(key -> {
String[] split1 = key.split("&&");
String mallName = split1[0];
List<TrunklineCarsOrderVO> trunklineCarsOrderVOS = addCarsOrderEntityMap.get(key);
Long finalNodeId = trunklineCarsOrderVOS.get(0).getFinalNodeId();
TrunklineLoadSignOrderEntity trunklineLoadSignOrderEntity = signOrderEntityMap.get(key);
if(Objects.isNull(trunklineLoadSignOrderEntity)){
trunklineLoadSignOrderEntity = new TrunklineLoadSignOrderEntity();
trunklineLoadSignOrderEntity.setLoadId(finalLoadId);
trunklineLoadSignOrderEntity.setWarehouseId(warehouseId);
trunklineLoadSignOrderEntity.setMallName(mallName);
//把trunklineCarsOrderVOS中所有元素的mallPerson去重后用,拼接
trunklineLoadSignOrderEntity.setMallPerson(trunklineCarsOrderVOS.stream().map(TrunklineCarsOrderVO::getMallPerson).distinct().collect(Collectors.joining(",")));
trunklineLoadSignOrderEntity.setMallMobile(trunklineCarsOrderVOS.stream().map(TrunklineCarsOrderVO::getMallMobile).distinct().collect(Collectors.joining(",")));
trunklineLoadSignOrderEntity.setMallAddress(trunklineCarsOrderVOS.stream().map(TrunklineCarsOrderVO::getMallAddress).distinct().collect(Collectors.joining(",")));
trunklineLoadSignOrderEntity.setBelongToWarehouseId(warehouseId);
trunklineLoadSignOrderEntity.setBelongToWarehouseName(warehouseName);
//把trunklineCarsOrderVOS中所有元素的planNum求和
trunklineLoadSignOrderEntity.setPlanNum(trunklineCarsOrderVOS.stream().mapToInt(TrunklineCarsOrderVO::getPlanNum).sum());
trunklineLoadSignOrderEntity.setLoadingNum(trunklineCarsOrderVOS.stream().mapToInt(TrunklineCarsOrderVO::getRealNum).sum());
trunklineLoadSignOrderEntity.setSignNum(0);
trunklineLoadSignOrderEntity.setSignStatus("0");
trunklineLoadSignOrderEntity.setLoadSignCode(codeClient.getCodeByType(CodeNumConstant.TRUNKLINE_LOAD_SIGN, warehouseCode, ""));
trunklineLoadSignOrderEntity.setFinalNodeId(finalNodeId);
}else{
//把trunklineCarsOrderVOS中所有元素的mallPerson去重后放入一个Set
Set<String> mallPersonSet = trunklineCarsOrderVOS.stream()
.map(TrunklineCarsOrderVO::getMallPerson)
.collect(Collectors.toSet());
mallPersonSet.add(trunklineLoadSignOrderEntity.getMallName());
trunklineLoadSignOrderEntity.setMallPerson(String.join(",",mallPersonSet));
Set<String> mallMobileSet = trunklineCarsOrderVOS.stream()
.map(TrunklineCarsOrderVO::getMallMobile)
.collect(Collectors.toSet());
mallMobileSet.add(trunklineLoadSignOrderEntity.getMallMobile());
trunklineLoadSignOrderEntity.setMallMobile(String.join(",",mallMobileSet));
Set<String> mallAddressSet = trunklineCarsOrderVOS.stream()
.map(TrunklineCarsOrderVO::getMallMobile)
.collect(Collectors.toSet());
mallAddressSet.add(trunklineLoadSignOrderEntity.getMallAddress());
trunklineLoadSignOrderEntity.setMallAddress(String.join(",",mallAddressSet));
int plan = trunklineCarsOrderVOS.stream().mapToInt(TrunklineCarsOrderVO::getPlanNum).sum() + trunklineLoadSignOrderEntity.getPlanNum();
trunklineLoadSignOrderEntity.setPlanNum(plan);
trunklineLoadSignOrderEntity.setLoadingNum(trunklineCarsOrderVOS.stream().mapToInt(TrunklineCarsOrderVO::getRealNum).sum()+trunklineLoadSignOrderEntity.getLoadingNum());
Integer signNum = trunklineLoadSignOrderEntity.getSignNum();
if(signNum >= plan){
trunklineLoadSignOrderEntity.setSignStatus("20");
}else if(signNum == 0){
trunklineLoadSignOrderEntity.setSignStatus("0");
}else{
trunklineLoadSignOrderEntity.setSignStatus("10");
}
}
trunklineLoadSignOrderService.saveOrUpdate(trunklineLoadSignOrderEntity);
Long signOrderId = trunklineLoadSignOrderEntity.getId();
trunklineCarsOrderVOS.forEach(trunklineCarsOrderVO -> {
Long nodeId = trunklineCarsOrderVO.getNodeId();
String waybillNo = trunklineCarsOrderVO.getWaybillNo();
String orderCode = trunklineCarsOrderVO.getOrderCode();
TrunklineCarsOrderEntity updateCarsOrder = new TrunklineCarsOrderEntity();
updateCarsOrder.setId(trunklineCarsOrderVO.getId());
updateCarsOrder.setNodeId(nodeId);
updateCarsOrder.setWaybillNo(waybillNo);
updateCarsOrder.setOrderCode(orderCode);
updateCarsOrder.setIsCustomer("1");
updateCarsOrder.setSignOrderId(signOrderId);
updateCarsOrderList.add(updateCarsOrder);
});
});
//生成直发商家签收单
createCustomerSignOrder(loadId, warehouseId);
if(CollUtil.isNotEmpty(updateCarsOrderList)){
trunklineCarsOrderService.updateBatchById(updateCarsOrderList);
updateCarsOrderList.forEach(e -> {
Long nodeId = e.getNodeId();
String orderCode = e.getOrderCode();
String waybillNo = e.getWaybillNo();
Long signOrderId = e.getSignOrderId();
trunklineCarsLoadScanService.addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(finalLoadId, nodeId, orderCode, waybillNo, signOrderId);
});
}
}else{
//直发商家移除
List<Long> dealwithCarsOrderIdList = new ArrayList<>();
List<TrunklineCarsOrderEntity> carsOrderEntityList = trunklineCarsOrderService.listByIds(carsOrderIdList);
//移除carsOrderEntityList中signNum不为0的元素
carsOrderEntityList.removeIf(e -> e.getSignNum() != 0);
//把carsOrderEntityList通过signOrderId进行分组
Map<Long, List<TrunklineCarsOrderEntity>> collect = carsOrderEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsOrderEntity::getSignOrderId));
Set<Long> signOrderIds = collect.keySet();
List<TrunklineLoadSignOrderEntity> signOrderEntityList = trunklineLoadSignOrderService.listByIds(signOrderIds);
//把signOrderEntityList转化成id为key的Map
Map<Long, TrunklineLoadSignOrderEntity> signOrderEntityMap = signOrderEntityList.stream().collect(Collectors.toMap(TrunklineLoadSignOrderEntity::getId, Function.identity()));
List<TrunklineCarsOrderEntity> updateCarsOrderList = new ArrayList<>();
List<TrunklineLoadSignOrderEntity> updateSignOrderList = new ArrayList<>();
List<Long> delSignOrderList = new ArrayList<>();
Long finalLoadId1 = loadId;
collect.keySet().forEach(signOrderId -> {
List<TrunklineCarsOrderEntity> list = collect.get(signOrderId);
TrunklineLoadSignOrderEntity trunklineLoadSignOrderEntity = signOrderEntityMap.get(signOrderId);
//把list中所有元素的realNum求和
int sumLoading = list.stream().mapToInt(TrunklineCarsOrderEntity::getRealNum).sum();
int sumPlan = list.stream().mapToInt(TrunklineCarsOrderEntity::getPlanNum).sum();
Integer planNum = trunklineLoadSignOrderEntity.getPlanNum();
Integer loadingNum = trunklineLoadSignOrderEntity.getLoadingNum();
Integer signNum = trunklineLoadSignOrderEntity.getSignNum();
if(sumPlan < planNum){
//只是更新不删除
TrunklineLoadSignOrderEntity updateSignOrderEntity = new TrunklineLoadSignOrderEntity();
updateSignOrderEntity.setId(trunklineLoadSignOrderEntity.getId());
int diff = planNum - sumPlan;
updateSignOrderEntity.setPlanNum(diff);
updateSignOrderEntity.setLoadingNum(loadingNum-sumLoading);
if(signNum >= diff){
updateSignOrderEntity.setSignStatus("20");
}else if(signNum == 0){
updateSignOrderEntity.setSignStatus("0");
}else{
updateSignOrderEntity.setSignStatus("10");
}
updateSignOrderList.add(updateSignOrderEntity);
}else{
//删除
delSignOrderList.add(signOrderId);
}
list.forEach(e -> {
TrunklineCarsOrderEntity carsOrderEntity = new TrunklineCarsOrderEntity();
carsOrderEntity.setId(e.getId());
carsOrderEntity.setOrderCode(e.getOrderCode());
carsOrderEntity.setWaybillNo(e.getWaybillNo());
carsOrderEntity.setLoadId(finalLoadId1);
carsOrderEntity.setNodeId(e.getNodeId());
updateCarsOrderList.add(carsOrderEntity);
});
});
if(CollUtil.isNotEmpty(updateSignOrderList)){
trunklineLoadSignOrderService.updateBatchById(updateSignOrderList);
}
if(CollUtil.isNotEmpty(delSignOrderList)){
trunklineLoadSignOrderService.deleteListBySignOrderIds(delSignOrderList);
}
if(CollUtil.isNotEmpty(updateCarsOrderList)){
//把updateCarsOrderIdList所有的id放入一个List
List<Long> updateCarsOrderIdList = updateCarsOrderList.stream().map(TrunklineCarsOrderEntity::getId).collect(Collectors.toList());
trunklineCarsOrderService.updateNoCustomer(updateCarsOrderIdList);
updateCarsOrderList.forEach(e -> {
Long nodeId = e.getNodeId();
String orderCode = e.getOrderCode();
String waybillNo = e.getWaybillNo();
trunklineCarsLoadScanService.clearSignOrderIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(finalLoadId1,nodeId,orderCode,waybillNo);
});
}
}
List<TrunklineLoadSignOrderEntity> signOrderList =trunklineLoadSignOrderService.findSignOrderListByLoadId(loadId);
String isCustomer1 = carsLoadEntity.getIsCustomer();
if(CollUtil.isNotEmpty(signOrderList)){
if("2".equals(isCustomer1)){
carsLoadEntity.setIsCustomer("1");
updateById(carsLoadEntity);
}
}else{
if("1".equals(isCustomer1)){
carsLoadEntity.setIsCustomer("2");
updateById(carsLoadEntity);
}
}
return R.success("更新成功");
}
@ -4761,12 +4963,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("##############signScanPackageCode: 签收单信息不存在 signOrderId={}", signOrderId);
throw new CustomerException(405, "签收单信息不存在");
}
Integer loadingNum = trunklineCarsOrderService.findLoadingNumBySignOrderId(signOrderId);
int loadingNum = trunklineCarsOrderService.findLoadingNumBySignOrderId(signOrderId);
Integer signNum = trunklineCarsOrderService.findSignNumBySignOrderId(signOrderId);
Integer realSignNum = trunklineCarsLoadScanService.findRealSignNumBySignOrderId(signOrderId);
int signNum = trunklineCarsOrderService.findSignNumBySignOrderId(signOrderId);
int realSignNum = trunklineCarsLoadScanService.findRealSignNumBySignOrderId(signOrderId);
signOrderEntity.setSignNum(realSignNum);
if (signNum.equals(loadingNum)) {
if (signNum >= loadingNum) {
signOrderEntity.setSignStatus("20");
signOrderEntity.setSignTime(new Date());
} else {
@ -4904,7 +5106,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Set<Long> loadIds = new HashSet<>();
//把list通过signOrderId进行分组
Map<Long, List<TrunklineCarsLoadScanVO>> map = list.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getSignOrderId));
Map<Long, List<TrunklineCarsLoadScanVO>> map = list.stream().filter(e -> !Objects.isNull(e.getSignOrderId())).collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getSignOrderId));
map.keySet().forEach(e -> {
List<TrunklineCarsLoadScanVO> trunklineCarsLoadScanVOS = map.get(e);//该签收单对应的包件
trunklineCarsLoadScanVOS.forEach(t -> {
@ -5298,10 +5500,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("90");
} else {
if (num == 1) {
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("91");
}
carsLoadEntity.setSignTime(date);
carsLoadEntity.setLoadStatus("91");
}
updateById(carsLoadEntity);

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

@ -138,4 +138,14 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl<Trunkli
return baseMapper.findLoadingNumBySignOrderId(signOrderId);
}
@Override
public void updateNoCustomer(List<Long> updateCarsOrderIdList) {
baseMapper.updateNoCustomer(updateCarsOrderIdList);
}
@Override
public List<TrunklineCarsOrderVO> findMallOrderList(List<Long> carsOrderIdList) {
return baseMapper.findMallOrderList(carsOrderIdList);
}
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineLoadSignOrderServiceImpl.java

@ -1,9 +1,9 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.mapper.TrunklineLoadSignOrderMapper;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.vo.SignOrderDetailVO;
@ -54,4 +54,16 @@ public class TrunklineLoadSignOrderServiceImpl extends BaseServiceImpl<Trunkline
public IPage<TrunklineLoadSignOrderVO> findSignOrderPageList(IPage<Object> page, LoadCarsDTO loadCarsDTO) {
return baseMapper.findSignOrderPageList(page,loadCarsDTO);
}
@Override
public void deleteListBySignOrderIds(List<Long> delSignOrderList) {
baseMapper.deleteListBySignOrderIds(delSignOrderList);
}
@Override
public List<TrunklineLoadSignOrderEntity> findSignOrderListByLoadId(Long loadId) {
QueryWrapper<TrunklineLoadSignOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId);
return baseMapper.selectList(queryWrapper);
}
}

4
blade-service/logpm-trunkline/src/main/resources/application-dev.yml

@ -12,10 +12,10 @@ server:
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.3.100
host: 192.168.2.46
port: 5672
username: admin
password: 123456
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)

4
blade-service/logpm-warehouse/src/main/resources/application-dev.yml

@ -12,10 +12,10 @@ server:
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.3.100
host: 192.168.2.46
port: 5672
username: admin
password: 123456
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)

Loading…
Cancel
Save