...
|
...
|
@@ -16,6 +16,7 @@ import java.util.stream.Collectors; |
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.yoho.ufo.order.service.event.DepotNumUpdateEvent;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
...
|
...
|
@@ -25,6 +26,8 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.context.ApplicationContextAware;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
...
|
...
|
@@ -130,7 +133,7 @@ import com.yohobuy.ufo.model.resp.product.SecondDetailResp; |
|
|
* @date 2018/9/13
|
|
|
*/
|
|
|
@Service
|
|
|
public class BuyerOrderServiceImpl implements IBuyerOrderService {
|
|
|
public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationContextAware {
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(BuyerOrderServiceImpl.class);
|
|
|
|
...
|
...
|
@@ -888,6 +891,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_CONFIRM_RECEIVE.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
|
|
|
updateDeptNo(Long.valueOf(buyerOrder.getOrderCode()), null, req.getPhoneUid());
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, "");
|
|
|
LOGGER.info("confirmReceive saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
...
|
...
|
@@ -920,6 +925,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
if(jsonObject == null || jsonObject.getIntValue("code") != 200) {
|
|
|
throw new ServiceException(400,"错误:订单"+orderCode +"确认收货失败");
|
|
|
}
|
|
|
|
|
|
updateDeptNo(null, sellerWaybillCode, req.getPhoneUid());
|
|
|
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, ""); //记录操作日志
|
|
|
LOGGER.info("confirmReceive saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
}
|
...
|
...
|
@@ -1627,7 +1635,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_REJECT.getByteVal()
|
|
|
||buyerOrder.getStatus().byteValue() == Constant.CANCEL_MINI_FAULT_OUT_TIME_REJECT.getByteVal()
|
|
|
||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()
|
|
|
||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal()){
|
|
|
||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal()
|
|
|
||buyerOrder.getStatus().byteValue() == Constant.CS_CANCEL_BEFORE_DEPOT_RECEIVE.getByteVal()){
|
|
|
//卖家地址
|
|
|
LOGGER.info("getDeliveryAddressByOrderCode call seller address ,req is {}", req);
|
|
|
return this.getSendBackInfoByOrderCode(req);
|
...
|
...
|
@@ -2531,7 +2540,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int addAbnormalPackage(String sellerWaybillCode) {
|
|
|
public int addAbnormalPackage(BuyerOrderReq req) {
|
|
|
String sellerWaybillCode = req.getSellerWaybillCode();
|
|
|
|
|
|
//数据库已存在
|
|
|
AbnormalPackage pkg = abnormalPackageMapper.selectBySellerWaybillCode(sellerWaybillCode);
|
|
|
if(null != pkg) {
|
...
|
...
|
@@ -2543,6 +2554,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
pkg.setIsDel(0);
|
|
|
pkg.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
pkg.setOperateUid(new UserHelper().getUserId());
|
|
|
|
|
|
// 校验鉴定中心是否是当前的鉴定室
|
|
|
updateDeptNo(null, sellerWaybillCode, req.getPhoneUid());
|
|
|
|
|
|
return abnormalPackageMapper.insert(pkg);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -3028,5 +3043,23 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private void updateDeptNo(Long orderCode, String wayBillCode, String phoneUid) {
|
|
|
LOGGER.error("method. updateDeptNo begin orderCode is {} , wayBillCode is {}, phoneUid is {}", orderCode, wayBillCode, phoneUid);
|
|
|
|
|
|
PhoneUidDepot phoneUidDepot = phoneUidDepotMapper.selectByphoneUid(phoneUid);
|
|
|
|
|
|
if (null == phoneUidDepot) {
|
|
|
LOGGER.error("phoneUidDepotMapper.selectByphoneUid is null phoneUid is {}", phoneUid);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
applicationContext.publishEvent(new DepotNumUpdateEvent(new AppraiseExpressInfoBo(null , orderCode, wayBillCode, phoneUidDepot.getDepotNo(), null)));
|
|
|
}
|
|
|
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) {
|
|
|
this.applicationContext = applicationContext;
|
|
|
}
|
|
|
} |
...
|
...
|
|