|
@@ -1,5 +1,6 @@
|
|
|
package com.ydtech.modules.admin.service.impl;
|
|
package com.ydtech.modules.admin.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -244,16 +245,43 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
@Override
|
|
@Override
|
|
|
- public IPage<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
|
|
|
|
|
- PageRequest pageRequest = new PageRequest();
|
|
|
|
|
- pageRequest.setPageNum(sysUserAccountVo.getPageNum());
|
|
|
|
|
- pageRequest.setPageSize(sysUserAccountVo.getPageSize());
|
|
|
|
|
- List<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo);
|
|
|
|
|
- IPage ipage = PageRequest.buildPageRequest(pageRequest);
|
|
|
|
|
- ipage.setRecords(sysUserAccountHistoryPage.stream().skip((sysUserAccountVo.getPageNum() - 1) * sysUserAccountVo.getPageSize()).limit(sysUserAccountVo.getPageSize()).
|
|
|
|
|
- collect(Collectors.toList()));
|
|
|
|
|
- ipage.setTotal(sysUserAccountHistoryPage.size());
|
|
|
|
|
- return ipage;
|
|
|
|
|
|
|
+ public BasePageResult<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
|
|
|
|
|
+ Page<SysUserAccount> page = new Page<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize());
|
|
|
|
|
+ Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo,page);
|
|
|
|
|
+ if(sysUserAccountHistoryPage!=null){
|
|
|
|
|
+ List<SysUserAccount> records = sysUserAccountHistoryPage.getRecords();
|
|
|
|
|
+ List<SysUserAccount> newRecords = new ArrayList<>();
|
|
|
|
|
+ if(records!=null && !records.isEmpty()){
|
|
|
|
|
+ for(SysUserAccount sysUserAccount :records){
|
|
|
|
|
+ //重新赋值总金额 - 已提现金额 支付中金额
|
|
|
|
|
+ MySumAmountQueryDto mySumAmountQueryDto =new MySumAmountQueryDto();
|
|
|
|
|
+ mySumAmountQueryDto.setUserId(sysUserAccount.getUserId());
|
|
|
|
|
+ //出单员是19 且是渠道的话,给渠道团队长
|
|
|
|
|
+ if ("21".equals(sysUserAccount.getRoleId()) && "1".equals(sysUserAccount.getManagementSource())) {
|
|
|
|
|
+ mySumAmountQueryDto.setDeptId(sysUserAccount.getDeptId());
|
|
|
|
|
+ }
|
|
|
|
|
+ //如果是电销组长,将组员的数据算进来
|
|
|
|
|
+ if ("72".equals(sysUserAccount.getRoleId()) && "3".equals(sysUserAccount.getManagementSource())) {
|
|
|
|
|
+ mySumAmountQueryDto.setGroupFlag(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 已提现金额 查询历史表中的审核状态为3的数据
|
|
|
|
|
+ BigDecimal ysTXAmount = insFeeOrderNewService.findMyAmountYTXmount(mySumAmountQueryDto.getUserId(), "3",mySumAmountQueryDto.getGroupFlag());
|
|
|
|
|
+ // 提现中
|
|
|
|
|
+ BigDecimal txzTXAmount = insFeeOrderNewService.findMyAmountYTXmount(mySumAmountQueryDto.getUserId(), "2",mySumAmountQueryDto.getGroupFlag());
|
|
|
|
|
+ // 可提现
|
|
|
|
|
+ BigDecimal ssKTAmount = sysUserAccount.getSumAmount()==null?BigDecimal.ZERO:sysUserAccount.getSumAmount();
|
|
|
|
|
+ //总的 = 已提现金额+ 可提现金额 + 提现中
|
|
|
|
|
+ BigDecimal sumAmount = ysTXAmount.add(ssKTAmount).add(txzTXAmount);
|
|
|
|
|
+ sysUserAccount.setSumAmountWithdrawal(sumAmount);
|
|
|
|
|
+ sysUserAccount.setSumAmountAccount(ysTXAmount);
|
|
|
|
|
+ sysUserAccount.setSumAmountPayment(txzTXAmount);
|
|
|
|
|
+ newRecords.add(sysUserAccount);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ sysUserAccountHistoryPage.setRecords(newRecords);
|
|
|
|
|
+ }
|
|
|
|
|
+ return new BasePageResult<>(sysUserAccountVo.getPageNum(), page.getSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
|
|
|
|
|
+ sysUserAccountHistoryPage.getRecords());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -273,13 +301,13 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
}
|
|
}
|
|
|
// add by hxl 2024-09-12 =============== 添加提现用户是渠道的话,只能提现100的整数金额
|
|
// add by hxl 2024-09-12 =============== 添加提现用户是渠道的话,只能提现100的整数金额
|
|
|
BigDecimal amount = sysUserAccountVo.getAmount();
|
|
BigDecimal amount = sysUserAccountVo.getAmount();
|
|
|
- // judgeAmount(amount, userId); 注释掉 2024-09-18
|
|
|
|
|
|
|
+ // judgeAmount(amount, userId); 注释掉 2024-09-18
|
|
|
// add by hxl end =============================
|
|
// add by hxl end =============================
|
|
|
BigDecimal zero = BigDecimal.ZERO;
|
|
BigDecimal zero = BigDecimal.ZERO;
|
|
|
BigDecimal beforeAmount;
|
|
BigDecimal beforeAmount;
|
|
|
BigDecimal afterAmount;
|
|
BigDecimal afterAmount;
|
|
|
// 用户当前金额
|
|
// 用户当前金额
|
|
|
- // BigDecimal amount = sysUserAccountVo.getAmount();
|
|
|
|
|
|
|
+ // BigDecimal amount = sysUserAccountVo.getAmount();
|
|
|
SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory(); // 记录
|
|
SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory(); // 记录
|
|
|
sysUserAccountHistory.setDocumentary(1); // 1提现
|
|
sysUserAccountHistory.setDocumentary(1); // 1提现
|
|
|
sysUserAccountHistory.setUserId(userId);
|
|
sysUserAccountHistory.setUserId(userId);
|
|
@@ -405,7 +433,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
BigDecimal beforeAmount;
|
|
BigDecimal beforeAmount;
|
|
|
BigDecimal afterAmount;
|
|
BigDecimal afterAmount;
|
|
|
// 用户当前金额
|
|
// 用户当前金额
|
|
|
- // BigDecimal amount = sysUserAccountVo.getAmount();
|
|
|
|
|
|
|
+ // BigDecimal amount = sysUserAccountVo.getAmount();
|
|
|
SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory(); // 记录
|
|
SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory(); // 记录
|
|
|
sysUserAccountHistory.setDocumentary(1); // 1支出
|
|
sysUserAccountHistory.setDocumentary(1); // 1支出
|
|
|
sysUserAccountHistory.setUserId(userId);
|
|
sysUserAccountHistory.setUserId(userId);
|
|
@@ -1584,9 +1612,9 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
//if(mySumAmountQueryDto.getGroupFlag()){
|
|
//if(mySumAmountQueryDto.getGroupFlag()){
|
|
|
// ssKTAmount = baseMapper.getGroupById(mySumAmountQueryDto.getUserId());
|
|
// ssKTAmount = baseMapper.getGroupById(mySumAmountQueryDto.getUserId());
|
|
|
//}else {
|
|
//}else {
|
|
|
- if (sysUserAccountEntity != null) {
|
|
|
|
|
- ssKTAmount = sysUserAccountEntity.getSumAmount() == null ? BigDecimal.ZERO : sysUserAccountEntity.getSumAmount();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (sysUserAccountEntity != null) {
|
|
|
|
|
+ ssKTAmount = sysUserAccountEntity.getSumAmount() == null ? BigDecimal.ZERO : sysUserAccountEntity.getSumAmount();
|
|
|
|
|
+ }
|
|
|
//}
|
|
//}
|
|
|
//总的 = 已提现金额+ 可提现金额 + 提现中
|
|
//总的 = 已提现金额+ 可提现金额 + 提现中
|
|
|
BigDecimal sumAmount = ysTXAmount.add(ssKTAmount).add(txzTXAmount);
|
|
BigDecimal sumAmount = ysTXAmount.add(ssKTAmount).add(txzTXAmount);
|