1
dd
2026-01-28 95a52a6087a7587c89253c099f3d76213f8318ab
1
5 files modified
1 files added
90 ■■■■ changed files
src/main/java/com/nq/controller/protol/UserWithdrawController.java 18 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/UserWithdraw.java 11 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/IUserWithdrawService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/vo/pay/OutMoneyVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/UserWithdrawMapper.xml 26 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/protol/UserWithdrawController.java
@@ -7,6 +7,7 @@
import javax.servlet.http.HttpServletRequest;
import com.nq.vo.pay.OutMoneyVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,9 +43,22 @@
    //用户提现
    @RequestMapping({"outMoney.do"})
    @ResponseBody
    public ServerResponse outMoney(@RequestParam(value = "amt") String amt,@RequestParam(value = "bankId") String bankId,
    public ServerResponse outMoney(@RequestParam(value = "amt") String amt,
                                   @RequestParam(value = "assetsType") String accsetType,
                                   @RequestParam(value = "bankId") String bankId,
                                   @RequestParam(value = "bankName", required = false) String bankName,
                                   @RequestParam(value = "bankAddress", required = false) String bankAddress,
                                   @RequestParam(value = "branchCode", required = false) String branchCode,
                                   @RequestParam(value = "cardholderName", required = false) String cardholderName,
                                   HttpServletRequest request) {
        OutMoneyVo outMoneyVo = new OutMoneyVo();
        outMoneyVo.setBankNo(bankId);
        outMoneyVo.setBankName(bankName);
        outMoneyVo.setBankAddress(bankAddress);
        outMoneyVo.setBranchCode(branchCode);
        outMoneyVo.setCardholderName(cardholderName);
        ServerResponse serverResponse = null;
        User user = this.iUserService.getCurrentRefreshUser(request);
@@ -65,7 +79,7 @@
//                return ServerResponse.createByErrorMsg("请输入整数!",request);
//            }
            synchronized (user.getId()){
                serverResponse = this.iUserWithdrawService.outMoney(amt, user.getWithPwd(), accsetType,bankId,request);
                serverResponse = this.iUserWithdrawService.outMoney(outMoneyVo,amt, user.getWithPwd(), accsetType,request);
            }
        } catch (Exception e) {
            log.error("出金异常 e = {}", e);
src/main/java/com/nq/pojo/UserWithdraw.java
@@ -31,12 +31,17 @@
    private Date transTime;
    private String withName;
    @Excel(name = "银行卡号")
    private String bankNo;
    @Excel(name = "银行名称")
    private String bankName;
    @Excel(name = "银行支行")
    @Excel(name = "分行名称")
    private String bankAddress;
    @Excel(name = "分行代码")
    private String branchCode;
    @Excel(name = "银行卡号")
    private String bankNo;
    @Excel(name = "持卡人姓名")
    private String cardholderName;
    @Excel(name = "状态" ,replace = { "审核中_0", "成功_1", "失败_2", "取消_3","已提交_4"  })
    private Integer withStatus;
src/main/java/com/nq/service/IUserWithdrawService.java
@@ -6,6 +6,7 @@
import com.nq.pojo.PaymentCallbackTwo;
import com.nq.pojo.TradeResultVO;
import com.nq.pojo.UserWithdraw;
import com.nq.vo.pay.OutMoneyVo;
import java.io.IOException;
import java.math.BigDecimal;
@@ -14,7 +15,7 @@
import javax.servlet.http.HttpServletResponse;
public interface IUserWithdrawService {
  ServerResponse outMoney(String paramString,String with_Pwd, String assetsType,String bankId,HttpServletRequest paramHttpServletRequest) throws Exception;
  ServerResponse outMoney(OutMoneyVo outMoneyVo,String paramString, String with_Pwd, String assetsType, HttpServletRequest paramHttpServletRequest) throws Exception;
  
  ServerResponse<PageInfo> findUserWithList(String paramString, HttpServletRequest paramHttpServletRequest, int paramInt1, int paramInt2);
  
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
@@ -25,6 +25,7 @@
import javax.servlet.http.HttpServletResponse;
import com.nq.utils.timeutil.TimeUtil;
import com.nq.vo.pay.OutMoneyVo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -79,7 +80,7 @@
    StockTimeSettingMapper stockTimeSettingMapper;
    @Transactional(rollbackFor = Exception.class)
    public ServerResponse outMoney(String amt, String with_Pwd,String accsetType,String bankId,HttpServletRequest request) throws Exception {
    public ServerResponse outMoney(OutMoneyVo outMoneyVo,String amt, String with_Pwd, String accsetType, HttpServletRequest request) throws Exception {
        if (StringUtils.isBlank(amt)) {
            return ServerResponse.createByErrorMsg("The parameter cannot be null");
        }
@@ -128,10 +129,11 @@
            userWithdraw.setWithAmt(new BigDecimal(amt));
            userWithdraw.setApplyTime(new Date());
            userWithdraw.setWithName(user.getRealName());
            userWithdraw.setBankNo(bankId);
//            userWithdraw.setBankNo(userBank.getBankNo());
//            userWithdraw.setBankName(userBank.getBankName());
//            userWithdraw.setBankAddress(userBank.getBankAddress());
            userWithdraw.setBankNo(outMoneyVo.getBankNo());
            userWithdraw.setBankName(outMoneyVo.getBankName());
            userWithdraw.setBankAddress(outMoneyVo.getBankAddress());
            userWithdraw.setBranchCode(outMoneyVo.getBranchCode());
            userWithdraw.setCardholderName(outMoneyVo.getCardholderName());
            userWithdraw.setWithStatus(Integer.valueOf(0));
            BigDecimal withfee = siteSetting.getWithFeePercent().multiply(new BigDecimal(amt)).add(new BigDecimal(siteSetting.getWithFeeSingle().intValue()));
            userWithdraw.setWithFee(withfee);
src/main/java/com/nq/vo/pay/OutMoneyVo.java
New file
@@ -0,0 +1,20 @@
package com.nq.vo.pay;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
@Data
public class OutMoneyVo {
    //银行名称
    private String bankName;
    //分行名称
    private String bankAddress;
    //分行代码
    private String branchCode;
    //银行卡号
    private String bankNo;
    //持卡人姓名
    private String cardholderName;
}
src/main/resources/mapper/UserWithdrawMapper.xml
@@ -32,18 +32,18 @@
    delete from user_withdraw
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.nq.pojo.UserWithdraw" >
    insert into user_withdraw (id, user_id, nick_name,
      agent_id, with_amt, apply_time,
      trans_time, with_name, bank_no,
      bank_name, bank_address, with_status,
      with_fee, with_msg, accset_type)
    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR},
      #{agentId,jdbcType=INTEGER}, #{withAmt,jdbcType=DECIMAL}, #{applyTime,jdbcType=TIMESTAMP},
      #{transTime,jdbcType=TIMESTAMP}, #{withName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR},
      #{bankName,jdbcType=VARCHAR}, #{bankAddress,jdbcType=VARCHAR}, #{withStatus,jdbcType=INTEGER},
      #{withFee,jdbcType=DECIMAL}, #{withMsg,jdbcType=VARCHAR}, #{accsetType,jdbcType=VARCHAR})
  </insert>
<!--  <insert id="insert" parameterType="com.nq.pojo.UserWithdraw" >-->
<!--    insert into user_withdraw (id, user_id, nick_name, -->
<!--      agent_id, with_amt, apply_time, -->
<!--      trans_time, with_name, bank_no, -->
<!--      bank_name, bank_address, with_status, -->
<!--      with_fee, with_msg, accset_type)-->
<!--    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR}, -->
<!--      #{agentId,jdbcType=INTEGER}, #{withAmt,jdbcType=DECIMAL}, #{applyTime,jdbcType=TIMESTAMP}, -->
<!--      #{transTime,jdbcType=TIMESTAMP}, #{withName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR}, -->
<!--      #{bankName,jdbcType=VARCHAR}, #{bankAddress,jdbcType=VARCHAR}, #{withStatus,jdbcType=INTEGER}, -->
<!--      #{withFee,jdbcType=DECIMAL}, #{withMsg,jdbcType=VARCHAR}, #{accsetType,jdbcType=VARCHAR})-->
<!--  </insert>-->
  <insert id="insertSelective" parameterType="com.nq.pojo.UserWithdraw" >
    insert into user_withdraw
    <trim prefix="(" suffix=")" suffixOverrides="," >
@@ -234,7 +234,7 @@
  <select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
    SELECT
    <include refid="Base_Column_List"/>
    *
    FROM user_withdraw
    where 1=1
      <if test="agentId != null and agentId != ''">