新的提交信息

pull/1/head
gaojiale 4 months ago
parent 6315245009
commit 508214d07e

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="kuaidizhan" />
</profile>
</annotationProcessing>
</component>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,296 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jlwl</groupId>
<artifactId>kuaidizhan</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.0.0.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<druid.version>1.1.0</druid.version>
<fastjson.version>1.2.8</fastjson.version>
<mybaitsplus.version>2.3</mybaitsplus.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.19</slf4j.version>
<aspectjweaver.version>1.8.8</aspectjweaver.version>
<fileupload.version>1.3.1</fileupload.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectjweaver.version}</version>
</dependency>
<!-- FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${fileupload.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Mybatis-Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybaitsplus.version}</version>
</dependency>
<!-- Mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.27</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
<!-- 导入导出excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.11-beta2</version>
</dependency>
</dependencies>
<build>
<!-- 项目访问名称 -->
<finalName>kuaidizhan</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,86 @@
package com.ServletContextListener;
// 导入MyBatis-Plus的EntityWrapper类用于构建实体查询条件
import com.baomidou.mybatisplus.mapper.EntityWrapper;
// 导入字典实体类,用于表示字典表中的数据
import com.entity.DictionaryEntity;
// 导入字典服务接口,用于操作字典数据
import com.service.DictionaryService;
// 导入日志记录器接口
import org.slf4j.Logger;
// 导入日志记录器工厂类,用于创建日志记录器
import org.slf4j.LoggerFactory;
// 导入Spring的应用上下文接口代表Spring应用的上下文环境
import org.springframework.context.ApplicationContext;
// 导入Spring的Web应用上下文工具类用于从Servlet上下文获取Spring应用上下文
import org.springframework.web.context.support.WebApplicationContextUtils;
// 导入Servlet上下文监听器接口
import javax.servlet.ServletContextListener;
// 导入Servlet上下文事件类代表Servlet上下文的事件
import javax.servlet.ServletContextEvent;
// 导入HashMap类用于存储键值对
import java.util.HashMap;
// 导入List接口用于存储有序集合
import java.util.List;
// 导入Map接口用于存储键值对映射
import java.util.Map;
/**
* ,,
*/
public class DictionaryServletContextListener implements ServletContextListener {
// 创建一个静态的日志记录器,用于记录该类的日志信息
private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class);
// 这里注释掉的@Autowired和DictionaryServiceImpl的声明原本是想自动注入字典服务实现类但可能因为在ServletContextListener中不能直接使用@Autowired所以采用其他方式获取服务
// @Autowired
// private DictionaryServiceImpl dictionaryService;
/**
* Servlet
* @param sce ServletServlet
*/
@Override
public void contextDestroyed(ServletContextEvent sce) {
// 记录服务器停止的日志信息
logger.info("----------服务器停止----------");
}
/**
* Servlet
* @param sce ServletServlet
*/
@Override
public void contextInitialized(ServletContextEvent sce) {
// 从Servlet上下文获取Spring的应用上下文
ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
// 记录字典表初始化开始的日志信息
logger.info("----------字典表初始化开始----------");
// 从Spring应用上下文中获取字典服务实例
DictionaryService dictionaryService = (DictionaryService)appContext.getBean("dictionaryService");
// 使用字典服务查询所有的字典实体数据
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
// 创建一个嵌套的Map用于存储字典数据外层键为字典代码内层键为代码索引值为索引名称
Map<String, Map<Integer,String>> map = new HashMap<>();
// 遍历查询到的所有字典实体数据
for(DictionaryEntity d :dictionaryEntities){
// 根据字典代码从外层Map中获取内层Map
Map<Integer, String> m = map.get(d.getDicCode());
// 如果内层Map为空或者不存在则创建一个新的内层Map
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
// 将代码索引和索引名称存入内层Map
m.put(d.getCodeIndex(),d.getIndexName());
// 将内层Map存入外层Map键为字典代码
map.put(d.getDicCode(),m);
}
// 将处理好的字典数据存储到Servlet上下文中键为"dictionaryMap"
sce.getServletContext().setAttribute("dictionaryMap", map);
// 记录字典表初始化完成的日志信息
logger.info("----------字典表初始化完成----------");
}
}

@ -0,0 +1,15 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface APPLoginUser {
}

@ -0,0 +1,13 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -0,0 +1,15 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface LoginUser {
}

@ -0,0 +1,28 @@
package com.config;
import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
/**
*
*/
public class MyMetaObjectHandler extends MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("ctime", new Date(), metaObject);
}
@Override
public boolean openUpdateFill() {
return false;
}
@Override
public void updateFill(MetaObject metaObject) {
// 关闭更新填充、这里不执行
}
}

@ -0,0 +1,240 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
@Autowired
private ConfigService configService;
private static AipFace client = null;
private static String BAIDU_DITU_AK = null;
@RequestMapping("/location")
public R location(String lng,String lat) {
if(BAIDU_DITU_AK==null) {
BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
if(BAIDU_DITU_AK==null) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
return R.ok().put("data", map);
}
/**
*
*
* @param face1 1
* @param face2 2
* @return
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2, HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* tablecolumn()
* @param table
* @param column
* @return
*/
@RequestMapping("/option/{tableName}/{columnName}")
@IgnoreAuth
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* tablecolumn
* @param table
* @param column
* @return
*/
@RequestMapping("/follow/{tableName}/{columnName}")
@IgnoreAuth
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* tablesfsh
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
*
* @param tableName
* @param columnName
* @param type 1: 2:
* @param map
* @return
*/
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
@IgnoreAuth
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
*
*/
@RequestMapping("/cal/{tableName}/{columnName}")
@IgnoreAuth
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
*/
@RequestMapping("/group/{tableName}/{columnName}")
@IgnoreAuth
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
*
*/
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
@IgnoreAuth
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
return R.ok().put("data", result);
}
}

