导出去除分页
This commit is contained in:
@@ -137,6 +137,8 @@ public class TrainingClassController {
|
|||||||
//导出培训班用户
|
//导出培训班用户
|
||||||
@RequestMapping("/exportTrainingClassUser")
|
@RequestMapping("/exportTrainingClassUser")
|
||||||
public void exportTrainingClassUser(HttpServletResponse response,@RequestBody Map<String,Object> params) {
|
public void exportTrainingClassUser(HttpServletResponse response,@RequestBody Map<String,Object> params) {
|
||||||
|
params.put("current",1);
|
||||||
|
params.put("limit",10000);
|
||||||
R r = trainingClassUserList(params);
|
R r = trainingClassUserList(params);
|
||||||
if ("0".equals(r.get("code").toString())){
|
if ("0".equals(r.get("code").toString())){
|
||||||
Page<TrainingToUser> trainingClassUserList = (Page<TrainingToUser>) r.get("trainingClassUserList");
|
Page<TrainingToUser> trainingClassUserList = (Page<TrainingToUser>) r.get("trainingClassUserList");
|
||||||
|
|||||||
@@ -68,10 +68,20 @@ public class UserCertificateController {
|
|||||||
|
|
||||||
//导出小班自考证书
|
//导出小班自考证书
|
||||||
@RequestMapping("/exportUserClassAndZKCertificate")
|
@RequestMapping("/exportUserClassAndZKCertificate")
|
||||||
public void exportUserClassAndZKCertificate(HttpServletResponse response, @RequestBody Map<String,Object> params) {
|
public void exportUserClassAndZKCertificate(HttpServletResponse response) {
|
||||||
R r = userClassAndZKCertificateList(params);
|
MPJLambdaWrapper<UserCertificate> wrapper = new MPJLambdaWrapper();
|
||||||
if ("0".equals(r.get("code").toString())){
|
wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,UserCertificate::getUserId);
|
||||||
Page<Map<String,Object>> certificateList = (Page<Map<String,Object>>) r.get("certificateList");
|
wrapper.in(UserCertificate::getLabelId,5,8);
|
||||||
|
wrapper.select("count(1) as count,user_id userId,name,tel,email");
|
||||||
|
wrapper.groupBy(UserCertificate::getUserId);
|
||||||
|
wrapper.orderByDesc("count");
|
||||||
|
List<Map<String,Object>> certificateList = userCertificateService.listMaps(wrapper);
|
||||||
|
for (Map<String,Object> map:certificateList){
|
||||||
|
map.put("certificate",userCertificateService.list(new LambdaQueryWrapper<UserCertificate>()
|
||||||
|
.eq(UserCertificate::getUserId,map.get("userId"))
|
||||||
|
.in(UserCertificate::getLabelId,5,8)));
|
||||||
|
}
|
||||||
|
if (certificateList.size() > 0){
|
||||||
XSSFWorkbook wb = new XSSFWorkbook();
|
XSSFWorkbook wb = new XSSFWorkbook();
|
||||||
Sheet sheet = wb.createSheet("用户证书");
|
Sheet sheet = wb.createSheet("用户证书");
|
||||||
Row titleRow = sheet.createRow(0);
|
Row titleRow = sheet.createRow(0);
|
||||||
@@ -87,13 +97,13 @@ public class UserCertificateController {
|
|||||||
int no = 1;
|
int no = 1;
|
||||||
int startI = 1;
|
int startI = 1;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (Map<String,Object> map : certificateList.getRecords()) {
|
for (Map<String,Object> map : certificateList) {
|
||||||
List<UserCertificate> list = (List)map.get("certificate");
|
List<UserCertificate> list = (List)map.get("certificate");
|
||||||
for (UserCertificate uc:list){
|
for (UserCertificate uc:list){
|
||||||
Row row = sheet.createRow(cell);
|
Row row = sheet.createRow(cell);
|
||||||
row.createCell(0).setCellValue(no);
|
row.createCell(0).setCellValue(no);
|
||||||
row.createCell(1).setCellValue(map.get("name").toString());
|
row.createCell(1).setCellValue(map.get("name").toString());
|
||||||
row.createCell(2).setCellValue(map.get("tel").toString());
|
row.createCell(2).setCellValue(map.get("tel")==null?"":map.get("tel").toString());
|
||||||
row.createCell(3).setCellValue(map.get("email").toString());
|
row.createCell(3).setCellValue(map.get("email").toString());
|
||||||
row.createCell(4).setCellValue(uc.getCertificateNo());
|
row.createCell(4).setCellValue(uc.getCertificateNo());
|
||||||
row.createCell(5).setCellValue((uc.getLabelId()==5?"小班":"自考")+"-"+uc.getTitle());
|
row.createCell(5).setCellValue((uc.getLabelId()==5?"小班":"自考")+"-"+uc.getTitle());
|
||||||
|
|||||||
Reference in New Issue
Block a user