5 files modified
1 files added
| | |
| | | |
| | | 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; |
| | |
| | | //用户提现 |
| | | @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); |
| | |
| | | // 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); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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); |
| | | |
| | |
| | | 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; |
| | |
| | | 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"); |
| | | } |
| | |
| | | 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); |
| New file |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | 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="," > |
| | |
| | | |
| | | <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 != ''"> |