Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/controller/CenterController.java # jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/modules/service/impl/Cet_4ServiceImpl.java # jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/text.java
This commit is contained in:
commit
43b8e942ad
|
@ -177,7 +177,7 @@ public class ShiroConfig {
|
|||
// <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边
|
||||
filterChainDefinitionMap.put("/**", "jwt");
|
||||
|
||||
// 未授权界面返回JSON
|
||||
// 未授权界面返回JSON
|
||||
shiroFilterFactoryBean.setUnauthorizedUrl("/sys/common/403");
|
||||
shiroFilterFactoryBean.setLoginUrl("/sys/common/403");
|
||||
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -83,7 +82,7 @@ public class CenterController {
|
|||
@PostMapping("/getAllRate")
|
||||
@Cacheable(value = "getAllRate", key = "'getAllRate' + #webData")
|
||||
public Result<JSONObject> getAllRate(@RequestBody JSONObject webData) {
|
||||
String level = webData.getString("level");
|
||||
String level= webData.getString("level");
|
||||
//四六级分开查询
|
||||
if (level.equals("cet4")) {
|
||||
|
||||
|
@ -96,19 +95,18 @@ public class CenterController {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/getRateByCollege")
|
||||
public Result<JSONObject> getRateByCollege(@RequestBody JSONObject webData) {
|
||||
public Result<JSONObject> getRateByCollege(@RequestBody JSONObject webData){
|
||||
return cet4Service.getRateByCollege(webData);
|
||||
}
|
||||
|
||||
@GetMapping("/getRateByAllBatch")
|
||||
// @Cacheable(value = "getRateByAllBatch", key = "'getRateByAllBatch' + #college+#major+#level")
|
||||
public Result<JSONObject> getRateByAllBatch(@RequestParam("college") String college, @RequestParam("major") String major, @RequestParam("level") String level) {
|
||||
public Result<JSONObject> getRateByAllBatch(@RequestParam("college") String college,@RequestParam("major") String major, @RequestParam("level") String level) {
|
||||
// System.out.println(college + " " + level);
|
||||
if (level.equals("cet4")) {
|
||||
|
||||
return cet4Service.getRateByAllBatch(college, major);
|
||||
return cet4Service.getRateByAllBatch(college,major);
|
||||
} else if (level.equals("cet6")) {
|
||||
Cet_6 cet = new Cet_6();
|
||||
cet.setCollege(college);
|
||||
|
@ -119,15 +117,15 @@ public class CenterController {
|
|||
}
|
||||
|
||||
@GetMapping("/getRateByBatch")
|
||||
public Result<JSONObject> getRateByBatch(@RequestParam("batch") String batch, @RequestParam("college") String college, @RequestParam("level") String level) {
|
||||
if (level.equals("cet4")) {
|
||||
return cet4Service.getRateByBatch(college, batch);
|
||||
} else return null;
|
||||
public Result<JSONObject> getRateByBatch(@RequestParam("batch")String batch, @RequestParam("college") String college, @RequestParam("level")String level){
|
||||
if (level.equals("cet4")){
|
||||
return cet4Service.getRateByBatch(college,batch);
|
||||
}else return null;
|
||||
}
|
||||
|
||||
@PostMapping("/getRateByMajor")
|
||||
public Result<JSONObject> getRateByMajor(@RequestBody JSONObject webData) {
|
||||
return cet4Service.getRateByMajor(webData);
|
||||
public Result<JSONObject> getRateByMajor(@RequestBody JSONObject webData){
|
||||
return cet4Service.getRateByMajor(webData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.entity.Cet_4;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -15,8 +13,5 @@ import java.util.List;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface Cet_4Mapper extends BaseMapper<Cet_4> {
|
||||
Date lastestDate();
|
||||
|
||||
long selectCountById(LambdaQueryWrapper<Cet_4> cet4Wrapper);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.mapper.Cet_4Mapper">
|
||||
<select id="lastestDate" resultType="java.util.Date">
|
||||
SELECT MAX(batch) AS latest_batch FROM cet_4;
|
||||
</select>
|
||||
<select id="selectCountById" resultType="java.lang.Long">
|
||||
SELECT DISTINCT id FROM cet_4;
|
||||
</select>
|
||||
</mapper>
|
|
@ -22,5 +22,4 @@ public interface CenterService extends IService<Cet_4> {
|
|||
|
||||
Result<JSONObject> getTest();
|
||||
Result<JSONObject> getCollegeMajor();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,11 +3,8 @@ package org.jeecg.modules.service;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.dto.getRateByEntryDate;
|
||||
import org.jeecg.modules.dto.getRateByMajorAndLastestBatchDto;
|
||||
import org.jeecg.modules.entity.Cet_4;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.util.Wrapper;
|
||||
|
||||
/**
|
||||
* @Description: cet_4
|
||||
|
@ -28,14 +25,4 @@ public interface ICet_4Service extends IService<Cet_4> {
|
|||
|
||||
Result<JSONObject> getDataByStudent(JSONObject jsonObject);
|
||||
boolean cleanData();
|
||||
|
||||
/**
|
||||
* @param getRateByMajorAndLastestBatchParam
|
||||
* @return {@link Wrapper }
|
||||
*/
|
||||
Wrapper getRateByMajorAndLastestBatch(getRateByMajorAndLastestBatchDto getRateByMajorAndLastestBatchParam);
|
||||
|
||||
Wrapper getRateByEntryDate(getRateByEntryDate getRateByEntryDateParams);
|
||||
|
||||
// Wrapper getRateByMajorAndLastestBatch(JSONObject webData);
|
||||
}
|
||||
|
|
|
@ -8,11 +8,13 @@ import org.jeecg.common.api.vo.Result;
|
|||
import org.jeecg.modules.entity.Cet4_major;
|
||||
import org.jeecg.modules.entity.Cet_4;
|
||||
import org.jeecg.modules.entity.Cet_4old;
|
||||
import org.jeecg.modules.entity.Cet_6;
|
||||
import org.jeecg.modules.mapper.Cet4_majorMapper;
|
||||
import org.jeecg.modules.mapper.Cet_4Mapper;
|
||||
import org.jeecg.modules.mapper.Cet_4oldMapper;
|
||||
import org.jeecg.modules.mapper.Cet_6Mapper;
|
||||
import org.jeecg.modules.service.CenterService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -112,30 +114,6 @@ public class CenterServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implement
|
|||
return Result.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据学院查对应的专业数据
|
||||
* @param college
|
||||
* @return
|
||||
*/
|
||||
// @Override
|
||||
// public Result<JSONObject> getMajorByCollege(String college) {
|
||||
//
|
||||
// LambdaQueryWrapper<Cet_4> wrapper = new LambdaQueryWrapper<>();
|
||||
// //收集某学院下专业数据
|
||||
// JSONArray majors = new JSONArray();
|
||||
// wrapper.eq(Cet_4::getCollege,college).groupBy(Cet_4::getMajorname);
|
||||
// List<Cet_4> list = list(wrapper);
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("college", college);
|
||||
// json.put("major", list);
|
||||
// majors.add(json);
|
||||
// JSONObject result = new JSONObject();
|
||||
// result.put("Majors", majors);
|
||||
// // 将数据存入缓存
|
||||
// redisTemplate.opsForValue().set("getMajor", result);
|
||||
// return Result.ok(result);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 统计四级表和六级表中存在的批次
|
||||
*/
|
||||
|
|
|
@ -33,8 +33,6 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.jeecgframework.poi.excel.entity.enmus.CellValueType.Null;
|
||||
|
||||
/**
|
||||
* @Description: cet_4
|
||||
* @Author: jeecg-boot
|
||||
|
@ -53,6 +51,7 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
private Cet4_majorMapper cet4_majorMapper;
|
||||
@Autowired
|
||||
CetCleanService cetCleanService;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
package org.jeecg.modules.util;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 简化和统一创建Wrapper对象
|
||||
*
|
||||
* @author Xubx
|
||||
* @date 2024/10/13
|
||||
*/
|
||||
public class WrapMapper {
|
||||
|
||||
/**
|
||||
* Instantiates a new wrap mapper.
|
||||
*/
|
||||
private WrapMapper() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param code the code
|
||||
* @param message the message
|
||||
* @param o the o
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> wrap(int code, String message, E o) {
|
||||
return new Wrapper<>(code, message, o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param code the code
|
||||
* @param message the message
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> wrap(int code, String message) {
|
||||
return wrap(code, message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param code the code
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> wrap(int code) {
|
||||
return wrap(code, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param e the e
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> wrap(Exception e) {
|
||||
return new Wrapper<>(Wrapper.ERROR_CODE, e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Un wrapper.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param wrapper the wrapper
|
||||
*
|
||||
* @return the e
|
||||
*/
|
||||
public static <E> E unWrap(Wrapper<E> wrapper) {
|
||||
return wrapper.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap ERROR. code=100
|
||||
*
|
||||
* @param <E> the element type
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> illegalArgument() {
|
||||
return wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, Wrapper.ILLEGAL_ARGUMENT_MESSAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap ERROR. code=500
|
||||
*
|
||||
* @param <E> the element type
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> error() {
|
||||
return wrap(Wrapper.ERROR_CODE, Wrapper.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Error wrapper.
|
||||
*
|
||||
* @param <E> the type parameter
|
||||
* @param message the message
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> error(String message) {
|
||||
return wrap(Wrapper.ERROR_CODE, StringUtils.isBlank(message) ? Wrapper.ERROR_MESSAGE : message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap SUCCESS. code=200
|
||||
*
|
||||
* @param <E> the element type
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> ok() {
|
||||
return new Wrapper<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ok wrapper.
|
||||
*
|
||||
* @param <E> the type parameter
|
||||
* @param o the o
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public static <E> Wrapper<E> ok(E o) {
|
||||
return new Wrapper<>(Wrapper.SUCCESS_CODE, Wrapper.SUCCESS_MESSAGE, o);
|
||||
}
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
package org.jeecg.modules.util;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 通用的响应包装器
|
||||
*
|
||||
* @author Xubx
|
||||
* @date 2024/10/13
|
||||
*/
|
||||
@Data
|
||||
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
|
||||
public class Wrapper<T> implements Serializable {
|
||||
|
||||
/**
|
||||
* 序列化标识
|
||||
*/
|
||||
private static final long serialVersionUID = 4893280118017319089L;
|
||||
|
||||
/**
|
||||
* 成功码.
|
||||
*/
|
||||
public static final int SUCCESS_CODE = 200;
|
||||
|
||||
/**
|
||||
* 成功信息.
|
||||
*/
|
||||
public static final String SUCCESS_MESSAGE = "操作成功";
|
||||
|
||||
/**
|
||||
* 错误码.
|
||||
*/
|
||||
public static final int ERROR_CODE = 500;
|
||||
|
||||
/**
|
||||
* 错误信息.
|
||||
*/
|
||||
public static final String ERROR_MESSAGE = "内部异常";
|
||||
|
||||
/**
|
||||
* 错误码:参数非法
|
||||
*/
|
||||
public static final int ILLEGAL_ARGUMENT_CODE_ = 100;
|
||||
|
||||
/**
|
||||
* 错误信息:参数非法
|
||||
*/
|
||||
public static final String ILLEGAL_ARGUMENT_MESSAGE = "参数非法";
|
||||
|
||||
/**
|
||||
* 编号.
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 信息.
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 结果数据
|
||||
*/
|
||||
private T result;
|
||||
|
||||
/**
|
||||
* Instantiates a new wrapper. default code=200
|
||||
*/
|
||||
Wrapper() {
|
||||
this(SUCCESS_CODE, SUCCESS_MESSAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new wrapper.
|
||||
*
|
||||
* @param code the code
|
||||
* @param message the message
|
||||
*/
|
||||
Wrapper(int code, String message) {
|
||||
this(code, message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new wrapper.
|
||||
*
|
||||
* @param code the code
|
||||
* @param message the message
|
||||
* @param result the result
|
||||
*/
|
||||
public Wrapper(int code, String message, T result) {
|
||||
super();
|
||||
this.code(code).message(message).result(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the 编号 , 返回自身的引用.
|
||||
*
|
||||
* @param code the new 编号
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
private Wrapper<T> code(int code) {
|
||||
this.setCode(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the 信息 , 返回自身的引用.
|
||||
*
|
||||
* @param message the new 信息
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
private Wrapper<T> message(String message) {
|
||||
this.setMessage(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the 结果数据 , 返回自身的引用.
|
||||
*
|
||||
* @param result the new 结果数据
|
||||
*
|
||||
* @return the wrapper
|
||||
*/
|
||||
public Wrapper<T> result(T result) {
|
||||
this.setResult(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否成功: 依据 Wrapper.SUCCESS_CODE == this.code
|
||||
*
|
||||
* @return code =200,true;否则 false.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean success() {
|
||||
return Wrapper.SUCCESS_CODE == this.code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否成功: 依据 Wrapper.SUCCESS_CODE != this.code
|
||||
*
|
||||
* @return code !=200,true;否则 false.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean error() {
|
||||
return !success();
|
||||
}
|
||||
|
||||
}
|
|
@ -7,7 +7,6 @@
|
|||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -1,12 +1,10 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JEECG BOOT ${project.version}</name>
|
||||
|
||||
<developers>
|
||||
|
|
Loading…
Reference in New Issue