1.成本计算
This commit is contained in:
parent
8cf4a61856
commit
cb7b167593
|
@ -190,6 +190,9 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
logger.info("【微信/太米支付回调】订单信息 : " + JSON.toJSONString(order));
|
||||
logger.info("【微信/太米支付回调】========== orderId : " + order.getOrderId());
|
||||
|
||||
Long payChannel = order.getPayChannel();
|
||||
ChannelVO channelVO = etChannelService.selectSmChannelByChannelId(payChannel);
|
||||
|
||||
AsUser asUser = asUserMapper.selectUserById(order.getUserId());
|
||||
/** 支付回调逻辑 1. 处理预约还是开锁 电压 */
|
||||
AsDevice asDevice = null;
|
||||
|
@ -232,7 +235,7 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
order1.setHandlingCharge(capitalFlow.getHandlingCharge());
|
||||
order1.setPlatformServiceFee(capitalFlow.getPlatformServiceFee());
|
||||
order1.setOperatorDividend(capitalFlow.getOperatorDividend());
|
||||
order1.setCost(getCost(order.getPayFee()));
|
||||
order1.setCost(getCost(channelVO,order.getPayFee()));
|
||||
logger.info("=================【微信/太米支付回调】4444444==================");
|
||||
}else if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_APPOINTMENT)){
|
||||
logger.info("【微信/太米支付回调】取消预约支付");
|
||||
|
@ -309,9 +312,10 @@ public class CallbackServiceImpl implements CallbackService {
|
|||
if(!execute)throw new ServiceException("管理员开锁失败");
|
||||
}
|
||||
|
||||
private BigDecimal getCost(BigDecimal payFee) {
|
||||
// todo 获取到微信的成本
|
||||
BigDecimal bigDecimal = new BigDecimal(0.54).divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP);
|
||||
private BigDecimal getCost(ChannelVO channel,BigDecimal payFee) {
|
||||
// 获取到渠道成本
|
||||
BigDecimal costRate = channel.getCostRate();
|
||||
BigDecimal bigDecimal = costRate.divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal cost = bigDecimal.multiply(payFee).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
logger.info("【保存资金流水记录--订单支付】 成本==============bigDecimal=====================:"+bigDecimal);
|
||||
return cost;
|
||||
|
|
|
@ -168,7 +168,7 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
|||
public int updateEtFeeRule(EtFeeRule etFeeRule)
|
||||
{
|
||||
int i = etModelRuleMapper.deleteModelRuleByModelId(etFeeRule.getRuleId());
|
||||
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
|
||||
if(ObjectUtil.isNotNull(etFeeRule.getModelId()) && etFeeRule.getModelId() != 0){
|
||||
etModelRuleMapper.insert(EtModelRule.builder().modelId(etFeeRule.getModelId()).ruleId(etFeeRule.getRuleId()).build());
|
||||
}
|
||||
return etFeeRuleMapper.updateEtFeeRule(etFeeRule);
|
||||
|
|
Loading…
Reference in New Issue
Block a user