|
|
@@ -288,6 +288,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 有价储值卡消费时,如果未启用分账,金额也记入补贴表,可能会导致查询错误, |
|
|
// 有价储值卡消费时,如果未启用分账,金额也记入补贴表,可能会导致查询错误, |
|
|
|
|
|
Long merchantId = couponMerchant.getMerchantId(); |
|
|
|
|
|
WxMerchant merchant = wxMerchantMapper.selectById(merchantId); |
|
|
if (cardInfo.getSaleAmount() > 0) { |
|
|
if (cardInfo.getSaleAmount() > 0) { |
|
|
if (payment > 0) { |
|
|
if (payment > 0) { |
|
|
try { |
|
|
try { |
|
|
@@ -299,8 +301,6 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
|
|
|
|
|
//更新商户余额 |
|
|
//更新商户余额 |
|
|
if (real_payment > 0) { |
|
|
if (real_payment > 0) { |
|
|
Long merchantId = couponMerchant.getMerchantId(); |
|
|
|
|
|
WxMerchant merchant = wxMerchantMapper.selectById(merchantId); |
|
|
|
|
|
wxCashOutService.addCashOut(merchant, real_payment); |
|
|
wxCashOutService.addCashOut(merchant, real_payment); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -318,7 +318,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
orderUpdate.setPayment(record.getDeductionAmount()); |
|
|
orderUpdate.setPayment(record.getDeductionAmount()); |
|
|
orderUpdate.setCreditByPamentRate(false); |
|
|
orderUpdate.setCreditByPamentRate(false); |
|
|
} |
|
|
} |
|
|
wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, coupon.getBusiness()); |
|
|
|
|
|
|
|
|
if (null != merchant) { |
|
|
|
|
|
wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, merchant.getBusinessId()); |
|
|
|
|
|
}else { |
|
|
|
|
|
wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, coupon.getBusiness()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error("成长值:" + e.getMessage()); |
|
|
logger.error("成长值:" + e.getMessage()); |
|
|
} |
|
|
} |
|
|
@@ -335,7 +340,6 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
creditHistory.setTenantId(record.getFinalTenantId()); |
|
|
creditHistory.setTenantId(record.getFinalTenantId()); |
|
|
creditHistory.setFinalTenantId(record.getFinalTenantId()); |
|
|
creditHistory.setFinalTenantId(record.getFinalTenantId()); |
|
|
creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); |
|
|
creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); |
|
|
creditHistory.setBusinessId(coupon.getBusiness()); |
|
|
|
|
|
//看是按售价比例算还是按面额比例算 |
|
|
//看是按售价比例算还是按面额比例算 |
|
|
if (coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_SALE_PRICE.getCode().intValue()) { |
|
|
if (coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_SALE_PRICE.getCode().intValue()) { |
|
|
creditHistory.setSpend(payment); |
|
|
creditHistory.setSpend(payment); |
|
|
@@ -347,6 +351,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
creditHistory.setMerchantId(record.getMerchantId()); |
|
|
creditHistory.setMerchantId(record.getMerchantId()); |
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); |
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); |
|
|
creditHistory.setChangePurpose("卡消费:消费商户["+wxMerchant.getName()+"] 金额["+creditHistory.getSpendStr()+"元]"); |
|
|
creditHistory.setChangePurpose("卡消费:消费商户["+wxMerchant.getName()+"] 金额["+creditHistory.getSpendStr()+"元]"); |
|
|
|
|
|
creditHistory.setBusinessId(wxMerchant.getBusinessId()); |
|
|
wxCreditHistoryService.saveOrUpdate(creditHistory,record); |
|
|
wxCreditHistoryService.saveOrUpdate(creditHistory,record); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error("积分值:" + e.getMessage()); |
|
|
logger.error("积分值:" + e.getMessage()); |
|
|
@@ -1329,7 +1334,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
orderUpdate.setPayment(record.getRealPayment()); |
|
|
orderUpdate.setPayment(record.getRealPayment()); |
|
|
orderUpdate.setPaymentTime(record.getUpdateDate()); |
|
|
orderUpdate.setPaymentTime(record.getUpdateDate()); |
|
|
orderUpdate.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); |
|
|
orderUpdate.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); |
|
|
int point = wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, coupon.getBusiness()); |
|
|
|
|
|
|
|
|
int point = wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, merchant.getBusinessId()); |
|
|
scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); |
|
|
scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error("成长值:" + e.getMessage()); |
|
|
logger.error("成长值:" + e.getMessage()); |
|
|
|