|
@@ -13,14 +13,18 @@ import com.google.zxing.BarcodeFormat;
|
|
|
import com.google.zxing.common.BitMatrix;
|
|
|
import com.google.zxing.qrcode.QRCodeWriter;
|
|
|
import com.zhongzheng.common.annotation.DataScope;
|
|
|
+import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
+import com.zhongzheng.common.utils.file.FileUtils;
|
|
|
import com.zhongzheng.modules.alioss.service.OssService;
|
|
|
+import com.zhongzheng.modules.alioss.vo.FileBean;
|
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
|
import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
|
|
|
+import com.zhongzheng.modules.base.bo.UserProfileFit;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
import com.zhongzheng.modules.course.domain.Major;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
@@ -76,6 +80,7 @@ import java.util.*;
|
|
|
import java.util.List;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
/**
|
|
|
* 用户预约考试Service业务层处理
|
|
@@ -138,6 +143,8 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
private IWxLoginService iWxLoginService;
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
|
|
@@ -1768,22 +1775,73 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<UserSubscribeStudentExportVo> listUserExport(UserSubscribeQueryBo bo) {
|
|
|
+ public Map<String,Object> listUserExport(UserSubscribeQueryBo bo) {
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
List<UserVo> list = baseMapper.listUserExport(bo);
|
|
|
List<UserSubscribeStudentExportVo> list1 = new ArrayList<>();
|
|
|
- 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("女");
|
|
|
+ List<FileBean> fileBeanList = new ArrayList<>(); //身份证列表
|
|
|
+ List<FileBean> fileBeanList2 = new ArrayList<>(); //证件照列表
|
|
|
+ String filename = FileUtils.encodingZipFilename("学员信息数据");
|
|
|
+ String zipFile = FileUtils.getZipAbsoluteFile(filename);
|
|
|
+ /* String filename2 = FileUtils.encodingZipFilename("证件照压缩包");
|
|
|
+ String zipFile2 = FileUtils.getZipAbsoluteFile(filename2);*/
|
|
|
+ try {
|
|
|
+ ZipOutputStream outStream = new ZipOutputStream(new FileOutputStream(zipFile));
|
|
|
+ // ZipOutputStream outStream2 = new ZipOutputStream(new FileOutputStream(zipFile2));
|
|
|
+ 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("女");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list1.add(item);
|
|
|
+
|
|
|
+ if(Validator.isNotEmpty(vo.getIdCardImg1())){
|
|
|
+ FileBean f1 = new FileBean();
|
|
|
+ String idCardImg1 = vo.getIdCardImg1();
|
|
|
+ f1.setPath(idCardImg1);
|
|
|
+ f1.setFileName("ID_CARD/"+vo.getIdCard() + "_0.jpg");
|
|
|
+ FileBean f2 = new FileBean();
|
|
|
+ String idCardImg2 = vo.getIdCardImg2();
|
|
|
+ f2.setPath(idCardImg2);
|
|
|
+ f2.setFileName("ID_CARD/"+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("oneInchPhotos/"+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("commitment/"+vo.getIdCard() + ".jpg");
|
|
|
+ fileBeanList.add(f4);
|
|
|
}
|
|
|
}
|
|
|
- list1.add(item);
|
|
|
+ ossService.zipWisdomDownload(fileBeanList,outStream);
|
|
|
+ // ossService.zipWisdomDownload(fileBeanList2,outStream2);
|
|
|
+ outStream.close();
|
|
|
+ // outStream2.close();
|
|
|
}
|
|
|
- return list1;
|
|
|
+ catch (IOException e) {
|
|
|
+ }
|
|
|
+ map.put("list", list1);
|
|
|
+ map.put("zip", AjaxResult.success(filename));
|
|
|
+ // map.put("zip2", AjaxResult.success(filename2));
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
@Override
|