You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

  • 没有参加充值活动并且账户余额小于50元后台可以设置,系统自动退款原路返回。
  • 个人用户----用户充值 ---- 充电消费----余额到用户钱包,可以下次消费,如果没有参加充值送券活动,则该笔充值可以申请退款。后骒审核信息无误,可以原路退回。
D:\dsWork\YltProject\Ylt\ms-finance\src\main\java\com\charge\finance\controller\RecManageController.java
/**
     * @param
     * @return  PageInfo<AccountRechargeListVO>
     */
    @ApiOperation(value = "退款分页列表",response = AccountRechargeListVO.class)
    @GetMapping(value = "/refundInfo")
    public ResultVO<PageInfo<AccountRechargeListVO>> refundInfo(RechargeQueryDTO queryDTO) {
        PageInfo<AccountRechargeListVO> refundPage = rechargeService.refundPage(queryDTO);
        return ResultVO.success(refundPage);
    }
<select id="refundPage" resultType="com.charge.finance.vo.AccountRechargeListVO">
    SELECT
      ifnull( te.id, '' ) rechargeId,
      ifnull( date_format( refund_time, '%Y-%m-%d %H:%i:%s' ), '' ) refundTime,
      ifnull( date_format( pay_time, '%Y-%m-%d %H:%i:%s' ), '' ) payTime,
      ifnull( refund_money, '' ) refundMoney,
      ifnull( refund_state, '' ) refundState,
      ifnull( pay_money, '' ) payMoney,
      ifnull( tu.id, '' ) userId,
      ifnull( tu.phone, '' ) phone,
      ifnull( refund_memo, '' ) refundMemo,
      ifnull( outtradeno, '' ) outTradeNo,
      ifnull( refund_outtradno, '' ) refundOuttradno,
      ifnull( refund_operer, '' ) refundOperer,
      ifnull( pay_type, '' ) payType,
      ifnull( tu.user_type, '' ) userType,
      ifnull( te.refund_reason, '' ) refundReason,
      ifnull( tu.user_name, '' ) userName,
      ifnull( te.refund_apply_time, '' ) refundApplyTime,
      ifnull( te.refund_image, '' ) refundImage,
      tu.user_owner_id as userOwnerId
    FROM
      t_account_recharge te
    LEFT JOIN t_user tu ON te.user_id = tu.id
    LEFT JOIN t_user_card c ON tu.id = c.user_id
    WHERE
      refund_state IN ( 1, 2, 3, 4 )
    <if test="dto.ownerId!=null and dto.ownerId!=''">
      AND tu.user_owner_id = #{dto.ownerId}
    </if>
    <if test="dto.userType!=null and dto.userType !=''">
      AND tu.user_type = #{dto.userType}
    </if>
    <if test="dto.userName!=null and dto.userName!=''">
      AND tu.user_name like "%"#{dto.userName}"%"
    </if>
    <if test="dto.phone != null and dto.phone != ''">
      AND tu.phone= #{dto.phone}
    </if>

    <if test="dto.outTradeNo!=null and dto.outTradeNo!=''">
      AND outtradeno = #{dto.outTradeNo}
    </if>
    <if test="dto.userId!=null and dto.userId!=''">
      AND tu.id = #{dto.userId}
    </if>

    <if test="dto.refundOuttradno!=null and dto.refundOuttradno!=''">
      AND refund_outtradno = #{dto.refundOuttradno}
    </if>

    <if test="dto.payType!=null and dto.payType!=''">
      AND pay_type = #{dto.payType}
    </if>

    <if test="dto.refundTimeType != null">
      <choose>
        <when test="dto.refundTimeType == 1">
          <if test="dto.refundStartTime !=null and dto.refundStartTime!=''">
            AND refund_apply_time >= date_format(#{dto.refundStartTime} ,'%Y-%m-%d %H:%i:%s')
          </if>
          <if test="dto.refundEndTime !=null and dto.refundEndTime!=''">
            AND refund_apply_time &lt;= date_format(#{dto.refundEndTime} ,'%Y-%m-%d %H:%i:%s')
          </if>
        </when>
        <when test="dto.refundTimeType == 2">
          <if test="dto.refundStartTime !=null and dto.refundStartTime!=''">
            AND refund_time >= date_format(#{dto.refundStartTime} ,'%Y%m%d%H%i%s')
          </if>
          <if test="dto.refundEndTime !=null and dto.refundEndTime!=''">
            AND refund_time &lt;= date_format(#{dto.refundEndTime} ,'%Y%m%d%H%i%s')
          </if>
        </when>
      </choose>
    </if>
    <if test="dto.refundState!=null and dto.refundState!=''">
      and refund_state = #{dto.refundState}
    </if>
    <if test="dto.cardNo!=null and dto.cardNo!=''">
      AND c.card_no = #{dto.cardNo}
    </if>
    GROUP BY te.id
    ORDER BY te.id DESC
  </select>

Q:如何知道一条充值订单是不是可以退款?

用户在申请退款时,如果这笔充值参加了活动,用户就不能选择这笔充值退款。

refund\_state 6款状态0未退款 1已退款 2 退款失败 3退款申请审核 4未退款驳回 5建帮活动不可退款

select * from t_account_recharge where user_id=53958 and refund_state=6 order by id desc

App支付记录表 t_account_recharge
refund_state
refund_state IN ( 1, 2, 3, 4 )
退款状态(0未退款 1已退款  2 退款失败 3退款申请审核 4未退款驳回 5建帮活动不可退款)

select * from t_account_recharge  where outtradeno='4200002328202408130579252328'