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")
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);
}
@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();
if(Objects.isNull(warehouseEntryTimeEnd)){
warehouseEntryTimeEnd = parcelListEntity.getCreateTime();
}
long time = warehouseEntryTimeEnd.getTime();
if(firstEntryTime == 0L){
@ -1364,6 +1367,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
}
stockArticleEntity.setIncomingNum(incomingNum);
stockArticleEntity.setHandQuantity(handleNum);
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, "保存包件信息失败");
}else{
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{
distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
// Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
//
// if(handQuantity+1 >= totalNumber){
// distributionStockArticleEntity.setCompleteSet(1);
// distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
// distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
// }else{
// distributionStockArticleEntity.setCompleteSet(0);
// distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
// distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
// }
// distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
// 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);
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`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY
`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>
@ -111,11 +113,13 @@
AND `i`.`goods_type` = '1'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY
`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}
</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 signState = orderDetailEntity.getSignState();
waybillNo = orderDetailEntity.getWaybillNo();
Date rukuTime = orderDetailEntity.getCreateTime();
//存入运单信息
WayBillEntity waybillEntity = saveWaybillEntity(waybillNo);
@ -1408,9 +1409,20 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
// if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// }
// if(2 == signState){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
// }
if(2 == signState){
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.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
@ -1431,7 +1443,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName());
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime));
entity.setWarehouseEntryTimeEnd(rukuTime);
entity.setMaterialCode(vo.getMaterialCode());
entity.setMaterialName(vo.getMaterialName());
@ -1455,20 +1467,21 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
}else{
log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{
distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// distributionStockArticleClient.updateOrderInfo(orderCode,distributionStockArticleEntity.getWarehouseId());
// Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
// Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
//
// if(handQuantity+1 >= totalNumber){
// distributionStockArticleEntity.setCompleteSet(1);
// distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
// distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
// }else{
// distributionStockArticleEntity.setCompleteSet(0);
// distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
// distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
// }
// distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
// distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
}

Loading…
Cancel
Save