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