├── image ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 67.png ├── src ├── main │ ├── resources │ │ ├── mapper │ │ │ ├── ConfigDao.xml │ │ │ ├── TokenDao.xml │ │ │ ├── UsersDao.xml │ │ │ ├── JiaoshiDao.xml │ │ │ ├── XueshengDao.xml │ │ │ ├── PeiyangfanganDao.xml │ │ │ ├── CommonDao.xml │ │ │ ├── BiyezigeDao.xml │ │ │ └── XueshengchengjiDao.xml │ │ └── application.yml │ └── java │ │ └── com │ │ ├── dao │ │ ├── ConfigDao.java │ │ ├── UsersDao.java │ │ ├── TokenDao.java │ │ ├── CommonDao.java │ │ ├── JiaoshiDao.java │ │ ├── XueshengDao.java │ │ ├── PeiyangfanganDao.java │ │ ├── BiyezigeDao.java │ │ └── XueshengchengjiDao.java │ │ ├── annotation │ │ ├── IgnoreAuth.java │ │ ├── LoginUser.java │ │ └── APPLoginUser.java │ │ ├── config │ │ ├── AlipayConfig.java │ │ ├── MybatisPlusConfig.java │ │ └── InterceptorConfig.java │ │ ├── utils │ │ ├── MD5Util.java │ │ ├── FileUtil.java │ │ ├── JQPageInfo.java │ │ ├── R.java │ │ ├── SQLFilter.java │ │ ├── HttpClientUtils.java │ │ ├── ValidatorUtils.java │ │ ├── SpringContextUtils.java │ │ ├── PageUtils.java │ │ ├── Query.java │ │ ├── CommonUtil.java │ │ ├── MPUtil.java │ │ └── BaiduUtil.java │ │ ├── service │ │ ├── ConfigService.java │ │ ├── UsersService.java │ │ ├── CommonService.java │ │ ├── TokenService.java │ │ ├── impl │ │ │ ├── ConfigServiceImpl.java │ │ │ ├── UsersServiceImpl.java │ │ │ ├── CommonServiceImpl.java │ │ │ ├── JiaoshiServiceImpl.java │ │ │ ├── XueshengServiceImpl.java │ │ │ ├── PeiyangfanganServiceImpl.java │ │ │ ├── TokenServiceImpl.java │ │ │ ├── BiyezigeServiceImpl.java │ │ │ └── XueshengchengjiServiceImpl.java │ │ ├── JiaoshiService.java │ │ ├── XueshengService.java │ │ ├── PeiyangfanganService.java │ │ ├── BiyezigeService.java │ │ └── XueshengchengjiService.java │ │ ├── SpringbootSchemaApplication.java │ │ ├── entity │ │ ├── view │ │ │ ├── JiaoshiView.java │ │ │ ├── XueshengView.java │ │ │ ├── BiyezigeView.java │ │ │ ├── PeiyangfanganView.java │ │ │ └── XueshengchengjiView.java │ │ ├── EIException.java │ │ ├── ConfigEntity.java │ │ ├── UsersEntity.java │ │ ├── TokenEntity.java │ │ ├── vo │ │ │ ├── JiaoshiVO.java │ │ │ ├── XueshengVO.java │ │ │ ├── BiyezigeVO.java │ │ │ ├── XueshengchengjiVO.java │ │ │ └── PeiyangfanganVO.java │ │ ├── model │ │ │ ├── JiaoshiModel.java │ │ │ ├── XueshengModel.java │ │ │ ├── BiyezigeModel.java │ │ │ ├── XueshengchengjiModel.java │ │ │ └── PeiyangfanganModel.java │ │ ├── JiaoshiEntity.java │ │ ├── XueshengEntity.java │ │ ├── BiyezigeEntity.java │ │ ├── XueshengchengjiEntity.java │ │ └── PeiyangfanganEntity.java │ │ ├── interceptor │ │ └── AuthorizationInterceptor.java │ │ └── controller │ │ ├── ConfigController.java │ │ ├── FileController.java │ │ ├── UsersController.java │ │ └── CommonController.java └── test │ └── java │ └── com │ └── SpringbootSchemaApplicationTests.java ├── .gitignore ├── README.md ├── pom.xml └── mvnw.cmd /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/7.png -------------------------------------------------------------------------------- /image/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/8.png -------------------------------------------------------------------------------- /image/67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No138University-Graduation-and-Degree-Qualification-Review-System/HEAD/image/67.png -------------------------------------------------------------------------------- /src/main/resources/mapper/ConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ConfigDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import com.entity.ConfigEntity; 6 | 7 | /** 8 | * 配置 9 | */ 10 | public interface ConfigDao extends BaseMapper { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/IgnoreAuth.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 忽略Token验证 7 | */ 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | public @interface IgnoreAuth { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/SpringbootSchemaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootSchemaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import java.io.FileWriter; 4 | import java.io.IOException; 5 | 6 | /* * 7 | *类名:AlipayConfig 8 | *功能:基础配置类 9 | *详细:设置帐户有关信息及返回路径 10 | *修改日期:2017-04-05 11 | *说明: 12 | *以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 13 | *该代码仅供学习和研究支付宝接口使用,只是提供一个参考。 14 | */ 15 | 16 | public class AlipayConfig { 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import cn.hutool.crypto.digest.DigestUtil; 4 | 5 | public class MD5Util { 6 | 7 | /** 8 | * @param text明文 9 | * @param key密钥 10 | * @return 密文 11 | */ 12 | // 带秘钥加密 13 | public static String md5(String text) { 14 | // 加密后的字符串 15 | String md5str = DigestUtil.md5Hex(text); 16 | return md5str; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/LoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface LoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/APPLoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface APPLoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UsersDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.Map; 5 | 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.service.IService; 8 | import com.entity.ConfigEntity; 9 | import com.utils.PageUtils; 10 | 11 | 12 | /** 13 | * 系统用户 14 | */ 15 | public interface ConfigService extends IService { 16 | PageUtils queryPage(Map params,Wrapper wrapper); 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /src/main/java/com/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | 2 | package com.config; 3 | 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 9 | 10 | /** 11 | * mybatis-plus配置 12 | */ 13 | @Configuration 14 | public class MybatisPlusConfig { 15 | 16 | /** 17 | * 分页插件 18 | */ 19 | @Bean 20 | public PaginationInterceptor paginationInterceptor() { 21 | return new PaginationInterceptor(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/dao/UsersDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.UsersEntity; 12 | 13 | /** 14 | * 用户 15 | */ 16 | public interface UsersDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/dao/TokenDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.TokenEntity; 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/service/UsersService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.service.IService; 11 | import com.entity.UsersEntity; 12 | import com.utils.PageUtils; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | public interface UsersService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params,Wrapper wrapper); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface CommonService { 7 | List getOption(Map params); 8 | 9 | Map getFollowByOption(Map params); 10 | 11 | void sh(Map params); 12 | 13 | int remindCount(Map params); 14 | 15 | Map selectCal(Map params); 16 | 17 | List> selectGroup(Map params); 18 | 19 | List> selectValue(Map params); 20 | 21 | List> selectTimeStatValue(Map params); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/utils/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | 13 | public class FileUtil { 14 | public static byte[] FileToByte(File file) throws IOException { 15 | // 将数据转为流 16 | @SuppressWarnings("resource") 17 | InputStream content = new FileInputStream(file); 18 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); 19 | byte[] buff = new byte[100]; 20 | int rc = 0; 21 | while ((rc = content.read(buff, 0, 100)) > 0) { 22 | swapStream.write(buff, 0, rc); 23 | } 24 | // 获得二进制数组 25 | return swapStream.toByteArray(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/service/TokenService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.TokenEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenService extends IService { 17 | PageUtils queryPage(Map params); 18 | 19 | List selectListView(Wrapper wrapper); 20 | 21 | PageUtils queryPage(Map params,Wrapper wrapper); 22 | 23 | String generateToken(Long userid,String username,String tableName, String role); 24 | 25 | TokenEntity getTokenEntity(String token); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CommonDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * 通用接口 9 | */ 10 | public interface CommonDao{ 11 | List getOption(Map params); 12 | 13 | Map getFollowByOption(Map params); 14 | 15 | List getFollowByOption2(Map params); 16 | 17 | void sh(Map params); 18 | 19 | int remindCount(Map params); 20 | 21 | Map selectCal(Map params); 22 | 23 | List> selectGroup(Map params); 24 | 25 | List> selectValue(Map params); 26 | 27 | List> selectTimeStatValue(Map params); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/SpringbootSchemaApplication.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | 9 | @SpringBootApplication 10 | @MapperScan(basePackages = {"com.dao"}) 11 | public class SpringbootSchemaApplication extends SpringBootServletInitializer{ 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringbootSchemaApplication.class, args); 15 | } 16 | 17 | @Override 18 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { 19 | return applicationBuilder.sources(SpringbootSchemaApplication.class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/JiaoshiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.JiaoshiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 教师 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-04-03 16:15:19 19 | */ 20 | @TableName("jiaoshi") 21 | public class JiaoshiView extends JiaoshiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public JiaoshiView(){ 25 | } 26 | 27 | public JiaoshiView(JiaoshiEntity jiaoshiEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, jiaoshiEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/XueshengView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.XueshengEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 学生 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-04-03 16:15:19 19 | */ 20 | @TableName("xuesheng") 21 | public class XueshengView extends XueshengEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public XueshengView(){ 25 | } 26 | 27 | public XueshengView(XueshengEntity xueshengEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, xueshengEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/BiyezigeView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.BiyezigeEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 毕业资格 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-04-03 16:15:19 19 | */ 20 | @TableName("biyezige") 21 | public class BiyezigeView extends BiyezigeEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public BiyezigeView(){ 25 | } 26 | 27 | public BiyezigeView(BiyezigeEntity biyezigeEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, biyezigeEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/utils/JQPageInfo.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class JQPageInfo{ 4 | private Integer page; 5 | 6 | private Integer limit; 7 | 8 | private String sidx; 9 | 10 | private String order; 11 | 12 | private Integer offset; 13 | 14 | public Integer getPage() { 15 | return page; 16 | } 17 | 18 | public void setPage(Integer page) { 19 | this.page = page; 20 | } 21 | 22 | public Integer getLimit() { 23 | return limit; 24 | } 25 | 26 | public void setLimit(Integer limit) { 27 | this.limit = limit; 28 | } 29 | 30 | public String getSidx() { 31 | return sidx; 32 | } 33 | 34 | public void setSidx(String sidx) { 35 | this.sidx = sidx; 36 | } 37 | 38 | public String getOrder() { 39 | return order; 40 | } 41 | 42 | public void setOrder(String order) { 43 | this.order = order; 44 | } 45 | 46 | public Integer getOffset() { 47 | return offset; 48 | } 49 | 50 | public void setOffset(Integer offset) { 51 | this.offset = offset; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/PeiyangfanganView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.PeiyangfanganEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 培养方案 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-04-03 16:15:19 19 | */ 20 | @TableName("peiyangfangan") 21 | public class PeiyangfanganView extends PeiyangfanganEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public PeiyangfanganView(){ 25 | } 26 | 27 | public PeiyangfanganView(PeiyangfanganEntity peiyangfanganEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, peiyangfanganEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/EIException.java: -------------------------------------------------------------------------------- 1 | 2 | package com.entity; 3 | 4 | /** 5 | * 自定义异常 6 | */ 7 | public class EIException extends RuntimeException { 8 | private static final long serialVersionUID = 1L; 9 | 10 | private String msg; 11 | private int code = 500; 12 | 13 | public EIException(String msg) { 14 | super(msg); 15 | this.msg = msg; 16 | } 17 | 18 | public EIException(String msg, Throwable e) { 19 | super(msg, e); 20 | this.msg = msg; 21 | } 22 | 23 | public EIException(String msg, int code) { 24 | super(msg); 25 | this.msg = msg; 26 | this.code = code; 27 | } 28 | 29 | public EIException(String msg, int code, Throwable e) { 30 | super(msg, e); 31 | this.msg = msg; 32 | this.code = code; 33 | } 34 | 35 | public String getMsg() { 36 | return msg; 37 | } 38 | 39 | public void setMsg(String msg) { 40 | this.msg = msg; 41 | } 42 | 43 | public int getCode() { 44 | return code; 45 | } 46 | 47 | public void setCode(int code) { 48 | this.code = code; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/utils/R.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 返回数据 8 | */ 9 | public class R extends HashMap { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public R() { 13 | put("code", 0); 14 | } 15 | 16 | public static R error() { 17 | return error(500, "未知异常,请联系管理员"); 18 | } 19 | 20 | public static R error(String msg) { 21 | return error(500, msg); 22 | } 23 | 24 | public static R error(int code, String msg) { 25 | R r = new R(); 26 | r.put("code", code); 27 | r.put("msg", msg); 28 | return r; 29 | } 30 | 31 | public static R ok(String msg) { 32 | R r = new R(); 33 | r.put("msg", msg); 34 | return r; 35 | } 36 | 37 | public static R ok(Map map) { 38 | R r = new R(); 39 | r.putAll(map); 40 | return r; 41 | } 42 | 43 | public static R ok() { 44 | return new R(); 45 | } 46 | 47 | public R put(String key, Object value) { 48 | super.put(key, value); 49 | return this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/XueshengchengjiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.XueshengchengjiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 学生成绩 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-04-03 16:15:19 19 | */ 20 | @TableName("xueshengchengji") 21 | public class XueshengchengjiView extends XueshengchengjiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public XueshengchengjiView(){ 25 | } 26 | 27 | public XueshengchengjiView(XueshengchengjiEntity xueshengchengjiEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, xueshengchengjiEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Map; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 10 | import com.baomidou.mybatisplus.mapper.Wrapper; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import com.dao.ConfigDao; 14 | import com.entity.ConfigEntity; 15 | import com.service.ConfigService; 16 | import com.utils.PageUtils; 17 | import com.utils.Query; 18 | 19 | 20 | /** 21 | * 系统用户 22 | */ 23 | @Service("configService") 24 | public class ConfigServiceImpl extends ServiceImpl implements ConfigService { 25 | @Override 26 | public PageUtils queryPage(Map params, Wrapper wrapper) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | wrapper 30 | ); 31 | return new PageUtils(page); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ConfigEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | @TableName("config") 13 | public class ConfigEntity implements Serializable{ 14 | private static final long serialVersionUID = 1L; 15 | 16 | @TableId(type = IdType.AUTO) 17 | private Long id; 18 | 19 | /** 20 | * key 21 | */ 22 | private String name; 23 | 24 | /** 25 | * value 26 | */ 27 | private String value; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/dao/JiaoshiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.JiaoshiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.JiaoshiVO; 12 | import com.entity.view.JiaoshiView; 13 | 14 | 15 | /** 16 | * 教师 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public interface JiaoshiDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | JiaoshiVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | JiaoshiView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/dao/XueshengDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.XueshengEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.XueshengVO; 12 | import com.entity.view.XueshengView; 13 | 14 | 15 | /** 16 | * 学生 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public interface XueshengDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | XueshengVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | XueshengView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/service/JiaoshiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.JiaoshiEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.JiaoshiVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.JiaoshiView; 12 | 13 | 14 | /** 15 | * 教师 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public interface JiaoshiService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | JiaoshiVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | JiaoshiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/service/XueshengService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.XueshengEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.XueshengVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.XueshengView; 12 | 13 | 14 | /** 15 | * 学生 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public interface XueshengService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | XueshengVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | XueshengView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SQLFilter.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import com.entity.EIException; 7 | 8 | /** 9 | * SQL过滤 10 | */ 11 | public class SQLFilter { 12 | 13 | /** 14 | * SQL注入过滤 15 | * @param str 待验证的字符串 16 | */ 17 | public static String sqlInject(String str){ 18 | if(StringUtils.isBlank(str)){ 19 | return null; 20 | } 21 | //去掉'|"|;|\字符 22 | str = StringUtils.replace(str, "'", ""); 23 | str = StringUtils.replace(str, "\"", ""); 24 | str = StringUtils.replace(str, ";", ""); 25 | str = StringUtils.replace(str, "\\", ""); 26 | 27 | //转换成小写 28 | str = str.toLowerCase(); 29 | 30 | //非法字符 31 | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; 32 | 33 | //判断是否包含非法字符 34 | for(String keyword : keywords){ 35 | if(str.indexOf(keyword) != -1){ 36 | throw new EIException("包含非法字符"); 37 | } 38 | } 39 | 40 | return str; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/utils/HttpClientUtils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | 8 | 9 | /** 10 | * HttpClient工具类 11 | */ 12 | public class HttpClientUtils { 13 | 14 | /** 15 | * @param uri 16 | * @return String 17 | * @description get请求方式 18 | * @author: long.he01 19 | */ 20 | public static String doGet(String uri) { 21 | 22 | StringBuilder result = new StringBuilder(); 23 | try { 24 | String res = ""; 25 | URL url = new URL(uri); 26 | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 27 | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); 28 | String line; 29 | while ((line = in.readLine()) != null) { 30 | res += line+"\n"; 31 | } 32 | in.close(); 33 | return res; 34 | }catch (Exception e) { 35 | e.printStackTrace(); 36 | return null; 37 | } 38 | 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/dao/PeiyangfanganDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.PeiyangfanganEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.PeiyangfanganVO; 12 | import com.entity.view.PeiyangfanganView; 13 | 14 | 15 | /** 16 | * 培养方案 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public interface PeiyangfanganDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | PeiyangfanganVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | PeiyangfanganView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/service/PeiyangfanganService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.PeiyangfanganEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.PeiyangfanganVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.PeiyangfanganView; 12 | 13 | 14 | /** 15 | * 培养方案 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public interface PeiyangfanganService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | PeiyangfanganVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | PeiyangfanganView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/utils/ValidatorUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | 5 | import java.util.Set; 6 | 7 | import javax.validation.ConstraintViolation; 8 | import javax.validation.Validation; 9 | import javax.validation.Validator; 10 | 11 | import com.entity.EIException; 12 | 13 | /** 14 | * hibernate-validator校验工具类 15 | */ 16 | public class ValidatorUtils { 17 | private static Validator validator; 18 | 19 | static { 20 | validator = Validation.buildDefaultValidatorFactory().getValidator(); 21 | } 22 | 23 | /** 24 | * 校验对象 25 | * @param object 待校验对象 26 | * @param groups 待校验的组 27 | * @throws EIException 校验不通过,则报EIException异常 28 | */ 29 | public static void validateEntity(Object object, Class... groups) 30 | throws EIException { 31 | Set> constraintViolations = validator.validate(object, groups); 32 | if (!constraintViolations.isEmpty()) { 33 | ConstraintViolation constraint = (ConstraintViolation)constraintViolations.iterator().next(); 34 | throw new EIException(constraint.getMessage()); 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SpringContextUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | /** 11 | * Spring Context 工具类 12 | */ 13 | @Component 14 | public class SpringContextUtils implements ApplicationContextAware { 15 | public static ApplicationContext applicationContext; 16 | 17 | @Override 18 | public void setApplicationContext(ApplicationContext applicationContext) 19 | throws BeansException { 20 | SpringContextUtils.applicationContext = applicationContext; 21 | } 22 | 23 | public static Object getBean(String name) { 24 | return applicationContext.getBean(name); 25 | } 26 | 27 | public static T getBean(String name, Class requiredType) { 28 | return applicationContext.getBean(name, requiredType); 29 | } 30 | 31 | public static boolean containsBean(String name) { 32 | return applicationContext.containsBean(name); 33 | } 34 | 35 | public static boolean isSingleton(String name) { 36 | return applicationContext.isSingleton(name); 37 | } 38 | 39 | public static Class getType(String name) { 40 | return applicationContext.getType(name); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/service/BiyezigeService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.BiyezigeEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.BiyezigeVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.BiyezigeView; 12 | 13 | 14 | /** 15 | * 毕业资格 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public interface BiyezigeService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | BiyezigeVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | BiyezigeView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | List> selectValue(Map params,Wrapper wrapper); 37 | 38 | List> selectTimeStatValue(Map params,Wrapper wrapper); 39 | 40 | List> selectGroup(Map params,Wrapper wrapper); 41 | 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/main/java/com/entity/UsersEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.annotations.TableId; 7 | import com.baomidou.mybatisplus.annotations.TableName; 8 | import com.baomidou.mybatisplus.enums.IdType; 9 | 10 | /** 11 | * 用户 12 | */ 13 | @TableName("users") 14 | public class UsersEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Long id; 19 | 20 | /** 21 | * 用户账号 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 密码 27 | */ 28 | private String password; 29 | 30 | /** 31 | * 用户类型 32 | */ 33 | private String role; 34 | 35 | private Date addtime; 36 | 37 | public String getUsername() { 38 | return username; 39 | } 40 | 41 | public void setUsername(String username) { 42 | this.username = username; 43 | } 44 | 45 | public String getPassword() { 46 | return password; 47 | } 48 | 49 | public void setPassword(String password) { 50 | this.password = password; 51 | } 52 | 53 | public String getRole() { 54 | return role; 55 | } 56 | 57 | public void setRole(String role) { 58 | this.role = role; 59 | } 60 | 61 | public Date getAddtime() { 62 | return addtime; 63 | } 64 | 65 | public void setAddtime(Date addtime) { 66 | this.addtime = addtime; 67 | } 68 | 69 | public Long getId() { 70 | return id; 71 | } 72 | 73 | public void setId(Long id) { 74 | this.id = id; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/dao/BiyezigeDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.BiyezigeEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.BiyezigeVO; 12 | import com.entity.view.BiyezigeView; 13 | 14 | 15 | /** 16 | * 毕业资格 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public interface BiyezigeDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | BiyezigeVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | BiyezigeView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | List> selectValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 36 | 37 | List> selectTimeStatValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 38 | 39 | List> selectGroup(@Param("params") Map params,@Param("ew") Wrapper wrapper); 40 | 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/UsersServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 11 | import com.baomidou.mybatisplus.mapper.Wrapper; 12 | import com.baomidou.mybatisplus.plugins.Page; 13 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 14 | import com.dao.UsersDao; 15 | import com.entity.UsersEntity; 16 | import com.service.UsersService; 17 | import com.utils.PageUtils; 18 | import com.utils.Query; 19 | 20 | 21 | /** 22 | * 系统用户 23 | */ 24 | @Service("usersService") 25 | public class UsersServiceImpl extends ServiceImpl implements UsersService { 26 | 27 | @Override 28 | public PageUtils queryPage(Map params) { 29 | Page page = this.selectPage( 30 | new Query(params).getPage(), 31 | new EntityWrapper() 32 | ); 33 | return new PageUtils(page); 34 | } 35 | 36 | @Override 37 | public List selectListView(Wrapper wrapper) { 38 | return baseMapper.selectListView(wrapper); 39 | } 40 | 41 | @Override 42 | public PageUtils queryPage(Map params, 43 | Wrapper wrapper) { 44 | Page page =new Query(params).getPage(); 45 | page.setRecords(baseMapper.selectListView(page,wrapper)); 46 | PageUtils pageUtil = new PageUtils(page); 47 | return pageUtil; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/mapper/JiaoshiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 28 | 29 | 35 | 36 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/config/InterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 8 | 9 | import com.interceptor.AuthorizationInterceptor; 10 | 11 | @Configuration 12 | public class InterceptorConfig extends WebMvcConfigurationSupport{ 13 | 14 | @Bean 15 | public AuthorizationInterceptor getAuthorizationInterceptor() { 16 | return new AuthorizationInterceptor(); 17 | } 18 | 19 | @Override 20 | public void addInterceptors(InterceptorRegistry registry) { 21 | registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**"); 22 | super.addInterceptors(registry); 23 | } 24 | 25 | /** 26 | * springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法 27 | */ 28 | @Override 29 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 30 | registry.addResourceHandler("/**") 31 | .addResourceLocations("classpath:/resources/") 32 | .addResourceLocations("classpath:/static/") 33 | .addResourceLocations("classpath:/admin/") 34 | .addResourceLocations("classpath:/front/") 35 | .addResourceLocations("classpath:/public/"); 36 | super.addResourceHandlers(registry); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/service/XueshengchengjiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.XueshengchengjiEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.XueshengchengjiVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.XueshengchengjiView; 12 | 13 | 14 | /** 15 | * 学生成绩 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public interface XueshengchengjiService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | XueshengchengjiVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | XueshengchengjiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | List> selectValue(Map params,Wrapper wrapper); 37 | 38 | List> selectTimeStatValue(Map params,Wrapper wrapper); 39 | 40 | List> selectGroup(Map params,Wrapper wrapper); 41 | 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/main/java/com/dao/XueshengchengjiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.XueshengchengjiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.XueshengchengjiVO; 12 | import com.entity.view.XueshengchengjiView; 13 | 14 | 15 | /** 16 | * 学生成绩 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public interface XueshengchengjiDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | XueshengchengjiVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | XueshengchengjiView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | List> selectValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 36 | 37 | List> selectTimeStatValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 38 | 39 | List> selectGroup(@Param("params") Map params,@Param("ew") Wrapper wrapper); 40 | 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CommonServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.dao.CommonDao; 12 | import com.service.CommonService; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | @Service("commonService") 19 | public class CommonServiceImpl implements CommonService { 20 | 21 | @Autowired 22 | private CommonDao commonDao; 23 | 24 | @Override 25 | public List getOption(Map params) { 26 | return commonDao.getOption(params); 27 | } 28 | 29 | @Override 30 | public Map getFollowByOption(Map params) { 31 | return commonDao.getFollowByOption(params); 32 | } 33 | 34 | @Override 35 | public void sh(Map params) { 36 | commonDao.sh(params); 37 | } 38 | 39 | @Override 40 | public int remindCount(Map params) { 41 | return commonDao.remindCount(params); 42 | } 43 | 44 | @Override 45 | public Map selectCal(Map params) { 46 | return commonDao.selectCal(params); 47 | } 48 | 49 | @Override 50 | public List> selectGroup(Map params) { 51 | return commonDao.selectGroup(params); 52 | } 53 | 54 | @Override 55 | public List> selectValue(Map params) { 56 | return commonDao.selectValue(params); 57 | } 58 | 59 | @Override 60 | public List> selectTimeStatValue(Map params) { 61 | return commonDao.selectTimeStatValue(params); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于Springboot的高校毕业与学位资格审核系统(程序+论文) 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于Spring Boot框架实现的高校毕业与学位资格审核系统,系统包含三种角色:管理员、学生、教师,主要功能如下。 12 | ### 管理员: 13 | 1. 个人中心:管理员可以管理个人信息,包括修改密码、查看个人资料等。 14 | 2. 学生管理:管理员可以管理学生的基本信息,包括添加、编辑、删除学生信息等操作。 15 | 3. 教师管理:管理员可以管理教师的基本信息,包括添加、编辑、删除教师信息等操作。 16 | 4. 学生成绩管理:管理员可以管理学生的学习成绩,包括录入、修改、查询学生成绩等操作。 17 | 5. 培养方案管理:管理员可以管理学生的培养方案,包括制定、编辑、删除培养方案等操作。 18 | 6. 毕业资格管理:管理员可以审核学生的毕业资格。 19 | 20 | ### 学生: 21 | 1. 个人中心:学生可以管理个人信息,包括修改密码、查看个人资料等。 22 | 2. 学生成绩管理:学生可以查看自己的学习成绩,包括查询已修课程成绩、计算绩点等操作。 23 | 3. 培养方案管理:学生可以查看自己的培养方案,了解所需修读的课程、学分等信息。 24 | 4. 毕业资格管理:学生可以提交毕业资格申请材料,包括学分记录、实习报告等,进行审核操作。 25 | 26 | ### 教师: 27 | 1. 个人中心:教师可以管理个人信息,包括修改密码、查看个人资料等。 28 | 2. 学生成绩管理:教师可以录入和修改学生的学习成绩,对学生的学业情况进行管理。 29 | 3. 培养方案管理:教师可以制定和编辑学生的培养方案,包括设置课程要求、学分要求等。 30 | 4. 毕业资格管理:教师可以审核学生的毕业资格,包括学分要求、课程完成情况、实习报告等审核操作。 31 | 32 | 33 | 34 | 35 | 二、项目技术 36 | --- 37 | - 编程语言:Java 38 | - 数据库:MySQL 39 | - 项目管理工具:Maven 40 | - 前端技术:VUE、HTML、Jquery、Bootstrap 41 | - 后端技术:Spring、SpringMVC、MyBatis 42 | 43 | 三、运行环境 44 | --- 45 | - 操作系统:Windows、macOS都可以 46 | - JDK版本:JDK1.8以上都可以 47 | - 开发工具:IDEA、Ecplise、Myecplise都可以 48 | - 数据库: MySQL5.7以上都可以 49 | - Tomcat:任意版本都可以 50 | - Maven:任意版本都可以 51 | 52 | 四、运行截图 53 | --- 54 | 55 | ### 程序截图: 56 | ![image/1.png](image/1.png) 57 | ![image/1.png](image/2.png) 58 | ![image/1.png](image/3.png) 59 | ![image/1.png](image/4.png) 60 | ![image/1.png](image/5.png) 61 | ![image/1.png](image/6.png) 62 | ![image/1.png](image/7.png) 63 | ![image/1.png](image/8.png) 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/main/resources/mapper/XueshengDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | 38 | 39 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Tomcat 2 | server: 3 | tomcat: 4 | uri-encoding: UTF-8 5 | port: 8080 6 | servlet: 7 | context-path: /springbootzpl96 8 | 9 | 10 | spring: 11 | datasource: 12 | driverClassName: com.mysql.cj.jdbc.Driver 13 | url: jdbc:mysql://127.0.0.1:3306/springbootzpl96?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8 14 | username: root 15 | password: 123456 16 | 17 | # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver 18 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootzpl96 19 | # username: sa 20 | # password: 123456 21 | 22 | servlet: 23 | multipart: 24 | max-file-size: 300MB 25 | max-request-size: 300MB 26 | resources: 27 | static-locations: classpath:static/,file:static/ 28 | 29 | #mybatis 30 | mybatis-plus: 31 | mapper-locations: classpath*:mapper/*.xml 32 | #实体扫描,多个package用逗号或者分号分隔 33 | typeAliasesPackage: com.entity 34 | global-config: 35 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 36 | id-type: 1 37 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 38 | field-strategy: 1 39 | #驼峰下划线转换 40 | db-column-underline: true 41 | #刷新mapper 调试神器 42 | refresh-mapper: true 43 | #逻辑删除配置 44 | logic-delete-value: -1 45 | logic-not-delete-value: 0 46 | #自定义SQL注入器 47 | sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 48 | configuration: 49 | map-underscore-to-camel-case: true 50 | cache-enabled: false 51 | call-setters-on-nulls: true 52 | #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) 53 | jdbc-type-for-null: 'null' 54 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/JiaoshiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.JiaoshiDao; 16 | import com.entity.JiaoshiEntity; 17 | import com.service.JiaoshiService; 18 | import com.entity.vo.JiaoshiVO; 19 | import com.entity.view.JiaoshiView; 20 | 21 | @Service("jiaoshiService") 22 | public class JiaoshiServiceImpl extends ServiceImpl implements JiaoshiService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public JiaoshiVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public JiaoshiView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/XueshengServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.XueshengDao; 16 | import com.entity.XueshengEntity; 17 | import com.service.XueshengService; 18 | import com.entity.vo.XueshengVO; 19 | import com.entity.view.XueshengView; 20 | 21 | @Service("xueshengService") 22 | public class XueshengServiceImpl extends ServiceImpl implements XueshengService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public XueshengVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public XueshengView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/PeiyangfanganServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.PeiyangfanganDao; 16 | import com.entity.PeiyangfanganEntity; 17 | import com.service.PeiyangfanganService; 18 | import com.entity.vo.PeiyangfanganVO; 19 | import com.entity.view.PeiyangfanganView; 20 | 21 | @Service("peiyangfanganService") 22 | public class PeiyangfanganServiceImpl extends ServiceImpl implements PeiyangfanganService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public PeiyangfanganVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public PeiyangfanganView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/resources/mapper/PeiyangfanganDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 37 | 38 | 44 | 45 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.io.Serializable; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import com.baomidou.mybatisplus.plugins.Page; 9 | 10 | /** 11 | * 分页工具类 12 | */ 13 | public class PageUtils implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | //总记录数 16 | private long total; 17 | //每页记录数 18 | private int pageSize; 19 | //总页数 20 | private long totalPage; 21 | //当前页数 22 | private int currPage; 23 | //列表数据 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param totalCount 总记录数 30 | * @param pageSize 每页记录数 31 | * @param currPage 当前页数 32 | */ 33 | public PageUtils(List list, int totalCount, int pageSize, int currPage) { 34 | this.list = list; 35 | this.total = totalCount; 36 | this.pageSize = pageSize; 37 | this.currPage = currPage; 38 | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); 39 | } 40 | 41 | /** 42 | * 分页 43 | */ 44 | public PageUtils(Page page) { 45 | this.list = page.getRecords(); 46 | this.total = page.getTotal(); 47 | this.pageSize = page.getSize(); 48 | this.currPage = page.getCurrent(); 49 | this.totalPage = page.getPages(); 50 | } 51 | 52 | /* 53 | * 空数据的分页 54 | */ 55 | public PageUtils(Map params) { 56 | Page page =new Query(params).getPage(); 57 | new PageUtils(page); 58 | } 59 | 60 | 61 | public int getPageSize() { 62 | return pageSize; 63 | } 64 | 65 | public void setPageSize(int pageSize) { 66 | this.pageSize = pageSize; 67 | } 68 | 69 | public int getCurrPage() { 70 | return currPage; 71 | } 72 | 73 | public void setCurrPage(int currPage) { 74 | this.currPage = currPage; 75 | } 76 | 77 | public List getList() { 78 | return list; 79 | } 80 | 81 | public void setList(List list) { 82 | this.list = list; 83 | } 84 | 85 | public long getTotalPage() { 86 | return totalPage; 87 | } 88 | 89 | public void setTotalPage(long totalPage) { 90 | this.totalPage = totalPage; 91 | } 92 | 93 | public long getTotal() { 94 | return total; 95 | } 96 | 97 | public void setTotal(long total) { 98 | this.total = total; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/TokenServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 13 | import com.baomidou.mybatisplus.mapper.Wrapper; 14 | import com.baomidou.mybatisplus.plugins.Page; 15 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 16 | import com.dao.TokenDao; 17 | import com.entity.TokenEntity; 18 | import com.entity.TokenEntity; 19 | import com.service.TokenService; 20 | import com.utils.CommonUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.Query; 23 | 24 | 25 | /** 26 | * token 27 | */ 28 | @Service("tokenService") 29 | public class TokenServiceImpl extends ServiceImpl implements TokenService { 30 | 31 | @Override 32 | public PageUtils queryPage(Map params) { 33 | Page page = this.selectPage( 34 | new Query(params).getPage(), 35 | new EntityWrapper() 36 | ); 37 | return new PageUtils(page); 38 | } 39 | 40 | @Override 41 | public List selectListView(Wrapper wrapper) { 42 | return baseMapper.selectListView(wrapper); 43 | } 44 | 45 | @Override 46 | public PageUtils queryPage(Map params, 47 | Wrapper wrapper) { 48 | Page page =new Query(params).getPage(); 49 | page.setRecords(baseMapper.selectListView(page,wrapper)); 50 | PageUtils pageUtil = new PageUtils(page); 51 | return pageUtil; 52 | } 53 | 54 | @Override 55 | public String generateToken(Long userid,String username, String tableName, String role) { 56 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("userid", userid).eq("role", role)); 57 | String token = CommonUtil.getRandomString(32); 58 | Calendar cal = Calendar.getInstance(); 59 | cal.setTime(new Date()); 60 | cal.add(Calendar.HOUR_OF_DAY, 1); 61 | if(tokenEntity!=null) { 62 | tokenEntity.setToken(token); 63 | tokenEntity.setExpiratedtime(cal.getTime()); 64 | this.updateById(tokenEntity); 65 | } else { 66 | this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime())); 67 | } 68 | return token; 69 | } 70 | 71 | @Override 72 | public TokenEntity getTokenEntity(String token) { 73 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("token", token)); 74 | if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime() implements BiyezigeService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public BiyezigeVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public BiyezigeView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | @Override 63 | public List> selectValue(Map params, Wrapper wrapper) { 64 | return baseMapper.selectValue(params, wrapper); 65 | } 66 | 67 | @Override 68 | public List> selectTimeStatValue(Map params, Wrapper wrapper) { 69 | return baseMapper.selectTimeStatValue(params, wrapper); 70 | } 71 | 72 | @Override 73 | public List> selectGroup(Map params, Wrapper wrapper) { 74 | return baseMapper.selectGroup(params, wrapper); 75 | } 76 | 77 | 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/JiaoshiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.JiaoshiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 教师 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public class JiaoshiVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 密码 27 | */ 28 | 29 | private String mima; 30 | 31 | /** 32 | * 教师姓名 33 | */ 34 | 35 | private String jiaoshixingming; 36 | 37 | /** 38 | * 性别 39 | */ 40 | 41 | private String xingbie; 42 | 43 | /** 44 | * 职称 45 | */ 46 | 47 | private String zhicheng; 48 | 49 | /** 50 | * 电话号码 51 | */ 52 | 53 | private String dianhuahaoma; 54 | 55 | /** 56 | * 头像 57 | */ 58 | 59 | private String touxiang; 60 | 61 | 62 | /** 63 | * 设置:密码 64 | */ 65 | 66 | public void setMima(String mima) { 67 | this.mima = mima; 68 | } 69 | 70 | /** 71 | * 获取:密码 72 | */ 73 | public String getMima() { 74 | return mima; 75 | } 76 | 77 | 78 | /** 79 | * 设置:教师姓名 80 | */ 81 | 82 | public void setJiaoshixingming(String jiaoshixingming) { 83 | this.jiaoshixingming = jiaoshixingming; 84 | } 85 | 86 | /** 87 | * 获取:教师姓名 88 | */ 89 | public String getJiaoshixingming() { 90 | return jiaoshixingming; 91 | } 92 | 93 | 94 | /** 95 | * 设置:性别 96 | */ 97 | 98 | public void setXingbie(String xingbie) { 99 | this.xingbie = xingbie; 100 | } 101 | 102 | /** 103 | * 获取:性别 104 | */ 105 | public String getXingbie() { 106 | return xingbie; 107 | } 108 | 109 | 110 | /** 111 | * 设置:职称 112 | */ 113 | 114 | public void setZhicheng(String zhicheng) { 115 | this.zhicheng = zhicheng; 116 | } 117 | 118 | /** 119 | * 获取:职称 120 | */ 121 | public String getZhicheng() { 122 | return zhicheng; 123 | } 124 | 125 | 126 | /** 127 | * 设置:电话号码 128 | */ 129 | 130 | public void setDianhuahaoma(String dianhuahaoma) { 131 | this.dianhuahaoma = dianhuahaoma; 132 | } 133 | 134 | /** 135 | * 获取:电话号码 136 | */ 137 | public String getDianhuahaoma() { 138 | return dianhuahaoma; 139 | } 140 | 141 | 142 | /** 143 | * 设置:头像 144 | */ 145 | 146 | public void setTouxiang(String touxiang) { 147 | this.touxiang = touxiang; 148 | } 149 | 150 | /** 151 | * 获取:头像 152 | */ 153 | public String getTouxiang() { 154 | return touxiang; 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /src/main/java/com/utils/Query.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import org.apache.commons.lang3.StringUtils; 8 | 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | 11 | /** 12 | * 查询参数 13 | */ 14 | public class Query extends LinkedHashMap { 15 | private static final long serialVersionUID = 1L; 16 | /** 17 | * mybatis-plus分页参数 18 | */ 19 | private Page page; 20 | /** 21 | * 当前页码 22 | */ 23 | private int currPage = 1; 24 | /** 25 | * 每页条数 26 | */ 27 | private int limit = 10; 28 | 29 | public Query(JQPageInfo pageInfo) { 30 | //分页参数 31 | if(pageInfo.getPage()!= null){ 32 | currPage = pageInfo.getPage(); 33 | } 34 | if(pageInfo.getLimit()!= null){ 35 | limit = pageInfo.getLimit(); 36 | } 37 | 38 | 39 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 40 | String sidx = SQLFilter.sqlInject(pageInfo.getSidx()); 41 | String order = SQLFilter.sqlInject(pageInfo.getOrder()); 42 | 43 | 44 | //mybatis-plus分页 45 | this.page = new Page<>(currPage, limit); 46 | 47 | //排序 48 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 49 | this.page.setOrderByField(sidx); 50 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 51 | } 52 | } 53 | 54 | 55 | public Query(Map params){ 56 | this.putAll(params); 57 | 58 | //分页参数 59 | if(params.get("page") != null){ 60 | currPage = Integer.parseInt((String)params.get("page")); 61 | } 62 | if(params.get("limit") != null){ 63 | limit = Integer.parseInt((String)params.get("limit")); 64 | } 65 | 66 | this.put("offset", (currPage - 1) * limit); 67 | this.put("page", currPage); 68 | this.put("limit", limit); 69 | 70 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 71 | String sidx = SQLFilter.sqlInject((String)params.get("sidx")); 72 | String order = SQLFilter.sqlInject((String)params.get("order")); 73 | this.put("sidx", sidx); 74 | this.put("order", order); 75 | 76 | //mybatis-plus分页 77 | this.page = new Page<>(currPage, limit); 78 | 79 | //排序 80 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 81 | this.page.setOrderByField(sidx); 82 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 83 | } 84 | 85 | } 86 | 87 | public Page getPage() { 88 | return page; 89 | } 90 | 91 | public int getCurrPage() { 92 | return currPage; 93 | } 94 | 95 | public int getLimit() { 96 | return limit; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/JiaoshiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.JiaoshiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 教师 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public class JiaoshiModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 密码 28 | */ 29 | 30 | private String mima; 31 | 32 | /** 33 | * 教师姓名 34 | */ 35 | 36 | private String jiaoshixingming; 37 | 38 | /** 39 | * 性别 40 | */ 41 | 42 | private String xingbie; 43 | 44 | /** 45 | * 职称 46 | */ 47 | 48 | private String zhicheng; 49 | 50 | /** 51 | * 电话号码 52 | */ 53 | 54 | private String dianhuahaoma; 55 | 56 | /** 57 | * 头像 58 | */ 59 | 60 | private String touxiang; 61 | 62 | 63 | /** 64 | * 设置:密码 65 | */ 66 | 67 | public void setMima(String mima) { 68 | this.mima = mima; 69 | } 70 | 71 | /** 72 | * 获取:密码 73 | */ 74 | public String getMima() { 75 | return mima; 76 | } 77 | 78 | 79 | /** 80 | * 设置:教师姓名 81 | */ 82 | 83 | public void setJiaoshixingming(String jiaoshixingming) { 84 | this.jiaoshixingming = jiaoshixingming; 85 | } 86 | 87 | /** 88 | * 获取:教师姓名 89 | */ 90 | public String getJiaoshixingming() { 91 | return jiaoshixingming; 92 | } 93 | 94 | 95 | /** 96 | * 设置:性别 97 | */ 98 | 99 | public void setXingbie(String xingbie) { 100 | this.xingbie = xingbie; 101 | } 102 | 103 | /** 104 | * 获取:性别 105 | */ 106 | public String getXingbie() { 107 | return xingbie; 108 | } 109 | 110 | 111 | /** 112 | * 设置:职称 113 | */ 114 | 115 | public void setZhicheng(String zhicheng) { 116 | this.zhicheng = zhicheng; 117 | } 118 | 119 | /** 120 | * 获取:职称 121 | */ 122 | public String getZhicheng() { 123 | return zhicheng; 124 | } 125 | 126 | 127 | /** 128 | * 设置:电话号码 129 | */ 130 | 131 | public void setDianhuahaoma(String dianhuahaoma) { 132 | this.dianhuahaoma = dianhuahaoma; 133 | } 134 | 135 | /** 136 | * 获取:电话号码 137 | */ 138 | public String getDianhuahaoma() { 139 | return dianhuahaoma; 140 | } 141 | 142 | 143 | /** 144 | * 设置:头像 145 | */ 146 | 147 | public void setTouxiang(String touxiang) { 148 | this.touxiang = touxiang; 149 | } 150 | 151 | /** 152 | * 获取:头像 153 | */ 154 | public String getTouxiang() { 155 | return touxiang; 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CommonDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 22 | 23 | 24 | UPDATE ${table} set sfsh=#{sfsh} where id=#{id} 25 | 26 | 27 | 47 | 48 | 51 | 52 | 55 | 56 | 59 | 60 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/XueshengchengjiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.XueshengchengjiDao; 16 | import com.entity.XueshengchengjiEntity; 17 | import com.service.XueshengchengjiService; 18 | import com.entity.vo.XueshengchengjiVO; 19 | import com.entity.view.XueshengchengjiView; 20 | 21 | @Service("xueshengchengjiService") 22 | public class XueshengchengjiServiceImpl extends ServiceImpl implements XueshengchengjiService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public XueshengchengjiVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public XueshengchengjiView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | @Override 63 | public List> selectValue(Map params, Wrapper wrapper) { 64 | return baseMapper.selectValue(params, wrapper); 65 | } 66 | 67 | @Override 68 | public List> selectTimeStatValue(Map params, Wrapper wrapper) { 69 | return baseMapper.selectTimeStatValue(params, wrapper); 70 | } 71 | 72 | @Override 73 | public List> selectGroup(Map params, Wrapper wrapper) { 74 | return baseMapper.selectGroup(params, wrapper); 75 | } 76 | 77 | 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/resources/mapper/BiyezigeDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 34 | 35 | 41 | 42 | 46 | 47 | 48 | 54 | 55 | 72 | 73 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/main/java/com/interceptor/AuthorizationInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.interceptor; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | import com.alibaba.fastjson.JSONObject; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Component; 14 | import org.springframework.web.method.HandlerMethod; 15 | import org.springframework.web.servlet.HandlerInterceptor; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.http.HttpStatus; 18 | 19 | import com.annotation.IgnoreAuth; 20 | import com.entity.EIException; 21 | import com.entity.TokenEntity; 22 | import com.service.TokenService; 23 | import com.utils.R; 24 | 25 | /** 26 | * 权限(Token)验证 27 | */ 28 | @Component 29 | public class AuthorizationInterceptor implements HandlerInterceptor { 30 | 31 | public static final String LOGIN_TOKEN_KEY = "Token"; 32 | 33 | @Autowired 34 | private TokenService tokenService; 35 | 36 | @Override 37 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 38 | 39 | //支持跨域请求 40 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); 41 | response.setHeader("Access-Control-Max-Age", "3600"); 42 | response.setHeader("Access-Control-Allow-Credentials", "true"); 43 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); 44 | response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); 45 | // 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态 46 | if (request.getMethod().equals(RequestMethod.OPTIONS.name())) { 47 | response.setStatus(HttpStatus.OK.value()); 48 | return false; 49 | } 50 | 51 | IgnoreAuth annotation; 52 | if (handler instanceof HandlerMethod) { 53 | annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); 54 | } else { 55 | return true; 56 | } 57 | 58 | //从header中获取token 59 | String token = request.getHeader(LOGIN_TOKEN_KEY); 60 | 61 | /** 62 | * 不需要验证权限的方法直接放过 63 | */ 64 | if(annotation!=null) { 65 | return true; 66 | } 67 | 68 | TokenEntity tokenEntity = null; 69 | if(StringUtils.isNotBlank(token)) { 70 | tokenEntity = tokenService.getTokenEntity(token); 71 | } 72 | 73 | if(tokenEntity != null) { 74 | request.getSession().setAttribute("userId", tokenEntity.getUserid()); 75 | request.getSession().setAttribute("role", tokenEntity.getRole()); 76 | request.getSession().setAttribute("tableName", tokenEntity.getTablename()); 77 | request.getSession().setAttribute("username", tokenEntity.getUsername()); 78 | return true; 79 | } 80 | 81 | PrintWriter writer = null; 82 | response.setCharacterEncoding("UTF-8"); 83 | response.setContentType("application/json; charset=utf-8"); 84 | try { 85 | writer = response.getWriter(); 86 | writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); 87 | } finally { 88 | if(writer != null){ 89 | writer.close(); 90 | } 91 | } 92 | // throw new EIException("请先登录", 401); 93 | return false; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.annotation.IgnoreAuth; 17 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 18 | import com.entity.ConfigEntity; 19 | import com.service.ConfigService; 20 | import com.utils.MPUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.R; 23 | import com.utils.ValidatorUtils; 24 | 25 | /** 26 | * 登录相关 27 | */ 28 | @RequestMapping("config") 29 | @RestController 30 | public class ConfigController{ 31 | 32 | @Autowired 33 | private ConfigService configService; 34 | 35 | /** 36 | * 列表 37 | */ 38 | @RequestMapping("/page") 39 | public R page(@RequestParam Map params,ConfigEntity config){ 40 | EntityWrapper ew = new EntityWrapper(); 41 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params)); 42 | return R.ok().put("data", page); 43 | } 44 | 45 | /** 46 | * 列表 47 | */ 48 | @IgnoreAuth 49 | @RequestMapping("/list") 50 | public R list(@RequestParam Map params,ConfigEntity config){ 51 | EntityWrapper ew = new EntityWrapper(); 52 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params)); 53 | return R.ok().put("data", page); 54 | } 55 | 56 | /** 57 | * 信息 58 | */ 59 | @RequestMapping("/info/{id}") 60 | public R info(@PathVariable("id") String id){ 61 | ConfigEntity config = configService.selectById(id); 62 | return R.ok().put("data", config); 63 | } 64 | 65 | /** 66 | * 详情 67 | */ 68 | @IgnoreAuth 69 | @RequestMapping("/detail/{id}") 70 | public R detail(@PathVariable("id") String id){ 71 | ConfigEntity config = configService.selectById(id); 72 | return R.ok().put("data", config); 73 | } 74 | 75 | /** 76 | * 根据name获取信息 77 | */ 78 | @RequestMapping("/info") 79 | public R infoByName(@RequestParam String name){ 80 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 81 | return R.ok().put("data", config); 82 | } 83 | 84 | /** 85 | * 保存 86 | */ 87 | @PostMapping("/save") 88 | public R save(@RequestBody ConfigEntity config){ 89 | // ValidatorUtils.validateEntity(config); 90 | configService.insert(config); 91 | return R.ok(); 92 | } 93 | 94 | /** 95 | * 修改 96 | */ 97 | @RequestMapping("/update") 98 | public R update(@RequestBody ConfigEntity config){ 99 | // ValidatorUtils.validateEntity(config); 100 | configService.updateById(config);//全部更新 101 | return R.ok(); 102 | } 103 | 104 | /** 105 | * 删除 106 | */ 107 | @RequestMapping("/delete") 108 | public R delete(@RequestBody Long[] ids){ 109 | configService.deleteBatchIds(Arrays.asList(ids)); 110 | return R.ok(); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/resources/mapper/XueshengchengjiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 35 | 36 | 42 | 43 | 47 | 48 | 49 | 55 | 56 | 73 | 74 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/XueshengVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.XueshengEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 学生 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public class XueshengVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 姓名 27 | */ 28 | 29 | private String xingming; 30 | 31 | /** 32 | * 密码 33 | */ 34 | 35 | private String mima; 36 | 37 | /** 38 | * 性别 39 | */ 40 | 41 | private String xingbie; 42 | 43 | /** 44 | * 身份证 45 | */ 46 | 47 | private String shenfenzheng; 48 | 49 | /** 50 | * 手机 51 | */ 52 | 53 | private String shouji; 54 | 55 | /** 56 | * 专业 57 | */ 58 | 59 | private String zhuanye; 60 | 61 | /** 62 | * 班级 63 | */ 64 | 65 | private String banji; 66 | 67 | /** 68 | * 头像 69 | */ 70 | 71 | private String touxiang; 72 | 73 | /** 74 | * 院系 75 | */ 76 | 77 | private String yuanxi; 78 | 79 | 80 | /** 81 | * 设置:姓名 82 | */ 83 | 84 | public void setXingming(String xingming) { 85 | this.xingming = xingming; 86 | } 87 | 88 | /** 89 | * 获取:姓名 90 | */ 91 | public String getXingming() { 92 | return xingming; 93 | } 94 | 95 | 96 | /** 97 | * 设置:密码 98 | */ 99 | 100 | public void setMima(String mima) { 101 | this.mima = mima; 102 | } 103 | 104 | /** 105 | * 获取:密码 106 | */ 107 | public String getMima() { 108 | return mima; 109 | } 110 | 111 | 112 | /** 113 | * 设置:性别 114 | */ 115 | 116 | public void setXingbie(String xingbie) { 117 | this.xingbie = xingbie; 118 | } 119 | 120 | /** 121 | * 获取:性别 122 | */ 123 | public String getXingbie() { 124 | return xingbie; 125 | } 126 | 127 | 128 | /** 129 | * 设置:身份证 130 | */ 131 | 132 | public void setShenfenzheng(String shenfenzheng) { 133 | this.shenfenzheng = shenfenzheng; 134 | } 135 | 136 | /** 137 | * 获取:身份证 138 | */ 139 | public String getShenfenzheng() { 140 | return shenfenzheng; 141 | } 142 | 143 | 144 | /** 145 | * 设置:手机 146 | */ 147 | 148 | public void setShouji(String shouji) { 149 | this.shouji = shouji; 150 | } 151 | 152 | /** 153 | * 获取:手机 154 | */ 155 | public String getShouji() { 156 | return shouji; 157 | } 158 | 159 | 160 | /** 161 | * 设置:专业 162 | */ 163 | 164 | public void setZhuanye(String zhuanye) { 165 | this.zhuanye = zhuanye; 166 | } 167 | 168 | /** 169 | * 获取:专业 170 | */ 171 | public String getZhuanye() { 172 | return zhuanye; 173 | } 174 | 175 | 176 | /** 177 | * 设置:班级 178 | */ 179 | 180 | public void setBanji(String banji) { 181 | this.banji = banji; 182 | } 183 | 184 | /** 185 | * 获取:班级 186 | */ 187 | public String getBanji() { 188 | return banji; 189 | } 190 | 191 | 192 | /** 193 | * 设置:头像 194 | */ 195 | 196 | public void setTouxiang(String touxiang) { 197 | this.touxiang = touxiang; 198 | } 199 | 200 | /** 201 | * 获取:头像 202 | */ 203 | public String getTouxiang() { 204 | return touxiang; 205 | } 206 | 207 | 208 | /** 209 | * 设置:院系 210 | */ 211 | 212 | public void setYuanxi(String yuanxi) { 213 | this.yuanxi = yuanxi; 214 | } 215 | 216 | /** 217 | * 获取:院系 218 | */ 219 | public String getYuanxi() { 220 | return yuanxi; 221 | } 222 | 223 | } 224 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/XueshengModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.XueshengEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 学生 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public class XueshengModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 姓名 28 | */ 29 | 30 | private String xingming; 31 | 32 | /** 33 | * 密码 34 | */ 35 | 36 | private String mima; 37 | 38 | /** 39 | * 性别 40 | */ 41 | 42 | private String xingbie; 43 | 44 | /** 45 | * 身份证 46 | */ 47 | 48 | private String shenfenzheng; 49 | 50 | /** 51 | * 手机 52 | */ 53 | 54 | private String shouji; 55 | 56 | /** 57 | * 专业 58 | */ 59 | 60 | private String zhuanye; 61 | 62 | /** 63 | * 班级 64 | */ 65 | 66 | private String banji; 67 | 68 | /** 69 | * 头像 70 | */ 71 | 72 | private String touxiang; 73 | 74 | /** 75 | * 院系 76 | */ 77 | 78 | private String yuanxi; 79 | 80 | 81 | /** 82 | * 设置:姓名 83 | */ 84 | 85 | public void setXingming(String xingming) { 86 | this.xingming = xingming; 87 | } 88 | 89 | /** 90 | * 获取:姓名 91 | */ 92 | public String getXingming() { 93 | return xingming; 94 | } 95 | 96 | 97 | /** 98 | * 设置:密码 99 | */ 100 | 101 | public void setMima(String mima) { 102 | this.mima = mima; 103 | } 104 | 105 | /** 106 | * 获取:密码 107 | */ 108 | public String getMima() { 109 | return mima; 110 | } 111 | 112 | 113 | /** 114 | * 设置:性别 115 | */ 116 | 117 | public void setXingbie(String xingbie) { 118 | this.xingbie = xingbie; 119 | } 120 | 121 | /** 122 | * 获取:性别 123 | */ 124 | public String getXingbie() { 125 | return xingbie; 126 | } 127 | 128 | 129 | /** 130 | * 设置:身份证 131 | */ 132 | 133 | public void setShenfenzheng(String shenfenzheng) { 134 | this.shenfenzheng = shenfenzheng; 135 | } 136 | 137 | /** 138 | * 获取:身份证 139 | */ 140 | public String getShenfenzheng() { 141 | return shenfenzheng; 142 | } 143 | 144 | 145 | /** 146 | * 设置:手机 147 | */ 148 | 149 | public void setShouji(String shouji) { 150 | this.shouji = shouji; 151 | } 152 | 153 | /** 154 | * 获取:手机 155 | */ 156 | public String getShouji() { 157 | return shouji; 158 | } 159 | 160 | 161 | /** 162 | * 设置:专业 163 | */ 164 | 165 | public void setZhuanye(String zhuanye) { 166 | this.zhuanye = zhuanye; 167 | } 168 | 169 | /** 170 | * 获取:专业 171 | */ 172 | public String getZhuanye() { 173 | return zhuanye; 174 | } 175 | 176 | 177 | /** 178 | * 设置:班级 179 | */ 180 | 181 | public void setBanji(String banji) { 182 | this.banji = banji; 183 | } 184 | 185 | /** 186 | * 获取:班级 187 | */ 188 | public String getBanji() { 189 | return banji; 190 | } 191 | 192 | 193 | /** 194 | * 设置:头像 195 | */ 196 | 197 | public void setTouxiang(String touxiang) { 198 | this.touxiang = touxiang; 199 | } 200 | 201 | /** 202 | * 获取:头像 203 | */ 204 | public String getTouxiang() { 205 | return touxiang; 206 | } 207 | 208 | 209 | /** 210 | * 设置:院系 211 | */ 212 | 213 | public void setYuanxi(String yuanxi) { 214 | this.yuanxi = yuanxi; 215 | } 216 | 217 | /** 218 | * 获取:院系 219 | */ 220 | public String getYuanxi() { 221 | return yuanxi; 222 | } 223 | 224 | } 225 | -------------------------------------------------------------------------------- /src/main/java/com/entity/JiaoshiEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 教师 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-04-03 16:15:19 30 | */ 31 | @TableName("jiaoshi") 32 | public class JiaoshiEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public JiaoshiEntity() { 37 | 38 | } 39 | 40 | public JiaoshiEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 教师工号 56 | */ 57 | 58 | private String jiaoshigonghao; 59 | 60 | /** 61 | * 密码 62 | */ 63 | 64 | private String mima; 65 | 66 | /** 67 | * 教师姓名 68 | */ 69 | 70 | private String jiaoshixingming; 71 | 72 | /** 73 | * 性别 74 | */ 75 | 76 | private String xingbie; 77 | 78 | /** 79 | * 职称 80 | */ 81 | 82 | private String zhicheng; 83 | 84 | /** 85 | * 电话号码 86 | */ 87 | 88 | private String dianhuahaoma; 89 | 90 | /** 91 | * 头像 92 | */ 93 | 94 | private String touxiang; 95 | 96 | 97 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 98 | @DateTimeFormat 99 | private Date addtime; 100 | 101 | public Date getAddtime() { 102 | return addtime; 103 | } 104 | public void setAddtime(Date addtime) { 105 | this.addtime = addtime; 106 | } 107 | 108 | public Long getId() { 109 | return id; 110 | } 111 | 112 | public void setId(Long id) { 113 | this.id = id; 114 | } 115 | /** 116 | * 设置:教师工号 117 | */ 118 | public void setJiaoshigonghao(String jiaoshigonghao) { 119 | this.jiaoshigonghao = jiaoshigonghao; 120 | } 121 | /** 122 | * 获取:教师工号 123 | */ 124 | public String getJiaoshigonghao() { 125 | return jiaoshigonghao; 126 | } 127 | /** 128 | * 设置:密码 129 | */ 130 | public void setMima(String mima) { 131 | this.mima = mima; 132 | } 133 | /** 134 | * 获取:密码 135 | */ 136 | public String getMima() { 137 | return mima; 138 | } 139 | /** 140 | * 设置:教师姓名 141 | */ 142 | public void setJiaoshixingming(String jiaoshixingming) { 143 | this.jiaoshixingming = jiaoshixingming; 144 | } 145 | /** 146 | * 获取:教师姓名 147 | */ 148 | public String getJiaoshixingming() { 149 | return jiaoshixingming; 150 | } 151 | /** 152 | * 设置:性别 153 | */ 154 | public void setXingbie(String xingbie) { 155 | this.xingbie = xingbie; 156 | } 157 | /** 158 | * 获取:性别 159 | */ 160 | public String getXingbie() { 161 | return xingbie; 162 | } 163 | /** 164 | * 设置:职称 165 | */ 166 | public void setZhicheng(String zhicheng) { 167 | this.zhicheng = zhicheng; 168 | } 169 | /** 170 | * 获取:职称 171 | */ 172 | public String getZhicheng() { 173 | return zhicheng; 174 | } 175 | /** 176 | * 设置:电话号码 177 | */ 178 | public void setDianhuahaoma(String dianhuahaoma) { 179 | this.dianhuahaoma = dianhuahaoma; 180 | } 181 | /** 182 | * 获取:电话号码 183 | */ 184 | public String getDianhuahaoma() { 185 | return dianhuahaoma; 186 | } 187 | /** 188 | * 设置:头像 189 | */ 190 | public void setTouxiang(String touxiang) { 191 | this.touxiang = touxiang; 192 | } 193 | /** 194 | * 获取:头像 195 | */ 196 | public String getTouxiang() { 197 | return touxiang; 198 | } 199 | 200 | } 201 | -------------------------------------------------------------------------------- /src/main/java/com/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.IOException; 6 | import java.util.Arrays; 7 | import java.util.Date; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Random; 12 | import java.util.UUID; 13 | 14 | import org.apache.commons.io.FileUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpHeaders; 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.http.MediaType; 20 | import org.springframework.http.ResponseEntity; 21 | import org.springframework.util.ResourceUtils; 22 | import org.springframework.web.bind.annotation.PathVariable; 23 | import org.springframework.web.bind.annotation.RequestBody; 24 | import org.springframework.web.bind.annotation.RequestMapping; 25 | import org.springframework.web.bind.annotation.RequestParam; 26 | import org.springframework.web.bind.annotation.RestController; 27 | import org.springframework.web.multipart.MultipartFile; 28 | 29 | import com.annotation.IgnoreAuth; 30 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 31 | import com.entity.ConfigEntity; 32 | import com.entity.EIException; 33 | import com.service.ConfigService; 34 | import com.utils.R; 35 | 36 | /** 37 | * 上传文件映射表 38 | */ 39 | @RestController 40 | @RequestMapping("file") 41 | @SuppressWarnings({"unchecked","rawtypes"}) 42 | public class FileController{ 43 | @Autowired 44 | private ConfigService configService; 45 | /** 46 | * 上传文件 47 | */ 48 | @RequestMapping("/upload") 49 | @IgnoreAuth 50 | public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception { 51 | if (file.isEmpty()) { 52 | throw new EIException("上传文件不能为空"); 53 | } 54 | String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); 55 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 56 | if(!path.exists()) { 57 | path = new File(""); 58 | } 59 | File upload = new File(path.getAbsolutePath(),"/upload/"); 60 | if(!upload.exists()) { 61 | upload.mkdirs(); 62 | } 63 | String fileName = new Date().getTime()+"."+fileExt; 64 | File dest = new File(upload.getAbsolutePath()+"/"+fileName); 65 | file.transferTo(dest); 66 | /** 67 | * 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开 68 | * 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径, 69 | * 并且项目路径不能存在中文、空格等特殊字符 70 | */ 71 | // FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/ 72 | if(StringUtils.isNotBlank(type) && type.equals("1")) { 73 | ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 74 | if(configEntity==null) { 75 | configEntity = new ConfigEntity(); 76 | configEntity.setName("faceFile"); 77 | configEntity.setValue(fileName); 78 | } else { 79 | configEntity.setValue(fileName); 80 | } 81 | configService.insertOrUpdate(configEntity); 82 | } 83 | return R.ok().put("file", fileName); 84 | } 85 | 86 | /** 87 | * 下载文件 88 | */ 89 | @IgnoreAuth 90 | @RequestMapping("/download") 91 | public ResponseEntity download(@RequestParam String fileName) { 92 | try { 93 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 94 | if(!path.exists()) { 95 | path = new File(""); 96 | } 97 | File upload = new File(path.getAbsolutePath(),"/upload/"); 98 | if(!upload.exists()) { 99 | upload.mkdirs(); 100 | } 101 | File file = new File(upload.getAbsolutePath()+"/"+fileName); 102 | if(file.exists()){ 103 | /*if(!fileService.canRead(file, SessionManager.getSessionUser())){ 104 | getResponse().sendError(403); 105 | }*/ 106 | HttpHeaders headers = new HttpHeaders(); 107 | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); 108 | headers.setContentDispositionFormData("attachment", fileName); 109 | return new ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); 110 | } 111 | } catch (IOException e) { 112 | e.printStackTrace(); 113 | } 114 | return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/com/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.Random; 4 | import java.util.ArrayList; 5 | import org.springframework.stereotype.Component; 6 | import org.apache.commons.lang3.StringUtils; 7 | import org.apache.poi.ss.usermodel.Cell; 8 | import java.text.DecimalFormat; 9 | import java.text.SimpleDateFormat; 10 | import org.apache.poi.ss.usermodel.DateUtil; 11 | import java.util.Objects; 12 | import com.alibaba.fastjson.JSONObject; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | 15 | @Component 16 | public class CommonUtil { 17 | /** 18 | * 获取随机字符串 19 | * 20 | * @param num 21 | * @return 22 | */ 23 | public static String getRandomString(Integer num) { 24 | String base = "abcdefghijklmnopqrstuvwxyz0123456789"; 25 | Random random = new Random(); 26 | StringBuffer sb = new StringBuffer(); 27 | for (int i = 0; i < num; i++) { 28 | int number = random.nextInt(base.length()); 29 | sb.append(base.charAt(number)); 30 | } 31 | return sb.toString(); 32 | } 33 | 34 | /** 35 | * 获取随机验证码 36 | * 37 | * @param num 38 | * @return 39 | */ 40 | public static String getRandomNumber(Integer num) { 41 | String base = "0123456789"; 42 | Random random = new Random(); 43 | StringBuffer sb = new StringBuffer(); 44 | for (int i = 0; i < num; i++) { 45 | int number = random.nextInt(base.length()); 46 | sb.append(base.charAt(number)); 47 | } 48 | return sb.toString(); 49 | } 50 | 51 | public static String getCellValue(Cell cell) { 52 | String resultValue = ""; 53 | // 判空 54 | if (Objects.isNull(cell)) { 55 | return resultValue; 56 | } 57 | 58 | // 拿到单元格类型 59 | int cellType = cell.getCellType(); 60 | switch (cellType) { 61 | // 字符串类型 62 | case Cell.CELL_TYPE_STRING: 63 | resultValue = StringUtils.isEmpty(cell.getStringCellValue()) ? "" : cell.getStringCellValue().trim(); 64 | break; 65 | // 布尔类型 66 | case Cell.CELL_TYPE_BOOLEAN: 67 | resultValue = String.valueOf(cell.getBooleanCellValue()); 68 | break; 69 | // 数值类型 70 | case Cell.CELL_TYPE_NUMERIC: 71 | /** 72 | * format 的值可能为以下这些 yyyyMMddHHmmss 73 | * yyyy-MM-dd----- 14 74 | * yyyy年m月d日----- 31 75 | * yyyy年m月--------57 76 | * m月d日 -----------58 77 | * HH:mm-----------20 78 | * h时mm分 --------- 32 79 | */ 80 | Object val = cell.getNumericCellValue(); 81 | // POI Excel 日期格式转换 82 | String formatDate = ""; 83 | switch (cell.getCellStyle().getDataFormat()){ 84 | case 14: 85 | formatDate = "yyyy-MM-dd"; 86 | break; 87 | case 20: 88 | formatDate = "HH:mm"; 89 | break; 90 | case 21: 91 | formatDate = "HH:mm:ss"; 92 | break; 93 | case 31: 94 | formatDate = "yyyy年MM月dd日"; 95 | break; 96 | case 32: 97 | formatDate = "HH时mm分"; 98 | break; 99 | case 33: 100 | formatDate = "HH时mm分mm秒"; 101 | break; 102 | case 57: 103 | formatDate = "yyyy年MM月"; 104 | break; 105 | case 58: 106 | formatDate = "MM月dd日"; 107 | break; 108 | case 176: 109 | formatDate = "yyyy-MM-dd HH:mm:ss"; 110 | break; 111 | } 112 | if(!"".equals(formatDate)){ 113 | resultValue = new SimpleDateFormat(formatDate).format(DateUtil.getJavaDate((Double) val)); 114 | }else{ 115 | resultValue = new DecimalFormat("#.######").format(cell.getNumericCellValue()); 116 | } 117 | break; 118 | // 取空串 119 | default: 120 | break; 121 | } 122 | return resultValue; 123 | } 124 | 125 | 126 | 127 | 128 | 129 | } 130 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/BiyezigeVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.BiyezigeEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 毕业资格 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public class BiyezigeVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 姓名 27 | */ 28 | 29 | private String xingming; 30 | 31 | /** 32 | * 院系 33 | */ 34 | 35 | private String yuanxi; 36 | 37 | /** 38 | * 专业 39 | */ 40 | 41 | private String zhuanye; 42 | 43 | /** 44 | * 班级 45 | */ 46 | 47 | private String banji; 48 | 49 | /** 50 | * 身份证 51 | */ 52 | 53 | private String shenfenzheng; 54 | 55 | /** 56 | * 毕业情况 57 | */ 58 | 59 | private String biyeqingkuang; 60 | 61 | /** 62 | * 年份 63 | */ 64 | 65 | private String nianfen; 66 | 67 | /** 68 | * 登记时间 69 | */ 70 | 71 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 72 | @DateTimeFormat 73 | private Date dengjishijian; 74 | 75 | /** 76 | * 教师工号 77 | */ 78 | 79 | private String jiaoshigonghao; 80 | 81 | /** 82 | * 教师姓名 83 | */ 84 | 85 | private String jiaoshixingming; 86 | 87 | /** 88 | * 是否审核 89 | */ 90 | 91 | private String sfsh; 92 | 93 | /** 94 | * 审核回复 95 | */ 96 | 97 | private String shhf; 98 | 99 | 100 | /** 101 | * 设置:姓名 102 | */ 103 | 104 | public void setXingming(String xingming) { 105 | this.xingming = xingming; 106 | } 107 | 108 | /** 109 | * 获取:姓名 110 | */ 111 | public String getXingming() { 112 | return xingming; 113 | } 114 | 115 | 116 | /** 117 | * 设置:院系 118 | */ 119 | 120 | public void setYuanxi(String yuanxi) { 121 | this.yuanxi = yuanxi; 122 | } 123 | 124 | /** 125 | * 获取:院系 126 | */ 127 | public String getYuanxi() { 128 | return yuanxi; 129 | } 130 | 131 | 132 | /** 133 | * 设置:专业 134 | */ 135 | 136 | public void setZhuanye(String zhuanye) { 137 | this.zhuanye = zhuanye; 138 | } 139 | 140 | /** 141 | * 获取:专业 142 | */ 143 | public String getZhuanye() { 144 | return zhuanye; 145 | } 146 | 147 | 148 | /** 149 | * 设置:班级 150 | */ 151 | 152 | public void setBanji(String banji) { 153 | this.banji = banji; 154 | } 155 | 156 | /** 157 | * 获取:班级 158 | */ 159 | public String getBanji() { 160 | return banji; 161 | } 162 | 163 | 164 | /** 165 | * 设置:身份证 166 | */ 167 | 168 | public void setShenfenzheng(String shenfenzheng) { 169 | this.shenfenzheng = shenfenzheng; 170 | } 171 | 172 | /** 173 | * 获取:身份证 174 | */ 175 | public String getShenfenzheng() { 176 | return shenfenzheng; 177 | } 178 | 179 | 180 | /** 181 | * 设置:毕业情况 182 | */ 183 | 184 | public void setBiyeqingkuang(String biyeqingkuang) { 185 | this.biyeqingkuang = biyeqingkuang; 186 | } 187 | 188 | /** 189 | * 获取:毕业情况 190 | */ 191 | public String getBiyeqingkuang() { 192 | return biyeqingkuang; 193 | } 194 | 195 | 196 | /** 197 | * 设置:年份 198 | */ 199 | 200 | public void setNianfen(String nianfen) { 201 | this.nianfen = nianfen; 202 | } 203 | 204 | /** 205 | * 获取:年份 206 | */ 207 | public String getNianfen() { 208 | return nianfen; 209 | } 210 | 211 | 212 | /** 213 | * 设置:登记时间 214 | */ 215 | 216 | public void setDengjishijian(Date dengjishijian) { 217 | this.dengjishijian = dengjishijian; 218 | } 219 | 220 | /** 221 | * 获取:登记时间 222 | */ 223 | public Date getDengjishijian() { 224 | return dengjishijian; 225 | } 226 | 227 | 228 | /** 229 | * 设置:教师工号 230 | */ 231 | 232 | public void setJiaoshigonghao(String jiaoshigonghao) { 233 | this.jiaoshigonghao = jiaoshigonghao; 234 | } 235 | 236 | /** 237 | * 获取:教师工号 238 | */ 239 | public String getJiaoshigonghao() { 240 | return jiaoshigonghao; 241 | } 242 | 243 | 244 | /** 245 | * 设置:教师姓名 246 | */ 247 | 248 | public void setJiaoshixingming(String jiaoshixingming) { 249 | this.jiaoshixingming = jiaoshixingming; 250 | } 251 | 252 | /** 253 | * 获取:教师姓名 254 | */ 255 | public String getJiaoshixingming() { 256 | return jiaoshixingming; 257 | } 258 | 259 | 260 | /** 261 | * 设置:是否审核 262 | */ 263 | 264 | public void setSfsh(String sfsh) { 265 | this.sfsh = sfsh; 266 | } 267 | 268 | /** 269 | * 获取:是否审核 270 | */ 271 | public String getSfsh() { 272 | return sfsh; 273 | } 274 | 275 | 276 | /** 277 | * 设置:审核回复 278 | */ 279 | 280 | public void setShhf(String shhf) { 281 | this.shhf = shhf; 282 | } 283 | 284 | /** 285 | * 获取:审核回复 286 | */ 287 | public String getShhf() { 288 | return shhf; 289 | } 290 | 291 | } 292 | -------------------------------------------------------------------------------- /src/main/java/com/entity/XueshengEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 学生 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-04-03 16:15:19 30 | */ 31 | @TableName("xuesheng") 32 | public class XueshengEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public XueshengEntity() { 37 | 38 | } 39 | 40 | public XueshengEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 学号 56 | */ 57 | 58 | private String xuehao; 59 | 60 | /** 61 | * 姓名 62 | */ 63 | 64 | private String xingming; 65 | 66 | /** 67 | * 密码 68 | */ 69 | 70 | private String mima; 71 | 72 | /** 73 | * 性别 74 | */ 75 | 76 | private String xingbie; 77 | 78 | /** 79 | * 身份证 80 | */ 81 | 82 | private String shenfenzheng; 83 | 84 | /** 85 | * 手机 86 | */ 87 | 88 | private String shouji; 89 | 90 | /** 91 | * 专业 92 | */ 93 | 94 | private String zhuanye; 95 | 96 | /** 97 | * 班级 98 | */ 99 | 100 | private String banji; 101 | 102 | /** 103 | * 头像 104 | */ 105 | 106 | private String touxiang; 107 | 108 | /** 109 | * 院系 110 | */ 111 | 112 | private String yuanxi; 113 | 114 | 115 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 116 | @DateTimeFormat 117 | private Date addtime; 118 | 119 | public Date getAddtime() { 120 | return addtime; 121 | } 122 | public void setAddtime(Date addtime) { 123 | this.addtime = addtime; 124 | } 125 | 126 | public Long getId() { 127 | return id; 128 | } 129 | 130 | public void setId(Long id) { 131 | this.id = id; 132 | } 133 | /** 134 | * 设置:学号 135 | */ 136 | public void setXuehao(String xuehao) { 137 | this.xuehao = xuehao; 138 | } 139 | /** 140 | * 获取:学号 141 | */ 142 | public String getXuehao() { 143 | return xuehao; 144 | } 145 | /** 146 | * 设置:姓名 147 | */ 148 | public void setXingming(String xingming) { 149 | this.xingming = xingming; 150 | } 151 | /** 152 | * 获取:姓名 153 | */ 154 | public String getXingming() { 155 | return xingming; 156 | } 157 | /** 158 | * 设置:密码 159 | */ 160 | public void setMima(String mima) { 161 | this.mima = mima; 162 | } 163 | /** 164 | * 获取:密码 165 | */ 166 | public String getMima() { 167 | return mima; 168 | } 169 | /** 170 | * 设置:性别 171 | */ 172 | public void setXingbie(String xingbie) { 173 | this.xingbie = xingbie; 174 | } 175 | /** 176 | * 获取:性别 177 | */ 178 | public String getXingbie() { 179 | return xingbie; 180 | } 181 | /** 182 | * 设置:身份证 183 | */ 184 | public void setShenfenzheng(String shenfenzheng) { 185 | this.shenfenzheng = shenfenzheng; 186 | } 187 | /** 188 | * 获取:身份证 189 | */ 190 | public String getShenfenzheng() { 191 | return shenfenzheng; 192 | } 193 | /** 194 | * 设置:手机 195 | */ 196 | public void setShouji(String shouji) { 197 | this.shouji = shouji; 198 | } 199 | /** 200 | * 获取:手机 201 | */ 202 | public String getShouji() { 203 | return shouji; 204 | } 205 | /** 206 | * 设置:专业 207 | */ 208 | public void setZhuanye(String zhuanye) { 209 | this.zhuanye = zhuanye; 210 | } 211 | /** 212 | * 获取:专业 213 | */ 214 | public String getZhuanye() { 215 | return zhuanye; 216 | } 217 | /** 218 | * 设置:班级 219 | */ 220 | public void setBanji(String banji) { 221 | this.banji = banji; 222 | } 223 | /** 224 | * 获取:班级 225 | */ 226 | public String getBanji() { 227 | return banji; 228 | } 229 | /** 230 | * 设置:头像 231 | */ 232 | public void setTouxiang(String touxiang) { 233 | this.touxiang = touxiang; 234 | } 235 | /** 236 | * 获取:头像 237 | */ 238 | public String getTouxiang() { 239 | return touxiang; 240 | } 241 | /** 242 | * 设置:院系 243 | */ 244 | public void setYuanxi(String yuanxi) { 245 | this.yuanxi = yuanxi; 246 | } 247 | /** 248 | * 获取:院系 249 | */ 250 | public String getYuanxi() { 251 | return yuanxi; 252 | } 253 | 254 | } 255 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/BiyezigeModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.BiyezigeEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 毕业资格 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public class BiyezigeModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 姓名 28 | */ 29 | 30 | private String xingming; 31 | 32 | /** 33 | * 院系 34 | */ 35 | 36 | private String yuanxi; 37 | 38 | /** 39 | * 专业 40 | */ 41 | 42 | private String zhuanye; 43 | 44 | /** 45 | * 班级 46 | */ 47 | 48 | private String banji; 49 | 50 | /** 51 | * 身份证 52 | */ 53 | 54 | private String shenfenzheng; 55 | 56 | /** 57 | * 毕业情况 58 | */ 59 | 60 | private String biyeqingkuang; 61 | 62 | /** 63 | * 年份 64 | */ 65 | 66 | private String nianfen; 67 | 68 | /** 69 | * 登记时间 70 | */ 71 | 72 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 73 | @DateTimeFormat 74 | private Date dengjishijian; 75 | 76 | /** 77 | * 教师工号 78 | */ 79 | 80 | private String jiaoshigonghao; 81 | 82 | /** 83 | * 教师姓名 84 | */ 85 | 86 | private String jiaoshixingming; 87 | 88 | /** 89 | * 是否审核 90 | */ 91 | 92 | private String sfsh; 93 | 94 | /** 95 | * 审核回复 96 | */ 97 | 98 | private String shhf; 99 | 100 | 101 | /** 102 | * 设置:姓名 103 | */ 104 | 105 | public void setXingming(String xingming) { 106 | this.xingming = xingming; 107 | } 108 | 109 | /** 110 | * 获取:姓名 111 | */ 112 | public String getXingming() { 113 | return xingming; 114 | } 115 | 116 | 117 | /** 118 | * 设置:院系 119 | */ 120 | 121 | public void setYuanxi(String yuanxi) { 122 | this.yuanxi = yuanxi; 123 | } 124 | 125 | /** 126 | * 获取:院系 127 | */ 128 | public String getYuanxi() { 129 | return yuanxi; 130 | } 131 | 132 | 133 | /** 134 | * 设置:专业 135 | */ 136 | 137 | public void setZhuanye(String zhuanye) { 138 | this.zhuanye = zhuanye; 139 | } 140 | 141 | /** 142 | * 获取:专业 143 | */ 144 | public String getZhuanye() { 145 | return zhuanye; 146 | } 147 | 148 | 149 | /** 150 | * 设置:班级 151 | */ 152 | 153 | public void setBanji(String banji) { 154 | this.banji = banji; 155 | } 156 | 157 | /** 158 | * 获取:班级 159 | */ 160 | public String getBanji() { 161 | return banji; 162 | } 163 | 164 | 165 | /** 166 | * 设置:身份证 167 | */ 168 | 169 | public void setShenfenzheng(String shenfenzheng) { 170 | this.shenfenzheng = shenfenzheng; 171 | } 172 | 173 | /** 174 | * 获取:身份证 175 | */ 176 | public String getShenfenzheng() { 177 | return shenfenzheng; 178 | } 179 | 180 | 181 | /** 182 | * 设置:毕业情况 183 | */ 184 | 185 | public void setBiyeqingkuang(String biyeqingkuang) { 186 | this.biyeqingkuang = biyeqingkuang; 187 | } 188 | 189 | /** 190 | * 获取:毕业情况 191 | */ 192 | public String getBiyeqingkuang() { 193 | return biyeqingkuang; 194 | } 195 | 196 | 197 | /** 198 | * 设置:年份 199 | */ 200 | 201 | public void setNianfen(String nianfen) { 202 | this.nianfen = nianfen; 203 | } 204 | 205 | /** 206 | * 获取:年份 207 | */ 208 | public String getNianfen() { 209 | return nianfen; 210 | } 211 | 212 | 213 | /** 214 | * 设置:登记时间 215 | */ 216 | 217 | public void setDengjishijian(Date dengjishijian) { 218 | this.dengjishijian = dengjishijian; 219 | } 220 | 221 | /** 222 | * 获取:登记时间 223 | */ 224 | public Date getDengjishijian() { 225 | return dengjishijian; 226 | } 227 | 228 | 229 | /** 230 | * 设置:教师工号 231 | */ 232 | 233 | public void setJiaoshigonghao(String jiaoshigonghao) { 234 | this.jiaoshigonghao = jiaoshigonghao; 235 | } 236 | 237 | /** 238 | * 获取:教师工号 239 | */ 240 | public String getJiaoshigonghao() { 241 | return jiaoshigonghao; 242 | } 243 | 244 | 245 | /** 246 | * 设置:教师姓名 247 | */ 248 | 249 | public void setJiaoshixingming(String jiaoshixingming) { 250 | this.jiaoshixingming = jiaoshixingming; 251 | } 252 | 253 | /** 254 | * 获取:教师姓名 255 | */ 256 | public String getJiaoshixingming() { 257 | return jiaoshixingming; 258 | } 259 | 260 | 261 | /** 262 | * 设置:是否审核 263 | */ 264 | 265 | public void setSfsh(String sfsh) { 266 | this.sfsh = sfsh; 267 | } 268 | 269 | /** 270 | * 获取:是否审核 271 | */ 272 | public String getSfsh() { 273 | return sfsh; 274 | } 275 | 276 | 277 | /** 278 | * 设置:审核回复 279 | */ 280 | 281 | public void setShhf(String shhf) { 282 | this.shhf = shhf; 283 | } 284 | 285 | /** 286 | * 获取:审核回复 287 | */ 288 | public String getShhf() { 289 | return shhf; 290 | } 291 | 292 | } 293 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/XueshengchengjiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.XueshengchengjiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 学生成绩 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public class XueshengchengjiVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 学期 27 | */ 28 | 29 | private String xueqi; 30 | 31 | /** 32 | * 学号 33 | */ 34 | 35 | private String xuehao; 36 | 37 | /** 38 | * 科目 39 | */ 40 | 41 | private String kemu; 42 | 43 | /** 44 | * 姓名 45 | */ 46 | 47 | private String xingming; 48 | 49 | /** 50 | * 院系 51 | */ 52 | 53 | private String yuanxi; 54 | 55 | /** 56 | * 专业 57 | */ 58 | 59 | private String zhuanye; 60 | 61 | /** 62 | * 教师工号 63 | */ 64 | 65 | private String jiaoshigonghao; 66 | 67 | /** 68 | * 教师姓名 69 | */ 70 | 71 | private String jiaoshixingming; 72 | 73 | /** 74 | * 是否合格 75 | */ 76 | 77 | private String shifouhege; 78 | 79 | /** 80 | * 学分 81 | */ 82 | 83 | private Integer xuefen; 84 | 85 | /** 86 | * 成绩 87 | */ 88 | 89 | private Integer chengji; 90 | 91 | /** 92 | * 评语 93 | */ 94 | 95 | private String pingyu; 96 | 97 | /** 98 | * 登记时间 99 | */ 100 | 101 | private String dengjishijian; 102 | 103 | 104 | /** 105 | * 设置:学期 106 | */ 107 | 108 | public void setXueqi(String xueqi) { 109 | this.xueqi = xueqi; 110 | } 111 | 112 | /** 113 | * 获取:学期 114 | */ 115 | public String getXueqi() { 116 | return xueqi; 117 | } 118 | 119 | 120 | /** 121 | * 设置:学号 122 | */ 123 | 124 | public void setXuehao(String xuehao) { 125 | this.xuehao = xuehao; 126 | } 127 | 128 | /** 129 | * 获取:学号 130 | */ 131 | public String getXuehao() { 132 | return xuehao; 133 | } 134 | 135 | 136 | /** 137 | * 设置:科目 138 | */ 139 | 140 | public void setKemu(String kemu) { 141 | this.kemu = kemu; 142 | } 143 | 144 | /** 145 | * 获取:科目 146 | */ 147 | public String getKemu() { 148 | return kemu; 149 | } 150 | 151 | 152 | /** 153 | * 设置:姓名 154 | */ 155 | 156 | public void setXingming(String xingming) { 157 | this.xingming = xingming; 158 | } 159 | 160 | /** 161 | * 获取:姓名 162 | */ 163 | public String getXingming() { 164 | return xingming; 165 | } 166 | 167 | 168 | /** 169 | * 设置:院系 170 | */ 171 | 172 | public void setYuanxi(String yuanxi) { 173 | this.yuanxi = yuanxi; 174 | } 175 | 176 | /** 177 | * 获取:院系 178 | */ 179 | public String getYuanxi() { 180 | return yuanxi; 181 | } 182 | 183 | 184 | /** 185 | * 设置:专业 186 | */ 187 | 188 | public void setZhuanye(String zhuanye) { 189 | this.zhuanye = zhuanye; 190 | } 191 | 192 | /** 193 | * 获取:专业 194 | */ 195 | public String getZhuanye() { 196 | return zhuanye; 197 | } 198 | 199 | 200 | /** 201 | * 设置:教师工号 202 | */ 203 | 204 | public void setJiaoshigonghao(String jiaoshigonghao) { 205 | this.jiaoshigonghao = jiaoshigonghao; 206 | } 207 | 208 | /** 209 | * 获取:教师工号 210 | */ 211 | public String getJiaoshigonghao() { 212 | return jiaoshigonghao; 213 | } 214 | 215 | 216 | /** 217 | * 设置:教师姓名 218 | */ 219 | 220 | public void setJiaoshixingming(String jiaoshixingming) { 221 | this.jiaoshixingming = jiaoshixingming; 222 | } 223 | 224 | /** 225 | * 获取:教师姓名 226 | */ 227 | public String getJiaoshixingming() { 228 | return jiaoshixingming; 229 | } 230 | 231 | 232 | /** 233 | * 设置:是否合格 234 | */ 235 | 236 | public void setShifouhege(String shifouhege) { 237 | this.shifouhege = shifouhege; 238 | } 239 | 240 | /** 241 | * 获取:是否合格 242 | */ 243 | public String getShifouhege() { 244 | return shifouhege; 245 | } 246 | 247 | 248 | /** 249 | * 设置:学分 250 | */ 251 | 252 | public void setXuefen(Integer xuefen) { 253 | this.xuefen = xuefen; 254 | } 255 | 256 | /** 257 | * 获取:学分 258 | */ 259 | public Integer getXuefen() { 260 | return xuefen; 261 | } 262 | 263 | 264 | /** 265 | * 设置:成绩 266 | */ 267 | 268 | public void setChengji(Integer chengji) { 269 | this.chengji = chengji; 270 | } 271 | 272 | /** 273 | * 获取:成绩 274 | */ 275 | public Integer getChengji() { 276 | return chengji; 277 | } 278 | 279 | 280 | /** 281 | * 设置:评语 282 | */ 283 | 284 | public void setPingyu(String pingyu) { 285 | this.pingyu = pingyu; 286 | } 287 | 288 | /** 289 | * 获取:评语 290 | */ 291 | public String getPingyu() { 292 | return pingyu; 293 | } 294 | 295 | 296 | /** 297 | * 设置:登记时间 298 | */ 299 | 300 | public void setDengjishijian(String dengjishijian) { 301 | this.dengjishijian = dengjishijian; 302 | } 303 | 304 | /** 305 | * 获取:登记时间 306 | */ 307 | public String getDengjishijian() { 308 | return dengjishijian; 309 | } 310 | 311 | } 312 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/XueshengchengjiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.XueshengchengjiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 学生成绩 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public class XueshengchengjiModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 学期 28 | */ 29 | 30 | private String xueqi; 31 | 32 | /** 33 | * 学号 34 | */ 35 | 36 | private String xuehao; 37 | 38 | /** 39 | * 科目 40 | */ 41 | 42 | private String kemu; 43 | 44 | /** 45 | * 姓名 46 | */ 47 | 48 | private String xingming; 49 | 50 | /** 51 | * 院系 52 | */ 53 | 54 | private String yuanxi; 55 | 56 | /** 57 | * 专业 58 | */ 59 | 60 | private String zhuanye; 61 | 62 | /** 63 | * 教师工号 64 | */ 65 | 66 | private String jiaoshigonghao; 67 | 68 | /** 69 | * 教师姓名 70 | */ 71 | 72 | private String jiaoshixingming; 73 | 74 | /** 75 | * 是否合格 76 | */ 77 | 78 | private String shifouhege; 79 | 80 | /** 81 | * 学分 82 | */ 83 | 84 | private Integer xuefen; 85 | 86 | /** 87 | * 成绩 88 | */ 89 | 90 | private Integer chengji; 91 | 92 | /** 93 | * 评语 94 | */ 95 | 96 | private String pingyu; 97 | 98 | /** 99 | * 登记时间 100 | */ 101 | 102 | private String dengjishijian; 103 | 104 | 105 | /** 106 | * 设置:学期 107 | */ 108 | 109 | public void setXueqi(String xueqi) { 110 | this.xueqi = xueqi; 111 | } 112 | 113 | /** 114 | * 获取:学期 115 | */ 116 | public String getXueqi() { 117 | return xueqi; 118 | } 119 | 120 | 121 | /** 122 | * 设置:学号 123 | */ 124 | 125 | public void setXuehao(String xuehao) { 126 | this.xuehao = xuehao; 127 | } 128 | 129 | /** 130 | * 获取:学号 131 | */ 132 | public String getXuehao() { 133 | return xuehao; 134 | } 135 | 136 | 137 | /** 138 | * 设置:科目 139 | */ 140 | 141 | public void setKemu(String kemu) { 142 | this.kemu = kemu; 143 | } 144 | 145 | /** 146 | * 获取:科目 147 | */ 148 | public String getKemu() { 149 | return kemu; 150 | } 151 | 152 | 153 | /** 154 | * 设置:姓名 155 | */ 156 | 157 | public void setXingming(String xingming) { 158 | this.xingming = xingming; 159 | } 160 | 161 | /** 162 | * 获取:姓名 163 | */ 164 | public String getXingming() { 165 | return xingming; 166 | } 167 | 168 | 169 | /** 170 | * 设置:院系 171 | */ 172 | 173 | public void setYuanxi(String yuanxi) { 174 | this.yuanxi = yuanxi; 175 | } 176 | 177 | /** 178 | * 获取:院系 179 | */ 180 | public String getYuanxi() { 181 | return yuanxi; 182 | } 183 | 184 | 185 | /** 186 | * 设置:专业 187 | */ 188 | 189 | public void setZhuanye(String zhuanye) { 190 | this.zhuanye = zhuanye; 191 | } 192 | 193 | /** 194 | * 获取:专业 195 | */ 196 | public String getZhuanye() { 197 | return zhuanye; 198 | } 199 | 200 | 201 | /** 202 | * 设置:教师工号 203 | */ 204 | 205 | public void setJiaoshigonghao(String jiaoshigonghao) { 206 | this.jiaoshigonghao = jiaoshigonghao; 207 | } 208 | 209 | /** 210 | * 获取:教师工号 211 | */ 212 | public String getJiaoshigonghao() { 213 | return jiaoshigonghao; 214 | } 215 | 216 | 217 | /** 218 | * 设置:教师姓名 219 | */ 220 | 221 | public void setJiaoshixingming(String jiaoshixingming) { 222 | this.jiaoshixingming = jiaoshixingming; 223 | } 224 | 225 | /** 226 | * 获取:教师姓名 227 | */ 228 | public String getJiaoshixingming() { 229 | return jiaoshixingming; 230 | } 231 | 232 | 233 | /** 234 | * 设置:是否合格 235 | */ 236 | 237 | public void setShifouhege(String shifouhege) { 238 | this.shifouhege = shifouhege; 239 | } 240 | 241 | /** 242 | * 获取:是否合格 243 | */ 244 | public String getShifouhege() { 245 | return shifouhege; 246 | } 247 | 248 | 249 | /** 250 | * 设置:学分 251 | */ 252 | 253 | public void setXuefen(Integer xuefen) { 254 | this.xuefen = xuefen; 255 | } 256 | 257 | /** 258 | * 获取:学分 259 | */ 260 | public Integer getXuefen() { 261 | return xuefen; 262 | } 263 | 264 | 265 | /** 266 | * 设置:成绩 267 | */ 268 | 269 | public void setChengji(Integer chengji) { 270 | this.chengji = chengji; 271 | } 272 | 273 | /** 274 | * 获取:成绩 275 | */ 276 | public Integer getChengji() { 277 | return chengji; 278 | } 279 | 280 | 281 | /** 282 | * 设置:评语 283 | */ 284 | 285 | public void setPingyu(String pingyu) { 286 | this.pingyu = pingyu; 287 | } 288 | 289 | /** 290 | * 获取:评语 291 | */ 292 | public String getPingyu() { 293 | return pingyu; 294 | } 295 | 296 | 297 | /** 298 | * 设置:登记时间 299 | */ 300 | 301 | public void setDengjishijian(String dengjishijian) { 302 | this.dengjishijian = dengjishijian; 303 | } 304 | 305 | /** 306 | * 获取:登记时间 307 | */ 308 | public String getDengjishijian() { 309 | return dengjishijian; 310 | } 311 | 312 | } 313 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.2.2.RELEASE 9 | 10 | 11 | com.jlwl 12 | 13 | springbootzpl96 14 | 0.0.1-SNAPSHOT 15 | springboot-schema 16 | springboot学习框架 17 | 18 | 19 | 1.8 20 | 1.2.8 21 | 3.1.1 22 | 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | org.mybatis.spring.boot 31 | mybatis-spring-boot-starter 32 | 2.1.1 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-jdbc 37 | 38 | 39 | 40 | mysql 41 | mysql-connector-java 42 | 43 | 44 | org.apache.shiro 45 | shiro-spring 46 | 1.3.2 47 | 48 | 49 | 50 | com.baomidou 51 | mybatis-plus 52 | 2.3 53 | 54 | 55 | com.baomidou 56 | mybatisplus-spring-boot-starter 57 | 1.0.5 58 | 59 | 60 | com.google.protobuf 61 | protobuf-java 62 | 3.10.0 63 | 64 | 65 | 66 | org.apache.commons 67 | commons-lang3 68 | 3.0 69 | 70 | 71 | 72 | javax.validation 73 | validation-api 74 | 2.0.1.Final 75 | 76 | 77 | 78 | commons-io 79 | commons-io 80 | 2.5 81 | 82 | 83 | 84 | 85 | cn.hutool 86 | hutool-all 87 | 4.0.12 88 | 89 | 90 | 91 | 92 | com.alibaba 93 | fastjson 94 | ${fastjson.version} 95 | 96 | 109 | 110 | 111 | com.baidu.aip 112 | java-sdk 113 | 4.4.1 114 | 115 | 116 | 117 | org.apache.poi 118 | poi 119 | 3.11 120 | 121 | 122 | 123 | org.apache.poi 124 | poi-ooxml 125 | 3.9 126 | 127 | 128 | 129 | 130 | org.springframework.boot 131 | spring-boot-starter-test 132 | test 133 | 134 | 135 | org.junit.vintage 136 | junit-vintage-engine 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | org.springframework.boot 146 | spring-boot-maven-plugin 147 | 148 | 149 | org.apache.maven.plugins 150 | maven-compiler-plugin 151 | 152 | 1.8 153 | 1.8 154 | 155 | 156 | 157 | org.apache.maven.plugins 158 | maven-surefire-plugin 159 | 160 | true 161 | 162 | 163 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /src/main/java/com/controller/UsersController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | import java.util.Map; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.GetMapping; 15 | import org.springframework.web.bind.annotation.PathVariable; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.RequestParam; 20 | import org.springframework.web.bind.annotation.ResponseBody; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | import com.annotation.IgnoreAuth; 24 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 25 | import com.entity.TokenEntity; 26 | import com.entity.UsersEntity; 27 | import com.service.TokenService; 28 | import com.service.UsersService; 29 | import com.utils.CommonUtil; 30 | import com.utils.MPUtil; 31 | import com.utils.PageUtils; 32 | import com.utils.R; 33 | import com.utils.ValidatorUtils; 34 | 35 | /** 36 | * 登录相关 37 | */ 38 | @RequestMapping("users") 39 | @RestController 40 | public class UsersController{ 41 | 42 | @Autowired 43 | private UsersService userService; 44 | 45 | @Autowired 46 | private TokenService tokenService; 47 | 48 | /** 49 | * 登录 50 | */ 51 | @IgnoreAuth 52 | @RequestMapping(value = "/login") 53 | public R login(String username, String password, String captcha, HttpServletRequest request) { 54 | UsersEntity user = userService.selectOne(new EntityWrapper().eq("username", username)); 55 | if(user==null || !user.getPassword().equals(password)) { 56 | return R.error("账号或密码不正确"); 57 | } 58 | String token = tokenService.generateToken(user.getId(),username, "users", user.getRole()); 59 | return R.ok().put("token", token); 60 | } 61 | 62 | /** 63 | * 注册 64 | */ 65 | @IgnoreAuth 66 | @PostMapping(value = "/register") 67 | public R register(@RequestBody UsersEntity user){ 68 | // ValidatorUtils.validateEntity(user); 69 | if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) { 70 | return R.error("用户已存在"); 71 | } 72 | userService.insert(user); 73 | return R.ok(); 74 | } 75 | 76 | /** 77 | * 退出 78 | */ 79 | @GetMapping(value = "logout") 80 | public R logout(HttpServletRequest request) { 81 | request.getSession().invalidate(); 82 | return R.ok("退出成功"); 83 | } 84 | 85 | /** 86 | * 密码重置 87 | */ 88 | @IgnoreAuth 89 | @RequestMapping(value = "/resetPass") 90 | public R resetPass(String username, HttpServletRequest request){ 91 | UsersEntity user = userService.selectOne(new EntityWrapper().eq("username", username)); 92 | if(user==null) { 93 | return R.error("账号不存在"); 94 | } 95 | user.setPassword("123456"); 96 | userService.update(user,null); 97 | return R.ok("密码已重置为:123456"); 98 | } 99 | 100 | /** 101 | * 列表 102 | */ 103 | @RequestMapping("/page") 104 | public R page(@RequestParam Map params,UsersEntity user){ 105 | EntityWrapper ew = new EntityWrapper(); 106 | PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params)); 107 | return R.ok().put("data", page); 108 | } 109 | 110 | /** 111 | * 列表 112 | */ 113 | @RequestMapping("/list") 114 | public R list( UsersEntity user){ 115 | EntityWrapper ew = new EntityWrapper(); 116 | ew.allEq(MPUtil.allEQMapPre( user, "user")); 117 | return R.ok().put("data", userService.selectListView(ew)); 118 | } 119 | 120 | /** 121 | * 信息 122 | */ 123 | @RequestMapping("/info/{id}") 124 | public R info(@PathVariable("id") String id){ 125 | UsersEntity user = userService.selectById(id); 126 | return R.ok().put("data", user); 127 | } 128 | 129 | /** 130 | * 获取用户的session用户信息 131 | */ 132 | @RequestMapping("/session") 133 | public R getCurrUser(HttpServletRequest request){ 134 | Long id = (Long)request.getSession().getAttribute("userId"); 135 | UsersEntity user = userService.selectById(id); 136 | return R.ok().put("data", user); 137 | } 138 | 139 | /** 140 | * 保存 141 | */ 142 | @PostMapping("/save") 143 | public R save(@RequestBody UsersEntity user){ 144 | // ValidatorUtils.validateEntity(user); 145 | if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) { 146 | return R.error("用户已存在"); 147 | } 148 | userService.insert(user); 149 | return R.ok(); 150 | } 151 | 152 | /** 153 | * 修改 154 | */ 155 | @RequestMapping("/update") 156 | public R update(@RequestBody UsersEntity user){ 157 | // ValidatorUtils.validateEntity(user); 158 | UsersEntity u = userService.selectOne(new EntityWrapper().eq("username", user.getUsername())); 159 | if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) { 160 | return R.error("用户名已存在。"); 161 | } 162 | userService.updateById(user);//全部更新 163 | return R.ok(); 164 | } 165 | 166 | /** 167 | * 删除 168 | */ 169 | @RequestMapping("/delete") 170 | public R delete(@RequestBody Long[] ids){ 171 | userService.deleteBatchIds(Arrays.asList(ids)); 172 | return R.ok(); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MPUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashMap; 5 | import java.util.Iterator; 6 | import java.util.Map; 7 | 8 | import org.apache.commons.lang3.StringUtils; 9 | 10 | import cn.hutool.core.bean.BeanUtil; 11 | 12 | import com.baomidou.mybatisplus.mapper.Wrapper; 13 | 14 | /** 15 | * Mybatis-Plus工具类 16 | */ 17 | public class MPUtil { 18 | public static final char UNDERLINE = '_'; 19 | 20 | 21 | //mybatis plus allEQ 表达式转换 22 | public static Map allEQMapPre(Object bean,String pre) { 23 | Map map =BeanUtil.beanToMap(bean); 24 | return camelToUnderlineMap(map,pre); 25 | } 26 | 27 | //mybatis plus allEQ 表达式转换 28 | public static Map allEQMap(Object bean) { 29 | Map map =BeanUtil.beanToMap(bean); 30 | return camelToUnderlineMap(map,""); 31 | } 32 | 33 | public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) { 34 | Map map =BeanUtil.beanToMap(bean); 35 | Map result = camelToUnderlineMap(map,pre); 36 | 37 | return genLike(wrapper,result); 38 | } 39 | 40 | public static Wrapper allLike(Wrapper wrapper,Object bean) { 41 | Map result = BeanUtil.beanToMap(bean, true, true); 42 | return genLike(wrapper,result); 43 | } 44 | 45 | 46 | public static Wrapper genLike( Wrapper wrapper,Map param) { 47 | Iterator> it = param.entrySet().iterator(); 48 | int i=0; 49 | while (it.hasNext()) { 50 | if(i>0) wrapper.and(); 51 | Map.Entry entry = it.next(); 52 | String key = entry.getKey(); 53 | String value = (String) entry.getValue(); 54 | wrapper.like(key, value); 55 | i++; 56 | } 57 | return wrapper; 58 | } 59 | 60 | public static Wrapper likeOrEq(Wrapper wrapper,Object bean) { 61 | Map result = BeanUtil.beanToMap(bean, true, true); 62 | return genLikeOrEq(wrapper,result); 63 | } 64 | 65 | public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) { 66 | Iterator> it = param.entrySet().iterator(); 67 | int i=0; 68 | while (it.hasNext()) { 69 | if(i>0) wrapper.and(); 70 | Map.Entry entry = it.next(); 71 | String key = entry.getKey(); 72 | if(entry.getValue().toString().contains("%")) { 73 | wrapper.like(key, entry.getValue().toString().replace("%", "")); 74 | } else { 75 | wrapper.eq(key, entry.getValue()); 76 | } 77 | i++; 78 | } 79 | return wrapper; 80 | } 81 | 82 | public static Wrapper allEq(Wrapper wrapper,Object bean) { 83 | Map result = BeanUtil.beanToMap(bean, true, true); 84 | return genEq(wrapper,result); 85 | } 86 | 87 | 88 | public static Wrapper genEq( Wrapper wrapper,Map param) { 89 | Iterator> it = param.entrySet().iterator(); 90 | int i=0; 91 | while (it.hasNext()) { 92 | if(i>0) wrapper.and(); 93 | Map.Entry entry = it.next(); 94 | String key = entry.getKey(); 95 | wrapper.eq(key, entry.getValue()); 96 | i++; 97 | } 98 | return wrapper; 99 | } 100 | 101 | 102 | public static Wrapper between(Wrapper wrapper,Map params) { 103 | for(String key : params.keySet()) { 104 | String columnName = ""; 105 | if(key.endsWith("_start")) { 106 | columnName = key.substring(0, key.indexOf("_start")); 107 | if(StringUtils.isNotBlank(params.get(key).toString())) { 108 | wrapper.ge(columnName, params.get(key)); 109 | } 110 | } 111 | if(key.endsWith("_end")) { 112 | columnName = key.substring(0, key.indexOf("_end")); 113 | if(StringUtils.isNotBlank(params.get(key).toString())) { 114 | wrapper.le(columnName, params.get(key)); 115 | } 116 | } 117 | } 118 | return wrapper; 119 | } 120 | 121 | public static Wrapper sort(Wrapper wrapper,Map params) { 122 | String order = ""; 123 | if(params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) { 124 | order = params.get("order").toString(); 125 | } 126 | if(params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) { 127 | if(order.equalsIgnoreCase("desc")) { 128 | wrapper.orderDesc(Arrays.asList(params.get("sort"))); 129 | } else { 130 | wrapper.orderAsc(Arrays.asList(params.get("sort"))); 131 | } 132 | } 133 | return wrapper; 134 | } 135 | 136 | 137 | /** 138 | * 驼峰格式字符串转换为下划线格式字符串 139 | * 140 | * @param param 141 | * @return 142 | */ 143 | public static String camelToUnderline(String param) { 144 | if (param == null || "".equals(param.trim())) { 145 | return ""; 146 | } 147 | int len = param.length(); 148 | StringBuilder sb = new StringBuilder(len); 149 | for (int i = 0; i < len; i++) { 150 | char c = param.charAt(i); 151 | if (Character.isUpperCase(c)) { 152 | sb.append(UNDERLINE); 153 | sb.append(Character.toLowerCase(c)); 154 | } else { 155 | sb.append(c); 156 | } 157 | } 158 | return sb.toString(); 159 | } 160 | 161 | public static void main(String[] ages) { 162 | System.out.println(camelToUnderline("ABCddfANM")); 163 | } 164 | 165 | public static Map camelToUnderlineMap(Map param, String pre) { 166 | 167 | Map newMap = new HashMap(); 168 | Iterator> it = param.entrySet().iterator(); 169 | while (it.hasNext()) { 170 | Map.Entry entry = it.next(); 171 | String key = entry.getKey(); 172 | String newKey = camelToUnderline(key); 173 | if (pre.endsWith(".")) { 174 | newMap.put(pre + newKey, entry.getValue()); 175 | } else if (StringUtils.isEmpty(pre)) { 176 | newMap.put(newKey, entry.getValue()); 177 | } else { 178 | 179 | newMap.put(pre + "." + newKey, entry.getValue()); 180 | } 181 | } 182 | return newMap; 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/PeiyangfanganVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.PeiyangfanganEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 培养方案 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-04-03 16:15:19 20 | */ 21 | public class PeiyangfanganVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 院系 27 | */ 28 | 29 | private String yuanxi; 30 | 31 | /** 32 | * 专业 33 | */ 34 | 35 | private String zhuanye; 36 | 37 | /** 38 | * 班级 39 | */ 40 | 41 | private String banji; 42 | 43 | /** 44 | * 培养类型 45 | */ 46 | 47 | private String peiyangleixing; 48 | 49 | /** 50 | * 学号 51 | */ 52 | 53 | private String xuehao; 54 | 55 | /** 56 | * 姓名 57 | */ 58 | 59 | private String xingming; 60 | 61 | /** 62 | * 课程名称 63 | */ 64 | 65 | private String kechengmingcheng; 66 | 67 | /** 68 | * 课程类别 69 | */ 70 | 71 | private String kechengleibie; 72 | 73 | /** 74 | * 学分 75 | */ 76 | 77 | private String xuefen; 78 | 79 | /** 80 | * 总学时 81 | */ 82 | 83 | private String zongxueshi; 84 | 85 | /** 86 | * 考核方式 87 | */ 88 | 89 | private String kaohefangshi; 90 | 91 | /** 92 | * 学期 93 | */ 94 | 95 | private String xueqi; 96 | 97 | /** 98 | * 年份 99 | */ 100 | 101 | private String nianfen; 102 | 103 | /** 104 | * 教师工号 105 | */ 106 | 107 | private String jiaoshigonghao; 108 | 109 | /** 110 | * 教师姓名 111 | */ 112 | 113 | private String jiaoshixingming; 114 | 115 | 116 | /** 117 | * 设置:院系 118 | */ 119 | 120 | public void setYuanxi(String yuanxi) { 121 | this.yuanxi = yuanxi; 122 | } 123 | 124 | /** 125 | * 获取:院系 126 | */ 127 | public String getYuanxi() { 128 | return yuanxi; 129 | } 130 | 131 | 132 | /** 133 | * 设置:专业 134 | */ 135 | 136 | public void setZhuanye(String zhuanye) { 137 | this.zhuanye = zhuanye; 138 | } 139 | 140 | /** 141 | * 获取:专业 142 | */ 143 | public String getZhuanye() { 144 | return zhuanye; 145 | } 146 | 147 | 148 | /** 149 | * 设置:班级 150 | */ 151 | 152 | public void setBanji(String banji) { 153 | this.banji = banji; 154 | } 155 | 156 | /** 157 | * 获取:班级 158 | */ 159 | public String getBanji() { 160 | return banji; 161 | } 162 | 163 | 164 | /** 165 | * 设置:培养类型 166 | */ 167 | 168 | public void setPeiyangleixing(String peiyangleixing) { 169 | this.peiyangleixing = peiyangleixing; 170 | } 171 | 172 | /** 173 | * 获取:培养类型 174 | */ 175 | public String getPeiyangleixing() { 176 | return peiyangleixing; 177 | } 178 | 179 | 180 | /** 181 | * 设置:学号 182 | */ 183 | 184 | public void setXuehao(String xuehao) { 185 | this.xuehao = xuehao; 186 | } 187 | 188 | /** 189 | * 获取:学号 190 | */ 191 | public String getXuehao() { 192 | return xuehao; 193 | } 194 | 195 | 196 | /** 197 | * 设置:姓名 198 | */ 199 | 200 | public void setXingming(String xingming) { 201 | this.xingming = xingming; 202 | } 203 | 204 | /** 205 | * 获取:姓名 206 | */ 207 | public String getXingming() { 208 | return xingming; 209 | } 210 | 211 | 212 | /** 213 | * 设置:课程名称 214 | */ 215 | 216 | public void setKechengmingcheng(String kechengmingcheng) { 217 | this.kechengmingcheng = kechengmingcheng; 218 | } 219 | 220 | /** 221 | * 获取:课程名称 222 | */ 223 | public String getKechengmingcheng() { 224 | return kechengmingcheng; 225 | } 226 | 227 | 228 | /** 229 | * 设置:课程类别 230 | */ 231 | 232 | public void setKechengleibie(String kechengleibie) { 233 | this.kechengleibie = kechengleibie; 234 | } 235 | 236 | /** 237 | * 获取:课程类别 238 | */ 239 | public String getKechengleibie() { 240 | return kechengleibie; 241 | } 242 | 243 | 244 | /** 245 | * 设置:学分 246 | */ 247 | 248 | public void setXuefen(String xuefen) { 249 | this.xuefen = xuefen; 250 | } 251 | 252 | /** 253 | * 获取:学分 254 | */ 255 | public String getXuefen() { 256 | return xuefen; 257 | } 258 | 259 | 260 | /** 261 | * 设置:总学时 262 | */ 263 | 264 | public void setZongxueshi(String zongxueshi) { 265 | this.zongxueshi = zongxueshi; 266 | } 267 | 268 | /** 269 | * 获取:总学时 270 | */ 271 | public String getZongxueshi() { 272 | return zongxueshi; 273 | } 274 | 275 | 276 | /** 277 | * 设置:考核方式 278 | */ 279 | 280 | public void setKaohefangshi(String kaohefangshi) { 281 | this.kaohefangshi = kaohefangshi; 282 | } 283 | 284 | /** 285 | * 获取:考核方式 286 | */ 287 | public String getKaohefangshi() { 288 | return kaohefangshi; 289 | } 290 | 291 | 292 | /** 293 | * 设置:学期 294 | */ 295 | 296 | public void setXueqi(String xueqi) { 297 | this.xueqi = xueqi; 298 | } 299 | 300 | /** 301 | * 获取:学期 302 | */ 303 | public String getXueqi() { 304 | return xueqi; 305 | } 306 | 307 | 308 | /** 309 | * 设置:年份 310 | */ 311 | 312 | public void setNianfen(String nianfen) { 313 | this.nianfen = nianfen; 314 | } 315 | 316 | /** 317 | * 获取:年份 318 | */ 319 | public String getNianfen() { 320 | return nianfen; 321 | } 322 | 323 | 324 | /** 325 | * 设置:教师工号 326 | */ 327 | 328 | public void setJiaoshigonghao(String jiaoshigonghao) { 329 | this.jiaoshigonghao = jiaoshigonghao; 330 | } 331 | 332 | /** 333 | * 获取:教师工号 334 | */ 335 | public String getJiaoshigonghao() { 336 | return jiaoshigonghao; 337 | } 338 | 339 | 340 | /** 341 | * 设置:教师姓名 342 | */ 343 | 344 | public void setJiaoshixingming(String jiaoshixingming) { 345 | this.jiaoshixingming = jiaoshixingming; 346 | } 347 | 348 | /** 349 | * 获取:教师姓名 350 | */ 351 | public String getJiaoshixingming() { 352 | return jiaoshixingming; 353 | } 354 | 355 | } 356 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/PeiyangfanganModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.PeiyangfanganEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 培养方案 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-04-03 16:15:19 21 | */ 22 | public class PeiyangfanganModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 院系 28 | */ 29 | 30 | private String yuanxi; 31 | 32 | /** 33 | * 专业 34 | */ 35 | 36 | private String zhuanye; 37 | 38 | /** 39 | * 班级 40 | */ 41 | 42 | private String banji; 43 | 44 | /** 45 | * 培养类型 46 | */ 47 | 48 | private String peiyangleixing; 49 | 50 | /** 51 | * 学号 52 | */ 53 | 54 | private String xuehao; 55 | 56 | /** 57 | * 姓名 58 | */ 59 | 60 | private String xingming; 61 | 62 | /** 63 | * 课程名称 64 | */ 65 | 66 | private String kechengmingcheng; 67 | 68 | /** 69 | * 课程类别 70 | */ 71 | 72 | private String kechengleibie; 73 | 74 | /** 75 | * 学分 76 | */ 77 | 78 | private String xuefen; 79 | 80 | /** 81 | * 总学时 82 | */ 83 | 84 | private String zongxueshi; 85 | 86 | /** 87 | * 考核方式 88 | */ 89 | 90 | private String kaohefangshi; 91 | 92 | /** 93 | * 学期 94 | */ 95 | 96 | private String xueqi; 97 | 98 | /** 99 | * 年份 100 | */ 101 | 102 | private String nianfen; 103 | 104 | /** 105 | * 教师工号 106 | */ 107 | 108 | private String jiaoshigonghao; 109 | 110 | /** 111 | * 教师姓名 112 | */ 113 | 114 | private String jiaoshixingming; 115 | 116 | 117 | /** 118 | * 设置:院系 119 | */ 120 | 121 | public void setYuanxi(String yuanxi) { 122 | this.yuanxi = yuanxi; 123 | } 124 | 125 | /** 126 | * 获取:院系 127 | */ 128 | public String getYuanxi() { 129 | return yuanxi; 130 | } 131 | 132 | 133 | /** 134 | * 设置:专业 135 | */ 136 | 137 | public void setZhuanye(String zhuanye) { 138 | this.zhuanye = zhuanye; 139 | } 140 | 141 | /** 142 | * 获取:专业 143 | */ 144 | public String getZhuanye() { 145 | return zhuanye; 146 | } 147 | 148 | 149 | /** 150 | * 设置:班级 151 | */ 152 | 153 | public void setBanji(String banji) { 154 | this.banji = banji; 155 | } 156 | 157 | /** 158 | * 获取:班级 159 | */ 160 | public String getBanji() { 161 | return banji; 162 | } 163 | 164 | 165 | /** 166 | * 设置:培养类型 167 | */ 168 | 169 | public void setPeiyangleixing(String peiyangleixing) { 170 | this.peiyangleixing = peiyangleixing; 171 | } 172 | 173 | /** 174 | * 获取:培养类型 175 | */ 176 | public String getPeiyangleixing() { 177 | return peiyangleixing; 178 | } 179 | 180 | 181 | /** 182 | * 设置:学号 183 | */ 184 | 185 | public void setXuehao(String xuehao) { 186 | this.xuehao = xuehao; 187 | } 188 | 189 | /** 190 | * 获取:学号 191 | */ 192 | public String getXuehao() { 193 | return xuehao; 194 | } 195 | 196 | 197 | /** 198 | * 设置:姓名 199 | */ 200 | 201 | public void setXingming(String xingming) { 202 | this.xingming = xingming; 203 | } 204 | 205 | /** 206 | * 获取:姓名 207 | */ 208 | public String getXingming() { 209 | return xingming; 210 | } 211 | 212 | 213 | /** 214 | * 设置:课程名称 215 | */ 216 | 217 | public void setKechengmingcheng(String kechengmingcheng) { 218 | this.kechengmingcheng = kechengmingcheng; 219 | } 220 | 221 | /** 222 | * 获取:课程名称 223 | */ 224 | public String getKechengmingcheng() { 225 | return kechengmingcheng; 226 | } 227 | 228 | 229 | /** 230 | * 设置:课程类别 231 | */ 232 | 233 | public void setKechengleibie(String kechengleibie) { 234 | this.kechengleibie = kechengleibie; 235 | } 236 | 237 | /** 238 | * 获取:课程类别 239 | */ 240 | public String getKechengleibie() { 241 | return kechengleibie; 242 | } 243 | 244 | 245 | /** 246 | * 设置:学分 247 | */ 248 | 249 | public void setXuefen(String xuefen) { 250 | this.xuefen = xuefen; 251 | } 252 | 253 | /** 254 | * 获取:学分 255 | */ 256 | public String getXuefen() { 257 | return xuefen; 258 | } 259 | 260 | 261 | /** 262 | * 设置:总学时 263 | */ 264 | 265 | public void setZongxueshi(String zongxueshi) { 266 | this.zongxueshi = zongxueshi; 267 | } 268 | 269 | /** 270 | * 获取:总学时 271 | */ 272 | public String getZongxueshi() { 273 | return zongxueshi; 274 | } 275 | 276 | 277 | /** 278 | * 设置:考核方式 279 | */ 280 | 281 | public void setKaohefangshi(String kaohefangshi) { 282 | this.kaohefangshi = kaohefangshi; 283 | } 284 | 285 | /** 286 | * 获取:考核方式 287 | */ 288 | public String getKaohefangshi() { 289 | return kaohefangshi; 290 | } 291 | 292 | 293 | /** 294 | * 设置:学期 295 | */ 296 | 297 | public void setXueqi(String xueqi) { 298 | this.xueqi = xueqi; 299 | } 300 | 301 | /** 302 | * 获取:学期 303 | */ 304 | public String getXueqi() { 305 | return xueqi; 306 | } 307 | 308 | 309 | /** 310 | * 设置:年份 311 | */ 312 | 313 | public void setNianfen(String nianfen) { 314 | this.nianfen = nianfen; 315 | } 316 | 317 | /** 318 | * 获取:年份 319 | */ 320 | public String getNianfen() { 321 | return nianfen; 322 | } 323 | 324 | 325 | /** 326 | * 设置:教师工号 327 | */ 328 | 329 | public void setJiaoshigonghao(String jiaoshigonghao) { 330 | this.jiaoshigonghao = jiaoshigonghao; 331 | } 332 | 333 | /** 334 | * 获取:教师工号 335 | */ 336 | public String getJiaoshigonghao() { 337 | return jiaoshigonghao; 338 | } 339 | 340 | 341 | /** 342 | * 设置:教师姓名 343 | */ 344 | 345 | public void setJiaoshixingming(String jiaoshixingming) { 346 | this.jiaoshixingming = jiaoshixingming; 347 | } 348 | 349 | /** 350 | * 获取:教师姓名 351 | */ 352 | public String getJiaoshixingming() { 353 | return jiaoshixingming; 354 | } 355 | 356 | } 357 | -------------------------------------------------------------------------------- /src/main/java/com/entity/BiyezigeEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 毕业资格 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-04-03 16:15:19 30 | */ 31 | @TableName("biyezige") 32 | public class BiyezigeEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public BiyezigeEntity() { 37 | 38 | } 39 | 40 | public BiyezigeEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 学号 56 | */ 57 | 58 | private String xuehao; 59 | 60 | /** 61 | * 姓名 62 | */ 63 | 64 | private String xingming; 65 | 66 | /** 67 | * 院系 68 | */ 69 | 70 | private String yuanxi; 71 | 72 | /** 73 | * 专业 74 | */ 75 | 76 | private String zhuanye; 77 | 78 | /** 79 | * 班级 80 | */ 81 | 82 | private String banji; 83 | 84 | /** 85 | * 身份证 86 | */ 87 | 88 | private String shenfenzheng; 89 | 90 | /** 91 | * 毕业情况 92 | */ 93 | 94 | private String biyeqingkuang; 95 | 96 | /** 97 | * 年份 98 | */ 99 | 100 | private String nianfen; 101 | 102 | /** 103 | * 登记时间 104 | */ 105 | 106 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 107 | @DateTimeFormat 108 | private Date dengjishijian; 109 | 110 | /** 111 | * 教师工号 112 | */ 113 | 114 | private String jiaoshigonghao; 115 | 116 | /** 117 | * 教师姓名 118 | */ 119 | 120 | private String jiaoshixingming; 121 | 122 | /** 123 | * 是否审核 124 | */ 125 | 126 | private String sfsh; 127 | 128 | /** 129 | * 审核回复 130 | */ 131 | 132 | private String shhf; 133 | 134 | 135 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 136 | @DateTimeFormat 137 | private Date addtime; 138 | 139 | public Date getAddtime() { 140 | return addtime; 141 | } 142 | public void setAddtime(Date addtime) { 143 | this.addtime = addtime; 144 | } 145 | 146 | public Long getId() { 147 | return id; 148 | } 149 | 150 | public void setId(Long id) { 151 | this.id = id; 152 | } 153 | /** 154 | * 设置:学号 155 | */ 156 | public void setXuehao(String xuehao) { 157 | this.xuehao = xuehao; 158 | } 159 | /** 160 | * 获取:学号 161 | */ 162 | public String getXuehao() { 163 | return xuehao; 164 | } 165 | /** 166 | * 设置:姓名 167 | */ 168 | public void setXingming(String xingming) { 169 | this.xingming = xingming; 170 | } 171 | /** 172 | * 获取:姓名 173 | */ 174 | public String getXingming() { 175 | return xingming; 176 | } 177 | /** 178 | * 设置:院系 179 | */ 180 | public void setYuanxi(String yuanxi) { 181 | this.yuanxi = yuanxi; 182 | } 183 | /** 184 | * 获取:院系 185 | */ 186 | public String getYuanxi() { 187 | return yuanxi; 188 | } 189 | /** 190 | * 设置:专业 191 | */ 192 | public void setZhuanye(String zhuanye) { 193 | this.zhuanye = zhuanye; 194 | } 195 | /** 196 | * 获取:专业 197 | */ 198 | public String getZhuanye() { 199 | return zhuanye; 200 | } 201 | /** 202 | * 设置:班级 203 | */ 204 | public void setBanji(String banji) { 205 | this.banji = banji; 206 | } 207 | /** 208 | * 获取:班级 209 | */ 210 | public String getBanji() { 211 | return banji; 212 | } 213 | /** 214 | * 设置:身份证 215 | */ 216 | public void setShenfenzheng(String shenfenzheng) { 217 | this.shenfenzheng = shenfenzheng; 218 | } 219 | /** 220 | * 获取:身份证 221 | */ 222 | public String getShenfenzheng() { 223 | return shenfenzheng; 224 | } 225 | /** 226 | * 设置:毕业情况 227 | */ 228 | public void setBiyeqingkuang(String biyeqingkuang) { 229 | this.biyeqingkuang = biyeqingkuang; 230 | } 231 | /** 232 | * 获取:毕业情况 233 | */ 234 | public String getBiyeqingkuang() { 235 | return biyeqingkuang; 236 | } 237 | /** 238 | * 设置:年份 239 | */ 240 | public void setNianfen(String nianfen) { 241 | this.nianfen = nianfen; 242 | } 243 | /** 244 | * 获取:年份 245 | */ 246 | public String getNianfen() { 247 | return nianfen; 248 | } 249 | /** 250 | * 设置:登记时间 251 | */ 252 | public void setDengjishijian(Date dengjishijian) { 253 | this.dengjishijian = dengjishijian; 254 | } 255 | /** 256 | * 获取:登记时间 257 | */ 258 | public Date getDengjishijian() { 259 | return dengjishijian; 260 | } 261 | /** 262 | * 设置:教师工号 263 | */ 264 | public void setJiaoshigonghao(String jiaoshigonghao) { 265 | this.jiaoshigonghao = jiaoshigonghao; 266 | } 267 | /** 268 | * 获取:教师工号 269 | */ 270 | public String getJiaoshigonghao() { 271 | return jiaoshigonghao; 272 | } 273 | /** 274 | * 设置:教师姓名 275 | */ 276 | public void setJiaoshixingming(String jiaoshixingming) { 277 | this.jiaoshixingming = jiaoshixingming; 278 | } 279 | /** 280 | * 获取:教师姓名 281 | */ 282 | public String getJiaoshixingming() { 283 | return jiaoshixingming; 284 | } 285 | /** 286 | * 设置:是否审核 287 | */ 288 | public void setSfsh(String sfsh) { 289 | this.sfsh = sfsh; 290 | } 291 | /** 292 | * 获取:是否审核 293 | */ 294 | public String getSfsh() { 295 | return sfsh; 296 | } 297 | /** 298 | * 设置:审核回复 299 | */ 300 | public void setShhf(String shhf) { 301 | this.shhf = shhf; 302 | } 303 | /** 304 | * 获取:审核回复 305 | */ 306 | public String getShhf() { 307 | return shhf; 308 | } 309 | 310 | } 311 | -------------------------------------------------------------------------------- /src/main/java/com/entity/XueshengchengjiEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 学生成绩 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-04-03 16:15:19 30 | */ 31 | @TableName("xueshengchengji") 32 | public class XueshengchengjiEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public XueshengchengjiEntity() { 37 | 38 | } 39 | 40 | public XueshengchengjiEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 年份 56 | */ 57 | 58 | private String nianfen; 59 | 60 | /** 61 | * 学期 62 | */ 63 | 64 | private String xueqi; 65 | 66 | /** 67 | * 学号 68 | */ 69 | 70 | private String xuehao; 71 | 72 | /** 73 | * 科目 74 | */ 75 | 76 | private String kemu; 77 | 78 | /** 79 | * 姓名 80 | */ 81 | 82 | private String xingming; 83 | 84 | /** 85 | * 院系 86 | */ 87 | 88 | private String yuanxi; 89 | 90 | /** 91 | * 专业 92 | */ 93 | 94 | private String zhuanye; 95 | 96 | /** 97 | * 教师工号 98 | */ 99 | 100 | private String jiaoshigonghao; 101 | 102 | /** 103 | * 教师姓名 104 | */ 105 | 106 | private String jiaoshixingming; 107 | 108 | /** 109 | * 是否合格 110 | */ 111 | 112 | private String shifouhege; 113 | 114 | /** 115 | * 学分 116 | */ 117 | 118 | private Integer xuefen; 119 | 120 | /** 121 | * 成绩 122 | */ 123 | 124 | private Integer chengji; 125 | 126 | /** 127 | * 评语 128 | */ 129 | 130 | private String pingyu; 131 | 132 | /** 133 | * 登记时间 134 | */ 135 | 136 | private String dengjishijian; 137 | 138 | 139 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 140 | @DateTimeFormat 141 | private Date addtime; 142 | 143 | public Date getAddtime() { 144 | return addtime; 145 | } 146 | public void setAddtime(Date addtime) { 147 | this.addtime = addtime; 148 | } 149 | 150 | public Long getId() { 151 | return id; 152 | } 153 | 154 | public void setId(Long id) { 155 | this.id = id; 156 | } 157 | /** 158 | * 设置:年份 159 | */ 160 | public void setNianfen(String nianfen) { 161 | this.nianfen = nianfen; 162 | } 163 | /** 164 | * 获取:年份 165 | */ 166 | public String getNianfen() { 167 | return nianfen; 168 | } 169 | /** 170 | * 设置:学期 171 | */ 172 | public void setXueqi(String xueqi) { 173 | this.xueqi = xueqi; 174 | } 175 | /** 176 | * 获取:学期 177 | */ 178 | public String getXueqi() { 179 | return xueqi; 180 | } 181 | /** 182 | * 设置:学号 183 | */ 184 | public void setXuehao(String xuehao) { 185 | this.xuehao = xuehao; 186 | } 187 | /** 188 | * 获取:学号 189 | */ 190 | public String getXuehao() { 191 | return xuehao; 192 | } 193 | /** 194 | * 设置:科目 195 | */ 196 | public void setKemu(String kemu) { 197 | this.kemu = kemu; 198 | } 199 | /** 200 | * 获取:科目 201 | */ 202 | public String getKemu() { 203 | return kemu; 204 | } 205 | /** 206 | * 设置:姓名 207 | */ 208 | public void setXingming(String xingming) { 209 | this.xingming = xingming; 210 | } 211 | /** 212 | * 获取:姓名 213 | */ 214 | public String getXingming() { 215 | return xingming; 216 | } 217 | /** 218 | * 设置:院系 219 | */ 220 | public void setYuanxi(String yuanxi) { 221 | this.yuanxi = yuanxi; 222 | } 223 | /** 224 | * 获取:院系 225 | */ 226 | public String getYuanxi() { 227 | return yuanxi; 228 | } 229 | /** 230 | * 设置:专业 231 | */ 232 | public void setZhuanye(String zhuanye) { 233 | this.zhuanye = zhuanye; 234 | } 235 | /** 236 | * 获取:专业 237 | */ 238 | public String getZhuanye() { 239 | return zhuanye; 240 | } 241 | /** 242 | * 设置:教师工号 243 | */ 244 | public void setJiaoshigonghao(String jiaoshigonghao) { 245 | this.jiaoshigonghao = jiaoshigonghao; 246 | } 247 | /** 248 | * 获取:教师工号 249 | */ 250 | public String getJiaoshigonghao() { 251 | return jiaoshigonghao; 252 | } 253 | /** 254 | * 设置:教师姓名 255 | */ 256 | public void setJiaoshixingming(String jiaoshixingming) { 257 | this.jiaoshixingming = jiaoshixingming; 258 | } 259 | /** 260 | * 获取:教师姓名 261 | */ 262 | public String getJiaoshixingming() { 263 | return jiaoshixingming; 264 | } 265 | /** 266 | * 设置:是否合格 267 | */ 268 | public void setShifouhege(String shifouhege) { 269 | this.shifouhege = shifouhege; 270 | } 271 | /** 272 | * 获取:是否合格 273 | */ 274 | public String getShifouhege() { 275 | return shifouhege; 276 | } 277 | /** 278 | * 设置:学分 279 | */ 280 | public void setXuefen(Integer xuefen) { 281 | this.xuefen = xuefen; 282 | } 283 | /** 284 | * 获取:学分 285 | */ 286 | public Integer getXuefen() { 287 | return xuefen; 288 | } 289 | /** 290 | * 设置:成绩 291 | */ 292 | public void setChengji(Integer chengji) { 293 | this.chengji = chengji; 294 | } 295 | /** 296 | * 获取:成绩 297 | */ 298 | public Integer getChengji() { 299 | return chengji; 300 | } 301 | /** 302 | * 设置:评语 303 | */ 304 | public void setPingyu(String pingyu) { 305 | this.pingyu = pingyu; 306 | } 307 | /** 308 | * 获取:评语 309 | */ 310 | public String getPingyu() { 311 | return pingyu; 312 | } 313 | /** 314 | * 设置:登记时间 315 | */ 316 | public void setDengjishijian(String dengjishijian) { 317 | this.dengjishijian = dengjishijian; 318 | } 319 | /** 320 | * 获取:登记时间 321 | */ 322 | public String getDengjishijian() { 323 | return dengjishijian; 324 | } 325 | 326 | } 327 | -------------------------------------------------------------------------------- /src/main/java/com/entity/PeiyangfanganEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 培养方案 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-04-03 16:15:19 30 | */ 31 | @TableName("peiyangfangan") 32 | public class PeiyangfanganEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public PeiyangfanganEntity() { 37 | 38 | } 39 | 40 | public PeiyangfanganEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 方案编号 56 | */ 57 | 58 | private String fanganbianhao; 59 | 60 | /** 61 | * 院系 62 | */ 63 | 64 | private String yuanxi; 65 | 66 | /** 67 | * 专业 68 | */ 69 | 70 | private String zhuanye; 71 | 72 | /** 73 | * 班级 74 | */ 75 | 76 | private String banji; 77 | 78 | /** 79 | * 培养类型 80 | */ 81 | 82 | private String peiyangleixing; 83 | 84 | /** 85 | * 学号 86 | */ 87 | 88 | private String xuehao; 89 | 90 | /** 91 | * 姓名 92 | */ 93 | 94 | private String xingming; 95 | 96 | /** 97 | * 课程名称 98 | */ 99 | 100 | private String kechengmingcheng; 101 | 102 | /** 103 | * 课程类别 104 | */ 105 | 106 | private String kechengleibie; 107 | 108 | /** 109 | * 学分 110 | */ 111 | 112 | private String xuefen; 113 | 114 | /** 115 | * 总学时 116 | */ 117 | 118 | private String zongxueshi; 119 | 120 | /** 121 | * 考核方式 122 | */ 123 | 124 | private String kaohefangshi; 125 | 126 | /** 127 | * 学期 128 | */ 129 | 130 | private String xueqi; 131 | 132 | /** 133 | * 年份 134 | */ 135 | 136 | private String nianfen; 137 | 138 | /** 139 | * 教师工号 140 | */ 141 | 142 | private String jiaoshigonghao; 143 | 144 | /** 145 | * 教师姓名 146 | */ 147 | 148 | private String jiaoshixingming; 149 | 150 | 151 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 152 | @DateTimeFormat 153 | private Date addtime; 154 | 155 | public Date getAddtime() { 156 | return addtime; 157 | } 158 | public void setAddtime(Date addtime) { 159 | this.addtime = addtime; 160 | } 161 | 162 | public Long getId() { 163 | return id; 164 | } 165 | 166 | public void setId(Long id) { 167 | this.id = id; 168 | } 169 | /** 170 | * 设置:方案编号 171 | */ 172 | public void setFanganbianhao(String fanganbianhao) { 173 | this.fanganbianhao = fanganbianhao; 174 | } 175 | /** 176 | * 获取:方案编号 177 | */ 178 | public String getFanganbianhao() { 179 | return fanganbianhao; 180 | } 181 | /** 182 | * 设置:院系 183 | */ 184 | public void setYuanxi(String yuanxi) { 185 | this.yuanxi = yuanxi; 186 | } 187 | /** 188 | * 获取:院系 189 | */ 190 | public String getYuanxi() { 191 | return yuanxi; 192 | } 193 | /** 194 | * 设置:专业 195 | */ 196 | public void setZhuanye(String zhuanye) { 197 | this.zhuanye = zhuanye; 198 | } 199 | /** 200 | * 获取:专业 201 | */ 202 | public String getZhuanye() { 203 | return zhuanye; 204 | } 205 | /** 206 | * 设置:班级 207 | */ 208 | public void setBanji(String banji) { 209 | this.banji = banji; 210 | } 211 | /** 212 | * 获取:班级 213 | */ 214 | public String getBanji() { 215 | return banji; 216 | } 217 | /** 218 | * 设置:培养类型 219 | */ 220 | public void setPeiyangleixing(String peiyangleixing) { 221 | this.peiyangleixing = peiyangleixing; 222 | } 223 | /** 224 | * 获取:培养类型 225 | */ 226 | public String getPeiyangleixing() { 227 | return peiyangleixing; 228 | } 229 | /** 230 | * 设置:学号 231 | */ 232 | public void setXuehao(String xuehao) { 233 | this.xuehao = xuehao; 234 | } 235 | /** 236 | * 获取:学号 237 | */ 238 | public String getXuehao() { 239 | return xuehao; 240 | } 241 | /** 242 | * 设置:姓名 243 | */ 244 | public void setXingming(String xingming) { 245 | this.xingming = xingming; 246 | } 247 | /** 248 | * 获取:姓名 249 | */ 250 | public String getXingming() { 251 | return xingming; 252 | } 253 | /** 254 | * 设置:课程名称 255 | */ 256 | public void setKechengmingcheng(String kechengmingcheng) { 257 | this.kechengmingcheng = kechengmingcheng; 258 | } 259 | /** 260 | * 获取:课程名称 261 | */ 262 | public String getKechengmingcheng() { 263 | return kechengmingcheng; 264 | } 265 | /** 266 | * 设置:课程类别 267 | */ 268 | public void setKechengleibie(String kechengleibie) { 269 | this.kechengleibie = kechengleibie; 270 | } 271 | /** 272 | * 获取:课程类别 273 | */ 274 | public String getKechengleibie() { 275 | return kechengleibie; 276 | } 277 | /** 278 | * 设置:学分 279 | */ 280 | public void setXuefen(String xuefen) { 281 | this.xuefen = xuefen; 282 | } 283 | /** 284 | * 获取:学分 285 | */ 286 | public String getXuefen() { 287 | return xuefen; 288 | } 289 | /** 290 | * 设置:总学时 291 | */ 292 | public void setZongxueshi(String zongxueshi) { 293 | this.zongxueshi = zongxueshi; 294 | } 295 | /** 296 | * 获取:总学时 297 | */ 298 | public String getZongxueshi() { 299 | return zongxueshi; 300 | } 301 | /** 302 | * 设置:考核方式 303 | */ 304 | public void setKaohefangshi(String kaohefangshi) { 305 | this.kaohefangshi = kaohefangshi; 306 | } 307 | /** 308 | * 获取:考核方式 309 | */ 310 | public String getKaohefangshi() { 311 | return kaohefangshi; 312 | } 313 | /** 314 | * 设置:学期 315 | */ 316 | public void setXueqi(String xueqi) { 317 | this.xueqi = xueqi; 318 | } 319 | /** 320 | * 获取:学期 321 | */ 322 | public String getXueqi() { 323 | return xueqi; 324 | } 325 | /** 326 | * 设置:年份 327 | */ 328 | public void setNianfen(String nianfen) { 329 | this.nianfen = nianfen; 330 | } 331 | /** 332 | * 获取:年份 333 | */ 334 | public String getNianfen() { 335 | return nianfen; 336 | } 337 | /** 338 | * 设置:教师工号 339 | */ 340 | public void setJiaoshigonghao(String jiaoshigonghao) { 341 | this.jiaoshigonghao = jiaoshigonghao; 342 | } 343 | /** 344 | * 获取:教师工号 345 | */ 346 | public String getJiaoshigonghao() { 347 | return jiaoshigonghao; 348 | } 349 | /** 350 | * 设置:教师姓名 351 | */ 352 | public void setJiaoshixingming(String jiaoshixingming) { 353 | this.jiaoshixingming = jiaoshixingming; 354 | } 355 | /** 356 | * 获取:教师姓名 357 | */ 358 | public String getJiaoshixingming() { 359 | return jiaoshixingming; 360 | } 361 | 362 | } 363 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /src/main/java/com/utils/BaiduUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import org.json.JSONArray; 12 | import org.json.JSONObject; 13 | 14 | import com.baidu.aip.ocr.AipOcr; 15 | import com.baidu.aip.imageclassify.AipImageClassify; 16 | 17 | /** 18 | * 类说明 : 19 | */ 20 | 21 | public class BaiduUtil { 22 | 23 | /** 24 | * 根据经纬度获得省市区信息 25 | * @param lon 纬度 26 | * @param lat 经度 27 | * @param coordtype 经纬度坐标系 28 | * @return 29 | */ 30 | public static Map getCityByLonLat(String key, String lng, String lat) { 31 | String location = lat + "," + lng; 32 | try { 33 | //拼装url 34 | String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location; 35 | String result = HttpClientUtils.doGet(url); 36 | JSONObject o = new JSONObject(result); 37 | Map area = new HashMap<>(); 38 | area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province")); 39 | area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city")); 40 | area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district")); 41 | area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street")); 42 | return area; 43 | }catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | return null; 47 | } 48 | 49 | /** 50 | * 获取API访问token 51 | * 该token有一定的有效期,需要自行管理,当失效时需重新获取. 52 | * @param ak - 百度云官网获取的 API Key 53 | * @param sk - 百度云官网获取的 Securet Key 54 | * @return assess_token 55 | */ 56 | public static String getAuth(String ak, String sk) { 57 | // 获取token地址 58 | String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; 59 | String getAccessTokenUrl = authHost 60 | // 1. grant_type为固定参数 61 | + "grant_type=client_credentials" 62 | // 2. 官网获取的 API Key 63 | + "&client_id=" + ak 64 | // 3. 官网获取的 Secret Key 65 | + "&client_secret=" + sk; 66 | try { 67 | URL realUrl = new URL(getAccessTokenUrl); 68 | // 打开和URL之间的连接 69 | HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection(); 70 | connection.setRequestMethod("GET"); 71 | connection.connect(); 72 | // 获取所有响应头字段 73 | Map> map = connection.getHeaderFields(); 74 | // 遍历所有的响应头字段 75 | for (String key : map.keySet()) { 76 | System.err.println(key + "--->" + map.get(key)); 77 | } 78 | // 定义 BufferedReader输入流来读取URL的响应 79 | BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); 80 | String result = ""; 81 | String line; 82 | while ((line = in.readLine()) != null) { 83 | result += line; 84 | } 85 | /** 86 | * 返回结果示例 87 | */ 88 | System.err.println("result:" + result); 89 | org.json.JSONObject jsonObject = new org.json.JSONObject(result); 90 | String access_token = jsonObject.getString("access_token"); 91 | return access_token; 92 | } catch (Exception e) { 93 | System.err.printf("获取token失败!"); 94 | e.printStackTrace(System.err); 95 | } 96 | return null; 97 | } 98 | 99 | //设置APPID/AK/SK 100 | public static final String APP_ID = "29917330"; 101 | public static final String API_KEY = "yMnHy1guHZRzGhXB7BILdktB"; 102 | public static final String SECRET_KEY = "1oHG8X0yizyZmIwj3bZygG470b648iE1"; 103 | 104 | private static AipOcr ocrClient = null; 105 | 106 | /** 107 | * 识别图片上的文本内容,转成文字字符串返回 108 | * @param imagePath 图片文件的路径 109 | */ 110 | public static String generalString(String imagePath, boolean isNewline){ 111 | try{ 112 | HashMap options = new HashMap(); 113 | options.put("language_type", "CHN_ENG"); //CHN_ENG:中英文混合, ENG:英文 114 | options.put("detect_direction", "true"); //是否检测图像朝向,默认不检测,即:false 115 | options.put("detect_language", "true"); //是否检测语言,默认不检测。 116 | options.put("probability", "false"); //是否返回识别结果中每一行的置信度 117 | //通用文字识别 118 | if(ocrClient==null) { 119 | ocrClient = new AipOcr(APP_ID, API_KEY, SECRET_KEY); 120 | ocrClient.setConnectionTimeoutInMillis(5000); 121 | ocrClient.setSocketTimeoutInMillis(60000); 122 | } 123 | JSONObject jsonObject = ocrClient.basicAccurateGeneral(imagePath, options); 124 | String result = mergeString(jsonObject, isNewline); 125 | return result; 126 | }catch(Exception ex){ 127 | ex.printStackTrace(); 128 | } 129 | return null; 130 | } 131 | 132 | 133 | private static String mergeString(JSONObject jsonObject, boolean isNewline){ 134 | if(jsonObject == null){ 135 | return ""; 136 | } 137 | 138 | if(jsonObject.has("words_result") && jsonObject.has("words_result_num")){ 139 | int wordsResultNum = jsonObject.getInt("words_result_num"); 140 | if(wordsResultNum > 0){ 141 | StringBuilder sb = new StringBuilder(); 142 | 143 | JSONArray jsonArray = jsonObject.getJSONArray("words_result"); 144 | int len = jsonArray.length(); 145 | for(int i=0;i params = new HashMap(); 166 | params.put("baike_num", "1"); 167 | JSONObject res = aic.animalDetect(imgPath, params); 168 | System.out.println(res.toString(2)); 169 | return res; 170 | } 171 | 172 | public static JSONObject dishDetect(String imgPath) { 173 | //初始化 174 | AipImageClassify aic = new AipImageClassify(APP_ID, API_KEY, SECRET_KEY); 175 | //返回JSON格式的数据 176 | HashMap params = new HashMap(); 177 | params.put("baike_num", "1"); 178 | JSONObject res = aic.dishDetect(imgPath, params); 179 | System.out.println(res.toString(2)); 180 | return res; 181 | } 182 | 183 | public static JSONObject plantDetect(String imgPath) { 184 | //初始化 185 | AipImageClassify aic = new AipImageClassify(APP_ID, API_KEY, SECRET_KEY); 186 | //返回JSON格式的数据 187 | HashMap params = new HashMap(); 188 | params.put("baike_num", "1"); 189 | JSONObject res = aic.plantDetect(imgPath, params); 190 | System.out.println(res.toString(2)); 191 | return res; 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /src/main/java/com/controller/CommonController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.IOException; 6 | import java.text.SimpleDateFormat; 7 | import java.util.ArrayList; 8 | import java.util.Calendar; 9 | import java.util.Date; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | 16 | import org.apache.commons.lang3.StringUtils; 17 | import org.json.JSONObject; 18 | import org.springframework.beans.factory.annotation.Autowired; 19 | import org.springframework.util.ResourceUtils; 20 | import org.springframework.web.bind.annotation.PathVariable; 21 | import org.springframework.web.bind.annotation.RequestBody; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | import org.springframework.web.bind.annotation.RequestParam; 24 | import org.springframework.web.bind.annotation.RestController; 25 | 26 | import com.annotation.IgnoreAuth; 27 | import com.baidu.aip.face.AipFace; 28 | import com.baidu.aip.face.MatchRequest; 29 | import com.baidu.aip.util.Base64Util; 30 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 31 | import com.entity.ConfigEntity; 32 | import com.service.CommonService; 33 | import com.service.ConfigService; 34 | import com.utils.BaiduUtil; 35 | import com.utils.FileUtil; 36 | import com.utils.R; 37 | import com.utils.CommonUtil; 38 | /** 39 | * 通用接口 40 | */ 41 | @RestController 42 | public class CommonController{ 43 | @Autowired 44 | private CommonService commonService; 45 | 46 | private static AipFace client = null; 47 | 48 | @Autowired 49 | private ConfigService configService; 50 | /** 51 | * 获取table表中的column列表(联动接口) 52 | * @param table 53 | * @param column 54 | * @return 55 | */ 56 | @IgnoreAuth 57 | @RequestMapping("/option/{tableName}/{columnName}") 58 | public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,@RequestParam(required = false) String conditionColumn,@RequestParam(required = false) String conditionValue,String level,String parent) { 59 | Map params = new HashMap(); 60 | params.put("table", tableName); 61 | params.put("column", columnName); 62 | if(StringUtils.isNotBlank(level)) { 63 | params.put("level", level); 64 | } 65 | if(StringUtils.isNotBlank(parent)) { 66 | params.put("parent", parent); 67 | } 68 | if(StringUtils.isNotBlank(conditionColumn)) { 69 | params.put("conditionColumn", conditionColumn); 70 | } 71 | if(StringUtils.isNotBlank(conditionValue)) { 72 | params.put("conditionValue", conditionValue); 73 | } 74 | List data = commonService.getOption(params); 75 | return R.ok().put("data", data); 76 | } 77 | 78 | /** 79 | * 根据table中的column获取单条记录 80 | * @param table 81 | * @param column 82 | * @return 83 | */ 84 | @IgnoreAuth 85 | @RequestMapping("/follow/{tableName}/{columnName}") 86 | public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) { 87 | Map params = new HashMap(); 88 | params.put("table", tableName); 89 | params.put("column", columnName); 90 | params.put("columnValue", columnValue); 91 | Map result = commonService.getFollowByOption(params); 92 | return R.ok().put("data", result); 93 | } 94 | 95 | /** 96 | * 修改table表的sfsh状态 97 | * @param table 98 | * @param map 99 | * @return 100 | */ 101 | @RequestMapping("/sh/{tableName}") 102 | public R sh(@PathVariable("tableName") String tableName, @RequestBody Map map) { 103 | map.put("table", tableName); 104 | commonService.sh(map); 105 | return R.ok(); 106 | } 107 | 108 | /** 109 | * 获取需要提醒的记录数 110 | * @param tableName 111 | * @param columnName 112 | * @param type 1:数字 2:日期 113 | * @param map 114 | * @return 115 | */ 116 | @IgnoreAuth 117 | @RequestMapping("/remind/{tableName}/{columnName}/{type}") 118 | public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, 119 | @PathVariable("type") String type,@RequestParam Map map) { 120 | map.put("table", tableName); 121 | map.put("column", columnName); 122 | map.put("type", type); 123 | 124 | if(type.equals("2")) { 125 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 126 | Calendar c = Calendar.getInstance(); 127 | Date remindStartDate = null; 128 | Date remindEndDate = null; 129 | if(map.get("remindstart")!=null) { 130 | Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); 131 | c.setTime(new Date()); 132 | c.add(Calendar.DAY_OF_MONTH,remindStart); 133 | remindStartDate = c.getTime(); 134 | map.put("remindstart", sdf.format(remindStartDate)); 135 | } 136 | if(map.get("remindend")!=null) { 137 | Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); 138 | c.setTime(new Date()); 139 | c.add(Calendar.DAY_OF_MONTH,remindEnd); 140 | remindEndDate = c.getTime(); 141 | map.put("remindend", sdf.format(remindEndDate)); 142 | } 143 | } 144 | 145 | int count = commonService.remindCount(map); 146 | return R.ok().put("count", count); 147 | } 148 | 149 | /** 150 | * 单列求和 151 | */ 152 | @IgnoreAuth 153 | @RequestMapping("/cal/{tableName}/{columnName}") 154 | public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) { 155 | Map params = new HashMap(); 156 | params.put("table", tableName); 157 | params.put("column", columnName); 158 | Map result = commonService.selectCal(params); 159 | return R.ok().put("data", result); 160 | } 161 | 162 | /** 163 | * 分组统计 164 | */ 165 | @IgnoreAuth 166 | @RequestMapping("/group/{tableName}/{columnName}") 167 | public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) { 168 | Map params = new HashMap(); 169 | params.put("table", tableName); 170 | params.put("column", columnName); 171 | List> result = commonService.selectGroup(params); 172 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 173 | for(Map m : result) { 174 | for(String k : m.keySet()) { 175 | if(m.get(k) instanceof Date) { 176 | m.put(k, sdf.format((Date)m.get(k))); 177 | } 178 | } 179 | } 180 | return R.ok().put("data", result); 181 | } 182 | 183 | /** 184 | * (按值统计) 185 | */ 186 | @IgnoreAuth 187 | @RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}") 188 | public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) { 189 | Map params = new HashMap(); 190 | params.put("table", tableName); 191 | params.put("xColumn", xColumnName); 192 | params.put("yColumn", yColumnName); 193 | List> result = commonService.selectValue(params); 194 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 195 | for(Map m : result) { 196 | for(String k : m.keySet()) { 197 | if(m.get(k) instanceof Date) { 198 | m.put(k, sdf.format((Date)m.get(k))); 199 | } 200 | } 201 | } 202 | return R.ok().put("data", result); 203 | } 204 | 205 | /** 206 | * (按值统计)时间统计类型 207 | */ 208 | @IgnoreAuth 209 | @RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}") 210 | public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) { 211 | Map params = new HashMap(); 212 | params.put("table", tableName); 213 | params.put("xColumn", xColumnName); 214 | params.put("yColumn", yColumnName); 215 | params.put("timeStatType", timeStatType); 216 | List> result = commonService.selectTimeStatValue(params); 217 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 218 | for(Map m : result) { 219 | for(String k : m.keySet()) { 220 | if(m.get(k) instanceof Date) { 221 | m.put(k, sdf.format((Date)m.get(k))); 222 | } 223 | } 224 | } 225 | return R.ok().put("data", result); 226 | } 227 | 228 | 229 | 230 | } 231 | --------------------------------------------------------------------------------