1. 联调
This commit is contained in:
		
							parent
							
								
									d31bfd5ebc
								
							
						
					
					
						commit
						5822ff6d51
					
				|  | @ -98,6 +98,10 @@ public class EtOrder extends BaseEntity | |||
|     @Excel(name = "订单总金额(元)") | ||||
|     private BigDecimal totalFee; | ||||
| 
 | ||||
|     /** 实际支付金额(元) */ | ||||
|     @Excel(name = "实际支付金额(元)") | ||||
|     private BigDecimal payFee; | ||||
| 
 | ||||
|     /** 实际结算金额(元) */ | ||||
|     @TableField(exist = false) | ||||
|     private BigDecimal settlementFee; | ||||
|  |  | |||
|  | @ -128,7 +128,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 根据sn号查询车辆实时信息 | ||||
|      * 根据sn号查询车辆实时信息  真实金额  实际 | ||||
|      * | ||||
|      * @param sn 设备sn | ||||
|      * @return 设备 | ||||
|  | @ -140,12 +140,20 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | |||
|         if (ObjectUtil.isNull(asDevice)) { | ||||
|             throw new ServiceException("设备不存在:"+ sn); | ||||
|         } | ||||
|         // 查询车辆上下线 | ||||
|         if(!isOnline(sn)){ | ||||
|             asDevice.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_OFFLINE); | ||||
|             log.info("设备不在线:"+ sn); | ||||
|         }else{ | ||||
|             asDevice.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_ONLINE); | ||||
|         } | ||||
|         int i = asDeviceMapper.updateAsDevice(asDevice); | ||||
|         Long areaId = asDevice.getAreaId(); | ||||
|         EtOperatingArea etOperatingArea; | ||||
|         if (ObjectUtil.isNotNull(areaId)) { | ||||
|             etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId); | ||||
|         }else{ | ||||
|             throw new ServiceException("区域信息不存在"); | ||||
|             throw new ServiceException("【selectAsDeviceBySn】区域信息不存在"); | ||||
|         } | ||||
|         if(ObjectUtil.isNotNull(etOperatingArea)){ | ||||
|             asDevice.setAreaName(etOperatingArea.getAreaName()); | ||||
|  |  | |||
|  | @ -715,6 +715,8 @@ public class EtOrderServiceImpl implements IEtOrderService | |||
|         } | ||||
|         log.info("总金额:【{}】,退款金额:【{}】", etOrder1.getTotalFee(), refundAmount); | ||||
|         Refund refund = wxPayService.refund(etOrder1, etOrder.getReason(), refundAmount); | ||||
|         //todo 更新订单的payFee = totalFee - refundAmount | ||||
| 
 | ||||
|         /** 2.记录退款表  创建退款对象*/ | ||||
|         EtRefund refund1= createRefund(etOrder, refundAmount, appointmentFee, dispatchFee, manageFee, ridingFee, refund,ServiceConstants.REFUND_TYPE_SYSTEM); | ||||
|         int i = etRefundService.insertEtRefund(refund1); | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|         <result property="payType"    column="pay_type"    /> | ||||
|         <result property="type"    column="type"    /> | ||||
|         <result property="totalFee"    column="total_fee"    /> | ||||
|         <result property="payFee"    column="pay_fee"    /> | ||||
|         <result property="dispatchFee"    column="dispatch_fee"    /> | ||||
|         <result property="manageFee"    column="manage_fee"    /> | ||||
|         <result property="ridingFee"    column="riding_fee"    /> | ||||
|  | @ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| 
 | ||||
|     <sql id="selectEtOrderVo"> | ||||
|         select order_id, area_id, order_no, out_trade_no, user_id, rule_id, | ||||
|                device_mac, sn, pay_time, paid, pay_type, type, total_fee, dispatch_fee, | ||||
|                device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee, | ||||
|                manage_fee, riding_fee, appointment_fee, mark, duration, distance, status, | ||||
|                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 from et_order | ||||
|     </sql> | ||||
|  | @ -63,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|         o.pay_type, | ||||
|         o.type, | ||||
|         COALESCE(o.total_fee, 0) AS total_fee, | ||||
|         COALESCE(o.pay_fee, 0) AS pay_fee, | ||||
|         COALESCE(o.dispatch_fee, 0) AS dispatch_fee, | ||||
|         COALESCE(o.manage_fee, 0) AS manage_fee, | ||||
|         COALESCE(o.riding_fee, 0) AS riding_fee, | ||||
|  | @ -250,7 +252,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|     </select> | ||||
| 
 | ||||
|     <select id="getPayFee" resultType="java.math.BigDecimal"> | ||||
|         select COALESCE(SUM(total_fee), 0) from et_order | ||||
|         select COALESCE(SUM(pay_fee), 0) from et_order | ||||
|         <where> | ||||
|             <if test="sn != null  and sn != ''"> and sn = #{sn}</if> | ||||
|             <if test="startDateStr != null  and startDateStr != ''"> | ||||
|  | @ -264,7 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|     </select> | ||||
| 
 | ||||
|     <select id="getIncome" resultType="java.math.BigDecimal"> | ||||
|         select COALESCE(SUM(total_fee), 0) from et_order | ||||
|         select COALESCE(SUM(pay_fee), 0) from et_order | ||||
|         <where> | ||||
|             <if test="sn != null  and sn != ''"> and sn = #{sn}</if> | ||||
|             <if test="startDateStr != null  and startDateStr != ''"> | ||||
|  | @ -344,6 +346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="payType != null and payType != ''">pay_type,</if> | ||||
|             <if test="type != null">type,</if> | ||||
|             <if test="totalFee != null">total_fee,</if> | ||||
|             <if test="payFee != null">pay_fee,</if> | ||||
|             <if test="dispatchFee != null">dispatch_fee,</if> | ||||
|             <if test="manageFee != null">manage_fee,</if> | ||||
|             <if test="ridingFee != null">riding_fee,</if> | ||||
|  | @ -376,6 +379,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="payType != null and payType != ''">#{payType},</if> | ||||
|             <if test="type != null">#{type},</if> | ||||
|             <if test="totalFee != null">#{totalFee},</if> | ||||
|             <if test="payFee != null">#{payFee},</if> | ||||
|             <if test="dispatchFee != null">#{dispatchFee},</if> | ||||
|             <if test="manageFee != null">#{manageFee},</if> | ||||
|             <if test="ridingFee != null">#{ridingFee},</if> | ||||
|  | @ -411,6 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="payType != null and payType != ''">pay_type = #{payType},</if> | ||||
|             <if test="type != null">type = #{type},</if> | ||||
|             <if test="totalFee != null">total_fee = #{totalFee},</if> | ||||
|             <if test="payFee != null">pay_fee = #{payFee},</if> | ||||
|             <if test="dispatchFee != null">dispatch_fee = #{dispatchFee},</if> | ||||
|             <if test="manageFee != null">manage_fee = #{manageFee},</if> | ||||
|             <if test="ridingFee != null">riding_fee = #{ridingFee},</if> | ||||
|  | @ -446,6 +451,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="payType != null and payType != ''">pay_type = #{payType},</if> | ||||
|             <if test="type != null">type = #{type},</if> | ||||
|             <if test="totalFee != null">total_fee = #{totalFee},</if> | ||||
|             <if test="payFee != null">pay_fee = #{payFee},</if> | ||||
|             <if test="dispatchFee != null">dispatch_fee = #{dispatchFee},</if> | ||||
|             <if test="manageFee != null">manage_fee = #{manageFee},</if> | ||||
|             <if test="ridingFee != null">riding_fee = #{ridingFee},</if> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user