1.押金充值权限问题
This commit is contained in:
parent
cb7b167593
commit
11b1992029
|
@ -13,6 +13,7 @@ import com.ruoyi.common.exception.ServiceException;
|
|||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.domain.EtOrder;
|
||||
import com.ruoyi.system.domain.EtOrderQuery;
|
||||
import com.ruoyi.system.domain.vo.RechargeVo;
|
||||
import com.ruoyi.system.service.IAsUserService;
|
||||
import com.ruoyi.system.service.IEtOrderService;
|
||||
|
@ -61,7 +62,7 @@ public class EtOrderController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:list')")
|
||||
@GetMapping("/rechargeList")
|
||||
public TableDataInfo rechargeList(EtOrder etOrder)
|
||||
public TableDataInfo rechargeList(EtOrderQuery etOrder)
|
||||
{
|
||||
startPage();
|
||||
List<RechargeVo> list = etOrderService.rechargeList(etOrder);
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单对象 et_order
|
||||
*
|
||||
* @author 邱贞招
|
||||
* @date 2024-04-08
|
||||
*/
|
||||
@Data
|
||||
public class EtOrderQuery extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户 */
|
||||
@Excel(name = "用户")
|
||||
private String userName;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
|
||||
/** 状态:0-预约中,1-取消预约,2-开始骑行,3-结束 */
|
||||
@Excel(name = "状态:0-预约中,1-取消预约,2-开始骑行,3-结束")
|
||||
private String status;
|
||||
|
||||
/** 支付状态:0-未支付,1-已支付 */
|
||||
@Excel(name = "支付状态:0-未支付,1-已支付")
|
||||
private String paid;
|
||||
|
||||
/** 退款结果(回调) */
|
||||
@Excel(name = "退款结果(回调)")
|
||||
private String refundResult;
|
||||
|
||||
/** 退款类型 */
|
||||
@Excel(name = "退款类型")
|
||||
private String refundType;
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.EtOrder;
|
||||
import com.ruoyi.system.domain.EtOrderQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
@ -53,6 +54,14 @@ public interface EtOrderMapper
|
|||
*/
|
||||
public List<EtOrder> selectEtOrderListNoRoute(EtOrder etOrder);
|
||||
|
||||
/**
|
||||
* 查询订单列表(不带路由)
|
||||
*
|
||||
* @param etOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<EtOrder> selectEtOrderListNoRoute2(EtOrderQuery etOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
|
|||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.EtOrder;
|
||||
import com.ruoyi.system.domain.EtOrderQuery;
|
||||
import com.ruoyi.system.domain.EtRefund;
|
||||
|
||||
/**
|
||||
|
@ -29,6 +30,14 @@ public interface EtRefundMapper
|
|||
*/
|
||||
public List<EtRefund> selectEtRefundList(EtRefund etRefund);
|
||||
|
||||
/**
|
||||
* 查询退款订单列表
|
||||
*
|
||||
* @param orderQuery 退款订单
|
||||
* @return 退款订单集合
|
||||
*/
|
||||
public List<EtRefund> selectEtRefundList2(EtOrderQuery orderQuery);
|
||||
|
||||
/**
|
||||
* 新增退款订单
|
||||
*
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.EtOrder;
|
||||
import com.ruoyi.system.domain.EtOrderQuery;
|
||||
import com.ruoyi.system.domain.EtRefund;
|
||||
import com.ruoyi.system.domain.vo.*;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
|
||||
import com.wechat.pay.java.service.refund.model.Refund;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
|
@ -183,7 +183,7 @@ public interface IEtOrderService
|
|||
/**
|
||||
* 查询充值/退款订单列表
|
||||
*/
|
||||
List<RechargeVo> rechargeList(EtOrder etOrder);
|
||||
List<RechargeVo> rechargeList(EtOrderQuery etOrder);
|
||||
|
||||
/**
|
||||
* 获取当前正在骑行中的订单
|
||||
|
|
|
@ -362,13 +362,13 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<RechargeVo> rechargeList(EtOrder etOrder) {
|
||||
public List<RechargeVo> rechargeList(EtOrderQuery etOrder) {
|
||||
List<RechargeVo> rechargeVoList = new ArrayList<>();
|
||||
String status = etOrder.getStatus();
|
||||
if(StrUtil.isBlank(status) || "1".equals(status)){
|
||||
etOrder.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
|
||||
etOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
|
||||
List<EtOrder> etOrders = etOrderMapper.selectEtOrderListNoRoute(etOrder);
|
||||
List<EtOrder> etOrders = etOrderMapper.selectEtOrderListNoRoute2(etOrder);
|
||||
etOrders.forEach(etOrder1 -> {
|
||||
RechargeVo rechargeVo = new RechargeVo();
|
||||
BeanUtils.copyProperties(etOrder1,rechargeVo);
|
||||
|
@ -387,12 +387,10 @@ public class EtOrderServiceImpl implements IEtOrderService
|
|||
}
|
||||
if(StrUtil.isBlank(status) || "2".equals(status)){
|
||||
//如果查询押金则增加退款记录
|
||||
EtRefund refund = new EtRefund();
|
||||
refund.setType(ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
refund.setRefundResult(Constants.SUCCESS2);
|
||||
refund.setUserName(etOrder.getUserName());
|
||||
etOrder.setRefundType(ServiceConstants.REFUND_TYPE_DEPOSIT);
|
||||
etOrder.setRefundResult(Constants.SUCCESS2);
|
||||
PageUtils.startPage();
|
||||
List<EtRefund> etRefunds = etRefundMapper.selectEtRefundList(refund);
|
||||
List<EtRefund> etRefunds = etRefundMapper.selectEtRefundList2(etOrder);
|
||||
etRefunds.forEach(etRefund -> {
|
||||
AsUser asUser = asUserMapper.selectUserById(etRefund.getUserId());
|
||||
RechargeVo rechargeVo = new RechargeVo();
|
||||
|
|
|
@ -286,6 +286,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by o.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEtOrderListNoRoute2" parameterType="EtOrderQuery" resultMap="EtOrderResult">
|
||||
SELECT
|
||||
o.order_id,
|
||||
o.area_id,
|
||||
oa.area_name AS area,
|
||||
oa.is_deposit_deduction isDepositDeduction,
|
||||
u.user_name AS userName,
|
||||
u.phonenumber AS phonenumber,
|
||||
u.real_name AS realName,
|
||||
o.order_no,
|
||||
o.out_trade_no,
|
||||
o.user_id,
|
||||
o.rule_id,
|
||||
o.coupon_id,
|
||||
o.log_id,
|
||||
o.device_mac,
|
||||
o.sn,
|
||||
de.vehicle_num,
|
||||
o.pay_time,
|
||||
o.paid,
|
||||
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,
|
||||
COALESCE(o.appointment_fee, 0) AS appointment_fee,
|
||||
o.mark,
|
||||
o.duration,
|
||||
o.distance,
|
||||
o.status,
|
||||
o.create_time,
|
||||
o.appointment_start_time,
|
||||
o.appointment_end_time,
|
||||
o.appointment_timeout,
|
||||
o.unlock_time,
|
||||
o.return_time,
|
||||
o.rule_end_time,
|
||||
o.return_type,
|
||||
o.video_url,
|
||||
o.upload_time,
|
||||
o.deduction_amount,
|
||||
o.deposit_deduction,
|
||||
o.audio_files,
|
||||
o.used_sn,
|
||||
o.change_reason,
|
||||
o.locking,
|
||||
o.handling_charge,
|
||||
o.platform_service_fee,
|
||||
o.operator_dividend,
|
||||
o.pay_channel
|
||||
FROM
|
||||
et_order o
|
||||
LEFT JOIN
|
||||
et_operating_area oa ON o.area_id = oa.area_id
|
||||
LEFT JOIN
|
||||
et_device de ON de.sn = o.sn
|
||||
LEFT JOIN
|
||||
et_user u ON u.user_id = o.user_id
|
||||
LEFT join et_area_dept ad on ad.area_id = oa.area_id
|
||||
LEFT join sys_dept d on d.dept_id = ad.dept_id
|
||||
where 1 = 1
|
||||
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="type != null and type != ''"> and o.type = #{type}</if>
|
||||
<if test="status != null and status != ''"> and o.status = #{status}</if>
|
||||
<if test="paid != null and paid != ''"> and o.paid = #{paid}</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by o.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEtOrderByOrderId" parameterType="Long" resultMap="EtOrderResult">
|
||||
select o.order_id,
|
||||
o.area_id,
|
||||
|
|
|
@ -48,6 +48,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by o.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEtRefundList2" parameterType="EtOrderQuery" resultMap="EtRefundResult">
|
||||
select r.id, r.refund_no, o.area_id areaId,oa.area_name areaName,r.order_no, r.user_id, u.user_name userName, r.amount, r.dispatch_fee, r.manage_fee,
|
||||
r.riding_fee, r.appointment_fee, r.type, r.reason, r.create_time, r.item_desc,r.refund_result from et_refund r
|
||||
INNER JOIN et_order o on o.order_no = r.order_no
|
||||
left join et_user u on u.user_id = r.user_id
|
||||
LEFT JOIN et_operating_area oa ON o.area_id = oa.area_id
|
||||
LEFT join et_area_dept ad on ad.area_id = oa.area_id
|
||||
LEFT join sys_dept d on d.dept_id = ad.dept_id
|
||||
where 1 = 1
|
||||
<if test="refundResult != null "> and r.refund_result = #{refundResult}</if>
|
||||
<if test="refundType != null "> and r.type = #{refundType}</if>
|
||||
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by o.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEtRefundById" parameterType="Long" resultMap="EtRefundResult">
|
||||
<include refid="selectEtRefundVo"/>
|
||||
where id = #{id}
|
||||
|
|
Loading…
Reference in New Issue
Block a user