Commit 6e4bbce0 authored by libin's avatar libin

提现方式调整(1:线下自动 2:线下手动 3:线上自动)

parent 13b8acdb
...@@ -26,4 +26,8 @@ public class WalletCathFindDTO extends PageParam { ...@@ -26,4 +26,8 @@ public class WalletCathFindDTO extends PageParam {
private Long startTime; private Long startTime;
private Long endTime; private Long endTime;
/**
* 提现方式 1:线下自动 2:线下手动 3:线上自动
*/
private Integer withdrawWay;
} }
...@@ -56,6 +56,6 @@ public class WalletCathListDTO { ...@@ -56,6 +56,6 @@ public class WalletCathListDTO {
private String accountName; private String accountName;
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
} }
...@@ -134,9 +134,9 @@ public class MyWalletCath implements Serializable { ...@@ -134,9 +134,9 @@ public class MyWalletCath implements Serializable {
@Column(name = "account_name") @Column(name = "account_name")
private String accountName; private String accountName;
@Column(name = "offline_way") @Column(name = "withdraw_way")
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
@Column(name = "real_reason") @Column(name = "real_reason")
private String realReason; private String realReason;
......
...@@ -52,6 +52,6 @@ public class WalletCathAdminVo { ...@@ -52,6 +52,6 @@ public class WalletCathAdminVo {
private String accountName; private String accountName;
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
} }
...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil; ...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo; import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import com.xxfc.platform.app.enumconstant.WithDrawWayEnum;
import com.xxfc.platform.app.feign.ConfigFeign; import com.xxfc.platform.app.feign.ConfigFeign;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.FundPayVo; import com.xxfc.platform.universal.vo.FundPayVo;
...@@ -100,9 +101,6 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -100,9 +101,6 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
private DateTimeFormatter dateTimeFormatter; private DateTimeFormatter dateTimeFormatter;
private static final Integer WITHDRAW_ONLINE_WAY = 1;
private static final Integer WITHDRAW_OFFLINE_WAY = 2;
private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(12); private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(12);
...@@ -347,8 +345,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -347,8 +345,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
walletCath.setAccountName(applyCathVo.getAccountName()); walletCath.setAccountName(applyCathVo.getAccountName());
walletCath.setAccountNumber(accountNumber); walletCath.setAccountNumber(accountNumber);
walletCath.setAmount(amount); walletCath.setAmount(amount);
//手续费
walletCath.setCommission(commission); walletCath.setCommission(commission);
walletCath.setRealAmount(realAmount); walletCath.setRealAmount(realAmount);
walletCath.setWithdrawWay(withdrawWay);
myWalletCathBiz.insertSelective(walletCath); myWalletCathBiz.insertSelective(walletCath);
//提现金额 //提现金额
BigDecimal withdrawals = realAmount.add(commission); BigDecimal withdrawals = realAmount.add(commission);
...@@ -362,7 +362,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -362,7 +362,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
myWallet.setVersion(sumDto.getVersion()); myWallet.setVersion(sumDto.getVersion());
mapper.updMyWater(myWallet); mapper.updMyWater(myWallet);
//线上自动提现 //线上自动提现
if (WITHDRAW_ONLINE_WAY.equals(withdrawWay)) { if (WithDrawWayEnum.WITHDRAW_ONLINE_WAY.getCode() == withdrawWay) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request)); String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request));
FundPayVo fundPayVo = FundPayVo.builder() FundPayVo fundPayVo = FundPayVo.builder()
......
...@@ -101,12 +101,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> { ...@@ -101,12 +101,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
PageDataVO<WalletCathListDTO> walletCathListDTOPage = PageDataVO.pageInfo(walletCathFindDTO.getPage(), PageDataVO<WalletCathListDTO> walletCathListDTOPage = PageDataVO.pageInfo(walletCathFindDTO.getPage(),
walletCathFindDTO.getLimit(), walletCathFindDTO.getLimit(),
() -> mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUsername(), () -> mapper.selectWalletCatchAll(walletCathFindDTO));
walletCathFindDTO.getPhone(),
walletCathFindDTO.getState(),
walletCathFindDTO.getOrderNo(),
walletCathFindDTO.getStartTime(),
walletCathFindDTO.getEndTime()));
List<WalletCathListDTO> walletCathListDTOList = walletCathListDTOPage.getData(); List<WalletCathListDTO> walletCathListDTOList = walletCathListDTOPage.getData();
if (CollectionUtils.isEmpty(walletCathListDTOList)) { if (CollectionUtils.isEmpty(walletCathListDTOList)) {
......
package com.github.wxiaoqi.security.admin.mapper; package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO; import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO; import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathSumDto; import com.github.wxiaoqi.security.admin.dto.WalletCathSumDto;
import com.github.wxiaoqi.security.admin.entity.MyWalletCath; import com.github.wxiaoqi.security.admin.entity.MyWalletCath;
...@@ -17,12 +18,7 @@ import java.util.List; ...@@ -17,12 +18,7 @@ import java.util.List;
*/ */
public interface MyWalletCathMapper extends Mapper<MyWalletCath> { public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
List<WalletCathListDTO> selectByUserNameOrPhoneOrWithDrawSate(@Param("userName") String userName, List<WalletCathListDTO> selectWalletCatchAll(WalletCathFindDTO walletCathFindDTO);
@Param("phone") String phone,
@Param("state") Integer state,
@Param("orderNo") String orderNo,
@Param("startTime") Long startTime,
@Param("endTime") Long endTime);
List<PersonalConsumptionDTO> findUserWithDrawingByUserIds(@Param("userIds") List<Integer> userIds); List<PersonalConsumptionDTO> findUserWithDrawingByUserIds(@Param("userIds") List<Integer> userIds);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper"> <mapper namespace="com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper">
<select id="selectByUserNameOrPhoneOrWithDrawSate" <select id="selectWalletCatchAll"
resultType="com.github.wxiaoqi.security.admin.dto.WalletCathListDTO"> resultType="com.github.wxiaoqi.security.admin.dto.WalletCathListDTO">
SELECT SELECT
wc.id, wc.id,
...@@ -19,12 +19,16 @@ ...@@ -19,12 +19,16 @@
wc.order_no AS `orderNo`, wc.order_no AS `orderNo`,
wc.account_number AS `accountNumber`, wc.account_number AS `accountNumber`,
wc.account_name AS `accountName`, wc.account_name AS `accountName`,
wc.offline_way AS `offlineWay` wc.withdraw_way AS `withdrawWay`
FROM FROM
(SELECT * FROM `my_wallet_cath` WHERE 1 = 1 (SELECT * FROM `my_wallet_cath`
<where>
<if test="state != null"> <if test="state != null">
AND `stauts`=#{state} AND `stauts`=#{state}
</if> </if>
<if test="withdrawWay != null">
AND `withdraw_way`=#{withdrawWay}
</if>
<if test="orderNo !=null and orderNo !=''"> <if test="orderNo !=null and orderNo !=''">
AND `order_no` = #{orderNo} AND `order_no` = #{orderNo}
</if> </if>
...@@ -41,13 +45,14 @@ ...@@ -41,13 +45,14 @@
`crt_time` <= #{endTime} `crt_time` <= #{endTime}
]]> ]]>
</if> </if>
</where>
) AS `wc` ) AS `wc`
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''"> INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''">
WHERE `username`=#{phone} WHERE `username`=#{phone}
</if> ) AS `aul` ON aul.id = wc.user_id </if> ) AS `aul` ON aul.id = wc.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and userName != ''"> test="username != null and username != ''">
WHERE nickname =#{userName} OR realname =#{userName} WHERE nickname =#{username} OR realname =#{username}
</if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC </if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC
</select> </select>
......
...@@ -44,7 +44,7 @@ public class WithDrawRuleVo { ...@@ -44,7 +44,7 @@ public class WithDrawRuleVo {
private Integer maxNumberOfDay; private Integer maxNumberOfDay;
/** /**
* 1. 线上 2.线下 * 1.线下:自动 2.线下:手动 3. 线上
*/ */
private Integer withdrawWay; private Integer withdrawWay;
......
package com.xxfc.platform.app.enumconstant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author libin
* @version 1.0
* @description 提现方式
* @data 2020/1/7 8:44
*/
@AllArgsConstructor
@Getter
public enum WithDrawWayEnum {
WITHDRAW_ONLINE_WAY(3, "线上"),
WITHDRAW_OFFLINE_AUTO_WAY(2, "线下手动"),
WITHDRAW_OFFLINE_WAY(1, "线下自动");
private int code;
private String desc;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment