|
|
|
@@ -693,7 +693,13 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
|
|
|
|
map.put("realRate",payAccount.getRealRate()); |
|
|
|
map.put("systemRate",payAccount.getSystemRate()+payAccount.getSellRate()); |
|
|
|
int rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
int rate = 0; |
|
|
|
if(EnumYesOrNo.YES.getCode().equals(payAccount.getIsCommission())){ |
|
|
|
rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
}else{ |
|
|
|
rate = payAccount.getRealRate(); |
|
|
|
} |
|
|
|
|
|
|
|
if(EnumAppPlat.TOUTIAO.getCode().equals(couponAppInfo.getPlat())){ |
|
|
|
if(wxCoupon.getCategoryId() == null){ |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED.getCode(),"卡券信息错误"); |
|
|
|
@@ -705,7 +711,6 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
if(maxTakeRate != null){ |
|
|
|
rate += maxTakeRate; |
|
|
|
} |
|
|
|
rate += getRateMin(); |
|
|
|
} |
|
|
|
|
|
|
|
map.put("mallMax",getAllMax()); |
|
|
|
@@ -745,7 +750,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
if(ttPoiTakeRate != null){ |
|
|
|
takeRate = ttPoiTakeRate.getTakeRate(); |
|
|
|
}else{ |
|
|
|
takeRate = 2900; |
|
|
|
takeRate = getAllMax(); |
|
|
|
} |
|
|
|
|
|
|
|
WxAppinfo couponAppInfo = wxAppinfoService.getCouponAppInfo(wxCoupon); |
|
|
|
@@ -756,7 +761,12 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
if(payAccount == null){ |
|
|
|
throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND); |
|
|
|
} |
|
|
|
int rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
int rate = 0; |
|
|
|
if(EnumYesOrNo.YES.getCode().equals(payAccount.getIsCommission())){ |
|
|
|
rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
}else{ |
|
|
|
return getAllMax(); |
|
|
|
} |
|
|
|
if(EnumAppPlat.TOUTIAO.getCode().equals(couponAppInfo.getPlat())){ |
|
|
|
if(wxCoupon.getCategoryId() == null){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED.getCode(),"卡券信息错误"); |
|
|
|
@@ -764,8 +774,8 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
TtGoodsCategory ttGoodsCategory = ttGoodsCategoryMapper.selectById(wxCoupon.getCategoryId()); |
|
|
|
rate = rate+payAccount.getRealRate()-ttGoodsCategory.getServiceFee(); |
|
|
|
} |
|
|
|
if(ttPoiTakeRate.getTakeRate().intValue() > rate){ |
|
|
|
rate = ttPoiTakeRate.getTakeRate().intValue() - rate; |
|
|
|
if(takeRate > rate){ |
|
|
|
rate = takeRate - rate; |
|
|
|
return rate; |
|
|
|
}else{ |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"分佣率异常"); |
|
|
|
@@ -778,7 +788,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
|
|
|
|
//总分佣率最大值 |
|
|
|
private int getAllMax(){ |
|
|
|
return 3000; |
|
|
|
return 2900; |
|
|
|
} |
|
|
|
//总分佣率最小值 |
|
|
|
private int getAllMin(WxCoupon wxCoupon){ |
|
|
|
@@ -793,7 +803,12 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
if(payAccount == null){ |
|
|
|
throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND); |
|
|
|
} |
|
|
|
int rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
int rate = 0; |
|
|
|
if(EnumYesOrNo.YES.getCode().equals(payAccount.getIsCommission())){ |
|
|
|
rate = payAccount.getRealRate()+payAccount.getSystemRate()+payAccount.getSellRate(); |
|
|
|
}else{ |
|
|
|
rate = payAccount.getRealRate(); |
|
|
|
} |
|
|
|
if(EnumAppPlat.TOUTIAO.getCode().equals(couponAppInfo.getPlat())){ |
|
|
|
if(wxCoupon.getCategoryId() == null){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED.getCode(),"卡券信息错误"); |
|
|
|
@@ -804,7 +819,6 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
if(maxTakeRate != null){ |
|
|
|
rate += maxTakeRate; |
|
|
|
} |
|
|
|
rate += getRateMin(); |
|
|
|
} |
|
|
|
return rate; |
|
|
|
} |
|
|
|
|