commit
55510d34f7
@ -1,10 +0,0 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
@ -0,0 +1,17 @@
|
||||
package edu.ahbvc.recruit;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@MapperScan(basePackages = "edu.ahbvc.recruit.mapper")
|
||||
public class RecruitApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RecruitApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package edu.ahbvc.recruit.aspect;
|
||||
|
||||
import edu.ahbvc.recruit.annotation.SwitchMethod;
|
||||
import edu.ahbvc.recruit.model.ApiResponseData;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class MethodSwitch {
|
||||
// 使用常量定义功能类型
|
||||
// 注册
|
||||
public static final String REGISTER = "register";
|
||||
// 提交简历
|
||||
public static final String SUBMIT = "submit";
|
||||
// 尝试重新提交
|
||||
public static final String TRY_SUBMIT = "trySubmit";
|
||||
// 放弃投递
|
||||
public static final String ABANDON = "abandon";
|
||||
|
||||
// 使用带有默认值的线程安全的Map存储开关状态
|
||||
private static final Map<String, Boolean> METHOD_SWITCHES = new ConcurrentHashMap<>();
|
||||
|
||||
// 静态代码块,在类加载时执行,用于初始化开关状态
|
||||
static {
|
||||
// 默认情况下,所有功能都启用
|
||||
METHOD_SWITCHES.put(REGISTER, true);
|
||||
METHOD_SWITCHES.put(SUBMIT, true);
|
||||
METHOD_SWITCHES.put(TRY_SUBMIT, true);
|
||||
METHOD_SWITCHES.put(ABANDON, true);
|
||||
}
|
||||
|
||||
// 统一设置方法
|
||||
// 通过此方法可以动态地设置功能的开关状态
|
||||
public static void setSwitch(String methodType, boolean enabled) {
|
||||
// 检查方法类型是否存在
|
||||
if (!METHOD_SWITCHES.containsKey(methodType)) {
|
||||
throw new IllegalArgumentException("Invalid method type: " + methodType);
|
||||
}
|
||||
// 设置功能的开关状态
|
||||
METHOD_SWITCHES.put(methodType, enabled);
|
||||
}
|
||||
|
||||
// 统一获取方法
|
||||
// 通过此方法可以获取功能的开关状态
|
||||
public static boolean isEnabled(String methodType) {
|
||||
// 检查方法类型是否存在
|
||||
if (!METHOD_SWITCHES.containsKey(methodType)) {
|
||||
throw new IllegalArgumentException("Invalid method type: " + methodType);
|
||||
}
|
||||
// 返回功能的开关状态
|
||||
return METHOD_SWITCHES.getOrDefault(methodType, false);
|
||||
}
|
||||
|
||||
// 统一切面处理
|
||||
@Around("@annotation(switchMethod)")
|
||||
public Object controlMethod(ProceedingJoinPoint joinPoint, SwitchMethod switchMethod) throws Throwable {
|
||||
// 获取方法的功能类型
|
||||
String methodType = switchMethod.value();
|
||||
// 检查功能是否启用
|
||||
if (!METHOD_SWITCHES.getOrDefault(methodType, false)) {
|
||||
// 如果功能未启用,则返回错误信息
|
||||
return new ApiResponseData<>("500", null, "此功能已关闭");
|
||||
}
|
||||
// 如果功能已启用,则执行原方法
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,80 @@
|
||||
package edu.ahbvc.recruit.config;
|
||||
|
||||
import edu.ahbvc.recruit.util.JwtUtil;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* JWT请求过滤器
|
||||
* 用于处理JWT认证请求
|
||||
* 继承自OncePerRequestFilter, 确保每个请求只被过滤一次
|
||||
* 实现了doFilterInternal方法, 用于处理请求的认证逻辑
|
||||
* 从请求头中获取JWT令牌, 并验证令牌的有效性
|
||||
* 如果令牌有效, 则将用户信息设置到SecurityContextHolder中, 以便后续的认证和授权操作
|
||||
* 如果令牌无效, 则不做任何操作
|
||||
* 因为JWT相关代码暂未更新, 所以此类用不到
|
||||
* 更新了之后代码量更少了,所以屎山了, 但是功能是有的, 所以就先这样了, 以后再优化
|
||||
* @author c215
|
||||
*/
|
||||
|
||||
// * JWT请求过滤器
|
||||
// * 用于处理JWT认证请求
|
||||
// * 继承自OncePerRequestFilter, 确保每个请求只被过滤一次
|
||||
// * 实现了doFilterInternal方法, 用于处理请求的认证逻辑
|
||||
// * 从请求头中获取JWT令牌, 并验证令牌的有效性
|
||||
// * 如果令牌有效, 则将用户信息设置到SecurityContextHolder中, 以便后续的认证和授权操作
|
||||
// * 如果令牌无效, 则不做任何操作
|
||||
// * 因为JWT相关代码暂未更新, 所以此类用不到
|
||||
// * 更新了之后代码量更少了,所以屎山了, 但是功能是有的, 所以就先这样了, 以后再优化
|
||||
|
||||
@Component
|
||||
public class JwtRequestFilter {
|
||||
// extends OncePerRequestFilter
|
||||
// @Autowired
|
||||
// private UserDetailsService userDetailsService;
|
||||
//
|
||||
// @Autowired
|
||||
// private JwtUtil jwtUtil;
|
||||
//
|
||||
// @Override
|
||||
// protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
// throws ServletException, IOException {
|
||||
//
|
||||
// final String authorizationHeader = request.getHeader("Authorization");
|
||||
//
|
||||
// String username = null;
|
||||
// String jwt = null;
|
||||
//
|
||||
// if (authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
|
||||
// jwt = authorizationHeader.substring(7);
|
||||
// username = jwtUtil.extractUsername(jwt);
|
||||
// }
|
||||
//
|
||||
// if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
|
||||
//
|
||||
// UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
|
||||
//
|
||||
// if (jwtUtil.validateToken(jwt, userDetails)) {
|
||||
//
|
||||
// UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(
|
||||
// userDetails, null, userDetails.getAuthorities());
|
||||
// usernamePasswordAuthenticationToken
|
||||
// .setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
|
||||
// SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);
|
||||
// }
|
||||
// }
|
||||
// chain.doFilter(request, response);
|
||||
// }
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package edu.ahbvc.recruit.config;
|
||||
|
||||
|
||||
import edu.ahbvc.recruit.mapper.UserInter;
|
||||
import edu.ahbvc.recruit.model.token.CustomUserDetailsService;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.authentication.CachingUserDetailsService;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import static org.springframework.security.config.Customizer.withDefaults;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Spring Security配置类
|
||||
* @author c215
|
||||
*/
|
||||
// @Configuration 表示这是一个配置类
|
||||
@Configuration
|
||||
// @EnableWebSecurity 表示启用Spring Security的Web安全支持
|
||||
@EnableWebSecurity
|
||||
public class Security {
|
||||
// SecurityFilterChain 用于配置安全过滤器链
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.cors(withDefaults())
|
||||
.authorizeHttpRequests((requests)->requests
|
||||
.requestMatchers("/","/login","/favicon.ico","/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
|
||||
)
|
||||
.formLogin((form)-> form
|
||||
.loginPage("/login.html")
|
||||
.permitAll()
|
||||
);
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
||||
// CORS 配置源 用于配置跨域请求的CORS配置
|
||||
// 正式上线后需要修改为允许指定的域名和端口
|
||||
@Bean
|
||||
CorsConfigurationSource corsConfigurationSource() {
|
||||
CorsConfiguration configuration = new CorsConfiguration();
|
||||
// 允许所有本地地址和端口
|
||||
configuration.setAllowedOriginPatterns(Arrays.asList(
|
||||
"http://localhost:*",
|
||||
"http://127.0.0.1:*"
|
||||
));
|
||||
// 允许所有请求方法
|
||||
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
|
||||
// 允许所有请求头
|
||||
configuration.setAllowedHeaders(Collections.singletonList("*"));
|
||||
// 允许携带凭证
|
||||
configuration.setAllowCredentials(true);
|
||||
|
||||
// 注册CORS配置源
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
// 注册CORS配置源
|
||||
source.registerCorsConfiguration("/**", configuration);
|
||||
return source;
|
||||
}
|
||||
|
||||
// UserDetailsService 用于加载用户信息
|
||||
// 因为JWT相关代码暂未更新, 所以此方法用不到
|
||||
@Bean
|
||||
public UserDetailsService userDetailsService(UserInter userRepository){
|
||||
return new CustomUserDetailsService(userRepository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder(){
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package edu.ahbvc.recruit.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* Web配置
|
||||
* @author c215
|
||||
*/
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
// 配置跨域请求的CORS配置
|
||||
// 正式上线后需要修改为允许指定的域名和端口
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
// 允许所有本地地址和端口
|
||||
.allowedOrigins("http://localhost:3333")
|
||||
// 允许的请求方法
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE")
|
||||
// 允许的请求头
|
||||
.allowedHeaders("*")
|
||||
// 允许凭证
|
||||
.allowCredentials(true)
|
||||
// 预检请求的缓存时间
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
// 配置静态资源的处理
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// 配置静态资源的处理
|
||||
// 允许访问的路径
|
||||
registry.addResourceHandler("/**")
|
||||
// 允许访问的路径
|
||||
.addResourceLocations("classpath:/static/");
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,232 @@
|
||||
package edu.ahbvc.recruit.controller;
|
||||
|
||||
import edu.ahbvc.recruit.aspect.MethodSwitch;
|
||||
import edu.ahbvc.recruit.model.*;
|
||||
import edu.ahbvc.recruit.model.page.*;
|
||||
import edu.ahbvc.recruit.model.token.Token;
|
||||
import edu.ahbvc.recruit.service.ThingServiceImpl;
|
||||
import edu.ahbvc.recruit.service.UserServiceImpl;
|
||||
import edu.ahbvc.recruit.util.JwtUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Restful API接口
|
||||
* <p>
|
||||
* 用于提供前端页面所需的接口
|
||||
* </p>
|
||||
* @author c215
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class RestFulController {
|
||||
|
||||
/**
|
||||
* 开发环境下为true, 生产环境下为false
|
||||
* 本地开发环境下, 为了方便测试, 所有接口都返回模拟数据
|
||||
* 生产环境下, 所有接口都返回真实数据
|
||||
* 为了避免在生产环境下, 出现错误, 导致数据泄露, 请在生产环境下, 关闭该功能
|
||||
* 关闭方法: 将下方isDev的值改为false
|
||||
*/
|
||||
private final boolean isDev = false;
|
||||
|
||||
/**
|
||||
* 注入UserService和ThingService
|
||||
* 用于获取用户信息和批次信息
|
||||
*/
|
||||
private UserServiceImpl userService;
|
||||
|
||||
/**
|
||||
* 注入ThingService
|
||||
* 用于获取批次信息
|
||||
*/
|
||||
private ThingServiceImpl thingService;
|
||||
|
||||
/**
|
||||
* 注入UserService
|
||||
* 用于获取用户信息
|
||||
*
|
||||
* @param userService 用户服务
|
||||
*/
|
||||
@Autowired
|
||||
public void setUserService(UserServiceImpl userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注入ThingService
|
||||
* 用于获取批次信息
|
||||
*
|
||||
* @param thingService 批次服务
|
||||
*/
|
||||
@Autowired
|
||||
public void setThingService(ThingServiceImpl thingService) {
|
||||
this.thingService = thingService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有批次的{名称-id}以供前端下拉框使用
|
||||
*
|
||||
* @return 批次集合{名称-id}
|
||||
*/
|
||||
@GetMapping("tableBatchOption")
|
||||
public ApiResponseData<HashMap<String, Object>> getBatcheOption() {
|
||||
// 获取所有批次信息
|
||||
List<Batch> batches = thingService.getBatchOption();
|
||||
// 封装返回数据
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
// 将批次信息存入map中
|
||||
map.put("list", batches);
|
||||
// 创建ApiResponseData对象, 用于封装返回数据
|
||||
ApiResponseData<HashMap<String, Object>> responseData = new ApiResponseData<>();
|
||||
// 设置返回数据的状态码和消息
|
||||
responseData.setCode("0");
|
||||
// 设置返回数据的消息
|
||||
responseData.setMessage("获取批次数据");
|
||||
// 设置返回数据
|
||||
responseData.setData(map);
|
||||
// 返回ApiResponseData对象
|
||||
return responseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位下拉框内容
|
||||
*
|
||||
* @return 岗位集合{岗位名-id}
|
||||
*/
|
||||
@GetMapping("getPositionOption")
|
||||
public ApiResponseData<HashMap<String, Object>> getPositionOption() {
|
||||
// 获取所有岗位信息
|
||||
List<Position> list = thingService.getPositionOption();
|
||||
// 封装返回数据
|
||||
ApiResponseData<HashMap<String, Object>> responseData = new ApiResponseData<>();
|
||||
// 设置返回数据的状态码和消息
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
// 将岗位信息存入map中
|
||||
map.put("list", list);
|
||||
|
||||
if (list != null) {
|
||||
// 设置返回数据的状态码和消息
|
||||
responseData.setCode("0");
|
||||
// 设置返回数据的消息
|
||||
responseData.setMessage("获取信息成功");
|
||||
// 设置返回数据
|
||||
responseData.setData(map);
|
||||
|
||||
} else {
|
||||
// 设置返回数据的状态码和消息
|
||||
responseData.setCode("500");
|
||||
// 设置返回数据的消息
|
||||
responseData.setMessage("获取信息失败");
|
||||
|
||||
}
|
||||
// 返回ApiResponseData对象
|
||||
return responseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authorizationHeader 请求头Token
|
||||
* @return 用户前台获取当前批次
|
||||
*/
|
||||
@GetMapping("batchs")
|
||||
public ApiResponseData<HashMap<String, Object>> getBatches(
|
||||
@RequestHeader("Authorization") String authorizationHeader) {
|
||||
// 解析Token
|
||||
Token user;
|
||||
// 判断Token是否为空
|
||||
user = JwtUtil.parseJWT(authorizationHeader);
|
||||
if (user == null) {
|
||||
// 返回ApiResponseData对象
|
||||
return new ApiResponseData<>("401", null, "登录失效,请重新登录");
|
||||
}
|
||||
// 获取当前批次信息
|
||||
int infoIntegrity = 0;
|
||||
// 获取当前批次信息
|
||||
Batch batch = thingService.getCurrentBatches();
|
||||
// 获取当前用户信息
|
||||
User one = userService.getOne(user.getUserId());
|
||||
// 判断当前用户是否已经报名
|
||||
boolean alreadyRecruit = userService.alreadyRecruit(String.valueOf(user.getUserId()));
|
||||
if (one.getIdNum() != null) {
|
||||
// 判断当前用户是否已经填写过信息
|
||||
infoIntegrity = 1;
|
||||
}
|
||||
// 判断当前批次是否已经结束
|
||||
boolean disableSubmit = !MethodSwitch.isEnabled(MethodSwitch.SUBMIT);
|
||||
// 封装返回数据
|
||||
HashMap<String, Object> map = new HashMap<>(10);
|
||||
// 将批次信息存入map中
|
||||
map.put("oneBatch", batch);
|
||||
// 将信息完整性存入map中
|
||||
map.put("infoIntegrity", infoIntegrity);
|
||||
// 将是否已经报名存入map中
|
||||
map.put("disableRecruit", disableSubmit);
|
||||
// 将是否已经报名存入map中
|
||||
map.put("alreadyRecruit", alreadyRecruit);
|
||||
// 创建ApiResponseData对象, 用于封装返回数据
|
||||
ApiResponseData<HashMap<String, Object>> responseData = new ApiResponseData<>();
|
||||
// 设置返回数据的状态码和消息
|
||||
responseData.setCode("0");
|
||||
// 设置返回数据的消息
|
||||
responseData.setMessage("获取批次数据");
|
||||
// 设置返回数据
|
||||
responseData.setData(map);
|
||||
// 返回ApiResponseData对象
|
||||
return responseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索岗位
|
||||
*
|
||||
* @param authorizationHeader 请求头Token
|
||||
* @param requestBody 请求体
|
||||
* @return 岗位集合
|
||||
*/
|
||||
@PostMapping("searchPositions")
|
||||
public ApiResponseData<HashMap<String, Object>> getPositions(@RequestBody SearchAndPageOfPositionByUser requestBody,
|
||||
@RequestHeader("Authorization") String authorizationHeader) {
|
||||
|
||||
// 解析Token
|
||||
Token token;
|
||||
token = JwtUtil.parseJWT(authorizationHeader);
|
||||
if (token == null) {
|
||||
// 返回ApiResponseData对象
|
||||
return new ApiResponseData<>("401", null, "登录失效,请重新登录");
|
||||
}
|
||||
// 获取当前批次信息
|
||||
int batchId = requestBody.getBatchId();
|
||||
// 获取当前批次信息
|
||||
int offset = 0;
|
||||
// 获取当前批次信息
|
||||
int size = Integer.MAX_VALUE;
|
||||
// String code = requestBody.getCode();
|
||||
// 获取当前批次信息
|
||||
int positionsNum = thingService.getPositionsNum();
|
||||
// 判断当前批次是否已经结束
|
||||
if (requestBody.getCurrentPage() >= positionsNum) {
|
||||
// 返回ApiResponseData对象
|
||||
return new ApiResponseData<>("500", null, "参数异常");
|
||||
}
|
||||
// 获取当前批次信息
|
||||
List<Position> positionList = thingService.getSomePosition(batchId, offset, size);
|
||||
// 封装返回数据
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
// 将批次信息存入map中
|
||||
map.put("list", positionList);
|
||||
// 创建ApiResponseData对象, 用于封装返回数据
|
||||
ApiResponseData<HashMap<String, Object>> responseData = new ApiResponseData<>();
|
||||
// 设置返回数据的状态码和消息
|
||||
responseData.setCode("0");
|
||||
// 设置返回数据的消息
|
||||
responseData.setMessage("获取部门数据");
|
||||
// 设置返回数据
|
||||
responseData.setData(map);
|
||||
// 返回ApiResponseData对象
|
||||
return responseData;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,435 @@
|
||||
package edu.ahbvc.recruit.mapper;
|
||||
|
||||
import edu.ahbvc.recruit.model.Batch;
|
||||
import edu.ahbvc.recruit.model.Position;
|
||||
import edu.ahbvc.recruit.model.Thing;
|
||||
import edu.ahbvc.recruit.model.ThingWithUser;
|
||||
import edu.ahbvc.recruit.model.export.Excel;
|
||||
import edu.ahbvc.recruit.model.export.Ticket;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
package edu.ahbvc.recruit.mapper;
|
||||
|
||||
// 导入必要的模型类和注解
|
||||
import edu.ahbvc.recruit.model.Batch;
|
||||
import edu.ahbvc.recruit.model.Position;
|
||||
import edu.ahbvc.recruit.model.Thing;
|
||||
import edu.ahbvc.recruit.model.ThingWithUser;
|
||||
import edu.ahbvc.recruit.model.export.Excel;
|
||||
import edu.ahbvc.recruit.model.export.Ticket;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*
|
||||
* ThingInter 接口 - 招聘事务相关的数据库操作接口
|
||||
* 提供对招聘批次、岗位、用户投递关系等数据的CRUD操作
|
||||
*/
|
||||
@Repository // 标识为Spring的Repository组件
|
||||
@Mapper // MyBatis的Mapper接口
|
||||
public interface ThingInter {
|
||||
|
||||
/**
|
||||
* 获取准考证数据
|
||||
* @param recruitId 招聘ID
|
||||
* @param id 投递记录ID
|
||||
* @return 包含准考证数据的Ticket对象
|
||||
*/
|
||||
@Select("SELECT `u`.idnum, `u`.`name`, `u`.phone tel, p.`code`, "
|
||||
+ "CASE WHEN p.jobTitle LIKE '管%' THEN "
|
||||
+ "'行政部门' " + "WHEN p.jobTitle LIKE '专业%' THEN "
|
||||
+ "'二级学院' ELSE '其他部门'" + " END AS department ,"
|
||||
+ "(CASE WHEN ut.ticket_num = 0 THEN "
|
||||
+ "(SELECT MAX(ut2.ticket_num)+1 FROM `USER-thing` AS ut2 WHERE `thingid` = #{recruitId}) "
|
||||
+ "ELSE ut.ticket_num END) AS ticketNumber "
|
||||
+ "FROM "
|
||||
+ "`USER-thing` AS ut " + "LEFT JOIN `batch-position` AS `bp` ON `bp`.id = ut.thingid "
|
||||
+ "LEFT JOIN `positions` AS p ON `p`.id = bp.positionid "
|
||||
+ "LEFT JOIN `USER` AS u ON ut.userid = u.id "
|
||||
+ "LEFT JOIN batchs ON batchs.id = bp.batchid" + " WHERE "
|
||||
+ "ut.id = #{id}")
|
||||
Ticket getTicketData(@Param("recruitId")Integer recruitId, @Param("id")Integer id);
|
||||
|
||||
/**
|
||||
* 获取指定招聘的最大准考证号
|
||||
* @param recruitId 招聘ID
|
||||
* @return 最大准考证号
|
||||
*/
|
||||
@Select("SELECT MAX(ticket_num) FROM `user-thing` WHERE `thingid` = #{recruitId}")
|
||||
int getTicketNum(Integer recruitId);
|
||||
|
||||
/**
|
||||
* 检查准考证是否已打印
|
||||
* @param thingid 投递记录ID
|
||||
* @return 准考证号(0表示未打印)
|
||||
*/
|
||||
@Select("SELECT `ticket_num` FROM `user-thing` where `id`=#{thingid}")
|
||||
int isPrintedTicket(Integer thingid);
|
||||
|
||||
/**
|
||||
* 设置准考证已打印
|
||||
* @param ticketNum 准考证号
|
||||
* @param thingId 投递记录ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `user-thing` "
|
||||
+ "SET `ticket_num` = #{arg0} WHERE `id` = #{arg1}")
|
||||
int setTicketPrinted(Integer ticketNum, Integer thingId);
|
||||
|
||||
/**
|
||||
* 获取用户可投递的招聘批次信息
|
||||
* @param userid 用户ID
|
||||
* @param batch 批次ID(0表示全部)
|
||||
* @return 批次列表
|
||||
*/
|
||||
List<Batch> getthingForuser(@Param("userid") int userid, @Param("batch") int batch);
|
||||
|
||||
/**
|
||||
* 获取用户已投递的招聘信息
|
||||
* @param userid 用户ID
|
||||
* @return 招聘信息列表
|
||||
*/
|
||||
List<Thing> getThingAboutUser(@Param("userid") int userid);
|
||||
|
||||
/**
|
||||
* 分页获取招聘信息(管理员用)
|
||||
* @param currentPage 当前页
|
||||
* @param size 每页大小
|
||||
* @param jobTitles 岗位名称列表
|
||||
* @param batches 批次列表
|
||||
* @param status 状态列表
|
||||
* @param name 名称
|
||||
* @return 招聘信息列表
|
||||
*/
|
||||
List<ThingWithUser> getThings(@Param("currentPage") int currentPage, @Param("size") int size,
|
||||
@Param("jobTitles") List<Integer> jobTitles, @Param("batches") List<Integer> batches,
|
||||
@Param("status") List<Integer> status, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 分页获取待审核招聘信息(超级管理员用)
|
||||
* @param currentPage 当前页
|
||||
* @param size 每页大小
|
||||
* @param jobTitles 岗位名称列表
|
||||
* @param batches 批次列表
|
||||
* @return 招聘信息列表
|
||||
*/
|
||||
List<ThingWithUser> getAuditThings(@Param("currentPage") int currentPage, @Param("size") int size,
|
||||
@Param("jobTitles") List<Integer> jobTitles, @Param("batches") List<Integer> batches);
|
||||
|
||||
/**
|
||||
* 根据ID列表获取招聘信息
|
||||
* @param id ID列表
|
||||
* @return 招聘信息列表
|
||||
*/
|
||||
List<ThingWithUser> getThingsById(@Param("thingId") List<Integer> id);
|
||||
|
||||
/**
|
||||
* 获取单个招聘详细信息
|
||||
* @param thingId 招聘ID
|
||||
* @return 招聘详细信息
|
||||
*/
|
||||
@Select("SELECT `ut`.`id` thingId, `ut`.`status`,bp.id recruitId,"
|
||||
+ "`ut`.`awardsAndPunishments`, `ut`.`note`, `ut`.`qualificationResult`,"
|
||||
+ "batchs.id batchid,batchs.`name` batchname,p.id positionId, p.code, p.jobTitle,"
|
||||
+ "u.id userId, u.`name` username" + " FROM `user-thing` AS ut"
|
||||
+ " LEFT JOIN `batch-position` AS `bp` ON `bp`.id = ut.thingid "
|
||||
+ " LEFT JOIN `positions` AS p ON `p`.id = bp.positionid" + " LEFT JOIN `user` AS u ON ut.userid = u.id "
|
||||
+ " LEFT JOIN batchs ON batchs.id=bp.batchid" + " WHERE ut.id = #{id}")
|
||||
ThingWithUser getOneThing(@Param("id") int thingId);
|
||||
|
||||
/**
|
||||
* 获取未处理的招聘数量
|
||||
* @return 未处理数量
|
||||
*/
|
||||
@Select("SELECT count(id) FROM `user-thing` WHERE `status` = '0' LIMIT 0,1000")
|
||||
int getUnsettledThingsNum();
|
||||
|
||||
/**
|
||||
* 获取招聘信息数量
|
||||
* @param jobTitles 岗位名称列表
|
||||
* @param batches 批次列表
|
||||
* @param status 状态列表
|
||||
* @param name 名称
|
||||
* @return 数量
|
||||
*/
|
||||
Integer getThingsNum(@Param("jobTitles") List<Integer> jobTitles, @Param("batches") List<Integer> batches,
|
||||
@Param("status") List<Integer> status, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 更新招聘状态
|
||||
* @param thingid 招聘ID
|
||||
* @param status 状态
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `user-thing` SET `user-thing`.`status`= ${status} WHERE `user-thing`.id=${thingid}")
|
||||
int updateThingStatus(@Param("thingid") int thingid, @Param("status") int status);
|
||||
|
||||
/**
|
||||
* 拒绝招聘申请
|
||||
* @param thingid 招聘ID
|
||||
* @param status 状态
|
||||
* @param qualificationResult 资格审查结果
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `user-thing` SET `user-thing`.`status`= ${status},`user-thing`.`qualificationResult` = #{qualificationResult} WHERE `user-thing`.id=${thingid}")
|
||||
int refuseThing(@Param("thingid") int thingid, @Param("status") int status,
|
||||
@Param("qualificationResult") String qualificationResult);
|
||||
|
||||
/**
|
||||
* 更新招聘信息
|
||||
* @param thingid 招聘ID
|
||||
* @param awardsAndPunishments 奖惩信息
|
||||
* @param note 备注
|
||||
* @param qualificationResult 资格审查结果
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `user-thing` SET " + "`user-thing`.`awardsAndPunishments`= IFNULL(#{awardsAndPunishments}, ''),"
|
||||
+ "`user-thing`.`note`= IFNULL(#{note}, ''),"
|
||||
+ "`user-thing`.`qualificationResult`= IFNULL(#{qualificationResult}, '')"
|
||||
+ "WHERE `user-thing`.id = #{thingid}")
|
||||
int updateThingInfo(@Param("thingid") int thingid,
|
||||
@Param("awardsAndPunishments") String awardsAndPunishments, @Param("note") String note,
|
||||
@Param("qualificationResult") String qualificationResult);
|
||||
|
||||
/**
|
||||
* 更新资格审查结果
|
||||
* @param thingid 招聘ID
|
||||
* @param qualificationResult 资格审查结果
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `user-thing` SET "
|
||||
+ "`user-thing`.`qualificationResult`= IFNULL(#{qualificationResult}, '')"
|
||||
+ "WHERE `user-thing`.id = #{thingid}")
|
||||
int updateThingQualification(@Param("thingid") int thingid,
|
||||
@Param("qualificationResult") String qualificationResult);
|
||||
|
||||
// 批次相关操作
|
||||
/**
|
||||
* 获取所有批次选项
|
||||
* @return 批次列表
|
||||
*/
|
||||
@Select("SELECT batchs.id,batchs.name FROM `batchs`")
|
||||
List<Batch> getBatchOption();
|
||||
|
||||
/**
|
||||
* 获取单个批次信息
|
||||
* @param id 批次ID
|
||||
* @return 批次信息
|
||||
*/
|
||||
@Select("SELECT batchs.*, COUNT(positions.id) num " + "FROM `batchs` "
|
||||
+ "LEFT JOIN `batch-position` ON `batch-position`.batchid = batchs.id "
|
||||
+ "LEFT JOIN positions ON positions.id=`batch-position`.positionid "
|
||||
+ "GROUP BY batchs.id having batchs.id=#{id}")
|
||||
Batch getBatch(int id);
|
||||
|
||||
/**
|
||||
* 分页获取批次列表
|
||||
* @param currentPage 当前页
|
||||
* @param size 每页大小
|
||||
* @param key 关键字
|
||||
* @param state 状态
|
||||
* @return 批次列表
|
||||
*/
|
||||
List<Batch> getBatches(@Param("currentPage") int currentPage, @Param("size") int size,
|
||||
@Param("key") String key, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 获取当前开放的批次
|
||||
* @return 批次信息
|
||||
*/
|
||||
@Select("SELECT batchs.*, COUNT(positions.id) positionNum " + "FROM `batchs` "
|
||||
+ "LEFT JOIN `batch-position` ON `batch-position`.batchid = batchs.id "
|
||||
+ "LEFT JOIN positions ON positions.id=`batch-position`.positionid "
|
||||
+ "GROUP BY batchs.id having batchs.open=1 LIMIT 1")
|
||||
Batch getCurrentBatch();
|
||||
|
||||
/**
|
||||
* 获取批次数量
|
||||
* @param key 关键字
|
||||
* @param state 状态
|
||||
* @return 数量
|
||||
*/
|
||||
int getBatchesNum(@Param("key") String key, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 更新批次信息
|
||||
* @param batch 批次对象
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE batchs SET name = #{name},startime = #{startime},"
|
||||
+ "deadline = #{deadline},open = #{open}, `disableAutoUpdate`=#{disableAutoUpdate} where id = #{id}")
|
||||
int updateBatch(Batch batch);
|
||||
|
||||
/**
|
||||
* 开启批次
|
||||
* @param id 批次ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE batchs SET open = 1 where id = #{id}")
|
||||
int updateBatchOpen(int id);
|
||||
|
||||
/**
|
||||
* 关闭所有批次
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE batchs SET open = 0")
|
||||
int updateBatchClose();
|
||||
|
||||
/**
|
||||
* 添加批次
|
||||
* @param batch 批次对象
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Insert("INSERT INTO `batchs` (`open`, `name`, `disableAutoUpdate`) VALUES (#{open}, #{name}, #{disableAutoUpdate})")
|
||||
int addBatch(Batch batch);
|
||||
|
||||
/**
|
||||
* 删除批次
|
||||
* @param id 批次ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Delete("DELETE FROM `batchs` WHERE `id` = #{id}")
|
||||
int delBatch(int id);
|
||||
|
||||
// 岗位相关操作
|
||||
/**
|
||||
* 分页获取岗位列表
|
||||
* @param currentPage 当前页
|
||||
* @param size 每页大小
|
||||
* @return 岗位列表
|
||||
*/
|
||||
List<Position> getPositions(@Param("currentPage") int currentPage, @Param("size") int size);
|
||||
|
||||
/**
|
||||
* 获取岗位数量
|
||||
* @return 数量
|
||||
*/
|
||||
int getPositionsNum();
|
||||
|
||||
/**
|
||||
* 获取岗位选项
|
||||
* @return 岗位选项列表
|
||||
*/
|
||||
@Select("SELECT positions.id, CONCAT(positions.code, ' - ', positions.jobTitle) AS jobTitle FROM positions")
|
||||
List<Position> getPositionOption();
|
||||
|
||||
/**
|
||||
* 分页获取指定批次的岗位
|
||||
* @param batchid 批次ID
|
||||
* @param offset 偏移量
|
||||
* @param size 每页大小
|
||||
* @return 岗位列表
|
||||
*/
|
||||
List<Position> getSomePosition(@Param("batchid") int batchid, @Param("offset") int offset,
|
||||
@Param("size") int size);
|
||||
|
||||
/**
|
||||
* 获取单个岗位详情
|
||||
* @param id 岗位ID
|
||||
* @return 岗位详情
|
||||
*/
|
||||
@Select("SELECT positions.*, COUNT(`user-thing`.userid) toll,"
|
||||
+ " batchs.id bid,batchs.`open`, batchs.`name`, batchs.startime bstart"
|
||||
+ " FROM positions "
|
||||
+ " LEFT JOIN `user-thing` ON `user-thing`.thingid = positions.id"
|
||||
+ " LEFT JOIN batchs ON batchs.id = positions.batch WHERE positions.id = ${id}"
|
||||
+ " GROUP BY positions.id")
|
||||
Position getOnePosition(int id);
|
||||
|
||||
/**
|
||||
* 添加岗位
|
||||
* @param p 岗位对象
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Insert("INSERT INTO positions (`jobTitle`, `code`, `type`, `specialty`, `education`, `degree`, `maxAge`, `sex`, `zzmm`, `info`, `toll`, `require`) "
|
||||
+ "VALUES (#{jobTitle}, #{code}, #{type}, #{specialty}, #{education}, #{degree}, #{maxAge}, #{sex}, #{zzmm}, #{info}, #{toll}, #{require})")
|
||||
int addPosition(Position p);
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param id 岗位ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Delete("DELETE FROM `positions` WHERE `id` = #{id}")
|
||||
int delPosition(int id);
|
||||
|
||||
/**
|
||||
* 批量删除岗位
|
||||
* @param id 岗位ID列表
|
||||
* @return 影响的行数
|
||||
*/
|
||||
int delPositions(@Param("id") List<Integer> id);
|
||||
|
||||
/**
|
||||
* 更新岗位信息
|
||||
* @param p 岗位对象
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `positions` SET `jobTitle` = #{jobTitle}, `code` = #{code}, `type` = #{type}, `specialty` = #{specialty}, `education` = #{education}, `degree` = #{degree}, `maxAge` = #{maxAge}, `sex` = #{sex}, `zzmm` = #{zzmm}, `info` = #{info}, `toll` = #{toll}, `require` = #{require} WHERE `id` = #{id}")
|
||||
int updatePosition(Position p);
|
||||
|
||||
// 招聘岗位相关操作
|
||||
/**
|
||||
* 分页获取招聘岗位列表
|
||||
* @param currentPage 当前页
|
||||
* @param size 每页大小
|
||||
* @param jobTitle 岗位名称列表
|
||||
* @param batchs 批次列表
|
||||
* @return 招聘岗位列表
|
||||
*/
|
||||
List<Thing> getRecruits(@Param("currentPage") int currentPage, @Param("size") int size,
|
||||
@Param("jobTitle") List<Integer> jobTitle, @Param("batch") List<Integer> batchs);
|
||||
|
||||
/**
|
||||
* 获取招聘岗位数量
|
||||
* @param jobTitle 岗位名称列表
|
||||
* @param batch 批次列表
|
||||
* @return 数量
|
||||
*/
|
||||
int getRecruitNum(@Param("jobTitle") List<Integer> jobTitle, @Param("batch") List<Integer> batch);
|
||||
|
||||
/**
|
||||
* 添加招聘岗位
|
||||
* @param batchid 批次ID
|
||||
* @param positionid 岗位ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Insert("INSERT INTO `batch-position` (`batchid`, `positionid`) VALUES (#{batchid}, #{positionid})")
|
||||
int addRecruit(@Param("batchid") Integer batchid, @Param("positionid") Integer positionid);
|
||||
|
||||
/**
|
||||
* 更新招聘岗位
|
||||
* @param id IDm
|
||||
* @param batchid 批次ID
|
||||
* @param positionid 岗位ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Update("UPDATE `batch-position` SET `batchid` = #{batchid}, `positionid` = #{positionid} WHERE id = #{id}")
|
||||
int updateRecruit(@Param("id") Integer id, @Param("batchid") Integer batchid,
|
||||
@Param("positionid") Integer positionid);
|
||||
|
||||
/**
|
||||
* 删除招聘岗位
|
||||
* @param id ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
@Delete("DELETE FROM `batch-position` WHERE id = #{id}")
|
||||
int deleteRecruit(int id);
|
||||
|
||||
/**
|
||||
* 获取导出总表的数据
|
||||
* @return 准备导出的Excel数据
|
||||
*/
|
||||
ArrayList<Excel> getPrintData();
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class Admin {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String account;
|
||||
private String pwd;
|
||||
private String phone;
|
||||
private Integer promise;
|
||||
public Admin() {
|
||||
super();
|
||||
}
|
||||
public Admin(int id, String name, String num, String pwd, String tel, Integer viewOnly) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.account = num;
|
||||
this.pwd = pwd;
|
||||
this.phone = tel;
|
||||
this.promise = viewOnly;
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
public void setAccount(String num) {
|
||||
this.account = num;
|
||||
}
|
||||
public String getPwd() {
|
||||
return pwd;
|
||||
}
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String tel) {
|
||||
this.phone = tel;
|
||||
}
|
||||
public Integer getPromise() {
|
||||
return promise;
|
||||
}
|
||||
public void setPromise(Integer viewOnly) {
|
||||
this.promise = viewOnly;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Admin [id=" + id + ", name=" + name + ", account=" + account + ", pwd=" + pwd + ", phone=" + phone + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
* 封装返回数据
|
||||
* 统一返回数据格式
|
||||
*/
|
||||
public class ApiResponseData<T> {
|
||||
|
||||
public String code;
|
||||
public T data;
|
||||
public String message;
|
||||
|
||||
public ApiResponseData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ApiResponseData(String code, T data, String message) {
|
||||
super();
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApiResponseData [code=" + code + ", data=" + data + ", message=" + message + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public class Batch {
|
||||
private int id;
|
||||
@JsonIgnore
|
||||
private int index;
|
||||
private String name;
|
||||
private String startTime;
|
||||
private String deadline;
|
||||
private int open;
|
||||
private int disableAutoUpdate;
|
||||
private int positionNum;
|
||||
|
||||
public Batch() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getDeadline() {
|
||||
return deadline;
|
||||
}
|
||||
|
||||
public void setDeadline(String deadline) {
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
public int getPositionNum() {
|
||||
return positionNum;
|
||||
}
|
||||
|
||||
public void setPositionNum(int positionNum) {
|
||||
this.positionNum = positionNum;
|
||||
}
|
||||
|
||||
public int getOpen() {
|
||||
return open;
|
||||
}
|
||||
|
||||
public void setOpen(int canuse) {
|
||||
this.open = canuse;
|
||||
}
|
||||
|
||||
public int getDisableAutoUpdate() {
|
||||
return disableAutoUpdate;
|
||||
}
|
||||
|
||||
public void setDisableAutoUpdate(int disableAutoUPDATE) {
|
||||
this.disableAutoUpdate = disableAutoUPDATE;
|
||||
}
|
||||
|
||||
|
||||
public int getNum() {
|
||||
return positionNum;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.positionNum = num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Batch [id=" + id + ", index=" + index + ", name=" + name + ", startime=" + startTime + ", deadline="
|
||||
+ deadline + ", open=" + open + ", disableAutoUpdate=" + disableAutoUpdate + ", positionNum="
|
||||
+ positionNum + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
/**
|
||||
* 岗位信息
|
||||
*
|
||||
* @author c215
|
||||
*/
|
||||
public class Position {
|
||||
private int id;
|
||||
/**
|
||||
* 标识该岗位在对应批次下的编号(序号) 例如 2003 01 001
|
||||
*/
|
||||
private int recruitId;
|
||||
private String code;
|
||||
private String jobTitle;
|
||||
private int toll;
|
||||
private String type;
|
||||
private String specialty;
|
||||
private int education;
|
||||
private int degree;
|
||||
/**
|
||||
* 性别要求 0不限 1男 2女
|
||||
* 数据库类型 tinyint
|
||||
* 默认值 0 不限
|
||||
*/
|
||||
private int sex;
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
private String politicalStatus;
|
||||
private int maxAge;
|
||||
private String info;
|
||||
private String require;
|
||||
|
||||
|
||||
public Position() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Position(int id, int recruitId, String code, String jobTitle, int toll,
|
||||
int education, int degree, int maxAge, String info, String require) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.recruitId = recruitId;
|
||||
this.code = code;
|
||||
this.jobTitle = jobTitle;
|
||||
this.toll = toll;
|
||||
this.education = education;
|
||||
this.degree = degree;
|
||||
this.maxAge = maxAge;
|
||||
this.info = info;
|
||||
this.require = require;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
public int getRecruitId() {
|
||||
return recruitId;
|
||||
}
|
||||
|
||||
public void setRecruitId(int recruitId) {
|
||||
this.recruitId = recruitId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getJobTitle() {
|
||||
return jobTitle;
|
||||
}
|
||||
public void setJobTitle(String jobTitle) {
|
||||
this.jobTitle = jobTitle;
|
||||
}
|
||||
public int getEducation() {
|
||||
return education;
|
||||
}
|
||||
public void setEducation(int degree) {
|
||||
this.education = degree;
|
||||
}
|
||||
public int getMaxAge() {
|
||||
return maxAge;
|
||||
}
|
||||
|
||||
public void setMaxAge(int maxAge) {
|
||||
this.maxAge = maxAge;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public int getDegree() {
|
||||
return degree;
|
||||
}
|
||||
|
||||
public void setDegree(int degree) {
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSpecialty() {
|
||||
return specialty;
|
||||
}
|
||||
|
||||
public void setSpecialty(String specialty) {
|
||||
this.specialty = specialty;
|
||||
}
|
||||
|
||||
public String getPoliticalStatus() {
|
||||
return politicalStatus;
|
||||
}
|
||||
|
||||
public void setPoliticalStatus(String politicalStatus) {
|
||||
this.politicalStatus = politicalStatus;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getToll() {
|
||||
return toll;
|
||||
}
|
||||
public void setToll(int toll) {
|
||||
this.toll = toll;
|
||||
}
|
||||
|
||||
public String getRequire() {
|
||||
return require;
|
||||
}
|
||||
|
||||
public void setRequire(String require) {
|
||||
this.require = require;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Position [id=" + id + ", recruitId=" + recruitId + ", code=" + code + ", jobTitle=" + jobTitle
|
||||
+ ", toll=" + toll + ", maxAge=" + maxAge + ", education="
|
||||
+ education + ", info=" + info + ", require=" + require + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class SwitchMethodStatus {
|
||||
|
||||
private Integer open;
|
||||
|
||||
public SwitchMethodStatus() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SwitchMethodStatus(Integer open) {
|
||||
super();
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
public Integer getOpen() {
|
||||
return open;
|
||||
}
|
||||
|
||||
public void setOpen(Integer open) {
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Thing {
|
||||
/** 岗位id */
|
||||
private int positionId;
|
||||
/** 岗位与批次关系表的主键id */
|
||||
private int recruitId;
|
||||
/** 用户与<岗位批次>关系表的主键id */
|
||||
private int thingId;
|
||||
private String jobTitle;
|
||||
private String code;
|
||||
private Integer ticketNum;
|
||||
private int batchId;
|
||||
private String batchname;
|
||||
private int degree;
|
||||
private int status;
|
||||
private String awardsAndPunishments;
|
||||
private String note;
|
||||
private String qualificationResult;
|
||||
/**
|
||||
* 用户投递时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd,HH-mm-ss")
|
||||
private Date time;
|
||||
/**
|
||||
* 对应用户是否申请过该岗位,无用
|
||||
*/
|
||||
private int ok;
|
||||
|
||||
public Thing() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Thing(int id, int recruitId, String batch, int batchid, int degree, int status,
|
||||
String jobTitle, int ok) {
|
||||
super();
|
||||
this.positionId = id;
|
||||
this.recruitId = recruitId;
|
||||
this.batchname = batch;
|
||||
this.batchId = batchid;
|
||||
this.degree = degree;
|
||||
this.status = status;
|
||||
this.jobTitle = jobTitle;
|
||||
this.ok = ok;
|
||||
}
|
||||
|
||||
public int getPositionId() {
|
||||
return positionId;
|
||||
}
|
||||
|
||||
public void setPositionId(int id) {
|
||||
this.positionId = id;
|
||||
}
|
||||
|
||||
public int getRecruitId() {
|
||||
return recruitId;
|
||||
}
|
||||
|
||||
public void setRecruitId(int recruitId) {
|
||||
this.recruitId = recruitId;
|
||||
}
|
||||
|
||||
public int getThingId() {
|
||||
return thingId;
|
||||
}
|
||||
|
||||
public void setThingId(int thingId) {
|
||||
this.thingId = thingId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getTicketNum() {
|
||||
return ticketNum;
|
||||
}
|
||||
|
||||
public void setTicketNum(Integer ticketNum) {
|
||||
this.ticketNum = ticketNum;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getBatchname() {
|
||||
return batchname;
|
||||
}
|
||||
|
||||
public void setBatchname(String batch) {
|
||||
this.batchname = batch;
|
||||
}
|
||||
|
||||
public int getDegree() {
|
||||
return degree;
|
||||
}
|
||||
|
||||
public void setDegree(int degree) {
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
public String getJobTitle() {
|
||||
return jobTitle;
|
||||
}
|
||||
|
||||
public void setJobTitle(String jobTitle) {
|
||||
this.jobTitle = jobTitle;
|
||||
}
|
||||
|
||||
public int getOk() {
|
||||
return ok;
|
||||
}
|
||||
|
||||
public void setOk(int ok) {
|
||||
this.ok = ok;
|
||||
}
|
||||
|
||||
public int getBatchId() {
|
||||
return batchId;
|
||||
}
|
||||
|
||||
public void setBatchId(int batchid) {
|
||||
this.batchId = batchid;
|
||||
}
|
||||
|
||||
public String getAwardsAndPunishments() {
|
||||
return awardsAndPunishments;
|
||||
}
|
||||
|
||||
public void setAwardsAndPunishments(String awardsAndPunishments) {
|
||||
this.awardsAndPunishments = awardsAndPunishments;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public String getQualificationResult() {
|
||||
return qualificationResult;
|
||||
}
|
||||
|
||||
public void setQualificationResult(String qualificationResult) {
|
||||
this.qualificationResult = qualificationResult;
|
||||
}
|
||||
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TableDataThing [positionId=" + positionId + "," + jobTitle + ", batchname=" + batchname + ", degree=" + degree
|
||||
+ ", status=" + status + ", ok=" + ok + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package edu.ahbvc.recruit.model;
|
||||
|
||||
public class ThingWithUser extends Thing{
|
||||
|
||||
private String username;
|
||||
private int userId;
|
||||
|
||||
public ThingWithUser() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ThingWithUser(int id, int recruitId, String batch, int batchId, int degree, int status,
|
||||
String department, String jobTitle, int ok) {
|
||||
super(id, recruitId, batch, batchId, degree, status, jobTitle, ok);
|
||||
}
|
||||
|
||||
public ThingWithUser(String username, int userId) {
|
||||
super();
|
||||
this.username = username;
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TableDataThingWithUser [username=" + username + ", userId=" + userId + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package edu.ahbvc.recruit.model.api;
|
||||
|
||||
public class ImageCaptchaResponse {
|
||||
/**
|
||||
* API响应状态码
|
||||
*/
|
||||
public String statusCode;
|
||||
/**
|
||||
* 状态码说明
|
||||
*/
|
||||
public String desc;
|
||||
/**
|
||||
* 接口的返回信息
|
||||
*/
|
||||
public VerifyCodeResponse result;
|
||||
|
||||
public String getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public void setStatusCode(String statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public VerifyCodeResponse getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(VerifyCodeResponse result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package edu.ahbvc.recruit.model.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* API响应数据模型
|
||||
* 用于封装API响应数据
|
||||
* 使用于发短信验证码的API响应
|
||||
*
|
||||
* @author c215
|
||||
*/
|
||||
public class SMApiResponse {
|
||||
// 响应状态码
|
||||
public String code;
|
||||
// 响应消息
|
||||
@JsonProperty("msg")
|
||||
public String message;
|
||||
// 短信验证码UUID
|
||||
@JsonProperty("smUuid")
|
||||
public String smUuid;
|
||||
|
||||
// 构造函数
|
||||
public SMApiResponse() {
|
||||
super();
|
||||
}
|
||||
|
||||
// getter方法
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
// setter方法
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
// getter方法
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
// setter方法
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
// getter方法
|
||||
public String getSmUuid() {
|
||||
return smUuid;
|
||||
}
|
||||
|
||||
// setter方法
|
||||
public void setSmUuid(String smUuid) {
|
||||
this.smUuid = smUuid;
|
||||
}
|
||||
|
||||
// 重写toString方法
|
||||
@Override
|
||||
public String toString() {
|
||||
return "APIVerifyCodeResponse [code=" + code + ", message=" + message + ", data=" + smUuid + "]";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,209 @@
|
||||
package edu.ahbvc.recruit.model.export;
|
||||
|
||||
import edu.ahbvc.recruit.model.resume.Education;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Excel 导出总表数据模型
|
||||
* @author c215
|
||||
*/
|
||||
public class Excel {
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
protected int no;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
protected int userid;
|
||||
/**
|
||||
* 岗位代码
|
||||
*/
|
||||
protected String code;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
protected String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
protected int sex;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
protected String birthday;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
protected String idnum;
|
||||
/**
|
||||
* 教育经历
|
||||
*/
|
||||
protected ArrayList<Education> education;
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
protected String zzmm;
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
protected String nation;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
protected String phone;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
protected int status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
protected String note;
|
||||
|
||||
public Excel() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Excel(int no, String code, String name, int sex, String birthday, String idnum,
|
||||
ArrayList<Education> education, String zzmm, String nation, String phone, int status, String note) {
|
||||
super();
|
||||
this.no = no;
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.sex = sex;
|
||||
this.birthday = birthday;
|
||||
this.idnum = idnum;
|
||||
this.education = education;
|
||||
this.zzmm = zzmm;
|
||||
this.nation = nation;
|
||||
this.phone = phone;
|
||||
this.status = status;
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public int getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(int no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public int getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(int userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getIdnum() {
|
||||
return idnum;
|
||||
}
|
||||
|
||||
public void setIdnum(String idnum) {
|
||||
this.idnum = idnum;
|
||||
}
|
||||
|
||||
public ArrayList<Education> getEducation() {
|
||||
return education;
|
||||
}
|
||||
|
||||
public void setEducation(ArrayList<Education> education) {
|
||||
this.education = education;
|
||||
}
|
||||
|
||||
public String getZzmm() {
|
||||
return zzmm;
|
||||
}
|
||||
|
||||
public void setZzmm(String zzmm) {
|
||||
this.zzmm = zzmm;
|
||||
}
|
||||
|
||||
public String getNation() {
|
||||
return nation;
|
||||
}
|
||||
|
||||
public void setNation(String nation) {
|
||||
this.nation = nation;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Excel{" +
|
||||
"no=" + no +
|
||||
", userid=" + userid +
|
||||
", code='" + code + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", sex=" + sex +
|
||||
", birthday='" + birthday + '\'' +
|
||||
", idnum='" + idnum + '\'' +
|
||||
", education=" + education +
|
||||
", zzmm='" + zzmm + '\'' +
|
||||
", nation='" + nation + '\'' +
|
||||
", phone='" + phone + '\'' +
|
||||
", status=" + status +
|
||||
", note='" + note + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package edu.ahbvc.recruit.model.export;
|
||||
|
||||
/**
|
||||
* 准考证数据模型
|
||||
* 用于封装准考证相关信息
|
||||
* @author c215
|
||||
*/
|
||||
public class Ticket {
|
||||
|
||||
/**
|
||||
* 岗位代码
|
||||
*/
|
||||
protected String code;
|
||||
/**
|
||||
* 准考证号
|
||||
*/
|
||||
protected String ticketNumber;
|
||||
protected String name;
|
||||
protected String tel;
|
||||
protected String idnum;
|
||||
protected String department;
|
||||
protected String batch;
|
||||
|
||||
|
||||
public Ticket() {
|
||||
super();
|
||||
}
|
||||
public Ticket(String myindex, String myindexWithUser, String name, String tel, String idnum,
|
||||
String department, String batch) {
|
||||
super();
|
||||
this.code = myindex;
|
||||
this.ticketNumber = myindexWithUser;
|
||||
this.name = name;
|
||||
this.tel = tel;
|
||||
this.idnum = idnum;
|
||||
this.department = department;
|
||||
this.batch = batch;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String myindex) {
|
||||
this.code = myindex;
|
||||
}
|
||||
public String getTicketNumber() {
|
||||
return ticketNumber;
|
||||
}
|
||||
public void setTicketNumber(String myindexWithUser) {
|
||||
this.ticketNumber = myindexWithUser;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
public void setTel(String tel) {
|
||||
this.tel = tel;
|
||||
}
|
||||
public String getIdnum() {
|
||||
return idnum;
|
||||
}
|
||||
public void setIdnum(String idnum) {
|
||||
this.idnum = idnum;
|
||||
}
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getBatch() {
|
||||
return batch;
|
||||
}
|
||||
public void setBatch(String batch) {
|
||||
this.batch = batch;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PrintCertificate [code=" + code + ", ticketNumber=" + ticketNumber + ", name=" + name
|
||||
+ ", tel=" + tel + ", idnum=" + idnum + ", department=" + department + ", batch=" + batch + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* 分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class Page {
|
||||
/**
|
||||
* 当前页码
|
||||
*/
|
||||
protected int currentPage;
|
||||
/**
|
||||
* 每页显示的记录数
|
||||
*/
|
||||
protected int size;
|
||||
|
||||
/**
|
||||
* 无参构造函数
|
||||
*/
|
||||
public Page() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 有参构造函数
|
||||
* @param currentPage 当前页码
|
||||
* @param size 每页显示的记录数
|
||||
*/
|
||||
public Page(int currentPage, int size) {
|
||||
super();
|
||||
this.currentPage = currentPage;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getCurrentPage() {
|
||||
return currentPage;
|
||||
}
|
||||
|
||||
public void setCurrentPage(int currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PageUtil [currentPage=" + currentPage + ", size=" + size + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfAdmin extends Page {
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
protected String name;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
protected String phone;
|
||||
|
||||
public SearchAndPageOfAdmin() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfAdmin(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
|
||||
public SearchAndPageOfAdmin(String name, String phone) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String key) {
|
||||
this.name = key;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SearchAndPageOfAdmin [name=" + name + ", phone=" + phone + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfBatches extends Page {
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
protected String key;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
protected Integer state;
|
||||
|
||||
public SearchAndPageOfBatches() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfBatches(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
|
||||
public SearchAndPageOfBatches(String key, Integer state) {
|
||||
super();
|
||||
this.key = key;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SearchAndPageOfBatches [key=" + key + ", state=" + state + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfDepartment extends Page {
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
protected String key;
|
||||
|
||||
public SearchAndPageOfDepartment() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfDepartment(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
|
||||
public SearchAndPageOfDepartment(String key) {
|
||||
super();
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SearchAndPageOfDepartment [key=" + key + "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfPosition extends Page {
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private List<Integer> departments;
|
||||
|
||||
public SearchAndPageOfPosition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfPosition(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
|
||||
public List<Integer> getDepartments() {
|
||||
return departments;
|
||||
}
|
||||
|
||||
public void setDepartments(List<Integer> departments) {
|
||||
this.departments = departments;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfPositionByUser extends Page {
|
||||
|
||||
public String code;
|
||||
public int batchId;
|
||||
|
||||
|
||||
public SearchAndPageOfPositionByUser() {
|
||||
super();
|
||||
}
|
||||
public SearchAndPageOfPositionByUser(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
public SearchAndPageOfPositionByUser(String code, int batchId) {
|
||||
super();
|
||||
this.code = code;
|
||||
this.batchId = batchId;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public int getBatchId() {
|
||||
return batchId;
|
||||
}
|
||||
public void setBatchId(int batchId) {
|
||||
this.batchId = batchId;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SearchAndPageOfPositionByUser [code=" + code + ", batchId=" + batchId + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfResult extends Page {
|
||||
/**
|
||||
* 批次列表
|
||||
*/
|
||||
private List<Integer> batches;
|
||||
/**
|
||||
* 职位列表
|
||||
*/
|
||||
private List<Integer> jobTitles;
|
||||
/**
|
||||
* 状态列表
|
||||
*/
|
||||
private List<Integer> status;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
public SearchAndPageOfResult() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfResult(int currentPage, int size, List<Integer> batches, List<Integer> jobTitles,
|
||||
List<Integer> departments) {
|
||||
super();
|
||||
super.currentPage = currentPage;
|
||||
super.size = size;
|
||||
this.batches = batches;
|
||||
this.jobTitles = jobTitles;
|
||||
this.status = departments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentPage() {
|
||||
return super.getCurrentPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentPage(int currentPage) {
|
||||
super.setCurrentPage(currentPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return super.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(int size) {
|
||||
super.setSize(size);
|
||||
}
|
||||
|
||||
public List<Integer> getBatches() {
|
||||
return batches;
|
||||
}
|
||||
|
||||
public void setBatches(List<Integer> batches) {
|
||||
this.batches = batches;
|
||||
}
|
||||
|
||||
public List<Integer> getJobTitles() {
|
||||
return jobTitles;
|
||||
}
|
||||
|
||||
public void setJobTitles(List<Integer> jobTitles) {
|
||||
this.jobTitles = jobTitles;
|
||||
}
|
||||
|
||||
public List<Integer> getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(List<Integer> departments) {
|
||||
this.status = departments;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final int maxLen = 10;
|
||||
return "SearchAndPageOfResult [batches="
|
||||
+ (batches != null ? batches.subList(0, Math.min(batches.size(), maxLen)) : null) + ", jobTitles="
|
||||
+ (jobTitles != null ? jobTitles.subList(0, Math.min(jobTitles.size(), maxLen)) : null)
|
||||
+ ", status="
|
||||
+ (status != null ? status.subList(0, Math.min(status.size(), maxLen)) : null) + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package edu.ahbvc.recruit.model.page;
|
||||
|
||||
/**
|
||||
* 搜索和分页工具类
|
||||
* @author c215
|
||||
*/
|
||||
public class SearchAndPageOfUsers extends Page {
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
protected String name;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
protected String phone;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
protected String idnum;
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
protected Integer degree;
|
||||
|
||||
public SearchAndPageOfUsers() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SearchAndPageOfUsers(int currentPage, int size) {
|
||||
super(currentPage, size);
|
||||
}
|
||||
|
||||
public SearchAndPageOfUsers(String name, String tel, String idnum, Integer degree) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.phone = tel;
|
||||
this.idnum = idnum;
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getIdnum() {
|
||||
return idnum;
|
||||
}
|
||||
|
||||
public void setIdnum(String idnum) {
|
||||
this.idnum = idnum;
|
||||
}
|
||||
|
||||
public Integer getDegree() {
|
||||
return degree;
|
||||
}
|
||||
|
||||
public void setDegree(Integer degree) {
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SearchAndPageOfUsers [name=" + name + ", phone=" + phone + ", idnum=" + idnum + ", degree=" + degree
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
public class Education {
|
||||
private int id;
|
||||
private String school;
|
||||
private String graduationTime;
|
||||
private int degree;
|
||||
private int education;
|
||||
private String specialty;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSchool() {
|
||||
return school;
|
||||
}
|
||||
|
||||
public void setSchool(String school) {
|
||||
this.school = school;
|
||||
}
|
||||
|
||||
public String getGraduationTime() {
|
||||
return graduationTime;
|
||||
}
|
||||
|
||||
public void setGraduationTime(String graduationTime) {
|
||||
this.graduationTime = graduationTime;
|
||||
}
|
||||
|
||||
public int getDegree() {
|
||||
return degree;
|
||||
}
|
||||
|
||||
public void setDegree(int degree) {
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
public int getEducation() {
|
||||
return education;
|
||||
}
|
||||
|
||||
public void setEducation(int education) {
|
||||
this.education = education;
|
||||
}
|
||||
|
||||
public String getSpecialty() {
|
||||
return specialty;
|
||||
}
|
||||
|
||||
public void setSpecialty(String specialty) {
|
||||
this.specialty = specialty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Education{" +
|
||||
"id=" + id +
|
||||
", school='" + school + '\'' +
|
||||
", graduationTime='" + graduationTime + '\'' +
|
||||
", degree=" + degree +
|
||||
", education=" + education +
|
||||
", specialty='" + specialty + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class FamilyConnections {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String connection;
|
||||
private String work;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
public void setConnection(String connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
public String getWork() {
|
||||
return work;
|
||||
}
|
||||
|
||||
public void setWork(String work) {
|
||||
this.work = work;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FamilyConnections{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", connection='" + connection + '\'' +
|
||||
", work='" + work + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class Paper {
|
||||
private int id;
|
||||
private String journal;
|
||||
private String title;
|
||||
private String time;
|
||||
private String journalNum;
|
||||
public Paper() {
|
||||
}
|
||||
|
||||
public Paper(int id, String journal, String title, String time, String journalNum) {
|
||||
this.id = id;
|
||||
this.journal = journal;
|
||||
this.title = title;
|
||||
this.time = time;
|
||||
this.journalNum = journalNum;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getJournal() {
|
||||
return journal;
|
||||
}
|
||||
|
||||
public void setJournal(String journal) {
|
||||
this.journal = journal;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getJournalNum() {
|
||||
return journalNum;
|
||||
}
|
||||
|
||||
public void setJournalNum(String journalNum) {
|
||||
this.journalNum = journalNum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Paper{" +
|
||||
"id=" + id +
|
||||
", journal='" + journal + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", time='" + time + '\'' +
|
||||
", journalNum='" + journalNum + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class Project {
|
||||
private int id;
|
||||
private int type;
|
||||
private String time;
|
||||
private String title;
|
||||
private String level;
|
||||
private String rank;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(String level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
public void setRank(String rank) {
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Project{" +
|
||||
"id=" + id +
|
||||
", type=" + type +
|
||||
", time='" + time + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", level='" + level + '\'' +
|
||||
", rank='" + rank + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class Research {
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Research{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class UserInfo {
|
||||
private int id;
|
||||
private String name;
|
||||
private int sex;
|
||||
private String phone;
|
||||
private String birthPlace;
|
||||
private String nation;
|
||||
private String politicalStatus;
|
||||
private String email;
|
||||
private String birthday;
|
||||
private String idNum;
|
||||
private String married;
|
||||
/**
|
||||
* 户口所在地
|
||||
*/
|
||||
private String nativePlace;
|
||||
/**
|
||||
* 家庭详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 曾获何种专业证书,有何特长
|
||||
*/
|
||||
private String specialtiesCertificates;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getBirthPlace() {
|
||||
return birthPlace;
|
||||
}
|
||||
|
||||
public void setBirthPlace(String birthPlace) {
|
||||
this.birthPlace = birthPlace;
|
||||
}
|
||||
|
||||
public String getNation() {
|
||||
return nation;
|
||||
}
|
||||
|
||||
public void setNation(String nation) {
|
||||
this.nation = nation;
|
||||
}
|
||||
|
||||
public String getPoliticalStatus() {
|
||||
return politicalStatus;
|
||||
}
|
||||
|
||||
public void setPoliticalStatus(String politicalStatus) {
|
||||
this.politicalStatus = politicalStatus;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getIdNum() {
|
||||
return idNum;
|
||||
}
|
||||
|
||||
public void setIdNum(String idNum) {
|
||||
this.idNum = idNum;
|
||||
}
|
||||
|
||||
public String getMarried() {
|
||||
return married;
|
||||
}
|
||||
|
||||
public void setMarried(String married) {
|
||||
this.married = married;
|
||||
}
|
||||
|
||||
public String getNativePlace() {
|
||||
return nativePlace;
|
||||
}
|
||||
|
||||
public void setNativePlace(String nativePlace) {
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getSpecialtiesCertificates() {
|
||||
return specialtiesCertificates;
|
||||
}
|
||||
|
||||
public void setSpecialtiesCertificates(String specialtiesCertificates) {
|
||||
this.specialtiesCertificates = specialtiesCertificates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserInfo{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", sex=" + sex +
|
||||
", phone='" + phone + '\'' +
|
||||
", birthPlace='" + birthPlace + '\'' +
|
||||
", nation='" + nation + '\'' +
|
||||
", zzmm='" + politicalStatus + '\'' +
|
||||
", email='" + email + '\'' +
|
||||
", birthday='" + birthday + '\'' +
|
||||
", idNum='" + idNum + '\'' +
|
||||
", married='" + married + '\'' +
|
||||
", nativePlace='" + nativePlace + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", specialtiesCertificates='" + specialtiesCertificates + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package edu.ahbvc.recruit.model.resume;
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class WorkExperience {
|
||||
private int id;
|
||||
private String company;
|
||||
private String workTimeStart;
|
||||
private String workTimeEnd;
|
||||
private String position;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getWorkTimeStart() {
|
||||
return workTimeStart;
|
||||
}
|
||||
|
||||
public void setWorkTimeStart(String workTimeStart) {
|
||||
this.workTimeStart = workTimeStart;
|
||||
}
|
||||
|
||||
public String getWorkTimeEnd() {
|
||||
return workTimeEnd;
|
||||
}
|
||||
|
||||
public void setWorkTimeEnd(String workTimeEnd) {
|
||||
this.workTimeEnd = workTimeEnd;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WorkExperience{" +
|
||||
"id=" + id +
|
||||
", company='" + company + '\'' +
|
||||
", workTimeStart='" + workTimeStart + '\'' +
|
||||
", workTimeEnd='" + workTimeEnd + '\'' +
|
||||
", position='" + position + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package edu.ahbvc.recruit.model.token;
|
||||
|
||||
import edu.ahbvc.recruit.mapper.UserInter;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 利用UserInter实现了UserDetailsService中根据名字找用户的抽象方法
|
||||
* @author c215
|
||||
*/
|
||||
@Service
|
||||
public class CustomUserDetailsService implements UserDetailsService {
|
||||
|
||||
// 这个类被注解为Service, 所以会被Spring容器管理
|
||||
// 控制翻转!!!
|
||||
// 依赖注入!!!
|
||||
//
|
||||
// 所以可以自动通过构造函数注入UserInter
|
||||
final UserInter userInter;
|
||||
|
||||
public CustomUserDetailsService(UserInter userInter) {
|
||||
this.userInter = userInter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
|
||||
// UserInter中实现了根据名字找用户的方法
|
||||
// 因为JWT认证和更规范的权限管理暂暂未实现,所以此处用不到
|
||||
// SELECT * FROM `user-thing` WHERE `userid` = #{arg0}
|
||||
UserDetails userDetails = userInter.loadUserByUsername(username);
|
||||
return userDetails;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package edu.ahbvc.recruit.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import edu.ahbvc.recruit.mapper.AdminInter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import edu.ahbvc.recruit.model.Admin;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
@Service
|
||||
public class AdminServiceImpl {
|
||||
|
||||
private final AdminInter mapper;
|
||||
|
||||
public AdminServiceImpl(AdminInter mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
public Admin getOne(int id) {
|
||||
return mapper.getOne(id);
|
||||
}
|
||||
|
||||
public String isAdmin(String phone) {
|
||||
return mapper.isAdmin(phone);
|
||||
}
|
||||
|
||||
public Integer getAdminsNum(String name,String phone) {
|
||||
return mapper.getAdminsNum(name, phone);
|
||||
}
|
||||
|
||||
public Admin login(String num, String pwd) {
|
||||
return mapper.login(num, pwd);
|
||||
}
|
||||
|
||||
public List<Admin> getAdmins(int offset, int size, String name, String phone) {
|
||||
return mapper.getAdmins(offset, size, name, phone);
|
||||
}
|
||||
|
||||
public int addAdmin(Admin admin) {
|
||||
return mapper.addAdmin(admin);
|
||||
}
|
||||
|
||||
public int delAdmin(int id) {
|
||||
return mapper.delAdmin(id);
|
||||
}
|
||||
|
||||
public int updateAdmin(Admin ad) {
|
||||
return mapper.updateAdmin(ad);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
package edu.ahbvc.recruit.service;
|
||||
|
||||
import edu.ahbvc.recruit.mapper.ThingInter;
|
||||
import edu.ahbvc.recruit.model.Batch;
|
||||
import edu.ahbvc.recruit.model.Position;
|
||||
import edu.ahbvc.recruit.model.Thing;
|
||||
import edu.ahbvc.recruit.model.ThingWithUser;
|
||||
import edu.ahbvc.recruit.model.export.Excel;
|
||||
import edu.ahbvc.recruit.model.export.Ticket;
|
||||
import edu.ahbvc.recruit.util.AdmissionTicketCreater;
|
||||
import edu.ahbvc.recruit.util.ExcelExporter;
|
||||
import edu.ahbvc.recruit.util.file.FilePatch;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
@Service
|
||||
public class ThingServiceImpl {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ThingServiceImpl.class);
|
||||
private final ThingInter mapper;
|
||||
|
||||
@Autowired
|
||||
public ThingServiceImpl(ThingInter mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<ThingWithUser> getThings(List<Integer> id) {
|
||||
return mapper.getThingsById(id);
|
||||
}
|
||||
|
||||
public List<ThingWithUser> getThings(int currentPage, int size, List<Integer> jobTitles,
|
||||
List<Integer> batch, List<Integer> status, String name) {
|
||||
List<ThingWithUser> list = mapper.getThings(currentPage, size, jobTitles, batch, status, name);
|
||||
if(!list.isEmpty()) {
|
||||
System.out.println(list.get(list.size()-1).getTime());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<ThingWithUser> getAuditThings(int currentPage, int size, List<Integer> jobTitles,
|
||||
List<Integer> batch) {
|
||||
return mapper.getAuditThings(currentPage, size, jobTitles, batch);
|
||||
}
|
||||
|
||||
public Integer getThingsNum(List<Integer> jobTitles, List<Integer> batch, List<Integer> status, String name) {
|
||||
return mapper.getThingsNum(jobTitles, batch, status, name);
|
||||
}
|
||||
|
||||
public int getUnsettledThingsNum() {
|
||||
return mapper.getUnsettledThingsNum();
|
||||
}
|
||||
|
||||
|
||||
public List<Batch> getBatchOption() {
|
||||
return mapper.getBatchOption();
|
||||
}
|
||||
|
||||
public Batch getBatch(int id) {
|
||||
return mapper.getBatch(id);
|
||||
}
|
||||
|
||||
public int updateBatch(Batch batch) {
|
||||
return mapper.updateBatch(batch);
|
||||
}
|
||||
|
||||
public int switchBatchOpen(int id) {
|
||||
mapper.updateBatchClose();
|
||||
return mapper.updateBatchOpen(id);
|
||||
}
|
||||
|
||||
public int addBatch(Batch batch) {
|
||||
return mapper.addBatch(batch);
|
||||
}
|
||||
|
||||
public int delBatch(int id) {
|
||||
return mapper.delBatch(id);
|
||||
}
|
||||
|
||||
public List<Batch> getBatches(int currentPage, int size, String key, Integer state) {
|
||||
return mapper.getBatches(currentPage, size, key, state);
|
||||
}
|
||||
|
||||
public Batch getCurrentBatches() {
|
||||
return mapper.getCurrentBatch();
|
||||
}
|
||||
|
||||
public List<Batch> getOpenBatches() {
|
||||
return mapper.getBatches(0, Integer.MAX_VALUE, null, 1);
|
||||
}
|
||||
|
||||
public int getBatchesNum(String key, Integer state) {
|
||||
return mapper.getBatchesNum(key, state);
|
||||
}
|
||||
|
||||
public List<Position> getPositionOption() {
|
||||
return mapper.getPositionOption();
|
||||
}
|
||||
|
||||
public List<Position> getPositions(int currentPage, int size) {
|
||||
return mapper.getPositions(currentPage, size);
|
||||
}
|
||||
|
||||
public int getPositionsNum() {
|
||||
return mapper.getPositionsNum();
|
||||
}
|
||||
|
||||
public List<Position> getSomePosition(int batchId, int offset, int size) {
|
||||
return mapper.getSomePosition(batchId, offset, size);
|
||||
}
|
||||
|
||||
public Position getOnePosition(int id) {
|
||||
return mapper.getOnePosition(id);
|
||||
}
|
||||
|
||||
public int addPosition(Position p) {
|
||||
return mapper.addPosition(p);
|
||||
}
|
||||
|
||||
public int delPosition(int id) {
|
||||
return mapper.delPosition(id);
|
||||
}
|
||||
|
||||
public int delPositions(List<Integer> id) {
|
||||
int i;
|
||||
try {
|
||||
i = mapper.delPositions(id);
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
// 记录异常信息
|
||||
log.error(e.getMessage());
|
||||
// 返回一个错误标志
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public int updatePosition(Position p) {
|
||||
return mapper.updatePosition(p);
|
||||
}
|
||||
|
||||
public List<Batch> getthingForuser(int userid, int batch) {
|
||||
return mapper.getthingForuser(userid, batch);
|
||||
}
|
||||
|
||||
public int refuseThing(int thingid, int status, String qualificationResult) {
|
||||
return mapper.refuseThing(thingid, status, qualificationResult);
|
||||
}
|
||||
|
||||
public int updateThingStatus(int thingid, int status) {
|
||||
return mapper.updateThingStatus(thingid, status);
|
||||
}
|
||||
|
||||
public int updateThingInfo(int thingid, String awardsAndPunishments, String note, String qualificationResult) {
|
||||
return mapper.updateThingInfo(thingid, awardsAndPunishments, note, qualificationResult);
|
||||
}
|
||||
|
||||
|
||||
public int updateThingInfo(int thingid, String qualificationResult) {
|
||||
return mapper.updateThingQualification(thingid, qualificationResult);
|
||||
}
|
||||
|
||||
public ThingWithUser getOneThing(int thingid) {
|
||||
return mapper.getOneThing(thingid);
|
||||
}
|
||||
|
||||
public List<Thing> getThingAboutUser(int userid) {
|
||||
return mapper.getThingAboutUser(userid);
|
||||
}
|
||||
|
||||
public List<Thing> getRecruits(int currentPage, int size, List<Integer> jobTitles, List<Integer> batch) {
|
||||
return mapper.getRecruits(currentPage, size, jobTitles, batch);
|
||||
}
|
||||
|
||||
public int getRecruitNum(List<Integer> jobTitles, List<Integer> batch) {
|
||||
return mapper.getRecruitNum(jobTitles, batch);
|
||||
}
|
||||
|
||||
public int addRecruit(Integer batchid, Integer positionid) {
|
||||
return mapper.addRecruit(batchid, positionid);
|
||||
}
|
||||
|
||||
public int updateRecruit(Integer id, Integer batchid, Integer positionid) {
|
||||
return mapper.updateRecruit(id, batchid, positionid);
|
||||
}
|
||||
|
||||
public int deleteRecruit(int id) {
|
||||
try {
|
||||
return mapper.deleteRecruit(id);
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
// 捕获外键约束违反异常
|
||||
log.error(e.getMessage());
|
||||
// 返回一个错误标志
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public String outPutExcel() {
|
||||
String saveExcelFilePath = FilePatch.SaveExcelFilePath;
|
||||
ArrayList<Excel> printData = mapper.getPrintData();
|
||||
int excelFile = ExcelExporter.getExcelFile(saveExcelFilePath);
|
||||
|
||||
int excel = ExcelExporter.exportToExcel(printData,saveExcelFilePath);
|
||||
if(excel!=0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return saveExcelFilePath + "招聘总表.xlsx";
|
||||
}
|
||||
|
||||
public String previewTicket(Integer id, Integer recruitid) {
|
||||
Ticket ticketData = mapper.getTicketData(recruitid, id);
|
||||
return AdmissionTicketCreater.generateUserDocument(ticketData);
|
||||
}
|
||||
|
||||
public int conformPrintTicket(Integer thingid, Integer recruitid) {
|
||||
int ticketNum = mapper.getTicketNum(recruitid);
|
||||
int printedTicket = mapper.isPrintedTicket(thingid);
|
||||
int ticketData;
|
||||
if(printedTicket==0)
|
||||
// 如果是没有打印过准考证的,就去当前岗位中的最大值加一
|
||||
{
|
||||
ticketData = mapper.setTicketPrinted(ticketNum+1, thingid);
|
||||
} else
|
||||
// 否则就使用原来的准考证序号
|
||||
{
|
||||
ticketData = mapper.setTicketPrinted(printedTicket, thingid);
|
||||
}
|
||||
return ticketData;
|
||||
}
|
||||
|
||||
|
||||
public int getOldTicketNum(Integer thingid, Integer recruitid) {
|
||||
return mapper.isPrintedTicket(thingid);
|
||||
}
|
||||
|
||||
public boolean isPrintedTicket(Integer thingid) {
|
||||
int ticketData = mapper.isPrintedTicket(thingid);
|
||||
return ticketData!=0;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package edu.ahbvc.recruit.service.api;
|
||||
|
||||
import edu.ahbvc.recruit.model.api.ImageCaptchaResponse;
|
||||
import edu.ahbvc.recruit.model.api.SMApiResponse;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 封装了第三方API服务
|
||||
* @author c215
|
||||
*/
|
||||
@Service
|
||||
public interface ApiService {
|
||||
String MOCK_CAPTCHA = "1";
|
||||
/**
|
||||
* 获取图片验证码
|
||||
* @return 图片验证码
|
||||
*/
|
||||
ImageCaptchaResponse getImgCode();
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
* @param captcha 图片验证码
|
||||
* @param tel 手机号
|
||||
* @return 封装好的短信验证码响应
|
||||
*/
|
||||
SMApiResponse sendSM(String captcha, String tel);
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package edu.ahbvc.recruit.service.api;
|
||||
|
||||
import edu.ahbvc.recruit.model.api.ImageCaptchaResponse;
|
||||
import edu.ahbvc.recruit.model.api.JsonReader;
|
||||
import edu.ahbvc.recruit.model.api.SMApiResponse;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
@Profile("prod")
|
||||
@Repository
|
||||
public class RealApiServiceImpl implements ApiService {
|
||||
|
||||
/**
|
||||
* 使用Log4j2 LogManager获取Logger实例
|
||||
* 提供日志服务
|
||||
*/
|
||||
private static final Logger logger = LogManager.getLogger(RealApiServiceImpl.class);
|
||||
|
||||
|
||||
/**
|
||||
* 图片验证码
|
||||
* Image verification code
|
||||
* @return 自定义包装类, 包含图片验证码相关信息
|
||||
* @see <a href="https://www.apispace.com/eolink/api/lwtpyzmsc/apiDocument">接口文档</a>
|
||||
*/
|
||||
@Override
|
||||
public ImageCaptchaResponse getImgCode() {
|
||||
|
||||
URI url = null;
|
||||
try {
|
||||
url = new URI("https://eolink.o.apispace.com/lwtpyzmsc/common/verify/getComplicateVerifyImage");
|
||||
} catch (URISyntaxException e) {
|
||||
logger.error("图片验证码URI异常");
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
// 准备调用api的请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String MyKey = "p4jb13padiv8g31wdaqlva6xoeoygdnw";
|
||||
headers.add("X-APISpace-Token", MyKey);
|
||||
headers.add("Authorization-Type", "apikey");
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JsonReader<ImageCaptchaResponse> jsonReader = new JsonReader<>();
|
||||
|
||||
// 准备调用api的请求体
|
||||
MultiValueMap<String, String> requestBody = new LinkedMultiValueMap<>();
|
||||
//验证码类型
|
||||
// (1:纯数字,2:小写字母,3:大写字母,4:数字+小写字母,5:数字+大写字母,6:数字+大小写字母,7:大小写字母)
|
||||
requestBody.add("codeType", "1");
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
// 发送调用api请求
|
||||
RequestEntity<MultiValueMap<String, String>> requestEntity = new RequestEntity<>(
|
||||
requestBody, headers, HttpMethod.POST, url);
|
||||
|
||||
// 返回结果是JSON,转换成字符串
|
||||
ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class);
|
||||
|
||||
// api返回的内容是JSON
|
||||
String responseData = responseEntity.getBody();
|
||||
|
||||
// 输出api返回的结果
|
||||
logger.debug("图片验证码api返回结果" + responseData);
|
||||
|
||||
ImageCaptchaResponse processApiResponse;
|
||||
|
||||
processApiResponse = jsonReader.processApiResponse(responseData, ImageCaptchaResponse.class);
|
||||
|
||||
return processApiResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SMApiResponse sendSM(String captcha, String tel){
|
||||
URI url = null;
|
||||
|
||||
try {
|
||||
url = new URI("http://api.1cloudsp.com/api/v2/single_send");
|
||||
} catch (URISyntaxException e) {
|
||||
logger.info("短信验证码URI异常");
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
// 准备调用api的请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization-Type", "apikey");
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
// 用户开发key
|
||||
String accesskey = "nBWSTPoSwKmBbP81";
|
||||
// 用户开发秘钥
|
||||
String accessSecret = "Tp5u0ff4K3qpzoqDcxtHaDgcTYGphSQw";
|
||||
|
||||
// 准备调用api的请求体
|
||||
MultiValueMap<String, String> requestBody = new LinkedMultiValueMap<>();
|
||||
requestBody.add("accesskey", accesskey);
|
||||
requestBody.add("secret", accessSecret);
|
||||
requestBody.add("sign", "299439");
|
||||
requestBody.add("templateId", "277804");
|
||||
requestBody.add("mobile", tel);
|
||||
requestBody.add("content", URLEncoder.encode(captcha, StandardCharsets.UTF_8));
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
JsonReader<SMApiResponse> jsonReader = new JsonReader<>();
|
||||
|
||||
// 发送调用api请求
|
||||
RequestEntity<MultiValueMap<String, String>> requestEntity = new RequestEntity<>(
|
||||
requestBody, headers, HttpMethod.POST, url);
|
||||
|
||||
// 返回结果是JSON,转换成字符串
|
||||
ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class);
|
||||
|
||||
// api返回的内容是JSON
|
||||
String responseData = responseEntity.getBody();
|
||||
|
||||
// 输出api返回的结果
|
||||
logger.info("短信验证码api返回结果" + responseData);
|
||||
|
||||
SMApiResponse processApiResponse;
|
||||
|
||||
processApiResponse = jsonReader.processApiResponse(responseData, SMApiResponse.class);
|
||||
|
||||
return processApiResponse;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,173 @@
|
||||
package edu.ahbvc.recruit.util;
|
||||
|
||||
|
||||
import edu.ahbvc.recruit.model.export.Excel;
|
||||
import edu.ahbvc.recruit.model.resume.Education;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author c215
|
||||
*/
|
||||
public class ExcelExporter {
|
||||
|
||||
/**
|
||||
* 使用Log4j2 LogManager获取Logger实例
|
||||
*/
|
||||
private static final Logger logger = LogManager.getLogger(ExcelExporter.class);
|
||||
|
||||
/**
|
||||
* @param data 导出的Excel的数据
|
||||
* @param path 导出的Excel的路径
|
||||
* @return 0:正常,,-1:异常
|
||||
*/
|
||||
public static int exportToExcel(ArrayList<Excel> data, String path) {
|
||||
if (data == null) {
|
||||
logger.warn("传入数据为空");
|
||||
return -1;
|
||||
}
|
||||
logger.info("开始生成总表");
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
Sheet sheet = workbook.createSheet("Data");
|
||||
// 设置样式解决含有'\n'不自动换行的问题
|
||||
CellStyle cellStyle = workbook.createCellStyle();
|
||||
// 设置单元格样式为自动换行
|
||||
cellStyle.setWrapText(true);
|
||||
// Create header row
|
||||
Row headerRow = sheet.createRow(0);
|
||||
// Assuming first column is "No", second is "Code", etc.
|
||||
String[] columnHeaders = {"序号", "岗位代码", "姓名", "性别", "出生日期", "身份证号码", "政治面貌", "民族", "毕业学校", "所学专业", "学历", "学位",
|
||||
"毕业时间", "联系电话", "资格审查结果", "备注"};
|
||||
for (int i = 0; i < columnHeaders.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell.setCellValue(columnHeaders[i]);
|
||||
}
|
||||
|
||||
// Fill data
|
||||
int rowNum = 1;
|
||||
for (Excel item : data) {
|
||||
Row row = sheet.createRow(rowNum++);
|
||||
row.createCell(0).setCellValue(rowNum - 1);
|
||||
row.createCell(1).setCellValue(item.getCode());
|
||||
row.createCell(2).setCellValue(item.getName());
|
||||
row.createCell(3).setCellValue(item.getSex() == 1 ? "男" : "女");
|
||||
row.createCell(4).setCellValue(item.getBirthday());
|
||||
row.createCell(5).setCellValue(item.getIdnum());
|
||||
row.createCell(6).setCellValue(item.getZzmm());
|
||||
row.createCell(7).setCellValue(item.getNation());
|
||||
StringBuilder school = new StringBuilder();
|
||||
StringBuilder specialty = new StringBuilder();
|
||||
StringBuilder education = new StringBuilder();
|
||||
StringBuilder degree = new StringBuilder();
|
||||
StringBuilder graduationTime = new StringBuilder();
|
||||
for (int i = 0; i < item.getEducation().size(); i++) {
|
||||
boolean end = i == item.getEducation().size() - 1;
|
||||
Education e = item.getEducation().get(i);
|
||||
|
||||
String educations = switch (e.getEducation()) {
|
||||
case 0 -> "专科";
|
||||
case 1 -> "本科";
|
||||
case 2 -> "研究生";
|
||||
default -> "异常";
|
||||
};
|
||||
/* 将学历转换成汉字 */
|
||||
String degrees = switch (e.getDegree()) {
|
||||
case 0 -> "暂无";
|
||||
case 1 -> "学士";
|
||||
case 2 -> "硕士";
|
||||
case 3 -> "博士";
|
||||
default -> "异常";
|
||||
};
|
||||
school.append(e.getSchool());
|
||||
specialty.append(e.getSpecialty());
|
||||
education.append(educations);
|
||||
degree.append(degrees);
|
||||
graduationTime.append(e.getGraduationTime());
|
||||
|
||||
if (!end) {
|
||||
school.append("\n");
|
||||
specialty.append("\n");
|
||||
education.append("\n");
|
||||
degree.append("\n");
|
||||
graduationTime.append("\n");
|
||||
}
|
||||
}
|
||||
Cell schoolcell = row.createCell(8);
|
||||
schoolcell.setCellStyle(cellStyle);
|
||||
schoolcell.setCellValue(school.toString());
|
||||
Cell specialtycell = row.createCell(9);
|
||||
specialtycell.setCellStyle(cellStyle);
|
||||
specialtycell.setCellValue(specialty.toString());
|
||||
Cell educationcell = row.createCell(10);
|
||||
educationcell.setCellStyle(cellStyle);
|
||||
educationcell.setCellValue(education.toString());
|
||||
Cell degreecell = row.createCell(11);
|
||||
degreecell.setCellStyle(cellStyle);
|
||||
degreecell.setCellValue(degree.toString());
|
||||
Cell graduationTimecell = row.createCell(12);
|
||||
graduationTimecell.setCellStyle(cellStyle);
|
||||
graduationTimecell.setCellValue(graduationTime.toString());
|
||||
row.createCell(13).setCellValue(item.getPhone());
|
||||
|
||||
|
||||
String sta = switch (item.getStatus()) {
|
||||
case -2 -> "已拒绝";
|
||||
case -1 -> "拒绝待确认";
|
||||
case 0 -> "未处理";
|
||||
case 1 -> "同意待确认";
|
||||
case 2 -> "已同意";
|
||||
default -> "异常";
|
||||
};
|
||||
row.createCell(14).setCellValue(sta);
|
||||
|
||||
row.createCell(15).setCellValue(item.getNote());
|
||||
}
|
||||
|
||||
int graduationTimeColumnIndex = 12;
|
||||
// 生日列设12个字符宽
|
||||
sheet.setColumnWidth(4, 12 * 256);
|
||||
// 身份证号列设18个字符宽
|
||||
sheet.setColumnWidth(5, 20 * 256);
|
||||
// 毕业院校列设18个字符宽
|
||||
sheet.setColumnWidth(8, 18 * 256);
|
||||
// 专业列设18个字符宽
|
||||
sheet.setColumnWidth(9, 18 * 256);
|
||||
// 毕业时间列设8个字符宽
|
||||
sheet.setColumnWidth(12, 8 * 256);
|
||||
// 手机号列设12个字符宽
|
||||
sheet.setColumnWidth(13, 12 * 256);
|
||||
sheet.setColumnWidth(graduationTimeColumnIndex, 20 * 256);
|
||||
logger.error("生成总表Excel成功,开始保存 ");
|
||||
// Write the workbook to a file
|
||||
try {
|
||||
FileOutputStream outputStream = new FileOutputStream(path + "招聘总表.xlsx");
|
||||
workbook.write(outputStream);
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("保存导出的Excel发生IO错误");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getExcelFile(String path) {
|
||||
|
||||
File folder = new File(path);
|
||||
File[] fileList = folder.listFiles();
|
||||
if (fileList == null || fileList.length == 0) {
|
||||
return 0;
|
||||
} else if (fileList.length > 1) {
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
||||
package edu.ahbvc.recruit.util.file;
|
||||
|
||||
public class FilePathModel {
|
||||
|
||||
private String path = "";
|
||||
|
||||
public FilePathModel() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FilePathModel(String path) {
|
||||
super();
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FilePath [path=" + path + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
spring.application.name=Recruit
|
||||
# Development properties
|
||||
server.port=8080
|
||||
logging.level.root=DEBUG
|
||||
|
@ -0,0 +1,4 @@
|
||||
spring.application.name=Recruit
|
||||
# Production properties
|
||||
server.port=80
|
||||
logging.level.root=INFO
|
@ -0,0 +1,11 @@
|
||||
spring.application.name=Recruit
|
||||
# Common properties
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/ahbvcrefactor
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
mybatis.mapper-locations=classpath:mapper/*.xml
|
||||
# Development specific properties
|
||||
spring.profiles.active=dev
|
||||
|
@ -0,0 +1,45 @@
|
||||
/** 白屏阶段会执行的 CSS 加载动画 */
|
||||
|
||||
#app-loading {
|
||||
position: relative;
|
||||
top: 45vh;
|
||||
margin: 0 auto;
|
||||
color: #409eff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#app-loading,
|
||||
#app-loading::before,
|
||||
#app-loading::after {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
border-radius: 50%;
|
||||
animation: 2s ease-in-out infinite app-loading-animation;
|
||||
}
|
||||
|
||||
#app-loading::before,
|
||||
#app-loading::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#app-loading::before {
|
||||
left: -4em;
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
#app-loading::after {
|
||||
left: 4em;
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
|
||||
@keyframes app-loading-animation {
|
||||
0%,
|
||||
80%,
|
||||
100% {
|
||||
box-shadow: 0 2em 0 -2em;
|
||||
}
|
||||
40% {
|
||||
box-shadow: 0 2em 0 0;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" href="/Recruit/favicon.ico" />
|
||||
<link rel="stylesheet" href="/Recruit/app-loading.css" />
|
||||
<title>招聘管理系统</title>
|
||||
<script type="module" crossorigin src="/Recruit/static/index-1243327e.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/Recruit/static/vue-1357a625.js">
|
||||
<link rel="modulepreload" crossorigin href="/Recruit/static/element-b0a266eb.js">
|
||||
<link rel="modulepreload" crossorigin href="/Recruit/static/vxe-ab33838e.js">
|
||||
<link rel="stylesheet" href="/Recruit/static/index-e5828985.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div id="app-loading"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{_}from"./index-1243327e.js";import{ah as e,l as n,m as c,p as d,I as l,V as t,P as o,T as p}from"./vue-1357a625.js";const u={},i={class:"error-page"},f={class:"error-page-svg"};function m(r,v){const a=e("el-button"),s=e("router-link");return n(),c("div",i,[d("div",f,[l(r.$slots,"default",{},void 0,!0)]),t(s,{to:"/"},{default:o(()=>[t(a,{type:"primary"},{default:o(()=>[p("回到首页")]),_:1})]),_:1})])}const h=_(u,[["render",m],["__scopeId","data-v-5f207ac3"]]);export{h as E};
|
@ -0,0 +1 @@
|
||||
.error-page[data-v-5f207ac3]{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.error-page-svg[data-v-5f207ac3]{width:400px;margin-bottom:50px}
|
After Width: | Height: | Size: 690 KiB |
@ -0,0 +1 @@
|
||||
const r=e=>{switch(e){case 0:return"无";case 1:return"学士";case 2:return"硕士";case 3:return"博士";default:return"异常"}},t=e=>{switch(e){case 0:return"专科";case 1:return"本科";case 2:return"研究生";default:return"异常"}},s=e=>{switch(e){case"无":return 0;case"学士":return 1;case"硕士":return 2;case"博士":return 3;default:return-1}},a=e=>{switch(e){case"专科":return 0;case"本科":return 1;case"研究生":return 2;default:return-1}};export{r as a,a as b,t as g,s};
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
[data-v-64233a8b] .my-label{background:var(--el-color-success-light-9)!important}[data-v-64233a8b] .my-content{background:var(--el-color-danger-light-9)}
|
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.login-container[data-v-d3e57967]{display:flex;justify-content:center;align-items:center;background-image:url(/Recruit/static/banner_1-197f4ad3.jpg);background-position:center;background-repeat:no-repeat;background-size:cover;width:100%;min-height:100%}.login-container .theme-switch[data-v-d3e57967]{position:fixed;top:5%;right:5%;cursor:pointer}.login-container .login-card[data-v-d3e57967]{width:480px;border-radius:20px;box-shadow:0 0 10px #dcdfe6;background-color:#fff;overflow:hidden}.login-container .login-card .title[data-v-d3e57967]{display:flex;justify-content:center;align-items:center;height:150px}.login-container .login-card .title img[data-v-d3e57967]{height:100%}.login-container .login-card .content[data-v-d3e57967]{padding:20px 50px 50px}.login-container .login-card .content[data-v-d3e57967] .el-input-group__append{padding:0;overflow:hidden}.login-container .login-card .content[data-v-d3e57967] .el-input-group__append .el-image{width:100px;height:40px;border-left:0px;-webkit-user-select:none;user-select:none;cursor:pointer;text-align:center}.login-container .login-card .content aaa[data-v-d3e57967]{color:#a39;text-decoration:none;margin-left:10px}.login-container .login-card .content .el-button[data-v-d3e57967]{width:100%;margin-top:10px}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{i as e}from"./index-1243327e.js";function r(t){return e({url:"tableBatch",method:"post",data:t})}function n(t){return e({url:`tableBatch/${t}`,method:"delete"})}function u(t){return e({url:"tableBatch",method:"put",data:t})}function o(t){return e({url:"tableBatch/open",method:"get",params:t})}function l(t){return e({url:"tableBatches",method:"post",data:t})}function i(){return e({url:"tableBatchOption",method:"get"})}export{i as a,r as c,n as d,l as g,o as s,u};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
.el-drawer__body .el-col{text-align:center;padding:.5em .8em;outline:transparent 1px solid}.el-drawer__body .text-left-override{text-align:left}.el-drawer__body .el-row{margin-top:.3em;outline:#ccc 1px solid}.el-col{text-align:center;padding:.5em .3em;outline:transparent 1px solid}.el-upload-listc{display:flex;justify-content:space-between;align-items:center;width:60%}.custom-file-itemc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{i as e}from"./index-1243327e.js";function i(t){return e({url:"tablePosition",method:"post",data:t})}function n(t){const o=Array.isArray(t)?t:[t];return e({url:"tablePositionDel",method:"post",data:o})}function r(t){return e({url:"tablePosition",method:"put",data:t})}function s(t){return e({url:"tablePositions",method:"post",data:t})}function u(){return e({url:"getPositionOption",method:"get"})}export{u as a,i as c,n as d,s as g,r as u};
|
@ -0,0 +1 @@
|
||||
.el-drawer__body .el-col{text-align:center;padding:.5em .8em;outline:transparent 1px solid}.el-drawer__body .text-left-override{text-align:left}.el-drawer__body .el-row{margin-top:.3em;outline:#ccc 1px solid}.infinite-list{padding:0;margin:0;list-style:none}.table-wrapper li{margin-bottom:20px}li .el-card__body{padding:0}td{padding:20px}td.td-btn{cursor:pointer;transition:all .5s ease-out}td.td-btn:hover{cursor:pointer;transition:all;color:#00f;box-shadow:inset -2px -2px 5px 2px #888,inset 2px 2px 5px 2px #f4f4f4}
|
@ -0,0 +1 @@
|
||||
import{i as r}from"./index-1243327e.js";function n(){return r({url:"userInfo",method:"get"})}function o(e){return r({url:"userInfo",method:"post",data:e})}function s(e){return r({url:"realName",method:"post",data:e})}function u(e){return r({url:"user/pwd",method:"post",data:e})}export{o as a,n as g,u as n,s};
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{H as k,aF as b,r as f,_ as C,ah as s,l as F,m as I,V as e,p as n,P as a,u as g,T as _,a3 as R,a9 as S,aI as q,aJ as z}from"./vue-1357a625.js";import{_ as B}from"./logo-text-2-52bab0ac.js";import{e as K,_ as M}from"./index-1243327e.js";import{q as N,t as U}from"./element-b0a266eb.js";import{_ as T}from"./index.vue_vue_type_script_setup_true_lang-3a2a2642.js";import"./vxe-ab33838e.js";const D=r=>(q("data-v-d3e57967"),r=r(),z(),r),E={class:"login-container"},H={class:"login-card"},J=D(()=>n("div",{class:"title"},[n("img",{src:B})],-1)),L={class:"content"},P=k({__name:"index",setup(r){const x=b(),m=f(null),i=f(!1),o=C({username:"",password:"",code:""}),h={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:8,max:16,message:"长度在 8 到 16 个字符",trigger:"blur"}]},u=()=>{var d;(d=m.value)==null||d.validate((t,l)=>{t?(i.value=!0,K().login(o).then(()=>{x.push({path:"/"})}).catch(()=>{o.password=""}).finally(()=>{i.value=!1})):console.error("表单校验不通过",l)})};return(d,t)=>{const l=s("el-input"),c=s("el-form-item"),v=s("el-link"),w=s("el-text"),y=s("el-button"),V=s("el-form");return F(),I("div",E,[e(T,{class:"theme-switch"}),n("div",H,[J,n("div",L,[e(V,{ref_key:"loginFormRef",ref:m,model:o,rules:h,onKeyup:S(u,["enter"])},{default:a(()=>[e(c,{prop:"username"},{default:a(()=>[e(l,{modelValue:o.username,"onUpdate:modelValue":t[0]||(t[0]=p=>o.username=p),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":g(N),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),e(c,{prop:"password"},{default:a(()=>[e(l,{modelValue:o.password,"onUpdate:modelValue":t[1]||(t[1]=p=>o.password=p),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":g(U),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])]),_:1}),e(w,null,{default:a(()=>[_("没有账号? "),e(v,{href:"#/register"},{default:a(()=>[_("去注册")]),_:1})]),_:1}),e(y,{loading:i.value,type:"primary",size:"large",onClick:R(u,["prevent"])},{default:a(()=>[_("登 录")]),_:1},8,["loading","onClick"])]),_:1},8,["model","onKeyup"])])])])}}});const W=M(P,[["__scopeId","data-v-d3e57967"]]);export{W as default};
|
@ -0,0 +1 @@
|
||||
import{i as o}from"./index-1243327e.js";function i(t){return o({url:"searchPositions",method:"post",data:t})}function u(){return o({url:"batchs",method:"get"})}function s(t){return o({url:"submitA",method:"post",data:t})}function n(t){return o({url:"submitB",method:"post",data:t})}function a(t){return o({url:"submitC",method:"post",data:t})}function e(t){return o({url:"submitC",method:"put",data:t})}export{n as a,a as b,u as c,i as g,e as r,s};
|
@ -0,0 +1 @@
|
||||
.search-wrapper[data-v-2f683bf2]{margin-bottom:20px}.search-wrapper[data-v-2f683bf2] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-2f683bf2]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-2f683bf2]{margin-bottom:20px}.pager-wrapper[data-v-2f683bf2]{display:flex;justify-content:flex-end}
|
@ -0,0 +1 @@
|
||||
import{H as t,aE as r,aF as a,l as o,m as s}from"./vue-1357a625.js";const _=t({__name:"index",setup(n){const e=r();return a().replace({path:"/"+e.params.path,query:e.query}),(c,p)=>(o(),s("div"))}});export{_ as default};
|
@ -0,0 +1 @@
|
||||
.search-wrapper[data-v-00c90673]{margin-bottom:20px}.search-wrapper[data-v-00c90673] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-00c90673]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-00c90673]{margin-bottom:20px}.pager-wrapper[data-v-00c90673]{display:flex;justify-content:flex-end}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
.search-wrapper[data-v-4d9ef9a6]{margin-bottom:20px}.search-wrapper[data-v-4d9ef9a6] .el-card__body{padding-bottom:2px}.toolbar-wrapper[data-v-4d9ef9a6]{display:flex;justify-content:space-between;margin-bottom:20px}.table-wrapper[data-v-4d9ef9a6]{margin-bottom:20px}.pager-wrapper[data-v-4d9ef9a6]{display:flex;justify-content:flex-end}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue