Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

yangdamao 5 дней назад
Родитель
Сommit
cf18e02f8d

+ 22 - 21
run-prod.sh

@@ -1,33 +1,34 @@
 #!/usr/bin/env bash
 # 定义应用组名
-group_name='zhongzheng'
+group_admin_name='zhongzheng'
 # 定义应用名称
-app_name='zhongzheng-saas-api'
+app_admin_name='zhongzheng-saas-admin'
 # 定义应用版本
-app_version='1.0-SNAPSHOT'
+app_admin_version='1.0-SNAPSHOT'
 # 定义应用环境
 profile_active='prod'
-echo '----copy jar----'
-docker stop ${app_name}
-echo '----stop container----'
-docker rm ${app_name}
-echo '----rm container----'
-docker rmi ${group_name}/${app_name}:${app_version}
-echo '----rm image----'
+echo '----copy jar admin----'
+docker stop ${app_admin_name}
+echo '----stop container admin----'
+docker rm ${app_admin_name}
+echo '----rm container admin----'
+docker rmi ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----rm image admin----'
 # 打包编译docker镜像
-docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
-echo '----build image----'
-docker run -p 5055:5055 --name ${app_name} \
+docker build -f /mydata/maven/build/Dockerfile-admi -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
+echo '----build image admin----'
+docker run \
+-p 5030:5030 \
+--name ${app_admin_name} \
 --restart=always \
--e 'spring.profiles.active'=${profile_active} \
--e TZ="Asia/Shanghai" \
--m 10240m \
---cpus=3 \
 --log-opt max-size=50m \
 --log-opt max-file=3 \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
 -v /usr/share/fonts:/usr/share/fonts \
--v /data/logs/prod_api:/logs \
--v /mydata/app/${app_name}/logs:/var/logs \
--d ${group_name}/${app_name}:${app_version}
-echo '----start container----'
+-v /data/logs/prod_admin:/logs \
+-v /mydata/app/${app_admin_name}/logs:/var/logs \
+-v /data/nginx/conf.d:/data/nginx/conf.d \
+-d ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----start container admin----'

+ 4 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserSubscribeController.java

@@ -431,10 +431,10 @@ public class UserSubscribeController extends BaseController {
     @GetMapping("/listUserExport")
     public AjaxResult<Map<String,Object>> listUserExport(UserSubscribeQueryBo bo) {
         Map<String,Object> map = iUserSubscribeService.listUserExport(bo);
-//        List<UserSubscribeStudentExportVo> list = (List<UserSubscribeStudentExportVo>)map.get("list");
-//        ExcelUtil<UserSubscribeStudentExportVo> util = new ExcelUtil<UserSubscribeStudentExportVo>(UserSubscribeStudentExportVo.class);
-//        map.put("excel",util.exportExcel(list, "学员信息表"));
-//        map.remove("list");
+        List<UserSubscribeStudentExportVo> list = (List<UserSubscribeStudentExportVo>)map.get("list");
+        ExcelUtil<UserSubscribeStudentExportVo> util = new ExcelUtil<UserSubscribeStudentExportVo>(UserSubscribeStudentExportVo.class);
+        map.put("excel",util.exportExcel(list, "学员信息表"));
+        map.remove("list");
         return AjaxResult.success(map);
     }
 

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -4293,8 +4293,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         exam.setUpdateTime(DateUtils.getNowTime());
         exam.setStatus(1);
         exam.setExamPaperId(paper.getPaperId());
-        exam.setYear(2025l);
-        exam.setPublishStatus(1l);
+        exam.setYear(2025L);
+        exam.setPublishStatus(1L);
         exam.setPrefixName("安管题库");
         iExamService.save(exam);
 

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -812,6 +812,10 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
 
     private String getImgDir(){
         String tenantId = ToolsUtils.getTenantId();
+        //茂名使用学校的
+        if ("680980002459417532".equals(tenantId)){
+            return "867735392558919680";
+        }
         return StringUtils.isNotBlank(tenantId)?tenantId:"867735392558919680";
     }
 

+ 30 - 27
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -1449,8 +1449,8 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
     public Integer queryOfficialGradeCount(ClassGradeQueryBo bo) {
         String tenantId = ServletUtils.getRequest().getHeader("TenantId");
         if (ObjectUtils.isNotNull(tenantId)) {
-            SysOldOrg one = iSysOldOrgService.getOne(new LambdaQueryWrapper<SysOldOrg>().eq(SysOldOrg::getTenantId, Long.valueOf(tenantId)).ne(SysOldOrg::getShareClass,0).last("limit 1"));
-            if (ObjectUtils.isNotNull(one)) {
+            SysOldOrg one = iSysOldOrgService.getOne(new LambdaQueryWrapper<SysOldOrg>().eq(SysOldOrg::getTenantId, Long.valueOf(tenantId)).last("limit 1"));
+            if (ObjectUtils.isNotNull(one) && one.getShareClass() != 0) {
                 bo.setClassSign(one.getShareClass());
             }
         }
@@ -1561,32 +1561,35 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                 && Validator.isNotEmpty(gradeVo.getOfficialName()) && Validator.isEmpty(gradeVo.getSevenCode())) {
             ClassGradeQueryBo queryBo = new ClassGradeQueryBo();
             queryBo.setOfficialName(gradeVo.getOfficialName());
-            Integer peopleNum = queryOfficialGradeCount(queryBo);
+            numAll = queryOfficialGradeCount(queryBo);
+
+            //暂时关闭旧系统查询班级通道
             //查询旧系统
-            Map<String, String> params = new HashMap<>();
-            Long nowTime = DateUtils.getNowTime();
-            String sign = ToolsUtils.EncoderByMd5(nowTime.toString() + "pubilc2022");
-            params.put("stamp", nowTime.toString());
-            params.put("sign", sign);
-            params.put("jsonstr", gradeVo.getOfficialName());
-            String respone = "";
-            log.info("查询业务系统班级人数" + params, "");
-            Integer oldGradeNum = 0;
-            try {
-                respone = HttpUtils.postFormBody(GRADE_COUNT_PATH, params);
-                log.info("查询业务系统班级人数结果" + respone, "");
-                if (!respone.contains("\"Status\":true")) {
-                    throw new CustomException("同步请求错误" + respone);
-                }
-                JSONObject jsonObject = (JSONObject) JSONObject.parse(respone);
-                JSONArray dataArray = jsonObject.getJSONArray("Data");
-                JSONObject fObject = dataArray.getJSONObject(0);
-                oldGradeNum = (Integer) fObject.get("num");
-            } catch (IOException e) {
-                log.info("查询业务系统班级人数失败参数" + params, "");
-                throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
-            }
-            numAll = peopleNum + oldGradeNum;
+//            Integer peopleNum = queryOfficialGradeCount(queryBo);
+//            Map<String, String> params = new HashMap<>();
+//            Long nowTime = DateUtils.getNowTime();
+//            String sign = ToolsUtils.EncoderByMd5(nowTime.toString() + "pubilc2022");
+//            params.put("stamp", nowTime.toString());
+//            params.put("sign", sign);
+//            params.put("jsonstr", gradeVo.getOfficialName());
+//            String respone = "";
+//            log.info("查询业务系统班级人数" + params, "");
+//            Integer oldGradeNum = 0;
+//            try {
+//                respone = HttpUtils.postFormBody(GRADE_COUNT_PATH, params);
+//                log.info("查询业务系统班级人数结果" + respone, "");
+//                if (!respone.contains("\"Status\":true")) {
+//                    throw new CustomException("同步请求错误" + respone);
+//                }
+//                JSONObject jsonObject = (JSONObject) JSONObject.parse(respone);
+//                JSONArray dataArray = jsonObject.getJSONArray("Data");
+//                JSONObject fObject = dataArray.getJSONObject(0);
+//                oldGradeNum = (Integer) fObject.get("num");
+//            } catch (IOException e) {
+//                log.info("查询业务系统班级人数失败参数" + params, "");
+//                throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
+//            }
+//            numAll = peopleNum + oldGradeNum;
         } else if (Validator.isNotEmpty(gradeVo) && Validator.isNotEmpty(gradeVo.getSevenCode())) {
             //七大员继教
             Long num = baseMapper.getStudeCountByCode(gradeVo.getSevenCode());

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -3860,7 +3860,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             }
 
             ClassGrade classGrade = iClassGradeService.getById(gradeUser.getGradeId());
-            if (classGrade.getClassEndTime() > DateUtils.getNowTime()){
+            if (ObjectUtils.isNotNull(classGrade.getClassEndTime()) && classGrade.getClassEndTime() > DateUtils.getNowTime()){
                 //班级未结束不关闭
                 continue;
             }

+ 167 - 163
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -30,6 +30,7 @@ import com.zhongzheng.modules.alioss.bo.OssRequest;
 import com.zhongzheng.modules.alioss.service.OssService;
 import com.zhongzheng.modules.alioss.vo.FileBean;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
+import com.zhongzheng.modules.base.bo.UserProfileFit;
 import com.zhongzheng.modules.base.domain.UserProfile;
 import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
@@ -2183,182 +2184,185 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         if (CollectionUtils.isEmpty(list)) {
             return new HashMap<>();
         }
+//
+//        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+//        SysTenant sysTenant = iSysTenantService.getById(Long.valueOf(tenantId));
+//        String schoolName = ObjectUtils.isNotNull(sysTenant.getSchoolName()) ? sysTenant.getSchoolName() : "广东省祥粤建设职业培训学校";
+//        Map<String, List<UserVo>> collect = list.stream().collect(Collectors.groupingBy(UserVo::getJob));
+//        String zhiyuan = System.getProperty("user.dir");
+//        String destDirPath = zhiyuan + "/zhongzheng-admin/src/main/resources/"
+//                + String.format("%s预约考试%s", DateUtils.timestampToDateFormat(bo.getApplySiteExamTime(), "yyyy-MM-dd"), DateUtils.getNowTime());
+//        List<UserSubApplyExport> examApplyExports = new ArrayList<>();
+//
+//        collect.forEach((k, v) -> {
+//            String majorPath = destDirPath + "/" + k;
+//            File dirw = new File(majorPath);
+//            if (!dirw.exists()) {
+//                dirw.mkdirs();
+//            }
+//            String photoPath = majorPath + "/" + schoolName;
+//            File dirw2 = new File(photoPath);
+//            if (!dirw2.exists()) {
+//                dirw2.mkdirs();
+//            }
+//            List<UserSubApplyExport> applyExports = new ArrayList<>();
+//            //学员头像
+//            v.forEach(item -> {
+//                User user = iUserService.getByIdNoTenant(item.getUserId());
+//                //报考资料
+//                UserProfile profile = iUserProfileService.getByOrderGoodsIdNoTenant(item.getOrderGoodsId());
+//                if (ObjectUtils.isNull(profile)) {
+//                    return;
+//                }
+//                UserSubApplyExport applyExport = new UserSubApplyExport();
+//                applyExport.setUserName(user.getRealname());
+//                applyExport.setIdCard(EncryptHandler.decrypt(user.getIdCard()));
+//                applyExport.setPhone(EncryptHandler.decrypt(user.getTelphone()));
+//
+//                String keyValue = profile.getKeyValue();
+//                applyExport.setSex(getUserProfileValue(keyValue, "sex"));
+//                String education = getUserProfileValue(keyValue, "education");
+//                if(education.equals("小学")||education.equals("中学")||education.equals("高中")||education.equals("中职(含技工学校)")){
+//                    applyExport.setEducation("中职(含技工学校)");
+//                }
+//                else if(education.equals("本科")||education.equals("硕士研究生")||education.equals("博士研究生")||education.equals("本科及以上")){
+//                    applyExport.setEducation("本科及以上");
+//                }
+//                else{
+//                    applyExport.setEducation("专科(含高职和技师学院)");
+//                }
+//                applyExport.setCompanyName(getUserProfileValue(keyValue, "work_unit"));
+//                applyExport.setPostName(getUserProfileValue(keyValue, "apply_post"));
+//                applyExport.setMajorName(getUserProfileValue(keyValue, "major"));
+//                applyExport.setAge(getUserProfileValue(keyValue, "working_years"));
+//                applyExport.setGraduateTime(getUserProfileValue(keyValue, "graduation_time"));
+//                applyExports.add(applyExport);
+//
+//                //个人近照
+//                try {
+//                    String idCardPath = photoPath + "/个人照";
+//                    File dirw3 = new File(idCardPath);
+//                    if (!dirw3.exists()) {
+//                        dirw3.mkdirs();
+//                    }
+//                    InputStream inputStream = ossService.getStreamByObject(user.getOneInchPhotos());
+//                    //写入本地文件
+//                    String inchPath = idCardPath + "/" + String.format("%s$头像.jpg", EncryptHandler.decrypt(user.getRealname()));
+//                    FileOutputStream fileOutputStream = new FileOutputStream(inchPath);
+//                    byte[] buffer = new byte[1024];
+//                    int len = 0;
+//                    while ((len = inputStream.read(buffer)) != -1) {
+//                        fileOutputStream.write(buffer, 0, len);
+//                    }
+//                    inputStream.close();
+//                    fileOutputStream.close();
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//
+//                //测试计划
+//                examApplyExports.add(applyExport);
+//            });
+//            //报考资料
+//            if (CollectionUtils.isNotEmpty(applyExports)) {
+//                String path = majorPath + "/" + String.format("%s报名信息表", k) + ".xlsx";
+//                createCompleteExcel(path,applyExports);
+//            }
+//        });
+//
+//        //测试计划
+//        if (CollectionUtils.isNotEmpty(examApplyExports)) {
+//            String path = destDirPath + "/测试计划.xlsx";
+//            createCompleteExcel(path,examApplyExports);
+//        }
+//
+//        String filename = FileUtils.encodingZipFilename("学员信息数据");
+//        String zipFile = FileUtils.getZipAbsoluteFile(filename);
+//        FileUtils.toZip(zipFile, destDirPath, true);
+//        try {
+//            //删除本地资源
+//            Path pathStr = Paths.get(destDirPath);
+//            try (Stream<Path> walk = Files.walk(pathStr)) {
+//                walk.sorted(Comparator.reverseOrder())
+//                        .forEach(FileUtils::deleteDirectoryStream);
+//            } catch (IOException e) {
+//                log.error("删除本地资源失败:" + DateUtils.getNowTime());
+//            }
+//
+//            map.put("zip", AjaxResult.success(filename));
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
 
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
-        SysTenant sysTenant = iSysTenantService.getById(Long.valueOf(tenantId));
-        String schoolName = ObjectUtils.isNotNull(sysTenant.getSchoolName()) ? sysTenant.getSchoolName() : "广东省祥粤建设职业培训学校";
-        Map<String, List<UserVo>> collect = list.stream().collect(Collectors.groupingBy(UserVo::getJob));
-        String zhiyuan = System.getProperty("user.dir");
-        String destDirPath = zhiyuan + "/zhongzheng-admin/src/main/resources/"
-                + String.format("%s预约考试%s", DateUtils.timestampToDateFormat(bo.getApplySiteExamTime(), "yyyy-MM-dd"), DateUtils.getNowTime());
-        List<UserSubApplyExport> examApplyExports = new ArrayList<>();
 
-        collect.forEach((k, v) -> {
-            String majorPath = destDirPath + "/" + k;
-            File dirw = new File(majorPath);
-            if (!dirw.exists()) {
-                dirw.mkdirs();
-            }
-            String photoPath = majorPath + "/" + schoolName;
-            File dirw2 = new File(photoPath);
-            if (!dirw2.exists()) {
-                dirw2.mkdirs();
-            }
-            List<UserSubApplyExport> applyExports = new ArrayList<>();
-            //学员头像
-            v.forEach(item -> {
-                User user = iUserService.getByIdNoTenant(item.getUserId());
-                //报考资料
-                UserProfile profile = iUserProfileService.getByOrderGoodsIdNoTenant(item.getOrderGoodsId());
-                if (ObjectUtils.isNull(profile)) {
-                    return;
-                }
-                UserSubApplyExport applyExport = new UserSubApplyExport();
-                applyExport.setUserName(user.getRealname());
-                applyExport.setIdCard(EncryptHandler.decrypt(user.getIdCard()));
-                applyExport.setPhone(EncryptHandler.decrypt(user.getTelphone()));
 
-                String keyValue = profile.getKeyValue();
-                applyExport.setSex(getUserProfileValue(keyValue, "sex"));
-                String education = getUserProfileValue(keyValue, "education");
-                if(education.equals("小学")||education.equals("中学")||education.equals("高中")||education.equals("中职(含技工学校)")){
-                    applyExport.setEducation("中职(含技工学校)");
+        List<UserSubscribeStudentExportVo> list1 = new ArrayList<>();
+        List<FileBean> fileBeanList = new ArrayList<>(); //图片列表
+        String filename = FileUtils.encodingZipFilename("学员信息数据");
+        String zipFile = FileUtils.getZipAbsoluteFile(filename);
+        try {
+            ZipOutputStream outStream = new ZipOutputStream(new FileOutputStream(zipFile));
+            for (UserVo vo : list) {
+                UserSubscribeStudentExportVo item = BeanUtil.toBean(vo, UserSubscribeStudentExportVo.class);
+                if (Validator.isNotEmpty(vo.getSex())) {
+                    if (vo.getSex() == 1) {
+                        item.setSex("男");
+                    }
+                    if (vo.getSex() == 2) {
+                        item.setSex("女");
+                    }
                 }
-                else if(education.equals("本科")||education.equals("硕士研究生")||education.equals("博士研究生")||education.equals("本科及以上")){
-                    applyExport.setEducation("本科及以上");
+                if (ObjectUtils.isNotNull(vo.getApplySiteExamTime())) {
+                    String format = String.format("%s %s-%s", DateUtils.timestampToDateFormat(vo.getApplySiteExamTime(), "yyyy-MM-dd"), vo.getApplySiteStartTime(), vo.getApplySiteEndTime());
+                    item.setApplyTime(format);
                 }
-                else{
-                    applyExport.setEducation("专科(含高职和技师学院)");
+                if (ObjectUtils.isNotNull(vo.getSubscribeId())) {
+                    UserSubscribe subscribe = getById(vo.getSubscribeId());
+                    Goods goods = iGoodsService.getById(subscribe.getGoodsId());
+                    if (ObjectUtils.isNotNull(goods.getMajorId())) {
+                        Major major = iMajorService.getById(goods.getMajorId());
+                        item.setMajorName(major.getCategoryName());
+                    }
                 }
-                applyExport.setCompanyName(getUserProfileValue(keyValue, "work_unit"));
-                applyExport.setPostName(getUserProfileValue(keyValue, "apply_post"));
-                applyExport.setMajorName(getUserProfileValue(keyValue, "major"));
-                applyExport.setAge(getUserProfileValue(keyValue, "working_years"));
-                applyExport.setGraduateTime(getUserProfileValue(keyValue, "graduation_time"));
-                applyExports.add(applyExport);
+                list1.add(item);
 
-                //个人近照
-                try {
-                    String idCardPath = photoPath + "/个人照";
-                    File dirw3 = new File(idCardPath);
-                    if (!dirw3.exists()) {
-                        dirw3.mkdirs();
-                    }
-                    InputStream inputStream = ossService.getStreamByObject(user.getOneInchPhotos());
-                    //写入本地文件
-                    String inchPath = idCardPath + "/" + String.format("%s$头像.jpg", EncryptHandler.decrypt(user.getRealname()));
-                    FileOutputStream fileOutputStream = new FileOutputStream(inchPath);
-                    byte[] buffer = new byte[1024];
-                    int len = 0;
-                    while ((len = inputStream.read(buffer)) != -1) {
-                        fileOutputStream.write(buffer, 0, len);
-                    }
-                    inputStream.close();
-                    fileOutputStream.close();
-                } catch (Exception e) {
-                    e.printStackTrace();
+                if (Validator.isNotEmpty(vo.getIdCardImg1())) {
+                    FileBean f1 = new FileBean();
+                    String idCardImg1 = vo.getIdCardImg1();
+                    f1.setPath(idCardImg1);
+                    f1.setFileName("身份证/" + vo.getIdCard() + "_0$身份证.jpg");
+                    FileBean f2 = new FileBean();
+                    String idCardImg2 = vo.getIdCardImg2();
+                    f2.setPath(idCardImg2);
+                    f2.setFileName("身份证/" + vo.getIdCard() + "_1$身份证.jpg");
+                    fileBeanList.add(f1);
+                    fileBeanList.add(f2);
                 }
 
-                //测试计划
-                examApplyExports.add(applyExport);
-            });
-            //报考资料
-            if (CollectionUtils.isNotEmpty(applyExports)) {
-                String path = majorPath + "/" + String.format("%s报名信息表", k) + ".xlsx";
-                createCompleteExcel(path,applyExports);
-            }
-        });
 
-        //测试计划
-        if (CollectionUtils.isNotEmpty(examApplyExports)) {
-            String path = destDirPath + "/测试计划.xlsx";
-            createCompleteExcel(path,examApplyExports);
-        }
+                if (Validator.isNotEmpty(vo.getOneInchPhotos())) {
+                    FileBean f3 = new FileBean();
+                    String oneInchPhotos = vo.getOneInchPhotos();
+                    f3.setPath(oneInchPhotos);
+                    f3.setFileName("证件照/" + vo.getIdCard() + "$头像.jpg");
+                    fileBeanList.add(f3);
+                }
 
-        String filename = FileUtils.encodingZipFilename("学员信息数据");
-        String zipFile = FileUtils.getZipAbsoluteFile(filename);
-        FileUtils.toZip(zipFile, destDirPath, true);
-        try {
-            //删除本地资源
-            Path pathStr = Paths.get(destDirPath);
-            try (Stream<Path> walk = Files.walk(pathStr)) {
-                walk.sorted(Comparator.reverseOrder())
-                        .forEach(FileUtils::deleteDirectoryStream);
-            } catch (IOException e) {
-                log.error("删除本地资源失败:" + DateUtils.getNowTime());
+                if (Validator.isNotEmpty(vo.getKeyValue())) {
+                    Map<String, String> maps = JSONObject.parseObject(vo.getKeyValue(), Map.class);
+                    String commitment_seal = JSONObject.parseObject(String.valueOf(maps.get("commitment_seal")), UserProfileFit.class).getValue();
+                    FileBean f4 = new FileBean();
+                    f4.setPath(commitment_seal);
+                    f4.setFileName("承诺书/" + vo.getIdCard() + "$承诺书.jpg");
+                    fileBeanList.add(f4);
+                }
             }
-
-            map.put("zip", AjaxResult.success(filename));
-        } catch (Exception e) {
-            e.printStackTrace();
+            ossService.zipWisdomDownload(fileBeanList, outStream);
+            outStream.close();
+        } catch (IOException e) {
         }
-//        List<UserSubscribeStudentExportVo> list1 = new ArrayList<>();
-//        List<FileBean> fileBeanList = new ArrayList<>(); //图片列表
-//        String filename = FileUtils.encodingZipFilename("学员信息数据");
-//        String zipFile = FileUtils.getZipAbsoluteFile(filename);
-//        try {
-//            ZipOutputStream outStream = new ZipOutputStream(new FileOutputStream(zipFile));
-//            for (UserVo vo : list) {
-//                UserSubscribeStudentExportVo item = BeanUtil.toBean(vo, UserSubscribeStudentExportVo.class);
-//                if (Validator.isNotEmpty(vo.getSex())) {
-//                    if (vo.getSex() == 1) {
-//                        item.setSex("男");
-//                    }
-//                    if (vo.getSex() == 2) {
-//                        item.setSex("女");
-//                    }
-//                }
-//                if (ObjectUtils.isNotNull(vo.getApplySiteExamTime())) {
-//                    String format = String.format("%s %s-%s", DateUtils.timestampToDateFormat(vo.getApplySiteExamTime(), "yyyy-MM-dd"), vo.getApplySiteStartTime(), vo.getApplySiteEndTime());
-//                    item.setApplyTime(format);
-//                }
-//                if (ObjectUtils.isNotNull(vo.getSubscribeId())) {
-//                    UserSubscribe subscribe = getById(vo.getSubscribeId());
-//                    Goods goods = iGoodsService.getById(subscribe.getGoodsId());
-//                    if (ObjectUtils.isNotNull(goods.getMajorId())) {
-//                        Major major = iMajorService.getById(goods.getMajorId());
-//                        item.setMajorName(major.getCategoryName());
-//                    }
-//                }
-//                list1.add(item);
-//
-//                if (Validator.isNotEmpty(vo.getIdCardImg1())) {
-//                    FileBean f1 = new FileBean();
-//                    String idCardImg1 = vo.getIdCardImg1();
-//                    f1.setPath(idCardImg1);
-//                    f1.setFileName("身份证/" + vo.getIdCard() + "_0$身份证.jpg");
-//                    FileBean f2 = new FileBean();
-//                    String idCardImg2 = vo.getIdCardImg2();
-//                    f2.setPath(idCardImg2);
-//                    f2.setFileName("身份证/" + vo.getIdCard() + "_1$身份证.jpg");
-//                    fileBeanList.add(f1);
-//                    fileBeanList.add(f2);
-//                }
-//
-//
-//                if (Validator.isNotEmpty(vo.getOneInchPhotos())) {
-//                    FileBean f3 = new FileBean();
-//                    String oneInchPhotos = vo.getOneInchPhotos();
-//                    f3.setPath(oneInchPhotos);
-//                    f3.setFileName("证件照/" + vo.getIdCard() + "$头像.jpg");
-//                    fileBeanList.add(f3);
-//                }
-//
-//                if (Validator.isNotEmpty(vo.getKeyValue())) {
-//                    Map<String, String> maps = JSONObject.parseObject(vo.getKeyValue(), Map.class);
-//                    String commitment_seal = JSONObject.parseObject(String.valueOf(maps.get("commitment_seal")), UserProfileFit.class).getValue();
-//                    FileBean f4 = new FileBean();
-//                    f4.setPath(commitment_seal);
-//                    f4.setFileName("承诺书/" + vo.getIdCard() + "$承诺书.jpg");
-//                    fileBeanList.add(f4);
-//                }
-//            }
-//            ossService.zipWisdomDownload(fileBeanList, outStream);
-//            outStream.close();
-//        } catch (IOException e) {
-//        }
-//        map.put("list", list1);
-//        map.put("zip", AjaxResult.success(filename));
+        map.put("list", list1);
+        map.put("zip", AjaxResult.success(filename));
         return map;
     }
 

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserSubscribeStudentExportVo.java

@@ -34,10 +34,6 @@ public class UserSubscribeStudentExportVo {
 	@ApiModelProperty("手机号")
 	private String telphone;
 
-	@Excel(name = "座位号")
-	@ApiModelProperty("座位号")
-	private String seatNumber;
-
 	@Excel(name = "学历")
 	@ApiModelProperty("学历")
 	private String eduLevel;
@@ -46,6 +42,10 @@ public class UserSubscribeStudentExportVo {
 	@ApiModelProperty("工作单位")
 	private String companyName;
 
+	@Excel(name = "座位号")
+	@ApiModelProperty("座位号")
+	private String seatNumber;
+
 	@Excel(name = "约考时间")
 	@ApiModelProperty("约考时间")
 	private String applyTime;