Browse Source

增加商家数据推送

master
pref_mail@163.com 10 months ago
parent
commit
a7d453a0aa
  1. 26
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 28
      blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumberVO.java
  3. 18
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionBusinessPreOrderClient.java
  4. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionBusinessPreOrderController.java
  5. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionBusinessPreOrderClient.java
  6. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.java
  7. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.xml
  8. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  9. 42
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  11. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionBusinessPreOrderService.java
  12. 228
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  13. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java
  14. 120
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java
  15. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java
  16. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillPackageClient.java
  17. 53
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/InWarehourseToBusinessListener.java
  18. 147
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenWaybillToBusinessListener.java
  19. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java
  20. 317
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java
  21. 23
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  22. 614
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

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

@ -33,9 +33,9 @@ public interface RabbitConstant {
/**
* 新系统推送信息
*/
String NEW_SYSTEM_RECEIVE_INFO_QUEUE = "new_system_receive_info_queue"+ ModuleNameConstant.DEVAUTH;
String NEW_SYSTEM_RECEIVE_INFO_EXCHANGE = "new_system_receive_info_exchange"+ ModuleNameConstant.DEVAUTH;
String NEW_SYSTEM_RECEIVE_INFO_ROUTING = "new_system_receive_info_routing"+ ModuleNameConstant.DEVAUTH;
String NEW_SYSTEM_RECEIVE_INFO_QUEUE = "new_system_receive_info_queue" + ModuleNameConstant.DEVAUTH;
String NEW_SYSTEM_RECEIVE_INFO_EXCHANGE = "new_system_receive_info_exchange" + ModuleNameConstant.DEVAUTH;
String NEW_SYSTEM_RECEIVE_INFO_ROUTING = "new_system_receive_info_routing" + ModuleNameConstant.DEVAUTH;
/**
* 卸车完成确认
*/
@ -108,7 +108,6 @@ public interface RabbitConstant {
/****************文员复合签收推送老系统队列 end *************************/
/****************文员自提复合签收推送老系统队列 start *************************/
String BILL_CLERK_CHECK_PUSH_DATA_QUEUE = "bill_clerk_check_push_data_queue" + ModuleNameConstant.DEVAUTH;
@ -137,8 +136,6 @@ public interface RabbitConstant {
/***************************************梦天签收扫描数据推送 end************************************************/
/****************************************梦天签收复核数据推送 start***********************************************/
String MT_BUSINESS_DATA_CLERK_CHECK_2_FACTORY_QUEUE = "mt_business_data_clerk_check_2_factory_queue" + ModuleNameConstant.DEVAUTH;
String MT_BUSINESS_DATA_CLERK_CHECK_2_FACTORY_EXCHANGE = "mt_business_data_clerk_check_2_factory_exchange" + ModuleNameConstant.DEVAUTH;
@ -174,7 +171,24 @@ public interface RabbitConstant {
String OPEN_ORDER_LOAD_SCAN_ROUTING = "open_order_load_scan_routing" + ModuleNameConstant.DEVAUTH;
/****************运单创建推送商家数据start *************************/
String OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE = "open_waybill_to_business_data_queue" + ModuleNameConstant.DEVAUTH;
String OPEN_WAYBILL_TO_BUSINESS_DATA_EXCHANGE = "open_waybill_to_business_data_exchange" + ModuleNameConstant.DEVAUTH;
String OPEN_WAYBILL_TO_BUSINESS_DATA_ROUTING = "open_waybill_to_business_data_routing" + ModuleNameConstant.DEVAUTH;
/****************运单创建推送商家数据end *************************/
/****************库内入库推送商家数据start *************************/
String IN_WAREHOUSE_TO_BUSINESS_DATA_QUEUE = "in_warehouse_to_business_data_queue" + ModuleNameConstant.DEVAUTH;
String IN_WAREHOUSE_TO_BUSINESS_DATA_EXCHANGE = "in_warehouse_to_business_data_exchange" + ModuleNameConstant.DEVAUTH;
String IN_WAREHOUSE_TO_BUSINESS_DATA_ROUTING = "in_warehouse_to_business_data_routing" + ModuleNameConstant.DEVAUTH;
/****************库内入库推送商家数据end *************************/
/****************创建商家配送计划 start *************************/

28
blade-service-api/logpm-business-conversion-api/src/main/java/com/logpm/business/vo/DistributionBusinessPreCarNumberVO.java

@ -0,0 +1,28 @@
package com.logpm.business.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DistributionBusinessPreCarNumberVO {
@ApiModelProperty(value = "配送车次")
private String distrCarNumber;
@ApiModelProperty(value = "运单号")
private String waybillNumber;
@ApiModelProperty(value = "订单号")
private String orderCode;
@ApiModelProperty(value = "总件数")
private Integer totalNum;
@ApiModelProperty(value = "入库件数")
private Integer inNum;
@ApiModelProperty(value = "待入库件数")
private Integer restNum;
}

18
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionBusinessPreOrderClient.java

@ -0,0 +1,18 @@
package com.logpm.distribution.feign;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(
value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME
)
public interface IDistributionBusinessPreOrderClient {
String API_PREFIX = "/client";
String INORDERBYORDERPACKAGECODE = API_PREFIX + "/inOrderByOrderPackageCode";
@GetMapping(INORDERBYORDERPACKAGECODE)
public Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum")String carNum);
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionBusinessPreOrderController.java

@ -3,6 +3,7 @@ package com.logpm.distribution.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
@ -29,7 +30,7 @@ import java.util.Map;
@AllArgsConstructor
@Slf4j
@RequestMapping("/businessPreOrder")
@Api(value = "配送增值服务明细", tags = "预入库信息控制器")
@Api(value = "预入库信息控制器", tags = "预入库信息控制器")
public class DistributionBusinessPreOrderController extends BladeController {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
@ -40,12 +41,26 @@ public class DistributionBusinessPreOrderController extends BladeController {
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreOrderVO>> list(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
public R<IPage<DistributionBusinessPreOrderVO>> page(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreOrderVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreOrderVO> data= distributionBusinessPreOrderService.pacgeList(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
/**
* 预入库信息--配送车次
*/
@GetMapping("/pageByCarNum")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<IPage<DistributionBusinessPreCarNumberVO>> pageByCarNum(@ApiIgnore @RequestParam Map<String, Object> distributionBusinessPreOrderDTO, Query query) {
IPage<DistributionBusinessPreCarNumberVO> page = Condition.getPage(query);
IPage<DistributionBusinessPreCarNumberVO> data= distributionBusinessPreOrderService.pageByCarNum(distributionBusinessPreOrderDTO,page);
return R.data(data);
}
@GetMapping("/inOrder")
@ApiOperationSupport(order = 2)

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionBusinessPreOrderClient.java

@ -0,0 +1,17 @@
package com.logpm.distribution.feign;
import com.logpm.distribution.service.IDistributionBusinessPreOrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionBusinessPreOrderClient implements IDistributionBusinessPreOrderClient {
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode, String carNum) {
return distributionBusinessPreOrderService.inOrderByOrderPackageCode(orderPackageCode,carNum);
}
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.java

@ -20,19 +20,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.dto.DistributionBusinessPreOrderDTO;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.excel.DistributionParcelListExcel;
import com.logpm.distribution.vo.*;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 商家预备导入数据信息 Mapper 接口
@ -45,20 +39,25 @@ public interface DistributionBusinessPreOrderMapper extends BaseMapper<Distribut
/**
* 查询DistributionBusinessPreOrderVO列表
*
* @param page
* @param param
* @return
*/
IPage<DistributionBusinessPreOrderVO> pageList(IPage<DistributionBusinessPreOrderVO> page, DistributionBusinessPreOrderDTO param);
IPage<DistributionBusinessPreOrderVO> pageList(IPage<DistributionBusinessPreOrderVO> page, @Param("param") DistributionBusinessPreOrderDTO param);
/**
* 删除商家端数据
*
* @param k
* @param deletedPackageList
* @return
*/
Integer deleteBusinessPreOrder(String reservationCode, List<String> deletedPackageList);
Integer deleteBusinessPreOrder(String reservationCode, List<String> deletedPackageList);
List<DistributionBusinessPreOrderEntity> listByBusinessPreListDTO(@Param("queryrderDTO") BusinessPreListDTO queryrderDTO);
Integer updateBusinessPreOrderByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
Integer updateBusinessPreOrderByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(IPage<DistributionBusinessPreCarNumberVO> page, Map<String, Object> distributionBusinessPreOrderDTO);
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionBusinessPreOrderMapper.xml

@ -45,7 +45,6 @@
volume,
driver_name,
vehicle_name,
distr_car_number,
in_warehouse
FROM
logpm_business_pre_order
@ -54,16 +53,9 @@
<if test="param.id != null and param.id != ''">
AND id = #{param.id}
</if>
<!-- <if test="param.ids != null ">-->
<!-- AND id IN-->
<!-- <foreach collection="param.ids" item="item" index="index" open="(" close=")" separator=",">-->
<!-- #{otem}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="param.firsts != null and param.firsts != ''">
AND firsts like concat(#{param.id},'%')
</if>
<if test="param.second != null and param.second != ''">
AND `SECOND` like concat(#{param.second},'%')
</if>
@ -112,9 +104,11 @@
<if test="param.distrCarNumber != null and param.distrCarNumber != ''">
AND distr_car_number like concat(#{param.distrCarNumber},'%')
</if>
<if test="param.inWarehouse != null and param.inWarehouse != ''">
<if test="param.inWarehouse != null ">
AND in_warehouse = #{param.inWarehouse}
</if>
</where>
@ -161,5 +155,33 @@
</where>
</select>
<select id="pageByCarNum" resultType="com.logpm.business.vo.DistributionBusinessPreCarNumberVO">
SELECT distr_car_number,
waybill_number,
order_code,
COUNT(1) as totalNum,
COUNT(CASE WHEN in_warehouse = 1 THEN 1 END) as inNum,
COUNT(1)-COUNT(CASE WHEN in_warehouse = 1 THEN 1 END) as restNum
from logpm_business_pre_order
<where>
is_deleted=0
<if test="distributionBusinessPreOrderDTO.distrCarNumber != null and distributionBusinessPreOrderDTO.distrCarNumber != ''">
AND distr_car_number = #{distributionBusinessPreOrderDTO.distrCarNumber}
</if>
<if test="distributionBusinessPreOrderDTO.waybillNumber != null and distributionBusinessPreOrderDTO.waybillNumber != ''">
and waybill_number=#{distributionBusinessPreOrderDTO.waybillNumber}
</if>
<if test="distributionBusinessPreOrderDTO.orderCode != null and distributionBusinessPreOrderDTO.orderCode != ''">
and order_code LIKE CONCAT(#{distributionBusinessPreOrderDTO.orderCode},'%')
</if>
</where>
GROUP BY
distr_car_number,
waybill_number,
order_code
</select>
</mapper>

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

@ -86,7 +86,6 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
/**
* 查询自提库存品
* @param page
* @param distrilbutionBillLadingEntity
* @return
*/
@ -104,14 +103,12 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
/**
* 取消订制品包件
* @param billLodingIds
* @return
*/
Integer cancelBillLadingPackage(@Param("ids")List<Long> ids);
/**
* 查询自提单关联包件
* @param billLodingIds
* @return
*/
List<DistributionParcelListEntity> selectBillLadingPackage(@Param("ids")List<Long> ids);
@ -121,7 +118,6 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
/**
* 根据自提单号查询自提单
* @param id
* @param searchCode
* @return
*/
DistrilbutionBillLadingEntity selectByBillLadingCode(@Param("warehouseId") Long id,@Param("pickupBatch") String pickupBatch);
@ -142,7 +138,6 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
/**
*
* @param id
* @return
*/
Integer selectBillLadingLoading(@Param("billLadingId") Long billLadingId);
@ -156,28 +151,24 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
/**
* 查询自提单的零担包件
* @param reservationId
* @return
*/
List<DistributionStockupOrderListVO> selectBillLadingZeroPackageList(@Param("bullLadingId")Long bullLadingId);
/**
* 推送老系统
* @param billId
* @return
*/
SignPushDataDTO getSignPushDataDTO(@Param("id")Long id);
/**
* 查询推送老系统自提客户信息
* @param billId
* @return
*/
List<SignPushDataContactDTO> selectPushOldCustomer(@Param("id")Long id);
/**
* 查询自提签署包件推送老系统
* @param billId
* @return
*/
List<SignPushDataUnitDTO> selectPushOldPackageSigning(@Param("id")Long id);

42
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java

@ -82,7 +82,6 @@ public class BusinessPreOrderDataQueueHandler {
if(2==tenant.getTenantType()){
String mallName = tenant.getTenantName();
// 插入暂存单
extracted(map, mallName);
// 插入预计表
plantA(map,mallName);
}
@ -95,48 +94,7 @@ public class BusinessPreOrderDataQueueHandler {
}
private void extracted(Map map, String mallName) {
// 查询推送包件
List<DistributionParcelListEntity> distributionParcelListEntities = allList(map, mallName);
if (ObjectUtil.isEmpty(distributionParcelListEntities)) {
return;
}
// 得到下面的包间
// 假设 orderNumber 是 DistributionParcelListEntity 类中的一个属性
List<String> uniqueOrderNumbers = distributionParcelListEntities.stream()
.map(DistributionParcelListEntity::getWaybillNumber) // 将每个实体映射到其运单号
.distinct() // 移除重复的运单号
.collect(Collectors.toList()); // 收集到一个新的列表中
// 查询运单
List<WarehouseWaybillEntity> waybillBilllByWaybillNos = warehouseWaybillClient.findWaybillBilllByWaybillNos(uniqueOrderNumbers);
// 获取运单关联的暂存单信息
List<Long> waybillIds = waybillBilllByWaybillNos.stream().map(WarehouseWaybillEntity::getId).distinct().collect(Collectors.toList());
List<WarehouseWayBillDetail> warehouseWayBillDetails = warehouseWaybillDetailClient.findByWaybillIds(waybillIds);
List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities = trunklineWaybillOrderClient.findListByWaybillIds(waybillIds);
List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities = trunklineWaybillPackageClient.findListByWaybillIds(waybillIds);
// 暂存单ID集合
List<Long> collect = trunklineWaybillOrderEntities.stream().map(TrunklineWaybillOrderEntity::getAdvanceId).distinct().collect(Collectors.toList());
List<TrunklineAdvanceEntity> trunklineAdvanceEntities = trunklineAdvanceClient.findListByIds(collect);
// 获取暂存单明细
List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities = trunklineAdvanceDetailClient.findListByAdvanceIds(collect);
Tenant tenant = changeDataBase(mallName);
// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
CompletableFuture.supplyAsync(() -> {
// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
distributionAsyncService.saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
return null;
});
}
private List<DistributionParcelListEntity> allList(Map map, String mallName) {

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

@ -333,7 +333,6 @@ public interface IDistributionAsyncService {
DistributionStockArticleEntity findDistributionStockArticleEntityByIdForAsync(String tenantId, Long id);
void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, List<DistributionParcelListEntity> distributionParcelListEntities, String mallName);
void saveOtherDataBaseNew(String tenantId,List<DistributionBusinessPreOrderEntity> dataResult, String mallName);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionBusinessPreOrderService.java

@ -3,6 +3,7 @@ package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderListVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.bean.Resp;
@ -27,10 +28,11 @@ public interface IDistributionBusinessPreOrderService extends BaseService<Distri
/**
* 更新预入库状态
* @param orderPackageCode
* @param orderPackageCode 包条码
* @param carNum 入库的配送车次
* @return
*/
Integer inOrderByOrderPackageCode(String orderPackageCode);
Integer inOrderByOrderPackageCode(String orderPackageCode,String carNum);
/**
* 查询DistributionBusinessPreOrder列表
@ -50,4 +52,7 @@ public interface IDistributionBusinessPreOrderService extends BaseService<Distri
DistributionBusinessPreOrderListVO list(BusinessPreListDTO queryrderDTO);
Resp inOrderWarehourse(String orderPackageCode,String reservationCode) throws ExecutionException, InterruptedException;
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreCarNumberVO> page);
}

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

@ -152,7 +152,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final ISysClient sysClient;
private final BladeRedis bladeRedis;
// private final
@ -2834,233 +2834,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
return null;
}
@ChangeAsync()
@Override
public void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, List<DistributionParcelListEntity> distributionParcelListEntities, String mallName) {
// 保存暂存单
Tenant tenant = changeDataBase(mallName);
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
TrunklineAdvanceEntity finalTrunklineAdvanceEntity = trunklineAdvanceEntity;
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(finalTrunklineAdvanceEntity.getId())).collect(Collectors.toList());
saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName);
// 保存暂存子表
saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, mallName);
}
List<Long> collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList());
// 重新查询trunklineAdvanceDetail
List<TrunklineAdvanceDetailVO> listByAdvanceIds = trunklineAdvanceDetailClient.findListByAdvanceIds(collect);
// 保存运单
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
for (WarehouseWaybillEntity waybillBilllByWaybillNo : waybillBilllByWaybillNos) {
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
List<WarehouseWayBillDetail> t = warehouseWayBillDetails.stream().filter(warehouseWayBillDetail -> warehouseWayBillDetail.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
// 修改运单的起始仓库 和末端仓
waybillBilllByWaybillNo.setDepartureWarehouseName(waybillBilllByWaybillNo.getDestinationWarehouseName());
waybillBilllByWaybillNo.setDepartureWarehouseId(null);
// 目的仓
if(basicdataWarehouseEntity!=null){
waybillBilllByWaybillNo.setDestinationWarehouseId(basicdataWarehouseEntity.getId());
waybillBilllByWaybillNo.setDestinationWarehouseName(basicdataWarehouseEntity.getName());
}
waybillBilllByWaybillNo.setTenantId(tenant.getTenantId());
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
if(byWaybillNo==null){
Long l = warehouseWaybillClient.addEnntity(waybillBilllByWaybillNo);
waybillBilllByWaybillNo.setId(l);
}else{
waybillBilllByWaybillNo.setId(byWaybillNo.getId());
}
List<WarehouseWayBillDetail> byWaybillId = warehouseWaybillDetailClient.findByWaybillId(waybillBilllByWaybillNo.getId());
for (WarehouseWayBillDetail warehouseWayBillDetail : t) {
warehouseWayBillDetail.setId(null);
for (WarehouseWayBillDetail wayBillDetail : byWaybillId) {
if(wayBillDetail.getProductName().equals(warehouseWayBillDetail.getProductName())){
// 不执行
warehouseWayBillDetail.setId(wayBillDetail.getId());
break;
}
}
if(warehouseWayBillDetail.getId()==null){
warehouseWayBillDetail.setWaybillId(waybillBilllByWaybillNo.getId());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
}
}
List<TrunklineWaybillOrderEntity> listByWaybillNo = trunklineWaybillOrderClient.findListByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
for (TrunklineWaybillOrderEntity trunklineWaybillOrderEntity : collect1) {
trunklineWaybillOrderEntity.setId(null);
List<TrunklineWaybillPackageEntity> collect3 = trunklineWaybillPackageEntities.stream().filter(ts -> {
return ts.getWaybillNo().equals(trunklineWaybillOrderEntity.getWaybillNo()) && ts.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId());
}).collect(Collectors.toList());
trunklineWaybillOrderEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillOrderEntity.setTenantId(tenant.getTenantId());
Optional<TrunklineAdvanceEntity> entityWithOrderNumber1123 = trunklineAdvanceEntities.stream()
.filter(entity -> trunklineWaybillOrderEntity.getOrderCode().equals(entity.getOrderCode())) // 过滤出订单号为"1123"的实体
.findFirst(); // 获取第一个匹配的实体
if (entityWithOrderNumber1123.isPresent()) {
TrunklineAdvanceEntity foundEntity = entityWithOrderNumber1123.get();
// 使用找到的实体
trunklineWaybillOrderEntity.setAdvanceId(foundEntity.getId());
}
for (TrunklineWaybillOrderEntity waybillOrderEntity : listByWaybillNo) {
if(waybillOrderEntity.getOrderCode().equals(trunklineWaybillOrderEntity.getOrderCode())){
trunklineWaybillOrderEntity.setId(waybillOrderEntity.getId());
}
}
if(trunklineWaybillOrderEntity.getId()==null){
Long l1 = trunklineWaybillOrderClient.addEntityReturnId(trunklineWaybillOrderEntity);
trunklineWaybillOrderEntity.setId(l1);
}
List<Long> ids = Arrays.asList(waybillBilllByWaybillNo.getId());
List<TrunklineWaybillPackageEntity> listByWaybillIds = trunklineWaybillPackageClient.findListByWaybillIds(ids);
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : collect3) {
trunklineWaybillPackageEntity.setId(null);
trunklineWaybillPackageEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillPackageEntity.setTenantId(tenant.getTenantId());
trunklineWaybillPackageEntity.setAdvanceId(trunklineWaybillOrderEntity.getAdvanceId());
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId())) {
if (listByAdvanceId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setAdvanceDetailId(listByAdvanceId.getId());
}
}
}
for (TrunklineWaybillPackageEntity listByWaybillId : listByWaybillIds) {
if(listByWaybillId.getWaybillId().equals(trunklineWaybillPackageEntity.getWaybillId())){
if(listByWaybillId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())){
trunklineWaybillPackageEntity.setId(listByWaybillId.getId());
break;
}
}
}
if(trunklineWaybillPackageEntity.getId()==null){
trunklineWaybillPackageClient.addEntity(trunklineWaybillPackageEntity);
}
}
}
}
}
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
String cacheName =mallName +"仓";
BasicdataWarehouseEntity basicdataWarehouseEntity = bladeRedis.get(cacheName);
if(basicdataWarehouseEntity==null){
basicdataWarehouseEntity = warehouseClient.findByName(mallName +"仓");
bladeRedis.setEx(cacheName,basicdataWarehouseEntity,60*60*24L);
}
return basicdataWarehouseEntity;
}
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
List<Long> ids = Arrays.asList(trunklineAdvanceEntity.getId());
List<TrunklineAdvanceDetailVO> listByAdvanceIds = trunklineAdvanceDetailClient.findListByAdvanceIds(ids);
List<TrunklineAdvanceDetailEntity> saveObjs = new ArrayList<>();
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : t) {
trunklineAdvanceDetailEntity.setId(null);
// 检测 保存的对象是否已经存在
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if(listByAdvanceId.getOrderPackageCode().equals(trunklineAdvanceDetailEntity.getOrderPackageCode())){
trunklineAdvanceDetailEntity.setId(listByAdvanceId.getId());
break;
}
}
if(trunklineAdvanceDetailEntity.getId()==null){
trunklineAdvanceDetailEntity.setPackageStatus("0");
trunklineAdvanceDetailEntity.setAdvanceId(trunklineAdvanceEntity.getId());
trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId());
trunklineAdvanceDetailEntity.setIncomingWarehouseId(null);
trunklineAdvanceDetailEntity.setIncomingWarehouseName(null);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if(basicdataWarehouseEntity!=null){
trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
saveObjs.add(trunklineAdvanceDetailEntity);
}
}
trunklineAdvanceDetailClient.addAdvanceBatch(saveObjs);
}
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
// 查找商户的暂存单是否存在改制
TrunklineAdvanceEntity trunklineAdvanceEntity1 = trunklineAdvanceClient.findAdvanceLimitOneByOrderCode(trunklineAdvanceEntity.getOrderCode());
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象
if(basicdataWarehouseEntity!=null){
trunklineAdvanceEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
trunklineAdvanceEntity.setTenantId(tenant.getTenantId());
Long l = trunklineAdvanceClient.addAdvanceReturnId(trunklineAdvanceEntity);
trunklineAdvanceEntity.setId(l);
return trunklineAdvanceEntity;
} else {
return trunklineAdvanceEntity1;
}
}
@ChangeAsync()
@Override
public void saveOtherDataBaseNew(String tenantId,List<DistributionBusinessPreOrderEntity> dataResult, String mallName) {

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java

@ -9,6 +9,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.business.dto.BusinessPreListDTO;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.business.vo.DistributionBusinessPreCarNumberVO;
import com.logpm.business.vo.DistributionBusinessPreOrderListVO;
import com.logpm.business.vo.DistributionBusinessPreOrderVO;
import com.logpm.distribution.bean.Resp;
@ -98,24 +99,27 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
@Override
public Integer inOrderByOrderPackageCode(String orderPackageCode) {
public Integer inOrderByOrderPackageCode(String orderPackageCode,String carNum) {
int a =baseMapper.updateBusinessPreOrderByOrderPackageCode(orderPackageCode);
return a;
// int a =baseMapper.updateBusinessPreOrderByOrderPackageCode(orderPackageCode);
//
// return a;
// QueryWrapper wrapper = new QueryWrapper();
// wrapper.eq("order_package_code", orderPackageCode);
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("order_package_code", orderPackageCode);
// wrapper.eq("in_warehouse",0);
// wrapper.eq("is_deleted","0");
// List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
//
// for (DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity : data) {
//
// distributionBusinessPreOrderEntity.setInWarehouse(1);
// baseMapper.updateById(distributionBusinessPreOrderEntity);
// }
wrapper.eq("is_deleted","0");
List<DistributionBusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
if(!list.isEmpty()){
DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity = list.get(0);
distributionBusinessPreOrderEntity.setInWarehouse(1);
return baseMapper.updateById(distributionBusinessPreOrderEntity);
}
return 0;
}
@ -241,11 +245,17 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl<Di
// Long l = baseMapper.selectCount(queryWrapper);
return Resp.scanSuccess("扫描成功", "请前往码板打托进行入库!");
}
@Override
public IPage<DistributionBusinessPreCarNumberVO> pageByCarNum(Map<String, Object> distributionBusinessPreOrderDTO, IPage<DistributionBusinessPreCarNumberVO> page) {
IPage<DistributionBusinessPreCarNumberVO> pageByCarNum =baseMapper.pageByCarNum(page, distributionBusinessPreOrderDTO);
return pageByCarNum;
return Resp.scanSuccess("扫描成功", "请前往码板打托进行入库!");
}
private void buildDistributionParcelListEntity(DistributionBusinessPreOrderEntity distributionBusinessPreOrderEntity) {

120
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java

@ -0,0 +1,120 @@
package com.logpm.trunkline.aspect;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Aspect
@Component
@Slf4j
@Order(-1)
@AllArgsConstructor
public class ChangeAsyncAnnotationAspect {
private final MockLoginService mockLoginService;
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final String account = "shujutongbu";
/**
* 定义一个切点匹配所有带有@LogpmAsync("asyncExecutor")注解的方法
* 注意实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理直接这样配置可能会导致预期之外的行为
*/
@Around("@annotation(org.springblade.common.annotations.ChangeAsync)")
public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
ChangeAsync myAsync = method.getAnnotation(ChangeAsync.class);
String annotationValue = myAsync.value();
log.info(">>>>>>>>>>>>>>>>>> ChangeAsync={}", annotationValue);
// 获取当前拦截方法的入参参数
Object[] args = joinPoint.getArgs();
// 获取入参名称
String[] parameterNames = signature.getParameterNames();
String tenantId = null;
// 获取参数名称 为tenantId 的值
for (int i = 0; i < parameterNames.length; i++) {
if ("tenantId".equals(parameterNames[i])) {
tenantId = (String) args[i];
log.info(">> tenandId {} ", tenantId);
break;
}
}
// 执行模拟登录
if (StringUtil.isNotBlank(tenantId)) {
JSONObject data = bladeRedis.get(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account);
if (Objects.isNull(data)) {
boolean flag = redisLockClient.tryLock("local_server_user" + tenantId, LockType.FAIR, 5000, 10000, TimeUnit.MILLISECONDS);
if (flag) {
data = bladeRedis.get(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account);
if (Objects.isNull(data)) {
data = mockLoginService.mockToken(tenantId, account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 3200L);
redisLockClient.unLock("local_server_user" + tenantId, LockType.FAIR);
}
}
}
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
mockRequest.addHeader("Blade-Auth", "bearer "+data.get("access_token"));
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(mockRequest));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(data.getString("tenant_id"));
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}else{
return joinPoint.proceed();
}
// // 在方法执行前的操作
// String tenantId = AuthUtil.getTenantId();
// log.info(">> tenandId {} ",tenantId);
// DynamicDataSourceContextHolder.push("627683");
//
// // 执行原方法
// Object result = joinPoint.proceed();
//
// // 在方法执行后的操作
// DynamicDataSourceContextHolder.poll();
// return result;
}
}

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

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

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

@ -20,7 +20,6 @@ public class TrunklineWaybillPackageClient implements ITrunklineWaybillPackageCl
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper =new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId,waybillIds);
trunklineWaybillPackageService.list(lambdaQueryWrapper);
return trunklineWaybillPackageService.list(lambdaQueryWrapper);
}

53
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/InWarehourseToBusinessListener.java

@ -0,0 +1,53 @@
package com.logpm.trunkline.mq;
import com.alibaba.fastjson.JSONObject;
import com.logpm.distribution.feign.IDistributionBusinessPreOrderClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 码半
* 入库扫描
* 触发商家的入库数据
*/
@Slf4j
@AllArgsConstructor
@Component
@RabbitListener(queues = RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_QUEUE)
public class InWarehourseToBusinessListener {
private final IDistributionBusinessPreOrderClient distributionBusinessPreOrderClient;
@RabbitHandler
public void inWarehourseToBusinessDataHandler(Map map, Message message, Channel channel) {
extracted(map);
}
private void extracted(Map map) {
log.info("入库扫描-触发商家的入库数据-入参:{}", map);
JSONObject o = (JSONObject) map.get("messageData");
String orderPackageCode = o.getString("orderPackageCode");
String carNum = o.getString("carNum");
if(carNum==null){
carNum="";
}
Integer i = distributionBusinessPreOrderClient.inOrderByOrderPackageCode(orderPackageCode, carNum);
log.info(">>>>>>>>>>>>>>>>>> 入库操作 执行 {}",i);
}
}

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

@ -0,0 +1,147 @@
package com.logpm.trunkline.mq;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.trunkline.feign.ITrunklineWaybillPackageClient;
import com.logpm.trunkline.service.IAsyncService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import com.rabbitmq.client.Channel;
import jodd.util.ArraysUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
* 运单开单数据推送商场
* <br>
* <li>站存单</li>
* <li>站存单明细</li>
* <li>运单</li>
* <li>运单关联信息</li>
* <li>运单关联暂存单</li>
* <li>运单关联站存单明细</li>
*/
@Slf4j
@AllArgsConstructor
@Component
@RabbitListener(queues = RabbitConstant.OPEN_WAYBILL_TO_BUSINESS_DATA_QUEUE)
public class OpenWaybillToBusinessListener {
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient;
private final ITrunklineWaybillPackageClient trunklineWaybillPackageClient;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final ISysClient sysClient;
private final IAsyncService asyncService;
private ITrunklineWaybillTrackService trunklineWaybillTrackService;
@RabbitHandler
public void openWaybillToBusinessDataHandler(Map map, Message message, Channel channel) {
extracted(map);
}
private void extracted(Map map) {
Long waybillId = (Long) map.get("messageData");
if (ObjectUtil.isEmpty(waybillId)) {
log.warn("运单ID为null");
return;
}
// 获取运单关联的暂存单信息
WarehouseWaybillEntity byWaybillId = warehouseWaybillClient.findByWaybillId(waybillId);
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
for (Tenant datum : data) {
if (datum.getTenantType() == 2 && datum.getTenantName().equals(byWaybillId.getConsignee().trim())) {
tenant = datum;
break;
}
}
}
if (ObjectUtil.isEmpty(tenant)) {
log.warn(">>>>> 租户不存在");
return;
}
List<WarehouseWaybillEntity> waybillBilllByWaybillNos = new ArrayList<>();
waybillBilllByWaybillNos.add(byWaybillId);
List<Long> waybillIds = new ArrayList<>();
waybillIds.add(waybillId);
List<WarehouseWayBillDetail> warehouseWayBillDetails = warehouseWaybillDetailClient.findByWaybillId(waybillId);
List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities = trunklineWaybillOrderClient.findListByWaybillIds(waybillIds);
List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities = trunklineWaybillPackageClient.findListByWaybillIds(waybillIds);
// 暂存单ID集合
List<Long> collect = trunklineWaybillOrderEntities.stream().map(TrunklineWaybillOrderEntity::getAdvanceId).distinct().collect(Collectors.toList());
List<TrunklineAdvanceEntity> trunklineAdvanceEntities = trunklineAdvanceClient.findListByIds(collect);
// 获取暂存单明细
List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities = trunklineAdvanceDetailClient.findListByAdvanceIds(collect);
LambdaQueryWrapper<TrunklineWaybillTrackEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillId, waybillId);
queryWrapper.eq(TrunklineWaybillTrackEntity::getTrackType, "10");
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(queryWrapper);
TrunklineWaybillTrackEntity trunklineWaybillTrackEntity = list.get(0);
Tenant finalTenant = tenant;
CompletableFuture.supplyAsync(() -> {
asyncService.saveOtherData(finalTenant.getTenantId(), waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails,trunklineWaybillTrackEntity);
return null;
});
}
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java

@ -1,7 +1,11 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.common.annotations.ChangeAsync;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@ -13,4 +17,7 @@ public interface IAsyncService {
CompletableFuture<Boolean> saveAdvanceEntity(List<TrunklineAdvanceEntity> list, int queryType);
CompletableFuture<Boolean> updateAdvanceEntity(List<TrunklineAdvanceEntity> list, int queryType);
void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity );
}

317
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java

@ -1,24 +1,63 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.IAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@Service
@Slf4j
public class AsyncServiceImpl implements IAsyncService {
@Autowired
private ITrunklineAdvanceService advanceService;
@Autowired
private ITrunklineAdvanceDetailService advanceDetailService;
@Autowired
private IWarehouseWaybillClient warehouseWaybillClient;
@Autowired
private IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
@Autowired
private ISysClient sysClient;
@Autowired
private BladeRedis bladeRedis;
@Autowired
private ITrunklineWaybillOrderService waybillOrderService;
@Autowired
private ITrunklineWaybillPackageService trunklineWaybillPackageService;
@Autowired
private IWarehouseWaybillClient waybillClient;
@Autowired
private IBasicdataWarehouseClient warehouseClient;
@Autowired
private ITrunklineWaybillTrackService trunklineWaybillTrackService;
@LogpmAsync("asyncExecutor")
@Override
@ -47,4 +86,272 @@ public class AsyncServiceImpl implements IAsyncService {
);
}
@ChangeAsync()
@Override
public void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, TrunklineWaybillTrackEntity trunklineWaybillTrackEntity) {
// 保存暂存单
Tenant tenant = null;
R<Tenant> tenantFeign = sysClient.getTenant(tenantId);
if (tenantFeign.isSuccess()) {
tenant = tenantFeign.getData();
}
String mallName = tenant.getTenantName();
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
TrunklineAdvanceEntity finalTrunklineAdvanceEntity = trunklineAdvanceEntity;
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(finalTrunklineAdvanceEntity.getId())).collect(Collectors.toList());
saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName);
// 保存暂存子表
saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, mallName);
}
List<Long> collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList());
// 重新查询trunklineAdvanceDetail
List<TrunklineAdvanceDetailVO> listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(collect);
// 保存运单
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
for (WarehouseWaybillEntity waybillBilllByWaybillNo : waybillBilllByWaybillNos) {
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
List<WarehouseWayBillDetail> t = warehouseWayBillDetails.stream().filter(warehouseWayBillDetail -> warehouseWayBillDetail.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
// 修改运单的起始仓库 和末端仓
waybillBilllByWaybillNo.setDepartureWarehouseName(waybillBilllByWaybillNo.getDestinationWarehouseName());
waybillBilllByWaybillNo.setDepartureWarehouseId(null);
// 目的仓
if (basicdataWarehouseEntity != null) {
waybillBilllByWaybillNo.setDestinationWarehouseId(basicdataWarehouseEntity.getId());
waybillBilllByWaybillNo.setDestinationWarehouseName(basicdataWarehouseEntity.getName());
}
waybillBilllByWaybillNo.setTenantId(tenant.getTenantId());
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
if (byWaybillNo == null) {
Long l = warehouseWaybillClient.addEnntity(waybillBilllByWaybillNo);
waybillBilllByWaybillNo.setId(l);
} else {
waybillBilllByWaybillNo.setId(byWaybillNo.getId());
}
List<WarehouseWayBillDetail> byWaybillId = warehouseWaybillDetailClient.findByWaybillId(waybillBilllByWaybillNo.getId());
for (WarehouseWayBillDetail warehouseWayBillDetail : t) {
warehouseWayBillDetail.setId(null);
for (WarehouseWayBillDetail wayBillDetail : byWaybillId) {
if (wayBillDetail.getProductName().equals(warehouseWayBillDetail.getProductName())) {
// 不执行
warehouseWayBillDetail.setId(wayBillDetail.getId());
break;
}
}
if (warehouseWayBillDetail.getId() == null) {
warehouseWayBillDetail.setWaybillId(waybillBilllByWaybillNo.getId());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
}
}
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no", waybillBilllByWaybillNo.getWaybillNo());
List<TrunklineWaybillOrderEntity> listByWaybillNo = waybillOrderService.list(queryWrapper);
for (TrunklineWaybillOrderEntity trunklineWaybillOrderEntity : collect1) {
trunklineWaybillOrderEntity.setId(null);
List<TrunklineWaybillPackageEntity> collect3 = trunklineWaybillPackageEntities.stream().filter(ts -> {
return ts.getWaybillNo().equals(trunklineWaybillOrderEntity.getWaybillNo()) && ts.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId());
}).collect(Collectors.toList());
trunklineWaybillOrderEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillOrderEntity.setTenantId(tenant.getTenantId());
Optional<TrunklineAdvanceEntity> entityWithOrderNumber1123 = trunklineAdvanceEntities.stream()
.filter(entity -> trunklineWaybillOrderEntity.getOrderCode().equals(entity.getOrderCode())) // 过滤出订单号为"1123"的实体
.findFirst(); // 获取第一个匹配的实体
if (entityWithOrderNumber1123.isPresent()) {
TrunklineAdvanceEntity foundEntity = entityWithOrderNumber1123.get();
// 使用找到的实体
trunklineWaybillOrderEntity.setAdvanceId(foundEntity.getId());
}
for (TrunklineWaybillOrderEntity waybillOrderEntity : listByWaybillNo) {
if (waybillOrderEntity.getOrderCode().equals(trunklineWaybillOrderEntity.getOrderCode())) {
trunklineWaybillOrderEntity.setId(waybillOrderEntity.getId());
}
}
if (trunklineWaybillOrderEntity.getId() == null) {
waybillOrderService.save(trunklineWaybillOrderEntity);
}
List<Long> ids = Arrays.asList(waybillBilllByWaybillNo.getId());
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId, ids);
List<TrunklineWaybillPackageEntity> listByWaybillIds = trunklineWaybillPackageService.list(lambdaQueryWrapper);
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : collect3) {
trunklineWaybillPackageEntity.setId(null);
trunklineWaybillPackageEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillPackageEntity.setTenantId(tenant.getTenantId());
trunklineWaybillPackageEntity.setAdvanceId(trunklineWaybillOrderEntity.getAdvanceId());
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId())) {
if (listByAdvanceId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setAdvanceDetailId(listByAdvanceId.getId());
}
}
}
for (TrunklineWaybillPackageEntity listByWaybillId : listByWaybillIds) {
if (listByWaybillId.getWaybillId().equals(trunklineWaybillPackageEntity.getWaybillId())) {
if (listByWaybillId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setId(listByWaybillId.getId());
break;
}
}
}
if (trunklineWaybillPackageEntity.getId() == null) {
trunklineWaybillPackageService.save(trunklineWaybillPackageEntity);
}
}
}
// 查询运单作业节点数据
LambdaQueryWrapper<TrunklineWaybillTrackEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getWaybillNo, waybillBilllByWaybillNo.getWaybillNo());
lambdaQueryWrapper.eq(TrunklineWaybillTrackEntity::getTrackType, "10");
List<TrunklineWaybillTrackEntity> list = trunklineWaybillTrackService.list(lambdaQueryWrapper);
if (list.isEmpty()) {
trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId());
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName);
trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId());
trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName());
trunklineWaybillTrackService.save(trunklineWaybillTrackEntity);
}
}
}
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
String cacheName = mallName + "仓";
BasicdataWarehouseEntity basicdataWarehouseEntity = bladeRedis.get(cacheName);
if (basicdataWarehouseEntity == null) {
basicdataWarehouseEntity = warehouseClient.findByName(mallName + "仓");
bladeRedis.setEx(cacheName, basicdataWarehouseEntity, 60 * 60 * 24L);
}
return basicdataWarehouseEntity;
}
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
List<Long> ids = Arrays.asList(trunklineAdvanceEntity.getId());
List<TrunklineAdvanceDetailVO> listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(ids);
List<TrunklineAdvanceDetailEntity> saveObjs = new ArrayList<>();
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : t) {
trunklineAdvanceDetailEntity.setId(null);
// 检测 保存的对象是否已经存在
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getOrderPackageCode().equals(trunklineAdvanceDetailEntity.getOrderPackageCode())) {
trunklineAdvanceDetailEntity.setId(listByAdvanceId.getId());
break;
}
}
if (trunklineAdvanceDetailEntity.getId() == null) {
trunklineAdvanceDetailEntity.setPackageStatus("0");
trunklineAdvanceDetailEntity.setAdvanceId(trunklineAdvanceEntity.getId());
trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId());
trunklineAdvanceDetailEntity.setIncomingWarehouseId(null);
trunklineAdvanceDetailEntity.setIncomingWarehouseName(null);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if (basicdataWarehouseEntity != null) {
trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
saveObjs.add(trunklineAdvanceDetailEntity);
}
}
advanceDetailService.saveBatch(saveObjs);
}
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
// 查找商户的暂存单是否存在改制
QueryWrapper<TrunklineAdvanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_code", trunklineAdvanceEntity.getOrderCode())
.last("limit 1");
TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象
if (basicdataWarehouseEntity != null) {
trunklineAdvanceEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
trunklineAdvanceEntity.setTenantId(tenant.getTenantId());
advanceService.save(trunklineAdvanceEntity);
return trunklineAdvanceEntity;
} else {
return trunklineAdvanceEntity1;
}
}
private Tenant changeDataBase(String maillName) {
R<Tenant> tenantByName = sysClient.getTenantByName(maillName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return null;
}
return tenant;
}
return null;
}
}

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

@ -3,6 +3,7 @@ package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -25,9 +26,11 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
@ -186,6 +189,26 @@ public class InComingServiceImpl implements IInComingService {
// 完结预入库数据状态
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderPackageCode", packageCode);
jsonObject.put("carNum", null);
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("messageData", jsonObject);
mapState.put("createTime", System.currentTimeMillis());
try {
rabbitTemplate.convertAndSend(RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_EXCHANGE, RabbitConstant.IN_WAREHOUSE_TO_BUSINESS_DATA_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
}
}else{

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save