Authored by chenchao

fix

... ... @@ -30,6 +30,8 @@ import java.util.stream.Collectors;
public class AppraiseAddressService {
private static final Logger LOG = LoggerFactory.getLogger(AppraiseAddressService.class);
public static final int HK_AREA_CODE = 852;
private final static String CACHE_KEY="appraiseAddress_cache",
MAP_CACHE_KEY = "appraiseAddress_map",
LIST_CACHE_KEY = "appraiseAddress_list";
... ... @@ -73,7 +75,7 @@ public class AppraiseAddressService {
}
public AppraiseAddressResp queryHKAppraiseAddress() {
Integer provinceCode = 852;
final Integer provinceCode = HK_AREA_CODE;
Map<Integer, AppraiseAddress> map = buildCodeAppraiseAddressMap();
AppraiseAddress address = map.get(provinceCode);
if (Objects.nonNull(address)){
... ... @@ -206,8 +208,13 @@ public class AppraiseAddressService {
*/
public AppraiseAddressInfo findAppraiseAddress(Integer depotno, String areaCode){
AppraiseAddressResp addressResp = null;
if (areaCode!=null && areaCode.equals(String.valueOf(HK_AREA_CODE))){
addressResp = queryHKAppraiseAddress();
}
// 卖家已经发货选定了鉴定中心
if (depotno != null){
if (addressResp==null && depotno != null){
List<AppraiseAddressResp> addressRespList = queryAddressInfoList();
Map<Integer, AppraiseAddressResp> addressRespMap = addressRespList.stream()
.collect(Collectors.toMap(AppraiseAddressResp::getType, Function.identity(), (key1, key2)-> key1));
... ... @@ -216,7 +223,7 @@ public class AppraiseAddressService {
}
// 卖家未发货的情况,根据寄回地址就近选中一个鉴定中心
if (StringUtils.isNoneBlank(areaCode)){
if (addressResp==null && StringUtils.isNoneBlank(areaCode)){
addressResp = queryAddressByAreaCode(areaCode);
}
... ...
... ... @@ -548,10 +548,10 @@ public class SellerEnterApplyService {
if (notNotice && walletNotEnough){
String thresholdStr = MathUtils.formatCurrencyStr(bslfb.getWalletThreshold().doubleValue());
try {
logger.info("in processLargeSettlementSuperWhenWalletChange send mail uid {} sellerBo {} noticeCnt {}",
uid, sellerBo, noticeCnt);
String mailTo = configReader.getString("ufo.order.seller.noticeHKSellerEmailTo", "chao.chen@yoho.cn,xiuchun.luo@yoho.cn");
String content = String.format(getNoticeContent(sesl), thresholdStr);
logger.info("in processLargeSettlementSuperWhenWalletChange ready 2 send mail uid {} sellerBo {} noticeCnt {} mailTo {} content {}",
uid, sellerBo, noticeCnt, mailTo, content);
MailSender.newMailSender()
.subject("卖家服务提醒")
.to(mailTo)
... ...
... ... @@ -1723,6 +1723,7 @@ public class InBoxFacade {
switch (sesl){
case FULL:
smsIBT = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_WALLET_NOT_ENOUGH;
break;
case PARTITION:
smsIBT = InboxBusinessTypeEnum.SMS_LARGE_SETTLEMENT_SUPER_DEGRADE_PART_FUNC;
break;
... ...
... ... @@ -51,9 +51,9 @@ public class SellerEnterApplyServiceTest extends BaseWebTest {
@Test
public void testChangeLevel4Super(){
int uid = 20000760;
int uid = 500031424;
SellerWrapper sellerWrapper =sellerService.getBaseSellerWrapper(uid);
BigDecimal left = new BigDecimal(200);
BigDecimal left = new BigDecimal(6);
sellerEnterApplyService.changeLevel4Super(sellerWrapper, left);
}
}
... ...