Browse Source

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

master
zhenghaoyu 3 months ago
parent
commit
cd4adcbb31
  1. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java
  2. 13
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java
  3. 9
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java
  4. 24
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java
  5. 1
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  6. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  8. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  9. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  10. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  11. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  13. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  14. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  16. 129
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  17. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java
  18. 2
      blade-service/logpm-factory-data/logpm-factory-data-base/src/main/java/com/logpm/factorydata/base/constant/FactoryDatabaseConstants.java
  19. 29
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PushDataJob.java
  20. 4
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/DeliveryNoteMapper.java
  21. 2
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeAllPushMapper.java
  22. 9
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeAllPushMapper.xml
  23. 12
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeOrderMapper.xml
  24. 7
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java
  25. 3
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/DeliveryNoteService.java
  26. 2
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/FactoryNodeAllPushService.java
  27. 156
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java
  28. 4
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/FactoryNodeAllPushServiceImpl.java
  29. 4
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java
  30. 20
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java
  31. 2
      blade-service/logpm-report/src/main/resources/application-prod.yml
  32. 19
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java
  33. 6
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml
  34. 12
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml
  35. 12
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java
  36. 8
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java
  37. 367
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java
  38. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java
  39. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  40. 360
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java
  41. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  42. 20
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  43. 42
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  44. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  45. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  46. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  47. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  48. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  49. 22
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java
  50. 12
      blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java

