Browse Source

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

training
caoyizhong 1 year ago
parent
commit
4262fb2b81
  1. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWayBillDetail.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  3. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/WaybillDataHandler.java
  4. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWayBillDetail.java

@ -13,7 +13,7 @@ public class WarehouseWayBillDetail extends BaseEntity {
/** 运单号 */ /** 运单号 */
@ApiModelProperty(name = "运单号",notes = "") @ApiModelProperty(name = "运单号",notes = "")
private String waybillCode; private String waybillNo;
/** 运单号id */ /** 运单号id */
@ApiModelProperty(name = "运单id",notes = "") @ApiModelProperty(name = "运单id",notes = "")

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -93,7 +93,7 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
@Override @Override
public DistributionStockArticleEntity findByOrderSelfNum(String waybillNo) { public DistributionStockArticleEntity findByOrderSelfNum(String waybillNo) {
QueryWrapper<DistributionStockArticleEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<DistributionStockArticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_self_numbering",waybillNo); queryWrapper.eq("waybill_number",waybillNo);
return distributionStockArticleService.getOne(queryWrapper); return distributionStockArticleService.getOne(queryWrapper);
} }

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/WaybillDataHandler.java

@ -30,16 +30,20 @@ public class WaybillDataHandler {
@RabbitHandler @RabbitHandler
public void waybillDataHandler(Map map, Message message, Channel channel) { public void waybillDataHandler(Map map, Message message, Channel channel) {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉 // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
final long deliveryTag = message.getMessageProperties().getDeliveryTag(); final long deliveryTag = message.getMessageProperties().getDeliveryTag();
String msg = new String(message.getBody()); String msg = new String(message.getBody());
WaybillDTO waybillDTO = (WaybillDTO) map.get("messageData"); WaybillDTO waybillDTO = (WaybillDTO) map.get("messageData");
log.info("##################waybillDataHandler: 处理开单零单数据 waybillDTO={}",waybillDTO); log.info("##################waybillDataHandler: 处理开单零单数据 waybillDTO={}", waybillDTO);
if(!Objects.isNull(waybillDTO)) { if (!Objects.isNull(waybillDTO)) {
warehouseWaybillService.waybillDataHandler(waybillDTO); try {
}else { warehouseWaybillService.waybillDataHandler(waybillDTO);
log.info("##################waybillDataHandler: 处理开单零单数据 失败 WaybillNo={} ",waybillDTO.getWaybillNo()); } catch (Exception e) {
log.error(e.getMessage());
}
} else {
log.info("##################waybillDataHandler: 处理开单零单数据 失败 WaybillNo={} ", waybillDTO.getWaybillNo());
} }
} }
} }

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

@ -87,12 +87,12 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
WayBillEntity wayBillEntity = wayBillClient.getByWaybillId(wayBillId); WayBillEntity wayBillEntity = wayBillClient.getByWaybillId(wayBillId);
if(ObjectUtils.isNull(wayBillEntity)){ if (ObjectUtils.isNull(wayBillEntity)) {
log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillId={}", waybillDTO.getId()); log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillId={}", waybillDTO.getId());
throw new CustomerException("老系统中未找到对应运单"); throw new CustomerException("老系统中未找到对应运单");
} }
String waybillNo =wayBillEntity.getWaybillNo(); String waybillNo = wayBillEntity.getWaybillNo();
//通过运单号先去查询新系统是否存在这个运单号 //通过运单号先去查询新系统是否存在这个运单号
QueryWrapper<WarehouseWaybillEntity> waybillQueryWrapper = new QueryWrapper<>(); QueryWrapper<WarehouseWaybillEntity> waybillQueryWrapper = new QueryWrapper<>();
waybillQueryWrapper.eq("waybill_no", waybillNo); waybillQueryWrapper.eq("waybill_no", waybillNo);
@ -114,7 +114,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
for (WaybillDesEntity waybillDesEntity : des) { for (WaybillDesEntity waybillDesEntity : des) {
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail(); WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setWaybillId(waybillId); warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillCode(waybillNo); warehouseWayBillDetail.setWaybillNo(waybillNo);
warehouseWayBillDetail.setProductName(waybillDesEntity.getName()); warehouseWayBillDetail.setProductName(waybillDesEntity.getName());
warehouseWayBillDetail.setNum(waybillDesEntity.getNum()); warehouseWayBillDetail.setNum(waybillDesEntity.getNum());
warehouseWayBillDetail.setStatus(1); warehouseWayBillDetail.setStatus(1);
@ -123,8 +123,8 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
warehouseWayBillDetail.setUpdateTime(date); warehouseWayBillDetail.setUpdateTime(date);
ls.add(warehouseWayBillDetail); ls.add(warehouseWayBillDetail);
} }
warehouseWayBillDetailService.addList(ls); warehouseWayBillDetailService.addList(ls);
//创建在库订单
createStockArticle(warehouseWaybill); createStockArticle(warehouseWaybill);
} else { } else {
@ -343,6 +343,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
/** /**
* 插入运单 * 插入运单
*
* @param wayBillEntity * @param wayBillEntity
* @param allNum * @param allNum
* @return * @return

Loading…
Cancel
Save