|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.constants.sys.SysDeptAccountStatus;
|
|
import com.ydtech.constants.sys.SysDeptAccountStatus;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
|
|
+import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.dao.SysDeptAccountMapper;
|
|
import com.ydtech.modules.admin.dao.SysDeptAccountMapper;
|
|
|
import com.ydtech.modules.admin.model.*;
|
|
import com.ydtech.modules.admin.model.*;
|
|
@@ -58,10 +59,11 @@ public class SysDeptAccountServiceImpl extends ServiceImpl<SysDeptAccountMapper,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public IPage<SysDeptAccountDto> getDept(SysDeptAccountDto sysDeptAccountDto) {
|
|
public IPage<SysDeptAccountDto> getDept(SysDeptAccountDto sysDeptAccountDto) {
|
|
|
- Page<SysDeptAccountDto> page = new Page<>();
|
|
|
|
|
- List<SysDeptAccountDto> deptList = sysDeptAccountMapper.getDept(sysDeptAccountDto);
|
|
|
|
|
- page.setRecords(deptList);
|
|
|
|
|
- page.setTotal(deptList.size());
|
|
|
|
|
|
|
+ PageRequest pageRequest = new PageRequest();
|
|
|
|
|
+ pageRequest.setPageNum(sysDeptAccountDto.getPageNo());
|
|
|
|
|
+ pageRequest.setPageSize(sysDeptAccountDto.getPageSize());
|
|
|
|
|
+ Page page = PageRequest.buildPageRequest(pageRequest);
|
|
|
|
|
+ Page<SysDeptAccountDto> deptList = sysDeptAccountMapper.getDept(page,sysDeptAccountDto);
|
|
|
return page;
|
|
return page;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -77,9 +79,6 @@ public class SysDeptAccountServiceImpl extends ServiceImpl<SysDeptAccountMapper,
|
|
|
queryWrapper.eq(SysDept::getId, sysDeptAccount.getDeptId());
|
|
queryWrapper.eq(SysDept::getId, sysDeptAccount.getDeptId());
|
|
|
SysDept sysDept = sysDeptService.getOne(queryWrapper);
|
|
SysDept sysDept = sysDeptService.getOne(queryWrapper);
|
|
|
|
|
|
|
|
- if (!BaseController.getUser().getId().equals(sysDept.getWithdrawUser())) {
|
|
|
|
|
- throw new SystemException("您不为该机构账户提现人员");
|
|
|
|
|
- }
|
|
|
|
|
if (sysDeptAccount.getAmount().compareTo(deptAccount.getManagementFee()) > 0) {
|
|
if (sysDeptAccount.getAmount().compareTo(deptAccount.getManagementFee()) > 0) {
|
|
|
throw new SystemException("提现金额大于机构账户金额");
|
|
throw new SystemException("提现金额大于机构账户金额");
|
|
|
}
|
|
}
|