@ -50,6 +50,7 @@ public class DistributionAppStockUpClientVO implements Serializable {
private List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList;
private List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList;
private List<DistributionAppStockUpTrayDetailVO> deliveryTrayList;
private List<DistributionAppStockUpScanDetailVO> stockUpScanDetailVO;

13
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java

@ -31,10 +31,11 @@ import java.util.List;
public class DistributionAppStockUpScanDetailVO implements Serializable {
private static final long serialVersionUID = 1L;
private String trayName;
private String trayCode;
private Integer planNum;
private Integer scanNum;
private Long stockId;
private Integer type;
private String orderPackageCode;
private String typeName;
private String goodsName;
private String orderCode;
private String stockupAllocation;
}

9
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java

@ -30,12 +30,9 @@ import java.io.Serializable;
public class DistributionAppStockUpTrayDetailVO implements Serializable {
private Long orderId;
private Long packageId;
private String waybillNumber;
private String orderCode;
private String categoryName;
private String trayName;
private String trayCode;
private Integer planNum;
private String scanNum;
private Integer scanNum;
}

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

@ -75,6 +75,30 @@ public class ExpenseDispatchTrainDetailEntity extends TenantEntity {
@ApiModelProperty(value = "配送日期")
@ExcelProperty("车次号")
private String deliveryDate;
/**
* 车次完成时间
*/
@ApiModelProperty(value = "车次完成时间")
@ExcelProperty("车次完成时间")
private Date trainCompletionTime;
/**
* 车次完成时间-
*/
@ApiModelProperty(value = "车次完成时间-年")
@ExcelProperty("车次完成时间-年")
private int trainCompletionYear;
/**
* 车次完成时间-
*/
@ApiModelProperty(value = "车次完成时间-月")
@ExcelProperty("车次完成时间-月")
private int trainCompletionMonth;
/**
* 车次完成时间-
*/
@ApiModelProperty(value = "车次完成时间-日")
@ExcelProperty("车次完成时间-日")
private int trainCompletionDay;
/**
* 目的仓
*/

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

@ -140,7 +140,6 @@ public class AftersalesWorkOrderController extends BladeController {
log.error("工单查询系统异常》》》{}", e.getMessage());
return R.fail("系统异常!");
}
}
/**

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

@ -1250,9 +1250,10 @@
logpm_aftersales_processor AS lbp
WHERE
lbp.types_of != 3
AND lbp.processing_status IN ( '1', '3' )
AND lbp.processing_status = 1
AND lbp.is_deleted = 0
AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(NOW(),'%y%m%d')) &lt;= -3
AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT('2025-01-01','%y%m%d')) &lt;= -3
AND DATE_FORMAT(lbp.create_time,'%y%m%d') >= DATE_FORMAT( '2025-01-01', '%y%m%d' )
</select>
<select id="pageAllList" resultType="com.logpm.aftersales.vo.AftersalesWorkOrderVO">
SELECT DISTINCT

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

@ -275,7 +275,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
throw new ServiceException(phone + "手机号码已存在!");
}
R<User> userR = userClient.userInfoByPhone("627683", datum.getPhone());
R<User> userR = userClient.userInfoByPhone(AuthUtil.getTenantId(), datum.getPhone());
if (userR.getData() == null) {
// log.error("未找到用户");
// continue;

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

@ -1121,9 +1121,9 @@ public class DistributionStockupAppController extends BladeController {
Long reservationId = stockupDTO.getReservationId();
switch (typeService){
case "1": case "2":
return distributionStockupService.handleDeliveryPackageDetailList(reservationId,orderId);
return distributionStockupService.handleDeliveryPackageDetailList(reservationId);
case "3":
return distributionStockupService.handleBillPackageDetailList(reservationId,orderId);
return distributionStockupService.handleBillPackageDetailList(reservationId);
default:
return R.fail("未知的typeService");
}
@ -1221,19 +1221,12 @@ public class DistributionStockupAppController extends BladeController {
@ResponseBody
@PostMapping("/stockupScanDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
@ApiOperation(value = "备货扫描详情", notes = "传入stockupDTO")
public R stockupScanDetail(@RequestBody StockupDTO stockupDTO) {
String lockKey = "Lock:" + stockupDTO.getPacketBarCode() + stockupDTO.getStockupId();
String method = "#######################DistributionStockupAppController.newStockupScan";
log.info("#################stockupScan:获取redisson对象开始");
if (redis.exists(lockKey)) {
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue());
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2);
}
redis.setEx(lockKey, stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(), 5L);
//针对商市配、自提分别进行处理
if (Objects.isNull(stockupDTO.getReservationId())){
log.error(method+"参数:stockupDTO.getTypeService()缺失");
log.error(method+"参数:stockupDTO.getReservationId()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
if (Objects.isNull(stockupDTO.getStockupId())){

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

@ -72,7 +72,7 @@
WHERE
reservation_id = #{reservationId} AND parce_list_id = #{packageId}
</delete>
<select id="deliveryTrayDetailList" resultType="com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO" >
<select id="deliveryTrayDetailList" resultType="com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO" >
SELECT
t.trayName,
t.trayCode,
@ -92,7 +92,7 @@
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldrp.reservation_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldrp.reservation_id AND lds.coding = ldpl.order_package_code
AND lds.type = 1
AND lds.outbound_type != 3
AND lds.cancel_status != 1
@ -102,7 +102,7 @@
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
IFNULL( sum( ldpl.quantity ), 0 ) > 0 AND ldpl.pallet IS NOT NULL
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0

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

@ -117,10 +117,11 @@
<select id="selectScanDetail"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO">
SELECT
lds.id,
lds.id AS stockId,
lds.type AS type,
lds.coding AS orderPackageCode,
CASE lds.type
WHEN 1 THEN '制品'
WHEN 1 THEN '制品'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE

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

@ -373,7 +373,7 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @param orderId
* @return
*/
List<DistributionAppStockUpPackageDetailVO> selectDeliveryPackageDetailList(@Param("reservationId")Long reservationId,@Param("orderId") Long orderId);
List<DistributionAppStockUpPackageDetailVO> selectDeliveryPackageDetailList(@Param("reservationId")Long reservationId);
/**
* 查询自提包件列表
@ -381,7 +381,7 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @param orderId
* @return
*/
List<DistributionAppStockUpPackageDetailVO> selectBillPackageDetailList(@Param("billId")Long billId,@Param("orderId") Long orderId);
List<DistributionAppStockUpPackageDetailVO> selectBillPackageDetailList(@Param("billId")Long billId);
/**
* 查询自提备货所有包件

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

@ -1145,7 +1145,7 @@
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id AND lds.coding = ldpl.order_package_code
AND lds.type = 1
AND lds.outbound_type = 3
AND lds.cancel_status != 1
@ -1155,7 +1155,7 @@
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
IFNULL( sum( ldpl.quantity ), 0 ) > 0 AND ldpl.pallet IS NOT NULL
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0

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

@ -365,18 +365,18 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
/**
* 查询备货扫描PDA包件详情
* @param reservationId
* @param orderId
* @param
* @return
*/
R handleDeliveryPackageDetailList(Long reservationId, Long orderId);
R handleDeliveryPackageDetailList(Long reservationId);
/**
* 查询自提包件数据
* @param reservationId
* @param orderId
* @param
* @return
*/
R handleBillPackageDetailList(Long reservationId, Long orderId);
R handleBillPackageDetailList(Long reservationId);
/**

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

@ -3295,7 +3295,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(list)) {
log.error("###########################预约包件查询错误:{}", list);
log.error("###########################查询错误预约Id:{}", reservationEntity.getId());
throw new RuntimeException(reservationEntity.getId()+"订单信息错误:"+s.getId());
throw new RuntimeException(s.getOrderCode()+"订单信息错误");
}
//list 对这个集合 按照getParceListId 进行分组
Map<String, List<DistributionReservationPackageEntity>> oldPackageList = list.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getPacketBarCode));

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

@ -2030,7 +2030,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//需要修改订单的状态
DistributionStockArticleDTO stockArticleDTO = Func.copy(stockArticleEntity, DistributionStockArticleDTO.class);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(stockArticleDTO.getOrderCode(), myCurrentWarehouse.getId());
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
});
}
@ -2123,7 +2123,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//构建库存品
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity();
disStockListDetailEntity.setNum(1);
disStockListDetailEntity.setSku(distributionStockListDTO.getSku());
disStockListDetailEntity.setSku(distributionStockListDTO.getCargoNumber());
disStockListDetailEntity.setStockListId(distributionStockListDTO.getId());
disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.weizhuangche.getValue());
disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.weiqianshou.getValue());

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

@ -4643,7 +4643,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//配送零担备货
return handleDeliveryZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
case 4:
//配送零担备货
//配送托盘备货
return handleDeliveryTrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
default:
log.error(method + "未知scanType");
@ -4687,26 +4687,42 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId);
return R.fail("查询计划信息错误");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
boolean isAllStockUp = distributionParcelListEntities.stream().anyMatch(a -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(a.getOrderPackageStockupStatus()));
if (isAllStockUp) {
List<DistributionParcelListEntity> unStockUpPackageData = distributionParcelListEntities.stream().filter(f1 -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(f1.getOrderPackageStockupStatus())).collect(Collectors.toList());
if (unStockUpPackageData.isEmpty()) {
return Resp.scanFail("扫描已完成","扫描已完成");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> packageData = unStockUpPackageData.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId(),stockupEntity);
if (!stockEntityList.isEmpty()) {
// 备货作业节点
distributionStockService.saveBatch(stockEntityList);
List<Long> updatePackageIds = stockEntityList.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList());
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId,updatePackageIds)
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.yibeihu.getValue())
);
}
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId());
if (!stockEntityList.isEmpty()) {
distributionStockService.saveBatch(stockEntityList);
return Resp.scanSuccess("操作成功","");
}else {
return Resp.scanFail("订制品备货已完成","");
}
return Resp.scanSuccess("操作成功"," ");
}
private List<DistributionStockEntity> generateDeliveryTrayPackageStockEntity(DistributionReservationEntity reservationEntity,
List<DistributionParcelListEntity> packageData,
BasicdataWarehouseEntity warehouse,
BladeUser user,
Long stockUpId) {
Long stockUpId,
DistributionStockupEntity stockupEntity) {
List<DistributionStockEntity> list= new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : packageData) {
DistributionStockEntity distributionStockEntity = new DistributionStockEntity();
@ -4728,6 +4744,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distributionStockEntity.setScanUser(user.getNickName());
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue()));
list.add(distributionStockEntity);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(stockupEntity, distributionStockEntity, parcelListEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
}
return list;
}
@ -5071,7 +5091,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (parcelListEntity.getConditions() != 2) {
return Resp.scanFail("当前包件不是库存品", "当前包件不是库存品");
}
if (OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageFreezeStatus())) {
if (!OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageGroundingStatus())) {
return Resp.scanFail("当前库存品未上架", "当前库存品未上架");
}
//查询计划是否正常
@ -5660,12 +5680,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
@Override
public R handleDeliveryPackageDetailList(Long reservationId, Long orderId) {
public R handleDeliveryPackageDetailList(Long reservationId) {
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId);
if (Objects.isNull(stockUpClientVO)){
return R.fail("查询备货客户信息错误");
}
List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId,orderId);
List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId);
if (!deliveryPackageDetailList.isEmpty()) {
stockUpClientVO.setDeliveryPackageDetailList(deliveryPackageDetailList);
}
@ -5674,12 +5694,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
@Override
public R handleBillPackageDetailList(Long reservationId, Long orderId) {
public R handleBillPackageDetailList(Long reservationId) {
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId);
if (Objects.isNull(stockUpClientVO)){
return R.fail("查询备货客户信息错误");
}
List<DistributionAppStockUpPackageDetailVO> billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId,orderId);
List<DistributionAppStockUpPackageDetailVO> billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId);
if (!billPackageDetailList.isEmpty()) {
stockUpClientVO.setDeliveryPackageDetailList(billPackageDetailList);
}
@ -5827,14 +5847,15 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
//查询已扫备货的详情
List<DistributionAppStockUpScanDetailVO> stockUpScanDetailVO = distributionStockService.selectScanDetail(reservationId,stockupId);
return R.data(stockUpScanDetailVO);
if (!stockUpScanDetailVO.isEmpty()) {
stockUpClientVO.setStockUpScanDetailVO(stockUpScanDetailVO);
return R.data(stockUpClientVO);
}
return R.fail("无备货记录");
}
@Override
public R newStockupArea(StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getStockupId())){
return R.fail("StockupId()参数缺失");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return Resp.scanFail("请选择备货作业仓库","请选择备货作业仓库");
@ -5843,6 +5864,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("当前仓库无部门信息","当前仓库无部门信息");
}
Long stockupId = stockupDTO.getStockupId();
String allocationCode = stockupDTO.getAllocationCode();
DistributionStockupEntity stockupEntity = this.getById(stockupId);
if (Objects.isNull(stockupEntity)) {
return R.fail("查询备货计划错误");
@ -5862,13 +5884,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
Long deptId = myCurrentWarehouse.getDepartment();
return R.data(basicdataGoodsAreaClient.getDepartmentId(deptId));
List<BasicdataGoodsAreaVO> goodsAreaVOList = basicdataGoodsAreaClient.getDepartmentId(deptId);
BasicdataGoodsAllocationEntity entityByQrCode = basicdataGoodsAllocationClient.findEntityByQrCode(myCurrentWarehouse.getId(), allocationCode);
if (Objects.isNull(entityByQrCode)){
return Resp.scanFail("请扫描库位码","请扫描库位码");
}
List<BasicdataGoodsAreaVO> areaVOList = goodsAreaVOList.stream().filter(f -> "1".equals(f.getAreaType()) && entityByQrCode.getGoodsAreaId().equals(f.getId())).collect(Collectors.toList());
if (!areaVOList.isEmpty()) {
return Resp.scanFail("当前库位不是备货库位","当前库位不是备货库位");
}
return R.data(entityByQrCode);
}else {
return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限");
}
}
@Override
@Transactional
public R upStockUpShelf(StockupDTO stockupDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
@ -5887,7 +5919,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
boolean b = this.judgeIsPickingStaff(AuthUtil.getUser());
if (!b) {
return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限");
}else {
} else {
if (!stockupEntity.getForkliftId().equals(AuthUtil.getUserId())){
return Resp.scanFail("与任务指派拣货员不一致","与任务指派拣货员不一致");
}
@ -5917,6 +5949,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
@Override
@Transactional
public R cancelStock(StockupDTO stockupDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
@ -5926,14 +5959,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
String stockIds = stockupDTO.getStockIds();
Long stockupId = stockupDTO.getStockupId();
DistributionStockupEntity stockupEntity = this.getById(stockupId);
boolean b = this.judgeIsPickingStaff(AuthUtil.getUser());
if (!b) {
return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限");
}else {
if (!stockupEntity.getForkliftId().equals(AuthUtil.getUserId())){
return Resp.scanFail("与任务指派拣货员不一致","与任务指派拣货员不一致");
}
}
// boolean b = this.judgeIsPickingStaff(AuthUtil.getUser());
// if (!b) {
// return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限");
// }else {
// if (!stockupEntity.getForkliftId().equals(AuthUtil.getUserId())){
// return Resp.scanFail("与任务指派拣货员不一致","与任务指派拣货员不一致");
// }
// }
List<String> strList = Func.toStrList(stockIds);
List<DistributionStockEntity> distributionStockEntities = distributionStockService.listByIds(strList);
int sum = 0;
@ -5959,7 +5992,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
return R.fail("取消成功"+sum+"件");
return Resp.scanSuccess("取消成功"+sum+"件","取消成功"+sum+"件");
}
private List<DistributionAppStockUpZeroOrderDetailVO> handleStockupBillZeroOrder(DistrilbutionBillLadingEntity billLadingEntity) {
@ -6058,13 +6091,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public R handleDeliveryTrayDetailList(Long reservationId) {
return R.data(distributionReservationMapper.deliveryTrayDetailList(reservationId));
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId);
if (Objects.isNull(stockUpClientVO)){
return R.fail("查询备货客户信息错误");
}
List<DistributionAppStockUpTrayDetailVO> deliveryTrayDetailList = distributionReservationMapper.deliveryTrayDetailList(reservationId);
if (!deliveryTrayDetailList.isEmpty()) {
stockUpClientVO.setDeliveryTrayList(deliveryTrayDetailList);
}
return R.data(stockUpClientVO);
}
@Override
public R handleBillTrayDetailList(Long reservationId) {
return R.data(distrilbutionBillLadingMapper.billTrayDetailList(reservationId));
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId);
if (Objects.isNull(stockUpClientVO)){
return R.fail("查询备货客户信息错误");
}
List<DistributionAppStockUpTrayDetailVO> distributionAppStockUpTrayDetailVOS = distrilbutionBillLadingMapper.billTrayDetailList(reservationId);
if (!distributionAppStockUpTrayDetailVOS.isEmpty()) {
stockUpClientVO.setDeliveryTrayList(distributionAppStockUpTrayDetailVOS);
}
return R.data(stockUpClientVO);
}
/**
@ -6314,7 +6362,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (parcelListEntity.getConditions() != 2) {
return Resp.scanFail("当前包件不是库存品", "当前包件不是库存品");
}
if (OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageFreezeStatus())) {
if (!OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageGroundingStatus())) {
return Resp.scanFail("当前库存品未上架", "当前库存品未上架");
}
//查询计划是否正常
@ -6505,6 +6553,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistrilbutionBillPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if(packageEntityList.isEmpty()){
return Resp.scanFail("不在此备货计划中","不在此备货计划中");
}
if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复");
}
@ -6605,8 +6656,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionReservationPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!packageEntityList.isEmpty()) {
return Resp.scanFail("无此备货计划","无此备货计划");
if (packageEntityList.isEmpty()) {
return Resp.scanFail("不在此备货计划中","不在此备货计划中");
}
if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复");

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

@ -116,6 +116,10 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl<QualityDeliverMap
BigDecimal fuelCost = BigDecimal.ZERO;
trainDetailEntity.setSettlementStatus("未结算");
for (QualityDeliverEntity qualityDeliverEntity : value) {
trainDetailEntity.setTrainCompletionYear(DateUtil.year(qualityDeliverEntity.getCarComplateTime()));
trainDetailEntity.setTrainCompletionMonth(DateUtil.month(qualityDeliverEntity.getCarComplateTime()) + 1);
trainDetailEntity.setTrainCompletionDay(DateUtil.dayOfMonth(qualityDeliverEntity.getCarComplateTime()));
trainDetailEntity.setTrainCompletionTime(qualityDeliverEntity.getCarComplateTime());
trainDetailEntity.setTotalOrderQuantity(qualityDeliverEntity.getOrderNumber());
trainDetailEntity.setDeliveryVehicle(qualityDeliverEntity.getSignCarNumber());
trainDetailEntity.setDistributionModel(qualityDeliverEntity.getSignCarType());
@ -426,16 +430,16 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl<QualityDeliverMap
baseMapper.delPlanDelivery(id);
}
@Override
public void delDistributionCarStart(Long id) {
baseMapper.delDistributionCarStart(id);
}
@Override
public void delDistributionCarStart(Long id) {
baseMapper.delDistributionCarStart(id);
}
@Override
public void carExpenseDispatchDetailFinal(String trainNumber) {
if(StrUtil.isNotEmpty(trainNumber)){
if (StrUtil.isNotEmpty(trainNumber)) {
List<QualityDeliverEntity> entities = this.list(Wrappers.<QualityDeliverEntity>lambdaQuery().eq(QualityDeliverEntity::getSignTrainNumber, trainNumber));
if(CollUtil.isNotEmpty(entities)){
if (CollUtil.isNotEmpty(entities)) {
buildCarExpenseReport(entities);
}
}

2
blade-service/logpm-factory-data/logpm-factory-data-base/src/main/java/com/logpm/factorydata/base/constant/FactoryDatabaseConstants.java

@ -10,6 +10,6 @@ public class FactoryDatabaseConstants {
/**
* 工厂基地对应的始发仓 redis key
*/
public static final String FACTORY_DATA_BASE_WAREHOUSE_BIND = "factorydata:base:warehouse_bind";
public static final String FACTORY_DATA_BASE_WAREHOUSE_BIND = "factory-data:base:warehouse_bind";
}

