|
|
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.dz;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.ValidationException;
|
|
|
|
|
|
@@ -10,12 +11,14 @@ import com.ruoyi.common.enums.ExamType;
|
|
|
import com.ruoyi.common.enums.UserRegStatus;
|
|
|
import com.ruoyi.common.utils.NumberUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
import com.ruoyi.dz.domain.DzAgent;
|
|
|
import com.ruoyi.dz.service.IDzAgentService;
|
|
|
import com.ruoyi.enums.CardAction;
|
|
|
import com.ruoyi.enums.CardType;
|
|
|
import com.ruoyi.enums.UserTypeEnum;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
+import com.ruoyi.web.domain.DzCardExport;
|
|
|
import com.ruoyi.web.service.SysLoginService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -62,6 +65,12 @@ public class DzCardsController extends BaseController
|
|
|
@ApiOperation("列表")
|
|
|
public TableDataInfo list(DzCards dzCards)
|
|
|
{
|
|
|
+ startPage();
|
|
|
+ List<DzCards> list = dzCardsService.selectDzCardsList(prepare(dzCards));
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ private DzCards prepare(DzCards dzCards) {
|
|
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
|
String userType = sysUser.getUserType();
|
|
|
if(UserTypeEnum.isInstitution(userType)){
|
|
|
@@ -80,10 +89,7 @@ public class DzCardsController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- startPage();
|
|
|
- List<DzCards> list = dzCardsService.selectDzCardsList(dzCards);
|
|
|
- return getDataTable(list);
|
|
|
+ return dzCards;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -94,9 +100,17 @@ public class DzCardsController extends BaseController
|
|
|
@PostMapping("/export")
|
|
|
public void export(HttpServletResponse response, DzCards dzCards)
|
|
|
{
|
|
|
- List<DzCards> list = dzCardsService.selectDzCardsList(dzCards);
|
|
|
- ExcelUtil<DzCards> util = new ExcelUtil<DzCards>(DzCards.class);
|
|
|
- util.exportExcel(response, list, "学习卡数据");
|
|
|
+ List<DzCards> list = dzCardsService.selectDzCardsList(prepare(dzCards));
|
|
|
+ for(DzCards dc : list) {
|
|
|
+ dc.getDeptId();
|
|
|
+
|
|
|
+ }
|
|
|
+ ExcelUtil<DzCardExport> util = new ExcelUtil<DzCardExport>(DzCardExport.class);
|
|
|
+ util.exportExcel(response, list.stream().map(t -> {
|
|
|
+ DzCardExport exp = new DzCardExport();
|
|
|
+ BeanUtils.copyProperties(t, exp);
|
|
|
+ return exp;
|
|
|
+ }).collect(Collectors.toList()), "学习卡数据");
|
|
|
}
|
|
|
|
|
|
/**
|