Authored by mali

Merge branch 'test6.9.7'

... ... @@ -214,6 +214,7 @@ public class ChargeService {
*/
private void calculateShippingAmount(ChargeContext chargeContext) {
double deliveryWayCost = 0D;
double finalDeliverAmount = 0D;
//如果是门店自提,则免运费
DeliveryWayEnum deliveryWay = DeliveryWayEnum.getByCode(chargeContext.getChargeParam().getDeliveryWay());
if (deliveryWay == null){
... ... @@ -222,6 +223,7 @@ public class ChargeService {
switch (deliveryWay){
case SELF_FETCH:
deliveryWayCost = 0D;
finalDeliverAmount = 0D;
break;
case OVERSEAS_HONGHONG:
BigDecimal shipFee = chargeContext.getChargeParam().getShipFee();
... ... @@ -233,12 +235,13 @@ public class ChargeService {
}
AmountCutPolicy shipFeeCutPolicy = chargeContext.getChargeParam().getShipFeeCutPolicy();
SingleFeeDetail shipFeeDetail = calculateOverSeasOrderShipAmount(deliveryWayCost, shipFeeCutPolicy);
deliveryWayCost = shipFeeDetail.getFinalAmount();
finalDeliverAmount = shipFeeDetail.getFinalAmount();
chargeContext.getChargeResult().setShipFeeDetail(shipFeeDetail);
break;
case SF:
default:
deliveryWayCost = deliveryWayCostSupport.getCostOfSf();
finalDeliverAmount = deliveryWayCost;
break;
}
}
... ... @@ -262,7 +265,7 @@ public class ChargeService {
//运费
chargeContext.getChargeResult().setDeliveryWay(chargeContext.getChargeParam().getDeliveryWay());
chargeContext.getChargeResult().setShippingAmount(deliveryWayCost);
chargeContext.getChargeResult().setFinalShippingAmount(deliveryWayCost);
chargeContext.getChargeResult().setFinalShippingAmount(finalDeliverAmount);
ChargeResult chargeResult = chargeContext.getChargeResult();
... ...
... ... @@ -54,4 +54,12 @@ public class ErpSellerController {
logger.info("erp invoke getSellerWithAuth,req {},sellerBo {}", sellerReq, sellerBo);
return sellerBo;
}
@IgnoreSignature
@IgnoreSession
@RequestMapping("/detectEntryLevel")
public void detectEntryLevel(@RequestBody SellerReq req){
logger.info("in detectEntryLevel,req {}", req);
sellerService.processAfterWalletChange(req.getUid());
}
}
... ...
... ... @@ -529,7 +529,7 @@ public class SellerEnterApplyService {
boolean notNotice = (Objects.isNull(noticeCnt= storedSellerCacheService.getNoticeCntWhenWalletNotEnough(uid)) || noticeCnt<1);
if (notNotice && walletNotEnough){
try {
logger.info("in changeLevel4Super send mail uid {} sellerBo {} noticeCnt {}",
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");
MailSender.newMailSender()
... ... @@ -539,17 +539,19 @@ public class SellerEnterApplyService {
.send();
storedSellerCacheService.setNoticeCntWhenWalletNotEnough(uid, 1);
}catch (Exception ex){
logger.warn("changeLevel4Super send mail fail, uid {} left wallet {}", uid, left, ex);
logger.warn("processLargeSettlementSuperWhenWalletChange send mail fail, uid {} left wallet {}", uid, left, ex);
}
}
logger.info("in changeLevel4Super uid {} sellerBo {} noticeCnt {}",
logger.info("in processLargeSettlementSuperWhenWalletChange uid {} sellerBo {} noticeCnt {}",
uid, sellerBo, noticeCnt);
//hidden sale product
boolean needHiddenPrds = bslfb.getLevel() == SuperEnterStageLevel.DISABLE.getCode()
&& bslfb.getWalletThreshold().compareTo(left) > 0;
boolean cancelHidden = bslfb.getLevel() != SuperEnterStageLevel.DISABLE.getCode()
&& bslfb.getWalletThreshold().compareTo(left) < 0;
&& BigDecimal.ZERO.compareTo(left) < 0;
logger.info("in processLargeSettlementSuperWhenWalletChange uid {} sellerBo {} needHiddenPrds {} cancelHidden {}",
uid, sellerBo, needHiddenPrds, cancelHidden);
EntrySellerType currentEST = sellerBo.getEntrySellerType();
if (needHiddenPrds || cancelHidden){
EntryLevelNode eln = buildEntryLevelNode(sellerWrapper, bslfb);
... ...
... ... @@ -51,7 +51,7 @@ public class SellerEnterApplyServiceTest extends BaseWebTest {
@Test
public void testChangeLevel4Super(){
int uid = 500031424;
int uid = 20000760;
SellerWrapper sellerWrapper =sellerService.getBaseSellerWrapper(uid);
BigDecimal left = new BigDecimal(200);
sellerEnterApplyService.changeLevel4Super(sellerWrapper, left);
... ...