29
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/job/PushDataJob.java

@ -45,6 +45,35 @@ public class PushDataJob {
return ReturnT.SUCCESS;
}
/**
* 补传我乐到达节点数据
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("rePushOloNodeData")
public ReturnT<String> rePushOloNodeData(String param) throws Exception {
deliveryNoteService.rePushOloNodeData();
return ReturnT.SUCCESS;
}
/**
* 补传我乐到达节点数据-指定订单 分单 回传
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("rePushOloNodeDataByCode")
public ReturnT<String> rePushOloNodeDataByCode(String param) throws Exception {
if (StrUtil.isEmpty(param)) {
return ReturnT.SUCCESS;
}
deliveryNoteService.rePushOloNodeDataByCode(param);
return ReturnT.SUCCESS;
}
/**
* 自定义回传工厂节点作业数据
*

4
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/DeliveryNoteMapper.java

@ -6,6 +6,8 @@ import com.logpm.factorydata.olo.entity.DeliveryNoteEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 发货单 mapper
*
@ -18,4 +20,6 @@ public interface DeliveryNoteMapper extends BaseMapper<DeliveryNoteEntity> {
JSONObject customPushNodeData();
void updateSustomPushNodeDataStatus(@Param("status") String status, @Param("orderNo") String orderNo, @Param("deliveryNo") String deliveryNo);
List<DeliveryNoteEntity> rePushOloNodeData(@Param("orderCode") String orderCode, @Param("shipmentCode") String shipmentCode, @Param("shipmentSpitCode") String shipmentSpitCode);
}

2
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeAllPushMapper.java

@ -13,4 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FactoryNodeAllPushMapper extends BaseMapper<FactoryNodeAllPushEntity> {
FactoryNodeAllPushEntity rePushOloNodeData();
}

9
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeAllPushMapper.xml

@ -2,4 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factorydata.olo.mapper.FactoryNodeAllPushMapper">
<select id="rePushOloNodeData" resultType="com.logpm.factorydata.olo.entity.FactoryNodeAllPushEntity">
select *
from olo_factory_node_all_push
where reserve1 != reserve2
and reserve1 is not null
and reserve2 is not null
and type_code = 1
limit 1
</select>
</mapper>

12
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mapper/FactoryNodeOrderMapper.xml

@ -23,4 +23,16 @@
and orderNo = #{orderNo}
and deliveryNo = #{deliveryNo}
</update>
<select id="rePushOloNodeData" resultType="com.logpm.factorydata.olo.entity.DeliveryNoteEntity">
select *
from olo_delivery_note
where
(flag is null or flag = 'A' or flag = '')
and shipment_type_desc != '快递'
and shipment_type_desc != '包车'
and shipment_no = #{shipmentCode}
and shipment_split_no = #{shipmentSpitCode}
and crm_so = #{orderCode}
</select>
</mapper>

7
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java

@ -33,7 +33,6 @@ 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;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
@ -203,7 +202,11 @@ public class NodeDataPushListener {
pushAllEntities.add(factoryNodeAllPushEntity);
for (Map.Entry<String, Integer> stringIntegerEntry : snMap.entrySet()) {
JSONObject jsonObject = new JSONObject();
jsonObject.set("sn", stringIntegerEntry.getKey());
String key = stringIntegerEntry.getKey();
if (StrUtil.contains(key, "补")) {
key = key.split("-")[0];
}
jsonObject.set("sn", key);
jsonObject.set("qty", stringIntegerEntry.getValue());
jsonObject.set("scanTime", entries.getStr("operatorTime"));
snArray.add(jsonObject);

3
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/DeliveryNoteService.java

@ -26,4 +26,7 @@ public interface DeliveryNoteService extends BaseService<DeliveryNoteEntity> {
**/
void customPushNodeData();
void rePushOloNodeData();
void rePushOloNodeDataByCode(String param);
}

2
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/FactoryNodeAllPushService.java

@ -11,4 +11,6 @@ import org.springblade.core.mp.base.BaseService;
**/
public interface FactoryNodeAllPushService extends BaseService<FactoryNodeAllPushEntity> {
FactoryNodeAllPushEntity rePushOloNodeData();
}

156
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java

