Sfoglia il codice sorgente

//rate share

release_toaliyun_real
xhxu 3 anni fa
parent
commit
3f30b2875c
7 ha cambiato i file con 37 aggiunte e 12 eliminazioni
  1. +1
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/app/WxPayAccountController.java
  2. +4
    -1
      mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql
  3. +1
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxPayAccountController.java
  4. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPayAccount.java
  5. +23
    -9
      mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java
  6. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  7. +5
    -1
      mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml

+ 1
- 0
mallinkAdmin/src/main/java/com/iformall/controller/app/WxPayAccountController.java Vedi File

@@ -56,6 +56,7 @@ public class WxPayAccountController extends BaseController {
returnPayAccount.setOpenPay(payAccount.getOpenPay());
returnPayAccount.setPayVersion(payAccount.getPayVersion());
returnPayAccount.setShare(payAccount.getShare());
returnPayAccount.setIsCommission(payAccount.getIsCommission());
return new ResultData(returnPayAccount);
}



+ 4
- 1
mallinkAdmin/src/main/resources/db/migration/V2022091400001__add_pay_account.sql Vedi File

@@ -1,2 +1,5 @@
ALTER TABLE `mallink`.`wx_pay_account`
ADD COLUMN `sell_rate` int(6) NOT NULL DEFAULT 0 COMMENT '销售提点' AFTER `system_rate`;
ADD COLUMN `sell_rate` int(6) NOT NULL DEFAULT 0 COMMENT '销售提点' AFTER `system_rate`;

ALTER TABLE `mallink`.`wx_pay_account`
ADD COLUMN `is_commission` smallint(2) NOT NULL DEFAULT 0 COMMENT '是否抽佣' AFTER `real_rate`;

+ 1
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxPayAccountController.java Vedi File

@@ -66,6 +66,7 @@ public class WxPayAccountController extends BaseController {
returnPayAccount.setOpenPay(payAccount.getOpenPay());
returnPayAccount.setPayVersion(payAccount.getPayVersion());
returnPayAccount.setShare(payAccount.getShare());
returnPayAccount.setIsCommission(payAccount.getIsCommission());
return new ResultData(returnPayAccount);
}



+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPayAccount.java Vedi File

@@ -56,6 +56,8 @@ public class WxPayAccount extends TenantEntity {
private Integer rate;
@io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate")
private Integer realRate;
@io.swagger.annotations.ApiModelProperty(value="是否抽成",name="isCommission")
private Integer isCommission;
@io.swagger.annotations.ApiModelProperty(value="系统提点",name="systemRate")
private Integer systemRate;
@io.swagger.annotations.ApiModelProperty(value="销售提点",name="sellRate")


+ 23
- 9
mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java Vedi File

@@ -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;
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java Vedi File

@@ -219,7 +219,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
int commissionAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), rate, true);
wxComposeChildOrderShare.setCommissionAmount(commissionAmount);
int surplus = 0;//当广场抽成帐号与收款帐号相等,无法添加分账方,计入商管商户中
if(EnumPayMchType.DIRECT.getCode().equals(payOrder.getMchType())){
if(EnumPayMchType.DIRECT.getCode().equals(payOrder.getMchType()) && EnumYesOrNo.YES.getCode().equals(payAccount.getIsCommission())){
//销售抽点+系统抽点
int selSysAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), payAccount.getSellRate()+payAccount.getSystemRate(), false);
//销售抽点


+ 5
- 1
mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml Vedi File

@@ -24,6 +24,7 @@
<result column="share" jdbcType="INTEGER" property="share"/>
<result column="rate" jdbcType="INTEGER" property="rate"/>
<result column="real_rate" jdbcType="INTEGER" property="realRate"/>
<result column="is_commission" jdbcType="INTEGER" property="isCommission"/>
<result column="system_rate" jdbcType="INTEGER" property="systemRate"/>
<result column="sell_rate" jdbcType="INTEGER" property="sellRate"/>

@@ -37,7 +38,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`sub_app_id`,`api_key`,`merchant_api_key`,`notify_url`,`notify_token`,`cert_path`,
`merchant_cert_path`,`type`,`mch_type`,`open_pay`,`share`,`rate`,`real_rate`,`system_rate`,`sell_rate`,
`merchant_cert_path`,`type`,`mch_type`,`open_pay`,`share`,`rate`,`real_rate`,`is_commission`,`system_rate`,`sell_rate`,
`service_id`,`pay_score_notify_url`,`api_v3_key`,`cert_serial_no`,`private_key_path`,`private_cert_pem_path`,
`merchant_key_path`,`merchant_apiv3_key`,`merchant_cert_pem_path`
</sql>
@@ -83,6 +84,9 @@
<if test=" null != realRate ">
and `real_rate` = #{realRate}
</if>
<if test=" null != isCommission ">
and `is_commission` = #{isCommission}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


Caricamento…
Annulla
Salva