yangdamao 1 年之前
父節點
當前提交
a523faaed5

+ 5 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/CommonController.java

@@ -13,6 +13,7 @@ import com.zhongzheng.common.utils.file.FileUtils;
 import com.zhongzheng.framework.config.ServerConfig;
 import com.zhongzheng.modules.alioss.bo.FileHandleBo;
 import com.zhongzheng.modules.user.bo.UserDownloadBo;
+import com.zhongzheng.modules.user.service.IUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,9 @@ public class CommonController extends BaseController {
     @Autowired
     private ServerConfig serverConfig;
 
+    @Autowired
+    private IUserService iUserService;
+
     /**
      * 通用下载请求
      *
@@ -201,7 +205,7 @@ public class CommonController extends BaseController {
 
     @PostMapping("/common/user/data/download")
     public AjaxResult userDateDownload(@RequestBody UserDownloadBo bo){
-
+        iUserService.userDateDownload(bo);
         return AjaxResult.success();
     }
 

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -157,6 +157,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/free/**").anonymous()
                 .antMatchers("/common/download**").anonymous()
                 .antMatchers("/common/download/resource**").anonymous()
+                .antMatchers("/common/user/data/download").anonymous()
                 .antMatchers("/grade/grade/listPeriod").anonymous()
                 .antMatchers("/course/business/queryFullId").anonymous()
                 .antMatchers("/grade/grade/listUserPeriod").anonymous()

+ 354 - 6
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -25,8 +25,12 @@ import com.zhongzheng.common.exception.BaseException;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.*;
+import com.zhongzheng.common.utils.file.FileUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.common.utils.ip.IpUtils;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.modules.alioss.bo.OssRequest;
+import com.zhongzheng.modules.alioss.service.OssService;
 import com.zhongzheng.modules.alisms.service.IAliSmsService;
 import com.zhongzheng.modules.collect.domain.CollectBank;
 import com.zhongzheng.modules.collect.domain.CollectCourse;
@@ -45,10 +49,14 @@ import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.UserNewGoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
-import com.zhongzheng.modules.grade.service.impl.ClassGradeServiceImpl;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
+import com.zhongzheng.modules.order.bo.OrderQueryBo;
+import com.zhongzheng.modules.order.service.IOrderService;
+import com.zhongzheng.modules.order.vo.OrderListVo;
+import com.zhongzheng.modules.system.domain.SysTask;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
+import com.zhongzheng.modules.system.service.ISysTaskService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
@@ -66,13 +74,18 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
-
+import java.util.stream.Stream;
 
 
 /**
@@ -124,13 +137,16 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
     @Autowired
     private TokenService tokenService;
-
     @Autowired
     private IUserVisitLogService iUserVisitLogService;
-
+    @Autowired
+    private IUserSubscribeService iUserSubscribeService;
+    @Autowired
+    private IOrderService iOrderService;
     @Autowired
     private IUserStudyLogService iUserStudyLogService;
-
+    @Autowired
+    private OssService ossService;
     @Autowired
     private IUserLoginErrorService iUserLoginErrorService;
     @Autowired
@@ -139,7 +155,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private IGoodsService iGoodsService;
     @Autowired
     private ISysTenantService iSysTenantService;
-
+    @Autowired
+    private ISysTaskService iSysTaskService;
     @Autowired
     private ICourseService iCourseService;
     @Autowired
@@ -1723,6 +1740,337 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return null;
     }
 
+    @Override
+    public void userDateDownload(UserDownloadBo bo) {
+        SysTask task = iSysTaskService.getOne(new LambdaQueryWrapper<SysTask>()
+                .eq(SysTask::getSysUserId, bo.getCreateSysUserId())
+                .eq(SysTask::getTaskCode, bo.getTaskCode()));
+        if (ObjectUtil.isNull(task)){
+            log.error("档案下载错误:下载任务获取不到"+bo.getTaskCode());
+            return;
+        }
+        if (CollectionUtils.isEmpty(bo.getUserIds())){
+            log.error("档案下载错误:学员信息获取有误"+bo.getTaskCode());
+            return;
+        }
+        task.setTaskStatus(2);//下载中
+        iSysTaskService.updateById(task);
+        String zhiyuan = System.getProperty("user.dir");
+        String toPath = zhiyuan + "/zhongzheng-admin/src/main/resources/dangan"+DateUtils.getNowTime();
+        for (Long userId : bo.getUserIds()) {
+            User user = getById(userId);
+            if (ObjectUtil.isNull(user)){
+                continue;
+            }
+            String userPath = toPath + "/" +user.getRealname()+EncryptHandler.decrypt(user.getIdCard());
+            File file = new File(userPath);
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            for (Integer type : bo.getTypes()) {
+                switch (type){
+                    case 1://个人资料
+                        UserDataExcelBo excelBo = BeanUtil.toBean(user, UserDataExcelBo.class);
+                        excelBo.setRegisterTime(DateUtils.timestampToDateFormat(user.getCreateTime(),"yyyy/MM/dd HH:mm:ss"));
+                        excelBo.setSex(ObjectUtil.isNotNull(user.getSex()) && user.getSex() == 1?"男":"女");
+                        excelBo.setUserPhone(EncryptHandler.decrypt(user.getTelphone()));
+                        excelBo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
+                        ExcelUtil<UserDataExcelBo> util = new ExcelUtil<>(UserDataExcelBo.class);
+                        String path1 = userPath + "/"+"个人资料.xlsx";
+                        List<UserDataExcelBo> excelBoList = new ArrayList<>();
+                        excelBoList.add(excelBo);
+                        util.exportEasyExcelUtil(excelBoList, UserDataExcelBo.class,path1);
+                        break;
+                    case 2://证件照
+                        //获取个人近照
+                        try {
+                            InputStream inputStream = ossService.getStreamByObject(user.getOneInchPhotos());
+                            //写入本地文件
+                            String inchPath = userPath + "/证件照.jpg";
+                            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();
+                        }
+                        break;
+                    case 3://身份证照片
+                        //获取身份证照片
+                        try {
+                            InputStream inputStream = ossService.getStreamByObject(user.getIdCardImg1());
+                            //写入本地文件
+                            String inchPath = userPath + "/身份证正面.jpg";
+                            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();
+
+                            InputStream inputStream2 = ossService.getStreamByObject(user.getIdCardImg2());
+                            String inchPath2 = userPath + "/身份证反面.jpg";
+                            FileOutputStream fileOutputStream2 = new FileOutputStream(inchPath2);
+                            byte[] buffer2 = new byte[1024];
+                            int len2 = 0;
+                            while ((len2 = inputStream2.read(buffer2)) != -1) {
+                                fileOutputStream2.write(buffer2, 0, len2);
+                            }
+                            inputStream2.close();
+                            fileOutputStream2.close();
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        break;
+                    case 4://订单记录
+                        OrderQueryBo queryBo = new OrderQueryBo();
+                        queryBo.setStatus(new Integer[]{0,1});
+                        queryBo.setUserId(user.getUserId());
+                        List<OrderListVo> orderListVos = iOrderService.selectDangAnOrderList(queryBo);
+                        if (!CollectionUtils.isEmpty(orderListVos)){
+                            for (OrderListVo vo : orderListVos) {
+                                vo.setIdCard(EncryptHandler.decrypt(vo.getIdCard()));
+                                vo.setCreateTimeStr(DateUtils.timestampToDateFormat(vo.getCreateTime(),"yyyy/MM/dd HH:mm:ss"));
+                                if (ObjectUtils.isNotNull(vo.getGoodsType())){
+                                    switch (vo.getGoodsType()){
+                                        case 1:
+                                            vo.setOrderTypeStr("视频");
+                                            break;
+                                        case 2:
+                                            vo.setOrderTypeStr("题库");
+                                            break;
+                                        case 6:
+                                            vo.setOrderTypeStr("直播");
+                                            break;
+                                        default:
+                                            vo.setOrderTypeStr("其他");
+                                    }
+                                }
+                                vo.setPayTypeStr("微信");
+                                vo.setOrderPriceStr(vo.getGoodsRealPrice().toString());
+                                vo.setOrderReceivedStr(vo.getGoodsReceived().toString());
+                                BigDecimal money = vo.getGoodsRealPrice().subtract(vo.getGoodsReceived());
+                                vo.setOrderUncollectedStr(money.toString());
+                                vo.setBusinessNameStr(String.format("%s-%s%s",vo.getEducationName(),vo.getBusinessName(),vo.getProjectName()));
+                                vo.setValidityTime(String.format("%s至%s",DateUtils.timestampToDateFormat(vo.getServiceStartTime(),"yyyy/MM/dd HH:mm:ss"),
+                                        DateUtils.timestampToDateFormat(vo.getServiceEndTime(),"yyyy/MM/dd HH:mm:ss")));
+                                //商品订单状态 -1关闭 0待支付 1已支付 2已退款
+                                if (Validator.isEmpty(vo.getRefundStatus())) {
+                                    vo.setOrderGoodsStatus(-1);
+                                    vo.setOrderStatusStr("关闭");
+                                } else if (vo.getRefundStatus() == 2) {
+                                    vo.setOrderGoodsStatus(2);
+                                    vo.setOrderStatusStr("已退款");
+                                } else if (vo.getOrderStatus() < 0) {
+                                    vo.setOrderGoodsStatus(-1);
+                                    vo.setOrderStatusStr("关闭");
+                                } else if (vo.getGoodsPayStatus() == 1) {
+                                    vo.setOrderGoodsStatus(0);
+                                    vo.setOrderStatusStr("待支付");
+                                } else if (vo.getGoodsPayStatus() > 1) {
+                                    vo.setOrderGoodsStatus(1);
+                                    vo.setOrderStatusStr("已支付");
+                                }
+                            }
+                            ExcelUtil<OrderListVo> util2 = new ExcelUtil<>(OrderListVo.class);
+                            String path2 = userPath + "/"+"订单记录.xlsx";
+                            util2.exportEasyExcelUtil(orderListVos, OrderListVo.class,path2);
+                        }
+                        break;
+                    case 5://报名记录
+                        iClassGradeUserService.exportListBKUserPeriod(userId,userPath);
+                        break;
+                    case 6://网课记录
+                        iClassGradeUserService.exportListVideoUserPeriod(userId,userPath);
+                        break;
+                    case 7://题库记录
+                        iClassGradeUserService.exportExamStudyList(userId,userPath);
+                        break;
+                    case 8://直播记录
+                        iClassGradeUserService.exportLiveStudyList(userId,userPath);
+                        break;
+                    case 9://资料记录
+                        iClassGradeUserService.exportHandoutsStudyList(userId,userPath);
+                        break;
+                    case 10://约考记录
+                        UserUsbRecordBo recordBo = new UserUsbRecordBo();
+                        recordBo.setUserId(user.getUserId());
+                        List<UserUsbRecordVo> usbRecordVos = iClassGradeUserService.getListUserSubscribe(recordBo);
+                        if (!CollectionUtils.isEmpty(usbRecordVos)){
+                            usbRecordVos.forEach(item -> {
+                                if (ObjectUtils.isNotNull(item.getApplyTime())){
+                                    item.setApplyTimeStr(String.format("%s (%s-%s)",DateUtils.timestampToDateFormat(item.getApplyTime(),"yyyy-MM-dd")
+                                            ,item.getApplyStarTime(),item.getApplyEndTime()));
+                                }
+                                item.setRealname(user.getRealname());
+                                item.setIdCard(EncryptHandler.decrypt(user.getIdCard()));
+                                item.setSubscribeStatusStr(item.getSubscribeStatus() == 1 ? "已预约":"已取消");
+                                if (item.getSubscribeStatus() == 1){
+                                    if (ObjectUtils.isNull(item.getApplyTime())){
+                                        item.setSubscribeStatus(3);
+                                        item.setSubscribeStatusStr("已过期");
+                                    }else {
+                                        Long aLong = DateUtils.dateTimeSec("HH:mm", item.getApplyEndTime());
+                                        Long time = item.getApplyTime()+aLong;
+                                        if (DateUtils.getNowTime() > time){
+                                            item.setSubscribeStatus(3);
+                                            item.setSubscribeStatusStr("已过期");
+                                        }
+                                    }
+                                }
+                            });
+                            ExcelUtil<UserUsbRecordVo> util3 = new ExcelUtil<>(UserUsbRecordVo.class);
+                            String path3 = userPath + "/"+"约考记录.xlsx";
+                            util3.exportEasyExcelUtil(usbRecordVos, UserUsbRecordVo.class,path3);
+                        }
+                        break;
+                    case 11://考试记录
+                        UserApplyRecordBo applyRecordBo = new UserApplyRecordBo();
+                        applyRecordBo.setUserId(user.getUserId());
+                        List<UserApplyRecordVo> applyRecordVos = iUserSubscribeService.listUserApply(applyRecordBo);
+                        if (!CollectionUtils.isEmpty(applyRecordVos)){
+                            applyRecordVos.forEach(item -> {
+                                item.setRealname(user.getRealname());
+                                item.setIdCard(EncryptHandler.decrypt(user.getIdCard()));
+                                if (ObjectUtils.isNotNull(item.getApplyTime())){
+                                    item.setApplyTimeStr(String.format("%s (%s-%s)",DateUtils.timestampToDateFormat(item.getApplyTime(),"yyyy-MM-dd")
+                                            ,item.getApplyStarTime(),item.getApplyEndTime()));
+                                }
+                                item.setApplyNewStr(item.getApplyNew() == 1 ? "是":"否");
+                                if (ObjectUtils.isNotNull(item.getExamStatus())){
+                                    switch (item.getExamStatus()){
+                                        case 1:
+                                            item.setExamStatusStr("正常");
+                                            break;
+                                        case 2:
+                                            item.setExamStatusStr("缺考");
+                                            break;
+                                        case 3:
+                                            item.setExamStatusStr("作弊");
+                                            break;
+                                        case 4:
+                                            item.setExamStatusStr("替考");
+                                            break;
+                                        default:
+                                            item.setExamStatusStr("其他");
+
+                                    }
+                                }
+                                item.setApplyStatusStr(item.getApplyStatus() == 1 ? "通过":"不通过");
+                                if (ObjectUtils.isNotNull(item.getPerformance())){
+                                    item.setPerformanceStr(String.format("%s分",item.getPerformance()));
+                                }
+                            });
+                            ExcelUtil<UserApplyRecordVo> util4 = new ExcelUtil<>(UserApplyRecordVo.class);
+                            String path4 = userPath + "/"+"考试记录.xlsx";
+                            util4.exportEasyExcelUtil(applyRecordVos, UserApplyRecordVo.class,path4);
+                        }
+                        break;
+                    case 12://证书/证明
+                        iClassGradeUserService.exportCertificateList(userId,userPath);
+                        break;
+                    case 13://承诺书
+                        UserPromiseRecordBo userPromiseRecordBo = new UserPromiseRecordBo();
+                        userPromiseRecordBo.setUserId(user.getUserId());
+                        List<UserPromiseRecordVo> recordVos = iUserSubscribeService.listPromise(userPromiseRecordBo);
+                        if (!CollectionUtils.isEmpty(recordVos)){
+                            List<String> paths = new ArrayList<>();
+                            recordVos.forEach(item -> {
+                                item.setStampStatus(0);
+                                if (ObjectUtils.isNotNull(item.getKeyValue())){
+                                    JSONObject jsonObject = JSONObject.parseObject(item.getKeyValue());
+                                    if (ObjectUtils.isNotNull(jsonObject.get("commitment_electr_signature"))){
+                                        String json = JSONObject.toJSONString(jsonObject.get("commitment_electr_signature"));
+                                        JSONObject jsonObject1 = JSONObject.parseObject(json);
+                                        if (ObjectUtils.isNotNull(jsonObject1) && ObjectUtils.isNotNull(jsonObject1.get("value"))){
+                                            paths.add(jsonObject1.get("value").toString());
+                                        }
+                                    }
+
+                                    if (ObjectUtils.isNotNull(jsonObject.get("commitment_seal"))){
+                                        String json = JSONObject.toJSONString(jsonObject.get("commitment_seal"));
+                                        JSONObject jsonObject1 = JSONObject.parseObject(json);
+                                        if (ObjectUtils.isNotNull(jsonObject1) && ObjectUtils.isNotNull(jsonObject1.get("value"))){
+                                            paths.add(jsonObject1.get("value").toString());
+                                        }
+                                    }
+                                }
+                            });
+                            if (!CollectionUtils.isEmpty(paths)){
+                                String commitmentPath = userPath + "/承诺书" ;
+                                File file2 = new File(commitmentPath);
+                                if (!file2.exists()) {
+                                    file2.mkdirs();
+                                }
+                                for (String path : paths) {
+                                    try {
+                                        InputStream inputStream = ossService.getStreamByObject(path);
+                                        //写入本地文件
+                                        String inchPath = commitmentPath + "/"+String.format("承诺书%s.jpg",DateUtils.getNowTime());
+                                        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();
+                                    }
+                                }
+                            }
+                        }
+                        break;
+                }
+            }
+        }
+
+        //压缩上传oss
+        String zipPath = zhiyuan + "/zhongzheng-admin/src/main/resources/danganzip" + "/" + DateUtils.getNowTime() + ".zip";
+        File desc = new File(zipPath);
+        if (!desc.getParentFile().exists()) {
+            desc.getParentFile().mkdirs();
+        }
+        if (FileUtils.toZip(zipPath, toPath, true)) {
+            //压缩成功删除文件
+            Path pathStr = Paths.get(toPath);
+            try (Stream<Path> walk = Files.walk(pathStr)) {
+                walk.sorted(Comparator.reverseOrder())
+                        .forEach(FileUtils::deleteDirectoryStream);
+
+                //上传oss
+                OssRequest ossRequest = new OssRequest();
+                ossRequest.setGradeId(0L);
+                ossRequest.setUserId(0L);
+                ossRequest.setImageStatus(7);
+                File file1 = new File(zipPath);
+                ossRequest.setFile(FileUtils.getMultipartFile(file1));
+                String upload = ossService.upload(ossRequest);
+                task.setFinishNum(1);
+                task.setTaskStatus(3);//下载完成
+                task.setTaskPath(upload);
+                iSysTaskService.updateById(task);
+                //删除压缩包
+                Path zipPathStr = Paths.get(zipPath);
+                Stream<Path> zipWalk = Files.walk(zipPathStr);
+                zipWalk.sorted(Comparator.reverseOrder())
+                        .forEach(FileUtils::deleteDirectoryStream);
+
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("学员档案资料上传oss失败:" + e.getMessage());
+            }
+        }
+
+    }
+
     @Override
     public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
         if(Validator.isEmpty(bo.getAccount())){

+ 32 - 20
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -20,7 +20,6 @@ import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.core.redis.RedisLockEntity;
 import com.zhongzheng.common.exception.CustomException;
-import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
@@ -34,7 +33,6 @@ import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
-import com.zhongzheng.modules.base.domain.UserProfile;
 import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
@@ -76,7 +74,6 @@ import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordPhotoMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
-import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -3836,25 +3833,31 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     if(Validator.isNotEmpty(rVo.getRightRate())){
                         item.setRate(rVo.getRightRate()+"");
                     }
-                    if(rVo.getFromPlat()==1){
+                    if(ObjectUtils.isNull(rVo.getFromPlat())){
+                        item.setPlat("PC");
+                    }
+                    else if(rVo.getFromPlat()==1){
                         item.setPlat("小程序");
                     }
-                    if(rVo.getFromPlat()==2){
+                    else if(rVo.getFromPlat()==2){
                         item.setPlat("PC");
                     }
-                    if(rVo.getFromPlat()==3){
+                    else if(rVo.getFromPlat()==3){
                         item.setPlat("h5");
                     }
-                    if(rVo.getSectionType()==1){
+                    if(ObjectUtils.isNull(rVo.getSectionType())){
                         item.setSectionType("录播");
                     }
-                    if(rVo.getSectionType()==2){
+                    else if(rVo.getSectionType()==1){
+                        item.setSectionType("录播");
+                    }
+                    else if(rVo.getSectionType()==2){
                         item.setSectionType("直播");
                     }
-                    if(rVo.getSectionType()==3){
+                    else if(rVo.getSectionType()==3){
                         item.setSectionType("回放");
                     }
-                    if(rVo.getSectionType()==4){
+                    else if(rVo.getSectionType()==4){
                         item.setSectionType("题卷");
                     }
                     studyList.add(item);
@@ -4423,25 +4426,31 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     if(Validator.isNotEmpty(rVo.getRightRate())){
                         item.setRate(rVo.getRightRate()+"");
                     }
-                    if(rVo.getFromPlat()==1){
+                    if(ObjectUtils.isNull(rVo.getFromPlat())){
+                        item.setPlat("PC");
+                    }
+                    else if(rVo.getFromPlat()==1){
                         item.setPlat("小程序");
                     }
-                    if(rVo.getFromPlat()==2){
+                    else if(rVo.getFromPlat()==2){
                         item.setPlat("PC");
                     }
-                    if(rVo.getFromPlat()==3){
+                    else if(rVo.getFromPlat()==3){
                         item.setPlat("h5");
                     }
-                    if(rVo.getSectionType()==1){
+                    if(ObjectUtils.isNull(rVo.getSectionType())){
+                        item.setSectionType("录播");
+                    }
+                    else if(rVo.getSectionType()==1){
                         item.setSectionType("录播");
                     }
-                    if(rVo.getSectionType()==2){
+                    else if(rVo.getSectionType()==2){
                         item.setSectionType("直播");
                     }
-                    if(rVo.getSectionType()==3){
+                    else if(rVo.getSectionType()==3){
                         item.setSectionType("回放");
                     }
-                    if(rVo.getSectionType()==4){
+                    else if(rVo.getSectionType()==4){
                         item.setSectionType("题卷");
                     }
                     studyList.add(item);
@@ -4517,13 +4526,16 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     if(Validator.isNotEmpty(itemExportVo.getRightRate())){
                         item.setRate(itemExportVo.getRightRate()+"");
                     }
-                    if(itemExportVo.getFromPlat()==1){
+                    if(ObjectUtils.isNull(itemExportVo.getFromPlat())){
+                        item.setPlat("PC");
+                    }
+                    else if(itemExportVo.getFromPlat()==1){
                         item.setPlat("小程序");
                     }
-                    if(itemExportVo.getFromPlat()==2){
+                    else if(itemExportVo.getFromPlat()==2){
                         item.setPlat("PC");
                     }
-                    if(itemExportVo.getFromPlat()==3){
+                    else if(itemExportVo.getFromPlat()==3){
                         item.setPlat("h5");
                     }
                     exportItemList.add(item);

+ 62 - 115
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderListVo.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.order.vo;
 
-import com.zhongzheng.common.annotation.Excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -26,118 +27,98 @@ public class OrderListVo {
     @ApiModelProperty("$pkColumn.columnComment")
     private Long orderId;
 
-    /**
-     * 订单编号
-     */
+    @Excel(name = "姓名")
+    @ApiModelProperty("姓名")
+    private String realname;
+
+    @Excel(name = "身份证号")
+    @ApiModelProperty("身份证号")
+    private String idCard;
+
+    @Excel(name = "创建时间")
+    private String createTimeStr;
+
     @Excel(name = "订单编号")
     @ApiModelProperty("订单编号")
     private String orderSn;
-    /**
-     * 用户ID
-     */
-    @Excel(name = "用户ID")
+
+    @Excel(name = "订单类别")
+    private String orderTypeStr;
+
+    @Excel(name = "课程")
+    private String goodsName;
+
+    @Excel(name = "业务类型")
+    private String businessNameStr;
+
+    @Excel(name = "订单状态")
+    private String orderStatusStr;
+
+    @Excel(name = "支付方式")
+    private String payTypeStr;
+
+    @Excel(name = "成交金额")
+    private String orderPriceStr;
+
+    @Excel(name = "已收金额")
+    private String orderReceivedStr;
+
+    @Excel(name = "未收金额")
+    private String orderUncollectedStr;
+
+    @Excel(name = "有效期")
+    private String validityTime;
+
     @ApiModelProperty("用户ID")
     private Long userId;
 
-    /**
-     * 用户ID
-     */
-    @Excel(name = "商品封面")
     @ApiModelProperty("商品封面")
     private String coverUrl;
-    /**
-     * 订单价格
-     */
-    @Excel(name = "订单价格")
+
     @ApiModelProperty("订单价格")
     private BigDecimal orderPrice;
-    /**
-     * 支付订单号
-     */
-    @Excel(name = "支付订单号")
+
     @ApiModelProperty("支付订单号")
     private String orderGeneral;
-    /**
-     * 订单状态 -2 超时关闭,-1手动关闭,0普通状态,1为已付款,3为成功
-     */
-    @Excel(name = "订单状态 -2 超时关闭,-1手动关闭,0普通状态,1为已付款,3为成功")
+
     @ApiModelProperty("订单状态 -2 超时关闭,-1手动关闭,0普通状态,1为已付款,3为成功")
     private Integer orderStatus;
-    /**
-     * 支付时间
-     */
-    @Excel(name = "支付时间")
+
     @ApiModelProperty("支付时间")
     private Long payTime;
-    /**
-     * 支付平台 1微信 2支付宝
-     */
-    @Excel(name = "支付平台 1微信 2支付宝")
+
     @ApiModelProperty("支付平台 1微信 2支付宝")
     private Integer payType;
-    /**
-     * 微信流水号
-     */
-    @Excel(name = "微信流水号")
+
     @ApiModelProperty("微信流水号")
     private String transid;
-    /**
-     * 关闭时间
-     */
-    @Excel(name = "关闭时间")
+
     @ApiModelProperty("关闭时间")
     private Long cancelTime;
-    /**
-     * 订单完成时间
-     */
-    @Excel(name = "订单完成时间")
+
     @ApiModelProperty("订单完成时间")
     private Long finishTime;
-    /**
-     * 订单类型 1充值订单 2金币消费订单
-     */
-    @Excel(name = "订单类型 1充值订单 2金币消费订单")
+
     @ApiModelProperty("订单类型 1充值订单 2金币消费订单")
     private Integer orderType;
-    /**
-     * 支付价格
-     */
-    @Excel(name = "支付价格")
+
     @ApiModelProperty("支付价格")
     private BigDecimal payPrice;
-    /**
-     * 收费方式 1即刻收费 2稍后收费
-     */
-    @Excel(name = "收费方式 1即刻收费 2稍后收费")
+
     @ApiModelProperty("收费方式 1即刻收费 2稍后收费")
     private Integer chargingType;
-    /**
-     * 订单来源 1业务员录单
-     */
-    @Excel(name = "订单来源 1业务员录单")
+
     @ApiModelProperty("订单来源 1业务员录单")
     private Integer orderFrom;
     @ApiModelProperty("订单创建时间")
     private Long createTime;
-    /**
-     * 商品标准价格
-     */
-    @Excel(name = "商品标准价格")
+
     @ApiModelProperty("商品标准价格")
     private BigDecimal goodsPrice;
-    /**
-     * 商品成交价格
-     */
-    @Excel(name = "商品成交价格")
+
     @ApiModelProperty("商品成交价格")
     private BigDecimal goodsRealPrice;
-    /**
-     * 商品名称
-     */
-    @Excel(name = "商品名称")
-    @ApiModelProperty("商品名称")
-    private String goodsName;
-    @Excel(name = "年份")
+
     @ApiModelProperty("年份")
     private Long year;
     @ApiModelProperty("商品id")
@@ -154,48 +135,21 @@ public class OrderListVo {
     @ApiModelProperty("专业名称")
     private String categoryName;
 
-    /**
-     * 真实姓名
-     */
-    @Excel(name = "真实姓名")
-    @ApiModelProperty("真实姓名")
-    private String realname;
-    /**
-     * 身份证号
-     */
-    @Excel(name = "身份证号")
-    @ApiModelProperty("身份证号")
-    private String idCard;
-    /**
-     * 手机号码
-     */
-    @Excel(name = "手机号码")
     @ApiModelProperty("手机号码")
     private String telphone;
 
     @ApiModelProperty("公司名称")
     private String companyName;
 
-    @Excel(name = "商品订单状态")
     @ApiModelProperty("商品订单状态 -1关闭 0待支付 1已支付 2已退款")
     private Integer orderGoodsStatus;
 
-    /**
-     * 已收金额
-     */
-    @Excel(name = "已收金额")
     @ApiModelProperty("已收金额")
     private BigDecimal goodsReceived;
-    /**
-     * 退款状态 0无  1退款中 2已退款 3拒绝退款
-     */
-    @Excel(name = "退款状态 0无  1退款中 2已退款 3拒绝退款")
+
     @ApiModelProperty("退款状态 0无  1退款中 2已退款 3拒绝退款")
     private Integer refundStatus;
-    /**
-     * 支付状态 1未收费 2部分收费 3完全收费
-     */
-    @Excel(name = "支付状态 1未收费 2部分收费 3完全收费")
+
     @ApiModelProperty("支付状态 1未收费 2部分收费 3完全收费")
     private Integer payStatus;
     /**
@@ -224,28 +178,21 @@ public class OrderListVo {
 
     @ApiModelProperty("商品编号")
     private String code;
-    /**
-     * 0 非复购 1复购 针对业务层次配了【下单前需要  选择班级
-     */
-    @Excel(name = "0 非复购 1复购 针对业务层次配了【下单前需要  选择班级")
+
     @ApiModelProperty("0 非复购 1复购 针对业务层次配了【下单前需要  选择班级")
     private Integer rebuy;
     @ApiModelProperty("是否学时推送 0未推送 1推送")
     private Integer periodPlush;
-    @Excel(name = "复购老订单商品ID")
+
     @ApiModelProperty("复购老订单商品ID")
     private Long rebuyOrderGoodsId;
-    @Excel(name = "订单商品支付状态")
+
     @ApiModelProperty("订单商品支付状态  1未收费 2部分收费 3完全收费 4免费")
     private Integer goodsPayStatus;
-    /**
-     * 商品类型 1视频2题库 3补考 4前培
-     */
+
     @ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
     private Integer goodsType;
 
-    /** 发票状态 1未开票 2已开票 -1 已退票 */
-    @Excel(name = "发票状态 1未开票 2已开票 -1 已退票")
     @ApiModelProperty("发票状态 1未开票 2已开票 -1 已退票")
     private Integer invoiceStatus;
 

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysTask.java

@@ -26,8 +26,14 @@ public class SysTask implements Serializable {
     private Long updateTime;
     /** 0 失效 1启用 */
     private Integer status;
+    /** 任务类型:1七大员新考 2学员资料 */
+    private Integer taskType;
+    /** 关联账号ID */
+    private Long sysUserId;
     /** 任务名称 */
     private String taskName;
+    /** 任务名称 */
+    private String taskCode;
     /** 任务数量 */
     private Integer taskNum;
     /** 完成数量 */

+ 58 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserDataExcelBo.java

@@ -0,0 +1,58 @@
+package com.zhongzheng.modules.user.bo;
+
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月27日 16:06
+ */
+@Data
+public class UserDataExcelBo implements Serializable {
+
+    @Excel(name = "注册时间")
+    private String registerTime;
+
+    @Excel(name = "学员编号")
+    private String studentCode;
+
+    @Excel(name = "姓名")
+    private String realname;
+
+    @Excel(name = "性别")
+    private String sex;
+
+    @Excel(name = "手机号码")
+    private String userPhone;
+
+    @Excel(name = "身份证号")
+    private String userCard;
+
+    @Excel(name = "学历")
+    private String eduLevel;
+
+    @Excel(name = "毕业院校")
+    private String school;
+
+    @Excel(name = "毕业时间")
+    private String graduationTime;
+
+    @Excel(name = "所学专业")
+    private String major;
+
+    @Excel(name = "工作年限")
+    private String workYear;
+
+    @Excel(name = "工作单位")
+    private String companyName;
+
+    @Excel(name = "单位联系人")
+    private String unitContact;
+
+    @Excel(name = "单位联系电话")
+    private String unitTel;
+
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -147,4 +147,6 @@ public interface IUserService extends IService<User> {
     User getByCardNoTenant(String idCard);
 
 	Map<String, Object> importSevenUser(List<UserPeriodImportBo> userList);
+
+    void userDateDownload(UserDownloadBo bo);
 }

+ 29 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserApplyRecordVo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.vo;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -21,12 +22,19 @@ public class UserApplyRecordVo {
     @ApiModelProperty("预约记录ID")
     private Long subscribeId;
 
+    private Long applyTime;
+
+    @Excel(name = "姓名")
+    private String realname;
+
+    @Excel(name = "身份证号")
+    private String idCard;
+
+    @Excel(name = "考试时间")
     @ApiModelProperty("考试时间")
     private String applyTimeStr;
 
-    private Long applyTime;
-
-    /** 课程名称 */
+    @Excel(name = "课程")
     @ApiModelProperty("课程名称")
     private String goodsName;
 
@@ -38,24 +46,42 @@ public class UserApplyRecordVo {
 
     private Long majorId;
 
+    @Excel(name = "业务类型")
     @ApiModelProperty("业务类型")
     private String businessName;
 
+    @Excel(name = "专业")
     @ApiModelProperty("专业名称")
     private String majorName;
 
     @ApiModelProperty("是否新考:1是 0否")
     private Integer applyNew;
 
+    @Excel(name = "是否新考")
+    @ApiModelProperty("是否新考:1是 0否")
+    private String applyNewStr;
+
     @ApiModelProperty("出考状态:1正常 2缺考 3作弊 4替考")
     private Integer examStatus;
 
+    @Excel(name = "出考情况")
+    @ApiModelProperty("出考状态:1正常 2缺考 3作弊 4替考")
+    private String examStatusStr;
+
     @ApiModelProperty("考试状态:1通过 0不通过")
     private Integer applyStatus;
 
+    @Excel(name = "考试状态")
+    @ApiModelProperty("考试状态:1通过 0不通过")
+    private String applyStatusStr;
+
     @ApiModelProperty("成绩")
     private BigDecimal performance;
 
+    @Excel(name = "成绩")
+    @ApiModelProperty("成绩")
+    private String performanceStr;
+
     private String applyStarTime;
 
     private String applyEndTime;

+ 20 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserUsbRecordVo.java

@@ -1,13 +1,11 @@
 package com.zhongzheng.modules.user.vo;
 
-import com.zhongzheng.common.annotation.Excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.math.BigDecimal;
-import java.util.List;
-
 /**
  * 【请填写功能名称】视图对象 mall_package
  *
@@ -23,10 +21,19 @@ public class UserUsbRecordVo {
     @ApiModelProperty("预约记录ID")
     private Long subscribeId;
 
+    @Excel(name = "姓名")
+    private String realname;
+
+    @Excel(name = "身份证号")
+    private String idCard;
+
+    @Excel(name = "约考时间")
+    private String createTimeStr;
+
     @ApiModelProperty("约考时间")
     private Long createTime;
 
-    /** 课程名称 */
+    @Excel(name = "课程")
     @ApiModelProperty("课程名称")
     private String goodsName;
 
@@ -38,15 +45,21 @@ public class UserUsbRecordVo {
 
     private Long majorId;
 
+    @Excel(name = "业务类型")
     @ApiModelProperty("业务类型")
     private String businessName;
 
     @ApiModelProperty("预约状态:1已预约 2已取消 3已过期")
     private Integer subscribeStatus;
 
+    @Excel(name = "专业")
     @ApiModelProperty("专业名称")
     private String majorName;
 
+    @Excel(name = "约考状态")
+    private String subscribeStatusStr;
+
+    @Excel(name = "考试时间")
     @ApiModelProperty("考试时间")
     private String applyTimeStr;
 
@@ -59,9 +72,11 @@ public class UserUsbRecordVo {
     @ApiModelProperty("考试结束时间")
     private String applyEndTime;
 
+    @Excel(name = "考试地点")
     @ApiModelProperty("考试地点")
     private String applyAddress;
 
+    @Excel(name = "备注")
     @ApiModelProperty("备注")
     private String remark;
 

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orderFrom" column="order_from"/>
         <result property="status" column="status"/>
         <result property="periodStatus" column="period_status"/>
+        <result property="createTime" column="create_time"/>
 
         <result property="goodsName" column="goods_name"/>
         <result property="goodsId" column="goods_id"/>