|
@@ -12,6 +12,7 @@ import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum; |
|
@@ -12,6 +12,7 @@ import com.yohobuy.ufo.model.promotion.constant.CouponTypeEnum; |
12
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
12
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
13
|
import com.yohoufo.common.exception.UfoServiceException;
|
13
|
import com.yohoufo.common.exception.UfoServiceException;
|
14
|
import com.yohoufo.common.utils.AddressUtil;
|
14
|
import com.yohoufo.common.utils.AddressUtil;
|
|
|
15
|
+import com.yohoufo.common.utils.StringSimilarity;
|
15
|
import com.yohoufo.dal.order.SellerChangePriceRecordMapper;
|
16
|
import com.yohoufo.dal.order.SellerChangePriceRecordMapper;
|
16
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
17
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
17
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
18
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
|
@@ -122,6 +123,10 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
@@ -122,6 +123,10 @@ public class ShoppingServiceImpl implements IShoppingService { |
122
|
|
123
|
|
123
|
@Autowired
|
124
|
@Autowired
|
124
|
private ConfigReader configReader;
|
125
|
private ConfigReader configReader;
|
|
|
126
|
+
|
|
|
127
|
+ @Autowired
|
|
|
128
|
+ AppraiseAddressService appraiseAddressService;
|
|
|
129
|
+
|
125
|
/**
|
130
|
/**
|
126
|
* 结算页数据
|
131
|
* 结算页数据
|
127
|
* @param request
|
132
|
* @param request
|
|
@@ -449,6 +454,15 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
@@ -449,6 +454,15 @@ public class ShoppingServiceImpl implements IShoppingService { |
449
|
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
|
454
|
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
|
450
|
}
|
455
|
}
|
451
|
|
456
|
|
|
|
457
|
+ // 检查地址是否是鉴定中心的地址
|
|
|
458
|
+ List<AppraiseAddressResp> appraiseAddressRespList = appraiseAddressService.queryAddressInfoList();
|
|
|
459
|
+ List<String> appraiseAddressStrList = appraiseAddressRespList.stream().map(AppraiseAddressResp::getAddress).distinct().collect(Collectors.toList());
|
|
|
460
|
+ // 存在和鉴定中心相同的地址
|
|
|
461
|
+ if (appraiseAddressStrList.stream().filter(x->StringSimilarity.compute(x, addressInfo.getAddress())>0.5).findFirst().isPresent()){
|
|
|
462
|
+ logger.warn("submit address can not appraiseAddress, uid is {}, address is {}",shoppingRequest.getUid(), addressInfo.getAddress() );
|
|
|
463
|
+ throw new ServiceException(ServiceError.BUY_ADDRESS_CAN_NOT_APPRAISE_ADDRESS);
|
|
|
464
|
+ }
|
|
|
465
|
+
|
452
|
//脱敏的用户地址
|
466
|
//脱敏的用户地址
|
453
|
AddressInfo hiddenAddress = userProxyService.getHiddenAddressInfo(shoppingRequest.getUid(), addressId);
|
467
|
AddressInfo hiddenAddress = userProxyService.getHiddenAddressInfo(shoppingRequest.getUid(), addressId);
|
454
|
|
468
|
|