...
|
...
|
@@ -68,23 +68,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
public void deliverToDepot(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode) {
|
|
|
LOGGER.info("deliverToDepot uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode});
|
|
|
|
|
|
//保存物流信息+更新订单状态
|
|
|
saveExpressAndUpdateBuyerOrderStatus(uid,expressCompanyId,orderCode,wayBillCode,ExpressInfoConstant.EXPRESS_TYPE_1,OrderStatus.SELLER_SEND_OUT);
|
|
|
//保存物流信息+更新订单状态;
|
|
|
//本阶段的物流类型和订单状态
|
|
|
Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_1;
|
|
|
OrderStatus orderStatus=OrderStatus.SELLER_SEND_OUT;
|
|
|
|
|
|
// 发送mq获取物流信息
|
|
|
sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode);
|
|
|
LOGGER.info("deliverToDepot end ! send express to erp ");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存物流信息
|
|
|
* 更新订单状态
|
|
|
* @param uid
|
|
|
* @param expressCompanyId
|
|
|
* @param orderCode
|
|
|
* @param wayBillCode
|
|
|
*/
|
|
|
private void saveExpressAndUpdateBuyerOrderStatus(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer expressType,OrderStatus orderStatus){
|
|
|
LOGGER.info("deliverToDepot saveExpressAndUpdateBuyerOrderStatus uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
|
|
|
",expressType = {} ,orderStatus = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode,expressType,orderStatus});
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
...
|
...
|
@@ -94,6 +82,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
|
|
}
|
|
|
|
|
|
if(uid!=buyerOrder.getUid()){
|
|
|
LOGGER.warn("deliverToDepot saveExpressAndUpdateBuyerOrderStatus uid {} not equal buyer order uid {}",uid, buyerOrder.getUid());
|
|
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
|
|
}
|
|
|
|
|
|
// 保存订单物流信息
|
|
|
int ts=DateUtil.getCurrentTimeSecond();
|
|
|
ExpressInfo expressInfo=new ExpressInfo();
|
...
|
...
|
@@ -112,6 +105,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
buyerOrder.setUpdateTime(ts);
|
|
|
LOGGER.info("deliverToDepot update buyer order {} ", buyerOrder);
|
|
|
buyerOrderMapper.updateByPrimaryKeySelective(buyerOrder);
|
|
|
|
|
|
// 发送mq获取物流信息
|
|
|
sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode);
|
|
|
LOGGER.info("deliverToDepot end ! send express to erp ");
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -151,8 +148,16 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public ExpressInfoRespBo queryExpressDetailInfo(Integer uid,Long orderCode) {
|
|
|
public ExpressInfoRespBo queryExpressDetailInfo(Long orderCode) {
|
|
|
LOGGER.info("queryExpressDetailInfo orderCode = {}", orderCode);
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
|
|
|
if (buyerOrder == null){
|
|
|
LOGGER.warn("getOrderInfo order not exist, orderCode is {}", orderCode);
|
|
|
throw new ServiceException(ServiceError.ORDER_NULL);
|
|
|
}
|
|
|
|
|
|
Integer uid=buyerOrder.getUid();
|
|
|
ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo();
|
|
|
Integer expressType = getExpressType(orderCode);
|
|
|
LOGGER.info("getExpressType result = {}", expressType);
|
...
|
...
|
|