1.对账表押金抵扣
2.上传视频的校验 3.当天的押金抵扣处理
This commit is contained in:
		
							parent
							
								
									40249eef4e
								
							
						
					
					
						commit
						032e6b6d02
					
				|  | @ -44,6 +44,18 @@ public class EtReconciliation extends BaseEntity | |||
|     @Excel(name = "押金退款") | ||||
|     private BigDecimal depositRefund; | ||||
| 
 | ||||
|     /** 押金盈余 */ | ||||
|     @Excel(name = "押金盈余") | ||||
|     private BigDecimal depositSurplus; | ||||
| 
 | ||||
|     /** 订单退款 */ | ||||
|     @Excel(name = "订单退款") | ||||
|     private BigDecimal orderRefund; | ||||
| 
 | ||||
|     /** 订单盈余 */ | ||||
|     @Excel(name = "订单盈余") | ||||
|     private BigDecimal orderSurplus; | ||||
| 
 | ||||
|     /** 押金抵扣金额 */ | ||||
|     @Excel(name = "押金抵扣金额") | ||||
|     private BigDecimal deductionAmount; | ||||
|  |  | |||
|  | @ -1787,6 +1787,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | |||
|                 throw new ServiceException("该订单状态非骑行中"); | ||||
|             } | ||||
|             EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(order.getAreaId()); | ||||
|             if(ServiceConstants.RETURN_VERIFY_YES.equals(area.getReturnVerify()) && StrUtil.isBlank(order.getVideoUrl())){ | ||||
|                 throw new ServiceException("请先拍摄还车视频!"); | ||||
|             } | ||||
|             if(ServiceConstants.RETURN_TYPE_NORMAL.equals(returnType)){ | ||||
|                 //判断是否在禁停区内,如果在禁停区内,不能还车。  noParkingArea | ||||
|                 if(isNoParkingArea(order.getSn(), order.getAreaId())){ | ||||
|  |  | |||
|  | @ -905,6 +905,9 @@ public class EtTask { | |||
|         etReconciliation.setPlatformServiceFee(selfReconciliationVO.getPlatformServiceFee()); | ||||
|         etReconciliation.setDepositPaid(selfReconciliationVO.getDepositPaid()); | ||||
|         etReconciliation.setOrderPaid(selfReconciliationVO.getOrderPaid()); | ||||
|         etReconciliation.setOrderRefund(selfReconciliationVO.getOrderRefund()); | ||||
|         etReconciliation.setOrderSurplus(selfReconciliationVO.getOrderPaid().subtract(selfReconciliationVO.getOrderRefund()).add(selfReconciliationVO.getDeductionAmount())); | ||||
|         etReconciliation.setDepositSurplus(selfReconciliationVO.getDepositChange()); | ||||
|         etReconciliation.setDepositRefund(selfReconciliationVO.getDepositRefund()); | ||||
|         etReconciliation.setDeductionAmount(selfReconciliationVO.getDeductionAmount()); | ||||
|         etReconciliation.setUserReceipts(selfReconciliationVO.getUserReceipts()); | ||||
|  |  | |||
|  | @ -1177,7 +1177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| 
 | ||||
|     <select id="selectToBePaidEtOrderList" resultType="com.ruoyi.system.domain.EtOrder"> | ||||
|         <include refid="selectEtOrderVoNoRoute"/> | ||||
|         where status = 3 and return_time <= DATE_SUB(NOW(), INTERVAL 7 DAY) | ||||
|         WHERE status = 3 AND DATE(return_time) = CURDATE() | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="getCurrentOrderList" resultType="com.ruoyi.system.domain.EtOrder"> | ||||
|  | @ -1208,7 +1208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|         <if test="endDateStr != null  and endDateStr != ''"> | ||||
|             AND date_format(pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') | ||||
|         </if> | ||||
|         AND STATUS = 4 | ||||
|         AND STATUS in (4,5) | ||||
|         AND paid = 1 | ||||
|         AND total_fee != 0 | ||||
|             ) AS total_order, | ||||
|  | @ -1226,7 +1226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|         <if test="endDateStr != null  and endDateStr != ''"> | ||||
|             AND date_format(pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') | ||||
|         </if> | ||||
|         AND STATUS = 4 | ||||
|         AND STATUS in (4,5) | ||||
|         AND type = 1 | ||||
|         AND deposit_deduction = '1' | ||||
|         AND paid = 1 | ||||
|  | @ -1236,24 +1236,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| 
 | ||||
|     <select id="getDepositDeductionAmount" resultType="java.math.BigDecimal"> | ||||
|         SELECT | ||||
|             COALESCE(SUM(pay_fee), 0) AS deposit_deduction_fee | ||||
|             SUM( total_amount ) AS total_sum | ||||
|         FROM | ||||
|             et_order | ||||
|         WHERE 1=1 | ||||
|         <if test="channelId != 3 or (channelId == null)">and area_id != 14 </if> | ||||
|         <if test="areaId != null and areaId != 0"> and area_id = #{areaId}</if> | ||||
|         <if test="channelId != null ">and pay_channel =  #{channelId}</if> | ||||
|         <if test="startDateStr != null  and startDateStr != ''"> | ||||
|             AND date_format(pay_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') | ||||
|         </if> | ||||
|         <if test="endDateStr != null  and endDateStr != ''"> | ||||
|             AND date_format(pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') | ||||
|         </if> | ||||
|         AND STATUS = 4 | ||||
|         AND type = 1 | ||||
|         AND deposit_deduction = '1' | ||||
|         AND paid = 1 | ||||
|         AND total_fee != 0 | ||||
|         ( | ||||
|             SELECT | ||||
|             ( | ||||
|             o.pay_fee - COALESCE ( ref.total_refund, 0 )) AS total_amount | ||||
|             FROM | ||||
|             et_order o | ||||
|             LEFT JOIN ( SELECT order_no, SUM( amount ) AS total_refund FROM et_refund GROUP BY order_no ) ref ON o.order_no = ref.order_no | ||||
|             WHERE 1=1 | ||||
|             <if test="channelId != 3 or (channelId == null)">and o.area_id != 14 </if> | ||||
|             <if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if> | ||||
|             <if test="startDateStr != null  and startDateStr != ''"> | ||||
|                 AND date_format(o.pay_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') | ||||
|             </if> | ||||
|             <if test="endDateStr != null  and endDateStr != ''"> | ||||
|                 AND date_format(o.pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') | ||||
|             </if> | ||||
|             AND o.STATUS = 4 | ||||
|             AND o.type = 1 | ||||
|             AND o.deposit_deduction = '1' | ||||
|             AND o.paid = 1 | ||||
|             AND o.total_fee != 0 | ||||
|             AND ( | ||||
|             o.pay_fee - COALESCE ( ref.total_refund, 0 )) > 0 | ||||
|             AND o.mark LIKE '%大于%' UNION ALL | ||||
|             SELECT | ||||
|             SUM( o.pay_fee - ref.amount ) AS total_amount | ||||
|             FROM | ||||
|             et_order o | ||||
|             LEFT JOIN et_refund ref ON o.order_no = ref.order_no | ||||
|             WHERE 1=1 | ||||
|             <if test="channelId != 3 or (channelId == null)">and o.area_id != 14 </if> | ||||
|             <if test="areaId != null and areaId != 0"> and o.area_id = #{areaId}</if> | ||||
|             <if test="channelId != null ">AND o.pay_channel =  #{channelId}</if> | ||||
|             <if test="startDateStr != null  and startDateStr != ''"> | ||||
|                 AND date_format(ref.create_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') | ||||
|             </if> | ||||
|             <if test="endDateStr != null  and endDateStr != ''"> | ||||
|                 AND date_format(ref.create_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') | ||||
|             </if> | ||||
|             AND o.STATUS = 4 | ||||
|             AND o.type = 2 | ||||
|             AND o.deposit_deduction = '1' | ||||
|             AND o.paid = 1 | ||||
|             AND o.total_fee != 0 | ||||
|             GROUP BY | ||||
|             o.order_no | ||||
|         ) AS combined_amounts | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -18,10 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|         <result property="userReceipts"    column="user_receipts"    /> | ||||
|         <result property="settlementAmount"    column="settlement_amount"    /> | ||||
|         <result property="platformServiceFee"    column="platform_service_fee"    /> | ||||
|         <result property="orderRefund"    column="order_refund"    /> | ||||
|         <result property="orderSurplus"    column="order_surplus"    /> | ||||
|         <result property="depositSurplus"    column="deposit_surplus"    /> | ||||
|     </resultMap> | ||||
| 
 | ||||
|     <sql id="selectEtReconciliationVo"> | ||||
|         select reconciliation_id, order_paid, total_amount, deposit_paid, pay_channel, create_time, day, deposit_refund, deduction_amount, handling_charge, user_receipts, settlement_amount, platform_service_fee from et_reconciliation | ||||
|         select reconciliation_id, order_paid, total_amount, deposit_paid, pay_channel, create_time, day, deposit_refund, deduction_amount, | ||||
|                handling_charge, user_receipts, settlement_amount, platform_service_fee, order_refund, order_surplus, deposit_surplus from et_reconciliation | ||||
|     </sql> | ||||
| 
 | ||||
|     <select id="selectEtReconciliationList" parameterType="EtReconciliation" resultMap="EtReconciliationResult"> | ||||
|  | @ -67,6 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userReceipts != null">user_receipts,</if> | ||||
|             <if test="settlementAmount != null">settlement_amount,</if> | ||||
|             <if test="platformServiceFee != null">platform_service_fee,</if> | ||||
|             <if test="depositSurplus != null">deposit_surplus,</if> | ||||
|             <if test="orderRefund != null">order_refund,</if> | ||||
|             <if test="orderSurplus != null">order_surplus,</if> | ||||
|          </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="orderPaid != null">#{orderPaid},</if> | ||||
|  | @ -81,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userReceipts != null">#{userReceipts},</if> | ||||
|             <if test="settlementAmount != null">#{settlementAmount},</if> | ||||
|             <if test="platformServiceFee != null">#{platformServiceFee},</if> | ||||
|             <if test="depositSurplus != null">#{depositSurplus},</if> | ||||
|             <if test="orderRefund != null">#{orderRefund},</if> | ||||
|             <if test="orderSurplus != null">#{orderSurplus},</if> | ||||
|          </trim> | ||||
|     </insert> | ||||
| 
 | ||||
|  | @ -99,6 +109,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
|             <if test="userReceipts != null">user_receipts = #{userReceipts},</if> | ||||
|             <if test="settlementAmount != null">settlement_amount = #{settlementAmount},</if> | ||||
|             <if test="platformServiceFee != null">platform_service_fee = #{platformServiceFee},</if> | ||||
|             <if test="depositSurplus != null">deposit_surplus = #{depositSurplus},</if> | ||||
|             <if test="orderRefund != null">order_refund = #{orderRefund},</if> | ||||
|             <if test="orderSurplus != null">order_surplus = #{orderSurplus},</if> | ||||
|         </trim> | ||||
|         where reconciliation_id = #{reconciliationId} | ||||
|     </update> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user