Explorar el Código

院校,专业,职业三库移植

mingfu hace 1 mes
padre
commit
7afc80bc8f

+ 64 - 2
ie-admin/src/main/java/com/ruoyi/web/controller/front/CommController.java

@@ -2,15 +2,21 @@ package com.ruoyi.web.controller.front;
 
 
 import com.alibaba.fastjson2.JSONObject;
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.constant.CacheConstants;
+import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.utils.PhoneUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.vod.VodPlayAuthDto;
+import com.ruoyi.common.vod.VodUtils;
+import com.ruoyi.common.vod.VodZlsjsUtils;
 import com.ruoyi.dz.domain.DzCards;
 import com.ruoyi.dz.service.IDzCardsService;
 import com.ruoyi.enums.SmsTypeEnum;
@@ -21,7 +27,7 @@ import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.ShortMessageService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.compress.utils.Lists;
 import org.springframework.web.bind.annotation.*;
@@ -31,6 +37,7 @@ import java.util.stream.Collectors;
 
 @RestController("/front/comm")
 @Api(tags = "前台-公共")
+@Slf4j
 public class CommController {
     private final ISysDictTypeService dictTypeService;
     private final ShortMessageService shortMessageService;
@@ -38,14 +45,18 @@ public class CommController {
     private final ISysUserService userService;
     private final ISysConfigService configService;
     private final IDzCardsService cardsService;
+    private final VodUtils vodUtils;
+    private final VodZlsjsUtils vodZlsjsUtils;
 
-    public CommController(ISysDictTypeService dictTypeService, ShortMessageService shortMessageService, RedisCache redisCache, ISysUserService userService, ISysConfigService configService, IDzCardsService cardsService) {
+    public CommController(ISysDictTypeService dictTypeService, ShortMessageService shortMessageService, RedisCache redisCache, ISysUserService userService, ISysConfigService configService, IDzCardsService cardsService, VodUtils vodUtils, VodZlsjsUtils vodZlsjsUtils) {
         this.dictTypeService = dictTypeService;
         this.shortMessageService = shortMessageService;
         this.redisCache = redisCache;
         this.userService = userService;
         this.configService = configService;
         this.cardsService = cardsService;
+        this.vodUtils = vodUtils;
+        this.vodZlsjsUtils = vodZlsjsUtils;
     }
 
     @GetMapping(value = "dict/{dictTypes}")
@@ -170,4 +181,55 @@ public class CommController {
         }
         return true;
     }
+
+    @GetMapping("/vod/getVideoPlayAuth")
+    @ApiOperation("获取视频点播授权")
+    public AjaxResult getVideoPlayAuth(String videoId) throws Exception {
+        VodPlayAuthDto dto = new VodPlayAuthDto();
+        try {
+            dto = vodUtils.getVideoPlayAuth(videoId);
+        }catch (Exception e){
+            log.error(e.toString());
+        }
+        return AjaxResult.success(dto);
+    }
+
+    @GetMapping("/vod/getVideoPlayInfo")
+    @ApiOperation("获取视频播放信息")
+    public AjaxResult getVideoPlayInfo(String videoId) throws Exception {
+        GetPlayInfoResponse response = new GetPlayInfoResponse();
+        //智隆叁加叁的vod为 “zlsjs,” 开头
+        Boolean isZlsjs=true;
+        try {
+            if(videoId.startsWith(Constants.ZLSJS_PREFIX)|| Convert.toStrArray(videoId).length==2){
+                videoId = Convert.toStrArray(videoId)[1];
+                response = vodZlsjsUtils.getPlayInfo(videoId);
+            }else {
+                isZlsjs=false;
+                response = vodUtils.getPlayInfo(videoId);
+            }
+        }catch (Exception e){
+            if(isZlsjs){
+                response = vodUtils.getPlayInfo(videoId);
+            }else {
+                response = vodZlsjsUtils.getPlayInfo(videoId);
+            }
+        }
+
+        if(StringUtils.isNotNull(response)&& !org.springframework.util.CollectionUtils.isEmpty(response.getPlayInfoList())){
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("videoId",videoId);
+            jsonObject.put("palyUrl",response.getPlayInfoList().get(0).getPlayURL());
+            jsonObject.put("duration",response.getPlayInfoList().get(0).getDuration());
+            jsonObject.put("coverUrl",StringUtils.EMPTY);
+            if(StringUtils.isNotNull(response.getVideoBase())){
+                jsonObject.put("coverUrl",response.getVideoBase().getCoverURL());
+                jsonObject.put("title",response.getVideoBase().getTitle());
+                jsonObject.put("videoId",response.getVideoBase().getVideoId());
+            }
+
+            return AjaxResult.success(jsonObject);
+        }
+        return AjaxResult.error("未找到有效的url");
+    }
 }

+ 130 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontSyMajorController.java

@@ -0,0 +1,130 @@
+package com.ruoyi.web.controller.front;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.mxjb.domain.MxjbContants;
+import com.ruoyi.sy.domain.SyTestExaminee;
+import com.ruoyi.web.domain.CategoryDto;
+import com.ruoyi.web.domain.PaperDto;
+import com.ruoyi.web.service.CacheService;
+import com.ruoyi.web.service.SyTestMajorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@Api(tags = "前端 测试选专业")
+@RestController
+@RequestMapping("front/test/major/")
+public class FrontSyMajorController extends BaseController {
+    private final SyTestMajorService syTestMajorService;
+    private final CacheService cacheService;
+
+    public FrontSyMajorController(SyTestMajorService syTestMajorService, CacheService cacheService) {
+        this.syTestMajorService = syTestMajorService;
+        this.cacheService = cacheService;
+    }
+
+    @ApiOperation("01 查询测试历史")
+    @GetMapping(value = "getTestList")
+    public TableDataInfo getTestList(@ApiParam("1价值2职业3知识") @RequestParam Integer testType) {
+        List<SyTestExaminee> examineeList = syTestMajorService.getTestList(testType);
+        return getDataTable(examineeList);
+    }
+
+    @ApiOperation("02 查询测试内容")
+    @GetMapping(value = "loadExamineePaper")
+    public PaperDto loadExamineePaper(@ApiParam("测试用户id") @RequestParam Long examineeId) {
+        PaperDto paperDto = syTestMajorService.loadPaperByExaminerId(examineeId);
+        Map<String, String> stateMap = cacheService.selectDictDataMapByType(MxjbContants.StateTypeExaminee);
+        paperDto.setStateStr(stateMap.get(String.valueOf(paperDto.getState())));
+        paperDto.calculateAllow();
+        return paperDto;
+    }
+
+    /**
+     * 提取测试结果
+     * @param testType
+     * @return
+     */
+    @ApiOperation("03 提取测试结果")
+    @GetMapping(value = "getTestMajorResult")
+    public AjaxResult loadTestMajorResult(@ApiParam("1价值2职业3知识") @RequestParam(required = false) Integer testType,
+                                          @ApiParam("用户代码") @RequestParam(required = false) Long examineeId) {
+        try {
+            if (null != examineeId) {
+                return syTestMajorService.loadTestMajorResult(examineeId);
+            }
+            return syTestMajorService.loadTestMajorResult(testType, SecurityUtils.getLoginUser().getUser().getCode());
+        } catch (JsonProcessingException e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 提取测试结果涉及的专业树
+     * @param testType
+     * @param matchCode
+     * @param level
+     * @return
+     */
+    @ApiOperation("04 提取测试结果涉及的一二级专业")
+    @GetMapping(value = "getMatchCategoryTree")
+    public AjaxResult loadMatchCategoryTree(@ApiParam("1价值2职业3知识") @RequestParam Integer testType,
+                                            @ApiParam("匹配代码") @RequestParam String matchCode,
+                                            @ApiParam("级次") @RequestParam(required = false) Integer level) {
+        return syTestMajorService.loadMatchCategoryTree(testType, matchCode, level);
+    }
+
+    /**
+     * 根据用户的选科返回所有一二三级专业
+     *
+     * @return
+     */
+    @ApiOperation("05 提取测试结果涉及的一二三级专业树")
+    @GetMapping(value = "getSelectMajorSubjectTree")
+    public AjaxResult loadSelectMajorSubjectTree() {
+        return syTestMajorService.loadSelectMajorSubjectTree();
+    }
+
+    @ApiOperation("05 提取所有的一二三级专业树")
+    @GetMapping(value = "loadAllMajorSubjectTree")
+    public AjaxResult loadAllMajorSubjectTree() {
+        return syTestMajorService.loadAllMajorSubjectTree();
+    }
+
+    @ApiOperation("06 保存选择的专业类")
+    @PostMapping(value = "saveUserSelectedCategory")
+    public AjaxResult saveUserSelectedCategory(@RequestBody CategoryDto.UserCategory param) {
+        return syTestMajorService.saveUserSelectedCategory(param);
+    }
+
+    @ApiOperation("07 保存选择的专业")
+    @PostMapping(value = "saveUserSelectedMajor")
+    public AjaxResult saveUserSelectedMajor(@RequestBody CategoryDto.UserMajor param) {
+        return syTestMajorService.saveUserSelectedMajor(param);
+    }
+
+    @ApiOperation("07 查询选择的专业")
+    @PostMapping(value = "getUserSelectedMajor")
+    public AjaxResult getUserSelectedMajor() {
+        return syTestMajorService.getUserSelectedMajor();
+    }
+
+    @ApiOperation("08 查询所有测试结果及选专业")
+    @PostMapping(value = "getAllTestMajorResult")
+    public AjaxResult getAllTestMajorResult() {
+        try {
+            return syTestMajorService.getAllTestMajorResult();
+        } catch (JsonProcessingException e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+}

+ 271 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontSyMajorRelationController.java

@@ -0,0 +1,271 @@
+package com.ruoyi.web.controller.front;
+
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.text.Convert;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.sy.domain.*;
+import com.ruoyi.sy.service.ISyMajorCareerProspectsService;
+import com.ruoyi.sy.service.ISyMajorOverviewService;
+import com.ruoyi.sy.service.ISyMajorService;
+import com.ruoyi.sy.service.ISyVocationalService;
+import com.ruoyi.syzy.domain.BCustomerMarjors;
+import com.ruoyi.syzy.domain.TreeSelectVocational;
+import com.ruoyi.syzy.dto.UniversitiesCondDTO;
+import com.ruoyi.syzy.service.IBBusiWishUniversitiesService;
+import com.ruoyi.syzy.service.IBCustomerMarjorsService;
+import com.ruoyi.util.ConstantUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Api(tags = "专业")
+@RestController
+@RequestMapping("front/major/")
+public class FrontSyMajorRelationController extends BaseController {
+    @Autowired
+    private ISyMajorCareerProspectsService majorCareerProspectsService;
+    @Autowired
+    private ISyMajorOverviewService syMajorOverviewService;
+    @Autowired
+    private ISyMajorService syMajorService;
+    @Autowired
+    private ISyVocationalService vocationalService;
+    @Autowired
+    private FrontUniversitiesController universitiesController;
+    @Autowired
+    private IBCustomerMarjorsService customerMarjorsService;
+    @Autowired
+    private IBBusiWishUniversitiesService universitiesService;
+
+    /**
+     * code在此处表示专业编码 name表示学校名称
+     * @param code
+     * @return
+     */
+    @GetMapping("getUniversityByCode")
+    @ApiOperation("03 根据专业查找所开设院校--废弃")
+    public TableDataInfo getUniversityByCode(@RequestParam(required = true) String code,
+                                             @ApiParam(value = "页数", example = "1") @RequestParam Integer pageNum,
+                                             @ApiParam(value = "页大小", example = "15") @RequestParam Integer pageSize) {
+//        List<BBusiWishUniversitiesProfession> syMajorUniversityList = universitiesService.selectBBusiWishUniversitiesProfessionByCode(code);
+        UniversitiesCondDTO cond = new UniversitiesCondDTO();
+        cond.setMajorCodes(code);
+        //是否收藏
+        return universitiesController.getUniversitiesList(cond,SecurityUtils.getLoginUser().getUser().getLocation(),pageNum,pageSize);
+    }
+
+    @GetMapping("getMajorOverviewByCode")
+    @ApiOperation("02 根据三级专业编码获取专业概况")
+    public AjaxResult getMajorOverviewByCode(@RequestParam(required = true) String code) {
+        code = StringUtils.getNumeric(code);//过滤字母
+        String examTypeData = ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title());
+        SyMajorOverview syMajorOverview = syMajorOverviewService.selectSyMajorOverviewByCode(examTypeData, code);
+        if(StringUtils.isNull(syMajorOverview)){
+            return AjaxResult.success(new SyMajorCareerProspects());
+        }
+        //是否收藏
+        SyMajor syMajor = syMajorService.selectSyMajorByCode(code);
+        Boolean isCollect = false;
+        if(null!=syMajor){
+            syMajorOverview.setMarjorId(syMajor.getId());
+            BCustomerMarjors query = new BCustomerMarjors().setStatus(1).setMarjorId(syMajor.getId()).setCustomerCode(SecurityUtils.getLoginUser().getUser().getCode());
+            if(CollectionUtils.isNotEmpty(customerMarjorsService.selectBCustomerMarjorsList(query))){
+                isCollect = true;
+            }
+        }
+        syMajorOverview.setIsCollect(isCollect);
+
+        return AjaxResult.success(syMajorOverview);
+    }
+
+    @GetMapping("getMajorOverviewByCodes")
+    @ApiOperation("02-1 根据三级专业编码获取专业概况")
+    public AjaxResult getMajorOverviewByCodes(@RequestParam(required = true) String codes) {
+        if(StringUtils.isBlank(codes)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+        List<String> codeList= Arrays.asList(Convert.toStrArray(codes));
+        List<String> codeQueryList = new ArrayList<>();
+        //过滤字母
+        for (String cc : codeList) {
+            if(cc.length()<6){
+                continue;
+            }
+            codeQueryList.add(StringUtils.getNumeric(cc));
+        }
+        String examTypeData = ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title());
+        List<SyMajorOverview> resultList = syMajorOverviewService.selectSyMajorOverviewByCodes(examTypeData, codeQueryList);
+        if(CollectionUtils.isEmpty(resultList)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+
+        return AjaxResult.success(resultList);
+    }
+
+    @GetMapping("getMajorCareerProspectsByCode")
+    @ApiOperation("01 根据三级专业编码获取职业前景")
+    public AjaxResult getMajorCareerProspectsByCode(@RequestParam(required = true) String code) {
+        code = StringUtils.getNumeric(code);//过滤字母
+        SyMajorCareerProspects majorCareerProspects = majorCareerProspectsService.selectSyMajorCareerProspectsByCode(code);
+        if(StringUtils.isNull(majorCareerProspects)){
+            return AjaxResult.success(new SyMajorCareerProspects());
+        }
+        return AjaxResult.success(majorCareerProspects);
+    }
+
+    @GetMapping("getMajorCareerProspectsByCodes")
+    @ApiOperation("01-2 根据三级专业编码获取职业前景")
+    public AjaxResult getMajorCareerProspectsByCodes(@RequestParam(required = true) String codes) {
+        if(StringUtils.isBlank(codes)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+        List<String> codeList= Arrays.asList(Convert.toStrArray(codes));
+        List<String> codeQueryList = new ArrayList<>();
+        //过滤字母
+        for (String cc : codeList) {
+            if(cc.length()<6){
+                continue;
+            }
+            codeQueryList.add(StringUtils.getNumeric(cc));
+        }
+        List<SyMajorCareerProspects> resultList = majorCareerProspectsService.selectSyMajorCareerProspectsByCodes(codeQueryList);
+        if(CollectionUtils.isEmpty(resultList)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+
+        return AjaxResult.success(resultList);
+    }
+
+    @GetMapping("getMajorDetailByCodes")
+    @ApiOperation("02-1 根据三级专业编码获取专业概况及职业前景")
+    public AjaxResult getMajorDetailByCodes(@RequestParam(required = true) String codes) {
+        if(StringUtils.isBlank(codes)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+        List<String> codeList= Arrays.asList(Convert.toStrArray(codes));
+        List<String> codeQueryList = new ArrayList<>();
+        //过滤字母
+        for (String cc : codeList) {
+            if(cc.length()<6){
+                continue;
+            }
+            codeQueryList.add(StringUtils.getNumeric(cc));
+        }
+
+        if(CollectionUtils.isEmpty(codeQueryList)){
+            return AjaxResult.success(new ArrayList<>());
+        }
+        String examTypeData = ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title());
+        Map<String, SyMajorOverview> overviewMap = syMajorOverviewService.selectSyMajorOverviewByCodes(examTypeData, codeQueryList)
+                .stream().collect(Collectors.toMap(SyMajorOverview::getCode, Function.identity()));
+
+        Map<String,SyMajorCareerProspects> prospectsMap = majorCareerProspectsService.selectSyMajorCareerProspectsByCodes(codeQueryList)
+                .stream().collect(Collectors.toMap(SyMajorCareerProspects::getCode, Function.identity()));
+
+        List<SyMajorDetail> resultList = new ArrayList<>();
+        for (String code : codeQueryList) {
+            SyMajorDetail detail = new SyMajorDetail();
+            detail.setCode(code);
+            detail.setOverview(overviewMap.containsKey(code)?overviewMap.get(code):new SyMajorOverview());
+            detail.setProspects(prospectsMap.containsKey(code)?prospectsMap.get(code):new SyMajorCareerProspects());
+            resultList.add(detail);
+        }
+
+        return AjaxResult.success(resultList);
+    }
+
+    /**
+     * @param type
+     * @param level 传3时表示需要1 2 3级的专业树 传2表示需要1 2 级专业树
+     * @param batch:批次,4表示专科,小于4为本科
+     * @return
+     */
+    @GetMapping("getAllMajor")
+    @ApiOperation("00 获取所有专业(三级树形结构)")
+    public AjaxResult getAllMajor(String type,Integer level,String parentCode,Integer batch) {
+        SyMajor query = new SyMajor().setLevel(level).setParentCode(parentCode);
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if(StringUtils.isNotBlank(type)) {
+            if("高职本科".equals(type)) {
+                query.setType("职教本科");
+            } else {
+                query.setType(type);
+            }
+        } else if(null != batch) {
+            query.setType(batch >= 4 ? "专科" : "本科");
+        }
+        query.setExamType(ConstantUtil.getExamTypeData(user.getExamType().title()));
+        List<SyMajor> majorList = syMajorService.selectSyMajorList(query);
+        List<SyVocational> toList = new ArrayList<>();
+        majorList.forEach(major->{
+            SyVocational syVocational=new SyVocational();
+            BeanUtils.copyProperties(major,syVocational);
+            toList.add(syVocational);
+        });
+        return AjaxResult.success(vocationalService.buildVocationalTreeSelect(toList));
+    }
+
+    /**
+     * level为0时 level>0 即返回1、2、3级数据;level为1时 level>1 即返回2、3级数据
+     * @param name
+     * @param level
+     * @return
+     */
+    @GetMapping("getMajorByName")
+    @ApiOperation("00 获取专业及子结构 适用于二级与三级")
+    public AjaxResult getMajorByName(@ApiParam("专业名称") @RequestParam String name, @ApiParam("type") @RequestParam(required = false) String type, @ApiParam("层级") @RequestParam Integer level,
+                                     Integer batch) {
+        SyMajor query = new SyMajor().setName(name);
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if(StringUtils.isNotBlank(type)) {
+            if("高职本科".equals(type)) {
+                query.setType("职教本科");
+            } else {
+                query.setType(type);
+            }
+        } else if(null != batch) {
+            query.setType(batch >= 4 ? "专科" : "本科");
+        }
+        String examTypeData = ConstantUtil.getExamTypeData(user.getExamType().title());
+        query.setExamType(examTypeData);
+        List<SyMajor> majorList = syMajorService.selectSyMajorList(query).stream().filter(major->major.getLevel()>level).collect(Collectors.toList());
+        List<TreeSelectVocational> resultList = new ArrayList<>();
+
+        majorList.forEach(ll->{
+            //获取
+            List<SyMajor> syMajors =syMajorService.selectSyMajorAndChildrenByCode(new SyMajor().setCode(ll.getCode()).setLevel(level).setExamType(examTypeData));
+            if(CollectionUtils.isNotEmpty(syMajors)){
+                List<SyVocational> toList = new ArrayList<>();
+                syMajors.forEach(major->{
+                    SyVocational syVocational=new SyVocational();
+                    BeanUtils.copyProperties(major,syVocational);
+                    toList.add(syVocational);
+                });
+                List<TreeSelectVocational> llist = vocationalService.buildVocationalTreeSelect(toList);
+                resultList.addAll(llist);
+            }
+
+        });
+
+        return AjaxResult.success(resultList);
+    }
+}

+ 101 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontSyVocationalController.java

@@ -0,0 +1,101 @@
+package com.ruoyi.web.controller.front;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.sy.domain.*;
+import com.ruoyi.sy.service.*;
+import com.ruoyi.web.service.SyTestMajorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Set;
+
+@Api(tags = "职业")
+@RestController
+@RequestMapping("front/vocational/")
+public class FrontSyVocationalController extends BaseController {
+    @Autowired
+    private ISyVocationalService vocationalService;
+    @Autowired
+    private ISyVocationalOverviewService vocationalOverviewService;
+    @Autowired
+    private ISyVocationalPostService vocationalPostService;
+    @Autowired
+    private ISyVocationalPostDetailService vocationalPostDetailService;
+    @Autowired
+    private ISyVocationalHitsLackService vocationalHitsLackService;
+    @Autowired
+    private SyTestMajorService syTestMajorService;
+
+    @GetMapping("getVocationalPostDetailByPostName")
+    @ApiOperation("05 根据就业岗位名称获取岗位详情")
+    public AjaxResult getVocationalPostDetailByPostName(@RequestParam(required = true) String postName) {
+        SyVocationalPostDetail vocationalPostDetail = vocationalPostDetailService.selectSyVocationalPostDetailByName(postName);
+        return AjaxResult.success(vocationalPostDetail);
+    }
+
+    @GetMapping("getVocationalPosts")
+    @ApiOperation("04 获取就业岗位")
+    public AjaxResult getVocationalPosts(@RequestParam(required = true) String code) {
+        List<SyVocationalPost> vocationalPost = vocationalPostService.selectSyVocationalPostByVocationalCode(code);
+        return AjaxResult.success(vocationalPost);
+    }
+
+    @GetMapping("getVocationalOverview")
+    @ApiOperation("03 获取职业概况")
+    public AjaxResult getVocationalOverview(@RequestParam String code) {
+        SyVocationalOverview vocationalOverview = vocationalOverviewService.selectSyVocationalOverviewByCode(code);
+        JSONArray marjorList = new JSONArray();
+        Set<String> marjorCodeSet = syTestMajorService.loadMarjorCodes();
+        vocationalOverview.getPostMajors().forEach(t -> {
+            if (marjorCodeSet.contains(((JSONObject) t).getString("code"))) {
+                marjorList.add(t);
+            }
+        });
+        vocationalOverview.setPostMajors(marjorList.toString());
+        return AjaxResult.success(vocationalOverview);
+    }
+
+    @GetMapping("getAllVocation")
+    @ApiOperation("02 获取所有职业(三级树形结构)")
+    public AjaxResult getAllVocation(String name,@ApiParam("层级")  Integer level) {
+        SyVocational query = new SyVocational();
+        if(StringUtils.isNotBlank(name)){
+            query.setName(name).setLevel(3);//只能搜索三级职业名称
+        }
+        List<SyVocational> vocationalList = vocationalService.selectSyVocationalList(query);
+        return AjaxResult.success(vocationalService.buildVocationalTreeSelect(vocationalList));
+    }
+
+    @GetMapping("getVocationByParentCode")
+    @ApiOperation("02-2 根据父级编码获取子职业")
+    public AjaxResult getVocationByParentCode(@RequestParam String parentCode) {
+        List<SyVocational> vocationalList = vocationalService.selectSyVocationalList(new SyVocational().setParentCode(parentCode));
+        return AjaxResult.success(vocationalList);
+    }
+
+    @GetMapping("getVocationHot")
+    @ApiOperation("01 热门/紧缺职业排名")
+    public TableDataInfo getVocationalHot(@ApiParam(value = "职业类型(1热门职业,2紧缺职业) ", example = "1") @RequestParam Integer type,
+        @ApiParam(value = "页数", example = "1") @RequestParam Integer pageNum,
+        @ApiParam(value = "页大小", example = "5") @RequestParam Integer pageSize ) {
+        SyVocationalHitsLack query = new SyVocationalHitsLack();
+        query.setType(type);
+        startPage();
+        List<SyVocationalHitsLack > list = vocationalHitsLackService.selectSyVocationalHitsLackList(query);
+
+        return getDataTable(list);
+    }
+}

+ 350 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontUniversitiesController.java

@@ -0,0 +1,350 @@
+package com.ruoyi.web.controller.front;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.service.ISysDictTypeService;
+import com.ruoyi.syzy.domain.*;
+import com.ruoyi.syzy.dto.UniversitiesCondDTO;
+import com.ruoyi.syzy.dto.UniversityDetailDTO;
+import com.ruoyi.syzy.service.*;
+import com.ruoyi.util.ConstantUtil;
+import com.ruoyi.web.domain.Constant;
+import com.ruoyi.web.service.CommService;
+import com.ruoyi.web.service.VoluntaryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@Api(tags = "院校库")
+@RequestMapping("front/university")
+public class FrontUniversitiesController extends BaseController {
+
+    @Autowired
+    private IBBusiWishUniversitiesImageService universitiesImageService;
+    @Autowired
+    private IBBusiWishUniversitiesEnrollBrochureService universitiesEnrollBrochureService;
+    @Autowired
+    private IBBusiWishUniversitiesService universitiesService;
+    @Autowired
+    private IBBusiWishUniversitiesRankingService universitiesRankingService;
+    @Autowired
+    public ISysDictTypeService dictTypeService;
+    @Autowired
+    private IBCustomerUniversitiesService customerUniversitiesService;
+    @Autowired
+    private VoluntaryService voluntaryService;
+    @Autowired
+    private IBBusiWishUniversitySubmitMarjorsService wishUniversitySubmitMarjorsService;
+    @Autowired
+    private IBBusiWishUniversitySubmitRecruitPlanService wishUniversitySubmitRecruitPlanService;
+    @Autowired
+    private CommService commService;
+
+    @GetMapping("filters")
+    @ApiOperation("00 院校列表数据筛选项")
+    public AjaxResult filters() {
+        String entranceType = ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title());
+        JSONObject data = new JSONObject(true);
+        data.put("locations", universitiesService.getLocations(entranceType));
+        data.put("natureTypes", universitiesService.getNatureTypeCN(entranceType));//办学性质:公办民办
+        data.put("types", universitiesService.getTypes(entranceType));//院校类别
+//        data.put("levels", universitiesService.getLevels());
+        data.put("features", universitiesService.getFeatures(entranceType));//等级
+        data.put("bxTypes", universitiesService.getBxTypes(entranceType));//双高院校
+        //竞争力星级
+        Map<String,String> map = dictTypeService.selectDictDataByType("university_stars")
+                .stream().collect(Collectors.toMap(t -> t.getDictValue(), SysDictData::getDictLabel));
+        map.entrySet().stream().sorted(Map.Entry.comparingByKey());
+//                .forEachOrdered(x -> map.put(x.getKey(), x.getValue()));
+        data.put("stars", map);
+        return AjaxResult.success(data);
+    }
+
+    @GetMapping("locations")
+    @ApiOperation("00 院校列表数据筛选项-地域 回传location")
+    public AjaxResult locations() {
+        return AjaxResult.success(universitiesService.getLocations(ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title())));
+    }
+
+    @GetMapping("natureTypes")
+    @ApiOperation("00 院校列表数据筛选项-主管部门类型 回传natureTypeCN")
+    public AjaxResult natureTypes() {
+        return AjaxResult.success(universitiesService.getNatureTypeCN(ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title())));
+    }
+
+    @GetMapping("types")
+    @ApiOperation("00 院校列表数据筛选项-院校类型 回传type")
+    public AjaxResult types() {
+        return AjaxResult.success(universitiesService.getTypes(ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title())));
+    }
+
+    @GetMapping("levels")
+    @ApiOperation("00 院校列表数据筛选项-学历层次 回传level")
+    public AjaxResult levels() {
+        return AjaxResult.success(universitiesService.getLevels(ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title())));
+    }
+
+    @GetMapping("features")
+    @ApiOperation("00 院校列表数据筛选项-院校类型 回传features")
+    public AjaxResult features() {
+        return AjaxResult.success(universitiesService.getFeatures(ConstantUtil.getExamTypeData(SecurityUtils.getLoginUser().getUser().getExamType().title())));
+    }
+
+    @GetMapping("listNoToken")
+    @ApiOperation("01 院校列表")
+    public TableDataInfo listNoToken(UniversitiesCondDTO cond, @ApiParam(value = "页数", example = "1") @RequestParam Integer pageNum,
+                                     @ApiParam(value = "页大小", example = "15") @RequestParam Integer pageSize) {
+        return getUniversitiesList(cond,null,  pageNum, pageSize);
+    }
+
+    @GetMapping("list")
+    @ApiOperation("01 院校列表")
+    public TableDataInfo list(UniversitiesCondDTO cond, @ApiParam(value = "页数", example = "1") @RequestParam Integer pageNum,
+                              @ApiParam(value = "页大小", example = "15") @RequestParam Integer pageSize) {
+        String location = SecurityUtils.getLoginUser().getUser().getLocation();
+        if(StringUtils.isNotBlank(location)){
+            location = location+",全国";
+        }
+        return getUniversitiesList(cond,location,  pageNum, pageSize);
+    }
+
+    public TableDataInfo getUniversitiesList(UniversitiesCondDTO cond,String location, Integer pageNum,Integer pageSize){
+        if (StringUtils.isNumber(cond.getName())) {
+            cond.setCode(cond.getName());
+            cond.setName(null);
+        }
+        if (null != cond.getFilterRank() && cond.getFilterRank()) {
+            cond.setOrderBy(" star desc, code");
+        } else {
+            cond.setFilterRank(null);
+            cond.setOrderBy(StringUtils.isNotBlank(cond.getOrderBy()) ? cond.getOrderBy() : "code");
+        }
+        cond.setEnrollLocation(location);
+        startPage();
+        List<BBusiWishUniversities> arr;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        Integer planYear = voluntaryService.getPlanYear(user);
+        if(Constant.EXAM_TYPE_ZG.equals(user.getExamType())) {
+            arr = universitiesService.selectMajorWishUniversitiesListSimpleByMap2(cond.toCondMap(planYear, user.getExamType().title(), user.getSelectSubject(), user.getLocation())); // TODO MF
+        } else {
+            arr = universitiesService.selectMajorWishUniversitiesListSimpleByMap(cond.toCondMap(planYear, Constant.EXAM_TYPE_PG, null, user.getLocation()));
+        }
+        //处理院校星级竞争力
+        arr.stream().forEach(t -> {
+            if(StringUtils.isNotEmpty(t.getStar())){
+                t.setStar(dictTypeService.getDictDataByType("university_stars",t.getStar()));
+            }
+        });
+        return getDataTable(arr);
+    }
+
+    @GetMapping("detail")
+    @ApiOperation("02 院校详情")
+    public AjaxResult detail(@ApiParam("学校code") @RequestParam String code) {
+        commService.requireVip();
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        UniversityDetailDTO data = universitiesService.detail(code, voluntaryService.getPlanYear(sysUser));
+        if(StringUtils.isNotEmpty(data.getBaseInfo().getStar())){
+            data.getBaseInfo().setStar(dictTypeService.getDictDataByType("university_stars",data.getBaseInfo().getStar()));
+        }
+        Long universityId = data.getBaseInfo().getId();
+        BCustomerUniversities cond = new BCustomerUniversities();
+        cond.setUniversityId(universityId);
+        cond.setCustomerCode(sysUser.getCode());
+        cond.setStatus(1L);
+        List<BCustomerUniversities> list = customerUniversitiesService.selectBCustomerUniversitiesList(cond);
+        data.getBaseInfo().setCollected(CollectionUtils.isNotEmpty(list));
+        this.saveUniversitiesClicks(code);
+
+        if(Constant.EXAM_TYPE_ZG.equals(sysUser.getExamType())) {
+            Integer examMajor = sysUser.getSelectSubject(); // TODO MF
+
+            BBusiWishUniversitySubmitRecruitPlan planCond = new BBusiWishUniversitySubmitRecruitPlan();
+            planCond.setUniversityId(universityId);
+            planCond.setLocation(sysUser.getLocation());
+            planCond.setLiberalScience(examMajor);
+            List<UniversityDetailDTO.WishPlan> planList = wishUniversitySubmitRecruitPlanService.selectBBusiWishUniversitySubmitRecruitPlanList(planCond).stream().map(t -> new UniversityDetailDTO.WishPlan(t)).collect(Collectors.toList());
+            data.setPlanHistories(planList);
+
+            BBusiWishUniversitySubmitMarjors submitCond = new BBusiWishUniversitySubmitMarjors();
+            submitCond.setUniversityId(universityId);
+            submitCond.setLocation(sysUser.getLocation());
+            submitCond.setLiberalScience(examMajor);
+            List<UniversityDetailDTO.WishSubmit> submitList = wishUniversitySubmitMarjorsService.selectBBusiWishUniversitySubmitMarjorsList(submitCond).stream().map(t -> new UniversityDetailDTO.WishSubmit(t)).collect(Collectors.toList());
+            data.setEnrollHistories(submitList);
+        } else if(Constant.EXAM_TYPE_PG.equals(sysUser.getExamType()) || Constant.EXAM_TYPE_ZZ.equals(sysUser.getExamType())) {
+            Pair<List<UniversityDetailDTO.WishPlan>, List<UniversityDetailDTO.WishSubmit>> pair = voluntaryService.getUniversityHistory(universityId, sysUser.getLocation(), sysUser.getExamType().title());
+            data.setPlanHistories(pair.getLeft());
+            data.setEnrollHistories(pair.getRight());
+        }
+        return AjaxResult.success(data);
+    }
+
+    @GetMapping("getUniversitiesEnrollBrochure")
+    @ApiOperation("03 招生简章")
+    public TableDataInfo getUniversitiesEnrollBrochure(@ApiParam("学校code") @RequestParam String code,
+                                                       @ApiParam("学校code")  String title) {
+        BBusiWishUniversitiesEnrollBrochure query = new BBusiWishUniversitiesEnrollBrochure();
+        query.setCollegeCode(code);
+        query.setTitle(title);
+        startPage();
+        List<BBusiWishUniversitiesEnrollBrochure> list = universitiesEnrollBrochureService.selectBBusiWishUniversitiesEnrollBrochureList(query);
+        return getDataTable(list);
+    }
+
+    @GetMapping("getUniversitiesEnrollBrochureDetail")
+    @ApiOperation("03-2 招生简章详情")
+    public AjaxResult getUniversitiesEnrollBrochure(@ApiParam("简章id") @RequestParam Long id) {
+        return AjaxResult.success(universitiesEnrollBrochureService.selectBBusiWishUniversitiesEnrollBrochureById(id));
+    }
+
+    @PostMapping("saveUniversitiesEnrollBrochureHits")
+    @ApiOperation("04-2 保存招生简章热度/点击")
+    public AjaxResult saveUniversitiesEnrollBrochureHits(@ApiParam("ID") @RequestParam Long id){
+        BBusiWishUniversitiesEnrollBrochure result = universitiesEnrollBrochureService.selectBBusiWishUniversitiesEnrollBrochureById(id);
+        result.setHits(null==result.getHits()?1:(result.getHits()+1));
+        universitiesEnrollBrochureService.updateBBusiWishUniversitiesEnrollBrochure(result);
+        return AjaxResult.success("保存成功");
+    }
+
+    //    @PostMapping("saveUniversitiesHits")
+//    @ApiOperation("04 保存院校热度/点击")
+    public AjaxResult saveUniversitiesClicks(@ApiParam("学校code") @RequestParam String code) {
+        BBusiWishUniversities result  = universitiesService.selectBBusiWishUniversitiesByCode(code);
+        if(null==result){
+            return AjaxResult.error("学校[ "+code+" ]不存在");
+        }
+        BBusiWishUniversities update = new BBusiWishUniversities();
+        update.setId(result.getId());
+        update.setHits(null==result.getHits()?1:(result.getHits()+1));
+        universitiesService.updateBBusiWishUniversities(update);
+        return AjaxResult.success();
+    }
+
+    @GetMapping("getUniversitiesHitsTopCount")
+    @ApiOperation("05 获取院校热度/点击 Top count")
+    public AjaxResult getUniversitiesHits(Integer count) {
+        BBusiWishUniversities exam = new BBusiWishUniversities();
+        exam.getParams().put("orderBy", "hits desc");
+        exam.getParams().put("limit", null==count?8:count);
+        List<BBusiWishUniversities> arr = universitiesService.selectBBusiWishUniversitiesListSimple(exam);
+        return AjaxResult.success(arr);
+    }
+
+    @GetMapping("getUniversitiesStyle")
+    @ApiOperation("06 获取院校风采")
+    public AjaxResult getUniversitiesStyle(@ApiParam("学校code") @RequestParam String code) {
+        BBusiWishUniversitiesImage query = new BBusiWishUniversitiesImage();
+        query.setCollegeCode(code);
+//        query.getParams().put("orderBy", "collegeCode,sort");
+        List<BBusiWishUniversitiesImage> list = universitiesImageService.selectBBusiWishUniversitiesImageList(query);
+        return AjaxResult.success(list);
+    }
+
+    @GetMapping("getUniversitiesRankingFilter")
+    @ApiOperation("07-1 获取院校排名筛选条件")
+    public AjaxResult getUniversitiesRankingFilter(String type) {
+        JSONObject result = new JSONObject();
+        result.put("types",universitiesRankingService.selectBBusiWishUniversitiesRankingTypes());
+        result.put("years",universitiesRankingService.selectBBusiWishUniversitiesRankingYears(type));
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("getUniversitiesRankingFilterYears")
+    @ApiOperation("07-1-1 获取院校排名筛选条件年份")
+    public AjaxResult getUniversitiesRankingFilterYears(String type) {
+        JSONObject result = new JSONObject();
+        result.put("years",universitiesRankingService.selectBBusiWishUniversitiesRankingYears(type));
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("getUniversitiesRanking")
+    @ApiOperation("07-2 获取院校排名")
+    public TableDataInfo getUniversitiesRanking(@ApiParam("排名类型") @RequestParam String type,
+                                                @ApiParam("年份") @RequestParam Integer year,@ApiParam("学校名称")  String collegeName) {
+
+        return getUniversitiesRankingList(type, year, collegeName);
+    }
+
+    @GetMapping("getUniversitiesRankingNoToken")
+    @ApiOperation("07-2 获取院校排名")
+    public TableDataInfo getUniversitiesRankingNoToken(@ApiParam("排名类型") @RequestParam String type,
+                                                       @ApiParam("年份") @RequestParam Integer year,@ApiParam("学校名称")  String collegeName) {
+
+        return getUniversitiesRankingList(type, year, collegeName);
+    }
+
+    private TableDataInfo getUniversitiesRankingList(String type,Integer year,String collegeName){
+        BBusiWishUniversitiesRanking query = new BBusiWishUniversitiesRanking();
+        query.setType(type);
+        query.setYear(year);
+        if(StringUtils.isNotBlank(collegeName)){
+            query.setCollegeName(collegeName);
+        }
+//        query.getParams().put("orderBy", " ranking");
+        startPage();
+        //取到学校数据
+        List<BBusiWishUniversitiesRanking> list = universitiesRankingService.selectBBusiWishUniversitiesRankingList(query);
+        return getDataTable(list);
+    }
+
+    @GetMapping("getUniversitiesRankingByTypes")
+    @ApiOperation("07-3 获取院校排名->APP使用")
+    public TableDataInfo getUniversitiesRankingByTypes(@ApiParam("排名类型") @RequestParam String type) {
+        Integer year = universitiesRankingService.selectUniversitiesRankingMaxYearByType(type);
+        if(null==year){
+            return getDataTable(new ArrayList<>());
+        }
+
+        BBusiWishUniversitiesRanking query = new BBusiWishUniversitiesRanking();
+        query.setType(type);
+        query.setYear(year);
+
+        //取到最新一年的学校排名数据
+        startPage();
+        List<BBusiWishUniversitiesRanking> list = universitiesRankingService.selectBBusiWishUniversitiesRankingList(query);
+
+        List<String> collegeCodes = list.stream().map(t->t.getCollegeCode()).collect(Collectors.toList());
+        query = new BBusiWishUniversitiesRanking();
+        query.setType(type);
+        query.setCollegeCodes(collegeCodes);
+        query.getParams().put("maxYear", year-1);
+        query.getParams().put("minYear", year-2);
+        //取最近两年对应学校的数据
+        List<BBusiWishUniversitiesRanking>  historyList = universitiesRankingService.selectBBusiWishUniversitiesRankingList(query);
+        Map<String,Integer> yearCodeRankingMap = historyList.stream().collect(Collectors.toMap(e -> (e.getYear()+e.getCollegeCode()),e -> e.getRanking()));
+//        Map<String, BBusiWishUniversitiesRanking> importMap = historyList.stream().collect(Collectors.toMap(BBusiWishUniversitiesRanking::getCollegeCode, Function.identity()));
+        //填充过去2年数据
+        for (BBusiWishUniversitiesRanking ll : list) {
+            //去年
+            String key = (ll.getYear() - 1) + ll.getCollegeCode();
+            if (yearCodeRankingMap.containsKey(key)) {
+                ll.setLastRanking1(yearCodeRankingMap.get(key));
+            }
+            //前年
+            key = (ll.getYear() - 2) + ll.getCollegeCode();
+            if (yearCodeRankingMap.containsKey(key)) {
+                ll.setLastRanking2(yearCodeRankingMap.get(key));
+            }
+        }
+
+        return getDataTable(list);
+    }
+
+}

+ 1 - 3
ie-admin/src/main/java/com/ruoyi/web/service/SyTestMajorService.java

@@ -33,7 +33,6 @@ public class SyTestMajorService {
     private final SyKnowledgeInterstTypeMapper syKnowledgeInterstTypeMapper;
     private final SyMajorCategoryMapper syMajorCategoryMapper;
     private final SyMajorMajorMapper syMajorMajorMapper;
-    private final SyMajorSubjectMapper syMajorSubjectMapper;
     private final SyOccupationInterstMajorMapper syOccupationInterstMajorMapper;
     private final SyOccupationInterstTypeMapper syOccupationInterstTypeMapper;
     private final SyPhilosophyViewMajorMapper syPhilosophyViewMajorMapper;
@@ -55,7 +54,7 @@ public class SyTestMajorService {
     private TypeReference<Map<String, Integer>> keyValueTypeReference = new TypeReference<Map<String, Integer>>() {};
 
     public SyTestMajorService(SyKnowledgeInterstMajorMapper syKnowledgeInterstMajorMapper, SyKnowledgeInterstTypeMapper syKnowledgeInterstTypeMapper, SyMajorCategoryMapper syMajorCategoryMapper,
-                              SyMajorMajorMapper syMajorMajorMapper, SyMajorSubjectMapper syMajorSubjectMapper, SyOccupationInterstMajorMapper syOccupationInterstMajorMapper,
+                              SyMajorMajorMapper syMajorMajorMapper, SyOccupationInterstMajorMapper syOccupationInterstMajorMapper,
                               SyOccupationInterstTypeMapper syOccupationInterstTypeMapper, SyPhilosophyViewMajorMapper syPhilosophyViewMajorMapper, SyPhilosophyViewTypeMapper syPhilosophyViewTypeMapper,
                               SyTestAnswersMapper syTestAnswersMapper, SyTestExamineeMapper syTestExamineeMapper, SyTestPaperMapper syTestPaperMapper, SyTestQuestionMapper syTestQuestionMapper, SyTestSelectCategoryMapper syTestSelectCategoryMapper,
                               SyTestSelectMajorMapper syTestSelectMajorMapper, ExamUtilService examUtilService, RedisCache redisCache) {
@@ -63,7 +62,6 @@ public class SyTestMajorService {
         this.syKnowledgeInterstTypeMapper = syKnowledgeInterstTypeMapper;
         this.syMajorCategoryMapper = syMajorCategoryMapper;
         this.syMajorMajorMapper = syMajorMajorMapper;
-        this.syMajorSubjectMapper = syMajorSubjectMapper;
         this.syOccupationInterstMajorMapper = syOccupationInterstMajorMapper;
         this.syOccupationInterstTypeMapper = syOccupationInterstTypeMapper;
         this.syPhilosophyViewMajorMapper = syPhilosophyViewMajorMapper;

+ 58 - 0
ie-common/pom.xml

@@ -148,6 +148,64 @@
             <scope>compile</scope>
         </dependency>
 
+
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-vod</artifactId>
+            <version>2.15.11</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.10.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>4.5.22</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-vod-upload</artifactId>
+            <version>1.4.14</version>
+        </dependency>
+
+        <!-- 阿里云视频点播 api-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>tea-openapi</artifactId>
+            <version>0.0.13</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-apache-httpclient</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+
+        <!-- 阿里云 -->
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.10.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-db</artifactId>
+            <version>5.7.21</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 105 - 0
ie-common/src/main/java/com/ruoyi/common/vod/AliyunUpload.java

@@ -0,0 +1,105 @@
+package com.ruoyi.common.vod;
+
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.exceptions.ClientException;
+import com.aliyuncs.profile.DefaultProfile;
+import com.aliyuncs.vod.model.v20170321.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author: LBX
+ * @Date: 2019/5/14 16:09
+ */
+public class AliyunUpload {
+
+    //初始化客户端
+    public static DefaultAcsClient initVodClient(Map<String, Object> param) {
+        DefaultProfile profile = DefaultProfile.getProfile(param.get("regionId").toString(), param.get("accessKeyId").toString(), param.get("accessKeySecret").toString());
+        DefaultAcsClient client = new DefaultAcsClient(profile);
+        return client;
+    }
+
+    /**
+     * 获取视频上传地址和凭证
+     */
+    public static HashMap<String, Object> createUploadVideo(Map<String, Object> param) {
+        DefaultAcsClient client = initVodClient(param);
+
+        CreateUploadVideoRequest request = new CreateUploadVideoRequest();
+        request.setTitle(param.get("title").toString());
+        request.setFileName(param.get("fileName").toString());
+        //JSONObject userData = new JSONObject();
+        //JSONObject messageCallback = new JSONObject();
+        //messageCallback.put("CallbackURL", "http://xxxxx");
+        //messageCallback.put("CallbackType", "http");
+        //userData.put("MessageCallback", messageCallback.toJSONString());
+        //JSONObject extend = new JSONObject();
+        //extend.put("MyId", "user-defined-id");
+        //userData.put("Extend", extend.toJSONString());
+        //request.setUserData(userData.toJSONString());
+        HashMap<String, Object> map = new HashMap<>();
+        try {
+            CreateUploadVideoResponse response = client.getAcsResponse(request);
+            map.put("Code", "0");
+            map.put("VideoId", response.getVideoId());
+            map.put("UploadAddress", response.getUploadAddress());
+            map.put("UploadAuth", response.getUploadAuth());
+            map.put("RequestId", response.getRequestId());
+        } catch (ClientException e) {
+            e.printStackTrace();
+            map.put("Code", "1");
+            map.put("ErrorMessage", e.getLocalizedMessage());
+        }
+
+        return map;
+    }
+
+    /**
+     * 刷新视频上传凭证
+     */
+    public static Map<String, Object> refreshUploadVideo(Map<String, Object> param) {
+        DefaultAcsClient client = initVodClient(param);
+        RefreshUploadVideoRequest request = new RefreshUploadVideoRequest();
+        request.setVideoId(param.get("videoId").toString());
+
+        Map<String, Object> map = new HashMap<>();
+        try {
+            RefreshUploadVideoResponse response = client.getAcsResponse(request);
+            map.put("Code", "0");
+            map.put("VideoId", response.getVideoId());
+            map.put("UploadAddress", response.getUploadAddress());
+            map.put("UploadAuth", response.getUploadAuth());
+        } catch (ClientException e) {
+            e.printStackTrace();
+            map.put("Code", "1");
+            map.put("ErrorMessage", e.getLocalizedMessage());
+        }
+        return map;
+    }
+
+    /*获取播放凭证函数*/
+    public static Map<String, Object> getVideoPlayAuth(Map<String, Object> param) {
+        DefaultAcsClient client = initVodClient(param);
+        GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();
+        request.setVideoId(param.get("videoId").toString());
+        request.setAuthInfoTimeout(Long.valueOf(param.get("authInfoTimeout").toString()));
+        Map<String, Object> map = new HashMap<>();
+        try {
+            GetVideoPlayAuthResponse response = client.getAcsResponse(request);
+            map.put("Code", "0");
+            map.put("PlayAuth", response.getPlayAuth());
+            map.put("RequestId", response.getRequestId());
+            map.put("VideoId", response.getVideoMeta().getVideoId());
+            map.put("Title", response.getVideoMeta().getTitle());
+            map.put("CoverUrl", response.getVideoMeta().getCoverURL());
+        } catch (ClientException e) {
+            e.printStackTrace();
+            map.put("Code", "1");
+            map.put("ErrorMessage", e.getLocalizedMessage());
+        }
+        return map;
+    }
+}
+

+ 33 - 0
ie-common/src/main/java/com/ruoyi/common/vod/CreateVodDto.java

@@ -0,0 +1,33 @@
+package com.ruoyi.common.vod;
+
+public class CreateVodDto {
+
+    private String uploadAddress;
+    private String uploadAuth;
+    private String videoId;
+
+
+    public String getUploadAddress() {
+        return uploadAddress;
+    }
+
+    public void setUploadAddress(String uploadAddress) {
+        this.uploadAddress = uploadAddress;
+    }
+
+    public String getUploadAuth() {
+        return uploadAuth;
+    }
+
+    public void setUploadAuth(String uploadAuth) {
+        this.uploadAuth = uploadAuth;
+    }
+
+    public String getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(String videoId) {
+        this.videoId = videoId;
+    }
+}

+ 16 - 0
ie-common/src/main/java/com/ruoyi/common/vod/PlayVideoDemo.java

@@ -0,0 +1,16 @@
+package com.ruoyi.common.vod;
+
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoRequest;
+
+public class PlayVideoDemo {
+
+    //账号AK信息请填写(必选)
+    private static final String accessKeyId = "LTAI4FpoeE88SWgavcYq5Soq";
+    //账号AK信息请填写(必选)
+    private static final String accessKeySecret = "ttU7YRLw6Bo3ph57f0m8ACXIwxfzfL";
+
+    public static void main(String[] args) {
+        GetPlayInfoRequest request = new GetPlayInfoRequest();
+        request.setVideoId("fa932f10788d4646a63cb6739ba3e32e");
+    }
+}                   

+ 21 - 0
ie-common/src/main/java/com/ruoyi/common/vod/RefreshSTSTokenImpl.java

@@ -0,0 +1,21 @@
+package com.ruoyi.common.vod;
+
+import com.aliyun.vod.upload.dto.STSTokenDTO;
+import com.aliyun.vod.upload.impl.VoDRefreshSTSTokenListener;
+
+/**
+ * @author vod
+ * 生成STS信息实现类
+ * @date 2019/6/5
+ */
+public class RefreshSTSTokenImpl implements VoDRefreshSTSTokenListener {
+
+    public STSTokenDTO onRefreshSTSToken() {
+        STSTokenDTO stsTokenDTO = new STSTokenDTO();
+        stsTokenDTO.setAccessKeyId("<your sts AccessKeyId>");
+        stsTokenDTO.setAccessKeySecret("<your sts AccessKeySecret>");
+        stsTokenDTO.setSecurityToken("<your sts SecurityToken>");
+        return stsTokenDTO;
+    }
+
+}

+ 212 - 0
ie-common/src/main/java/com/ruoyi/common/vod/UploadVideoDemo.java

@@ -0,0 +1,212 @@
+package com.ruoyi.common.vod;
+
+import com.aliyun.vod.upload.impl.UploadImageImpl;
+import com.aliyun.vod.upload.impl.UploadVideoImpl;
+import com.aliyun.vod.upload.req.UploadImageRequest;
+import com.aliyun.vod.upload.req.UploadURLStreamRequest;
+import com.aliyun.vod.upload.req.UploadVideoRequest;
+import com.aliyun.vod.upload.resp.UploadImageResponse;
+import com.aliyun.vod.upload.resp.UploadURLStreamResponse;
+import com.aliyun.vod.upload.resp.UploadVideoResponse;
+
+public class UploadVideoDemo {
+
+    //账号AK信息请填写(必选)
+    private static final String accessKeyId = "LTAI4FpoeE88SWgavcYq5Soq";
+    //账号AK信息请填写(必选)
+    private static final String accessKeySecret = "ttU7YRLw6Bo3ph57f0m8ACXIwxfzfL";
+
+    public static void main(String[] args) {
+        // 一、视频文件上传
+        // 视频标题(必选)
+        String title = "测试标题";
+        // 1.本地文件上传和文件流上传时,文件名称为上传文件绝对路径,如:/User/sample/文件名称.mp4 (必选)
+        // 2.网络流上传时,文件名称为源文件名,如文件名称.mp4(必选)。
+        // 任何上传方式文件名必须包含扩展名
+        String fileName = "/Users/kevin/Desktop/a.mp4s";
+        // 本地文件上传
+        testUploadVideo(accessKeyId, accessKeySecret, title, fileName);
+
+        // 待上传视频的网络流地址
+//        String url = "http://xxxx.xxxx.com/xxxx.mp4";
+
+        // 2.网络流上传
+        // 文件扩展名,当url中不包含扩展名时,需要设置该参数
+//        String fileExtension = "mp4";
+        //testUploadURLStream(accessKeyId, accessKeySecret, title, url, fileExtension);
+
+        // 二、图片上传
+        //testUploadImageLocalFile(accessKeyId, accessKeySecret);
+
+    }
+
+
+    /**
+     * 本地文件上传接口
+     *
+     * @param accessKeyId
+     * @param accessKeySecret
+     * @param title
+     * @param fileName
+     */
+    private static void testUploadVideo(String accessKeyId, String accessKeySecret, String title, String fileName) {
+        UploadVideoRequest request = new UploadVideoRequest(accessKeyId, accessKeySecret, title, fileName);
+        /* 可指定分片上传时每个分片的大小,默认为2M字节 */
+        request.setPartSize(2 * 1024 * 1024L);
+        /* 可指定分片上传时的并发线程数,默认为1,(注:该配置会占用服务器CPU资源,需根据服务器情况指定)*/
+        request.setTaskNum(1);
+        /* 是否开启断点续传, 默认断点续传功能关闭。当网络不稳定或者程序崩溃时,再次发起相同上传请求,可以继续未完成的上传任务,适用于超时3000秒仍不能上传完成的大文件。
+        注意: 断点续传开启后,会在上传过程中将上传位置写入本地磁盘文件,影响文件上传速度,请您根据实际情况选择是否开启*/
+        //request.setEnableCheckpoint(false);
+        /* OSS慢请求日志打印超时时间,是指每个分片上传时间超过该阈值时会打印debug日志,如果想屏蔽此日志,请调整该阈值。单位: 毫秒,默认为300000毫秒*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 可指定每个分片慢请求时打印日志的时间阈值,默认为300s*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 是否显示水印(可选),指定模板组ID时,根据模板组配置确定是否显示水印*/
+        //request.setIsShowWaterMark(true);
+        /* 自定义消息回调设置(可选),参数说明请参见请求参数说明。*/
+        // request.setUserData("{\"Extend\":{\"test\":\"www\",\"localId\":\"xxxx\"},\"MessageCallback\":{\"CallbackURL\":\"http://test.test.com\"}}");
+        /* 视频分类ID(可选) */
+        //request.setCateId(0);
+        /* 视频标签,多个用逗号分隔(可选) */
+        //request.setTags("标签1,标签2");
+        /* 视频描述(可选) */
+        //request.setDescription("视频描述");
+        /* 封面图片(可选) */
+        //request.setCoverURL("http://cover.sample.com/sample.jpg");
+        /* 模板组ID(可选) */
+        //request.setTemplateGroupId("8c4792cbc8694e7084fd5330e56a33d");
+        /* 工作流ID(可选) */
+        //request.setWorkflowId("d4430d07361f0*be1339577859b0177b");
+        /* 存储区域(可选) */
+        //request.setStorageLocation("in-201703232118266-5sejdln9o.oss-cn-shanghai.aliyuncs.com");
+        /* 开启默认上传进度回调 */
+        //request.setPrintProgress(false);
+        /* 设置自定义上传进度回调 (必须继承 VoDProgressListener) */
+        //request.setProgressListener(new PutObjectProgressListener());
+        /* 设置您实现的生成STS信息的接口实现类*/
+        // request.setVoDRefreshSTSTokenListener(new RefreshSTSTokenImpl());
+        /* 设置应用ID*/
+        //request.setAppId("app-1000000");
+        /* 点播服务接入点 */
+        //request.setApiRegionId("cn-shanghai");
+        /* ECS部署区域*/
+        // request.setEcsRegionId("cn-shanghai");
+        UploadVideoImpl uploader = new UploadVideoImpl();
+        UploadVideoResponse response = uploader.uploadVideo(request);
+        System.out.print("RequestId=" + response.getRequestId() + "\n");  //请求视频点播服务的请求ID
+        if (response.isSuccess()) {
+            System.out.print("VideoId=" + response.getVideoId() + "\n");
+        } else {
+            /* 如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因 */
+            System.out.print("VideoId=" + response.getVideoId() + "\n");
+            System.out.print("ErrorCode=" + response.getCode() + "\n");
+            System.out.print("ErrorMessage=" + response.getMessage() + "\n");
+        }
+    }
+
+    /**
+     * URL网络流上传。支持断点续传,最大支持48.8TB的单个文件。
+     * 该上传方式需要先将网络文件下载到本地磁盘,再进行上传,所以要保证本地磁盘有充足的空间。
+     * 当您设置的URL中不包括文件扩展名时,需要单独设置fileExtension,表示文件扩展名。
+     * @param accessKeyId
+     * @param accessKeySecret
+     * @param title
+     * @param fileName
+     * @param url
+     */
+    private static void testUploadURLStream(String accessKeyId, String accessKeySecret, String title, String url, String fileExtension) {
+        UploadURLStreamRequest request = new UploadURLStreamRequest(accessKeyId, accessKeySecret, title, url);
+
+        /* 文件扩展名*/
+        request.setFileExtension(fileExtension);
+        /* 网络文件下载连接超时,单位毫秒,0-表示不限制*/
+        request.setDownloadConnectTimeout(1000);
+        /* 网络文件下载读取超时,单位毫秒,0-表示不限制*/
+        request.setDownloadReadTimeout(0);
+        /* 网络文件下载后保存的本地目录*/
+        request.setLocalDownloadFilePath("/Users/download");
+        /* 是否显示水印(可选),指定模板组ID时,根据模板组配置确定是否显示水印*/
+        //request.setShowWaterMark(true);
+        /* 自定义消息回调设置(可选),参数说明请参见请求参数说明 */
+        // request.setUserData("{\"Extend\":{\"test\":\"www\",\"localId\":\"xxxx\"},\"MessageCallback\":{\"CallbackURL\":\"http://test.test.com\"}}");
+        /* 视频分类ID(可选) */
+        //request.setCateId(0);
+        /* 视频标签,多个用逗号分隔(可选) */
+        //request.setTags("标签1,标签2");
+        /* 视频描述(可选) */
+        //request.setDescription("视频描述");
+        /* 封面图片(可选) */
+        //request.setCoverURL("http://cover.sample.com/sample.jpg");
+        /* 模板组ID(可选) */
+        //request.setTemplateGroupId("8c4792cbc8694e7084fd5330e56a33d");
+        /* 工作流ID(可选) */
+        //request.setWorkflowId("d4430d07361f0*be1339577859b0177b");
+        /* 存储区域(可选) */
+        //request.setStorageLocation("xxxxxx.oss-cn-shanghai.aliyuncs.com");
+        /* 开启默认上传进度回调 */
+        //request.setPrintProgress(true);
+        /* 设置自定义上传进度回调 (必须继承 VoDProgressListener) */
+        //request.setProgressListener(new PutObjectProgressListener());
+        /* 设置应用ID*/
+        //request.setAppId("app-1000000");
+        /* 点播服务接入点 */
+        //request.setApiRegionId("cn-shanghai");
+        /* ECS部署区域*/
+        // request.setEcsRegionId("cn-shanghai");
+        UploadVideoImpl uploader = new UploadVideoImpl();
+        UploadURLStreamResponse response = uploader.uploadURLStream(request);
+        System.out.print("RequestId=" + response.getRequestId() + "\n"); //请求视频点播服务的请求ID
+        if (response.isSuccess()) {
+            System.out.print("VideoId=" + response.getVideoId() + "\n");
+        } else {
+            /* 如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因 */
+            System.out.print("VideoId=" + response.getVideoId() + "\n");
+            System.out.print("ErrorCode=" + response.getCode() + "\n");
+            System.out.print("ErrorMessage=" + response.getMessage() + "\n");
+        }
+    }
+
+    /**
+     * 图片上传接口,本地文件上传示例
+     * 参数请参见获取图片上传地址和凭证
+     *
+     * @param accessKeyId
+     * @param accessKeySecret
+     */
+    private static void testUploadImageLocalFile(String accessKeyId, String accessKeySecret) {
+        /* 图片类型(必选)取值范围:default(默认),cover(封面),watermark(水印)*/
+        String imageType = "default";
+        UploadImageRequest request = new UploadImageRequest(accessKeyId, accessKeySecret, imageType);
+        request.setImageType("default");
+        /* 图片文件扩展名(可选)取值范围:png,jpg,jpeg */
+        //request.setImageExt("png");
+        /* 图片标题(可选)长度不超过128个字节,UTF8编码 */
+        //request.setTitle("图片标题");
+        /* 图片标签(可选)单个标签不超过32字节,最多不超过16个标签,多个用逗号分隔,UTF8编码 */
+        //request.setTags("标签1,标签2");
+        /* 存储区域(可选)*/
+        //request.setStorageLocation("out-4f3952f78c0211e8b3020013e7.oss-cn-shanghai.aliyuncs.com");
+        /* fileName为源文件名称,如:文件名称.png*/
+        String fileName = "/User/sample/文件名称.png";
+        request.setFileName(fileName);
+        /* 开启默认上传进度回调 */
+        //request.setPrintProgress(false);
+        /* 设置自定义上传进度回调 (必须继承 VoDProgressListener) */
+        // request.setProgressListener(new PutObjectProgressListener());
+        /* 设置应用ID*/
+        //request.setAppId("app-1000000");
+        /* 点播服务接入点 */
+        //request.setApiRegionId("cn-shanghai");
+        UploadImageImpl uploadImage = new UploadImageImpl();
+        UploadImageResponse response = uploadImage.upload(request);
+        System.out.print("RequestId=" + response.getRequestId() + "\n");
+        if (response.isSuccess()) {
+            System.out.print("ImageId=" + response.getImageId() + "\n");
+            System.out.print("ImageURL=" + response.getImageURL() + "\n");
+        } else {
+            System.out.print("ErrorCode=" + response.getCode() + "\n");
+            System.out.print("ErrorMessage=" + response.getMessage() + "\n");
+        }
+    }
+}                   

+ 41 - 0
ie-common/src/main/java/com/ruoyi/common/vod/VodPlayAuthDto.java

@@ -0,0 +1,41 @@
+package com.ruoyi.common.vod;
+
+public class VodPlayAuthDto {
+    private String playAuth;
+    private String videoId;
+    private String requestId;
+    private String title;
+    private String coverUrl;
+    public String getPlayAuth() {
+        return playAuth;
+    }
+    public void setPlayAuth(String playAuth) {
+        this.playAuth = playAuth;
+    }
+    public String getVideoId() {
+        return videoId;
+    }
+    public void setVideoId(String videoId) {
+        this.videoId = videoId;
+    }
+    public String getRequestId() {
+        return requestId;
+    }
+    public void setRequestId(String requestId) {
+        this.requestId = requestId;
+    }
+    public String getTitle() {
+        return title;
+    }
+    public void setTitle(String title) {
+        this.title = title;
+    }
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+    
+    
+}

+ 145 - 0
ie-common/src/main/java/com/ruoyi/common/vod/VodUtils.java

@@ -0,0 +1,145 @@
+package com.ruoyi.common.vod;
+
+import com.aliyun.teaopenapi.models.Config;
+import com.aliyun.vod.upload.impl.UploadVideoImpl;
+import com.aliyun.vod.upload.req.UploadVideoRequest;
+import com.aliyun.vod.upload.resp.UploadVideoResponse;
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.exceptions.ClientException;
+import com.aliyuncs.profile.DefaultProfile;
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoRequest;
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse;
+import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest;
+import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+
+/**
+ * @author 莫进侠
+ * @date 使用智隆叁加叁的vod,此时aliId为 [zlsjs,aliId]
+ */
+@Component
+public class VodUtils {
+
+    @Value("${aliyun.vod.accessKeyId}")
+    private String accessKeyId;
+
+    @Value("${aliyun.vod.accessKeySecret}")
+    private String accessKeySecret;
+
+    @Value("${aliyun.vod.endpoint}")
+    private String endpoint;
+    
+    @Autowired
+    @Qualifier("vodClient")
+    private DefaultAcsClient client;
+
+    private static Logger logger = LoggerFactory.getLogger(VodUtils.class);
+
+    @Bean
+    @Qualifier("vodClient")
+    public DefaultAcsClient vodClient() throws Exception{
+        Config config = new Config()
+                // 您的AccessKey ID
+                .setAccessKeyId(accessKeyId)
+                // 您的AccessKey Secret
+                .setAccessKeySecret(accessKeySecret);
+        // 访问的域名
+        config.endpoint = endpoint;
+        DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", accessKeyId, accessKeySecret);
+        DefaultAcsClient client = new DefaultAcsClient(profile);
+        return client;
+    }
+    
+    public String upload(String title, File file) {
+        UploadVideoRequest request = new UploadVideoRequest(accessKeyId, accessKeySecret, title, file.getPath());
+        /* 可指定分片上传时每个分片的大小,默认为2M字节 */
+        request.setPartSize(2 * 1024 * 1024L);
+        /* 可指定分片上传时的并发线程数,默认为1,(注:该配置会占用服务器CPU资源,需根据服务器情况指定)*/
+        request.setTaskNum(1);
+        /* 是否开启断点续传, 默认断点续传功能关闭。当网络不稳定或者程序崩溃时,再次发起相同上传请求,可以继续未完成的上传任务,适用于超时3000秒仍不能上传完成的大文件。
+        注意: 断点续传开启后,会在上传过程中将上传位置写入本地磁盘文件,影响文件上传速度,请您根据实际情况选择是否开启*/
+        //request.setEnableCheckpoint(false);
+        /* OSS慢请求日志打印超时时间,是指每个分片上传时间超过该阈值时会打印debug日志,如果想屏蔽此日志,请调整该阈值。单位: 毫秒,默认为300000毫秒*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 可指定每个分片慢请求时打印日志的时间阈值,默认为300s*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 是否显示水印(可选),指定模板组ID时,根据模板组配置确定是否显示水印*/
+        //request.setIsShowWaterMark(true);
+        /* 自定义消息回调设置(可选),参数说明请参见请求参数说明。*/
+        // request.setUserData("{\"Extend\":{\"test\":\"www\",\"localId\":\"xxxx\"},\"MessageCallback\":{\"CallbackURL\":\"http://test.test.com\"}}");
+        /* 视频分类ID(可选) */
+        //request.setCateId(0);
+        /* 视频标签,多个用逗号分隔(可选) */
+        //request.setTags("标签1,标签2");
+        /* 视频描述(可选) */
+        //request.setDescription("视频描述");
+        /* 封面图片(可选) */
+        //request.setCoverURL("http://cover.sample.com/sample.jpg");
+        /* 模板组ID(可选) */
+        //request.setTemplateGroupId("8c4792cbc8694e7084fd5330e56a33d");
+        /* 工作流ID(可选) */
+        //request.setWorkflowId("d4430d07361f0*be1339577859b0177b");
+        /* 存储区域(可选) */
+        //request.setStorageLocation("in-201703232118266-5sejdln9o.oss-cn-shanghai.aliyuncs.com");
+        /* 开启默认上传进度回调 */
+        //request.setPrintProgress(false);
+        /* 设置自定义上传进度回调 (必须继承 VoDProgressListener) */
+        //request.setProgressListener(new PutObjectProgressListener());
+        /* 设置您实现的生成STS信息的接口实现类*/
+        // request.setVoDRefreshSTSTokenListener(new RefreshSTSTokenImpl());
+        /* 设置应用ID*/
+        //request.setAppId("app-1000000");
+        /* 点播服务接入点 */
+        //request.setApiRegionId("cn-shanghai");
+        /* ECS部署区域*/
+        // request.setEcsRegionId("cn-shanghai");
+        UploadVideoImpl uploader = new UploadVideoImpl();
+        UploadVideoResponse response = uploader.uploadVideo(request);
+//        System.out.print("RequestId=" + response.getRequestId() + "\n");  //请求视频点播服务的请求ID
+        if (response.isSuccess()) {
+            return response.getVideoId();
+        } else {
+            /* 如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因 */
+            throw new RuntimeException("上传视频出错,VideoId: " + response.getVideoId() + ", code: " + response.getCode() + ", msg: " + response.getMessage() + ", file: " + file.getPath());
+        }
+    
+    }
+    
+    
+    public VodPlayAuthDto getVideoPlayAuth(String videoId) {
+        GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();
+        request.setVideoId(videoId);
+        try {
+            GetVideoPlayAuthResponse response = client.getAcsResponse(request);
+            VodPlayAuthDto dto = new VodPlayAuthDto();
+            dto.setPlayAuth(response.getPlayAuth());
+            dto.setRequestId(response.getRequestId());
+            dto.setVideoId(response.getVideoMeta().getVideoId());
+            dto.setTitle(response.getVideoMeta().getTitle());
+            dto.setCoverUrl(response.getVideoMeta().getCoverURL());
+            return dto;
+        } catch (ClientException e) {
+            throw new RuntimeException("getVideoPlayAuth failed, videoId: " + videoId + ", msg: " + e.getMessage(), e);
+        }
+    }
+
+    public GetPlayInfoResponse getPlayInfo(String videoId) {
+        GetPlayInfoRequest getPlayInfoRequest = new GetPlayInfoRequest();
+        getPlayInfoRequest.setVideoId(videoId);
+        try {
+            GetPlayInfoResponse response = client.getAcsResponse(getPlayInfoRequest);
+            return response;
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("getPlayInfo failed, videoId: " + videoId + ", msg: " + e.getMessage(), e);
+        }
+    }
+}

+ 146 - 0
ie-common/src/main/java/com/ruoyi/common/vod/VodZlsjsUtils.java

@@ -0,0 +1,146 @@
+package com.ruoyi.common.vod;
+
+import com.aliyun.teaopenapi.models.Config;
+import com.aliyun.vod.upload.impl.UploadVideoImpl;
+import com.aliyun.vod.upload.req.UploadVideoRequest;
+import com.aliyun.vod.upload.resp.UploadVideoResponse;
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.exceptions.ClientException;
+import com.aliyuncs.profile.DefaultProfile;
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoRequest;
+import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse;
+import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest;
+import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+
+/**
+ * @author 莫进侠
+ * @date 使用智隆叁加叁的vod,此时aliId为 [zlsjs,aliId]
+ */
+@Component
+public class VodZlsjsUtils {
+
+    @Value("${oss.accessKeyId}")
+    private String accessKeyId;
+
+    @Value("${oss.accessKeySecret}")
+    private String accessKeySecret;
+
+    @Value("${oss.endpointVod}")
+    private String endpoint;
+    
+    @Autowired
+    @Qualifier("vodClient2")
+    private DefaultAcsClient client;
+
+    private static Logger logger = LoggerFactory.getLogger(VodZlsjsUtils.class);
+
+    @Bean
+    @Qualifier("vodClient2")
+    public DefaultAcsClient vodClient2() throws Exception{
+        Config config = new Config()
+                // 您的AccessKey ID
+                .setAccessKeyId(accessKeyId)
+                // 您的AccessKey Secret
+                .setAccessKeySecret(accessKeySecret);
+        // 访问的域名
+        config.endpoint = endpoint;
+        DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", accessKeyId, accessKeySecret);
+        DefaultAcsClient client = new DefaultAcsClient(profile);
+        return client;
+    }
+    
+    public String upload(String title, File file) {
+        UploadVideoRequest request = new UploadVideoRequest(accessKeyId, accessKeySecret, title, file.getPath());
+        /* 可指定分片上传时每个分片的大小,默认为2M字节 */
+        request.setPartSize(2 * 1024 * 1024L);
+        /* 可指定分片上传时的并发线程数,默认为1,(注:该配置会占用服务器CPU资源,需根据服务器情况指定)*/
+        request.setTaskNum(1);
+        /* 是否开启断点续传, 默认断点续传功能关闭。当网络不稳定或者程序崩溃时,再次发起相同上传请求,可以继续未完成的上传任务,适用于超时3000秒仍不能上传完成的大文件。
+        注意: 断点续传开启后,会在上传过程中将上传位置写入本地磁盘文件,影响文件上传速度,请您根据实际情况选择是否开启*/
+        //request.setEnableCheckpoint(false);
+        /* OSS慢请求日志打印超时时间,是指每个分片上传时间超过该阈值时会打印debug日志,如果想屏蔽此日志,请调整该阈值。单位: 毫秒,默认为300000毫秒*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 可指定每个分片慢请求时打印日志的时间阈值,默认为300s*/
+        //request.setSlowRequestsThreshold(300000L);
+        /* 是否显示水印(可选),指定模板组ID时,根据模板组配置确定是否显示水印*/
+        //request.setIsShowWaterMark(true);
+        /* 自定义消息回调设置(可选),参数说明请参见请求参数说明。*/
+        // request.setUserData("{\"Extend\":{\"test\":\"www\",\"localId\":\"xxxx\"},\"MessageCallback\":{\"CallbackURL\":\"http://test.test.com\"}}");
+        /* 视频分类ID(可选) */
+        //request.setCateId(0);
+        /* 视频标签,多个用逗号分隔(可选) */
+        //request.setTags("标签1,标签2");
+        /* 视频描述(可选) */
+        //request.setDescription("视频描述");
+        /* 封面图片(可选) */
+        //request.setCoverURL("http://cover.sample.com/sample.jpg");
+        /* 模板组ID(可选) */
+        //request.setTemplateGroupId("8c4792cbc8694e7084fd5330e56a33d");
+        /* 工作流ID(可选) */
+        //request.setWorkflowId("d4430d07361f0*be1339577859b0177b");
+        /* 存储区域(可选) */
+        //request.setStorageLocation("in-201703232118266-5sejdln9o.oss-cn-shanghai.aliyuncs.com");
+        /* 开启默认上传进度回调 */
+        //request.setPrintProgress(false);
+        /* 设置自定义上传进度回调 (必须继承 VoDProgressListener) */
+        //request.setProgressListener(new PutObjectProgressListener());
+        /* 设置您实现的生成STS信息的接口实现类*/
+        // request.setVoDRefreshSTSTokenListener(new RefreshSTSTokenImpl());
+        /* 设置应用ID*/
+        //request.setAppId("app-1000000");
+        /* 点播服务接入点 */
+        //request.setApiRegionId("cn-shanghai");
+        /* ECS部署区域*/
+        // request.setEcsRegionId("cn-shanghai");
+        UploadVideoImpl uploader = new UploadVideoImpl();
+        UploadVideoResponse response = uploader.uploadVideo(request);
+//        System.out.print("RequestId=" + response.getRequestId() + "\n");  //请求视频点播服务的请求ID
+        if (response.isSuccess()) {
+            return response.getVideoId();
+        } else {
+            /* 如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因 */
+            throw new RuntimeException("上传视频出错,VideoId: " + response.getVideoId() + ", code: " + response.getCode() + ", msg: " + response.getMessage() + ", file: " + file.getPath());
+        }
+    
+    }
+    
+    
+    public VodPlayAuthDto getVideoPlayAuth(String videoId) {
+        GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();
+        request.setVideoId(videoId);
+        try {
+            GetVideoPlayAuthResponse response = client.getAcsResponse(request);
+            VodPlayAuthDto dto = new VodPlayAuthDto();
+            dto.setPlayAuth(response.getPlayAuth());
+            dto.setRequestId(response.getRequestId());
+            dto.setVideoId(response.getVideoMeta().getVideoId());
+            dto.setTitle(response.getVideoMeta().getTitle());
+            dto.setCoverUrl(response.getVideoMeta().getCoverURL());
+            return dto;
+        } catch (ClientException e) {
+            throw new RuntimeException("getVideoPlayAuth failed, videoId: " + videoId + ", msg: " + e.getMessage(), e);
+        }
+    }
+
+    public GetPlayInfoResponse getPlayInfo(String videoId) {
+        GetPlayInfoRequest getPlayInfoRequest = new GetPlayInfoRequest();
+        getPlayInfoRequest.setVideoId(videoId);
+        try {
+            GetPlayInfoResponse response = client.getAcsResponse(getPlayInfoRequest);
+            return response;
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("getPlayInfo failed, videoId: " + videoId + ", msg: " + e.getMessage(), e);
+        }
+
+    }
+}

+ 2 - 4
ie-system/src/main/java/com/ruoyi/sy/domain/SyMajorCategory.java

@@ -1,11 +1,9 @@
 package com.ruoyi.sy.domain;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
-
-import java.util.List;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 二级专业对象 sy_major_category

+ 2 - 0
ie-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java

@@ -11,6 +11,8 @@ import com.ruoyi.common.core.domain.entity.SysDictType;
  */
 public interface ISysDictTypeService
 {
+    public String getDictDataByType(String dictType,String dictValue);
+
     /**
      * 根据条件分页查询字典类型
      * 

+ 19 - 0
ie-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.PostConstruct;
+
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -41,6 +43,23 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
         loadingDictCache();
     }
 
+    @Override
+    public String getDictDataByType(String dictType,String dictValue) {
+        List<SysDictData>  dictDatas = selectDictDataByType(dictType);
+        String defaultPath = StringUtils.EMPTY;
+        if(CollectionUtils.isNotEmpty(dictDatas)){
+            for(SysDictData sysDictData:dictDatas) {
+                if (sysDictData.getDictValue().equalsIgnoreCase(dictValue)) {
+                    return sysDictData.getDictLabel();
+                }
+                if ("0".equalsIgnoreCase(sysDictData.getDictValue())) {
+                    defaultPath = sysDictData.getDictLabel();
+                }
+            }
+        }
+        return defaultPath;
+    }
+
     /**
      * 根据条件分页查询字典类型
      *