|
@@ -245,8 +245,23 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "学生个人账户余额导出")
|
|
|
@PostMapping("export/userCashAccountDetail")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/userCashAccountDetail')")
|
|
|
- public void userCashAccountDetail(HttpServletResponse response, Integer userId) throws IOException {
|
|
|
- List<SysUserCashAccountDetail> cashAccountDetails = sysUserCashAccountDetailDao.exportDetail(userId);
|
|
|
+ public void userCashAccountDetail(HttpServletResponse response, ExportUserAccountQueryInfo queryInfo) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<SysUserCashAccountDetail> cashAccountDetails = sysUserCashAccountDetailDao.exportDetail(queryInfo);
|
|
|
if(cashAccountDetails.size() < 1){
|
|
|
throw new BizException("没有可导出数据");
|
|
|
}
|
|
@@ -255,10 +270,10 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "电话", "声部",
|
|
|
- "交易类型", "交易金额", "交易时间", "备注"}, new String[]{
|
|
|
- "userId", "username", "phone", "subjectName",
|
|
|
- "type.msg", "amount", "createTime", "comment"}, cashAccountDetails);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部","学员编号", "姓名", "电话", "声部",
|
|
|
+ "交易类型", "交易金额", "交易时间", "备注","可用余额"}, new String[]{
|
|
|
+ "organName","userId", "username", "phone", "subjectName",
|
|
|
+ "type.msg", "amount", "createTime", "comment","balance"}, cashAccountDetails);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attac:wq" +
|
|
|
"hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");
|
|
@@ -282,8 +297,23 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "学生个人课程余额导出")
|
|
|
@PostMapping("export/userCoursesAccount")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/userCoursesAccount')")
|
|
|
- public void userCoursesAccount(HttpServletResponse response, Integer userId) throws IOException {
|
|
|
- List<SysUserCoursesAccountDetail> coursesAccountDetails = sysUserCoursesAccountDetailDao.exportDetail(userId);
|
|
|
+ public void userCoursesAccount(HttpServletResponse response,ExportUserAccountQueryInfo queryInfo) throws IOException {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ }else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<SysUserCoursesAccountDetail> coursesAccountDetails = sysUserCoursesAccountDetailDao.exportDetail(queryInfo);
|
|
|
if(coursesAccountDetails.size() < 1){
|
|
|
throw new BizException("没有可导出数据");
|
|
|
}
|
|
@@ -292,10 +322,10 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "电话", "声部",
|
|
|
- "交易类型", "交易金额", "交易时间", "备注"}, new String[]{
|
|
|
- "userId", "username", "phone", "subjectName",
|
|
|
- "type.msg", "amount", "createTime", "comment"}, coursesAccountDetails);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学员编号", "姓名", "电话", "声部",
|
|
|
+ "交易类型", "交易金额", "交易时间", "备注","可用余额"}, new String[]{
|
|
|
+ "organName", "userId", "username", "phone", "subjectName",
|
|
|
+ "type.msg", "amount", "createTime", "comment","balance"}, coursesAccountDetails);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attac:wq" +
|
|
|
"hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");
|