Authored by chenchao

optimized : get hidden address by no hidden

... ... @@ -206,13 +206,14 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
}
//the address of send back 2 seller
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
logger.warn("submit appraise order addressId need update, uid {}, appraise {}, addressId {}",
uid, productId, addressId);
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
}
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHiddenBackAddress);
//dependency product service support produce data
ProductInfo productInfo = productProxyService.getProductInfo(uid, productId);
if (Objects.isNull(productInfo)){
... ...
... ... @@ -1054,8 +1054,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
@Override
public AddressInfo hiddenBackAddress(int uid, int addressId) {
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
public AddressInfo hiddenBackAddress(AddressInfo noHidden) {
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHidden);
return hiddenBackAddress;
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.utils.AddressUtil;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
... ... @@ -30,8 +31,9 @@ public class MetaAddressService<E> {
}
//the address of send back 2 seller
AddressInfo hiddenBackAddress = callBack.hiddenBackAddress(uid, addressId);
AddressInfo noHiddenBackAddress = callBack.noHiddenBackAddress(uid, addressId);
AddressInfo hiddenBackAddress = callBack.hiddenBackAddress(noHiddenBackAddress);
final String key = MetaKey.RECALL_ADDRESS, hiiden_key = MetaKey.RECALL_HIDDEN_ADDRESS;
E noHiddenAddressMeta= callBack.buildnoHiddenAddressMeta(uid, orderCode, key, noHiddenBackAddress);
... ... @@ -85,7 +87,7 @@ public class MetaAddressService<E> {
void updateMetaVal(E e);
AddressInfo hiddenBackAddress(int uid, int addressId);
AddressInfo hiddenBackAddress(AddressInfo noHiddenAddress);
AddressInfo noHiddenBackAddress(int uid, int addressId);
... ...
... ... @@ -216,14 +216,14 @@ public class SellerBidPublishService {
}
//the address of send back 2 seller
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if (AddressHelper.isNeedUpdate(noHiddenBackAddress)) {
logger.warn("addressId need update, uid is {}, addressId is {}",
uid, addressId);
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
}
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHiddenBackAddress);
return Pair.of(noHiddenBackAddress, hiddenBackAddress);
}
... ...
... ... @@ -605,8 +605,7 @@ public class ShoppingServiceImpl implements IShoppingService {
}
//脱敏的用户地址
AddressInfo hiddenAddress = userProxyService.getHiddenAddressInfo(shoppingRequest.getUid(), addressId);
AddressInfo hiddenAddress = UserProxyService.getHiddenAddressFromNotHidden(addressInfo);
return Pair.of(addressInfo, hiddenAddress);
}
... ...
... ... @@ -22,6 +22,7 @@ import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.convert.PrdPriceConvertor;
import com.yohoufo.order.convert.builder.AlarmEventBuilder;
import com.yohoufo.order.service.concurrent.ThreadPoolFactory;
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -248,8 +249,11 @@ public class ProductProxyService extends AbsProxyService{
}
public void addSalesInfo(Integer skup) {
Runnable addSalesTask = ()-> {
logger.info("order submit finished. 增加销量数据,skup= {}", skup);
ufoServiceCaller.call("ufo.product.addSales", skup);
};
ThreadPoolFactory.getCommomExecutorService().execute(addSalesTask);
}
public StorageDataResp getStorageData(int storageId){
... ...
... ... @@ -11,6 +11,7 @@ import com.yoho.service.model.request.UserAddressReqBO;
import com.yoho.service.model.social.response.UserInfoRspBO;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.utils.UserInfoHiddenHelper;
import com.yohoufo.dal.user.model.ZhiMaCert;
import com.yohoufo.order.convert.AddressInfoConvertor;
import com.yohoufo.order.service.IStoredSellerService;
... ... @@ -61,6 +62,38 @@ public class UserProxyService extends AbsProxyService{
}
/**
* {
* "address":"国家广告产业园5栋",
* "address_id":2394872,
* "area":"江苏省 南京市 建邺区 建邺区新城科技园",
* "areaCode":"320105400",
* "consignee":"陈超",
* "isUpdate":"N",
* "mobile":"18061464565",
* "phone":"null",
* "zipCode":"null"}
* @param noHiddenAddress
* @return
*/
public static AddressInfo getHiddenAddressFromNotHidden(AddressInfo noHiddenAddress){
String address = UserInfoHiddenHelper.getHiddenAddress(noHiddenAddress.getAddress());
String consignee = UserInfoHiddenHelper.getHiddenUserNickName(noHiddenAddress.getConsignee());
String mobile = UserInfoHiddenHelper.hidePhoneNo(noHiddenAddress.getMobile());
//
AddressInfo hiddenAddress = new AddressInfo();
hiddenAddress.setAreaCode(noHiddenAddress.getAreaCode());
hiddenAddress.setArea(noHiddenAddress.getArea());
hiddenAddress.setAddress_id(noHiddenAddress.getAddress_id());
hiddenAddress.setIsUpdate(noHiddenAddress.getIsUpdate());
//hidden
hiddenAddress.setAddress(address);
hiddenAddress.setConsignee(consignee);
hiddenAddress.setMobile(mobile);
return hiddenAddress;
}
/**
* 获取用户信息
* 地址不隐藏星号
* @param uid
... ...
... ... @@ -534,8 +534,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
}
@Override
public AddressInfo hiddenBackAddress(int uid, int addressId) {
return userProxyService.getHiddenAddressInfo(uid, addressId);
public AddressInfo hiddenBackAddress(AddressInfo noHidden) {
return UserProxyService.getHiddenAddressFromNotHidden(noHidden);
}
@Override
... ...
... ... @@ -75,14 +75,14 @@ public class ImperfectPublishProcessor implements PublishProcessor<ImperfectOrde
}
//the address of send back 2 seller
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
logger.warn("seller submit addressId need update, uid is {}, storageId is {}, addressId is {}",
uid, storageId, addressId);
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
}
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHiddenBackAddress);
ImperfectGoodsInfo imperfectGoodsInfo = checkImperfectGoodsInfo(iosr);
//step 1: rpc get product detail by storage id
... ...
... ... @@ -106,14 +106,14 @@ public class SellerOrderPrepareProcessor
}
//the address of send back 2 seller
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
log.warn("seller submit addressId need update, uid is {}, storageId is {}, addressId is {}",
uid, storageId, addressId);
throw new UfoServiceException(400,"您的收货地址缺少所在地的街道信息,请更新收货地址");
}
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHiddenBackAddress);
Integer businessClientCode = OrderAssist.findBusinessClientCode(req.getBusinessClient());
//
SellerOrderContext context = new SellerOrderContext();
... ...
... ... @@ -387,7 +387,7 @@ public class ShoppingSupport {
}
//脱敏的用户地址
AddressInfo hiddenAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo hiddenAddress = UserProxyService.getHiddenAddressFromNotHidden(addressInfo);
return Pair.of(addressInfo, hiddenAddress);
}
... ...