Commit 2c164440 authored by licc's avatar licc

钱包接口,累计收益明细实现

parent 196d891d
...@@ -53,7 +53,7 @@ public interface UsersMapper extends BaseMapper<User> { ...@@ -53,7 +53,7 @@ public interface UsersMapper extends BaseMapper<User> {
* @param userId 用户id * @param userId 用户id
* @return 用户信息 * @return 用户信息
*/ */
Integer getByUserId(@Param("userId") String userId); User getByUserId(@Param("userId") String userId);
/** /**
* 获取用户信息 * 获取用户信息
......
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
user_id=#{userId} user_id=#{userId}
</where> </where>
</select> </select>
<select id="getuserIdById" resultType="cn.wisenergy.model.app.User"> <select id="getuserIdById" resultType="java.lang.Integer">
select select
id id
from from
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.18</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<!-- MAVEN构建 --> <!-- MAVEN构建 -->
......
package cn.wisenergy.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*@ Description: 钱包余额提现银行卡Dto
*@ Author : 86187
*@ Date : 2021/3/4 9:51
* @author 86187
*/
@Data
@ApiModel("WithdrawBankDto")
public class WithdrawBankDto {
/**
* 用户id
*/
@ApiModelProperty(value = "用户id",name = "userId")
private String userId;
/**
* 短信验证码
*/
@ApiModelProperty(value = "短信验证码",name = "code")
private String code;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额",name = "money")
private Double money;
}
...@@ -69,6 +69,12 @@ ...@@ -69,6 +69,12 @@
<artifactId>itext-asian</artifactId> <artifactId>itext-asian</artifactId>
<version>5.2.0</version> <version>5.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.18</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<!-- MAVEN构建 --> <!-- MAVEN构建 -->
......
...@@ -69,12 +69,13 @@ public class AccountManager { ...@@ -69,12 +69,13 @@ public class AccountManager {
BigDecimal performanceTotal = accountInfo.getEarningsMonth().add(bigDecimal); BigDecimal performanceTotal = accountInfo.getEarningsMonth().add(bigDecimal);
accountInfo.setEarningsMonth(performanceTotal); accountInfo.setEarningsMonth(performanceTotal);
//2、修改订单返佣状态:已返佣 1 //2、修改订单返佣状态:已返佣 1
orderInfo.setRebateStatus(RebateStatusEnum.ALREADY_REBATE.getCode()); orderInfo.setRebateStatus(RebateStatusEnum.ALREADY_REBATE.getCode());
orderMapper.updateById(orderInfo); orderMapper.updateById(orderInfo);
//3、增加账户可用金额 //3、更新账户可用金额
accountMapper.updateById(accountInfo); accountMapper.updateById(accountInfo);
//4、添加交易流水记录 //4、添加交易流水记录
......
...@@ -2,6 +2,7 @@ package cn.wisenergy.service.app; ...@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.BankInfo; import cn.wisenergy.model.app.BankInfo;
import cn.wisenergy.model.dto.WithdrawBankDto;
/** /**
* @author 86187 * @author 86187
...@@ -42,9 +43,9 @@ public interface BankService { ...@@ -42,9 +43,9 @@ public interface BankService {
/** /**
* 用户提现到银行卡 * 用户提现到银行卡
* *
* @param userId 用户标识 * @param dto 用户标识
* @return true 成功 false 失败 * @return true 成功 false 失败
*/ */
R<Boolean> userWithdrawBank(String userId); R<Boolean> userWithdrawBank(WithdrawBankDto dto);
} }
...@@ -29,7 +29,7 @@ public interface WalletService { ...@@ -29,7 +29,7 @@ public interface WalletService {
R<WithdrawalAmountVo> getWithdrawalAmount(String userId); R<WithdrawalAmountVo> getWithdrawalAmount(String userId);
/** /**
* 展示用户累计收益记录 * 展示用户累计收益记录 -最近六月 不包括本月
* *
* @param userId 用户id * @param userId 用户id
* @return 用户累计收益 * @return 用户累计收益
......
...@@ -120,11 +120,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -120,11 +120,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
} }
} }
//遍历订单 订单状态创建时间,小于当前时间 订单当月任务处理状态 :未处理 //遍历订单 订单状态创建时间,当月时间小于当前时间
for (OrderInfo orderInfo : list) { for (OrderInfo orderInfo : list) {
long createTime = orderInfo.getCreated().getTime(); long createTime = orderInfo.getCreated().getTime();
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
if (MonthlyTaskStatus.NO_DEAL_WITH.getCode().equals(orderInfo.getMonthlyTaskStatus()) && createTime <= time) { if (createTime <= time) {
//获取用户信息 //获取用户信息
User user = usersMapper.selectById(orderInfo.getBuyerId()); User user = usersMapper.selectById(orderInfo.getBuyerId());
if (null == user) { if (null == user) {
...@@ -144,7 +144,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo> ...@@ -144,7 +144,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
teamPerformance.setMonthTeamPerformance(userCount); teamPerformance.setMonthTeamPerformance(userCount);
teamPerformances.add(teamPerformance); teamPerformances.add(teamPerformance);
//2、获取当前用户的上级用户列表 //2、获取当前用户的上级用户列表 todo 邀请码等于一个固定值,停止 等于两个值 七位XXXXXXX 和 7777777
List<User> userList = getByList(user.getUserId()); List<User> userList = getByList(user.getUserId());
if (CollectionUtils.isEmpty(userList)) { if (CollectionUtils.isEmpty(userList)) {
continue; continue;
......
package cn.wisenergy.service.app.impl; package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.utils.*; import cn.wisenergy.common.utils.*;
import cn.wisenergy.mapper.AccountMapper;
import cn.wisenergy.mapper.BankInfoMapper; import cn.wisenergy.mapper.BankInfoMapper;
import cn.wisenergy.mapper.UsersMapper; import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.model.app.AccountInfo;
import cn.wisenergy.model.app.BankInfo; import cn.wisenergy.model.app.BankInfo;
import cn.wisenergy.model.app.User; import cn.wisenergy.model.app.User;
import cn.wisenergy.model.dto.WithdrawBankDto;
import cn.wisenergy.service.app.BankService; import cn.wisenergy.service.app.BankService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -34,6 +37,9 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple ...@@ -34,6 +37,9 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired
private AccountMapper accountMapper;
@Override @Override
public R<BankInfo> add(BankInfo bankInfo) { public R<BankInfo> add(BankInfo bankInfo) {
...@@ -116,7 +122,26 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple ...@@ -116,7 +122,26 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
} }
@Override @Override
public R<Boolean> userWithdrawBank(String userId) { public R<Boolean> userWithdrawBank(WithdrawBankDto dto) {
log.info("shop-mall[]BankServiceImpl[]edit[]input.param.dto:" + dto);
if (null == dto || StringUtils.isBlank(dto.getUserId()) || StringUtils.isBlank(dto.getCode()) ||
null != dto.getMoney()) {
return R.error("入参不能为空!");
}
//1、判断提现金额不得超过余额
//获取账户信息
AccountInfo accountInfo=accountMapper.getByUserId(dto.getUserId());
if(null != accountInfo){
if(dto.getMoney() > accountInfo.getExtractMoney().doubleValue()){
return R.error("提现金额不得超过余额");
}
}
//2、验证短信验证码
//3、添加提现交易流水记录
return null; return null;
} }
} }
...@@ -78,6 +78,7 @@ public class WalletServiceImpl implements WalletService { ...@@ -78,6 +78,7 @@ public class WalletServiceImpl implements WalletService {
WithdrawalAmountVo withdrawalAmountVo = new WithdrawalAmountVo(); WithdrawalAmountVo withdrawalAmountVo = new WithdrawalAmountVo();
withdrawalAmountVo.setUserId(userId); withdrawalAmountVo.setUserId(userId);
withdrawalAmountVo.setWithdrawRule("这是一条规则!");
//1、获取用户账户信息 //1、获取用户账户信息
AccountInfo accountInfo = accountMapper.getByUserIdAndTime(userId, yearMonth); AccountInfo accountInfo = accountMapper.getByUserIdAndTime(userId, yearMonth);
......
...@@ -62,7 +62,7 @@ uploadFile: ...@@ -62,7 +62,7 @@ uploadFile:
location: /opt/images/upload_flowChart/ #自定义上传文件服务器硬盘保存路径 ,linux服务器保存路径 /home/changfa/app/wxbjgkpt/upload_flowChart/ location: /opt/images/upload_flowChart/ #自定义上传文件服务器硬盘保存路径 ,linux服务器保存路径 /home/changfa/app/wxbjgkpt/upload_flowChart/
file: file:
upload: upload:
path: D:/aplus path: C:/aplus
jwt: jwt:
# 加密秘钥 # 加密秘钥
secret: f4e2e52034348f86b67cde581c0f9eb5 secret: f4e2e52034348f86b67cde581c0f9eb5
......
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