Authored by mali

防止发货到鉴定中心重复提交导致物流信息重新记录

@@ -116,17 +116,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -116,17 +116,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
116 throw new ServiceException(ServiceError.ORDER_NULL); 116 throw new ServiceException(ServiceError.ORDER_NULL);
117 } 117 }
118 118
119 - // 保存订单物流信息  
120 - saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);  
121 -  
122 - // 发送mq获取物流信息  
123 - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode);  
124 - LOGGER.info("deliverToDepot end ! send express to erp ");  
125 -  
126 //根据skup ,更新鉴定中心 119 //根据skup ,更新鉴定中心
127 - int skup;  
128 SellerOrderGoods sellerOrderGoods=new SellerOrderGoods(); 120 SellerOrderGoods sellerOrderGoods=new SellerOrderGoods();
129 - sellerOrderGoods.setId(skup=buyerOrderGoods.getSkup()); 121 + sellerOrderGoods.setId(buyerOrderGoods.getSkup());
130 sellerOrderGoods.setDepotNo(depotNum); 122 sellerOrderGoods.setDepotNo(depotNum);
131 sellerOrderGoodsMapper.updateByPrimaryKeySelective(sellerOrderGoods); 123 sellerOrderGoodsMapper.updateByPrimaryKeySelective(sellerOrderGoods);
132 124
@@ -135,6 +127,16 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -135,6 +127,16 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
135 // 更新买家订单状态 127 // 更新买家订单状态
136 int updateBuyerCnt = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerOrder.getUid(), 128 int updateBuyerCnt = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerOrder.getUid(),
137 expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond()); 129 expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond());
  130 + if (updateBuyerCnt > 0) { // 更新买家订单成功之后,插入物流信息。防止并发、重复提交
  131 + // 保存订单物流信息
  132 + saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
  133 +
  134 + // 发送mq获取物流信息
  135 + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode);
  136 +
  137 + LOGGER.info("deliverToDepot end ! send express to erp ");
  138 + }
  139 +
138 LOGGER.info("deliverToDepot update buyer order status result {} ",updateBuyerCnt); 140 LOGGER.info("deliverToDepot update buyer order status result {} ",updateBuyerCnt);
139 141
140 142