| @@ -65,13 +65,13 @@ public class WxCashBackActivityRecord extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "返现金额", name = "cashMoney") | @io.swagger.annotations.ApiModelProperty(value = "返现金额", name = "cashMoney") | ||||
| private BigDecimal cashMoney; | private BigDecimal cashMoney; | ||||
| @Excel(name="商管承担比例(%)",width = 20,orderNum = "12") | @Excel(name="商管承担比例(%)",width = 20,orderNum = "12") | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "商管承担比例", name = "mallRate") | |||||
| private BigDecimal mallRate; | private BigDecimal mallRate; | ||||
| @Excel(name="商管承担返现金额",width = 20,orderNum = "13") | @Excel(name="商管承担返现金额",width = 20,orderNum = "13") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "商管承担返现金额", name = "mallCashMoney") | @io.swagger.annotations.ApiModelProperty(value = "商管承担返现金额", name = "mallCashMoney") | ||||
| private BigDecimal mallCashMoney; | private BigDecimal mallCashMoney; | ||||
| @Excel(name="商户承担比例(%)",width = 20,orderNum = "14") | @Excel(name="商户承担比例(%)",width = 20,orderNum = "14") | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "商户承担比例", name = "merchantRate") | |||||
| private BigDecimal merchantRate; | private BigDecimal merchantRate; | ||||
| @Excel(name="商户承担返现金额",width = 20,orderNum = "15") | @Excel(name="商户承担返现金额",width = 20,orderNum = "15") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "商户承担返现金额", name = "merchantCashMoney") | @io.swagger.annotations.ApiModelProperty(value = "商户承担返现金额", name = "merchantCashMoney") | ||||
| @@ -356,6 +356,8 @@ public class WxCashBackActivityServiceImpl implements WxCashBackActivityService | |||||
| EnumCashBackActivityItemRule moneyRule = EnumCashBackActivityItemRule.getEnum(item.getMoneyRule()); | EnumCashBackActivityItemRule moneyRule = EnumCashBackActivityItemRule.getEnum(item.getMoneyRule()); | ||||
| record.setCashRate(item.getTotalBackRate()); | record.setCashRate(item.getTotalBackRate()); | ||||
| record.setCashMoney(record.getOrderMoney().multiply(item.getTotalBackRate()).divide(new BigDecimal(100)).setScale(3,BigDecimal.ROUND_HALF_UP)); | record.setCashMoney(record.getOrderMoney().multiply(item.getTotalBackRate()).divide(new BigDecimal(100)).setScale(3,BigDecimal.ROUND_HALF_UP)); | ||||
| record.setMallRate(item.getMallBackRate()); | |||||
| record.setMerchantRate(item.getMerchantBackRate()); | |||||
| if (moneyRule == EnumCashBackActivityItemRule.MALL_ONLY) { | if (moneyRule == EnumCashBackActivityItemRule.MALL_ONLY) { | ||||
| record.setMallCashMoney(record.getCashMoney()); | record.setMallCashMoney(record.getCashMoney()); | ||||
| record.setMerchantCashMoney(new BigDecimal(0)); | record.setMerchantCashMoney(new BigDecimal(0)); | ||||
| @@ -368,10 +370,6 @@ public class WxCashBackActivityServiceImpl implements WxCashBackActivityService | |||||
| } | } | ||||
| } | } | ||||
| public static void main(String[] args) { | |||||
| BigDecimal om = new BigDecimal(67298.870); | |||||
| } | |||||
| @Override | @Override | ||||
| public void saveOrUpdateRecord(WxCashBackActivityRecord record) { | public void saveOrUpdateRecord(WxCashBackActivityRecord record) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -18,7 +18,9 @@ | |||||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | ||||
| <result column="cash_rate" jdbcType="DECIMAL" property="cashRate" /> | <result column="cash_rate" jdbcType="DECIMAL" property="cashRate" /> | ||||
| <result column="cash_money" jdbcType="DECIMAL" property="cashMoney" /> | <result column="cash_money" jdbcType="DECIMAL" property="cashMoney" /> | ||||
| <result column="mall_rate" jdbcType="DECIMAL" property="mallRate" /> | |||||
| <result column="mall_cash_money" jdbcType="DECIMAL" property="mallCashMoney" /> | <result column="mall_cash_money" jdbcType="DECIMAL" property="mallCashMoney" /> | ||||
| <result column="merchant_rate" jdbcType="DECIMAL" property="merchantRate" /> | |||||
| <result column="merchant_cash_money" jdbcType="DECIMAL" property="merchantCashMoney" /> | <result column="merchant_cash_money" jdbcType="DECIMAL" property="merchantCashMoney" /> | ||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | ||||
| @@ -26,7 +28,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`activity_id`,`item_id`,`order_no`,`order_money`,`cus_name`,`create_date`,`update_date`,`phone`, | `id`,`tenant_id`,`parent_tenant_id`,`activity_id`,`item_id`,`order_no`,`order_money`,`cus_name`,`create_date`,`update_date`,`phone`, | ||||
| `address`,`audit_remark`,`audit_status`,`cash_rate`,`cash_money`,`mall_cash_money`,`merchant_cash_money`,`merchant_id` | |||||
| `address`,`audit_remark`,`audit_status`,`cash_rate`,`cash_money`,`mall_rate`,`mall_cash_money`,`merchant_rate`,`merchant_cash_money`,`merchant_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -127,9 +129,15 @@ | |||||
| <if test=" null != cashMoney"> | <if test=" null != cashMoney"> | ||||
| `cash_money` = #{cashMoney}, | `cash_money` = #{cashMoney}, | ||||
| </if> | </if> | ||||
| <if test=" null != mallRate"> | |||||
| `mall_rate` = #{mallRate}, | |||||
| </if> | |||||
| <if test=" null != mallCashMoney"> | <if test=" null != mallCashMoney"> | ||||
| `mall_cash_money` = #{mallCashMoney}, | `mall_cash_money` = #{mallCashMoney}, | ||||
| </if> | </if> | ||||
| <if test=" null != merchantRate"> | |||||
| `merchant_rate` = #{merchantRate}, | |||||
| </if> | |||||
| <if test=" null != merchantCashMoney"> | <if test=" null != merchantCashMoney"> | ||||
| `merchant_cash_money` = #{merchantCashMoney}, | `merchant_cash_money` = #{merchantCashMoney}, | ||||
| </if> | </if> | ||||