123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893 |
- package com.zhongzheng.controller.grade;
- import java.io.FileOutputStream;
- import java.time.LocalDateTime;
- import java.time.format.DateTimeFormatter;
- import java.util.*;
- import java.util.concurrent.TimeUnit;
- import java.util.stream.Collectors;
- import cn.afterturn.easypoi.excel.ExcelExportUtil;
- import cn.afterturn.easypoi.excel.entity.ExportParams;
- import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
- import cn.hutool.core.bean.BeanUtil;
- import cn.hutool.core.lang.Validator;
- import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
- import com.baomidou.mybatisplus.core.toolkit.StringUtils;
- import com.github.pagehelper.PageInfo;
- import com.zhongzheng.common.core.domain.entity.SysRole;
- import com.zhongzheng.common.core.redis.RedisCache;
- import com.zhongzheng.common.utils.SecurityUtils;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.common.utils.ToolsUtils;
- import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
- import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
- import com.zhongzheng.modules.goods.service.IGoodsService;
- import com.zhongzheng.modules.goods.vo.GoodsVo;
- import com.zhongzheng.modules.grade.bo.*;
- import com.zhongzheng.modules.grade.domain.ClassGrade;
- import com.zhongzheng.modules.grade.service.*;
- import com.zhongzheng.modules.grade.vo.*;
- import com.zhongzheng.modules.order.bo.OrderQueryBo;
- import com.zhongzheng.modules.order.vo.OrderListExportVo;
- import com.zhongzheng.modules.user.bo.UserQueryBo;
- import com.zhongzheng.modules.user.entity.ClientLoginUser;
- import io.swagger.models.auth.In;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.BeanUtils;
- import org.springframework.boot.SpringBootVersion;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.poi.ExcelUtil;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import javax.servlet.ServletOutputStream;
- /**
- * 班级Controller
- *
- * @author ruoyi
- * @date 2021-11-10
- */
- @Api(value = "班级控制器", tags = {"班级管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/grade/grade")
- public class ClassGradeController extends BaseController {
- private final IClassGradeService iClassGradeService;
- private final IClassGradeInterfaceService iClassGradeInterfaceService;
- private final IClassGradeSysService iClassGradeSysService;
- private final IClassGradeUserService iClassGradeUserService;
- private final IUserPeriodService iUserPeriodService;
- private final IUserPeriodStatusService userPeriodStatusService;
- private final RedisCache redisCache;
- private final IGoodsService iGoodsService;
- /**
- * 查询班级列表
- */
- @ApiOperation("批量查询商品班级列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listGoodsBatch/{ids}")
- public TableDataInfo<ClassGradeGoodsVo> listGoodsBatch(@PathVariable Long[] ids) {
- startPage();
- ClassGradeQueryBo bo = new ClassGradeQueryBo();
- bo.setGoodsIds(Arrays.asList(ids));
- List<ClassGradeGoodsVo> list = iClassGradeService.listGoodsBatch(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("查询商品班级列表")
- @GetMapping("/listGoods")
- public TableDataInfo<ClassGradeVo> listGoods(ClassGradeQueryBo bo) {
- startPage();
- bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
- bo.setPastDue(1L);
- bo.setAtFull(1L);
- List<ClassGradeVo> list = iClassGradeService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("查询班级列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/list")
- public TableDataInfo<ClassGradeVo> list(ClassGradeQueryBo bo) {
- startPage();
- List<ClassGradeVo> list = iClassGradeService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表(新)
- */
- @ApiOperation("查询班级列表(新)")
- @GetMapping("/search/list")
- public TableDataInfo<ClassGradeVo> searchGradeList(ClassGradeQueryBo bo) {
- startPage();
- List<ClassGradeVo> list = iClassGradeService.searchGradeList(bo);
- return getDataTable(list);
- }
- /**
- * 查询其他平台班级详情
- */
- @ApiOperation("查询其他平台班级学员列表")
- @GetMapping("/other/Class/user")
- public AjaxResult<List<ClassNpUserInfoVo>> otherClassUserList(ClassNpUserInfoBo bo) {
- return AjaxResult.success(iClassGradeService.otherClassUserList(bo));
- }
- /**
- * 导出查询其他平台班级详情
- */
- @ApiOperation("查询其他平台班级学员列表")
- @GetMapping("/other/Class/user/export")
- public AjaxResult<List<ClassNpUserInfoVo>> otherClassUserListExport(ClassNpUserInfoBo bo) {
- List<ClassNpUserInfoVo> list = iClassGradeService.otherClassUserList(bo);
- List<ClassNpUserInfoExportVo> exportVos = list.stream().map(item -> BeanUtil.toBean(item,ClassNpUserInfoExportVo.class)).collect(Collectors.toList());
- ExcelUtil<ClassNpUserInfoExportVo> util = new ExcelUtil<ClassNpUserInfoExportVo>(ClassNpUserInfoExportVo.class);
- return util.exportExcel(exportVos, "班级学员列表");
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("是否出现官方按钮选择 1官方信息推送 2官方学时推送 3账号开通 1,2,3 班级出现全部 学时审核出现学时推送 ")
- @PreAuthorize("@ss.hasPermi('grade:grade:select')")
- @GetMapping("/selectButton")
- public AjaxResult<Integer[]> selectButton(ClassGradeQueryBo bo) {
- ClassGradeVo classGradeVo = iClassGradeService.queryList(bo).get(0);
- List<Integer> integers = new ArrayList<>();
- Integer status =1;
- //判断字段是否填写,填写出现按钮
- if (classGradeVo.getInterfacePushId() != null ){
- integers.add(1);
- }
- if (classGradeVo.getInterfacePeriodId()!=null){
- integers.add(2);
- }
- if (classGradeVo.getInterfaceAccountId() != null ){
- integers.add(3);
- }
- if (classGradeVo.getNoInterfaceAccountId() != null ){
- integers.add(4);
- }
- //初始化需要得到的数组
- Integer[] array = new Integer[integers.size()];
- //使用for循环得到数组
- for(int i = 0; i < integers.size();i++){
- array[i] = integers.get(i);
- }
- return AjaxResult.success(array);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("查询班级学员列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listGrade")
- public TableDataInfo<ClassGradeStudentVo> listGrade(ClassGradeUserQueryBo bo) {
- ClassGrade gradeGrade = iClassGradeService.getById(bo.getGradeId());
- if (StringUtils.isNotBlank(gradeGrade.getSevenCode())){
- bo.setSevenCode(gradeGrade.getSevenCode());
- }
- startPage();
- List<ClassGradeStudentVo> list = iClassGradeService.listGrade(bo);
- return getDataTable(list);
- }
- /**
- * 统计班级学员学时推送数量
- */
- @ApiOperation("统计班级学员学时推送数量")
- @GetMapping("/count/periodPlush")
- public AjaxResult getPeriodPlush(ClassGradeUserQueryBo bo) {
- HashMap<String, Object> plush = iClassGradeService.getPlush(bo);
- return AjaxResult.success(plush);
- }
- /**
- * 查询所有班级用户列表
- */
- @ApiOperation("查询所有班级用户列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listGradeAll")
- public TableDataInfo<ClassGradeStudentVo> listGradeAll(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassGradeStudentVo> list = iClassGradeService.listGradeAll(bo);
- return getDataTable(list);
- }
- @ApiOperation("导出所有班级用户列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listGradeAllExport")
- public AjaxResult<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo) {
- List<ClassGradeStudentAllExportVo> list = iClassGradeService.listGradeAllExport(bo);
- ExcelUtil<ClassGradeStudentAllExportVo> util = new ExcelUtil<>(ClassGradeStudentAllExportVo.class);
- return util.exportExcel(list,"报班学员记录");
- }
- /**
- * 导出班级学员列表
- */
- @ApiOperation("导出班级学员列表")
- // @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/exportListGrade")
- public AjaxResult exportListGrade(ClassGradeUserQueryBo bo) {
- List<ClassGradeStudentVo> list = iClassGradeService.listGrade(bo);
- List<ClassStudentExportVo> exportVos = list.stream().map(item -> ClassStudentExportVo.initEntity(item)).collect(Collectors.toList());
- ExcelUtil<ClassStudentExportVo> util = new ExcelUtil<ClassStudentExportVo>(ClassStudentExportVo.class);
- return util.exportExcel(exportVos, "班级学员列表");
- }
- /**
- * 学员进入新的班级
- */
- @ApiOperation("学员进入新的班级")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "班级", businessType = BusinessType.INSERT)
- @PostMapping("/addUserGrade")
- public AjaxResult<Void> editUserGrade(@RequestBody ClassGradeUserAddQueryBo bo) {
- return toAjax(iClassGradeService.editUserGrade(bo) ? 1 : 0);
- }
- /**
- * 查询学时学员记录列表
- */
- @ApiOperation("查询学员学时列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserPeriod")
- public TableDataInfo<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriod(bo);
- return getDataTable(list);
- }
- /**
- * 查询学时学员记录列表
- */
- @ApiOperation("查询学员学时列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserPeriod/manage")
- public TableDataInfo<ClassPeriodStudentVo> listUserPeriodManage(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodManage(bo);
- return getDataTable(list);
- }
- /**
- * 查询学时学员记录统计
- */
- @ApiOperation("查询学时学员记录统计")
- @GetMapping("/listUserPeriod/total")
- public AjaxResult<UserPeriodTotalVo> listUserPeriodTotal(ClassGradeUserQueryBo bo) {
- return AjaxResult.success(iClassGradeUserService.listUserPeriodTotal(bo));
- }
- /**
- * 查询学时学员记录列表(新)
- */
- @ApiOperation("查询学员学时列表(新)")
- @GetMapping("/listUserPeriod/new")
- public TableDataInfo<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentNewVo> list = iClassGradeUserService.listUserPeriodNew(bo);
- return getDataTable(list);
- }
- /**
- * 查询学时学员记录列表
- */
- @ApiOperation("查询学员学时学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserPeriodRecord")
- public TableDataInfo<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodRecord(bo);
- return getDataTable(list);
- }
- @ApiOperation("导出学员学时学习记录列表")
- @GetMapping("/exportListUserPeriodRecord")
- public AjaxResult<ClassPeriodStudentExportProcessVo> exportListUserPeriodRecord(ClassGradeUserQueryBo bo) {
- List<ClassPeriodStudentExportProcessVo> list = iClassGradeUserService.exportListUserPeriodRecord(bo);
- ExcelUtil<ClassPeriodStudentExportProcessVo> util = new ExcelUtil<>(ClassPeriodStudentExportProcessVo.class);
- return util.exportExcel(list,"学员学时学习记录列表");
- }
- /**
- * 导出审核不通过记录
- */
- @ApiOperation("导出审核不通过记录")
- @GetMapping("/export/noPass/record")
- public AjaxResult<ClassNoPassExportVo> exportNoPassRecord() {
- List<ClassNoPassExportVo> list = iClassGradeUserService.exportNoPassRecord();
- ExcelUtil<ClassNoPassExportVo> util = new ExcelUtil<>(ClassNoPassExportVo.class);
- return util.exportExcel(list,"学时不通过记录");
- }
- /**
- * 导出审核不通过重学记录
- */
- @ApiOperation("导出审核不通过重学记录")
- @GetMapping("/export/restart/record")
- public AjaxResult<ClassNoPassExportVo> exportRestartRecord() {
- List<ClassNoPassExportVo> list = iClassGradeUserService.exportRestartRecord();
- ExcelUtil<ClassNoPassExportVo> util = new ExcelUtil<>(ClassNoPassExportVo.class);
- return util.exportExcel(list,"学时不通过重学记录");
- }
- /**
- * 班级管理列表
- */
- @ApiOperation("班级管理列表")
- @GetMapping("/listUserPeriodRecord/new")
- public TableDataInfo<ClassPeriodStudentVo> listUserPeriodRecordNew(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodRecordNew(bo);
- return getDataTable(list);
- }
- @ApiOperation("按周查询学员学时学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserPeriodWeekRecord")
- public TableDataInfo<ClassPeriodStudentVo> listUserPeriodWeekRecord(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodWeekRecord(bo);
- return getDataTable(list);
- }
- @ApiOperation("查询学员视频学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserVideoRecord")
- public TableDataInfo<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserVideoRecord(bo);
- return getDataTable(list);
- }
- @ApiOperation("查询学员视频学习记录列表")
- @GetMapping("/listUserVideoRecord/new")
- public TableDataInfo<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserVideoRecordNew(bo);
- return getDataTable(list);
- }
- /**
- * 查询学时学员记录列表
- */
- @ApiOperation("查询学员学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserStudyRecord")
- public TableDataInfo<UserPeriodExportV2Vo> listUserStudyRecord(ClassGradeUserQueryBo bo) {
- startPage();
- List<UserPeriodExportV2Vo> list = iClassGradeUserService.listUserStudyRecordV2(bo);
- return getDataTable(list);
- }
- @ApiOperation("周查询学员学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserStudyRecordV2Week")
- public TableDataInfo<UserPeriodExportV2Vo> listUserStudyRecordV2Week(ClassGradeUserQueryBo bo) {
- startPage();
- List<UserPeriodExportV2Vo> list = iClassGradeUserService.listUserStudyRecordV2Week(bo);
- return getDataTable(list);
- }
- /**
- * 查询学时学员记录列表
- *//*
- @ApiOperation("查询学员学习记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUserStudyRecord")
- public TableDataInfo<UserPeriodExportVo> listUserStudyRecord(ClassGradeUserQueryBo bo) {
- startPage();
- List<UserPeriodExportVo> list = iClassGradeUserService.listUserStudyRecord(bo);
- return getDataTable(list);
- }*/
- /**
- * 导出资料审核列表
- */
- @ApiOperation("导出学员学时列表")
- @PreAuthorize("@ss.hasPermi('system:profile:export')")
- @Log(title = "导出学员学时列表", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<Map<String,Object>> export(ClassGradeUserQueryBo bo) {
- String fileName = "";
- if(Validator.isEmpty(bo.getStudyStatus())){
- bo.setStudyStatus(0);
- fileName="全部";
- }else{
- if(bo.getStudyStatus()==0){
- fileName="全部";
- }
- if(bo.getStudyStatus()==1){
- fileName="未完成学习";
- }
- if(bo.getStudyStatus()==2){
- fileName="完成学习";
- }
- }
- bo.setUserPhoto(1);
- Map<String,Object> map = iClassGradeUserService.exportPo(bo);
- List<ClassPeriodStudentExportAllVo> list = (List<ClassPeriodStudentExportAllVo>)map.get("list");
- ExcelUtil<ClassPeriodStudentExportAllVo> util = new ExcelUtil<ClassPeriodStudentExportAllVo>(ClassPeriodStudentExportAllVo.class);
- ExportParams deptExportParams = new ExportParams();
- // 设置sheet得名称
- deptExportParams.setSheetName("表1");
- String timeStr= LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
- Map<String, Object> deptExportMap = new HashMap<>();
- deptExportMap.put("title", deptExportParams);
- deptExportMap.put("entity", ClassPeriodStudentExportAllVo.class);
- // sheet中要填充得数据
- deptExportMap.put("data", list);
- List<Map<String, Object>> sheetsList = new ArrayList<>();
- sheetsList.add(deptExportMap);
- String businessName = Validator.isNotEmpty(bo.getBusinessName())?bo.getBusinessName():"";
- map.put("excel",util.exportEasyExcel(sheetsList, businessName+"-"+fileName+"-学员学习记录-"+timeStr));
- map.remove("list");
- return AjaxResult.success(map);
- }
- @ApiOperation("周导出学员学时列表")
- @PreAuthorize("@ss.hasPermi('system:profile:export')")
- @Log(title = "周导出学员学时列表", businessType = BusinessType.EXPORT)
- @PostMapping("/exportWeek")
- public AjaxResult<Map<String,Object>> exportWeek(@RequestBody ClassGradeUserQueryBo bo) {
- String fileName = "";
- if(Validator.isEmpty(bo.getStudyStatus())){
- bo.setStudyStatus(0);
- fileName="全部";
- }else{
- if(bo.getStudyStatus()==0){
- fileName="全部";
- }
- if(bo.getStudyStatus()==1){
- fileName="未完成学习";
- }
- if(bo.getStudyStatus()==2){
- fileName="完成学习";
- }
- }
- bo.setUserPhoto(1);
- Map<String,Object> map = iClassGradeUserService.exportWeekPo(bo);
- List<ClassPeriodStudentExportWeekAllVo> list = (List<ClassPeriodStudentExportWeekAllVo>)map.get("list");
- ExcelUtil<ClassPeriodStudentExportWeekAllVo> util = new ExcelUtil<ClassPeriodStudentExportWeekAllVo>(ClassPeriodStudentExportWeekAllVo.class);
- ExportParams deptExportParams = new ExportParams();
- // 设置sheet得名称
- deptExportParams.setSheetName("表1");
- String timeStr= LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
- Map<String, Object> deptExportMap = new HashMap<>();
- deptExportMap.put("title", deptExportParams);
- deptExportMap.put("entity", ClassPeriodStudentExportWeekAllVo.class);
- // sheet中要填充得数据
- deptExportMap.put("data", list);
- List<Map<String, Object>> sheetsList = new ArrayList<>();
- sheetsList.add(deptExportMap);
- String businessName = Validator.isNotEmpty(bo.getBusinessName())?bo.getBusinessName():"";
- map.put("excel",util.exportEasyExcel(sheetsList, businessName+"-"+fileName+"-学员学习记录-"+timeStr));
- map.remove("list");
- return AjaxResult.success(map);
- }
- /**
- * 查询学员学时信息列表
- */
- @ApiOperation("查询学员学时信息列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listPeriod")
- public TableDataInfo<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodUserVo> list = iClassGradeUserService.listPeriod(bo);
- return getDataTable(list);
- }
- /**
- * 学时审核
- */
- @ApiOperation("学时审核")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listPeriodAudit")
- public TableDataInfo<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassPeriodVo> list = iClassGradeUserService.listPeriodAudit(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员记录列表
- */
- @ApiOperation("查询学员记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUser")
- public TableDataInfo<ClassGradeUserVo> list(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassGradeUserVo> list = iClassGradeUserService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询查询以往审核记录列表
- */
- @ApiOperation("查询以往审核记录")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listPeriodStatus")
- public TableDataInfo<UserPeriodStatusVo> list(UserPeriodQueryBo bo) {
- startPage();
- List<UserPeriodStatusVo> list = userPeriodStatusService.selectPeriodStatus(bo);
- return getDataTable(list);
- }
- /**
- * 查询班主任记录列表
- */
- @ApiOperation("查询班主任记录列表")
- @PreAuthorize("@ss.hasPermi('grade:sys:list')")
- @GetMapping("/listSys")
- public TableDataInfo<ClassGradeSysVo> list(ClassGradeSysQueryBo bo) {
- startPage();
- List<ClassGradeSysVo> list = iClassGradeSysService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("是否出现官方接口选择")
- @PreAuthorize("@ss.hasPermi('grade:grade:select')")
- @GetMapping("/select")
- public AjaxResult<Integer> select(ClassGradeAddBo bo) {
- //自己公司的TenantId出现选择官方接口
- // boolean tenantId = ServletUtils.getRequest().getHeader("TenantId").equals("867735392558919680");
- // return AjaxResult.success(tenantId ? 1 : 0);
- return AjaxResult.success(1);
- }
- /**
- * 查询官方接口
- */
- @ApiOperation("查询官方接口")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listInterfaceVo")
- public TableDataInfo<ClassGradeInterfaceVo> list(ClassGradeInterfaceQueryBo bo) {
- startPage();
- List<ClassGradeInterfaceVo> list = iClassGradeInterfaceService.queryList(bo);
- return getDataTable(list);
- }
- /* *//**
- * 导出班级列表
- *//*
- @ApiOperation("导出班级列表")
- @PreAuthorize("@ss.hasPermi('modules.grade:grade:export')")
- @Log(title = "班级", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<ClassGradeVo> export(ClassGradeQueryBo bo) {
- List<ClassGradeVo> list = iClassGradeService.queryList(bo);
- ExcelUtil<ClassGradeVo> util = new ExcelUtil<ClassGradeVo>(ClassGradeVo.class);
- return util.exportExcel(list, "班级");
- }*/
- /**
- * 获取班级详细信息
- */
- @ApiOperation("获取班级详细信息")
- @PreAuthorize("@ss.hasPermi('grade:grade:query')")
- @GetMapping("/{classId}")
- public AjaxResult<ClassGradeVo> getInfo(@PathVariable("classId") Long classId) {
- return AjaxResult.success(iClassGradeService.queryById(classId));
- }
- /**
- * 新增班级
- */
- @ApiOperation("新增班级")
- @PreAuthorize("@ss.hasPermi('grade:grade:add')")
- @Log(title = "班级", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody ClassGradeAddBo bo) {
- return toAjax(iClassGradeService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改班级
- */
- @ApiOperation("修改班级")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "班级", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- public AjaxResult<Void> edit(@RequestBody ClassGradeEditBo bo) {
- return toAjax(iClassGradeService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 修改【请填写功能名称】
- */
- @ApiOperation("更改审核状态")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
- @PostMapping("/editPeriod")
- public AjaxResult<Void> edit(@RequestBody UserPeriodEditBo bo) {
- return toAjax(iUserPeriodService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 更改批量待审核状态
- */
- @ApiOperation("更改批量待审核状态")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
- @PostMapping("/editPeriodAll")
- public AjaxResult<Void> editPeriodAll(@RequestBody UserPeriodEditBo bo) {
- return toAjax(iUserPeriodService.editPeriodAll(bo) ? 1 : 0);
- }
- /**
- * 学时通过确认
- */
- @ApiOperation("学时通过确认")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "学时通过确认", businessType = BusinessType.UPDATE)
- @PostMapping("/confirmPeriod")
- public AjaxResult<Void> confirmPeriod(@RequestBody UserPeriodEditBo bo) {
- return toAjax(iUserPeriodService.confirmPeriod(bo) ? 1 : 0);
- }
- /**
- * 修改学员记录
- */
- @ApiOperation("修改学员记录")
- @PreAuthorize("@ss.hasPermi('system:user:edit')")
- @Log(title = "学员记录", businessType = BusinessType.UPDATE)
- @PostMapping("/editGradeUser")
- public AjaxResult<Void> edit(@RequestBody ClassGradeUserEditBo bo) {
- return toAjax(iClassGradeUserService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 学时审核獲得商品節下面的審核記錄
- */
- @ApiOperation("学时审核獲得商品節下面的審核記錄")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listPeriodAuditStatus")
- public AjaxResult<ClassPeriodSectionVo> listPeriodAuditStatus(UserPeriodQueryBo bo) {
- startPage();
- ClassPeriodSectionVo list = iClassGradeUserService.listPeriodAuditStatus(bo);
- return AjaxResult.success(list);
- }
- /**
- * 新增订单
- */
- @ApiOperation("选新班")
- @PostMapping("/sysChangeGrade")
- public AjaxResult changeGrade(@RequestBody ClassGradeUserSysChangeBo bo) {
- return AjaxResult.success(iClassGradeUserService.sysChangeGrade(bo));
- }
- /**
- * 自由选新班
- */
- @ApiOperation("自由选新班")
- @PostMapping("/changeGradeFree")
- public AjaxResult changeGradeFree(@RequestBody ClassGradeUserChangeBo bo) {
- return AjaxResult.success(iClassGradeUserService.changeGradeFree(bo));
- }
- /**
- * 检查编辑数据是否有用户通过学时
- */
- @ApiOperation("检查编辑数据是否有用户通过学时")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/checkGoodsChange")
- public AjaxResult<Long> checkGoodsChange(UserPeriodQueryBo bo) {
- return AjaxResult.success(iUserPeriodService.checkGoodsChange(bo));
- }
- /**
- * 检查编辑数据是否有用户通过学时
- */
- @ApiOperation("检查编辑数据是否有用户在学习")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/checkGoodsStudy")
- public AjaxResult<Long> checkGoodsStudy(UserPeriodQueryBo bo) {
- return AjaxResult.success(iUserPeriodService.checkGoodsStudy(bo));
- }
- /**
- * 查询班级信息推送数量
- */
- @ApiOperation("查询班级信息推送数量")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/officialInfoCount")
- public AjaxResult<Map<String,Object>> officialInfoCount(ClassGradeUserQueryBo bo) {
- return AjaxResult.success(iClassGradeUserService.selectOfficialInfoCount(bo));
- }
- /**
- * 查询班级学时推送数量
- */
- @ApiOperation("查询班级学时推送数量")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/officialPeriodCount")
- public AjaxResult<Long> officialPeriodCount(ClassGradeUserQueryBo bo) {
- return AjaxResult.success(iClassGradeUserService.selectOfficialPeriodCount(bo));
- }
- /**
- * 批量打回待审核状态
- */
- @ApiOperation("批量打回待审核状态")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "批量打回待审核状态", businessType = BusinessType.UPDATE)
- @PostMapping("/rollbackPeriod")
- public AjaxResult<Void> rollbackPeriod(@RequestBody UserPeriodEditBo bo) {
- return toAjax(iUserPeriodService.rollbackPeriod(bo) ? 1 : 0);
- }
- /**
- * 锁定学时审核页面
- */
- @ApiOperation("锁定学时审核页面")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @PostMapping("/lockPeriod")
- public AjaxResult<Void> lockPeriod(@RequestBody UserPeriodEditBo bo) {
- String key = "LockPeriod_"+bo.getGradeId()+"-"+bo.getUserId();
- redisCache.setCacheObject(key, SecurityUtils.getUsername(),15, TimeUnit.SECONDS);//15秒锁定
- return AjaxResult.success();
- }
- /**
- * 查看学时审核锁定状态
- */
- @ApiOperation("查看学时审核锁定状态")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "查看学时审核锁定状态", businessType = BusinessType.UPDATE)
- @PostMapping("/lockPeriodStatus")
- public AjaxResult<Void> lockPeriodStatus(@RequestBody UserPeriodEditBo bo) {
- String key = "LockPeriod_"+bo.getGradeId()+"-"+bo.getUserId();
- String username = redisCache.getCacheObject(key);
- if(SecurityUtils.getUsername().equals(username)){
- username = null;//同个用户不返回
- }
- return AjaxResult.success(username);
- }
- /**
- * 查询学习账号标记列表
- */
- @ApiOperation("查询学习账号标记列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listStudyAccountStatus")
- public TableDataInfo<StudyAccountStatusVo> listStudyAccountStatus(StudyAccountStatusQueryBo bo) {
- List<StudyAccountStatusVo> list = iClassGradeUserService.listStudyAccountStatus(bo);
- return getDataTable(getPageInfo(bo.getPageNum(), bo.getPageSize(), list).getList());
- }
- /**
- * 导出学习账号标记列表
- */
- @ApiOperation("导出学习账号标记列表")
- @PreAuthorize("@ss.hasPermi('system:profile:export')")
- @Log(title = "导出学员学时列表", businessType = BusinessType.EXPORT)
- @GetMapping("/exportStudyAccount")
- public AjaxResult<Map<String,Object>> exportStudyAccount(ClassGradeUserQueryBo bo) {
- bo.setUserPhoto(1);
- Map<String,Object> map = new HashMap<>();
- List<ClassGradeStudentVo> list = iClassGradeService.listGrade(bo);
- List<StudyAccountStatusExportVo> newList = new ArrayList<>();
- for (ClassGradeStudentVo classGradeStudent : list) {
- StudyAccountStatusExportVo studyAccountStatusExportVo = new StudyAccountStatusExportVo();
- BeanUtils.copyProperties(classGradeStudent, studyAccountStatusExportVo);
- newList.add(studyAccountStatusExportVo);
- }
- map.put("list", newList);
- ExcelUtil<StudyAccountStatusExportVo> util = new ExcelUtil<>(StudyAccountStatusExportVo.class);
- return util.exportExcel(newList,"学习账号标记");
- /*ExportParams deptExportParams = new ExportParams();
- // 设置sheet得名称
- deptExportParams.setSheetName("表1");
- String timeStr= LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
- Map<String, Object> deptExportMap = new HashMap<>();
- deptExportMap.put("title", deptExportParams);
- deptExportMap.put("entity", StudyAccountStatusExportVo.class);
- // sheet中要填充得数据
- deptExportMap.put("data", list);
- List<Map<String, Object>> sheetsList = new ArrayList<>();
- sheetsList.add(deptExportMap);
- map.put("excel",util.exportEasyExcel(sheetsList, "学习账号标记"+timeStr));
- map.remove("list");
- return AjaxResult.success(map);*/
- }
- /**
- * 数据批量同步到官方系统
- */
- @ApiOperation("数据批量同步到官方系统")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "数据批量同步到官方系统", businessType = BusinessType.UPDATE)
- @PostMapping("/OpenQdyAccount")
- public AjaxResult<Void> OpenQdyAccount(@RequestBody OpenQdyAccountBo bo) {
- return toAjax(iClassGradeService.OpenQdyAccount(bo) ? 1 : 0);
- }
- /**
- * 发送验证码
- */
- @ApiOperation("发送验证码")
- @PostMapping("/sendCode")
- public AjaxResult<Void> OpenQdyAccount() {
- return toAjax(iClassGradeService.sendCode() ? 1 : 0);
- }
- @ApiOperation("二审打回重审")
- @PostMapping("/confirm/rollbackPeriod")
- public AjaxResult<Void> confirmRollbackPeriod(@RequestBody UserPeriodEditBo bo)
- {
- bo.setRollBackPlat(1);
- iUserPeriodService.confirmRollbackPeriod(bo);
- return AjaxResult.success();
- }
- @ApiOperation("获取官方班级人数")
- @Log(title = "获取官方班级人数", businessType = BusinessType.UPDATE)
- @GetMapping("/officialGradeCount")
- public AjaxResult<Integer> queryOfficialGradeCount(ClassGradeQueryBo bo) {
- return AjaxResult.success(iClassGradeService.queryOfficialGradeCount(bo));
- }
- @ApiOperation("导出商品的课程结构")
- @GetMapping("/exportGoodsMenuExcel")
- public AjaxResult<List<ClassNpUserInfoVo>> exportGoodsMenuExcel(UserPeriodEditBo bo) {
- GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
- List<SyncUserChapterExport> list = iUserPeriodService.exportGoodsMenuExcel(bo);
- List<SyncUserChapterExport> exportVos = list.stream().map(item -> BeanUtil.toBean(item,SyncUserChapterExport.class)).collect(Collectors.toList());
- ExcelUtil<SyncUserChapterExport> util = new ExcelUtil<SyncUserChapterExport>(SyncUserChapterExport.class);
- return util.exportExcel(exportVos, goodsVo.getGoodsName());
- }
- }
|