Просмотр исходного кода

[储值卡][修改]:商场营销补贴

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
7110b8a383
1 измененных файлов: 26 добавлений и 23 удалений
  1. +26
    -23
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java

+ 26
- 23
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Просмотреть файл

@@ -138,29 +138,32 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {

// 8. 补贴
Integer subsidyFee = (record.getDeductionAmount() - payment)* subsidyRate / 10000;
Double dSubChargeFee = Math.ceil(subsidyFee * 1.0D * payAccount.getRate() / 10000);
Integer realSubsidyFee = subsidyFee - dSubChargeFee.intValue();
WxMerchantSubsidy merchantSubsidy = new WxMerchantSubsidy();
merchantSubsidy.setId(idWorker.nextId());
merchantSubsidy.setTenantId(record.getTenantId());
merchantSubsidy.setOrderId(order.getId());
merchantSubsidy.setOrderType(EnumOrderType.PREPAIDCARD.getCode());
merchantSubsidy.setMerchantId(record.getMerchantId());
merchantSubsidy.setCouponOrderId(cardInfo.getId());
merchantSubsidy.setCouponType(EnumCouponType.CARD_MULTIMCH.getCode());
merchantSubsidy.setOrderPayment(record.getDeductionAmount());
merchantSubsidy.setReceiverPayment(payment);
merchantSubsidy.setRealPayment(real_payment);
merchantSubsidy.setSubsidy(subsidyFee);
merchantSubsidy.setRealSubsidy(realSubsidyFee);
merchantSubsidy.setStatus(EnumMerchantSubsidyStatus.NOT_SUBSIDY.getCode());
merchantSubsidy.setCreateDate(curDate);
merchantSubsidy.setUpdateDate(curDate);
try {
wxMerchantSubsidyMapper.insertSelective(merchantSubsidy);
} catch (Exception e) {
logger.error("merchantSubsidy info insert error");
return new ResultData(ErrorCode.DB_FAIL.getCode(), "merchantSubsidy info 插入出错!");
if(subsidyFee > 0) {
// 有补贴时入库
Double dSubChargeFee = Math.ceil(subsidyFee * 1.0D * payAccount.getRate() / 10000);
Integer realSubsidyFee = subsidyFee - dSubChargeFee.intValue();
WxMerchantSubsidy merchantSubsidy = new WxMerchantSubsidy();
merchantSubsidy.setId(idWorker.nextId());
merchantSubsidy.setTenantId(record.getTenantId());
merchantSubsidy.setOrderId(order.getId());
merchantSubsidy.setOrderType(EnumOrderType.PREPAIDCARD.getCode());
merchantSubsidy.setMerchantId(record.getMerchantId());
merchantSubsidy.setCouponOrderId(cardInfo.getId());
merchantSubsidy.setCouponType(EnumCouponType.CARD_MULTIMCH.getCode());
merchantSubsidy.setOrderPayment(record.getDeductionAmount());
merchantSubsidy.setReceiverPayment(payment);
merchantSubsidy.setRealPayment(real_payment);
merchantSubsidy.setSubsidy(subsidyFee);
merchantSubsidy.setRealSubsidy(realSubsidyFee);
merchantSubsidy.setStatus(EnumMerchantSubsidyStatus.NOT_SUBSIDY.getCode());
merchantSubsidy.setCreateDate(curDate);
merchantSubsidy.setUpdateDate(curDate);
try {
wxMerchantSubsidyMapper.insertSelective(merchantSubsidy);
} catch (Exception e) {
logger.error("merchantSubsidy info insert error");
return new ResultData(ErrorCode.DB_FAIL.getCode(), "merchantSubsidy info 插入出错!");
}
}
// 9. 分账
try {


Загрузка…
Отмена
Сохранить