Authored by mali

Merge branch 'test6.9.7'

@@ -214,6 +214,7 @@ public class ChargeService { @@ -214,6 +214,7 @@ public class ChargeService {
214 */ 214 */
215 private void calculateShippingAmount(ChargeContext chargeContext) { 215 private void calculateShippingAmount(ChargeContext chargeContext) {
216 double deliveryWayCost = 0D; 216 double deliveryWayCost = 0D;
  217 + double finalDeliverAmount = 0D;
217 //如果是门店自提,则免运费 218 //如果是门店自提,则免运费
218 DeliveryWayEnum deliveryWay = DeliveryWayEnum.getByCode(chargeContext.getChargeParam().getDeliveryWay()); 219 DeliveryWayEnum deliveryWay = DeliveryWayEnum.getByCode(chargeContext.getChargeParam().getDeliveryWay());
219 if (deliveryWay == null){ 220 if (deliveryWay == null){
@@ -222,6 +223,7 @@ public class ChargeService { @@ -222,6 +223,7 @@ public class ChargeService {
222 switch (deliveryWay){ 223 switch (deliveryWay){
223 case SELF_FETCH: 224 case SELF_FETCH:
224 deliveryWayCost = 0D; 225 deliveryWayCost = 0D;
  226 + finalDeliverAmount = 0D;
225 break; 227 break;
226 case OVERSEAS_HONGHONG: 228 case OVERSEAS_HONGHONG:
227 BigDecimal shipFee = chargeContext.getChargeParam().getShipFee(); 229 BigDecimal shipFee = chargeContext.getChargeParam().getShipFee();
@@ -233,12 +235,13 @@ public class ChargeService { @@ -233,12 +235,13 @@ public class ChargeService {
233 } 235 }
234 AmountCutPolicy shipFeeCutPolicy = chargeContext.getChargeParam().getShipFeeCutPolicy(); 236 AmountCutPolicy shipFeeCutPolicy = chargeContext.getChargeParam().getShipFeeCutPolicy();
235 SingleFeeDetail shipFeeDetail = calculateOverSeasOrderShipAmount(deliveryWayCost, shipFeeCutPolicy); 237 SingleFeeDetail shipFeeDetail = calculateOverSeasOrderShipAmount(deliveryWayCost, shipFeeCutPolicy);
236 - deliveryWayCost = shipFeeDetail.getFinalAmount(); 238 + finalDeliverAmount = shipFeeDetail.getFinalAmount();
237 chargeContext.getChargeResult().setShipFeeDetail(shipFeeDetail); 239 chargeContext.getChargeResult().setShipFeeDetail(shipFeeDetail);
238 break; 240 break;
239 case SF: 241 case SF:
240 default: 242 default:
241 deliveryWayCost = deliveryWayCostSupport.getCostOfSf(); 243 deliveryWayCost = deliveryWayCostSupport.getCostOfSf();
  244 + finalDeliverAmount = deliveryWayCost;
242 break; 245 break;
243 } 246 }
244 } 247 }
@@ -262,7 +265,7 @@ public class ChargeService { @@ -262,7 +265,7 @@ public class ChargeService {
262 //运费 265 //运费
263 chargeContext.getChargeResult().setDeliveryWay(chargeContext.getChargeParam().getDeliveryWay()); 266 chargeContext.getChargeResult().setDeliveryWay(chargeContext.getChargeParam().getDeliveryWay());
264 chargeContext.getChargeResult().setShippingAmount(deliveryWayCost); 267 chargeContext.getChargeResult().setShippingAmount(deliveryWayCost);
265 - chargeContext.getChargeResult().setFinalShippingAmount(deliveryWayCost); 268 + chargeContext.getChargeResult().setFinalShippingAmount(finalDeliverAmount);
266 269
267 ChargeResult chargeResult = chargeContext.getChargeResult(); 270 ChargeResult chargeResult = chargeContext.getChargeResult();
268 271
@@ -54,4 +54,12 @@ public class ErpSellerController { @@ -54,4 +54,12 @@ public class ErpSellerController {
54 logger.info("erp invoke getSellerWithAuth,req {},sellerBo {}", sellerReq, sellerBo); 54 logger.info("erp invoke getSellerWithAuth,req {},sellerBo {}", sellerReq, sellerBo);
55 return sellerBo; 55 return sellerBo;
56 } 56 }
  57 +
  58 + @IgnoreSignature
  59 + @IgnoreSession
  60 + @RequestMapping("/detectEntryLevel")
  61 + public void detectEntryLevel(@RequestBody SellerReq req){
  62 + logger.info("in detectEntryLevel,req {}", req);
  63 + sellerService.processAfterWalletChange(req.getUid());
  64 + }
57 } 65 }
@@ -529,7 +529,7 @@ public class SellerEnterApplyService { @@ -529,7 +529,7 @@ public class SellerEnterApplyService {
529 boolean notNotice = (Objects.isNull(noticeCnt= storedSellerCacheService.getNoticeCntWhenWalletNotEnough(uid)) || noticeCnt<1); 529 boolean notNotice = (Objects.isNull(noticeCnt= storedSellerCacheService.getNoticeCntWhenWalletNotEnough(uid)) || noticeCnt<1);
530 if (notNotice && walletNotEnough){ 530 if (notNotice && walletNotEnough){
531 try { 531 try {
532 - logger.info("in changeLevel4Super send mail uid {} sellerBo {} noticeCnt {}", 532 + logger.info("in processLargeSettlementSuperWhenWalletChange send mail uid {} sellerBo {} noticeCnt {}",
533 uid, sellerBo, noticeCnt); 533 uid, sellerBo, noticeCnt);
534 String mailTo = configReader.getString("ufo.order.seller.noticeHKSellerEmailTo", "chao.chen@yoho.cn,xiuchun.luo@yoho.cn"); 534 String mailTo = configReader.getString("ufo.order.seller.noticeHKSellerEmailTo", "chao.chen@yoho.cn,xiuchun.luo@yoho.cn");
535 MailSender.newMailSender() 535 MailSender.newMailSender()
@@ -539,17 +539,19 @@ public class SellerEnterApplyService { @@ -539,17 +539,19 @@ public class SellerEnterApplyService {
539 .send(); 539 .send();
540 storedSellerCacheService.setNoticeCntWhenWalletNotEnough(uid, 1); 540 storedSellerCacheService.setNoticeCntWhenWalletNotEnough(uid, 1);
541 }catch (Exception ex){ 541 }catch (Exception ex){
542 - logger.warn("changeLevel4Super send mail fail, uid {} left wallet {}", uid, left, ex); 542 + logger.warn("processLargeSettlementSuperWhenWalletChange send mail fail, uid {} left wallet {}", uid, left, ex);
543 } 543 }
544 } 544 }
545 - logger.info("in changeLevel4Super uid {} sellerBo {} noticeCnt {}", 545 + logger.info("in processLargeSettlementSuperWhenWalletChange uid {} sellerBo {} noticeCnt {}",
546 uid, sellerBo, noticeCnt); 546 uid, sellerBo, noticeCnt);
547 547
548 //hidden sale product 548 //hidden sale product
549 boolean needHiddenPrds = bslfb.getLevel() == SuperEnterStageLevel.DISABLE.getCode() 549 boolean needHiddenPrds = bslfb.getLevel() == SuperEnterStageLevel.DISABLE.getCode()
550 && bslfb.getWalletThreshold().compareTo(left) > 0; 550 && bslfb.getWalletThreshold().compareTo(left) > 0;
551 boolean cancelHidden = bslfb.getLevel() != SuperEnterStageLevel.DISABLE.getCode() 551 boolean cancelHidden = bslfb.getLevel() != SuperEnterStageLevel.DISABLE.getCode()
552 - && bslfb.getWalletThreshold().compareTo(left) < 0; 552 + && BigDecimal.ZERO.compareTo(left) < 0;
  553 + logger.info("in processLargeSettlementSuperWhenWalletChange uid {} sellerBo {} needHiddenPrds {} cancelHidden {}",
  554 + uid, sellerBo, needHiddenPrds, cancelHidden);
553 EntrySellerType currentEST = sellerBo.getEntrySellerType(); 555 EntrySellerType currentEST = sellerBo.getEntrySellerType();
554 if (needHiddenPrds || cancelHidden){ 556 if (needHiddenPrds || cancelHidden){
555 EntryLevelNode eln = buildEntryLevelNode(sellerWrapper, bslfb); 557 EntryLevelNode eln = buildEntryLevelNode(sellerWrapper, bslfb);
@@ -51,7 +51,7 @@ public class SellerEnterApplyServiceTest extends BaseWebTest { @@ -51,7 +51,7 @@ public class SellerEnterApplyServiceTest extends BaseWebTest {
51 51
52 @Test 52 @Test
53 public void testChangeLevel4Super(){ 53 public void testChangeLevel4Super(){
54 - int uid = 500031424; 54 + int uid = 20000760;
55 SellerWrapper sellerWrapper =sellerService.getBaseSellerWrapper(uid); 55 SellerWrapper sellerWrapper =sellerService.getBaseSellerWrapper(uid);
56 BigDecimal left = new BigDecimal(200); 56 BigDecimal left = new BigDecimal(200);
57 sellerEnterApplyService.changeLevel4Super(sellerWrapper, left); 57 sellerEnterApplyService.changeLevel4Super(sellerWrapper, left);