Authored by qinchao

触发物流

@@ -18,6 +18,8 @@ import java.util.Objects; @@ -18,6 +18,8 @@ import java.util.Objects;
18 */ 18 */
19 public interface IExpressInfoService { 19 public interface IExpressInfoService {
20 20
  21 + void triggerExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile );
  22 +
21 /** 23 /**
22 * 卖家发货到鉴定中心 24 * 卖家发货到鉴定中心
23 * 25 *
@@ -229,6 +229,7 @@ public class AppraiseService { @@ -229,6 +229,7 @@ public class AppraiseService {
229 * 触发物流 229 * 触发物流
230 */ 230 */
231 public void triggerSellerToPlatformExpress(AppraiseExpressInfoBo appraiseExpressInfoBo ){ 231 public void triggerSellerToPlatformExpress(AppraiseExpressInfoBo appraiseExpressInfoBo ){
  232 + LOGGER.info("AppraiseService triggerSellerToPlatformExpress enter , appraiseExpressInfoBo {} ",appraiseExpressInfoBo);
232 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId(); 233 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
233 String wayBillCode = appraiseExpressInfoBo.getWayBillCode(); 234 String wayBillCode = appraiseExpressInfoBo.getWayBillCode();
234 Long orderCode = appraiseExpressInfoBo.getOrderCode(); 235 Long orderCode = appraiseExpressInfoBo.getOrderCode();
@@ -244,16 +245,23 @@ public class AppraiseService { @@ -244,16 +245,23 @@ public class AppraiseService {
244 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 245 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
245 246
246 if (buyerOrder == null){ 247 if (buyerOrder == null){
247 - LOGGER.warn("returnBack getOrderInfo order not exist, orderCode {}", orderCode); 248 + LOGGER.warn("triggerSellerToPlatformExpress getOrderInfo order not exist, orderCode {}", orderCode);
248 throw new ServiceException(ServiceError.ORDER_NULL); 249 throw new ServiceException(ServiceError.ORDER_NULL);
249 } 250 }
250 - Integer uid = buyerOrder.getSellerUid();  
251 - String mobile ="";  
252 - AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);  
253 - if(appraiseAddressResp!=null){  
254 - mobile = appraiseAddressResp.getMobile(); 251 +
  252 + //只有卖家已发货才能更改物流
  253 + if(buyerOrder.getStatus().byteValue() == OrderStatus.SELLER_SEND_OUT.getCode()) {
  254 + LOGGER.info("triggerSellerToPlatformExpress begin trigger , orderCode {}", orderCode);
  255 + Integer uid = buyerOrder.getSellerUid();
  256 + String mobile ="";
  257 + AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);
  258 + if(appraiseAddressResp!=null){
  259 + mobile = appraiseAddressResp.getMobile();
  260 + }
  261 + expressInfoService.triggerExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
  262 + }else{
  263 + LOGGER.info("triggerSellerToPlatformExpress not trigger because of error status , orderCode {} ,status {}", orderCode,buyerOrder.getStatus());
255 } 264 }
256 - //sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);  
257 } 265 }
258 266
259 /** 267 /**
@@ -229,6 +229,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -229,6 +229,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
229 expressRecordMapper.insert(record); 229 expressRecordMapper.insert(record);
230 } 230 }
231 231
  232 + @Override
  233 + public void triggerExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile ){
  234 + // 发送mq获取物流信息
  235 + sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
  236 + LOGGER.info("triggerExpressMQ end ! send express to erp ");
  237 + }
232 /** 238 /**
233 * 发送mq消息,获取物流信息 239 * 发送mq消息,获取物流信息
234 */ 240 */