Browse Source

1.修改同步订单数据的逻辑

2.修改推送数据更新订单信息的逻辑
newStockUp
zhenghaoyu 1 year ago
parent
commit
1da25c28db
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  2. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  4. 28
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  5. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java
  6. 16
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
  7. 49
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -124,4 +124,7 @@ public interface IDistributionStockArticleClient {
@GetMapping(API_PREFIX + "/addIncomingNum") @GetMapping(API_PREFIX + "/addIncomingNum")
void addIncomingNum(@RequestParam Long orderId, @RequestParam Integer num); void addIncomingNum(@RequestParam Long orderId, @RequestParam Integer num);
@GetMapping(API_PREFIX + "/updateOrderInfo")
void updateOrderInfo(@RequestParam String orderCode, @RequestParam Long warehouseId);
} }

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

@ -257,4 +257,9 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
distributionStockArticleService.addIncomingNumk(orderId,num); distributionStockArticleService.addIncomingNumk(orderId,num);
} }
@Override
public void updateOrderInfo(String orderCode, Long warehouseId) {
distributionStockArticleService.updateOrderInfo(orderCode,warehouseId);
}
} }

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -1303,6 +1303,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
} }
Date warehouseEntryTimeEnd = parcelListEntity.getWarehouseEntryTimeEnd(); Date warehouseEntryTimeEnd = parcelListEntity.getWarehouseEntryTimeEnd();
if(Objects.isNull(warehouseEntryTimeEnd)){
warehouseEntryTimeEnd = parcelListEntity.getCreateTime();
}
long time = warehouseEntryTimeEnd.getTime(); long time = warehouseEntryTimeEnd.getTime();
if(firstEntryTime == 0L){ if(firstEntryTime == 0L){
@ -1364,6 +1367,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
} }
} }
stockArticleEntity.setIncomingNum(incomingNum);
stockArticleEntity.setHandQuantity(handleNum);
updateById(stockArticleEntity); updateById(stockArticleEntity);
} }

28
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -754,20 +754,20 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
throw new CustomerException(405, "保存包件信息失败"); throw new CustomerException(405, "保存包件信息失败");
}else{ }else{
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode()); logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity(); // Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber(); // Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
//
if(handQuantity+1 >= totalNumber){ // if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1); // distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue()); // distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); // distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{ // }else{
distributionStockArticleEntity.setCompleteSet(0); // distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue()); // distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); // distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
} // }
distributionStockArticleEntity.setHandQuantity(handQuantity + 1); // distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); // distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
} }
} }
} }

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java

@ -101,6 +101,6 @@ public class AdvanceClient implements IAdvanceClient {
List<AdvanceEntity> list = service.findListByAdvanceIds(advanceIds); List<AdvanceEntity> list = service.findListByAdvanceIds(advanceIds);
return null; return list;
} }
} }

16
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml

@ -51,11 +51,13 @@
AND `i`.`goods_type` = '1' AND `i`.`goods_type` = '1'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 ) AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId} and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY ORDER BY
`i`.`update_time` DESC) t on `o`.order_code = t.orderSelfNum `i`.`update_time` DESC) t on `o`.order_code = t.orderSelfNum
where 1=1
and `o`.is_update = 0
<if test="param != null and param != ''">
AND t.orderSelfNum = #{param}
</if>
</select> </select>
@ -111,11 +113,13 @@
AND `i`.`goods_type` = '1' AND `i`.`goods_type` = '1'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 ) AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId} and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY ORDER BY
`i`.`id` DESC) t on `o`.order_code = t.orderSelfNum `i`.`id` DESC) t on `o`.order_code = t.orderSelfNum
where 1=1
and `o`.is_update = 0
<if test="param != null and param != ''">
AND t.orderSelfNum = #{param}
</if>
LIMIT #{pageNum},#{pageSize} LIMIT #{pageNum},#{pageSize}
</select> </select>

49
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1386,6 +1386,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
Integer carsType = orderDetailEntity.getCarsType(); Integer carsType = orderDetailEntity.getCarsType();
Integer signState = orderDetailEntity.getSignState(); Integer signState = orderDetailEntity.getSignState();
waybillNo = orderDetailEntity.getWaybillNo(); waybillNo = orderDetailEntity.getWaybillNo();
Date rukuTime = orderDetailEntity.getCreateTime();
//存入运单信息 //存入运单信息
WayBillEntity waybillEntity = saveWaybillEntity(waybillNo); WayBillEntity waybillEntity = saveWaybillEntity(waybillNo);
@ -1408,9 +1409,20 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
// if(3==carsType||4 == carsType){ // if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); // entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// } // }
// if(2 == signState){ if(2 == signState){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
// } }else{
String warehouseName = waybillEntity.getWarehouseName();//目的仓
BasicdataWarehouseEntity endhouse = basicdataWarehouseClient.findByName(warehouseName);
Long endWarehouseId = endhouse.getId();
Long warehouseId = distributionStockArticleEntity.getWarehouseId();
if(endWarehouseId.equals(warehouseId)){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
}else{
entity.setOrderPackageStatus(OrderPackageStatusConstant.zhongzhuanruku.getValue());
}
}
entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue()); entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue());
entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
@ -1431,7 +1443,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName()); entity.setDealerName(distributionStockArticleEntity.getDealerName());
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); entity.setWarehouseEntryTimeEnd(rukuTime);
entity.setMaterialCode(vo.getMaterialCode()); entity.setMaterialCode(vo.getMaterialCode());
entity.setMaterialName(vo.getMaterialName()); entity.setMaterialName(vo.getMaterialName());
@ -1455,20 +1467,21 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
}else{ }else{
log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode()); log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity(); // distributionStockArticleClient.updateOrderInfo(orderCode,distributionStockArticleEntity.getWarehouseId());
Integer totalNumber = distributionStockArticleEntity.getTotalNumber(); // Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
// Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){ //
distributionStockArticleEntity.setCompleteSet(1); // if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue()); // distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); // distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
}else{ // distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
distributionStockArticleEntity.setCompleteSet(0); // }else{
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue()); // distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); // distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
} // distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
distributionStockArticleEntity.setHandQuantity(handQuantity + 1); // }
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); // distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
// distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
} }
} }

Loading…
Cancel
Save