四六级实体类
This commit is contained in:
parent
bc8165a8d9
commit
2878b05b4b
|
@ -75,12 +75,9 @@ public class ShiroConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2024.3.3 黄晖添加,
|
// 2024.3.26 黄晖添加
|
||||||
// 生成大屏数据的接口
|
|
||||||
filterChainDefinitionMap.put("/generate/**", "anon");
|
|
||||||
// 这里是为了屏蔽查询接口的token验证
|
|
||||||
filterChainDefinitionMap.put("/**/**/list", "anon");
|
|
||||||
filterChainDefinitionMap.put("/**/list", "anon");
|
|
||||||
|
|
||||||
// 配置不会被拦截的链接 顺序判断
|
// 配置不会被拦截的链接 顺序判断
|
||||||
filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
|
filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
|
@ -18,6 +19,7 @@ import java.net.UnknownHostException;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableCaching
|
||||||
//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
|
//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
|
||||||
public class JeecgSystemApplication extends SpringBootServletInitializer {
|
public class JeecgSystemApplication extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.constant.CacheConstant;
|
||||||
|
import org.jeecg.modules.service.CenterService;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cet")
|
||||||
|
@Slf4j
|
||||||
|
public class CenterController {
|
||||||
|
@Resource
|
||||||
|
private CenterService centerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计四级表和六级表中存在得学院和年级
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getGradeAndCollege")
|
||||||
|
@Cacheable(value = "getGradeAndCollege", key = "'getGradeAndCollege'")
|
||||||
|
public Result<JSONObject> getGradeAndCollege() {
|
||||||
|
return centerService.getGradeAndCollege();
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,7 +30,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
*/
|
*/
|
||||||
@Api(tags="cet_4")
|
@Api(tags="cet_4")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/cet/cet_4")
|
@RequestMapping("/cet_4")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Cet_4Controller extends JeecgController<Cet_4, ICet_4Service> {
|
public class Cet_4Controller extends JeecgController<Cet_4, ICet_4Service> {
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
*/
|
*/
|
||||||
@Api(tags="cet_6")
|
@Api(tags="cet_6")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/cet/cet_6")
|
@RequestMapping("/cet_6")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Cet_6Controller extends JeecgController<Cet_6, ICet_6Service> {
|
public class Cet_6Controller extends JeecgController<Cet_6, ICet_6Service> {
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface CenterService {
|
||||||
|
Result<JSONObject> getGradeAndCollege();
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.modules.entity.Cet_4;
|
||||||
|
import org.jeecg.modules.entity.Cet_6;
|
||||||
|
import org.jeecg.modules.mapper.Cet_4Mapper;
|
||||||
|
import org.jeecg.modules.mapper.Cet_6Mapper;
|
||||||
|
import org.jeecg.modules.service.CenterService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_4
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CenterServiceImpl implements CenterService {
|
||||||
|
@Resource
|
||||||
|
private Cet_4Mapper cet4Mapper;
|
||||||
|
@Resource
|
||||||
|
private Cet_6Mapper cet6Mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<JSONObject> getGradeAndCollege() {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
// 收集学院名称
|
||||||
|
LambdaQueryWrapper<Cet_4> Cet_4CollegeQW = new LambdaQueryWrapper<>();
|
||||||
|
Cet_4CollegeQW.select(Cet_4::getCollege)
|
||||||
|
.groupBy(Cet_4::getCollege);
|
||||||
|
LambdaQueryWrapper<Cet_6> Cet_6CollegeQW = new LambdaQueryWrapper<>();
|
||||||
|
Cet_6CollegeQW.select(Cet_6::getCollege)
|
||||||
|
.groupBy(Cet_6::getCollege);
|
||||||
|
|
||||||
|
List<Map<String, Object>> Cet_4College = cet4Mapper.selectMaps(Cet_4CollegeQW);
|
||||||
|
List<Map<String, Object>> Cet_6College = cet6Mapper.selectMaps(Cet_6CollegeQW);
|
||||||
|
// 收集不重复的学院名称
|
||||||
|
Set<String> collegeSet = new HashSet<>();
|
||||||
|
for (Map<String, Object> map : Cet_4College) {
|
||||||
|
collegeSet.add((String) map.get("college"));
|
||||||
|
}
|
||||||
|
for (Map<String, Object> map : Cet_6College) {
|
||||||
|
collegeSet.add((String) map.get("college"));
|
||||||
|
}
|
||||||
|
JSONArray colleges = new JSONArray();
|
||||||
|
for (String college : collegeSet) {
|
||||||
|
JSONObject collegeObj = new JSONObject();
|
||||||
|
collegeObj.put("label", college);
|
||||||
|
collegeObj.put("value", college);
|
||||||
|
colleges.add(collegeObj);
|
||||||
|
}
|
||||||
|
result.put("colleges", colleges);
|
||||||
|
|
||||||
|
// 收集入学年级
|
||||||
|
LambdaQueryWrapper<Cet_4> Cet_4EntrydateQW = new LambdaQueryWrapper<>();
|
||||||
|
Cet_4EntrydateQW.select(Cet_4::getEntrydate)
|
||||||
|
.groupBy(Cet_4::getEntrydate);
|
||||||
|
LambdaQueryWrapper<Cet_6> Cet_6EntrydateQW = new LambdaQueryWrapper<>();
|
||||||
|
Cet_6EntrydateQW.select(Cet_6::getEntrydate)
|
||||||
|
.groupBy(Cet_6::getEntrydate);
|
||||||
|
List<Map<String, Object>> Cet_4Entrydate = cet4Mapper.selectMaps(Cet_4EntrydateQW);
|
||||||
|
List<Map<String, Object>> Cet_6Entrydate = cet6Mapper.selectMaps(Cet_6EntrydateQW);
|
||||||
|
// 收集不重复的入学年级
|
||||||
|
Set<String> entrydateSet = new HashSet<>();
|
||||||
|
for (Map<String, Object> map : Cet_4Entrydate) {
|
||||||
|
entrydateSet.add((String) map.get("entrydate"));
|
||||||
|
}
|
||||||
|
for (Map<String, Object> map : Cet_6Entrydate) {
|
||||||
|
entrydateSet.add((String) map.get("entrydate"));
|
||||||
|
}
|
||||||
|
JSONArray entrydates = new JSONArray();
|
||||||
|
for (String entrydate : entrydateSet) {
|
||||||
|
JSONObject entrydateObj = new JSONObject();
|
||||||
|
entrydateObj.put("label", entrydate);
|
||||||
|
entrydateObj.put("value", entrydate);
|
||||||
|
entrydates.add(entrydateObj);
|
||||||
|
}
|
||||||
|
result.put("entrydates", entrydates);
|
||||||
|
return Result.ok(result);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue