1. 订单列表修改

This commit is contained in:
邱贞招 2024-09-09 08:43:13 +08:00
parent 2ae3c8e279
commit 4a1b01e3fe
4 changed files with 53 additions and 7 deletions

View File

@ -304,4 +304,22 @@ public class EtOrder extends BaseEntity
@Excel(name = "封顶金额") @Excel(name = "封顶金额")
private BigDecimal cappedAmount; private BigDecimal cappedAmount;
/** 手续费 */
@Excel(name = "手续费")
private BigDecimal handlingCharge;
/** 平台服务费 */
@Excel(name = "平台服务费")
private BigDecimal platformServiceFee;
/** 运营商分账(到账金额) */
@Excel(name = "运营商分账(到账金额)")
private BigDecimal operatorDividend;
/** 成本 */
@Excel(name = "成本")
@TableField(exist = false)
private BigDecimal cost;
} }

View File

@ -230,6 +230,11 @@ public class CallbackServiceImpl implements CallbackService {
asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE);
// 新增资金流水记录 // 新增资金流水记录
EtCapitalFlow capitalFlow = capitalFlowRecords(order, ServiceConstants.FLOW_TYPE_INCOME, ServiceConstants.ORDER_TYPE_RIDING, ServiceConstants.OWNER_TYPE_OPERATOR, null, ServiceConstants.PAY_TYPE_WX); EtCapitalFlow capitalFlow = capitalFlowRecords(order, ServiceConstants.FLOW_TYPE_INCOME, ServiceConstants.ORDER_TYPE_RIDING, ServiceConstants.OWNER_TYPE_OPERATOR, null, ServiceConstants.PAY_TYPE_WX);
logger.info("=================【骑行支付回调-新增资金流水记录后】=================={}",JSON.toJSON(capitalFlow));
order.setHandlingCharge(capitalFlow.getHandlingCharge());
order.setPlatformServiceFee(capitalFlow.getPlatformServiceFee());
order.setOperatorDividend(capitalFlow.getOperatorDividend());
order.setCost(getCost(order.getPayFee()));
// 发起分账 // 发起分账
// BigDecimal dividendAmount= order.getPayFee().subtract(capitalFlow.getHandlingCharge()).subtract(capitalFlow.getPlatformServiceFee());//分账金额订单实际支付金额-平台服务费-支付手续费 // BigDecimal dividendAmount= order.getPayFee().subtract(capitalFlow.getHandlingCharge()).subtract(capitalFlow.getPlatformServiceFee());//分账金额订单实际支付金额-平台服务费-支付手续费
// logger.info("=================【微信支付回调】分账金额=================={}",dividendAmount); // logger.info("=================【微信支付回调】分账金额=================={}",dividendAmount);
@ -277,7 +282,7 @@ public class CallbackServiceImpl implements CallbackService {
throw new ServiceException("【微信支付回调】更新车辆状态失败"); throw new ServiceException("【微信支付回调】更新车辆状态失败");
} }
} }
logger.info("=================【微信支付回调】开始更新订单信息=================="); logger.info("=================【微信支付回调】开始更新订单信息=================={}",JSON.toJSON(order));
int updateEtOrder = orderService.updateEtOrder(order); int updateEtOrder = orderService.updateEtOrder(order);
if(updateEtOrder==0){ if(updateEtOrder==0){
logger.error("【微信支付回调】更新订单信息失败"); logger.error("【微信支付回调】更新订单信息失败");
@ -296,6 +301,14 @@ public class CallbackServiceImpl implements CallbackService {
} }
} }
private BigDecimal getCost(BigDecimal payFee) {
// todo 获取到微信的成本
BigDecimal bigDecimal = new BigDecimal(0.54).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;
}
private void couponSuccessHandle(EtOrder order) { private void couponSuccessHandle(EtOrder order) {
logger.info("【微信支付回调】优惠券支付-------------1"); logger.info("【微信支付回调】优惠券支付-------------1");
/** /**

View File

@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getHandlingFee" resultType="java.math.BigDecimal"> <select id="getHandlingFee" resultType="java.math.BigDecimal">
select select
COALESCE(SUM(CASE WHEN f.type = '1' THEN handling_charge ELSE 0 END), 0) AS net_fee COALESCE(SUM(CASE WHEN f.type = '1' THEN f.handling_charge ELSE 0 END), 0) AS net_fee
from et_capital_flow f from et_capital_flow f
LEFT JOIN et_order o on o.order_no = f.order_no LEFT JOIN et_order o on o.order_no = f.order_no
where f.bus_type != '5' and f.bus_type != '6' and f.type = 1 where f.bus_type != '5' and f.bus_type != '6' and f.type = 1
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getServiceFee" resultType="java.math.BigDecimal"> <select id="getServiceFee" resultType="java.math.BigDecimal">
select select
COALESCE(SUM(platform_service_fee), 0) AS net_fee COALESCE(SUM(f.platform_service_fee), 0) AS net_fee
from et_capital_flow f from et_capital_flow f
LEFT JOIN et_order o on o.order_no = f.order_no LEFT JOIN et_order o on o.order_no = f.order_no
where f.area_id != 14 and f.type = 1 where f.area_id != 14 and f.type = 1

View File

@ -56,6 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="chargingCycle" column="charging_cycle" /> <result property="chargingCycle" column="charging_cycle" />
<result property="chargingCycleValue" column="charging_cycle_value" /> <result property="chargingCycleValue" column="charging_cycle_value" />
<result property="cappedAmount" column="capped_amount" /> <result property="cappedAmount" column="capped_amount" />
<result property="handlingCharge" column="handling_charge" />
<result property="platformServiceFee" column="platform_service_fee" />
<result property="operatorDividend" column="operator_dividend" />
</resultMap> </resultMap>
<sql id="selectEtOrderVo"> <sql id="selectEtOrderVo">
@ -65,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction,video_url, rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction,video_url,
upload_time,deduction_amount,audio_files,used_sn,change_reason,locking,auto_refund_deposit,free_ride_time, upload_time,deduction_amount,audio_files,used_sn,change_reason,locking,auto_refund_deposit,free_ride_time,
rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amount from et_order rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amount,handling_charge, platform_service_fee, operator_dividend from et_order
</sql> </sql>
<sql id="selectEtOrderVoNoRoute"> <sql id="selectEtOrderVoNoRoute">
@ -74,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status, manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
rule_end_time, return_type, cycle,deposit_deduction,video_url,upload_time,deduction_amount,audio_files,used_sn,change_reason,locking,auto_refund_deposit,free_ride_time, rule_end_time, return_type, cycle,deposit_deduction,video_url,upload_time,deduction_amount,audio_files,used_sn,change_reason,locking,auto_refund_deposit,free_ride_time,
rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amountfrom et_order rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amount,handling_charge, platform_service_fee, operator_dividend from et_order
</sql> </sql>
<select id="selectEtOrderList" parameterType="EtOrder" resultMap="EtOrderResult"> <select id="selectEtOrderList" parameterType="EtOrder" resultMap="EtOrderResult">
@ -124,7 +127,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
o.audio_files, o.audio_files,
o.used_sn, o.used_sn,
o.change_reason, o.change_reason,
o.locking o.locking,
o.handling_charge,
o.platform_service_fee,
o.operator_dividend
FROM FROM
et_order o et_order o
LEFT JOIN LEFT JOIN
@ -218,7 +224,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
o.audio_files, o.audio_files,
o.used_sn, o.used_sn,
o.change_reason, o.change_reason,
o.locking o.locking,
o.handling_charge,
o.platform_service_fee,
o.operator_dividend
FROM FROM
et_order o et_order o
LEFT JOIN LEFT JOIN
@ -938,6 +947,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargingCycle != null">charging_cycle = #{chargingCycle},</if> <if test="chargingCycle != null">charging_cycle = #{chargingCycle},</if>
<if test="chargingCycleValue != null">charging_cycle_value = #{chargingCycleValue},</if> <if test="chargingCycleValue != null">charging_cycle_value = #{chargingCycleValue},</if>
<if test="cappedAmount != null">capped_amount = #{cappedAmount},</if> <if test="cappedAmount != null">capped_amount = #{cappedAmount},</if>
<if test="handlingCharge != null">handling_charge = #{handlingCharge},</if>
<if test="platformServiceFee != null">platform_service_fee = #{platformServiceFee},</if>
<if test="operatorDividend != null">operator_dividend = #{operatorDividend},</if>
</trim> </trim>
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>
@ -992,6 +1004,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargingCycle != null">charging_cycle = #{chargingCycle},</if> <if test="chargingCycle != null">charging_cycle = #{chargingCycle},</if>
<if test="chargingCycleValue != null">charging_cycle_value = #{chargingCycleValue},</if> <if test="chargingCycleValue != null">charging_cycle_value = #{chargingCycleValue},</if>
<if test="cappedAmount != null">capped_amount = #{cappedAmount},</if> <if test="cappedAmount != null">capped_amount = #{cappedAmount},</if>
<if test="handlingCharge != null">handling_charge = #{handlingCharge},</if>
<if test="platformServiceFee != null">platform_service_fee = #{platformServiceFee},</if>
<if test="operatorDividend != null">operator_dividend = #{operatorDividend},</if>
</trim> </trim>
where order_no = #{orderNo} where order_no = #{orderNo}
</update> </update>