1
zj
2024-10-01 f525648210da700d58d3b3a5c8a48d46abba4a68
1
5 files modified
60 ■■■■■ changed files
src/main/java/com/nq/dao/UserWithdrawMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/UserBank.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/UserWithdraw.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java 15 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/UserWithdrawMapper.xml 16 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/dao/UserWithdrawMapper.java
@@ -9,8 +9,6 @@
public interface UserWithdrawMapper extends BaseMapper<UserWithdraw> {
  int deleteByPrimaryKey(Integer paramInteger);
  
  int insertSelective(UserWithdraw paramUserWithdraw);
  UserWithdraw selectByPrimaryKey(Integer paramInteger);
  
  int updateByPrimaryKeySelective(UserWithdraw paramUserWithdraw);
src/main/java/com/nq/pojo/UserBank.java
@@ -17,16 +17,16 @@
    private Integer userId;
    //银行
    //银行名称
    private String bankName;
    //分支
    //开户支行
    private String branch;
    //分行号码
    private String branchNo;
    //账号
    //银行卡号
    private String bankNo;
    //姓名
src/main/java/com/nq/pojo/UserWithdraw.java
@@ -31,10 +31,27 @@
    private Date transTime;
    private String withName;
    @Excel(name = "银行卡号")
    private String bankNo;
    //银行名称
    @Excel(name = "银行名称")
    private String bankName;
    //开户支行
    @Excel(name = "开户支行")
    private String branch;
    //分行号码
    @Excel(name = "分行号码")
    private String branchNo;
    //银行卡号
    @Excel(name = "银行卡号")
    private String bankNo;
    //姓名
    @Excel(name = "姓名")
    private String payeeName;
    @Excel(name = "银行支行")
    private String bankAddress;
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
@@ -149,28 +149,33 @@
            if(type == 0){
                userWithdraw.setBankNo(userBank.getBankNo());
                userWithdraw.setBankName(userBank.getBankName());
                userWithdraw.setBranch("银行卡");
                userWithdraw.setPayeeName(userBank.getPayeeName());
                userWithdraw.setBankAddress("银行卡");
            }else{
                userWithdraw.setBankNo(walletAddress);
                userWithdraw.setPayeeName("加密货币");
                userWithdraw.setBankName("加密货币");
                userWithdraw.setBranch("加密货币");
                userWithdraw.setBankAddress("加密货币");
            }
            userWithdraw.setBranchNo(userBank.getBranchNo());
            userWithdraw.setWithStatus(Integer.valueOf(0));
            BigDecimal withfee = siteSetting.getWithFeePercent().multiply(new BigDecimal(amt)).add(new BigDecimal(siteSetting.getWithFeeSingle().intValue()));
            userWithdraw.setWithFee(withfee);
            userWithdraw.setAssetsType(accsetType);
            log.info("userWithdraw------------:"+userWithdraw.toString());
            log.info("userBank--------------:"+userBank.toString());
            int insertCount = this.userWithdrawMapper.insert(userWithdraw);
            if (insertCount > 0) {
                return ServerResponse.createBySuccessMsg("提现成功",request);
            }
            log.error("保存提现记录失败");
            throw new Exception("用户提现,保存提现记录失败");
        } else {
            return ServerResponse.createByErrorMsg("提现密码不正确!",request);
        }
        return ServerResponse.createBySuccessMsg("提现成功",request);
    }
src/main/resources/mapper/UserWithdrawMapper.xml
@@ -31,18 +31,6 @@
    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)
    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})
  </insert>
  <insert id="insertSelective" parameterType="com.nq.pojo.UserWithdraw" >
    insert into user_withdraw
    <trim prefix="(" suffix=")" suffixOverrides="," >
@@ -231,9 +219,9 @@
    ORDER BY id DESC
  </select>
  <select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
  <select id="listByAdmin" resultType="com.nq.pojo.UserWithdraw" parameterType="map">
    SELECT
    <include refid="Base_Column_List"/>
   *
    FROM user_withdraw
    where agent_id != 1
      <if test="agentId != null">