Authored by qinchao

触发物流

... ... @@ -18,6 +18,8 @@ import java.util.Objects;
*/
public interface IExpressInfoService {
void triggerExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile );
/**
* 卖家发货到鉴定中心
*
... ...
... ... @@ -229,6 +229,7 @@ public class AppraiseService {
* 触发物流
*/
public void triggerSellerToPlatformExpress(AppraiseExpressInfoBo appraiseExpressInfoBo ){
LOGGER.info("AppraiseService triggerSellerToPlatformExpress enter , appraiseExpressInfoBo {} ",appraiseExpressInfoBo);
Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
String wayBillCode = appraiseExpressInfoBo.getWayBillCode();
Long orderCode = appraiseExpressInfoBo.getOrderCode();
... ... @@ -244,16 +245,23 @@ public class AppraiseService {
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
if (buyerOrder == null){
LOGGER.warn("returnBack getOrderInfo order not exist, orderCode {}", orderCode);
LOGGER.warn("triggerSellerToPlatformExpress getOrderInfo order not exist, orderCode {}", orderCode);
throw new ServiceException(ServiceError.ORDER_NULL);
}
Integer uid = buyerOrder.getSellerUid();
String mobile ="";
AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);
if(appraiseAddressResp!=null){
mobile = appraiseAddressResp.getMobile();
//只有卖家已发货才能更改物流
if(buyerOrder.getStatus().byteValue() == OrderStatus.SELLER_SEND_OUT.getCode()) {
LOGGER.info("triggerSellerToPlatformExpress begin trigger , orderCode {}", orderCode);
Integer uid = buyerOrder.getSellerUid();
String mobile ="";
AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);
if(appraiseAddressResp!=null){
mobile = appraiseAddressResp.getMobile();
}
expressInfoService.triggerExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
}else{
LOGGER.info("triggerSellerToPlatformExpress not trigger because of error status , orderCode {} ,status {}", orderCode,buyerOrder.getStatus());
}
//sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
}
/**
... ...
... ... @@ -229,6 +229,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
expressRecordMapper.insert(record);
}
@Override
public void triggerExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile ){
// 发送mq获取物流信息
sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
LOGGER.info("triggerExpressMQ end ! send express to erp ");
}
/**
* 发送mq消息,获取物流信息
*/
... ...