@ -1,9 +1,11 @@
package com.logpm.factorydata.olo.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
@ -16,10 +18,12 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.olo.entity.DeliveryNoteEntity;
import com.logpm.factorydata.olo.entity.FactoryNodeAllPushEntity;
import com.logpm.factorydata.olo.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.olo.mapper.DeliveryNoteMapper;
import com.logpm.factorydata.olo.pros.OldProperties;
import com.logpm.factorydata.olo.service.DeliveryNoteService;
import com.logpm.factorydata.olo.service.FactoryNodeAllPushService;
import com.logpm.factorydata.olo.service.FactoryOrderLogService;
import com.logpm.factorydata.olo.vo.DeliveryNoteVO;
import com.logpm.factorydata.vo.SendMsg;
@ -54,8 +58,11 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 发货单 业务实现类
@ -74,6 +81,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
private final IFactoryDataBaseClient baseClient;
private final OldProperties oldProperties;
private final RabbitTemplate rabbitTemplate;
private final FactoryNodeAllPushService factoryNodeAllPushService;
@Override
public String order(List<DeliveryNoteVO> vo) {
@ -213,7 +221,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
advanceDetailEntity.setQuantity(1);
// 按老系统生成新的逻辑的包件号 OLO2312064418-20231226010129-1-001
// 标准台面全部使用新码,其他的数量大于 1 的使用新码
if (StrUtil.equals(orderPackageDTO.getType(),"标准台面") || anInt > 1) {
if (StrUtil.equals(orderPackageDTO.getType(), "标准台面") || anInt > 1) {
advanceDetailEntity.setOrderPackageCode("OLO" + orderPackageDTO.getSn() + "-" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + "-" + num + "-" + StrUtil.padPre(String.valueOf(i + 1), 3, "0"));
} else {
advanceDetailEntity.setOrderPackageCode(orderPackageDTO.getSn());
@ -292,6 +300,152 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
}
}
@Override
public void rePushOloNodeData() {
// 查出少推送的数据
FactoryNodeAllPushEntity entity = factoryNodeAllPushService.rePushOloNodeData();
if (ObjectUtil.isNotEmpty(entity)) {
String content = entity.getContent();
Date createTime = entity.getCreateTime();
JSONObject entries = JSONUtil.parseObj(content);
entries.set("snList", null);
String packageCodes = entity.getPackageCode();
String[] split = packageCodes.split(",");
Set<String> packageCodeSet = new HashSet<>();
for (String s : split) {
if (StrUtil.contains(s, "补")) {
continue;
}
packageCodeSet.add(s);
}
String orderCode = entity.getOrderCode();
String shipmentCode = entity.getShipmentCode();
String shipmentSpitCode = entity.getShipmentSpitCode();
List<DeliveryNoteEntity> list = this.baseMapper.rePushOloNodeData(orderCode, shipmentCode, shipmentSpitCode);
if (CollUtil.isNotEmpty(list)) {
List<DeliveryNoteEntity> sns = list.stream().filter(s -> !packageCodeSet.contains(s.getSn())).map(deliveryNoteEntity -> {
String sn = deliveryNoteEntity.getSn();
if (StrUtil.contains(sn, "补")) {
sn = sn.split("-")[0];
}
deliveryNoteEntity.setSn(sn);
return deliveryNoteEntity;
}).collect(Collectors.toList());
if (CollUtil.isNotEmpty(sns)) {
JSONArray snArray = new JSONArray();
for (DeliveryNoteEntity sn : sns) {
JSONObject jsonObject = new JSONObject();
jsonObject.set("sn", sn.getSn());
jsonObject.set("qty", sn.getQty());
jsonObject.set("scanTime", DateUtil.formatDateTime(createTime));
snArray.add(jsonObject);
}
entries.set("snList", snArray);
JSONArray objects = new JSONArray();
objects.add(entries);
String post = HttpUtil.post(entity.getSendUrl(), JSONUtil.toJsonStr(objects));
FactoryNodeAllPushEntity pushAllEntity = new FactoryNodeAllPushEntity();
BeanUtil.copyProperties(entity, pushAllEntity);
pushAllEntity.setId(null);
try {
JSONObject entries1 = JSONUtil.parseObj(post);
Integer code = entries1.getInt("code");
String data = entries1.getStr("data");
// 成功
Integer successCode = code;
String message = data;
if (NumberUtil.equals(code, 200)) {
if (StrUtil.isNotEmpty(data)) {
JSONObject jsonObject = JSONUtil.parseObj(data);
Integer code1 = jsonObject.getInt("code");
successCode = code1;
}
}
pushAllEntity.setPackageCode(sns.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
pushAllEntity.setSendStatus(successCode + "");
pushAllEntity.setContent(JSONUtil.toJsonStr(entries));
pushAllEntity.setResultContent(message);
pushAllEntity.setReserve1(Convert.toStr(sns.size()));
pushAllEntity.setReserve2(Convert.toStr(sns.size()));
factoryNodeAllPushService.save(pushAllEntity);
} catch (Exception e) {
log.error("解析返回值失败");
}
}
}
entity.setReserve1(entity.getReserve2());
factoryNodeAllPushService.updateById(entity);
}
}
@Override
public void rePushOloNodeDataByCode(String param) {
JSONObject entries = JSONUtil.parseObj(param);
String orderCode = entries.getStr("orderNo");
String shipmentCode = entries.getStr("shipmentNo");
String shipmentSpitCode = entries.getStr("shipmentSplitNo");
List<DeliveryNoteEntity> list = this.baseMapper.rePushOloNodeData(orderCode, shipmentCode, shipmentSpitCode);
if (CollUtil.isNotEmpty(list)) {
List<DeliveryNoteEntity> sns = list.stream().map(deliveryNoteEntity -> {
String sn = deliveryNoteEntity.getSn();
if (StrUtil.contains(sn, "补")) {
sn = sn.split("-")[0];
}
deliveryNoteEntity.setSn(sn);
return deliveryNoteEntity;
}).collect(Collectors.toList());
if (CollUtil.isNotEmpty(sns)) {
JSONArray snArray = new JSONArray();
for (DeliveryNoteEntity sn : sns) {
JSONObject jsonObject = new JSONObject();
jsonObject.set("sn", sn.getSn());
jsonObject.set("qty", sn.getQty());
jsonObject.set("scanTime", DateUtil.formatDateTime(new Date()));
snArray.add(jsonObject);
}
entries.set("snList", snArray);
JSONArray objects = new JSONArray();
objects.add(entries);
String post = HttpUtil.post(oldProperties.getPushNodeUrl(), JSONUtil.toJsonStr(objects));
FactoryNodeAllPushEntity pushAllEntity = new FactoryNodeAllPushEntity();
pushAllEntity.setWarehouse(entries.getStr("nodeName"));
pushAllEntity.setWorkBatch(orderCode);
pushAllEntity.setSendUrl(oldProperties.getPushNodeUrl());
pushAllEntity.setOrderCode(orderCode);
pushAllEntity.setShipmentCode(shipmentCode);
pushAllEntity.setShipmentSpitCode(shipmentSpitCode);
pushAllEntity.setType(entries.getStr("content"));
pushAllEntity.setWaybillCode(entries.getStr("deliveryNo"));
pushAllEntity.setTypeCode(entries.getInt("siteLevel"));
try {
JSONObject entries1 = JSONUtil.parseObj(post);
Integer code = entries1.getInt("code");
String data = entries1.getStr("data");
// 成功
Integer successCode = code;
String message = data;
if (NumberUtil.equals(code, 200)) {
if (StrUtil.isNotEmpty(data)) {
JSONObject jsonObject = JSONUtil.parseObj(data);
Integer code1 = jsonObject.getInt("code");
successCode = code1;
}
}
pushAllEntity.setPackageCode(sns.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
pushAllEntity.setSendStatus(successCode + "");
pushAllEntity.setContent(JSONUtil.toJsonStr(entries));
pushAllEntity.setResultContent(message);
pushAllEntity.setReserve1(Convert.toStr(sns.size()));
pushAllEntity.setReserve2(Convert.toStr(sns.size()));
factoryNodeAllPushService.save(pushAllEntity);
} catch (Exception e) {
log.error("解析返回值失败");
}
}
}
}
private String uploadFile(String body) {
// 文本内容和保存为本地文件 并上传
String logPath = FileLogsUtil.saveFileLogs(body);

4
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/FactoryNodeAllPushServiceImpl.java

@ -19,4 +19,8 @@ import org.springframework.stereotype.Service;
@AllArgsConstructor
public class FactoryNodeAllPushServiceImpl extends BaseServiceImpl<FactoryNodeAllPushMapper, FactoryNodeAllPushEntity> implements FactoryNodeAllPushService {
@Override
public FactoryNodeAllPushEntity rePushOloNodeData() {
return this.baseMapper.rePushOloNodeData();
}
}

4
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java

@ -38,10 +38,10 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, suoFeiYaProperties, deliveryNoteService))
.addPathPatterns("/order/v1").order(2);
.addPathPatterns("/order/v1").order(3);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, suoFeiYaProperties, deliveryNoteService))
.addPathPatterns("/**")
.excludePathPatterns("/order/v1")
.order(3);
.order(2);
}
}

20
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java

