...
|
...
|
@@ -11,17 +11,16 @@ import com.yohobuy.ufo.model.order.resp.OrderCntResp; |
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
|
|
import com.yohoufo.common.utils.AddressUtil;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.UserInfoHiddenHelper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
import com.yohoufo.dal.order.QualityCheckMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
|
|
import com.yohoufo.dal.product.ProductMapper;
|
|
|
import com.yohoufo.dal.product.model.Product;
|
|
|
import com.yohoufo.order.common.ActionStatusHold;
|
|
|
import com.yohoufo.order.common.DelStatus;
|
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.event.*;
|
|
|
import com.yohoufo.order.model.PayQueryBo;
|
|
|
import com.yohoufo.order.model.request.OrderRequest;
|
...
|
...
|
@@ -40,6 +39,7 @@ import com.yohoufo.order.service.pay.AbstractPayService; |
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
|
|
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
|
|
import com.yohoufo.order.service.proxy.UserProxyService;
|
|
|
import com.yohoufo.order.utils.BuyerOrderUtils;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
...
|
...
|
@@ -775,6 +775,85 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetStatus.getCode());
|
|
|
}
|
|
|
}
|
|
|
@Autowired
|
|
|
private BuyerOrderMetaMapper buyerOrderMetaMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private UserProxyService userProxyService;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void modifyAddressOfDepositOrder(int uid, Long orderCode, String addressIdstr) {
|
|
|
int addressId = AddressUtil.getDecryptStr(addressIdstr);
|
|
|
if (addressId < 0){
|
|
|
logger.warn("modifyAddressOfDepositOrder addressId invalidate, uid {}, orderCode {}, addressId is {}",
|
|
|
uid, orderCode, addressIdstr);
|
|
|
throw new ServiceException(ServiceError.ORDER_ADDRESSID_INVALIDATE);
|
|
|
}
|
|
|
BuyerOrder pbo = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
if (pbo == null ){
|
|
|
logger.warn("in modifyAddressOfDepositOrder BuyerOrder is null,uid {} orderCode {} addressIdstr {}",
|
|
|
uid, orderCode, addressIdstr);
|
|
|
return;
|
|
|
}
|
|
|
Integer oa;
|
|
|
if (OrderAttributes.DEPOSITE.getCode() != (oa=pbo.getAttributes())){
|
|
|
logger.warn("in modifyAddressOfDepositOrder BuyerOrder.Attributes is {},uid {} orderCode {} addressIdstr {}",
|
|
|
oa, uid, orderCode, addressIdstr);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
//the address of send back 2 seller
|
|
|
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
|
|
|
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
|
|
|
final String key = MetaKey.RECALL_ADDRESS, hiiden_key = MetaKey.RECALL_HIDDEN_ADDRESS;
|
|
|
BuyerOrderMeta noHiddenAddressMeta=new BuyerOrderMeta();
|
|
|
noHiddenAddressMeta.setUid(uid);
|
|
|
noHiddenAddressMeta.setOrderCode(orderCode);
|
|
|
noHiddenAddressMeta.setMetaKey(key);
|
|
|
noHiddenAddressMeta.setMetaValue(JSONObject.toJSONString(noHiddenBackAddress));
|
|
|
//hidden address
|
|
|
BuyerOrderMeta hiddenAddressMeta=new BuyerOrderMeta();
|
|
|
hiddenAddressMeta.setUid(uid);
|
|
|
hiddenAddressMeta.setOrderCode(orderCode);
|
|
|
hiddenAddressMeta.setMetaKey(hiiden_key);
|
|
|
hiddenAddressMeta.setMetaValue(JSONObject.toJSONString(hiddenBackAddress));
|
|
|
//
|
|
|
List<BuyerOrderMeta> boms = new ArrayList<>(2);
|
|
|
boms.add(noHiddenAddressMeta);
|
|
|
boms.add(hiddenAddressMeta);
|
|
|
|
|
|
|
|
|
List<BuyerOrderMeta> pboms = buyerOrderMetaMapper.selectByMetaKeys(uid, orderCode, Arrays.asList(key, hiiden_key));
|
|
|
|
|
|
if(CollectionUtils.isEmpty(pboms)){
|
|
|
buyerOrderMetaMapper.insertBatch(boms);
|
|
|
}else{
|
|
|
boolean hitNoHidden = false;
|
|
|
boolean hitHidden = false;
|
|
|
for (BuyerOrderMeta pbom : pboms){
|
|
|
if (pbom.getMetaKey().equals(hiiden_key)){
|
|
|
hitHidden = true;
|
|
|
}
|
|
|
|
|
|
if (pbom.getMetaKey().equals(key)){
|
|
|
hitNoHidden = true;
|
|
|
}
|
|
|
}
|
|
|
doPersistent4AddessMeta(hitHidden, hiddenAddressMeta);
|
|
|
doPersistent4AddessMeta(hitNoHidden, noHiddenAddressMeta);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void doPersistent4AddessMeta(boolean isExisted, BuyerOrderMeta bom){
|
|
|
if (isExisted){
|
|
|
buyerOrderMetaMapper.updateMetaValueByUidAndOrderCodeAndMetaKey(bom);
|
|
|
}else {
|
|
|
buyerOrderMetaMapper.insert(bom);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//清理缓存
|
...
|
...
|
|