@ -0,0 +1,110 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* name
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,244 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.JiedanEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DaiquEntity;
import com.entity.view.DaiquView;
import com.entity.YonghuEntity;
import com.entity.ZhandianEntity;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/daiqu")
public class DaiquController {
private static final Logger logger = LoggerFactory.getLogger(DaiquController.class);
@Autowired
private DaiquService daiquService;
@Autowired
private JiedanService jiedanService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhandianService zhandianService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = daiquService.queryPage(params);
//字典表数据转换
List<DaiquView> list =(List<DaiquView>)page.getList();
for(DaiquView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaiquEntity daiqu = daiquService.selectById(id);
if(daiqu !=null){
//entity转view
DaiquView view = new DaiquView();
BeanUtils.copyProperties( daiqu , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(daiqu.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
ZhandianEntity zhandian = zhandianService.selectById(daiqu.getZhandianId());
if(zhandian != null){
BeanUtils.copyProperties( zhandian , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setZhandianId(zhandian.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DaiquEntity daiqu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,daiqu:{}",this.getClass().getName(),daiqu.toString());
daiqu.setKdztTypes(1);
daiqu.setTakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
Wrapper<DaiquEntity> queryWrapper = new EntityWrapper<DaiquEntity>()
.eq("dqname", daiqu.getDqname())
.eq("zhandian_id", daiqu.getZhandianId())
.eq("yonghu_id", daiqu.getYonghuId())
.eq("takecode", daiqu.getTakecode())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiquEntity daiquEntity = daiquService.selectOne(queryWrapper);
if(daiquEntity==null){
daiquService.insert(daiqu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DaiquEntity daiqu, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,daiqu:{}",this.getClass().getName(),daiqu.toString());
//根据字段查询是否有相同数据
Wrapper<DaiquEntity> queryWrapper = new EntityWrapper<DaiquEntity>()
.notIn("id",daiqu.getId())
.eq("dqname", daiqu.getDqname())
.eq("zhandian_id", daiqu.getZhandianId())
.eq("yonghu_id", daiqu.getYonghuId())
.eq("kddx_types", daiqu.getKddxTypes())
.eq("dqphone", daiqu.getDqphone())
.eq("takecode", daiqu.getTakecode())
.eq("kdzt_types", daiqu.getKdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiquEntity daiquEntity = daiquService.selectOne(queryWrapper);
daiqu.setPickupTime(new Date());
if(daiquEntity==null){
daiquService.updateById(daiqu);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/replaceExpress")
public R replaceExpress(@RequestBody Integer ids){
DaiquEntity daiqu = daiquService.selectById(ids);
if(daiqu == null){
return R.error("数据不存在");
}
YonghuEntity yonghu = yonghuService.selectById(daiqu.getYonghuId());
if(yonghu == null){
return R.error("数据不存在");
}
JiedanEntity jiedan = new JiedanEntity();
jiedan.setInitiateTime(new Date());
jiedan.setJdyonghuId(daiqu.getYonghuId());
jiedan.setJdphone(daiqu.getDqphone());
jiedan.setAddresseename(yonghu.getName());
jiedan.setJdaddressee("住宿楼栋:"+yonghu.getDormitory()+" ,寝室号:"+yonghu.getDormitory());
jiedan.setJdtakecode(daiqu.getTakecode());
jiedan.setDaiqukuaidimc(daiqu.getDqname());
jiedan.setJdztTypes(1);//1未接
jiedan.setKdlxTypes(1);//1取件
jiedan.setOdd(String.valueOf(new Date().getTime()));
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("jdyonghu_id", jiedan.getJdyonghuId())
.eq("jdtakecode", jiedan.getJdtakecode())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
daiqu.setKdztTypes(3);
daiquService.updateById(daiqu);
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"你已经发布过这件快递的代取订单了");
}
}
/**
*
*/
@RequestMapping("/pickUp")
public R pickUp(@RequestBody Integer ids){
DaiquEntity daiqu = daiquService.selectById(ids);
if(daiqu == null){
return R.error("数据不存在");
}
daiqu.setKdztTypes(2);
daiqu.setPickupTime(new Date());
daiquService.updateById(daiqu);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
daiquService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,225 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.DaiqurenEntity;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DaiqurenEntity;
import com.service.DaiqurenService;
import com.entity.view.DaiqurenView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/daiquren")
public class DaiqurenController {
private static final Logger logger = LoggerFactory.getLogger(DaiqurenController.class);
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "代取人".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = daiqurenService.queryPage(params);
//字典表数据转换
List<DaiqurenView> list =(List<DaiqurenView>)page.getList();
for(DaiqurenView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DaiqurenEntity daiquren = daiqurenService.selectById(id);
if(daiquren !=null){
//entity转view
DaiqurenView view = new DaiqurenView();
BeanUtils.copyProperties( daiquren , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DaiqurenEntity daiquren, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,daiquren:{}",this.getClass().getName(),daiquren.toString());
Wrapper<DaiqurenEntity> queryWrapper = new EntityWrapper<DaiqurenEntity>()
.eq("name", daiquren.getName())
.eq("username", daiquren.getUsername())
.eq("password", daiquren.getPassword())
.eq("sex_types", daiquren.getSexTypes())
.eq("phone", daiquren.getPhone())
.eq("role", daiquren.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiqurenEntity daiqurenEntity = daiqurenService.selectOne(queryWrapper);
if(daiqurenEntity==null){
daiquren.setRole("代取人");
daiqurenService.insert(daiquren);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DaiqurenEntity daiquren, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,daiquren:{}",this.getClass().getName(),daiquren.toString());
//根据字段查询是否有相同数据
Wrapper<DaiqurenEntity> queryWrapper = new EntityWrapper<DaiqurenEntity>()
.notIn("id",daiquren.getId())
.eq("name", daiquren.getName())
.eq("username", daiquren.getUsername())
.eq("password", daiquren.getPassword())
.eq("sex_types", daiquren.getSexTypes())
.eq("phone", daiquren.getPhone())
.eq("role", daiquren.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DaiqurenEntity daiqurenEntity = daiqurenService.selectOne(queryWrapper);
if("".equals(daiquren.getImgPhoto()) || "null".equals(daiquren.getImgPhoto())){
daiquren.setImgPhoto(null);
}
if(daiqurenEntity==null){
daiqurenService.updateById(daiquren);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
daiqurenService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
DaiqurenEntity yonghu = daiqurenService.selectOne(new EntityWrapper<DaiqurenEntity>().eq("username", username));
if(yonghu==null || !yonghu.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
if(!role.equals(yonghu.getRole())){
return R.error("权限不正确");
}
String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "代取人");
R r = R.ok();
r.put("token", token);
r.put("role","代取人");
r.put("userId",yonghu.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody DaiqurenEntity yonghu){
// ValidatorUtils.validateEntity(user);
if(daiqurenService.selectOne(new EntityWrapper<DaiqurenEntity>().eq("username", yonghu.getUsername()).orNew().eq("phone",yonghu.getPhone())) !=null) {
return R.error("代取人已存在或手机号身份证号已经被使用");
}
daiqurenService.insert(yonghu);
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
DaiqurenEntity yonghu = daiqurenService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
}

@ -0,0 +1,188 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.entity.view.DictionaryView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {
private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
@Autowired
private DictionaryService dictionaryService;
@Autowired
private TokenService tokenService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = dictionaryService.queryPage(params);
//字典表数据转换
List<DictionaryView> list =(List<DictionaryView>)page.getList();
for(DictionaryView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
DictionaryEntity dictionary = dictionaryService.selectById(id);
if(dictionary !=null){
//entity转view
DictionaryView view = new DictionaryView();
BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.eq("code_index", dictionary.getCodeIndex())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionary.setCreateTime(new Date());
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// dictionary.set
// }
dictionaryService.insert(dictionary);
//如果字典表新增数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
//根据字段查询是否有相同数据
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.notIn("id",dictionary.getId())
.eq("dic_code", dictionary.getDicCode())
.eq("code_index", dictionary.getCodeIndex())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// dictionary.set
// }
dictionaryService.updateById(dictionary);//根据id更新
//如果字典表修改数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
dictionaryService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,83 @@
package com.controller;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
*
*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
String fileName = new Date().getTime()+"."+fileExt;
File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
file.transferTo(dest);
if(StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
if(configEntity==null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
configService.insertOrUpdate(configEntity);
}
return R.ok().put("file", fileName);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/download")
public void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
try {
File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
if (file.exists()) {
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setContentType("application/octet-stream; charset=UTF-8");
IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,259 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.DaiqurenEntity;
import com.entity.YijiedanEntity;
import com.entity.YonghuEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.JiedanEntity;
import com.entity.view.JiedanView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/jiedan")
public class JiedanController {
private static final Logger logger = LoggerFactory.getLogger(JiedanController.class);
@Autowired
private YijiedanService yijiedanService;
@Autowired
private JiedanService jiedanService;
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private YonghuService yonghuService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
PageUtils page = null;
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
page = jiedanService.queryPage(params);
}
page = jiedanService.queryPage(params);
//字典表数据转换
List<JiedanView> list =(List<JiedanView>)page.getList();
for(JiedanView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiedanEntity jiedan = jiedanService.selectById(id);
if(jiedan !=null){
//entity转view
JiedanView view = new JiedanView();
BeanUtils.copyProperties( jiedan , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody JiedanEntity jiedan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiedan:{}",this.getClass().getName(),jiedan.toString());
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody JiedanEntity jiedan, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,jiedan:{}",this.getClass().getName(),jiedan.toString());
//根据字段查询是否有相同数据
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.notIn("id",jiedan.getId())
.eq("odd", jiedan.getOdd())
.eq("daiqukuaidimc", jiedan.getDaiqukuaidimc())
.eq("jdyonghu_id", jiedan.getJdyonghuId())
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
.eq("jdtakecode", jiedan.getJdtakecode())
.eq("jdzt_types", jiedan.getJdztTypes())
.eq("kdlx_types", jiedan.getKdlxTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
jiedan.setInitiateTime(new Date());
if(jiedanEntity==null){
jiedanService.updateById(jiedan);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/receiving")
public R receiving(@RequestBody Integer ids, HttpServletRequest request){
JiedanEntity jiedan = jiedanService.selectById(ids);
if(jiedan == null){
return R.error();
}
if(request.getSession().getAttribute("role").equals("代取人")){
DaiqurenEntity userId = daiqurenService.selectById((Integer) request.getSession().getAttribute("userId"));
jiedan.setJdztTypes(2);//以接
YijiedanEntity yijiedan = new YijiedanEntity();
yijiedan.setOdd(jiedan.getOdd());
yijiedan.setYonghuId(jiedan.getJdyonghuId());
yijiedan.setFbphone(jiedan.getJdphone());
yijiedan.setDaiqurenId(userId.getId());
yijiedan.setJdphone(userId.getPhone());
yijiedan.setInitiateTime(new Date());
yijiedan.setDdztTypes(1);//1正在路上
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.eq("odd", yijiedan.getOdd())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
if(yijiedanEntity==null){
jiedanService.updateById(jiedan);
yijiedanService.insert(yijiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
return R.error("***");
}
/**
*
*/
@RequestMapping("/ship")
public R ship(String name, Integer yh, Integer dx, HttpServletRequest request){
if(name == null && name == "null" && name == ""){
return R.error("快递名称不能为空");
}
if(yh == null && yh == 0){
return R.error("收件人不能为空");
}
YonghuEntity yonghu = yonghuService.selectById(yh);
if(yonghu == null){
return R.error();
}
if(yonghu.getId() == (Integer)request.getSession().getAttribute("userId")){
return R.error("发件人和收件人不能相同");
}
JiedanEntity jiedan = new JiedanEntity();
jiedan.setOdd(String.valueOf(new Date().getTime()));
jiedan.setDaiqukuaidimc(name);
jiedan.setDx(dx);
jiedan.setJdyonghuId((Integer)request.getSession().getAttribute("userId"));
jiedan.setJdphone(yonghu.getPhone());
jiedan.setInitiateTime(new Date());
jiedan.setAddresseename(yonghu.getName());
jiedan.setJdaddressee("住宿楼栋:"+yonghu.getDormitory()+" ,寝室号:"+yonghu.getDormitory());
jiedan.setJdtakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
jiedan.setJdztTypes(1);//1未接
jiedan.setKdlxTypes(2);//2寄件
Wrapper<JiedanEntity> queryWrapper = new EntityWrapper<JiedanEntity>()
.eq("addresseename", jiedan.getAddresseename())
.eq("jdphone", jiedan.getJdphone())
.eq("jdaddressee", jiedan.getJdaddressee())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiedanEntity jiedanEntity = jiedanService.selectOne(queryWrapper);
if(jiedanEntity==null){
jiedanService.insert(jiedan);
return R.ok();
}else {
return R.error(511,"已经有相同的数据了");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
jiedanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,178 @@
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user != null){
if(!user.getRole().equals(role)){
return R.error("权限不正常");
}
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}else{
return R.error("账号或密码或权限不对");
}
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,246 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import com.entity.*;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.view.YijiedanView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/yijiedan")
public class YijiedanController {
private static final Logger logger = LoggerFactory.getLogger(YijiedanController.class);
@Autowired
private YijiedanService yijiedanService;
@Autowired
private JiedanService jiedanService;
@Autowired
private DictionaryService dictionaryService;
@Autowired
private DaiquService daiquService;
//级联表service
@Autowired
private DaiqurenService daiqurenService;
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhandianService zhandianService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
PageUtils page = null;
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
page = yijiedanService.queryPage(params);
}else if(StringUtil.isNotEmpty(role) && "代取人".equals(role)){
params.put("daiqurenId",request.getSession().getAttribute("userId"));
page = yijiedanService.queryPage(params);
}
page = yijiedanService.queryPage(params);
//字典表数据转换
List<YijiedanView> list =(List<YijiedanView>)page.getList();
for(YijiedanView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YijiedanEntity yijiedan = yijiedanService.selectById(id);
if(yijiedan !=null){
//entity转view
YijiedanView view = new YijiedanView();
BeanUtils.copyProperties( yijiedan , view );//把实体数据重构到view中
//级联表
DaiqurenEntity daiquren = daiqurenService.selectById(yijiedan.getDaiqurenId());
if(daiquren != null){
view.setDaiqurenId(daiquren.getId());
view.setYhname(daiquren.getName());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(yijiedan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YijiedanEntity yijiedan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yijiedan:{}",this.getClass().getName(),yijiedan.toString());
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.eq("odd", yijiedan.getOdd())
.eq("yonghu_id", yijiedan.getYonghuId())
.eq("fbphone", yijiedan.getFbphone())
.eq("daiquren_id", yijiedan.getDaiqurenId())
.eq("jdphone", yijiedan.getJdphone())
.eq("ddzt_types", yijiedan.getDdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
if(yijiedanEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// yijiedan.set
// }
yijiedanService.insert(yijiedan);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YijiedanEntity yijiedan, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yijiedan:{}",this.getClass().getName(),yijiedan.toString());
//根据字段查询是否有相同数据
Wrapper<YijiedanEntity> queryWrapper = new EntityWrapper<YijiedanEntity>()
.notIn("id",yijiedan.getId())
.eq("odd", yijiedan.getOdd())
.eq("yonghu_id", yijiedan.getYonghuId())
.eq("fbphone", yijiedan.getFbphone())
.eq("daiquren_id", yijiedan.getDaiqurenId())
.eq("jdphone", yijiedan.getJdphone())
.eq("ddzt_types", yijiedan.getDdztTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YijiedanEntity yijiedanEntity = yijiedanService.selectOne(queryWrapper);
yijiedan.setInitiateTime(new Date());
if(yijiedanEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// yijiedan.set
// }
yijiedanService.updateById(yijiedan);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/accomplish")
public R accomplish(@RequestBody Integer ids){
YijiedanEntity yijiedan = yijiedanService.selectById(ids);
if(yijiedan == null){
return R.error();
}
JiedanEntity odd = jiedanService.selectOne(new EntityWrapper<JiedanEntity>().eq("odd", yijiedan.getOdd()));
if(odd == null){
return R.error();
}
if(odd.getKdlxTypes() == 1){
DaiquEntity takecode = daiquService.selectOne(new EntityWrapper().eq("takecode", odd.getJdtakecode()));
if(takecode == null){
return R.error();
}
takecode.setKdztTypes(2);
takecode.setPickupTime(new Date());
daiquService.updateById(takecode);
}else{
DaiquEntity daiqu = new DaiquEntity();
List<ZhandianEntity> zhandian = zhandianService.selectList(null);
int max=zhandian.size()-1,min=0;
int ran2 = (int) (Math.random()*(max-min)+min);
//随机站点
daiqu.setZhandianId(zhandian.get(ran2).getId());
//快递名称
daiqu.setDqname(odd.getDaiqukuaidimc());
//快递大小
daiqu.setKddxTypes(odd.getDx());
daiqu.setKdztTypes(1);
//收件用户id
YonghuEntity name = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("name", odd.getAddresseename()));
daiqu.setYonghuId(name.getId());
//手机号
daiqu.setDqphone(name.getPhone());
//取件码
daiqu.setTakecode(UUID.randomUUID().toString().toString().replace("-","").substring(0,6));
daiquService.insert(daiqu);
}
yijiedan.setDdztTypes(2);//2已完成
yijiedanService.updateById(yijiedan);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
yijiedanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,242 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/yonghu")
public class YonghuController {
private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);
@Autowired
private YonghuService yonghuService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
PageUtils page = yonghuService.queryPage(params);
//字典表数据转换
List<YonghuView> list =(List<YonghuView>)page.getList();
for(YonghuView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YonghuEntity yonghu = yonghuService.selectById(id);
if(yonghu !=null){
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/save")
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("studentnumber", yonghu.getStudentnumber())
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("zhuSuLou", yonghu.getZhuSuLou())
.eq("dormitory", yonghu.getDormitory())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
if(yonghu.getPassword()== "" || yonghu.getPassword() == null){
yonghu.setPassword("123456");
}
yonghu.setRole("用户");
yonghuService.insert(yonghu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
//根据字段查询是否有相同数据
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.notIn("id",yonghu.getId())
.eq("studentnumber", yonghu.getStudentnumber())
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("zhuSuLou", yonghu.getZhuSuLou())
.eq("dormitory", yonghu.getDormitory())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getImgPhoto()) || "null".equals(yonghu.getImgPhoto())){
yonghu.setImgPhoto(null);
}
if(yonghuEntity==null){
yonghuService.updateById(yonghu);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
yonghuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/yanz")
public R delete(Integer ids){
YonghuEntity yonghu = yonghuService.selectById(ids);
if(yonghu!= null){
return R.error();
}
yonghu.setYanzheng(1);
yonghuService.updateById(yonghu);
return R.ok();
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String role, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(yonghu==null || !yonghu.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
if(yonghu.getYanzheng() != 1){
return R.error("还未通过验证请耐心等待");
}
if(!role.equals(yonghu.getRole())){
return R.error("权限不正确");
}
String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用户");
R r = R.ok();
r.put("token", token);
r.put("role","用户");
r.put("userId",yonghu.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YonghuEntity yonghu){
// ValidatorUtils.validateEntity(user);
if(yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", yonghu.getUsername()).orNew().eq("phone",yonghu.getPhone())) !=null) {
return R.error("用户已存在或手机号身份证号已经被使用");
}
yonghuService.insert(yonghu);
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
YonghuEntity yonghu = yonghuService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
}

@ -0,0 +1,163 @@
package com.controller;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.StringUtil;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ZhandianEntity;
import com.service.ZhandianService;
import com.entity.view.ZhandianView;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/zhandian")
public class ZhandianController {
private static final Logger logger = LoggerFactory.getLogger(ZhandianController.class);
@Autowired
private ZhandianService zhandianService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = zhandianService.queryPage(params);
//字典表数据转换
List<ZhandianView> list =(List<ZhandianView>)page.getList();
for(ZhandianView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ZhandianEntity zhandian = zhandianService.selectById(id);
if(zhandian !=null){
//entity转view
ZhandianView view = new ZhandianView();
BeanUtils.copyProperties( zhandian , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ZhandianEntity zhandian, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,zhandian:{}",this.getClass().getName(),zhandian.toString());
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhandianEntity zhandianEntity = zhandianService.selectOne(queryWrapper);
if(zhandianEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// zhandian.set
// }
zhandianService.insert(zhandian);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ZhandianEntity zhandian, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,zhandian:{}",this.getClass().getName(),zhandian.toString());
//根据字段查询是否有相同数据
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.notIn("id",zhandian.getId())
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhandianEntity zhandianEntity = zhandianService.selectOne(queryWrapper);
if(zhandianEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// zhandian.set
// }
zhandianService.updateById(zhandian);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
zhandianService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,26 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface CommonDao{
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(Map<String, Object> params);
List<String> getFollowByOption2(Map<String, Object> params);
void sh(Map<String, Object> params);
int remindCount(Map<String, Object> params);
Map<String, Object> selectCal(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
}

@ -0,0 +1,13 @@
package com.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.ConfigEntity;
/**
*
*/
public interface ConfigDao extends BaseMapper<ConfigEntity> {
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.DaiquEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DaiquView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DaiquDao extends BaseMapper<DaiquEntity> {
List<DaiquView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.DaiqurenEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DaiqurenView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DaiqurenDao extends BaseMapper<DaiqurenEntity> {
List<DaiqurenView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DictionaryView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface DictionaryDao extends BaseMapper<DictionaryEntity> {
List<DictionaryView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.JiedanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.JiedanView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface JiedanDao extends BaseMapper<JiedanEntity> {
List<JiedanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.TokenEntity;
/**
* token
*/
public interface TokenDao extends BaseMapper<TokenEntity> {
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
List<TokenEntity> selectListView(Pagination page, @Param("ew") Wrapper<TokenEntity> wrapper);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;
/**
*
*/
public interface UserDao extends BaseMapper<UserEntity> {
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
List<UserEntity> selectListView(Pagination page, @Param("ew") Wrapper<UserEntity> wrapper);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.YijiedanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YijiedanView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface YijiedanDao extends BaseMapper<YijiedanEntity> {
List<YijiedanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface YonghuDao extends BaseMapper<YonghuEntity> {
List<YonghuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import com.entity.ZhandianEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.ZhandianView;
/**
* Dao
*
* @author
* @since 2021-03-11
*/
public interface ZhandianDao extends BaseMapper<ZhandianEntity> {
List<ZhandianView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,55 @@
package com.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* @author yangliyuan
* @version 202027 8:36:05
* :
*/
@TableName("config")
public class ConfigEntity implements Serializable{
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* key
*/
private String name;
/**
* value
*/
private String value;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,274 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiqu")
public class DaiquEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public DaiquEntity() {
}
public DaiquEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "dqname")
private String dqname;
/**
*
*/
@TableField(value = "zhandian_id")
private Integer zhandianId;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "kddx_types")
private Integer kddxTypes;
/**
*
*/
@TableField(value = "dqphone")
private String dqphone;
/**
*
*/
@TableField(value = "takecode")
private String takecode;
/**
*
*/
@TableField(value = "kdzt_types")
private Integer kdztTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy年MM月dd日 HH时mm分")
@DateTimeFormat
@TableField(value = "pickup_time",fill = FieldFill.UPDATE)
private Date pickupTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDqname() {
return dqname;
}
/**
*
*/
public void setDqname(String dqname) {
this.dqname = dqname;
}
/**
*
*/
public Integer getZhandianId() {
return zhandianId;
}
/**
*
*/
public void setZhandianId(Integer zhandianId) {
this.zhandianId = zhandianId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getKddxTypes() {
return kddxTypes;
}
/**
*
*/
public void setKddxTypes(Integer kddxTypes) {
this.kddxTypes = kddxTypes;
}
/**
*
*/
public String getDqphone() {
return dqphone;
}
/**
*
*/
public void setDqphone(String dqphone) {
this.dqphone = dqphone;
}
/**
*
*/
public String getTakecode() {
return takecode;
}
/**
*
*/
public void setTakecode(String takecode) {
this.takecode = takecode;
}
/**
*
*/
public Integer getKdztTypes() {
return kdztTypes;
}
/**
*
*/
public void setKdztTypes(Integer kdztTypes) {
this.kdztTypes = kdztTypes;
}
/**
*
*/
public Date getPickupTime() {
return pickupTime;
}
/**
*
*/
public void setPickupTime(Date pickupTime) {
this.pickupTime = pickupTime;
}
@Override
public String toString() {
return "Daiqu{" +
"id=" + id +
", dqname=" + dqname +
", zhandianId=" + zhandianId +
", yonghuId=" + yonghuId +
", kddxTypes=" + kddxTypes +
", dqphone=" + dqphone +
", takecode=" + takecode +
", kdztTypes=" + kdztTypes +
", pickupTime=" + pickupTime +
"}";
}
}

@ -0,0 +1,248 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiquren")
public class DaiqurenEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public DaiqurenEntity() {
}
public DaiqurenEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "name")
private String name;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@TableField(value = "img_photo")
private String imgPhoto;
/**
*
*/
@TableField(value = "phone")
private String phone;
/**
*
*/
@TableField(value = "role")
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
@Override
public String toString() {
return "Daiquren{" +
"id=" + id +
", name=" + name +
", username=" + username +
", password=" + password +
", sexTypes=" + sexTypes +
", imgPhoto=" + imgPhoto +
", phone=" + phone +
", role=" + role +
"}";
}
}

@ -0,0 +1,226 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("dictionary")
public class DictionaryEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public DictionaryEntity() {
}
public DictionaryEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "dic_code")
private String dicCode;
/**
*
*/
@TableField(value = "dic_name")
private String dicName;
/**
*
*/
@TableField(value = "code_index")
private Integer codeIndex;
/**
*
*/
@TableField(value = "index_name")
private String indexName;
/**
* id
*/
@TableField(value = "super_id")
private Integer superId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Dictionary{" +
"id=" + id +
", dicCode=" + dicCode +
", dicName=" + dicName +
", codeIndex=" + codeIndex +
", indexName=" + indexName +
", superId=" + superId +
", createTime=" + createTime +
"}";
}
}

@ -0,0 +1,52 @@
package com.entity;
/**
*
*/
public class EIException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String msg;
private int code = 500;
public EIException(String msg) {
super(msg);
this.msg = msg;
}
public EIException(String msg, Throwable e) {
super(msg, e);
this.msg = msg;
}
public EIException(String msg, int code) {
super(msg);
this.msg = msg;
this.code = code;
}
public EIException(String msg, int code, Throwable e) {
super(msg, e);
this.msg = msg;
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,328 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("jiedan")
public class JiedanEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public JiedanEntity() {
}
public JiedanEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "odd")
private String odd;
/**
*
*/
@TableField(value = "dx")
private Integer dx;
/**
*
*/
@TableField(value = "daiqukuaidimc")
private String daiqukuaidimc;
public String getDaiqukuaidimc() {
return daiqukuaidimc;
}
public void setDaiqukuaidimc(String daiqukuaidimc) {
this.daiqukuaidimc = daiqukuaidimc;
}
/**
*
*/
@TableField(value = "jdyonghu_id")
private Integer jdyonghuId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "initiate_time",fill = FieldFill.UPDATE)
private Date initiateTime;
/**
*
*/
@TableField(value = "addresseename")
private String addresseename;
/**
*
*/
@TableField(value = "jdphone")
private String jdphone;
/**
*
*/
@TableField(value = "jdaddressee")
private String jdaddressee;
/**
* (/)
*/
@TableField(value = "jdtakecode")
private String jdtakecode;
/**
*
*/
@TableField(value = "jdzt_types")
private Integer jdztTypes;
/**
*
*/
@TableField(value = "kdlx_types")
private Integer kdlxTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
/**
*
*/
public Integer getJdyonghuId() {
return jdyonghuId;
}
/**
*
*/
public void setJdyonghuId(Integer jdyonghuId) {
this.jdyonghuId = jdyonghuId;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public String getAddresseename() {
return addresseename;
}
/**
*
*/
public void setAddresseename(String addresseename) {
this.addresseename = addresseename;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public String getJdaddressee() {
return jdaddressee;
}
/**
*
*/
public void setJdaddressee(String jdaddressee) {
this.jdaddressee = jdaddressee;
}
/**
* (/)
*/
public String getJdtakecode() {
return jdtakecode;
}
public Integer getDx() {
return dx;
}
public void setDx(Integer dx) {
this.dx = dx;
}
/**
* (/)
*/
public void setJdtakecode(String jdtakecode) {
this.jdtakecode = jdtakecode;
}
/**
*
*/
public Integer getJdztTypes() {
return jdztTypes;
}
/**
*
*/
public void setJdztTypes(Integer jdztTypes) {
this.jdztTypes = jdztTypes;
}
/**
*
*/
public Integer getKdlxTypes() {
return kdlxTypes;
}
/**
*
*/
public void setKdlxTypes(Integer kdlxTypes) {
this.kdlxTypes = kdlxTypes;
}
@Override
public String toString() {
return "Jiedan{" +
"id=" + id +
", odd=" + odd +
", daiqukuaidimc=" + daiqukuaidimc +
", jdyonghuId=" + jdyonghuId +
", initiateTime=" + initiateTime +
", addresseename=" + addresseename +
", jdphone=" + jdphone +
", jdaddressee=" + jdaddressee +
", jdtakecode=" + jdtakecode +
", jdztTypes=" + jdztTypes +
", kdlxTypes=" + kdlxTypes +
"}";
}
}

@ -0,0 +1,132 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* token
*/
@TableName("token")
public class TokenEntity implements Serializable {
private static final Long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
/**
* id
*/
private Integer userid;
/**
*
*/
private String username;
/**
*
*/
private String tablename;
/**
*
*/
private String role;
/**
* token
*/
private String token;
/**
*
*/
private Date expiratedtime;
/**
*
*/
private Date addtime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getToken() {
return token;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public void setToken(String token) {
this.token = token;
}
public Date getExpiratedtime() {
return expiratedtime;
}
public void setExpiratedtime(Date expiratedtime) {
this.expiratedtime = expiratedtime;
}
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public TokenEntity(Integer userid, String username, String tablename,String role, String token, Date expiratedtime) {
super();
this.userid = userid;
this.username = username;
this.tablename = tablename;
this.role = role;
this.token = token;
this.expiratedtime = expiratedtime;
}
public TokenEntity() {
}
}

@ -0,0 +1,73 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*/
@TableName("users")
public class UserEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String role;
private Date addtime;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Integer getId() {
return id;
}
}

@ -0,0 +1,250 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("yijiedan")
public class YijiedanEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public YijiedanEntity() {
}
public YijiedanEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "odd")
private String odd;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "fbphone")
private String fbphone;
/**
*
*/
@TableField(value = "daiquren_id")
private Integer daiqurenId;
/**
*
*/
@TableField(value = "jdphone")
private String jdphone;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "initiate_time",fill = FieldFill.UPDATE)
private Date initiateTime;
/**
*
*/
@TableField(value = "ddzt_types")
private Integer ddztTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getFbphone() {
return fbphone;
}
/**
*
*/
public void setFbphone(String fbphone) {
this.fbphone = fbphone;
}
/**
*
*/
public Integer getDaiqurenId() {
return daiqurenId;
}
/**
*
*/
public void setDaiqurenId(Integer daiqurenId) {
this.daiqurenId = daiqurenId;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public Integer getDdztTypes() {
return ddztTypes;
}
/**
*
*/
public void setDdztTypes(Integer ddztTypes) {
this.ddztTypes = ddztTypes;
}
@Override
public String toString() {
return "Yijiedan{" +
"id=" + id +
", odd=" + odd +
", yonghuId=" + yonghuId +
", fbphone=" + fbphone +
", daiqurenId=" + daiqurenId +
", jdphone=" + jdphone +
", initiateTime=" + initiateTime +
", ddztTypes=" + ddztTypes +
"}";
}
}

@ -0,0 +1,329 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("yonghu")
public class YonghuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public YonghuEntity() {
}
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "studentnumber")
private String studentnumber;
/**
*
*/
@TableField(value = "name")
private String name;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
@TableField(value = "yanzheng")
private Integer yanzheng;
public Integer getYanzheng() {
return yanzheng;
}
public void setYanzheng(Integer yanzheng) {
this.yanzheng = yanzheng;
}
/**
*
*/
@TableField(value = "img_photo")
private String imgPhoto;
/**
*
*/
@TableField(value = "phone")
private String phone;
/**
* 宿
*/
@TableField(value = "zhuSuLou")
private String zhuSuLou;
/**
*
*/
@TableField(value = "dormitory")
private String dormitory;
/**
*
*/
@TableField(value = "role")
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getStudentnumber() {
return studentnumber;
}
/**
*
*/
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 宿
*/
public String getZhuSuLou() {
return zhuSuLou;
}
/**
* 宿
*/
public void setZhuSuLou(String zhuSuLou) {
this.zhuSuLou = zhuSuLou;
}
/**
*
*/
public String getDormitory() {
return dormitory;
}
/**
*
*/
public void setDormitory(String dormitory) {
this.dormitory = dormitory;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
@Override
public String toString() {
return "Yonghu{" +
"id=" + id +
", studentnumber=" + studentnumber +
", name=" + name +
", username=" + username +
", password=" + password +
", sexTypes=" + sexTypes +
", imgPhoto=" + imgPhoto +
", phone=" + phone +
", zhuSuLou=" + zhuSuLou +
", dormitory=" + dormitory +
", role=" + role +
"}";
}
}

@ -0,0 +1,128 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("zhandian")
public class ZhandianEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ZhandianEntity() {
}
public ZhandianEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "zdname")
private String zdname;
/**
*
*/
@TableField(value = "address")
private String address;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getZdname() {
return zdname;
}
/**
*
*/
public void setZdname(String zdname) {
this.zdname = zdname;
}
/**
*
*/
public String getAddress() {
return address;
}
/**
*
*/
public void setAddress(String address) {
this.address = address;
}
@Override
public String toString() {
return "Zhandian{" +
"id=" + id +
", zdname=" + zdname +
", address=" + address +
"}";
}
}

@ -0,0 +1,210 @@
package com.entity.model;
import com.entity.DaiquEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class DaiquModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String dqname;
/**
*
*/
private Integer zhandianId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer kddxTypes;
/**
*
*/
private Integer dqphone;
/**
*
*/
private String takecode;
/**
*
*/
private Integer kdztTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date pickupTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDqname() {
return dqname;
}
/**
*
*/
public void setDqname(String dqname) {
this.dqname = dqname;
}
/**
*
*/
public Integer getZhandianId() {
return zhandianId;
}
/**
*
*/
public void setZhandianId(Integer zhandianId) {
this.zhandianId = zhandianId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getKddxTypes() {
return kddxTypes;
}
/**
*
*/
public void setKddxTypes(Integer kddxTypes) {
this.kddxTypes = kddxTypes;
}
/**
*
*/
public Integer getDqphone() {
return dqphone;
}
/**
*
*/
public void setDqphone(Integer dqphone) {
this.dqphone = dqphone;
}
/**
*
*/
public String getTakecode() {
return takecode;
}
/**
*
*/
public void setTakecode(String takecode) {
this.takecode = takecode;
}
/**
*
*/
public Integer getKdztTypes() {
return kdztTypes;
}
/**
*
*/
public void setKdztTypes(Integer kdztTypes) {
this.kdztTypes = kdztTypes;
}
/**
*
*/
public Date getPickupTime() {
return pickupTime;
}
/**
*
*/
public void setPickupTime(Date pickupTime) {
this.pickupTime = pickupTime;
}
}

@ -0,0 +1,188 @@
package com.entity.model;
import com.entity.DaiqurenEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class DaiqurenModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String imgPhoto;
/**
*
*/
private String phone;
/**
*
*/
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
}

@ -0,0 +1,170 @@
package com.entity.model;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class DictionaryModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String dicCode;
/**
*
*/
private String dicName;
/**
*
*/
private Integer codeIndex;
/**
*
*/
private String indexName;
/**
* id
*/
private Integer superId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,250 @@
package com.entity.model;
import com.entity.JiedanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class JiedanModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String odd;
/**
*
*/
private Integer daiqukuaidiId;
/**
*
*/
private Integer jdyonghuId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date initiateTime;
/**
*
*/
private String addresseename;
/**
*
*/
private String jdphone;
/**
*
*/
private String jdaddressee;
/**
* (/)
*/
private String jdtakecode;
/**
*
*/
private Integer jdztTypes;
/**
*
*/
private Integer kdlxTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
/**
*
*/
public Integer getDaiqukuaidiId() {
return daiqukuaidiId;
}
/**
*
*/
public void setDaiqukuaidiId(Integer daiqukuaidiId) {
this.daiqukuaidiId = daiqukuaidiId;
}
/**
*
*/
public Integer getJdyonghuId() {
return jdyonghuId;
}
/**
*
*/
public void setJdyonghuId(Integer jdyonghuId) {
this.jdyonghuId = jdyonghuId;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public String getAddresseename() {
return addresseename;
}
/**
*
*/
public void setAddresseename(String addresseename) {
this.addresseename = addresseename;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public String getJdaddressee() {
return jdaddressee;
}
/**
*
*/
public void setJdaddressee(String jdaddressee) {
this.jdaddressee = jdaddressee;
}
/**
* (/)
*/
public String getJdtakecode() {
return jdtakecode;
}
/**
* (/)
*/
public void setJdtakecode(String jdtakecode) {
this.jdtakecode = jdtakecode;
}
/**
*
*/
public Integer getJdztTypes() {
return jdztTypes;
}
/**
*
*/
public void setJdztTypes(Integer jdztTypes) {
this.jdztTypes = jdztTypes;
}
/**
*
*/
public Integer getKdlxTypes() {
return kdlxTypes;
}
/**
*
*/
public void setKdlxTypes(Integer kdlxTypes) {
this.kdlxTypes = kdlxTypes;
}
}

@ -0,0 +1,190 @@
package com.entity.model;
import com.entity.YijiedanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class YijiedanModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String odd;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String fbphone;
/**
*
*/
private Integer daiqurenId;
/**
*
*/
private String jdphone;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date initiateTime;
/**
*
*/
private Integer ddztTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getFbphone() {
return fbphone;
}
/**
*
*/
public void setFbphone(String fbphone) {
this.fbphone = fbphone;
}
/**
*
*/
public Integer getDaiqurenId() {
return daiqurenId;
}
/**
*
*/
public void setDaiqurenId(Integer daiqurenId) {
this.daiqurenId = daiqurenId;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public Integer getDdztTypes() {
return ddztTypes;
}
/**
*
*/
public void setDdztTypes(Integer ddztTypes) {
this.ddztTypes = ddztTypes;
}
}

@ -0,0 +1,248 @@
package com.entity.model;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Integer id;
/**
*
*/
private String studentnumber;
/**
*
*/
private String name;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String imgPhoto;
/**
*
*/
private String phone;
/**
* 宿
*/
private String zhuSuLou;
/**
*
*/
private String dormitory;
/**
*
*/
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getStudentnumber() {
return studentnumber;
}
/**
*
*/
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 宿
*/
public String getZhuSuLou() {
return zhuSuLou;
}
/**
* 宿
*/
public void setZhuSuLou(String zhuSuLou) {
this.zhuSuLou = zhuSuLou;
}
/**
*
*/
public String getDormitory() {
return dormitory;
}
/**
*
*/
public void setDormitory(String dormitory) {
this.dormitory = dormitory;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
}

@ -0,0 +1,88 @@
package com.entity.model;
import com.entity.ZhandianEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2021-03-11
*/
public class ZhandianModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String zdname;
/**
*
*/
private String address;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getZdname() {
return zdname;
}
/**
*
*/
public void setZdname(String zdname) {
this.zdname = zdname;
}
/**
*
*/
public String getAddress() {
return address;
}
/**
*
*/
public void setAddress(String address) {
this.address = address;
}
}

@ -0,0 +1,315 @@
package com.entity.view;
import com.entity.DaiquEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiqu")
public class DaiquView extends DaiquEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String kddxValue;
/**
*
*/
private String kdztValue;
//级联表 yonghu
/**
*
*/
private String studentnumber;
/**
*
*/
private String name;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String sexValue;
/**
*
*/
private String imgPhoto;
/**
*
*/
private String phone;
/**
* 宿
*/
private String zhuSuLou;
/**
*
*/
private String dormitory;
/**
*
*/
private String role;
//级联表 zhandian
/**
*
*/
private String zdname;
/**
*
*/
private String address;
public DaiquView() {
}
public DaiquView(DaiquEntity daiquEntity) {
try {
BeanUtils.copyProperties(this, daiquEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getKddxValue() {
return kddxValue;
}
/**
*
*/
public void setKddxValue(String kddxValue) {
this.kddxValue = kddxValue;
}
/**
*
*/
public String getKdztValue() {
return kdztValue;
}
/**
*
*/
public void setKdztValue(String kdztValue) {
this.kdztValue = kdztValue;
}
//级联表的get和set yonghu
/**
*
*/
public String getStudentnumber() {
return studentnumber;
}
/**
*
*/
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getSexValue() {
return sexValue;
}
/**
*
*/
public void setSexValue(String sexValue) {
this.sexValue = sexValue;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 宿
*/
public String getZhuSuLou() {
return zhuSuLou;
}
/**
* 宿
*/
public void setZhuSuLou(String zhuSuLou) {
this.zhuSuLou = zhuSuLou;
}
/**
*
*/
public String getDormitory() {
return dormitory;
}
/**
*
*/
public void setDormitory(String dormitory) {
this.dormitory = dormitory;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
//级联表的get和set zhandian
/**
*
*/
public String getZdname() {
return zdname;
}
/**
*
*/
public void setZdname(String zdname) {
this.zdname = zdname;
}
/**
*
*/
public String getAddress() {
return address;
}
/**
*
*/
public void setAddress(String address) {
this.address = address;
}
}

@ -0,0 +1,67 @@
package com.entity.view;
import com.entity.DaiqurenEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiquren")
public class DaiqurenView extends DaiqurenEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String sexValue;
public DaiqurenView() {
}
public DaiqurenView(DaiqurenEntity daiqurenEntity) {
try {
BeanUtils.copyProperties(this, daiqurenEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getSexValue() {
return sexValue;
}
/**
*
*/
public void setSexValue(String sexValue) {
this.sexValue = sexValue;
}
}

@ -0,0 +1,59 @@
package com.entity.view;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("dictionary")
public class DictionaryView extends DictionaryEntity implements Serializable {
private static final long serialVersionUID = 1L;
public DictionaryView() {
}
public DictionaryView(DictionaryEntity dictionaryEntity) {
try {
BeanUtils.copyProperties(this, dictionaryEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,107 @@
package com.entity.view;
import com.entity.JiedanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("jiedan")
public class JiedanView extends JiedanEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String jdztValue;
/**
*
*/
private String kdlxValue;
private String fbrname;
public JiedanView() {
}
public JiedanView(JiedanEntity jiedanEntity) {
try {
BeanUtils.copyProperties(this, jiedanEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public String getFbrname() {
return fbrname;
}
public void setFbrname(String fbrname) {
this.fbrname = fbrname;
}
/**
*
*/
public String getJdztValue() {
return jdztValue;
}
/**
*
*/
public void setJdztValue(String jdztValue) {
this.jdztValue = jdztValue;
}
/**
*
*/
public String getKdlxValue() {
return kdlxValue;
}
/**
*
*/
public void setKdlxValue(String kdlxValue) {
this.kdlxValue = kdlxValue;
}
}

@ -0,0 +1,269 @@
package com.entity.view;
import com.entity.YijiedanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("yijiedan")
public class YijiedanView extends YijiedanEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String ddztValue;
//级联表 daiquren
/**
*
*/
private String yhname;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String sexValue;
/**
*
*/
private String imgPhoto;
/**
*
*/
private String phone;
/**
*
*/
private String role;
//级联表 yonghu
/**
*
*/
private String studentnumber;
private String name;
/**
* 宿
*/
private String zhuSuLou;
/**
*
*/
private String dormitory;
public YijiedanView() {
}
public YijiedanView(YijiedanEntity yijiedanEntity) {
try {
BeanUtils.copyProperties(this, yijiedanEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getDdztValue() {
return ddztValue;
}
/**
*
*/
public void setDdztValue(String ddztValue) {
this.ddztValue = ddztValue;
}
//级联表的get和set yonghu
/**
*
*/
public String getStudentnumber() {
return studentnumber;
}
/**
*
*/
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
public String getYhname() {
return yhname;
}
public void setYhname(String yhname) {
this.yhname = yhname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getSexValue() {
return sexValue;
}
/**
*
*/
public void setSexValue(String sexValue) {
this.sexValue = sexValue;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 宿
*/
public String getZhuSuLou() {
return zhuSuLou;
}
/**
* 宿
*/
public void setZhuSuLou(String zhuSuLou) {
this.zhuSuLou = zhuSuLou;
}
/**
*
*/
public String getDormitory() {
return dormitory;
}
/**
*
*/
public void setDormitory(String dormitory) {
this.dormitory = dormitory;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
}

@ -0,0 +1,67 @@
package com.entity.view;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("yonghu")
public class YonghuView extends YonghuEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String sexValue;
public YonghuView() {
}
public YonghuView(YonghuEntity yonghuEntity) {
try {
BeanUtils.copyProperties(this, yonghuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getSexValue() {
return sexValue;
}
/**
*
*/
public void setSexValue(String sexValue) {
this.sexValue = sexValue;
}
}

@ -0,0 +1,51 @@
package com.entity.view;
import com.entity.ZhandianEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
* @author
* @email
* @date 2021-03-11
*/
@TableName("zhandian")
public class ZhandianView extends ZhandianEntity implements Serializable {
private static final long serialVersionUID = 1L;
public ZhandianView() {
}
public ZhandianView(ZhandianEntity zhandianEntity) {
try {
BeanUtils.copyProperties(this, zhandianEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,235 @@
package com.entity.vo;
import com.entity.DaiquEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiqu")
public class DaiquVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "dqname")
private String dqname;
/**
*
*/
@TableField(value = "zhandian_id")
private Integer zhandianId;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "kddx_types")
private Integer kddxTypes;
/**
*
*/
@TableField(value = "dqphone")
private Integer dqphone;
/**
*
*/
@TableField(value = "takecode")
private String takecode;
/**
*
*/
@TableField(value = "kdzt_types")
private Integer kdztTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "pickup_time")
private Date pickupTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDqname() {
return dqname;
}
/**
*
*/
public void setDqname(String dqname) {
this.dqname = dqname;
}
/**
*
*/
public Integer getZhandianId() {
return zhandianId;
}
/**
*
*/
public void setZhandianId(Integer zhandianId) {
this.zhandianId = zhandianId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getKddxTypes() {
return kddxTypes;
}
/**
*
*/
public void setKddxTypes(Integer kddxTypes) {
this.kddxTypes = kddxTypes;
}
/**
*
*/
public Integer getDqphone() {
return dqphone;
}
/**
*
*/
public void setDqphone(Integer dqphone) {
this.dqphone = dqphone;
}
/**
*
*/
public String getTakecode() {
return takecode;
}
/**
*
*/
public void setTakecode(String takecode) {
this.takecode = takecode;
}
/**
*
*/
public Integer getKdztTypes() {
return kdztTypes;
}
/**
*
*/
public void setKdztTypes(Integer kdztTypes) {
this.kdztTypes = kdztTypes;
}
/**
*
*/
public Date getPickupTime() {
return pickupTime;
}
/**
*
*/
public void setPickupTime(Date pickupTime) {
this.pickupTime = pickupTime;
}
}

@ -0,0 +1,210 @@
package com.entity.vo;
import com.entity.DaiqurenEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("daiquren")
public class DaiqurenVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "name")
private String name;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@TableField(value = "img_photo")
private String imgPhoto;
/**
*
*/
@TableField(value = "phone")
private String phone;
/**
*
*/
@TableField(value = "role")
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
}

@ -0,0 +1,189 @@
package com.entity.vo;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("dictionary")
public class DictionaryVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "dic_code")
private String dicCode;
/**
*
*/
@TableField(value = "dic_name")
private String dicName;
/**
*
*/
@TableField(value = "code_index")
private Integer codeIndex;
/**
*
*/
@TableField(value = "index_name")
private String indexName;
/**
* id
*/
@TableField(value = "super_id")
private Integer superId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time")
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,275 @@
package com.entity.vo;
import com.entity.JiedanEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("jiedan")
public class JiedanVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "odd")
private String odd;
/**
*
*/
@TableField(value = "daiqukuaidimc")
private Integer daiqukuaidimc;
/**
*
*/
@TableField(value = "jdyonghu_id")
private Integer jdyonghuId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "initiate_time")
private Date initiateTime;
/**
*
*/
@TableField(value = "addresseename")
private String addresseename;
/**
*
*/
@TableField(value = "jdphone")
private String jdphone;
/**
*
*/
@TableField(value = "jdaddressee")
private String jdaddressee;
/**
* (/)
*/
@TableField(value = "jdtakecode")
private String jdtakecode;
/**
*
*/
@TableField(value = "jdzt_types")
private Integer jdztTypes;
/**
*
*/
@TableField(value = "kdlx_types")
private Integer kdlxTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
public Integer getDaiqukuaidimc() {
return daiqukuaidimc;
}
public void setDaiqukuaidimc(Integer daiqukuaidimc) {
this.daiqukuaidimc = daiqukuaidimc;
}
/**
*
*/
public Integer getJdyonghuId() {
return jdyonghuId;
}
/**
*
*/
public void setJdyonghuId(Integer jdyonghuId) {
this.jdyonghuId = jdyonghuId;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public String getAddresseename() {
return addresseename;
}
/**
*
*/
public void setAddresseename(String addresseename) {
this.addresseename = addresseename;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public String getJdaddressee() {
return jdaddressee;
}
/**
*
*/
public void setJdaddressee(String jdaddressee) {
this.jdaddressee = jdaddressee;
}
/**
* (/)
*/
public String getJdtakecode() {
return jdtakecode;
}
/**
* (/)
*/
public void setJdtakecode(String jdtakecode) {
this.jdtakecode = jdtakecode;
}
/**
*
*/
public Integer getJdztTypes() {
return jdztTypes;
}
/**
*
*/
public void setJdztTypes(Integer jdztTypes) {
this.jdztTypes = jdztTypes;
}
/**
*
*/
public Integer getKdlxTypes() {
return kdlxTypes;
}
/**
*
*/
public void setKdlxTypes(Integer kdlxTypes) {
this.kdlxTypes = kdlxTypes;
}
}

@ -0,0 +1,212 @@
package com.entity.vo;
import com.entity.YijiedanEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("yijiedan")
public class YijiedanVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "odd")
private String odd;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "fbphone")
private String fbphone;
/**
*
*/
@TableField(value = "daiquren_id")
private Integer daiqurenId;
/**
*
*/
@TableField(value = "jdphone")
private String jdphone;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "initiate_time")
private Date initiateTime;
/**
*
*/
@TableField(value = "ddzt_types")
private Integer ddztTypes;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getOdd() {
return odd;
}
/**
*
*/
public void setOdd(String odd) {
this.odd = odd;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getFbphone() {
return fbphone;
}
/**
*
*/
public void setFbphone(String fbphone) {
this.fbphone = fbphone;
}
/**
*
*/
public Integer getDaiqurenId() {
return daiqurenId;
}
/**
*
*/
public void setDaiqurenId(Integer daiqurenId) {
this.daiqurenId = daiqurenId;
}
/**
*
*/
public String getJdphone() {
return jdphone;
}
/**
*
*/
public void setJdphone(String jdphone) {
this.jdphone = jdphone;
}
/**
*
*/
public Date getInitiateTime() {
return initiateTime;
}
/**
*
*/
public void setInitiateTime(Date initiateTime) {
this.initiateTime = initiateTime;
}
/**
*
*/
public Integer getDdztTypes() {
return ddztTypes;
}
/**
*
*/
public void setDdztTypes(Integer ddztTypes) {
this.ddztTypes = ddztTypes;
}
}

@ -0,0 +1,279 @@
package com.entity.vo;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("yonghu")
public class YonghuVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "studentnumber")
private String studentnumber;
/**
*
*/
@TableField(value = "name")
private String name;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@TableField(value = "img_photo")
private String imgPhoto;
/**
*
*/
@TableField(value = "phone")
private String phone;
/**
* 宿
*/
@TableField(value = "zhuSuLou")
private String zhuSuLou;
/**
*
*/
@TableField(value = "dormitory")
private String dormitory;
/**
*
*/
@TableField(value = "role")
private String role;
/**
* id
*/
public Integer getId() {
return id;
}
/**
* id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getStudentnumber() {
return studentnumber;
}
/**
*
*/
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getImgPhoto() {
return imgPhoto;
}
/**
*
*/
public void setImgPhoto(String imgPhoto) {
this.imgPhoto = imgPhoto;
}
/**
*
*/
public String getPhone() {
return phone;
}
/**
*
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 宿
*/
public String getZhuSuLou() {
return zhuSuLou;
}
/**
* 宿
*/
public void setZhuSuLou(String zhuSuLou) {
this.zhuSuLou = zhuSuLou;
}
/**
*
*/
public String getDormitory() {
return dormitory;
}
/**
*
*/
public void setDormitory(String dormitory) {
this.dormitory = dormitory;
}
/**
*
*/
public String getRole() {
return role;
}
/**
*
*/
public void setRole(String role) {
this.role = role;
}
}

@ -0,0 +1,95 @@
package com.entity.vo;
import com.entity.ZhandianEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2021-03-11
*/
@TableName("zhandian")
public class ZhandianVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "zdname")
private String zdname;
/**
*
*/
@TableField(value = "address")
private String address;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getZdname() {
return zdname;
}
/**
*
*/
public void setZdname(String zdname) {
this.zdname = zdname;
}
/**
*
*/
public String getAddress() {
return address;
}
/**
*
*/
public void setAddress(String address) {
this.address = address;
}
}

@ -0,0 +1,122 @@
package com.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
/**
* (Token)
* Token访
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
// 定义用于在请求头中存储Token的键名
public static final String LOGIN_TOKEN_KEY = "Token";
// 自动注入TokenService用于处理Token相关业务
@Autowired
private TokenService tokenService;
/**
*
* @param request HttpServletRequest
* @param response HttpServletResponse
* @param handler HandlerMethod
* @return truefalse
* @throws Exception
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 支持跨域请求,设置相关的响应头信息
// 设置允许的请求方法
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
// 设置预检请求的有效期
response.setHeader("Access-Control-Max-Age", "3600");
// 设置是否允许携带认证信息如Cookie
response.setHeader("Access-Control-Allow-Credentials", "true");
// 设置允许的请求头字段
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
// 设置允许的来源使用请求头中的Origin字段值
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation;
// 判断处理器是否为HandlerMethod类型
if (handler instanceof HandlerMethod) {
// 如果是获取该方法上的IgnoreAuth注解
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
// 如果不是直接返回true可能是静态资源等不需要权限验证的情况
return true;
}
// 从请求头中获取Token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
*
*/
// 如果方法上存在IgnoreAuth注解说明不需要验证权限直接返回true
if (annotation!= null) {
return true;
}
TokenEntity tokenEntity = null;
// 如果获取到的Token不为空
if (StringUtils.isNotBlank(token)) {
// 通过TokenService获取Token对应的TokenEntity对象
tokenEntity = tokenService.getTokenEntity(token);
}
// 如果获取到了有效的TokenEntity对象
if (tokenEntity!= null) {
// 将用户ID存入请求的Session中
request.getSession().setAttribute("userId", tokenEntity.getUserid());
// 将用户角色存入请求的Session中
request.getSession().setAttribute("role", tokenEntity.getRole());
// 将表名存入请求的Session中
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
// 将用户名存入请求的Session中
request.getSession().setAttribute("username", tokenEntity.getUsername());
// 验证通过返回true
return true;
}
PrintWriter writer = null;
// 设置响应的字符编码为UTF-8
response.setCharacterEncoding("UTF-8");
// 设置响应的内容类型为application/json并指定字符编码为UTF-8
response.setContentType("application/json; charset=utf-8");
try {
// 获取用于向客户端写入响应的PrintWriter对象
writer = response.getWriter();
// 将包含错误信息的R对象转换为JSON字符串并写入响应
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
// 确保在使用完PrintWriter后关闭它
if (writer!= null) {
writer.close();
}
}
// throw new EIException("请先登录", 401);
// 验证不通过返回false
return false;
}
}

@ -0,0 +1,53 @@
package com.model.enums;
// 导入Serializable接口该接口用于标记可序列化的类使得对象可以在网络传输或保存到文件中
import java.io.Serializable;
// 导入MyBatis-Plus的IEnum接口用于将枚举类型映射到数据库字段
import com.baomidou.mybatisplus.enums.IEnum;
/**
* IEnum spring-mybatis.xml typeEnumsPackage
* IEnum
*/
public enum TypeEnum implements IEnum {
// 定义枚举常量表示禁用状态对应的整数值为0描述为"禁用"
DISABLED(0, "禁用"),
// 定义枚举常量表示正常状态对应的整数值为1描述为"正常"
NORMAL(1, "正常");
// 定义一个私有常量,用于存储枚举常量对应的整数值,该值将与数据库字段对应
private final int value;
// 定义一个私有常量,用于存储枚举常量的中文描述信息
private final String desc;
/**
*
* @param value
* @param desc
*/
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
/**
* IEnum
*
* @return
*/
@Override
public Serializable getValue() {
return this.value;
}
/**
*
* 使JacksonJSON使 @JsonValue JSON
* @return
*/
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
}

@ -0,0 +1,60 @@
package com.service;
// 导入List接口用于存储有序集合
import java.util.List;
// 导入Map接口用于存储键值对映射
import java.util.Map;
/**
*
*/
public interface CommonService {
/**
*
* @param params Map
* @return
*/
List<String> getOption(Map<String, Object> params);
/**
*
* @param params Map
* @return Map
*/
Map<String, Object> getFollowByOption(Map<String, Object> params);
/**
* sh
* @param params Map
*/
void sh(Map<String, Object> params);
/**
*
* @param params Map
* @return
*/
int remindCount(Map<String, Object> params);
/**
*
* @param params Map
* @return Map
*/
Map<String, Object> selectCal(Map<String, Object> params);
/**
*
* @param params Map
* @return Map
*/
List<Map<String, Object>> selectGroup(Map<String, Object> params);
/**
*
* @param params Map
* @return Map
*/
List<Map<String, Object>> selectValue(Map<String, Object> params);
}

@ -0,0 +1,18 @@
package com.service;
import java.util.Map;
import com.baomidou.mybatisplus.service.IService;
import com.entity.ConfigEntity;
import com.utils.PageUtils;
/**
*
* @author yangliyuan
* @date 20191010 9:18:20
*/
public interface ConfigService extends IService<ConfigEntity> {
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DaiquEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface DaiquService extends IService<DaiquEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DaiqurenEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface DaiqurenService extends IService<DaiqurenEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,26 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DictionaryEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface DictionaryService extends IService<DictionaryEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
/**
*
* @param obj
*/
void dictionaryConvert(Object obj);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.JiedanEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface JiedanService extends IService<JiedanEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,28 @@
package com.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.TokenEntity;
import com.utils.PageUtils;
/**
* token
* @author yangliyuan
* @date 20191010 9:18:20
*/
public interface TokenService extends IService<TokenEntity> {
PageUtils queryPage(Map<String, Object> params);
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
PageUtils queryPage(Map<String, Object> params, Wrapper<TokenEntity> wrapper);
String generateToken(Integer userid, String username, String tableName, String role);
TokenEntity getTokenEntity(String token);
}

@ -0,0 +1,49 @@
package com.service;
// 导入List接口用于表示有序集合可存储多个元素
import java.util.List;
// 导入Map接口用于存储键值对键唯一值可重复
import java.util.Map;
// 导入MyBatis的Param注解用于在Mapper方法中为参数命名
import org.apache.ibatis.annotations.Param;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供了常用的CRUD操作方法
import com.baomidou.mybatisplus.service.IService;
// 导入用户实体类,用于表示系统用户的相关属性
import com.entity.UserEntity;
// 导入分页工具类,用于处理分页查询结果
import com.utils.PageUtils;
/**
*
* @author yangliyuan
* @date 20191010 9:18:20
* MyBatis-PlusIService使CRUD
*/
public interface UserService extends IService<UserEntity> {
/**
*
* @param params Map
* @return PageUtils
*/
PageUtils queryPage(Map<String, Object> params);
/**
*
* @param wrapper Wrapper
* @return UserEntity
*/
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
/**
*
* @param params Map
* @param wrapper Wrapper
* @return PageUtils
*/
PageUtils queryPage(Map<String, Object> params, Wrapper<UserEntity> wrapper);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YijiedanEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface YijiedanService extends IService<YijiedanEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YonghuEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface YonghuService extends IService<YonghuEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,21 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.ZhandianEntity;
import java.util.Map;
/**
*
* @author
* @since 2021-03-11
*/
public interface ZhandianService extends IService<ZhandianEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,61 @@
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dao.CommonDao;
import com.service.CommonService;
/**
*
* @author yangliyuan
* @date 20191010 9:17:59
*/
@Service("commonService")
public class CommonServiceImpl implements CommonService {
@Autowired
private CommonDao commonDao;
@Override
public List<String> getOption(Map<String, Object> params) {
return commonDao.getOption(params);
}
@Override
public Map<String, Object> getFollowByOption(Map<String, Object> params) {
return commonDao.getFollowByOption(params);
}
@Override
public void sh(Map<String, Object> params) {
commonDao.sh(params);
}
@Override
public int remindCount(Map<String, Object> params) {
return commonDao.remindCount(params);
}
@Override
public Map<String, Object> selectCal(Map<String, Object> params) {
return commonDao.selectCal(params);
}
@Override
public List<Map<String, Object>> selectGroup(Map<String, Object> params) {
return commonDao.selectGroup(params);
}
@Override
public List<Map<String, Object>> selectValue(Map<String, Object> params) {
return commonDao.selectValue(params);
}
}

@ -0,0 +1,35 @@
package com.service.impl;
import java.util.Map;
import com.entity.ConfigEntity;
import com.utils.Query;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ConfigDao;
import com.service.ConfigService;
import com.utils.PageUtils;
import org.springframework.transaction.annotation.Transactional;
/**
*
* @author yangliyuan
* @date 20191010 9:17:59
*/
@Service("configService")
public class ConfigServiceImpl extends ServiceImpl<ConfigDao, ConfigEntity> implements ConfigService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<ConfigEntity> page = this.selectPage(
new Query<ConfigEntity>(params).getPage(),
new EntityWrapper<ConfigEntity>()
);
return new PageUtils(page);
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.DaiquDao;
import com.entity.DaiquEntity;
import com.service.DaiquService;
import com.entity.view.DaiquView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("daiquService")
@Transactional
public class DaiquServiceImpl extends ServiceImpl<DaiquDao, DaiquEntity> implements DaiquService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<DaiquView> page =new Query<DaiquView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.DaiqurenDao;
import com.entity.DaiqurenEntity;
import com.service.DaiqurenService;
import com.entity.view.DaiqurenView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("daiqurenService")
@Transactional
public class DaiqurenServiceImpl extends ServiceImpl<DaiqurenDao, DaiqurenEntity> implements DaiqurenService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<DaiqurenView> page =new Query<DaiqurenView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,120 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.DictionaryDao;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.entity.view.DictionaryView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("dictionaryService")
@Transactional
public class DictionaryServiceImpl extends ServiceImpl<DictionaryDao, DictionaryEntity> implements DictionaryService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<DictionaryView> page =new Query<DictionaryView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
/**
*
* @param obj view
*/
public void dictionaryConvert(Object obj) {
try {
if (obj == null) return;
//当前view和entity中的所有types的字段
List<String> fieldNameList = new ArrayList<>();
Class tempClass = obj.getClass();
while (tempClass !=null) {
Field[] declaredFields = tempClass.getDeclaredFields();
for (Field f : declaredFields) {
f.setAccessible(true);
if (f.getType().getName().equals("java.lang.Integer") && f.getName().contains("Types")) {
fieldNameList.add(f.getName());
}
}
tempClass = tempClass.getSuperclass(); //得到父类,然后赋给自己
}
// 获取监听器中的字典表
ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
//通过Types的值给Value字段赋值
for (String s : fieldNameList) {
Field types = null;
if(hasField(obj.getClass(),s)){
//判断view中有没有这个字段,有就通过反射取出字段
types= obj.getClass().getDeclaredField(s);//获取Types私有字段
}else{
//本表中没有这个字段,说明它是父表中的字段,也就是entity中的字段,从entity中取值
types=obj.getClass().getSuperclass().getDeclaredField(s);
}
Field value = obj.getClass().getDeclaredField(s.replace("Types", "Value"));//获取value私有字段
//设置权限
types.setAccessible(true);
value.setAccessible(true);
//赋值
if (StringUtil.isNotEmpty(String.valueOf(types.get(obj)))) { //types的值不为空
int i = Integer.parseInt(String.valueOf(types.get(obj)));//type
String s1 = s.replace("Types", "_types");
String s2 = dictionaryMap.get(s1).get(i);
value.set(obj, s2);
} else {
new Exception("字典表赋值出现问题::::"+value.getName());
value.set(obj, "");
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
* @param c
* @param fieldName
* @return
*/
public boolean hasField(Class c, String fieldName){
Field[] fields = c.getDeclaredFields();
for (Field f : fields) {
if (fieldName.equals(f.getName())) {
return true;
}
}
return false;
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.JiedanDao;
import com.entity.JiedanEntity;
import com.service.JiedanService;
import com.entity.view.JiedanView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("jiedanService")
@Transactional
public class JiedanServiceImpl extends ServiceImpl<JiedanDao, JiedanEntity> implements JiedanService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<JiedanView> page =new Query<JiedanView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,81 @@
package com.service.impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.TokenDao;
import com.entity.TokenEntity;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.CommonUtil;
import com.utils.PageUtils;
import com.utils.Query;
/**
* token
* @author yangliyuan
* @date 20191010 9:17:59
*/
@Service("tokenService")
public class TokenServiceImpl extends ServiceImpl<TokenDao, TokenEntity> implements TokenService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<TokenEntity> page = this.selectPage(
new Query<TokenEntity>(params).getPage(),
new EntityWrapper<TokenEntity>()
);
return new PageUtils(page);
}
@Override
public List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<TokenEntity> wrapper) {
Page<TokenEntity> page =new Query<TokenEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public String generateToken(Integer userid,String username, String tableName, String role) {
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));
String token = CommonUtil.getRandomString(32);
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.HOUR_OF_DAY, 1);
if(tokenEntity!=null) {
tokenEntity.setToken(token);
tokenEntity.setExpiratedtime(cal.getTime());
this.updateById(tokenEntity);
} else {
this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));
}
return token;
}
@Override
public TokenEntity getTokenEntity(String token) {
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("token", token));
if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime()<new Date().getTime()) {
return null;
}
return tokenEntity;
}
}

@ -0,0 +1,51 @@
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.UserDao;
import com.entity.UserEntity;
import com.service.UserService;
import com.utils.PageUtils;
import com.utils.Query;
/**
*
* @author yangliyuan
* @date 20191010 9:17:59
*/
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<UserEntity> page = this.selectPage(
new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>()
);
return new PageUtils(page);
}
@Override
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<UserEntity> wrapper) {
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.YijiedanDao;
import com.entity.YijiedanEntity;
import com.service.YijiedanService;
import com.entity.view.YijiedanView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("yijiedanService")
@Transactional
public class YijiedanServiceImpl extends ServiceImpl<YijiedanDao, YijiedanEntity> implements YijiedanService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<YijiedanView> page =new Query<YijiedanView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.YonghuDao;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("yonghuService")
@Transactional
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<YonghuView> page =new Query<YonghuView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,41 @@
package com.service.impl;
import com.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.dao.ZhandianDao;
import com.entity.ZhandianEntity;
import com.service.ZhandianService;
import com.entity.view.ZhandianView;
/**
*
* @author
* @since 2021-03-11
*/
@Service("zhandianService")
@Transactional
public class ZhandianServiceImpl extends ServiceImpl<ZhandianDao, ZhandianEntity> implements ZhandianService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
if(params != null && (params.get("limit") == null || params.get("page") == null)){
params.put("page","1");
params.put("limit","10");
}
Page<ZhandianView> page =new Query<ZhandianView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,122 @@
package com.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
/**
* @author yangliyuan
* @version 202027 9:37:05
* : API访token
*/
public class BaiduUtil {
/**
*
* @param key APIakAPI Key
* @param lng
* @param lat
* @return Mapnull
*/
public static Map<String, String> getCityByLonLat(String key, String lng, String lat) {
// 将纬度和经度组合成location字符串格式为 "纬度,经度"
String location = lat + "," + lng;
try {
// 拼装请求百度地图逆地理编码API的URL
String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location;
// 调用HttpClientUtils的doGet方法发送GET请求并获取响应结果
String result = HttpClientUtils.doGet(url);
// 将响应结果字符串转换为JSONObject对象
JSONObject o = new JSONObject(result);
// 创建一个HashMap用于存储省、市、区、街道信息
Map<String, String> area = new HashMap<>();
// 从响应结果中提取省份信息并放入Map中
area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province"));
// 从响应结果中提取城市信息并放入Map中
area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city"));
// 从响应结果中提取区域信息并放入Map中
area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
// 从响应结果中提取街道信息并放入Map中
area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
// 返回包含省、市、区、街道信息的Map
return area;
} catch (Exception e) {
// 若出现异常,打印异常堆栈信息
e.printStackTrace();
}
// 若出现异常返回null
return null;
}
/**
* API访token
* token.
* @param ak - API Key
* @param sk - Securet Key
* @return assess_token 访tokennull
*/
public static String getAuth(String ak, String sk) {
// 定义获取token的请求地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
// 拼接完整的获取token的URL
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
// 创建URL对象
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
// 设置请求方法为GET
connection.setRequestMethod("GET");
// 建立连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段并打印
for (String key : map.keySet()) {
System.err.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
// 用于存储响应结果的字符串
String result = "";
// 用于临时存储每行响应内容的字符串
String line;
// 逐行读取响应内容并拼接成完整的结果
while ((line = in.readLine()) != null) {
result += line;
}
/**
*
*/
// 打印响应结果
System.err.println("result:" + result);
// 将响应结果字符串转换为JSONObject对象
org.json.JSONObject jsonObject = new org.json.JSONObject(result);
// 从JSONObject中提取access_token字段的值
String access_token = jsonObject.getString("access_token");
// 返回access_token
return access_token;
} catch (Exception e) {
// 若获取token失败打印错误提示信息
System.err.printf("获取token失败");
// 打印异常堆栈信息到标准错误输出
e.printStackTrace(System.err);
}
// 若获取token失败返回null
return null;
}
}

@ -0,0 +1,33 @@
package com.utils;
// 导入Random类用于生成随机数
import java.util.Random;
/**
*
*/
public class CommonUtil {
/**
*
*
* @param num
* @return
*/
public static String getRandomString(Integer num) {
// 定义一个包含所有可能字符的基础字符串,由小写字母和数字组成
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
// 创建一个Random对象用于生成随机数
Random random = new Random();
// 创建一个StringBuffer对象用于动态拼接字符
StringBuffer sb = new StringBuffer();
// 循环num次每次生成一个随机字符并添加到StringBuffer中
for (int i = 0; i < num; i++) {
// 生成一个0到base字符串长度之间的随机整数
int number = random.nextInt(base.length());
// 根据随机整数从base字符串中取出对应的字符并添加到StringBuffer中
sb.append(base.charAt(number));
}
// 将StringBuffer对象转换为字符串并返回
return sb.toString();
}
}

@ -0,0 +1,29 @@
package com.utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* @author yangliyuan
* @version 202027 8:01:14
* :
*/
public class FileUtil {
public static byte[] FileToByte(File file) throws IOException {
// 将数据转为流
@SuppressWarnings("resource")
InputStream content = new FileInputStream(file);
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc = 0;
while ((rc = content.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
// 获得二进制数组
return swapStream.toByteArray();
}
}

@ -0,0 +1,56 @@
package com.utils;
// 导入BufferedReader类用于缓冲字符输入流提高读取效率
import java.io.BufferedReader;
// 导入InputStreamReader类用于将字节流转换为字符流
import java.io.InputStreamReader;
// 导入HttpURLConnection类用于创建HTTP连接并进行通信
import java.net.HttpURLConnection;
// 导入URL类用于表示统一资源定位符
import java.net.URL;
/**
* HttpClient
* HTTPGET
*/
public class HttpClientUtils {
/**
* GET访URL
* @param uri 访URL
* @return null
* @description get
* @author: long.he01
*/
public static String doGet(String uri) {
// 创建一个StringBuilder对象用于拼接响应结果
StringBuilder result = new StringBuilder();
try {
// 定义一个字符串变量,用于存储最终的响应结果
String res = "";
// 根据传入的uri创建一个URL对象
URL url = new URL(uri);
// 打开URL连接并将其转换为HttpURLConnection对象以便进行HTTP通信
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// 创建一个BufferedReader对象用于读取服务器响应的输入流指定字符编码为UTF-8
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
// 定义一个字符串变量,用于临时存储每行响应内容
String line;
// 逐行读取服务器响应内容,直到读取完毕
while ((line = in.readLine()) != null) {
// 将每行响应内容添加到res字符串中并在末尾添加换行符
res += line + "\n";
}
// 关闭BufferedReader对象释放资源
in.close();
// 返回最终的响应结果
return res;
} catch (Exception e) {
// 若发生异常,打印异常堆栈信息
e.printStackTrace();
// 发生异常时返回null
return null;
}
}
}

@ -0,0 +1,54 @@
package com.utils;
public class JQPageInfo{
private Integer page;
private Integer limit;
private String sidx;
private String order;
private Integer offset;
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public String getSidx() {
return sidx;
}
public void setSidx(String sidx) {
this.sidx = sidx;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public Integer getOffset() {
return offset;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
}

@ -0,0 +1,276 @@
package com.utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.mapper.Wrapper;
/**
* Mybatis-Plus
* MyBatis-Plus
*/
public class MPUtil {
// 定义一个字符常量,表示下划线字符
public static final char UNDERLINE = '_';
// 将对象的属性转换为Map并将属性名从驼峰格式转换为下划线格式同时添加前缀
// mybatis plus allEQ 表达式转换
public static Map allEQMapPre(Object bean, String pre) {
// 将对象转换为Map使用BeanUtil工具类的beanToMap方法
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 将Map中的键从驼峰格式转换为下划线格式并添加前缀
return camelToUnderlineMap(map, pre);
}
// 将对象的属性转换为Map并将属性名从驼峰格式转换为下划线格式
// mybatis plus allEQ 表达式转换
public static Map allEQMap(Object bean) {
// 将对象转换为Map使用BeanUtil工具类的beanToMap方法
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 将Map中的键从驼峰格式转换为下划线格式不添加前缀
return camelToUnderlineMap(map, "");
}
// 根据对象属性生成模糊查询条件,并添加前缀
public static Wrapper allLikePre(Wrapper wrapper, Object bean, String pre) {
// 将对象转换为Map使用BeanUtil工具类的beanToMap方法
Map<String, Object> map = BeanUtil.beanToMap(bean);
// 将Map中的键从驼峰格式转换为下划线格式并添加前缀
Map result = camelToUnderlineMap(map, pre);
// 根据转换后的Map生成模糊查询条件
return genLike(wrapper, result);
}
// 根据对象属性生成模糊查询条件
public static Wrapper allLike(Wrapper wrapper, Object bean) {
// 将对象转换为Map忽略空值和默认值使用BeanUtil工具类的beanToMap方法
Map result = BeanUtil.beanToMap(bean, true, true);
// 根据转换后的Map生成模糊查询条件
return genLike(wrapper, result);
}
// 根据Map生成模糊查询条件
public static Wrapper genLike(Wrapper wrapper, Map param) {
// 获取Map的键值对迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
// 初始化计数器
int i = 0;
// 遍历Map的键值对
while (it.hasNext()) {
// 如果不是第一个条件,添加逻辑与操作
if (i > 0) wrapper.and();
// 获取当前键值对
Map.Entry<String, Object> entry = it.next();
// 获取键
String key = entry.getKey();
// 获取值
String value = (String) entry.getValue();
// 添加模糊查询条件
wrapper.like(key, value);
// 计数器加1
i++;
}
// 返回生成好的条件构造器
return wrapper;
}
// 根据对象属性生成模糊查询或等于查询条件
public static Wrapper likeOrEq(Wrapper wrapper, Object bean) {
// 将对象转换为Map忽略空值和默认值使用BeanUtil工具类的beanToMap方法
Map result = BeanUtil.beanToMap(bean, true, true);
// 根据转换后的Map生成模糊查询或等于查询条件
return genLikeOrEq(wrapper, result);
}
// 根据Map生成模糊查询或等于查询条件
public static Wrapper genLikeOrEq(Wrapper wrapper, Map param) {
// 获取Map的键值对迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
// 初始化计数器
int i = 0;
// 遍历Map的键值对
while (it.hasNext()) {
// 如果不是第一个条件,添加逻辑与操作
if (i > 0) wrapper.and();
// 获取当前键值对
Map.Entry<String, Object> entry = it.next();
// 获取键
String key = entry.getKey();
// 判断值中是否包含百分号(模糊查询标志)
if (entry.getValue().toString().contains("%")) {
// 如果包含百分号,添加模糊查询条件,并去除百分号
wrapper.like(key, entry.getValue().toString().replace("%", ""));
} else {
// 如果不包含百分号,添加等于查询条件
wrapper.eq(key, entry.getValue());
}
// 计数器加1
i++;
}
// 返回生成好的条件构造器
return wrapper;
}
// 根据对象属性生成等于查询条件
public static Wrapper allEq(Wrapper wrapper, Object bean) {
// 将对象转换为Map忽略空值和默认值使用BeanUtil工具类的beanToMap方法
Map result = BeanUtil.beanToMap(bean, true, true);
// 根据转换后的Map生成等于查询条件
return genEq(wrapper, result);
}
// 根据Map生成等于查询条件
public static Wrapper genEq(Wrapper wrapper, Map param) {
// 获取Map的键值对迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
// 初始化计数器
int i = 0;
// 遍历Map的键值对
while (it.hasNext()) {
// 如果不是第一个条件,添加逻辑与操作
if (i > 0) wrapper.and();
// 获取当前键值对
Map.Entry<String, Object> entry = it.next();
// 获取键
String key = entry.getKey();
// 添加等于查询条件
wrapper.eq(key, entry.getValue());
// 计数器加1
i++;
}
// 返回生成好的条件构造器
return wrapper;
}
// 根据Map中的键值对生成范围查询条件大于等于和小于等于
public static Wrapper between(Wrapper wrapper, Map<String, Object> params) {
// 遍历Map的键
for (String key : params.keySet()) {
// 定义列名变量
String columnName = "";
// 如果键以"_start"结尾
if (key.endsWith("_start")) {
// 提取列名
columnName = key.substring(0, key.indexOf("_start"));
// 如果值不为空
if (StringUtils.isNotBlank(params.get(key).toString())) {
// 添加大于等于查询条件
wrapper.ge(columnName, params.get(key));
}
}
// 如果键以"_end"结尾
if (key.endsWith("_end")) {
// 提取列名
columnName = key.substring(0, key.indexOf("_end"));
// 如果值不为空
if (StringUtils.isNotBlank(params.get(key).toString())) {
// 添加小于等于查询条件
wrapper.le(columnName, params.get(key));
}
}
}
// 返回生成好的条件构造器
return wrapper;
}
// 根据Map中的排序参数生成排序条件
public static Wrapper sort(Wrapper wrapper, Map<String, Object> params) {
// 定义排序方向变量
String order = "";
// 如果排序方向参数不为空
if (params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) {
// 获取排序方向
order = params.get("order").toString();
}
// 如果排序字段参数不为空
if (params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
// 如果排序方向为降序
if (order.equalsIgnoreCase("desc")) {
// 添加降序排序条件
wrapper.orderDesc(Arrays.asList(params.get("sort")));
} else {
// 添加升序排序条件
wrapper.orderAsc(Arrays.asList(params.get("sort")));
}
}
// 返回生成好的条件构造器
return wrapper;
}
/**
* 线
*
* @param param
* @return 线
*/
public static String camelToUnderline(String param) {
// 如果参数为空或为空字符串
if (param == null || "".equals(param.trim())) {
// 返回空字符串
return "";
}
// 获取字符串长度
int len = param.length();
// 创建一个StringBuilder对象
StringBuilder sb = new StringBuilder(len);
// 遍历字符串
for (int i = 0; i < len; i++) {
// 获取当前字符
char c = param.charAt(i);
// 如果字符是大写字母
if (Character.isUpperCase(c)) {
// 添加下划线
sb.append(UNDERLINE);
// 添加转换为小写后的字符
sb.append(Character.toLowerCase(c));
} else {
// 添加当前字符
sb.append(c);
}
}
// 返回转换后的字符串
return sb.toString();
}
// 测试方法,用于测试驼峰转下划线方法
public static void main(String[] ages) {
// 输出转换后的字符串
System.out.println(camelToUnderline("ABCddfANM"));
}
// 将Map中的键从驼峰格式转换为下划线格式并根据前缀进行处理
public static Map camelToUnderlineMap(Map param, String pre) {
// 创建一个新的HashMap
Map<String, Object> newMap = new HashMap<String, Object>();
// 获取Map的键值对迭代器
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
// 遍历Map的键值对
while (it.hasNext()) {
// 获取当前键值对
Map.Entry<String, Object> entry = it.next();
// 获取键
String key = entry.getKey();
// 将键从驼峰格式转换为下划线格式
String newKey = camelToUnderline(key);
// 根据前缀的情况进行处理
if (pre.endsWith(".")) {
// 如果前缀以点结尾,直接添加前缀和新键
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
// 如果前缀为空,只添加新键
newMap.put(newKey, entry.getValue());
} else {
// 否则,添加前缀、点和新键
newMap.put(pre + "." + newKey, entry.getValue());
}
}
// 返回转换后的Map
return newMap;
}
}

@ -0,0 +1,101 @@
package com.utils;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.Page;
/**
*
*/
public class PageUtils implements Serializable {
private static final long serialVersionUID = 1L;
//总记录数
private long total;
//每页记录数
private int pageSize;
//总页数
private long totalPage;
//当前页数
private int currPage;
//列表数据
private List<?> list;
/**
*
* @param list
* @param totalCount
* @param pageSize
* @param currPage
*/
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.total = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
}
/**
*
*/
public PageUtils(Page<?> page) {
this.list = page.getRecords();
this.total = page.getTotal();
this.pageSize = page.getSize();
this.currPage = page.getCurrent();
this.totalPage = page.getPages();
}
/*
*
*/
public PageUtils(Map<String, Object> params) {
Page page =new Query(params).getPage();
new PageUtils(page);
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
public long getTotalPage() {
return totalPage;
}
public void setTotalPage(long totalPage) {
this.totalPage = totalPage;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
}

@ -0,0 +1,133 @@
package com.utils;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.plugins.Page;
/**
*
* LinkedHashMap
*/
public class Query<T> extends LinkedHashMap<String, Object> {
// 序列化版本号,用于兼容不同版本的序列化和反序列化操作
private static final long serialVersionUID = 1L;
/**
* mybatis-plus
* MyBatis-Plus
*/
private Page<T> page;
/**
*
* 1
*/
private int currPage = 1;
/**
*
* 10
*/
private int limit = 10;
/**
* JQPageInfo
* @param pageInfo JQPageInfo
*/
public Query(JQPageInfo pageInfo) {
// 分页参数处理
// 如果JQPageInfo中的page参数不为空设置当前页码
if (pageInfo.getPage()!= null) {
currPage = pageInfo.getPage();
}
// 如果JQPageInfo中的limit参数不为空设置每页条数
if (pageInfo.getLimit()!= null) {
limit = pageInfo.getLimit();
}
// 防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
// 对JQPageInfo中的sidx参数进行SQL注入过滤
String sidx = SQLFilter.sqlInject(pageInfo.getSidx());
// 对JQPageInfo中的order参数进行SQL注入过滤
String order = SQLFilter.sqlInject(pageInfo.getOrder());
// mybatis-plus分页
// 创建MyBatis-Plus的分页对象传入当前页码和每页条数
this.page = new Page<>(currPage, limit);
// 排序
// 如果sidx和order都不为空设置排序字段和排序方向
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) {
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
/**
* Map
* @param params Map
*/
public Query(Map<String, Object> params) {
// 将传入的参数Map中的所有键值对放入当前对象中
this.putAll(params);
// 分页参数处理
// 如果params中的page参数不为空设置当前页码
if (params.get("page")!= null) {
currPage = Integer.parseInt((String) params.get("page"));
}
// 如果params中的limit参数不为空设置每页条数
if (params.get("limit")!= null) {
limit = Integer.parseInt((String) params.get("limit"));
}
// 计算偏移量并将相关分页参数放入当前对象中
this.put("offset", (currPage - 1) * limit);
this.put("page", currPage);
this.put("limit", limit);
// 防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
// 对params中的sidx参数进行SQL注入过滤
String sidx = SQLFilter.sqlInject((String) params.get("sidx"));
// 对params中的order参数进行SQL注入过滤
String order = SQLFilter.sqlInject((String) params.get("order"));
// 将过滤后的sidx和order参数放入当前对象中
this.put("sidx", sidx);
this.put("order", order);
// mybatis-plus分页
// 创建MyBatis-Plus的分页对象传入当前页码和每页条数
this.page = new Page<>(currPage, limit);
// 排序
// 如果sidx和order都不为空设置排序字段和排序方向
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) {
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
/**
* MyBatis-Plus
* @return MyBatis-PlusPage<T>
*/
public Page<T> getPage() {
return page;
}
/**
*
* @return
*/
public int getCurrPage() {
return currPage;
}
/**
*
*/
public int getLimit() {
return limit;
}
}

@ -0,0 +1,111 @@
package com.utils;
import java.util.HashMap;
import java.util.Map;
/**
*
* HashMap
*/
public class R extends HashMap<String, Object> {
// 序列化版本号,用于保证序列化和反序列化过程中类的版本一致性
private static final long serialVersionUID = 1L;
/**
*
* 0
*/
public R() {
// 向 Map 中放入状态码0 通常表示成功
put("code", 0);
}
/**
* R
* 500 "未知异常,请联系管理员"
* @return R
*/
public static R error() {
// 调用另一个 error 方法,传入默认的状态码和错误消息
return error(500, "未知异常,请联系管理员");
}
/**
* R 使
* 500
* @param msg
* @return R
*/
public static R error(String msg) {
// 调用另一个 error 方法,传入默认的状态码和自定义的错误消息
return error(500, msg);
}
/**
* R 使
* @param code
* @param msg
* @return R
*/
public static R error(int code, String msg) {
// 创建一个新的 R 对象
R r = new R();
// 向 R 对象中放入自定义的状态码
r.put("code", code);
// 向 R 对象中放入自定义的错误消息
r.put("msg", msg);
// 返回包含错误信息的 R 对象
return r;
}
/**
* R 使
* @param msg
* @return R
*/
public static R ok(String msg) {
// 创建一个新的 R 对象
R r = new R();
// 向 R 对象中放入自定义的成功消息
r.put("msg", msg);
// 返回包含成功信息的 R 对象
return r;
}
/**
* R Map R
* @param map Map
* @return R
*/
public static R ok(Map<String, Object> map) {
// 创建一个新的 R 对象
R r = new R();
// 将传入的 Map 中的所有键值对放入 R 对象中
r.putAll(map);
// 返回包含成功信息和自定义数据的 R 对象
return r;
}
/**
* R
* 使 0
* @return R
*/
public static R ok() {
// 创建并返回一个新的 R 对象
return new R();
}
/**
* R R 便
* @param key
* @param value
* @return R
*/
public R put(String key, Object value) {
// 调用父类的 put 方法,将键值对放入 Map 中
super.put(key, value);
// 返回当前 R 对象,方便链式调用
return this;
}
}

@ -0,0 +1,42 @@
package com.utils;
import org.apache.commons.lang3.StringUtils;
import com.entity.EIException;
/**
* SQL
*/
public class SQLFilter {
/**
* SQL
* @param str
*/
public static String sqlInject(String str){
if(StringUtils.isBlank(str)){
return null;
}
//去掉'|"|;|\字符
str = StringUtils.replace(str, "'", "");
str = StringUtils.replace(str, "\"", "");
str = StringUtils.replace(str, ";", "");
str = StringUtils.replace(str, "\\", "");
//转换成小写
str = str.toLowerCase();
//非法字符
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
//判断是否包含非法字符
for(String keyword : keywords){
if(str.indexOf(keyword) != -1){
throw new EIException("包含非法字符");
}
}
return str;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save