@ -8,9 +8,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@ -22,32 +20,32 @@ public class ReportIncomingController extends BladeController {
private final IReportIncomingService reportIncomingService;
@GetMapping("/deptIncomingPage")
@PostMapping("/deptIncomingPage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "营业部收入报表", notes = "营业部收入报表")
public R deptIncomingPage(ReportIncomingDTO reportIncomingDTO) {
public R deptIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) {
return reportIncomingService.deptIncomingPage(reportIncomingDTO);
}
@GetMapping("/deptIncomingExport")
@PostMapping("/deptIncomingExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "营业部收入报表导出", notes = "营业部收入报表导出")
public void deptIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
public void deptIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
reportIncomingService.deptIncomingExport(reportIncomingDTO,response);
}
@GetMapping("/consigineeIncomingPage")
@PostMapping("/consigineeIncomingPage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "收货单位收入报表", notes = "收货单位收入报表")
public R consigineeIncomingPage(ReportIncomingDTO reportIncomingDTO) {
public R consigineeIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) {
return reportIncomingService.consigineeIncomingPage(reportIncomingDTO);
}
@GetMapping("/consigineeIncomingExport")
@PostMapping("/consigineeIncomingExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "收货单位收入报表导出", notes = "收货单位收入报表导出")
public void consigineeIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
public void consigineeIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
reportIncomingService.consigineeIncomingExport(reportIncomingDTO,response);
}

2
blade-service/logpm-report/src/main/resources/application-prod.yml

@ -22,6 +22,8 @@ spring:
proxy-filters:
- sqlLogInterceptor
query-timeout: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#设置默认的数据源或者数据源组,默认值即为master
primary: master
datasource:

19
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java

@ -5,7 +5,8 @@ import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.statistics.entity.*;
import com.logpm.statistics.service.*;
@ -14,7 +15,6 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -30,7 +30,6 @@ 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;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
@ -52,6 +51,7 @@ public class WaybillCheckListener {
private final IStatisticsDistributionPackageService distributionPackageService;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
private final IDistributionParcelListClient distributionParcelListClient;
private final IBasicdataClientClient basicdataClientClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA),
@ -200,6 +200,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -482,6 +486,10 @@ public class WaybillCheckListener {
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
Integer serviceType = waybillEntity.getServiceType();
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(basicdataClient)){
serviceType=basicdataClient.getTypeService();
}
String payWay = waybillEntity.getPayWay();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
@ -491,6 +499,8 @@ public class WaybillCheckListener {
Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot();
Date signTime = waybillEntity.getSignTime();
//单价计算
// BigDecimal pickupFee = Objects.isNull(waybillEntity.getPickupFee())?BigDecimal.ZERO:waybillEntity.getPickupFee();
BigDecimal warehouseManagementFee = Objects.isNull(waybillEntity.getWarehouseManagementFee()) ? BigDecimal.ZERO : waybillEntity.getWarehouseManagementFee();
@ -546,6 +556,7 @@ public class WaybillCheckListener {
//保存订单信息
List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>();
Integer finalServiceType = serviceType;
advanceEntities.forEach(advanceEntity -> {
StatisticsOrderInfoEntity orderInfoEntity = new StatisticsOrderInfoEntity();
orderInfoEntity.setOrderCode(advanceEntity.getOrderCode());
@ -555,7 +566,7 @@ public class WaybillCheckListener {
orderInfoEntity.setBrand(brand);
orderInfoEntity.setConsigneeId(consigneeId);
orderInfoEntity.setConsignee(consignee);
orderInfoEntity.setTypeService(serviceType);
orderInfoEntity.setTypeService(finalServiceType);
orderInfoEntity.setSignDate(signTime);
orderInfoEntity.setSignStatus(0);
orderInfoEntity.setSyncFeeStatus(0);

6
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml

@ -37,6 +37,12 @@
<if test="expenseDispatchTrainDetail.deliveryDateEnd != null and expenseDispatchTrainDetail.deliveryDateEnd != ''">
and delivery_date &lt;= #{expenseDispatchTrainDetail.deliveryDateEnd}
</if>
<if test="expenseDispatchTrainDetail.trainCompletionTimeStart != null and expenseDispatchTrainDetail.trainCompletionTimeStart != ''">
and train_completion_time >= #{expenseDispatchTrainDetail.trainCompletionTimeStart}
</if>
<if test="expenseDispatchTrainDetail.trainCompletionTimeEnd != null and expenseDispatchTrainDetail.trainCompletionTimeEnd != ''">
and train_completion_time &lt;= #{expenseDispatchTrainDetail.trainCompletionTimeEnd}
</if>
<if test="expenseDispatchTrainDetail.distributionType != null and expenseDispatchTrainDetail.distributionType != ''">
and distribution_type = #{expenseDispatchTrainDetail.distributionType}
</if>

12
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml

@ -32,9 +32,9 @@
<select id="expenseDispatchDetailMonthJob" resultType="com.logpm.statistics.entity.ExpenseDispatchWarehouseMonthEntity">
select t.destination_warehouse destinationWarehouse,
t.settlement_month settlementMonth,
t.settlement_year settlementYear,
concat(t.settlement_year,'年',t.settlement_month,'月') settlementTime,
t.train_completion_month settlementMonth,
t.train_completion_year settlementYear,
concat(t.train_completion_year,'年',t.train_completion_month,'月') settlementTime,
count(*) totalTrainService,
sum(t.planned_total_quantity) plannedTotalQuantity,
sum(t.inventory_item_count) inventoryItemCount,
@ -57,9 +57,9 @@
sum(t.change_amount) changeAmount,
sum(t.settlement_amount) settlementAmount
from logpm_expense_dispatch_train_detail t
where t.settlement_year = #{year}
and t.settlement_month = #{month}
group by t.settlement_month,t.settlement_year,t.destination_warehouse
where t.train_completion_year = #{year}
and t.train_completion_month = #{month}
group by t.train_completion_month,t.train_completion_year,t.destination_warehouse
</select>

12
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java

@ -5,6 +5,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.Query;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
public class ExpenseDispatchTrainDetailQuery extends Query {
@ -18,6 +20,16 @@ public class ExpenseDispatchTrainDetailQuery extends Query {
*/
@ApiModelProperty(value = "配送日期结束")
private String deliveryDateEnd;
/**
* 车次完成时间开始
*/
@ApiModelProperty(value = "车次完成时间开始")
private Date trainCompletionTimeStart;
/**
* 车次完成时间结束
*/
@ApiModelProperty(value = "车次完成时间结束")
private Date trainCompletionTimeEnd;
/**
* 配送司机
*/

8
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java

@ -64,8 +64,14 @@ public class ExpenseDispatchTrainDetailVO {
* 配送日期
*/
@ApiModelProperty(value = "配送日期")
@ExcelProperty("车次号")
@ExcelProperty("配送日期")
private String deliveryDate;
/**
* 车次完成时间
*/
@ApiModelProperty(value = "车次完成时间")
@ExcelProperty("车次完成时间")
private String trainCompletionTime;
/**
* 目的仓
*/

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

@ -1,39 +1,20 @@
package com.logpm.trunkline.mq;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineDetailProductService;
import com.logpm.trunkline.service.IAdvanceOrderMqService;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.io.IOException;
/**
* 监听工厂数据转暂存单
@ -46,142 +27,26 @@ import java.util.*;
@AllArgsConstructor
public class AdvanceOrderListener {
private final ITrunklineAdvanceService advanceService;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineDetailProductService detailProductService;
private final ITrunklineCarsLoadService trunklineCarsLoadService;
private final IDistributionStockArticleClient stockArticleClient;
private final IDistributionParcelListClient parcelListClient;
private final IAdvanceOrderMqService advanceOrderMqService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER
))
@Transactional(rollbackFor = Exception.class)
public void advanceOrder(String msg) {
), ackMode = "MANUAL")
public void advanceOrder(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
// 新增暂存单
if (StrUtil.isNotBlank(msg)) {
log.info("收到工厂数据暂存单消息:{}", msg);
JSONObject entries = JSONUtil.parseObj(msg);
JSONArray details = entries.getJSONArray("details");
TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class);
LambdaQueryWrapper<TrunklineAdvanceEntity> eq = Wrappers.<TrunklineAdvanceEntity>lambdaQuery()
.eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode());
if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) {
eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber());
}
// 暂存单 订单自编号 + 车次号 唯一
List<TrunklineAdvanceEntity> advanceEntities = advanceService.list(eq);
// 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上
// 如果已开单则新增暂存单
if (CollUtil.isNotEmpty(advanceEntities) && ObjectUtil.equal(advanceEntity.getWaybillStatus(), "0")) {
TrunklineAdvanceEntity entity = advanceEntities.get(0);
if (ObjectUtil.isNotEmpty(entity)) {
advanceEntity.setId(entity.getId());
// advanceEntity.setTotalNum(entity.getTotalNum() + advanceEntity.getTotalNum());
}
}
Set<String> packageCodeSet = new HashSet<>();
if (CollUtil.isNotEmpty(details)) {
// 使用HashSet代替ArrayList以优化内存使用和检查重复值
Set<String> orderPackageCodes = new HashSet<>();
details.forEach(detail -> {
try {
// 更具描述性的变量命名
JSONObject jsonObject = JSONUtil.parseObj(detail);
TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class);
// 检查转换后的实体不为null,且其orderPackageCode非null
if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) {
orderPackageCodes.add(entity.getOrderPackageCode());
}
} catch (Exception e) {
// 异常处理,可根据实际情况记录日志或进行其他处理
log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage());
}
});
// 查询数据库,校验订单包件编码是否重复
if (CollUtil.isNotEmpty(orderPackageCodes)) {
Map<String, String> packageCodeByCodes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes);
if (CollUtil.isNotEmpty(packageCodeByCodes)) {
packageCodeSet.addAll(packageCodeByCodes.keySet());
}
}
}
if (ObjectUtil.isNotNull(advanceEntity)) {
String orderCode = advanceEntity.getOrderCode();
if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) {
advanceEntity.setLegacyStatus("1");
}
// 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加
if (ObjectUtil.isEmpty(advanceEntity.getId())) {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
} else {
advanceService.updateById(advanceEntity);
}
}
if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = new ArrayList<>();
List<TrunklineDetailProductEntity> detailProductEntityList = new ArrayList<>();
for (Object detailObj : details) {
JSONObject detail = JSONUtil.parseObj(detailObj);
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) {
// 金牌如果是重复包条,则单独处理
if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) {
// 金牌按DD单号+包条确定唯一值
List<TrunklineAdvanceDetailEntity> list = advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>lambdaQuery()
.eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode())
.eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode())
);
if (CollUtil.isNotEmpty(list)) {
// 订单+包件重复则不处理这条数据
log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode());
continue;
} else {
// 包件码重复,订单+包件不重复,设置预留字段1 为 1
advanceDetailEntity.setReserve1("1");
}
} else {
log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode());
continue;
}
}
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间
if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) {
advanceDetailEntity.setSendDateStr(DateUtil.today());
}
advanceDetailEntityList.add(advanceDetailEntity);
JSONArray items = detail.getJSONArray("items");
if (CollUtil.isNotEmpty(items)) {
for (Object itemObj : items) {
JSONObject item = JSONUtil.parseObj(itemObj);
TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class);
if (ObjectUtil.isNotNull(detailProductEntity)) {
detailProductEntityList.add(detailProductEntity);
}
}
}
}
}
advanceDetailService.saveBatch(advanceDetailEntityList);
//发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
detailProductService.saveBatch(detailProductEntityList);
//发送报表数据广播
Long warehouseId = advanceEntity.getWarehouseId();
String warehouseName = advanceEntity.getWarehouseName();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntityList,dealerCode,dealerName);
}
log.info("收到工厂数据暂存单消息:{}", msg);
try {
advanceOrderMqService.advanceOrder(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("收到工厂数据暂存单消息失败: {}", e.getMessage());
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@ -189,188 +54,20 @@ public class AdvanceOrderListener {
value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_OUPAI),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER_OUPAI, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER
))
@Transactional(rollbackFor = Exception.class)
public void advanceOrderOuPai(String msg) {
), ackMode = "MANUAL")
public void advanceOrderOuPai(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
// 新增暂存单
if (StrUtil.isNotBlank(msg)) {
log.info("收到欧派工厂数据暂存单消息:{}", msg);
JSONObject entries = JSONUtil.parseObj(msg);
JSONArray details = entries.getJSONArray("details");
TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class);
LambdaQueryWrapper<TrunklineAdvanceEntity> eq = Wrappers.<TrunklineAdvanceEntity>lambdaQuery()
.eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode());
if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) {
eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber());
}
// 暂存单 订单自编号 + 车次号 唯一
List<TrunklineAdvanceEntity> advanceEntities = advanceService.list(eq);
// 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上
// 如果已开单则新增暂存单
// 订单 修改最终客户信息
if (CollUtil.isNotEmpty(advanceEntities)) {
TrunklineAdvanceEntity entity = advanceEntities.get(0);
if (ObjectUtil.isNotEmpty(entity)) {
// 如果存在则只修改客户信息
if (StrUtil.isNotEmpty(advanceEntity.getCustomerName())) {
entity.setCustomerName(advanceEntity.getCustomerName());
}
if (StrUtil.isNotEmpty(advanceEntity.getCustomerAddress())) {
entity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
if (StrUtil.isNotEmpty(advanceEntity.getCustomerPhone())) {
entity.setCustomerPhone(advanceEntity.getCustomerPhone());
}
advanceService.updateById(entity);
// 修改在库订单信息 未预约的数据 reservation_status = 10 才更新
if (ObjectUtil.isAllNotEmpty(entity.getOrderCode(), advanceEntity.getCustomerName(), advanceEntity.getCustomerAddress(), advanceEntity.getCustomerPhone())) {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.set("orderCode", entity.getOrderCode());
jsonObject.set("customerName", advanceEntity.getCustomerName());
jsonObject.set("customerAddress", advanceEntity.getCustomerAddress());
jsonObject.set("customerPhone", advanceEntity.getCustomerPhone());
stockArticleClient.updateCustomerAllByOrderCode(JSONUtil.toJsonStr(jsonObject));
} catch (Exception e) {
log.error("更新在库订单失败");
}
}
}
}
if (ObjectUtil.isNotNull(advanceEntity)) {
String orderCode = advanceEntity.getOrderCode();
if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) {
advanceEntity.setLegacyStatus("1");
}
// 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加
if (ObjectUtil.isEmpty(advanceEntity.getId())) {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
}
}
Map<String, String> packageCodeMap = new HashMap<>();
Map<String, Set<String>> parcelListMap = new HashMap<>();
if (CollUtil.isNotEmpty(details)) {
// 使用HashSet代替ArrayList以优化内存使用和检查重复值
Set<String> orderPackageCodes = new HashSet<>();
details.forEach(detail -> {
try {
// 更具描述性的变量命名
JSONObject jsonObject = JSONUtil.parseObj(detail);
TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class);
// 检查转换后的实体不为null,且其orderPackageCode非null
if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) {
orderPackageCodes.add(entity.getOrderPackageCode());
}
} catch (Exception e) {
// 异常处理,可根据实际情况记录日志或进行其他处理
log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage());
}
});
// 查询数据库,校验订单包件编码是否重复
if (CollUtil.isNotEmpty(orderPackageCodes)) {
packageCodeMap = advanceDetailService.findPackageCodeByCodes(orderPackageCodes);
try {
if(CollUtil.isNotEmpty(packageCodeMap)){
parcelListMap = parcelListClient.findPackageCodeByCodes(packageCodeMap.keySet());
}
}catch (Exception e){
log.error("查询包件表失败");
}
}
}
// 包件 修改 品类信息 物料名称
if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = new ArrayList<>();
List<TrunklineDetailProductEntity> detailProductEntityList = new ArrayList<>();
Set<String> productCodes = new HashSet<>();
for (Object detailObj : details) {
JSONObject detail = JSONUtil.parseObj(detailObj);
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeMap) && StrUtil.isNotEmpty(advanceDetailEntity.getOrderPackageCode())
&& packageCodeMap.containsKey(advanceDetailEntity.getOrderPackageCode())) {
if(!ObjectUtil.isAllEmpty(advanceDetailEntity.getFirstPackName(),advanceDetailEntity.getSecondPackName(),
advanceDetailEntity.getThirdPackName(),advanceDetailEntity.getMaterialName())){
TrunklineAdvanceDetailEntity updatedetailEntity = new TrunklineAdvanceDetailEntity();
updatedetailEntity.setId(Convert.toLong(packageCodeMap.get(advanceDetailEntity.getOrderPackageCode())));
updatedetailEntity.setFirstPackName(advanceDetailEntity.getFirstPackName());
updatedetailEntity.setFirstPackCode(advanceDetailEntity.getFirstPackCode());
updatedetailEntity.setSecondPackName(advanceDetailEntity.getSecondPackName());
updatedetailEntity.setSecondPackCode(advanceDetailEntity.getSecondPackCode());
updatedetailEntity.setThirdPackName(advanceDetailEntity.getThirdPackName());
updatedetailEntity.setThirdPackCode(advanceDetailEntity.getThirdPackCode());
updatedetailEntity.setMaterialName(advanceDetailEntity.getMaterialName());
updatedetailEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
advanceDetailEntityList.add(updatedetailEntity);
}
if(CollUtil.isNotEmpty(parcelListMap) && parcelListMap.containsKey(advanceDetailEntity.getOrderPackageCode())){
Set<String> strings = parcelListMap.get(advanceDetailEntity.getOrderPackageCode());
for (String string : strings) {
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
parcelListEntity.setId(Convert.toLong(string));
parcelListEntity.setFirsts(advanceDetailEntity.getFirstPackName());
parcelListEntity.setSecond(advanceDetailEntity.getSecondPackName());
parcelListEntity.setThirdProduct(advanceDetailEntity.getThirdPackName());
parcelListEntity.setMaterialName(advanceDetailEntity.getMaterialName());
parcelListEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
parcelListEntityList.add(parcelListEntity);
}
}
} else {
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间
if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) {
advanceDetailEntity.setSendDateStr(DateUtil.today());
}
advanceDetailEntityList.add(advanceDetailEntity);
}
JSONArray items = detail.getJSONArray("items");
if (CollUtil.isNotEmpty(items)) {
for (Object itemObj : items) {
JSONObject item = JSONUtil.parseObj(itemObj);
TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class);
if (ObjectUtil.isNotNull(detailProductEntity)) {
productCodes.add(detailProductEntity.getProductCode());
detailProductEntityList.add(detailProductEntity);
}
}
}
}
}
if(CollUtil.isNotEmpty(parcelListEntityList)){
parcelListClient.saveorUpdateBatchByOP(parcelListEntityList);
}
if(CollUtil.isNotEmpty(advanceDetailEntityList)){
advanceDetailService.saveOrUpdateBatch(advanceDetailEntityList);
}
//发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
if(CollUtil.isNotEmpty(detailProductEntityList)){
if(ObjectUtil.isAllNotEmpty(packageCodeMap,productCodes)){
List<TrunklineDetailProductEntity> list = detailProductService.list(Wrappers.<TrunklineDetailProductEntity>lambdaQuery()
.in(TrunklineDetailProductEntity::getUnitNo, packageCodeMap.keySet())
.in(TrunklineDetailProductEntity::getProductCode, productCodes)
);
if(CollUtil.isNotEmpty(list)){
for (TrunklineDetailProductEntity productEntity : detailProductEntityList) {
for (TrunklineDetailProductEntity detailProductEntity : list) {
if(ObjectUtil.equal(productEntity.getProductCode(),detailProductEntity.getProductCode())){
productEntity.setId(detailProductEntity.getId());
}
}
}
}
}
detailProductService.saveOrUpdateBatch(detailProductEntityList);
}
}
log.info("收到欧派工厂数据暂存单消息:{}", msg);
try {
advanceOrderMqService.advanceOrderOuPai(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("收到欧派工厂数据暂存单消息失败: {}", e.getMessage());
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java

@ -0,0 +1,8 @@
package com.logpm.trunkline.service;
public interface IAdvanceOrderMqService {
void advanceOrder(String msg);
void advanceOrderOuPai(String msg);
}

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

@ -53,4 +53,5 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
void clearWaybillInfoByWaybillNo(String waybillNo);
Integer findTotalNumByWaybillNoAndOrderCode(String waybillNo, String orderCode);
}

360
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java

@ -0,0 +1,360 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import com.logpm.trunkline.service.IAdvanceOrderMqService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineDetailProductService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service
@Slf4j
@AllArgsConstructor
public class AdvanceOrderMqServiceImpl implements IAdvanceOrderMqService {
private final ITrunklineAdvanceService advanceService;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineDetailProductService detailProductService;
private final ITrunklineCarsLoadService trunklineCarsLoadService;
private final IDistributionStockArticleClient stockArticleClient;
private final IDistributionParcelListClient parcelListClient;
@Override
@Transactional(rollbackFor = Exception.class)
public void advanceOrder(String msg) {
if (StrUtil.isNotBlank(msg)) {
JSONObject entries = JSONUtil.parseObj(msg);
JSONArray details = entries.getJSONArray("details");
TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class);
LambdaQueryWrapper<TrunklineAdvanceEntity> eq = Wrappers.<TrunklineAdvanceEntity>lambdaQuery()
.eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode());
if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) {
eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber());
}
// 暂存单 订单自编号 + 车次号 唯一
List<TrunklineAdvanceEntity> advanceEntities = advanceService.list(eq);
// 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上
// 如果已开单则新增暂存单
if (CollUtil.isNotEmpty(advanceEntities) && ObjectUtil.equal(advanceEntity.getWaybillStatus(), "0")) {
TrunklineAdvanceEntity entity = advanceEntities.get(0);
if (ObjectUtil.isNotEmpty(entity)) {
advanceEntity.setId(entity.getId());
// advanceEntity.setTotalNum(entity.getTotalNum() + advanceEntity.getTotalNum());
}
}
Set<String> packageCodeSet = new HashSet<>();
if (CollUtil.isNotEmpty(details)) {
// 使用HashSet代替ArrayList以优化内存使用和检查重复值
Set<String> orderPackageCodes = new HashSet<>();
details.forEach(detail -> {
try {
// 更具描述性的变量命名
JSONObject jsonObject = JSONUtil.parseObj(detail);
TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class);
// 检查转换后的实体不为null,且其orderPackageCode非null
if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) {
orderPackageCodes.add(entity.getOrderPackageCode());
}
} catch (Exception e) {
// 异常处理,可根据实际情况记录日志或进行其他处理
log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage());
}
});
// 查询数据库,校验订单包件编码是否重复
if (CollUtil.isNotEmpty(orderPackageCodes)) {
Map<String, String> packageCodeByCodes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes);
if (CollUtil.isNotEmpty(packageCodeByCodes)) {
packageCodeSet.addAll(packageCodeByCodes.keySet());
}
}
}
if (ObjectUtil.isNotNull(advanceEntity)) {
String orderCode = advanceEntity.getOrderCode();
if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) {
advanceEntity.setLegacyStatus("1");
}
// 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加
if (ObjectUtil.isEmpty(advanceEntity.getId())) {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
} else {
advanceService.updateById(advanceEntity);
}
}
if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = new ArrayList<>();
List<TrunklineDetailProductEntity> detailProductEntityList = new ArrayList<>();
for (Object detailObj : details) {
JSONObject detail = JSONUtil.parseObj(detailObj);
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) {
// 金牌如果是重复包条,则单独处理
if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) {
// 金牌按DD单号+包条确定唯一值
List<TrunklineAdvanceDetailEntity> list = advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>lambdaQuery()
.eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode())
.eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode())
);
if (CollUtil.isNotEmpty(list)) {
// 订单+包件重复则不处理这条数据
log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode());
continue;
} else {
// 包件码重复,订单+包件不重复,设置预留字段1 为 1
advanceDetailEntity.setReserve1("1");
}
} else {
log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode());
continue;
}
}
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间
if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) {
advanceDetailEntity.setSendDateStr(DateUtil.today());
}
advanceDetailEntityList.add(advanceDetailEntity);
JSONArray items = detail.getJSONArray("items");
if (CollUtil.isNotEmpty(items)) {
for (Object itemObj : items) {
JSONObject item = JSONUtil.parseObj(itemObj);
TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class);
if (ObjectUtil.isNotNull(detailProductEntity)) {
detailProductEntityList.add(detailProductEntity);
}
}
}
}
}
advanceDetailService.saveBatch(advanceDetailEntityList);
// 发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
detailProductService.saveBatch(detailProductEntityList);
// 发送报表数据广播
Long warehouseId = advanceEntity.getWarehouseId();
String warehouseName = advanceEntity.getWarehouseName();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, new Date(), advanceDetailEntityList, dealerCode, dealerName);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void advanceOrderOuPai(String msg) {
if (StrUtil.isNotBlank(msg)) {
JSONObject entries = JSONUtil.parseObj(msg);
JSONArray details = entries.getJSONArray("details");
TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class);
LambdaQueryWrapper<TrunklineAdvanceEntity> eq = Wrappers.<TrunklineAdvanceEntity>lambdaQuery()
.eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode());
if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) {
eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber());
}
// 暂存单 订单自编号 + 车次号 唯一
List<TrunklineAdvanceEntity> advanceEntities = advanceService.list(eq);
// 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上
// 如果已开单则新增暂存单
// 订单 修改最终客户信息
if (CollUtil.isNotEmpty(advanceEntities)) {
TrunklineAdvanceEntity entity = advanceEntities.get(0);
if (ObjectUtil.isNotEmpty(entity)) {
// 如果存在则只修改客户信息
if (StrUtil.isNotEmpty(advanceEntity.getCustomerName())) {
entity.setCustomerName(advanceEntity.getCustomerName());
}
if (StrUtil.isNotEmpty(advanceEntity.getCustomerAddress())) {
entity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
if (StrUtil.isNotEmpty(advanceEntity.getCustomerPhone())) {
entity.setCustomerPhone(advanceEntity.getCustomerPhone());
}
advanceService.updateById(entity);
// 修改在库订单信息 未预约的数据 reservation_status = 10 才更新
if (ObjectUtil.isAllNotEmpty(entity.getOrderCode(), advanceEntity.getCustomerName(), advanceEntity.getCustomerAddress(), advanceEntity.getCustomerPhone())) {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.set("orderCode", entity.getOrderCode());
jsonObject.set("customerName", advanceEntity.getCustomerName());
jsonObject.set("customerAddress", advanceEntity.getCustomerAddress());
jsonObject.set("customerPhone", advanceEntity.getCustomerPhone());
stockArticleClient.updateCustomerAllByOrderCode(JSONUtil.toJsonStr(jsonObject));
} catch (Exception e) {
log.error("更新在库订单失败");
}
}
}
}
if (ObjectUtil.isNotNull(advanceEntity)) {
String orderCode = advanceEntity.getOrderCode();
if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) {
advanceEntity.setLegacyStatus("1");
}
// 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加
if (ObjectUtil.isEmpty(advanceEntity.getId())) {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
}
}
Map<String, String> packageCodeMap = new HashMap<>();
Map<String, Set<String>> parcelListMap = new HashMap<>();
if (CollUtil.isNotEmpty(details)) {
// 使用HashSet代替ArrayList以优化内存使用和检查重复值
Set<String> orderPackageCodes = new HashSet<>();
details.forEach(detail -> {
try {
// 更具描述性的变量命名
JSONObject jsonObject = JSONUtil.parseObj(detail);
TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class);
// 检查转换后的实体不为null,且其orderPackageCode非null
if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) {
orderPackageCodes.add(entity.getOrderPackageCode());
}
} catch (Exception e) {
// 异常处理,可根据实际情况记录日志或进行其他处理
log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage());
}
});
// 查询数据库,校验订单包件编码是否重复
if (CollUtil.isNotEmpty(orderPackageCodes)) {
packageCodeMap = advanceDetailService.findPackageCodeByCodes(orderPackageCodes);
try {
if (CollUtil.isNotEmpty(packageCodeMap)) {
parcelListMap = parcelListClient.findPackageCodeByCodes(packageCodeMap.keySet());
}
} catch (Exception e) {
log.error("查询包件表失败");
}
}
}
// 包件 修改 品类信息 物料名称
if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = new ArrayList<>();
List<TrunklineDetailProductEntity> detailProductEntityList = new ArrayList<>();
Set<String> productCodes = new HashSet<>();
for (Object detailObj : details) {
JSONObject detail = JSONUtil.parseObj(detailObj);
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeMap) && StrUtil.isNotEmpty(advanceDetailEntity.getOrderPackageCode())
&& packageCodeMap.containsKey(advanceDetailEntity.getOrderPackageCode())) {
if (!ObjectUtil.isAllEmpty(advanceDetailEntity.getFirstPackName(), advanceDetailEntity.getSecondPackName(),
advanceDetailEntity.getThirdPackName(), advanceDetailEntity.getMaterialName())) {
TrunklineAdvanceDetailEntity updatedetailEntity = new TrunklineAdvanceDetailEntity();
updatedetailEntity.setId(Convert.toLong(packageCodeMap.get(advanceDetailEntity.getOrderPackageCode())));
updatedetailEntity.setFirstPackName(advanceDetailEntity.getFirstPackName());
updatedetailEntity.setFirstPackCode(advanceDetailEntity.getFirstPackCode());
updatedetailEntity.setSecondPackName(advanceDetailEntity.getSecondPackName());
updatedetailEntity.setSecondPackCode(advanceDetailEntity.getSecondPackCode());
updatedetailEntity.setThirdPackName(advanceDetailEntity.getThirdPackName());
updatedetailEntity.setThirdPackCode(advanceDetailEntity.getThirdPackCode());
updatedetailEntity.setMaterialName(advanceDetailEntity.getMaterialName());
updatedetailEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
advanceDetailEntityList.add(updatedetailEntity);
}
if (CollUtil.isNotEmpty(parcelListMap) && parcelListMap.containsKey(advanceDetailEntity.getOrderPackageCode())) {
Set<String> strings = parcelListMap.get(advanceDetailEntity.getOrderPackageCode());
for (String string : strings) {
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
parcelListEntity.setId(Convert.toLong(string));
parcelListEntity.setFirsts(advanceDetailEntity.getFirstPackName());
parcelListEntity.setSecond(advanceDetailEntity.getSecondPackName());
parcelListEntity.setThirdProduct(advanceDetailEntity.getThirdPackName());
parcelListEntity.setMaterialName(advanceDetailEntity.getMaterialName());
parcelListEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
parcelListEntityList.add(parcelListEntity);
}
}
} else {
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间
if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) {
advanceDetailEntity.setSendDateStr(DateUtil.today());
}
advanceDetailEntityList.add(advanceDetailEntity);
}
JSONArray items = detail.getJSONArray("items");
if (CollUtil.isNotEmpty(items)) {
for (Object itemObj : items) {
JSONObject item = JSONUtil.parseObj(itemObj);
TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class);
if (ObjectUtil.isNotNull(detailProductEntity)) {
productCodes.add(detailProductEntity.getProductCode());
detailProductEntityList.add(detailProductEntity);
}
}
}
}
}
if (CollUtil.isNotEmpty(parcelListEntityList)) {
parcelListClient.saveorUpdateBatchByOP(parcelListEntityList);
}
if (CollUtil.isNotEmpty(advanceDetailEntityList)) {
advanceDetailService.saveOrUpdateBatch(advanceDetailEntityList);
}
// 发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
if (CollUtil.isNotEmpty(detailProductEntityList)) {
if (ObjectUtil.isAllNotEmpty(packageCodeMap, productCodes)) {
List<TrunklineDetailProductEntity> list = detailProductService.list(Wrappers.<TrunklineDetailProductEntity>lambdaQuery()
.in(TrunklineDetailProductEntity::getUnitNo, packageCodeMap.keySet())
.in(TrunklineDetailProductEntity::getProductCode, productCodes)
);
if (CollUtil.isNotEmpty(list)) {
for (TrunklineDetailProductEntity productEntity : detailProductEntityList) {
for (TrunklineDetailProductEntity detailProductEntity : list) {
if (ObjectUtil.equal(productEntity.getProductCode(), detailProductEntity.getProductCode())) {
productEntity.setId(detailProductEntity.getId());
}
}
}
}
}
detailProductService.saveOrUpdateBatch(detailProductEntityList);
}
}
}
}
}

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

@ -916,8 +916,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
//修改暂存单明细的结算品类
advanceDetailService.updateBatchById(updateAdvanceDetailList);
//把updateAdvanceDetailList分成每300条一组
List<List<TrunklineAdvanceDetailEntity>> updateAdvanceDetailListList = CollUtil.split(updateAdvanceDetailList, 300);
updateAdvanceDetailListList.forEach(updateAdvanceDetailList1 -> {
advanceDetailService.updateBatchById(updateAdvanceDetailList1);
});
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);

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

@ -13,7 +13,11 @@ import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.*;
import com.logpm.basicdata.feign.IBasicdataBrandClient;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataTripartiteMallClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -27,6 +31,8 @@ import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineDetailProductService;
import com.logpm.trunkline.vo.CustomerInfoVO;
import com.logpm.trunkline.vo.OpenOrderVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
@ -45,7 +51,14 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -60,14 +73,12 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
private final IBasicdataClientClient basicdataClientClient;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataTripartiteMallClient tripartiteMallClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IBasicdataTripartiteMallClient basicdataTripartiteMallClient;
private final RabbitTemplate rabbitTemplate;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final IBasicdataBrandClient basicdataBrandClient;
@Override
public boolean saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId) {
String orderPackageCode = advanceDetailEntity.getOrderPackageCode();
@ -1972,4 +1983,5 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
public Integer findTotalNumByWaybillNoAndOrderCode(String waybillNo, String orderCode) {
return baseMapper.findTotalNumByWaybillNoAndOrderCode(waybillNo,orderCode);
}
}

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

@ -10951,27 +10951,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询已装车的零担
List<LoadZeroListVO> zeroList = trunklineCarsOrderService.findZeroList(loadId, warehouseId);
zeroList.forEach(loadZeroListVO -> {
String waybillNo = loadZeroListVO.getWaybillNo();
String orderCode = loadZeroListVO.getOrderCode();
List<GoodsLoadingNumVO> loadingNumVOList = scanZeroDetailService.findGoodsLoadingNum(loadId,warehouseId,waybillNo,orderCode);
//把loadingNumVOList转化成以goodsId作为key的Map
Map<Long, GoodsLoadingNumVO> map = loadingNumVOList.stream().collect(Collectors.toMap(GoodsLoadingNumVO::getGoodsId, Function.identity()));
List<JSONObject> zeroPackageList = distributionParcelListClient.findPackageGoodsListByWaybillNoAndWarehouseId(waybillNo,warehouseId);
List<ZeroPackageVO> ls = new ArrayList<>();
zeroPackageList.forEach(jsonObject -> {
ZeroPackageVO javaObject = jsonObject.toJavaObject(ZeroPackageVO.class);
Long goodsId = javaObject.getGoodsId();
GoodsLoadingNumVO goodsLoadingNumVO = map.get(goodsId);
if(Objects.isNull(goodsLoadingNumVO)){
javaObject.setLoadingNum(0);
}else{
javaObject.setLoadingNum(goodsLoadingNumVO.getLoadingNum());
}
ls.add(javaObject);
if(CollUtil.isNotEmpty(zeroList)){
zeroList.forEach(loadZeroListVO -> {
String waybillNo = loadZeroListVO.getWaybillNo();
String orderCode = loadZeroListVO.getOrderCode();
List<GoodsLoadingNumVO> loadingNumVOList = scanZeroDetailService.findGoodsLoadingNum(loadId,warehouseId,waybillNo,orderCode);
//把loadingNumVOList转化成以goodsId作为key的Map
Map<Long, GoodsLoadingNumVO> map = loadingNumVOList.stream().collect(Collectors.toMap(GoodsLoadingNumVO::getGoodsId, Function.identity()));
List<JSONObject> zeroPackageList = distributionParcelListClient.findPackageGoodsListByWaybillNoAndWarehouseId(waybillNo,warehouseId);
List<ZeroPackageVO> ls = new ArrayList<>();
zeroPackageList.forEach(jsonObject -> {
ZeroPackageVO javaObject = jsonObject.toJavaObject(ZeroPackageVO.class);
Long goodsId = javaObject.getGoodsId();
GoodsLoadingNumVO goodsLoadingNumVO = map.get(goodsId);
if(Objects.isNull(goodsLoadingNumVO)){
javaObject.setLoadingNum(0);
}else{
javaObject.setLoadingNum(goodsLoadingNumVO.getLoadingNum());
}
ls.add(javaObject);
});
loadZeroListVO.setZeroPackageList(ls);
});
loadZeroListVO.setZeroPackageList(ls);
});
}
//查询异常列表

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

@ -438,4 +438,19 @@ public class WarehouseWaybillController extends BladeController {
}
@PostMapping("/updateWaybillTypeService")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "修改运单的服务类型 ")
public R updateWaybillTypeService(@RequestBody WarehouseWaybillDTO waybillDTO) {
try {
log.info(">>>>>>>>>>>>>>>>>> updateWaybillTypeService: waybillDTO={}",waybillDTO);
return warehouseWaybillService.updateWaybillTypeService(waybillDTO);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
}

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

@ -83,4 +83,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
void updateWaybillCondigneeIdToNull(@Param("waybillId") Long waybillId);
List<WarehouseWaybillEntity> findWaybillVOByOrderCode(@Param("orderCode") String orderCode);
void updateWaybillTypeService(@Param("serviceType") Integer serviceType, @Param("waybillId") Long id);
}

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

@ -1286,4 +1286,8 @@
update logpm_warehouse_waybill set consignee_id = null where id = #{waybillId}
</update>
<update id="updateWaybillTypeService" >
update logpm_warehouse_waybill set service_type = #{serviceType} where id = #{waybillId}
</update>
</mapper>

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

@ -95,4 +95,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
void updateWaybillCondigneeIdToNull(Long waybillId);
List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode);
R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO);
}

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

@ -62,6 +62,9 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.scripting.support.ResourceScriptSource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -1060,6 +1063,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Override
public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) {
// String key = "orderScanOrderPackageCodeSyncJd:"+trayCode;
// Boolean exists = redis.exists(key);
// if(exists){
// log.warn("#########orderScanOrderPackageCodeSyncJd: 托盘正在被操作 trayCode={} warehouseId={}", trayCode, warehouseId);
// return R.fail(4001, "托盘信息正在更新,请重试");
// }
// redis.setEx(key,1,1L);
QueryWrapper<WarehouseTrayGoodsEntity> qw = new QueryWrapper<>();
qw.eq("association_value", orderPackageCode);
@ -1762,9 +1772,19 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.info("#########saveTrayType: 存入打托方式 trayType={},trayCode={}", trayType, trayCode);
String key = "saveTrayTypeNew:"+trayCode;
String value = "1";
Long expireTime = 5L;
DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>();
redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("luascript/resubmit.lua")));
redisScript.setResultType(Long.class);
List<String> keys = Collections.singletonList(key);
List<String> args = Arrays.asList(value, String.valueOf(expireTime));
Long result = redis.getRedisTemplate().execute(redisScript, keys, args);
Boolean exists = redis.exists(key);
if(exists){
if (result == 1) {
log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId);
throw new CustomerException(405, "托盘信息正在更新,请重试");
}

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

@ -1234,4 +1234,26 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
public List<WarehouseWaybillEntity> findWaybillVOByOrderCode(String orderCode) {
return baseMapper.findWaybillVOByOrderCode(orderCode);
}
@Override
public R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO) {
Long id = waybillDTO.getId();
Integer serviceType = waybillDTO.getServiceType();
WarehouseWaybillEntity warehouseWaybillEntity = baseMapper.selectById(id);
if(Objects.isNull(warehouseWaybillEntity)){
log.warn("###########updateWaybillTypeService: 运单信息为空");
return R.fail(405,"运单信息为空");
}
Integer checkStatus = warehouseWaybillEntity.getCheckStatus();
if(checkStatus.equals(1)){
log.warn("###########updateWaybillTypeService: 运单已审核");
return R.fail(405,"运单已审核");
}
baseMapper.updateWaybillTypeService(serviceType,id);
return R.success("修改成功");
}
}

12
blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

@ -0,0 +1,12 @@
local key = KEYS[1]
local value = ARGV[1]
local expireTime = tonumber(ARGV[2])
local exists = redis.call("EXISTS", key)
if exists == 1 then
return 1
end
redis.call("SETEX", key, expireTime, value)
return 0
Loading…
Cancel
Save