...
|
...
|
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl; |
|
|
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.alarm.SmsAlarmEvent;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
...
|
...
|
@@ -67,7 +68,8 @@ public class AppraiseService { |
|
|
TransferService transferService;
|
|
|
|
|
|
|
|
|
public boolean appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){
|
|
|
public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){
|
|
|
ApiResponse apiResponse=new ApiResponse();
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
|
|
|
if (buyerOrder == null){
|
...
|
...
|
@@ -133,6 +135,9 @@ public class AppraiseService { |
|
|
AlarmConfig alarmConfig = AlarmConfig.APPRAISE_SUCCESS;
|
|
|
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent(alarmConfig.getRefundName(), alarmConfig.name(), content);
|
|
|
EventBusPublisher.publishEvent(smsAlarmEvent);
|
|
|
|
|
|
apiResponse.setCode(400);
|
|
|
apiResponse.setMessage(content);
|
|
|
}finally {
|
|
|
// 更新买家订单状态
|
|
|
LOGGER.info("appraiseSuccess update buyer order {} ", buyerOrder);
|
...
|
...
|
@@ -166,7 +171,7 @@ public class AppraiseService { |
|
|
sellerOrder.getStatus(), expectSOStatus);
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
return apiResponse;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -179,7 +184,8 @@ public class AppraiseService { |
|
|
* @param wayBillCode
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){
|
|
|
public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){
|
|
|
ApiResponse apiResponse=new ApiResponse();
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
|
|
|
if (buyerOrder == null){
|
...
|
...
|
@@ -235,6 +241,8 @@ public class AppraiseService { |
|
|
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent(alarmConfig.getRefundName(), alarmConfig.name(), content);
|
|
|
EventBusPublisher.publishEvent(smsAlarmEvent);
|
|
|
|
|
|
apiResponse.setCode(400);
|
|
|
apiResponse.setMessage(content);
|
|
|
}finally {
|
|
|
// 更新买家订单状态 为鉴定不通过
|
|
|
OrderStatus targetStatus = OrderStatus.CHECKING_FAKE;
|
...
|
...
|
@@ -243,8 +251,8 @@ public class AppraiseService { |
|
|
DateUtil.getCurrentTimeSecond());
|
|
|
//更新物流信息,写到最后
|
|
|
expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return apiResponse;
|
|
|
}
|
|
|
} |
...
|
...
|
|