|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.logpm.basic.entity.BasicMaterialEntity; |
|
|
|
@ -18,6 +20,7 @@ import com.logpm.distribution.feign.IDistributionParcelListClient;
|
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockArticleClient; |
|
|
|
|
import com.logpm.trunkline.dto.AdvanceDTO; |
|
|
|
|
import com.logpm.trunkline.dto.InComingDTO; |
|
|
|
|
import com.logpm.trunkline.dto.OrderStatusDTO; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; |
|
|
|
|
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper; |
|
|
|
@ -29,12 +32,14 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
|
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.TenantNum; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
@ -53,6 +58,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
private final IBasicdataTripartiteMallClient tripartiteMallClient; |
|
|
|
|
private final IWarehouseWaybillClient warehouseWaybillClient; |
|
|
|
|
private final IBasicdataTripartiteMallClient basicdataTripartiteMallClient; |
|
|
|
|
private final RabbitTemplate rabbitTemplate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -626,7 +632,25 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
orderPackageCodes.add(orderPackageCode); |
|
|
|
|
} |
|
|
|
|
parcelListClient.addBatch(parcelListEntityList); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if(CollUtil.isNotEmpty(parcelListEntityList)){ |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { |
|
|
|
|
// 发送入库消息
|
|
|
|
|
OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); |
|
|
|
|
// 通过包件id 查询包件
|
|
|
|
|
orderStatusDTO.setUnitNo(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
orderStatusDTO.setOrderNo(parcelListEntity.getOrderCode()); |
|
|
|
|
orderStatusDTO.setStatus("4"); |
|
|
|
|
orderStatusDTO.setOperationTime(DateUtil.now()); |
|
|
|
|
orderStatusDTO.setCurrentWarehouse(warehouseId.toString()); |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO)); |
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("入库推送失败:{}", e); |
|
|
|
|
} |
|
|
|
|
return orderPackageCodes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|