pull/1/head
陈钦钦 2 months ago
commit f12426ca27

17
.gitignore vendored

@ -0,0 +1,17 @@
# 忽略node_modules目录
node_modules/
# 忽略Logs
logs
*.log
# 忽略/dist目录相对.gitignore文件所在目录
/dist
# 忽略.env文件
.env
# 忽略IDE的配置文件
.idea/
.vscode/
*.sw*

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.jlwl</groupId>
<!-- 导入项目的名称 -->
<artifactId>yiyuanguanhaojiuzhen</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>yiyuanguanhaojiuzhen</name>
<description>医院挂号就诊系统</description>
<properties>
<java.version>1.8</java.version>
<fastjson.version>1.2.8</fastjson.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!--访问静态资源-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.10.0</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>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<scope>4.0</scope>
<version>4.0</version>
</dependency>-->
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- poi高版本额外包 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,61 @@
package com.ServletContextListener;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.thread.MyThreadMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* ,,
*/
@WebListener
public class DictionaryServletContextListener implements ServletContextListener {
private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class);
private MyThreadMethod myThreadMethod;
@Override
public void contextDestroyed(ServletContextEvent sce) {
logger.info("----------服务器停止----------");
}
@Override
public void contextInitialized(ServletContextEvent sce) {
ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
logger.info("----------字典表初始化开始----------");
DictionaryService dictionaryService = (DictionaryService)appContext.getBean("dictionaryService");
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
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);
}
sce.getServletContext().setAttribute("dictionaryMap", map);
logger.info("----------字典表初始化完成----------");
logger.info("----------线程执行开始----------");
if (myThreadMethod == null) {
myThreadMethod = new MyThreadMethod();
myThreadMethod.start(); // servlet 上下文初始化时启动线程myThreadMethod
}
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,39 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.interceptor.AuthorizationInterceptor;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport{
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor() {
return new AuthorizationInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
super.addInterceptors(registry);
}
/**
* springboot 2.0WebMvcConfigurationSupport访addResourceHandlers
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/resources/")
.addResourceLocations("classpath:/static/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations("classpath:/img/")
.addResourceLocations("classpath:/front/")
.addResourceLocations("classpath:/public/");
super.addResourceHandlers(registry);
}
}

@ -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,24 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
/**
* mybatis-plus
*/
@Configuration
public class MybatisPlusConfig {
/**
*
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,326 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 线
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/chat")
public class ChatController {
private static final Logger logger = LoggerFactory.getLogger(ChatController.class);
@Autowired
private ChatService chatService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
@Autowired
private YishengService yishengService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = chatService.queryPage(params);
//字典表数据转换
List<ChatView> list =(List<ChatView>)page.getList();
for(ChatView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ChatEntity chat = chatService.selectById(id);
if(chat !=null){
//entity转view
ChatView view = new ChatView();
BeanUtils.copyProperties( chat , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(chat.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
chat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ChatEntity> queryWrapper = new EntityWrapper<ChatEntity>()
.eq("yonghu_id", chat.getYonghuId())
.eq("chat_issue", chat.getChatIssue())
.eq("chat_reply", chat.getChatReply())
.eq("zhuangtai_types", chat.getZhuangtaiTypes())
.eq("chat_types", chat.getChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChatEntity chatEntity = chatService.selectOne(queryWrapper);
if(chatEntity==null){
chat.setInsertTime(new Date());
chatService.insert(chat);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// chat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ChatEntity> queryWrapper = new EntityWrapper<ChatEntity>()
.notIn("id",chat.getId())
.andNew()
.eq("yonghu_id", chat.getYonghuId())
.eq("chat_issue", chat.getChatIssue())
.eq("chat_reply", chat.getChatReply())
.eq("zhuangtai_types", chat.getZhuangtaiTypes())
.eq("chat_types", chat.getChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChatEntity chatEntity = chatService.selectOne(queryWrapper);
if(chatEntity==null){
chatService.updateById(chat);//根据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());
chatService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<ChatEntity> chatList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
ChatEntity chatEntity = new ChatEntity();
// chatEntity.setYonghuId(Integer.valueOf(data.get(0))); //提问用户 要改的
// chatEntity.setChatIssue(data.get(0)); //问题 要改的
// chatEntity.setIssueTime(new Date(data.get(0))); //问题时间 要改的
// chatEntity.setChatReply(data.get(0)); //回复 要改的
// chatEntity.setReplyTime(new Date(data.get(0))); //回复时间 要改的
// chatEntity.setZhuangtaiTypes(Integer.valueOf(data.get(0))); //状态 要改的
// chatEntity.setChatTypes(Integer.valueOf(data.get(0))); //数据类型 要改的
// chatEntity.setInsertTime(date);//时间
chatList.add(chatEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
chatService.insertBatch(chatList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = chatService.queryPage(params);
//字典表数据转换
List<ChatView> list =(List<ChatView>)page.getList();
for(ChatView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ChatEntity chat = chatService.selectById(id);
if(chat !=null){
//entity转view
ChatView view = new ChatView();
BeanUtils.copyProperties( chat , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(chat.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());
Wrapper<ChatEntity> queryWrapper = new EntityWrapper<ChatEntity>()
.eq("yonghu_id", chat.getYonghuId())
.eq("chat_issue", chat.getChatIssue())
.eq("chat_reply", chat.getChatReply())
.eq("zhuangtai_types", chat.getZhuangtaiTypes())
.eq("chat_types", chat.getChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChatEntity chatEntity = chatService.selectOne(queryWrapper);
if(chatEntity==null){
chat.setInsertTime(new Date());
chatService.insert(chat);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,698 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSON;
import com.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
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.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@RestController
public class CommonController{
private static final Logger logger = LoggerFactory.getLogger(CommonController.class);
@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()
* @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
* @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 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);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}")
public R group1(@PathVariable("tableName") String tableName, @RequestParam Map<String,Object> params) {
params.put("table1", tableName);
List<Map<String, Object>> result = commonService.chartBoth(params);
return R.ok().put("data", result);
}
/**
*
*/
@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);
}
/**
*
*
*
*
*/
/**
*
* tableName
* groupColumn
* sumCloum
* @return
*/
@RequestMapping("/newSelectGroupSum")
public R newSelectGroupSum(@RequestParam Map<String,Object> params) {
logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
List<Map<String, Object>> result = commonService.newSelectGroupSum(params);
return R.ok().put("data", result);
}
/**
tableName
condition1 1
condition1Value 1
average
Number(res.data.value.toFixed(1))
if(res.data){}
* */
@IgnoreAuth
@RequestMapping("/queryScore")
public R queryScore(@RequestParam Map<String, Object> params) {
logger.debug("queryScore:,,Controller:{},,params:{}",this.getClass().getName(),params);
Map<String, Object> queryScore = commonService.queryScore(params);
return R.ok().put("data", queryScore);
}
/**
*
* tableName
* groupColumn
* @return
*/
@RequestMapping("/newSelectGroupCount")
public R newSelectGroupCount(@RequestParam Map<String,Object> params) {
logger.debug("newSelectGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
List<Map<String, Object>> result = commonService.newSelectGroupCount(params);
return R.ok().put("data", result);
}
/**
*
* tableName
* groupColumn
* sumCloum
* dateFormatType 1: 2: 3:
* @return
*/
@RequestMapping("/newSelectDateGroupSum")
public R newSelectDateGroupSum(@RequestParam Map<String,Object> params) {
logger.debug("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
String dateFormatType = String.valueOf(params.get("dateFormatType"));
if("1".equals(dateFormatType)){
params.put("dateFormat", "%Y");
}else if("2".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m");
}else if("3".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m-%d");
}else{
R.error("日期格式化不正确");
}
List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
return R.ok().put("data", result);
}
/**
*
*
* tableName
* groupColumn
* dateFormatType 1: 2: 3:
* @return
*/
@RequestMapping("/newSelectDateGroupCount")
public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {
logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
String dateFormatType = String.valueOf(params.get("dateFormatType"));
if("1".equals(dateFormatType)){
params.put("dateFormat", "%Y");
}else if("2".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m");
}else if("3".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m-%d");
}else{
R.error("日期格式化类型不正确");
}
List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
return R.ok().put("data", result);
}
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
*/
@RequestMapping("/barSum")
public R barSum(@RequestParam Map<String,Object> params) {
logger.debug("barSum方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
Boolean isJoinTableFlag = false;//是否有级联表相关
String one = "";//第一优先
String two = "";//第二优先
//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组
//当前表
Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
params.put("thisTable",thisTable);
//级联表
String joinTableString = String.valueOf(params.get("joinTable"));
if(StringUtil.isNotEmpty(joinTableString)) {
Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
params.put("joinTable", joinTable);
isJoinTableFlag = true;
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期
thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
one = "thisDate0";
}
if(isJoinTableFlag){//级联表日期
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinDate0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinDate0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串
thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisString0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisString0";
}
}
}
if(isJoinTableFlag){//级联表字符串
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinString0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinString0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型
thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisTypes0";
}
}
}
if(isJoinTableFlag){//级联表类型
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinTypes0";
}
}
}
}
List<Map<String, Object>> result = commonService.barSum(params);
List<String> xAxis = new ArrayList<>();//报表x轴
List<List<String>> yAxis = new ArrayList<>();//y轴
List<String> legend = new ArrayList<>();//标题
if(StringUtil.isEmpty(two)){//不包含第二列
List<String> yAxis0 = new ArrayList<>();
yAxis.add(yAxis0);
legend.add("数值");
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String value = String.valueOf(map.get("value"));
xAxis.add(oneValue);
yAxis0.add(value);
}
}else{//包含第二列
Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
if(StringUtil.isNotEmpty(two)){
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String twoValue = String.valueOf(map.get(two));
String value = String.valueOf(map.get("value"));
if(!legend.contains(twoValue)){
legend.add(twoValue);//添加完成后 就是最全的第二列的类型
}
if(dataMap.containsKey(oneValue)){
dataMap.get(oneValue).put(twoValue,value);
}else{
HashMap<String, String> oneData = new HashMap<>();
oneData.put(twoValue,value);
dataMap.put(oneValue,oneData);
}
}
}
for(int i =0; i<legend.size(); i++){
yAxis.add(new ArrayList<String>());
}
Set<String> keys = dataMap.keySet();
for(String key:keys){
xAxis.add(key);
HashMap<String, String> map = dataMap.get(key);
for(int i =0; i<legend.size(); i++){
List<String> data = yAxis.get(i);
if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
data.add(map.get(legend.get(i)));
}else{
data.add("0");
}
}
}
System.out.println();
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("xAxis",xAxis);
resultMap.put("yAxis",yAxis);
resultMap.put("legend",legend);
return R.ok().put("data", resultMap);
}
/**
*
*/
@RequestMapping("/barCount")
public R barCount(@RequestParam Map<String,Object> params) {
logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
Boolean isJoinTableFlag = false;//是否有级联表相关
String one = "";//第一优先
String two = "";//第二优先
//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组
//当前表
Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
params.put("thisTable",thisTable);
//级联表
String joinTableString = String.valueOf(params.get("joinTable"));
if(StringUtil.isNotEmpty(joinTableString)) {
Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
params.put("joinTable", joinTable);
isJoinTableFlag = true;
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期
thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
one = "thisDate0";
}
if(isJoinTableFlag){//级联表日期
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinDate0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinDate0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串
thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisString0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisString0";
}
}
}
if(isJoinTableFlag){//级联表字符串
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinString0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinString0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型
thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisTypes0";
}
}
}
if(isJoinTableFlag){//级联表类型
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinTypes0";
}
}
}
}
List<Map<String, Object>> result = commonService.barCount(params);
List<String> xAxis = new ArrayList<>();//报表x轴
List<List<String>> yAxis = new ArrayList<>();//y轴
List<String> legend = new ArrayList<>();//标题
if(StringUtil.isEmpty(two)){//不包含第二列
List<String> yAxis0 = new ArrayList<>();
yAxis.add(yAxis0);
legend.add("数值");
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String value = String.valueOf(map.get("value"));
xAxis.add(oneValue);
yAxis0.add(value);
}
}else{//包含第二列
Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
if(StringUtil.isNotEmpty(two)){
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String twoValue = String.valueOf(map.get(two));
String value = String.valueOf(map.get("value"));
if(!legend.contains(twoValue)){
legend.add(twoValue);//添加完成后 就是最全的第二列的类型
}
if(dataMap.containsKey(oneValue)){
dataMap.get(oneValue).put(twoValue,value);
}else{
HashMap<String, String> oneData = new HashMap<>();
oneData.put(twoValue,value);
dataMap.put(oneValue,oneData);
}
}
}
for(int i =0; i<legend.size(); i++){
yAxis.add(new ArrayList<String>());
}
Set<String> keys = dataMap.keySet();
for(String key:keys){
xAxis.add(key);
HashMap<String, String> map = dataMap.get(key);
for(int i =0; i<legend.size(); i++){
List<String> data = yAxis.get(i);
if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
data.add(map.get(legend.get(i)));
}else{
data.add("0");
}
}
}
System.out.println();
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("xAxis",xAxis);
resultMap.put("yAxis",yAxis);
resultMap.put("legend",legend);
return R.ok().put("data", resultMap);
}
}

@ -0,0 +1,111 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
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.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@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,277 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@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
@Autowired
private YonghuService yonghuService;
@Autowired
private YishengService yishengService;
/**
*
*/
@RequestMapping("/page")
@IgnoreAuth
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = dictionaryService.queryPage(params);
//字典表数据转换
List<DictionaryView> list =(List<DictionaryView>)page.getList();
for(DictionaryView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
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, request);
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());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.eq("index_name", dictionary.getIndexName())
;
if(dictionary.getDicCode().contains("_erji_types")){
queryWrapper.eq("super_id",dictionary.getSuperId());
}
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionary.setCreateTime(new Date());
dictionaryService.insert(dictionary);
//字典表新增数据,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.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());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.notIn("id",dictionary.getId())
.eq("dic_code", dictionary.getDicCode())
.eq("index_name", dictionary.getIndexName())
;
if(dictionary.getDicCode().contains("_erji_types")){
queryWrapper.eq("super_id",dictionary.getSuperId());
}
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionaryService.updateById(dictionary);//根据id更新
//如果字典表修改数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.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();
}
/**
*
*/
@RequestMapping("/maxCodeIndex")
public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){
logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
List<String> descs = new ArrayList<>();
descs.add("code_index");
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.orderDesc(descs);
logger.info("sql语句:"+queryWrapper.getSqlSegment());
List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);
if(dictionaryEntityList != null ){
return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);
}else{
return R.ok().put("maxCodeIndex",1);
}
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<DictionaryEntity> dictionaryList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
DictionaryEntity dictionaryEntity = new DictionaryEntity();
// dictionaryEntity.setDicCode(data.get(0)); //字段 要改的
// dictionaryEntity.setDicName(data.get(0)); //字段名 要改的
// dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0))); //编码 要改的
// dictionaryEntity.setIndexName(data.get(0)); //编码名字 要改的
// dictionaryEntity.setSuperId(Integer.valueOf(data.get(0))); //父字段id 要改的
// dictionaryEntity.setBeizhu(data.get(0)); //备注 要改的
// dictionaryEntity.setCreateTime(date);//时间
dictionaryList.add(dictionaryEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
dictionaryService.insertBatch(dictionaryList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}

@ -0,0 +1,110 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
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 org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
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) throws Exception {
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
String fileName = new Date().getTime()+"."+fileExt;
File dest = new File(upload.getAbsolutePath()+"/"+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 ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
File file = new File(upload.getAbsolutePath()+"/"+fileName);
if(file.exists()){
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
getResponse().sendError(403);
}*/
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", fileName);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
}
} catch (IOException e) {
e.printStackTrace();
}
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@ -0,0 +1,363 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/guahao")
public class GuahaoController {
private static final Logger logger = LoggerFactory.getLogger(GuahaoController.class);
@Autowired
private GuahaoService guahaoService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YishengService yishengService;
@Autowired
private YonghuService yonghuService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = guahaoService.queryPage(params);
//字典表数据转换
List<GuahaoView> list =(List<GuahaoView>)page.getList();
for(GuahaoView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
GuahaoEntity guahao = guahaoService.selectById(id);
if(guahao !=null){
//entity转view
GuahaoView view = new GuahaoView();
BeanUtils.copyProperties( guahao , view );//把实体数据重构到view中
//级联表
YishengEntity yisheng = yishengService.selectById(guahao.getYishengId());
if(yisheng != null){
BeanUtils.copyProperties( yisheng , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYishengId(yisheng.getId());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(guahao.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody GuahaoEntity guahao, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,guahao:{}",this.getClass().getName(),guahao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("医生".equals(role))
guahao.setYishengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
else if("用户".equals(role))
guahao.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<GuahaoEntity> queryWrapper = new EntityWrapper<GuahaoEntity>()
.eq("yisheng_id", guahao.getYishengId())
.eq("yonghu_id", guahao.getYonghuId())
.eq("guahao_uuin_number", guahao.getGuahaoUuinNumber())
.eq("guahao_time", new SimpleDateFormat("yyyy-MM-dd").format(guahao.getGuahaoTime()))
.eq("guahao_types", guahao.getGuahaoTypes())
.eq("guahao_status_types", guahao.getGuahaoStatusTypes())
.eq("guahao_yesno_types", guahao.getGuahaoYesnoTypes())
.eq("guahao_yesno_text", guahao.getGuahaoYesnoText())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GuahaoEntity guahaoEntity = guahaoService.selectOne(queryWrapper);
if(guahaoEntity==null){
guahao.setGuahaoYesnoTypes(1);
guahao.setCreateTime(new Date());
guahaoService.insert(guahao);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody GuahaoEntity guahao, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,guahao:{}",this.getClass().getName(),guahao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("医生".equals(role))
// guahao.setYishengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// else if("用户".equals(role))
// guahao.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<GuahaoEntity> queryWrapper = new EntityWrapper<GuahaoEntity>()
.notIn("id",guahao.getId())
.andNew()
.eq("yisheng_id", guahao.getYishengId())
.eq("yonghu_id", guahao.getYonghuId())
.eq("guahao_uuin_number", guahao.getGuahaoUuinNumber())
.eq("guahao_time", guahao.getGuahaoTime())
.eq("guahao_types", guahao.getGuahaoTypes())
.eq("guahao_status_types", guahao.getGuahaoStatusTypes())
.eq("guahao_yesno_types", guahao.getGuahaoYesnoTypes())
.eq("guahao_yesno_text", guahao.getGuahaoYesnoText())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GuahaoEntity guahaoEntity = guahaoService.selectOne(queryWrapper);
if(guahaoEntity==null){
guahaoService.updateById(guahao);//根据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());
guahaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<GuahaoEntity> guahaoList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
GuahaoEntity guahaoEntity = new GuahaoEntity();
// guahaoEntity.setYishengId(Integer.valueOf(data.get(0))); //医生 要改的
// guahaoEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// guahaoEntity.setGuahaoUuinNumber(Integer.valueOf(data.get(0))); //就诊识别码 要改的
// guahaoEntity.setGuahaoTime(new Date(data.get(0))); //挂号时间 要改的
// guahaoEntity.setGuahaoTypes(Integer.valueOf(data.get(0))); //时间类型 要改的
// guahaoEntity.setGuahaoStatusTypes(Integer.valueOf(data.get(0))); //挂号状态 要改的
// guahaoEntity.setGuahaoYesnoTypes(Integer.valueOf(data.get(0))); //挂号审核 要改的
// guahaoEntity.setGuahaoYesnoText(data.get(0)); //审核结果 要改的
// guahaoEntity.setCreateTime(date);//时间
guahaoList.add(guahaoEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
guahaoService.insertBatch(guahaoList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = guahaoService.queryPage(params);
//字典表数据转换
List<GuahaoView> list =(List<GuahaoView>)page.getList();
for(GuahaoView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
GuahaoEntity guahao = guahaoService.selectById(id);
if(guahao !=null){
//entity转view
GuahaoView view = new GuahaoView();
BeanUtils.copyProperties( guahao , view );//把实体数据重构到view中
//级联表
YishengEntity yisheng = yishengService.selectById(guahao.getYishengId());
if(yisheng != null){
BeanUtils.copyProperties( yisheng , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYishengId(yisheng.getId());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(guahao.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody GuahaoEntity guahao, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,guahao:{}",this.getClass().getName(),guahao.toString());
Wrapper<GuahaoEntity> queryWrapper = new EntityWrapper<GuahaoEntity>()
.eq("yisheng_id", guahao.getYishengId())
.eq("yonghu_id", guahao.getYonghuId())
.eq("guahao_uuin_number", guahao.getGuahaoUuinNumber())
.eq("guahao_types", guahao.getGuahaoTypes())
.eq("guahao_status_types", guahao.getGuahaoStatusTypes())
.eq("guahao_yesno_types", guahao.getGuahaoYesnoTypes())
.eq("guahao_yesno_text", guahao.getGuahaoYesnoText())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GuahaoEntity guahaoEntity = guahaoService.selectOne(queryWrapper);
if(guahaoEntity==null){
guahao.setGuahaoYesnoTypes(1);
guahao.setCreateTime(new Date());
YonghuEntity userId = yonghuService.selectById((Integer) request.getSession().getAttribute("userId"));
YishengEntity yishengEntity = yishengService.selectById(guahao.getYishengId());
if(userId.getNewMoney()<yishengEntity.getYishengNewMoney()){
return R.error("余额不足请充值");
}
userId.setNewMoney(userId.getNewMoney()-yishengEntity.getYishengNewMoney());
boolean b = yonghuService.updateById(userId);
if(!b){
return R.error();
}
guahaoService.insert(guahao);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,320 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/jiankangjiaoyu")
public class JiankangjiaoyuController {
private static final Logger logger = LoggerFactory.getLogger(JiankangjiaoyuController.class);
@Autowired
private JiankangjiaoyuService jiankangjiaoyuService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
@Autowired
private YishengService yishengService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
params.put("jiankangjiaoyuDeleteStart",1);params.put("jiankangjiaoyuDeleteEnd",1);
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = jiankangjiaoyuService.queryPage(params);
//字典表数据转换
List<JiankangjiaoyuView> list =(List<JiankangjiaoyuView>)page.getList();
for(JiankangjiaoyuView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiankangjiaoyuEntity jiankangjiaoyu = jiankangjiaoyuService.selectById(id);
if(jiankangjiaoyu !=null){
//entity转view
JiankangjiaoyuView view = new JiankangjiaoyuView();
BeanUtils.copyProperties( jiankangjiaoyu , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody JiankangjiaoyuEntity jiankangjiaoyu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiankangjiaoyu:{}",this.getClass().getName(),jiankangjiaoyu.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<JiankangjiaoyuEntity> queryWrapper = new EntityWrapper<JiankangjiaoyuEntity>()
.eq("jiankangjiaoyu_name", jiankangjiaoyu.getJiankangjiaoyuName())
.eq("jiankangjiaoyu_types", jiankangjiaoyu.getJiankangjiaoyuTypes())
.eq("jiankangjiaoyu_delete", jiankangjiaoyu.getJiankangjiaoyuDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangjiaoyuEntity jiankangjiaoyuEntity = jiankangjiaoyuService.selectOne(queryWrapper);
if(jiankangjiaoyuEntity==null){
jiankangjiaoyu.setInsertTime(new Date());
jiankangjiaoyu.setJiankangjiaoyuDelete(1);
jiankangjiaoyu.setCreateTime(new Date());
jiankangjiaoyuService.insert(jiankangjiaoyu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody JiankangjiaoyuEntity jiankangjiaoyu, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,jiankangjiaoyu:{}",this.getClass().getName(),jiankangjiaoyu.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<JiankangjiaoyuEntity> queryWrapper = new EntityWrapper<JiankangjiaoyuEntity>()
.notIn("id",jiankangjiaoyu.getId())
.andNew()
.eq("jiankangjiaoyu_name", jiankangjiaoyu.getJiankangjiaoyuName())
.eq("jiankangjiaoyu_types", jiankangjiaoyu.getJiankangjiaoyuTypes())
.eq("jiankangjiaoyu_delete", jiankangjiaoyu.getJiankangjiaoyuDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangjiaoyuEntity jiankangjiaoyuEntity = jiankangjiaoyuService.selectOne(queryWrapper);
if("".equals(jiankangjiaoyu.getJiankangjiaoyuPhoto()) || "null".equals(jiankangjiaoyu.getJiankangjiaoyuPhoto())){
jiankangjiaoyu.setJiankangjiaoyuPhoto(null);
}
if(jiankangjiaoyuEntity==null){
jiankangjiaoyuService.updateById(jiankangjiaoyu);//根据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());
ArrayList<JiankangjiaoyuEntity> list = new ArrayList<>();
for(Integer id:ids){
JiankangjiaoyuEntity jiankangjiaoyuEntity = new JiankangjiaoyuEntity();
jiankangjiaoyuEntity.setId(id);
jiankangjiaoyuEntity.setJiankangjiaoyuDelete(2);
list.add(jiankangjiaoyuEntity);
}
if(list != null && list.size() >0){
jiankangjiaoyuService.updateBatchById(list);
}
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<JiankangjiaoyuEntity> jiankangjiaoyuList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
JiankangjiaoyuEntity jiankangjiaoyuEntity = new JiankangjiaoyuEntity();
// jiankangjiaoyuEntity.setJiankangjiaoyuName(data.get(0)); //健康教育标题 要改的
// jiankangjiaoyuEntity.setJiankangjiaoyuTypes(Integer.valueOf(data.get(0))); //健康教育类型 要改的
// jiankangjiaoyuEntity.setJiankangjiaoyuPhoto("");//照片
// jiankangjiaoyuEntity.setInsertTime(date);//时间
// jiankangjiaoyuEntity.setJiankangjiaoyuContent("");//照片
// jiankangjiaoyuEntity.setJiankangjiaoyuDelete(1);//逻辑删除字段
// jiankangjiaoyuEntity.setCreateTime(date);//时间
jiankangjiaoyuList.add(jiankangjiaoyuEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
jiankangjiaoyuService.insertBatch(jiankangjiaoyuList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = jiankangjiaoyuService.queryPage(params);
//字典表数据转换
List<JiankangjiaoyuView> list =(List<JiankangjiaoyuView>)page.getList();
for(JiankangjiaoyuView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiankangjiaoyuEntity jiankangjiaoyu = jiankangjiaoyuService.selectById(id);
if(jiankangjiaoyu !=null){
//entity转view
JiankangjiaoyuView view = new JiankangjiaoyuView();
BeanUtils.copyProperties( jiankangjiaoyu , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody JiankangjiaoyuEntity jiankangjiaoyu, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,jiankangjiaoyu:{}",this.getClass().getName(),jiankangjiaoyu.toString());
Wrapper<JiankangjiaoyuEntity> queryWrapper = new EntityWrapper<JiankangjiaoyuEntity>()
.eq("jiankangjiaoyu_name", jiankangjiaoyu.getJiankangjiaoyuName())
.eq("jiankangjiaoyu_types", jiankangjiaoyu.getJiankangjiaoyuTypes())
.eq("jiankangjiaoyu_delete", jiankangjiaoyu.getJiankangjiaoyuDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiankangjiaoyuEntity jiankangjiaoyuEntity = jiankangjiaoyuService.selectOne(queryWrapper);
if(jiankangjiaoyuEntity==null){
jiankangjiaoyu.setInsertTime(new Date());
jiankangjiaoyu.setJiankangjiaoyuDelete(1);
jiankangjiaoyu.setCreateTime(new Date());
jiankangjiaoyuService.insert(jiankangjiaoyu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,304 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/news")
public class NewsController {
private static final Logger logger = LoggerFactory.getLogger(NewsController.class);
@Autowired
private NewsService newsService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
@Autowired
private YishengService yishengService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = newsService.queryPage(params);
//字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
NewsEntity news = newsService.selectById(id);
if(news !=null){
//entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
news.setInsertTime(new Date());
news.setCreateTime(new Date());
newsService.insert(news);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody NewsEntity news, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.notIn("id",news.getId())
.andNew()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){
news.setNewsPhoto(null);
}
if(newsEntity==null){
newsService.updateById(news);//根据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());
newsService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<NewsEntity> newsList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
NewsEntity newsEntity = new NewsEntity();
// newsEntity.setNewsName(data.get(0)); //公告名称 要改的
// newsEntity.setNewsPhoto("");//照片
// newsEntity.setNewsTypes(Integer.valueOf(data.get(0))); //公告类型 要改的
// newsEntity.setInsertTime(date);//时间
// newsEntity.setNewsContent("");//照片
// newsEntity.setCreateTime(date);//时间
newsList.add(newsEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
newsService.insertBatch(newsList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = newsService.queryPage(params);
//字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
NewsEntity news = newsService.selectById(id);
if(news !=null){
//entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
news.setInsertTime(new Date());
news.setCreateTime(new Date());
newsService.insert(news);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,168 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*/
@RequestMapping("users")
@RestController
public class UsersController {
@Autowired
private UsersService usersService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
R r = R.ok();
r.put("token", token);
r.put("role",user.getRole());
r.put("userId",user.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
usersService.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){
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
usersService.update(user,null);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UsersEntity user){
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UsersEntity user){
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", usersService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UsersEntity user = usersService.selectById(id);
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
UsersEntity user = usersService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
user.setPassword("123456");
usersService.insert(user);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
usersService.updateById(user);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
usersService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,475 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/yisheng")
public class YishengController {
private static final Logger logger = LoggerFactory.getLogger(YishengController.class);
@Autowired
private YishengService yishengService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = yishengService.queryPage(params);
//字典表数据转换
List<YishengView> list =(List<YishengView>)page.getList();
for(YishengView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YishengEntity yisheng = yishengService.selectById(id);
if(yisheng !=null){
//entity转view
YishengView view = new YishengView();
BeanUtils.copyProperties( yisheng , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YishengEntity yisheng, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yisheng:{}",this.getClass().getName(),yisheng.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<YishengEntity> queryWrapper = new EntityWrapper<YishengEntity>()
.eq("username", yisheng.getUsername())
.or()
.eq("yisheng_phone", yisheng.getYishengPhone())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YishengEntity yishengEntity = yishengService.selectOne(queryWrapper);
if(yishengEntity==null){
yisheng.setCreateTime(new Date());
yisheng.setPassword("123456");
yishengService.insert(yisheng);
return R.ok();
}else {
return R.error(511,"账户或者联系方式已经被使用");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YishengEntity yisheng, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yisheng:{}",this.getClass().getName(),yisheng.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<YishengEntity> queryWrapper = new EntityWrapper<YishengEntity>()
.notIn("id",yisheng.getId())
.andNew()
.eq("username", yisheng.getUsername())
.or()
.eq("yisheng_phone", yisheng.getYishengPhone())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YishengEntity yishengEntity = yishengService.selectOne(queryWrapper);
if("".equals(yisheng.getYishengPhoto()) || "null".equals(yisheng.getYishengPhoto())){
yisheng.setYishengPhoto(null);
}
if(yishengEntity==null){
yishengService.updateById(yisheng);//根据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());
yishengService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<YishengEntity> yishengList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
YishengEntity yishengEntity = new YishengEntity();
// yishengEntity.setYishengUuidNumber(data.get(0)); //医生工号 要改的
// yishengEntity.setUsername(data.get(0)); //账户 要改的
// //yishengEntity.setPassword("123456");//密码
// yishengEntity.setYishengName(data.get(0)); //医生名称 要改的
// yishengEntity.setYishengTypes(Integer.valueOf(data.get(0))); //科室 要改的
// yishengEntity.setZhiweiTypes(Integer.valueOf(data.get(0))); //职位 要改的
// yishengEntity.setYishengZhichneg(data.get(0)); //职称 要改的
// yishengEntity.setYishengPhoto("");//照片
// yishengEntity.setYishengPhone(data.get(0)); //联系方式 要改的
// yishengEntity.setYishengGuahao(data.get(0)); //挂号须知 要改的
// yishengEntity.setYishengEmail(data.get(0)); //邮箱 要改的
// yishengEntity.setYishengNewMoney(data.get(0)); //挂号价格 要改的
// yishengEntity.setYishengContent("");//照片
// yishengEntity.setCreateTime(date);//时间
yishengList.add(yishengEntity);
//把要查询是否重复的字段放入map中
//医生工号
if(seachFields.containsKey("yishengUuidNumber")){
List<String> yishengUuidNumber = seachFields.get("yishengUuidNumber");
yishengUuidNumber.add(data.get(0));//要改的
}else{
List<String> yishengUuidNumber = new ArrayList<>();
yishengUuidNumber.add(data.get(0));//要改的
seachFields.put("yishengUuidNumber",yishengUuidNumber);
}
//账户
if(seachFields.containsKey("username")){
List<String> username = seachFields.get("username");
username.add(data.get(0));//要改的
}else{
List<String> username = new ArrayList<>();
username.add(data.get(0));//要改的
seachFields.put("username",username);
}
//联系方式
if(seachFields.containsKey("yishengPhone")){
List<String> yishengPhone = seachFields.get("yishengPhone");
yishengPhone.add(data.get(0));//要改的
}else{
List<String> yishengPhone = new ArrayList<>();
yishengPhone.add(data.get(0));//要改的
seachFields.put("yishengPhone",yishengPhone);
}
}
//查询是否重复
//医生工号
List<YishengEntity> yishengEntities_yishengUuidNumber = yishengService.selectList(new EntityWrapper<YishengEntity>().in("yisheng_uuid_number", seachFields.get("yishengUuidNumber")));
if(yishengEntities_yishengUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YishengEntity s:yishengEntities_yishengUuidNumber){
repeatFields.add(s.getYishengUuidNumber());
}
return R.error(511,"数据库的该表中的 [医生工号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//账户
List<YishengEntity> yishengEntities_username = yishengService.selectList(new EntityWrapper<YishengEntity>().in("username", seachFields.get("username")));
if(yishengEntities_username.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YishengEntity s:yishengEntities_username){
repeatFields.add(s.getUsername());
}
return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//联系方式
List<YishengEntity> yishengEntities_yishengPhone = yishengService.selectList(new EntityWrapper<YishengEntity>().in("yisheng_phone", seachFields.get("yishengPhone")));
if(yishengEntities_yishengPhone.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YishengEntity s:yishengEntities_yishengPhone){
repeatFields.add(s.getYishengPhone());
}
return R.error(511,"数据库的该表中的 [联系方式] 字段已经存在 存在数据为:"+repeatFields.toString());
}
yishengService.insertBatch(yishengList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YishengEntity yisheng = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("username", username));
if(yisheng==null || !yisheng.getPassword().equals(password))
return R.error("账号或密码不正确");
// // 获取监听器中的字典表
// ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
// Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
// Map<Integer, String> role_types = dictionaryMap.get("role_types");
// role_types.get(.getRoleTypes());
String token = tokenService.generateToken(yisheng.getId(),username, "yisheng", "医生");
R r = R.ok();
r.put("token", token);
r.put("role","医生");
r.put("username",yisheng.getYishengName());
r.put("tableName","yisheng");
r.put("userId",yisheng.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YishengEntity yisheng){
// ValidatorUtils.validateEntity(user);
Wrapper<YishengEntity> queryWrapper = new EntityWrapper<YishengEntity>()
.eq("username", yisheng.getUsername())
.or()
.eq("yisheng_phone", yisheng.getYishengPhone())
;
YishengEntity yishengEntity = yishengService.selectOne(queryWrapper);
if(yishengEntity != null)
return R.error("账户或者联系方式已经被使用");
yisheng.setYishengNewMoney(0.0);
yisheng.setCreateTime(new Date());
yishengService.insert(yisheng);
return R.ok();
}
/**
*
*/
@GetMapping(value = "/resetPassword")
public R resetPassword(Integer id){
YishengEntity yisheng = new YishengEntity();
yisheng.setPassword("123456");
yisheng.setId(id);
yishengService.updateById(yisheng);
return R.ok();
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request) {
YishengEntity yisheng = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("username", username));
if(yisheng!=null){
yisheng.setPassword("123456");
boolean b = yishengService.updateById(yisheng);
if(!b){
return R.error();
}
}else{
return R.error("账号不存在");
}
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYisheng(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
YishengEntity yisheng = yishengService.selectById(id);
if(yisheng !=null){
//entity转view
YishengView view = new YishengView();
BeanUtils.copyProperties( yisheng , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = yishengService.queryPage(params);
//字典表数据转换
List<YishengView> list =(List<YishengView>)page.getList();
for(YishengView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YishengEntity yisheng = yishengService.selectById(id);
if(yisheng !=null){
//entity转view
YishengView view = new YishengView();
BeanUtils.copyProperties( yisheng , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody YishengEntity yisheng, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,yisheng:{}",this.getClass().getName(),yisheng.toString());
Wrapper<YishengEntity> queryWrapper = new EntityWrapper<YishengEntity>()
.eq("username", yisheng.getUsername())
.or()
.eq("yisheng_phone", yisheng.getYishengPhone())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YishengEntity yishengEntity = yishengService.selectOne(queryWrapper);
if(yishengEntity==null){
yisheng.setCreateTime(new Date());
yisheng.setPassword("123456");
yishengService.insert(yisheng);
return R.ok();
}else {
return R.error(511,"账户或者联系方式已经被使用");
}
}
}

@ -0,0 +1,503 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@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;
//级联表service
@Autowired
private YishengService yishengService;
/**
*
*/
@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(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
params.put("yonghuDeleteStart",1);params.put("yonghuDeleteEnd",1);
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = yonghuService.queryPage(params);
//字典表数据转换
List<YonghuView> list =(List<YonghuView>)page.getList();
for(YonghuView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
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, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
yonghu.setYonghuDelete(1);
yonghu.setCreateTime(new Date());
yonghu.setPassword("123456");
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());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.notIn("id",yonghu.getId())
.andNew()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){
yonghu.setYonghuPhoto(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());
ArrayList<YonghuEntity> list = new ArrayList<>();
for(Integer id:ids){
YonghuEntity yonghuEntity = new YonghuEntity();
yonghuEntity.setId(id);
yonghuEntity.setYonghuDelete(2);
list.add(yonghuEntity);
}
if(list != null && list.size() >0){
yonghuService.updateBatchById(list);
}
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<YonghuEntity> yonghuList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
YonghuEntity yonghuEntity = new YonghuEntity();
// yonghuEntity.setUsername(data.get(0)); //账户 要改的
// //yonghuEntity.setPassword("123456");//密码
// yonghuEntity.setYonghuName(data.get(0)); //用户姓名 要改的
// yonghuEntity.setYonghuPhoto("");//照片
// yonghuEntity.setYonghuPhone(data.get(0)); //用户手机号 要改的
// yonghuEntity.setYonghuIdNumber(data.get(0)); //用户身份证号 要改的
// yonghuEntity.setYonghuEmail(data.get(0)); //邮箱 要改的
// yonghuEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的
// yonghuEntity.setNewMoney(data.get(0)); //余额 要改的
// yonghuEntity.setYonghuDelete(1);//逻辑删除字段
// yonghuEntity.setCreateTime(date);//时间
yonghuList.add(yonghuEntity);
//把要查询是否重复的字段放入map中
//账户
if(seachFields.containsKey("username")){
List<String> username = seachFields.get("username");
username.add(data.get(0));//要改的
}else{
List<String> username = new ArrayList<>();
username.add(data.get(0));//要改的
seachFields.put("username",username);
}
//用户手机号
if(seachFields.containsKey("yonghuPhone")){
List<String> yonghuPhone = seachFields.get("yonghuPhone");
yonghuPhone.add(data.get(0));//要改的
}else{
List<String> yonghuPhone = new ArrayList<>();
yonghuPhone.add(data.get(0));//要改的
seachFields.put("yonghuPhone",yonghuPhone);
}
//用户身份证号
if(seachFields.containsKey("yonghuIdNumber")){
List<String> yonghuIdNumber = seachFields.get("yonghuIdNumber");
yonghuIdNumber.add(data.get(0));//要改的
}else{
List<String> yonghuIdNumber = new ArrayList<>();
yonghuIdNumber.add(data.get(0));//要改的
seachFields.put("yonghuIdNumber",yonghuIdNumber);
}
}
//查询是否重复
//账户
List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")).eq("yonghu_delete", 1));
if(yonghuEntities_username.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YonghuEntity s:yonghuEntities_username){
repeatFields.add(s.getUsername());
}
return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//用户手机号
List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")).eq("yonghu_delete", 1));
if(yonghuEntities_yonghuPhone.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YonghuEntity s:yonghuEntities_yonghuPhone){
repeatFields.add(s.getYonghuPhone());
}
return R.error(511,"数据库的该表中的 [用户手机号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//用户身份证号
List<YonghuEntity> yonghuEntities_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")).eq("yonghu_delete", 1));
if(yonghuEntities_yonghuIdNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YonghuEntity s:yonghuEntities_yonghuIdNumber){
repeatFields.add(s.getYonghuIdNumber());
}
return R.error(511,"数据库的该表中的 [用户身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
yonghuService.insertBatch(yonghuList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(yonghu==null || !yonghu.getPassword().equals(password))
return R.error("账号或密码不正确");
else if(yonghu.getYonghuDelete() != 1)
return R.error("账户已被删除");
// // 获取监听器中的字典表
// ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
// Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
// Map<Integer, String> role_types = dictionaryMap.get("role_types");
// role_types.get(.getRoleTypes());
String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用户");
R r = R.ok();
r.put("token", token);
r.put("role","用户");
r.put("username",yonghu.getYonghuName());
r.put("tableName","yonghu");
r.put("userId",yonghu.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YonghuEntity yonghu){
// ValidatorUtils.validateEntity(user);
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.andNew()
.eq("yonghu_delete", 1)
;
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity != null)
return R.error("账户或者用户手机号或者用户身份证号已经被使用");
yonghu.setNewMoney(0.0);
yonghu.setYonghuDelete(1);
yonghu.setCreateTime(new Date());
yonghuService.insert(yonghu);
return R.ok();
}
/**
*
*/
@GetMapping(value = "/resetPassword")
public R resetPassword(Integer id){
YonghuEntity yonghu = new YonghuEntity();
yonghu.setPassword("123456");
yonghu.setId(id);
yonghuService.updateById(yonghu);
return R.ok();
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(yonghu!=null){
yonghu.setPassword("123456");
boolean b = yonghuService.updateById(yonghu);
if(!b){
return R.error();
}
}else{
return R.error("账号不存在");
}
return R.ok();
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
YonghuEntity yonghu = yonghuService.selectById(id);
if(yonghu !=null){
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = yonghuService.queryPage(params);
//字典表数据转换
List<YonghuView> list =(List<YonghuView>)page.getList();
for(YonghuView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,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, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
yonghu.setYonghuDelete(1);
yonghu.setCreateTime(new Date());
yonghu.setPassword("123456");
yonghuService.insert(yonghu);
return R.ok();
}else {
return R.error(511,"账户或者用户手机号或者用户身份证号已经被使用");
}
}
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ChatEntity;
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.ChatView;
/**
* 线 Dao
*
* @author
*/
public interface ChatDao extends BaseMapper<ChatEntity> {
List<ChatView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,152 @@
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);
/**
tableName
condition1 1
condition1Value 1
average
* */
Map<String, Object> queryScore(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
List<Map<String, Object>> chartBoth(Map<String, Object> params);
List<Map<String, Object>> chartOne(Map<String, Object> params);
/**
*
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int plusCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int reduceCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int updateCloumValue(Map<String, Object> params);
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barCount(Map<String, Object> params);
}

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

@ -0,0 +1,21 @@
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
*/
public interface DictionaryDao extends BaseMapper<DictionaryEntity> {
List<DictionaryView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.GuahaoEntity;
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.GuahaoView;
/**
* Dao
*
* @author
*/
public interface GuahaoDao extends BaseMapper<GuahaoEntity> {
List<GuahaoView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.JiankangjiaoyuEntity;
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.JiankangjiaoyuView;
/**
* Dao
*
* @author
*/
public interface JiankangjiaoyuDao extends BaseMapper<JiankangjiaoyuEntity> {
List<JiankangjiaoyuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.NewsEntity;
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.NewsView;
/**
* Dao
*
* @author
*/
public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsView> 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.UsersEntity;
/**
*
*/
public interface UsersDao extends BaseMapper<UsersEntity> {
List<UsersEntity> selectListView(@Param("ew") Wrapper<UsersEntity> wrapper);
List<UsersEntity> selectListView(Pagination page, @Param("ew") Wrapper<UsersEntity> wrapper);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YishengEntity;
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.YishengView;
/**
* Dao
*
* @author
*/
public interface YishengDao extends BaseMapper<YishengEntity> {
List<YishengView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
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
*/
public interface YonghuDao extends BaseMapper<YonghuEntity> {
List<YonghuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,277 @@
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
*/
@TableName("chat")
public class ChatEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ChatEntity() {
}
public ChatEntity(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 = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "chat_issue")
private String chatIssue;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "issue_time")
private Date issueTime;
/**
*
*/
@TableField(value = "chat_reply")
private String chatReply;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "reply_time")
private Date replyTime;
/**
*
*/
@TableField(value = "zhuangtai_types")
private Integer zhuangtaiTypes;
/**
*
*/
@TableField(value = "chat_types")
private Integer chatTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getChatIssue() {
return chatIssue;
}
/**
*
*/
public void setChatIssue(String chatIssue) {
this.chatIssue = chatIssue;
}
/**
*
*/
public Date getIssueTime() {
return issueTime;
}
/**
*
*/
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
*
*/
public String getChatReply() {
return chatReply;
}
/**
*
*/
public void setChatReply(String chatReply) {
this.chatReply = chatReply;
}
/**
*
*/
public Date getReplyTime() {
return replyTime;
}
/**
*
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
*
*/
public Integer getZhuangtaiTypes() {
return zhuangtaiTypes;
}
/**
*
*/
public void setZhuangtaiTypes(Integer zhuangtaiTypes) {
this.zhuangtaiTypes = zhuangtaiTypes;
}
/**
*
*/
public Integer getChatTypes() {
return chatTypes;
}
/**
*
*/
public void setChatTypes(Integer chatTypes) {
this.chatTypes = chatTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
@Override
public String toString() {
return "Chat{" +
"id=" + id +
", yonghuId=" + yonghuId +
", chatIssue=" + chatIssue +
", issueTime=" + issueTime +
", chatReply=" + chatReply +
", replyTime=" + replyTime +
", zhuangtaiTypes=" + zhuangtaiTypes +
", chatTypes=" + chatTypes +
", insertTime=" + insertTime +
"}";
}
}

@ -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,249 @@
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
*/
@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;
/**
*
*/
@TableField(value = "beizhu")
private String beizhu;
/**
*
*/
@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 String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
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 +
", beizhu=" + beizhu +
", 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,299 @@
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
*/
@TableName("guahao")
public class GuahaoEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public GuahaoEntity() {
}
public GuahaoEntity(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 = "yisheng_id")
private Integer yishengId;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "guahao_uuin_number")
private String guahaoUuinNumber;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
@DateTimeFormat
@TableField(value = "guahao_time")
private Date guahaoTime;
/**
*
*/
@TableField(value = "guahao_types")
private Integer guahaoTypes;
/**
*
*/
@TableField(value = "guahao_status_types")
private Integer guahaoStatusTypes;
/**
*
*/
@TableField(value = "guahao_yesno_types")
private Integer guahaoYesnoTypes;
/**
*
*/
@TableField(value = "guahao_yesno_text")
private String guahaoYesnoText;
/**
*
*/
@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 Integer getYishengId() {
return yishengId;
}
/**
*
*/
public void setYishengId(Integer yishengId) {
this.yishengId = yishengId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getGuahaoUuinNumber() {
return guahaoUuinNumber;
}
/**
*
*/
public void setGuahaoUuinNumber(String guahaoUuinNumber) {
this.guahaoUuinNumber = guahaoUuinNumber;
}
/**
*
*/
public Date getGuahaoTime() {
return guahaoTime;
}
/**
*
*/
public void setGuahaoTime(Date guahaoTime) {
this.guahaoTime = guahaoTime;
}
/**
*
*/
public Integer getGuahaoTypes() {
return guahaoTypes;
}
/**
*
*/
public void setGuahaoTypes(Integer guahaoTypes) {
this.guahaoTypes = guahaoTypes;
}
/**
*
*/
public Integer getGuahaoStatusTypes() {
return guahaoStatusTypes;
}
/**
*
*/
public void setGuahaoStatusTypes(Integer guahaoStatusTypes) {
this.guahaoStatusTypes = guahaoStatusTypes;
}
/**
*
*/
public Integer getGuahaoYesnoTypes() {
return guahaoYesnoTypes;
}
/**
*
*/
public void setGuahaoYesnoTypes(Integer guahaoYesnoTypes) {
this.guahaoYesnoTypes = guahaoYesnoTypes;
}
/**
*
*/
public String getGuahaoYesnoText() {
return guahaoYesnoText;
}
/**
*
*/
public void setGuahaoYesnoText(String guahaoYesnoText) {
this.guahaoYesnoText = guahaoYesnoText;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Guahao{" +
"id=" + id +
", yishengId=" + yishengId +
", yonghuId=" + yonghuId +
", guahaoUuinNumber=" + guahaoUuinNumber +
", guahaoTime=" + guahaoTime +
", guahaoTypes=" + guahaoTypes +
", guahaoStatusTypes=" + guahaoStatusTypes +
", guahaoYesnoTypes=" + guahaoYesnoTypes +
", guahaoYesnoText=" + guahaoYesnoText +
", createTime=" + createTime +
"}";
}
}

@ -0,0 +1,251 @@
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
*/
@TableName("jiankangjiaoyu")
public class JiankangjiaoyuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public JiankangjiaoyuEntity() {
}
public JiankangjiaoyuEntity(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 = "jiankangjiaoyu_name")
private String jiankangjiaoyuName;
/**
*
*/
@TableField(value = "jiankangjiaoyu_types")
private Integer jiankangjiaoyuTypes;
/**
*
*/
@TableField(value = "jiankangjiaoyu_photo")
private String jiankangjiaoyuPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@TableField(value = "jiankangjiaoyu_content")
private String jiankangjiaoyuContent;
/**
*
*/
@TableField(value = "jiankangjiaoyu_delete")
private Integer jiankangjiaoyuDelete;
/**
*
*/
@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 getJiankangjiaoyuName() {
return jiankangjiaoyuName;
}
/**
*
*/
public void setJiankangjiaoyuName(String jiankangjiaoyuName) {
this.jiankangjiaoyuName = jiankangjiaoyuName;
}
/**
*
*/
public Integer getJiankangjiaoyuTypes() {
return jiankangjiaoyuTypes;
}
/**
*
*/
public void setJiankangjiaoyuTypes(Integer jiankangjiaoyuTypes) {
this.jiankangjiaoyuTypes = jiankangjiaoyuTypes;
}
/**
*
*/
public String getJiankangjiaoyuPhoto() {
return jiankangjiaoyuPhoto;
}
/**
*
*/
public void setJiankangjiaoyuPhoto(String jiankangjiaoyuPhoto) {
this.jiankangjiaoyuPhoto = jiankangjiaoyuPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangjiaoyuContent() {
return jiankangjiaoyuContent;
}
/**
*
*/
public void setJiankangjiaoyuContent(String jiankangjiaoyuContent) {
this.jiankangjiaoyuContent = jiankangjiaoyuContent;
}
/**
*
*/
public Integer getJiankangjiaoyuDelete() {
return jiankangjiaoyuDelete;
}
/**
*
*/
public void setJiankangjiaoyuDelete(Integer jiankangjiaoyuDelete) {
this.jiankangjiaoyuDelete = jiankangjiaoyuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Jiankangjiaoyu{" +
"id=" + id +
", jiankangjiaoyuName=" + jiankangjiaoyuName +
", jiankangjiaoyuTypes=" + jiankangjiaoyuTypes +
", jiankangjiaoyuPhoto=" + jiankangjiaoyuPhoto +
", insertTime=" + insertTime +
", jiankangjiaoyuContent=" + jiankangjiaoyuContent +
", jiankangjiaoyuDelete=" + jiankangjiaoyuDelete +
", createTime=" + createTime +
"}";
}
}

@ -0,0 +1,227 @@
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
*/
@TableName("news")
public class NewsEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public NewsEntity() {
}
public NewsEntity(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 = "news_name")
private String newsName;
/**
*
*/
@TableField(value = "news_photo")
private String newsPhoto;
/**
*
*/
@TableField(value = "news_types")
private Integer newsTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@TableField(value = "news_content")
private String newsContent;
/**
*
*/
@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 getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "News{" +
"id=" + id +
", newsName=" + newsName +
", newsPhoto=" + newsPhoto +
", newsTypes=" + newsTypes +
", insertTime=" + insertTime +
", newsContent=" + newsContent +
", createTime=" + createTime +
"}";
}
}

@ -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,77 @@
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 UsersEntity 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;
}
public void setId(Integer id) {
this.id = id;
}
}

@ -0,0 +1,417 @@
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
*/
@TableName("yisheng")
public class YishengEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public YishengEntity() {
}
public YishengEntity(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 = "yisheng_uuid_number")
private String yishengUuidNumber;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "yisheng_name")
private String yishengName;
/**
*
*/
@TableField(value = "yisheng_types")
private Integer yishengTypes;
/**
*
*/
@TableField(value = "zhiwei_types")
private Integer zhiweiTypes;
/**
*
*/
@TableField(value = "yisheng_zhichneg")
private String yishengZhichneg;
/**
*
*/
@TableField(value = "yisheng_photo")
private String yishengPhoto;
/**
*
*/
@TableField(value = "yisheng_phone")
private String yishengPhone;
/**
*
*/
@TableField(value = "yisheng_guahao")
private String yishengGuahao;
/**
*
*/
@TableField(value = "yisheng_email")
private String yishengEmail;
/**
*
*/
@TableField(value = "yisheng_new_money")
private Double yishengNewMoney;
/**
*
*/
@TableField(value = "yisheng_content")
private String yishengContent;
/**
*
*/
@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 getYishengUuidNumber() {
return yishengUuidNumber;
}
/**
*
*/
public void setYishengUuidNumber(String yishengUuidNumber) {
this.yishengUuidNumber = yishengUuidNumber;
}
/**
*
*/
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 getYishengName() {
return yishengName;
}
/**
*
*/
public void setYishengName(String yishengName) {
this.yishengName = yishengName;
}
/**
*
*/
public Integer getYishengTypes() {
return yishengTypes;
}
/**
*
*/
public void setYishengTypes(Integer yishengTypes) {
this.yishengTypes = yishengTypes;
}
/**
*
*/
public Integer getZhiweiTypes() {
return zhiweiTypes;
}
/**
*
*/
public void setZhiweiTypes(Integer zhiweiTypes) {
this.zhiweiTypes = zhiweiTypes;
}
/**
*
*/
public String getYishengZhichneg() {
return yishengZhichneg;
}
/**
*
*/
public void setYishengZhichneg(String yishengZhichneg) {
this.yishengZhichneg = yishengZhichneg;
}
/**
*
*/
public String getYishengPhoto() {
return yishengPhoto;
}
/**
*
*/
public void setYishengPhoto(String yishengPhoto) {
this.yishengPhoto = yishengPhoto;
}
/**
*
*/
public String getYishengPhone() {
return yishengPhone;
}
/**
*
*/
public void setYishengPhone(String yishengPhone) {
this.yishengPhone = yishengPhone;
}
/**
*
*/
public String getYishengGuahao() {
return yishengGuahao;
}
/**
*
*/
public void setYishengGuahao(String yishengGuahao) {
this.yishengGuahao = yishengGuahao;
}
/**
*
*/
public String getYishengEmail() {
return yishengEmail;
}
/**
*
*/
public void setYishengEmail(String yishengEmail) {
this.yishengEmail = yishengEmail;
}
/**
*
*/
public Double getYishengNewMoney() {
return yishengNewMoney;
}
/**
*
*/
public void setYishengNewMoney(Double yishengNewMoney) {
this.yishengNewMoney = yishengNewMoney;
}
/**
*
*/
public String getYishengContent() {
return yishengContent;
}
/**
*
*/
public void setYishengContent(String yishengContent) {
this.yishengContent = yishengContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Yisheng{" +
"id=" + id +
", yishengUuidNumber=" + yishengUuidNumber +
", username=" + username +
", password=" + password +
", yishengName=" + yishengName +
", yishengTypes=" + yishengTypes +
", zhiweiTypes=" + zhiweiTypes +
", yishengZhichneg=" + yishengZhichneg +
", yishengPhoto=" + yishengPhoto +
", yishengPhone=" + yishengPhone +
", yishengGuahao=" + yishengGuahao +
", yishengEmail=" + yishengEmail +
", yishengNewMoney=" + yishengNewMoney +
", yishengContent=" + yishengContent +
", createTime=" + createTime +
"}";
}
}

@ -0,0 +1,345 @@
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
*/
@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();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "yonghu_name")
private String yonghuName;
/**
*
*/
@TableField(value = "yonghu_photo")
private String yonghuPhoto;
/**
*
*/
@TableField(value = "yonghu_phone")
private String yonghuPhone;
/**
*
*/
@TableField(value = "yonghu_id_number")
private String yonghuIdNumber;
/**
*
*/
@TableField(value = "yonghu_email")
private String yonghuEmail;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@TableField(value = "new_money")
private Double newMoney;
/**
*
*/
@TableField(value = "yonghu_delete")
private Integer yonghuDelete;
/**
*
*/
@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 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 getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public Double getNewMoney() {
return newMoney;
}
/**
*
*/
public void setNewMoney(Double newMoney) {
this.newMoney = newMoney;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Yonghu{" +
"id=" + id +
", username=" + username +
", password=" + password +
", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto +
", yonghuPhone=" + yonghuPhone +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuEmail=" + yonghuEmail +
", sexTypes=" + sexTypes +
", newMoney=" + newMoney +
", yonghuDelete=" + yonghuDelete +
", createTime=" + createTime +
"}";
}
}

@ -0,0 +1,211 @@
package com.entity.model;
import com.entity.ChatEntity;
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
*/
public class ChatModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String chatIssue;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date issueTime;
/**
*
*/
private String chatReply;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date replyTime;
/**
*
*/
private Integer zhuangtaiTypes;
/**
*
*/
private Integer chatTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getChatIssue() {
return chatIssue;
}
/**
*
*/
public void setChatIssue(String chatIssue) {
this.chatIssue = chatIssue;
}
/**
*
*/
public Date getIssueTime() {
return issueTime;
}
/**
*
*/
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
*
*/
public String getChatReply() {
return chatReply;
}
/**
*
*/
public void setChatReply(String chatReply) {
this.chatReply = chatReply;
}
/**
*
*/
public Date getReplyTime() {
return replyTime;
}
/**
*
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
*
*/
public Integer getZhuangtaiTypes() {
return zhuangtaiTypes;
}
/**
*
*/
public void setZhuangtaiTypes(Integer zhuangtaiTypes) {
this.zhuangtaiTypes = zhuangtaiTypes;
}
/**
*
*/
public Integer getChatTypes() {
return chatTypes;
}
/**
*
*/
public void setChatTypes(Integer chatTypes) {
this.chatTypes = chatTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
}

@ -0,0 +1,187 @@
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
*/
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;
/**
*
*/
private String beizhu;
/**
*
*/
@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 String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,229 @@
package com.entity.model;
import com.entity.GuahaoEntity;
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
*/
public class GuahaoModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yishengId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer guahaoUuinNumber;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date guahaoTime;
/**
*
*/
private Integer guahaoTypes;
/**
*
*/
private Integer guahaoStatusTypes;
/**
*
*/
private Integer guahaoYesnoTypes;
/**
*
*/
private String guahaoYesnoText;
/**
*
*/
@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 Integer getYishengId() {
return yishengId;
}
/**
*
*/
public void setYishengId(Integer yishengId) {
this.yishengId = yishengId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getGuahaoUuinNumber() {
return guahaoUuinNumber;
}
/**
*
*/
public void setGuahaoUuinNumber(Integer guahaoUuinNumber) {
this.guahaoUuinNumber = guahaoUuinNumber;
}
/**
*
*/
public Date getGuahaoTime() {
return guahaoTime;
}
/**
*
*/
public void setGuahaoTime(Date guahaoTime) {
this.guahaoTime = guahaoTime;
}
/**
*
*/
public Integer getGuahaoTypes() {
return guahaoTypes;
}
/**
*
*/
public void setGuahaoTypes(Integer guahaoTypes) {
this.guahaoTypes = guahaoTypes;
}
/**
*
*/
public Integer getGuahaoStatusTypes() {
return guahaoStatusTypes;
}
/**
*
*/
public void setGuahaoStatusTypes(Integer guahaoStatusTypes) {
this.guahaoStatusTypes = guahaoStatusTypes;
}
/**
*
*/
public Integer getGuahaoYesnoTypes() {
return guahaoYesnoTypes;
}
/**
*
*/
public void setGuahaoYesnoTypes(Integer guahaoYesnoTypes) {
this.guahaoYesnoTypes = guahaoYesnoTypes;
}
/**
*
*/
public String getGuahaoYesnoText() {
return guahaoYesnoText;
}
/**
*
*/
public void setGuahaoYesnoText(String guahaoYesnoText) {
this.guahaoYesnoText = guahaoYesnoText;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,189 @@
package com.entity.model;
import com.entity.JiankangjiaoyuEntity;
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
*/
public class JiankangjiaoyuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String jiankangjiaoyuName;
/**
*
*/
private Integer jiankangjiaoyuTypes;
/**
*
*/
private String jiankangjiaoyuPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String jiankangjiaoyuContent;
/**
*
*/
private Integer jiankangjiaoyuDelete;
/**
* show1 show2 nameShow
*/
@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 getJiankangjiaoyuName() {
return jiankangjiaoyuName;
}
/**
*
*/
public void setJiankangjiaoyuName(String jiankangjiaoyuName) {
this.jiankangjiaoyuName = jiankangjiaoyuName;
}
/**
*
*/
public Integer getJiankangjiaoyuTypes() {
return jiankangjiaoyuTypes;
}
/**
*
*/
public void setJiankangjiaoyuTypes(Integer jiankangjiaoyuTypes) {
this.jiankangjiaoyuTypes = jiankangjiaoyuTypes;
}
/**
*
*/
public String getJiankangjiaoyuPhoto() {
return jiankangjiaoyuPhoto;
}
/**
*
*/
public void setJiankangjiaoyuPhoto(String jiankangjiaoyuPhoto) {
this.jiankangjiaoyuPhoto = jiankangjiaoyuPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangjiaoyuContent() {
return jiankangjiaoyuContent;
}
/**
*
*/
public void setJiankangjiaoyuContent(String jiankangjiaoyuContent) {
this.jiankangjiaoyuContent = jiankangjiaoyuContent;
}
/**
*
*/
public Integer getJiankangjiaoyuDelete() {
return jiankangjiaoyuDelete;
}
/**
*
*/
public void setJiankangjiaoyuDelete(Integer jiankangjiaoyuDelete) {
this.jiankangjiaoyuDelete = jiankangjiaoyuDelete;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,169 @@
package com.entity.model;
import com.entity.NewsEntity;
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
*/
public class NewsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String newsName;
/**
*
*/
private String newsPhoto;
/**
*
*/
private Integer newsTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String newsContent;
/**
* show1 show2 nameShow
*/
@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 getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,327 @@
package com.entity.model;
import com.entity.YishengEntity;
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
*/
public class YishengModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String yishengUuidNumber;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String yishengName;
/**
*
*/
private Integer yishengTypes;
/**
*
*/
private Integer zhiweiTypes;
/**
*
*/
private String yishengZhichneg;
/**
*
*/
private String yishengPhoto;
/**
*
*/
private String yishengPhone;
/**
*
*/
private String yishengGuahao;
/**
*
*/
private String yishengEmail;
/**
*
*/
private Double yishengNewMoney;
/**
*
*/
private String yishengContent;
/**
* show1 show2 photoShow
*/
@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 getYishengUuidNumber() {
return yishengUuidNumber;
}
/**
*
*/
public void setYishengUuidNumber(String yishengUuidNumber) {
this.yishengUuidNumber = yishengUuidNumber;
}
/**
*
*/
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 getYishengName() {
return yishengName;
}
/**
*
*/
public void setYishengName(String yishengName) {
this.yishengName = yishengName;
}
/**
*
*/
public Integer getYishengTypes() {
return yishengTypes;
}
/**
*
*/
public void setYishengTypes(Integer yishengTypes) {
this.yishengTypes = yishengTypes;
}
/**
*
*/
public Integer getZhiweiTypes() {
return zhiweiTypes;
}
/**
*
*/
public void setZhiweiTypes(Integer zhiweiTypes) {
this.zhiweiTypes = zhiweiTypes;
}
/**
*
*/
public String getYishengZhichneg() {
return yishengZhichneg;
}
/**
*
*/
public void setYishengZhichneg(String yishengZhichneg) {
this.yishengZhichneg = yishengZhichneg;
}
/**
*
*/
public String getYishengPhoto() {
return yishengPhoto;
}
/**
*
*/
public void setYishengPhoto(String yishengPhoto) {
this.yishengPhoto = yishengPhoto;
}
/**
*
*/
public String getYishengPhone() {
return yishengPhone;
}
/**
*
*/
public void setYishengPhone(String yishengPhone) {
this.yishengPhone = yishengPhone;
}
/**
*
*/
public String getYishengGuahao() {
return yishengGuahao;
}
/**
*
*/
public void setYishengGuahao(String yishengGuahao) {
this.yishengGuahao = yishengGuahao;
}
/**
*
*/
public String getYishengEmail() {
return yishengEmail;
}
/**
*
*/
public void setYishengEmail(String yishengEmail) {
this.yishengEmail = yishengEmail;
}
/**
*
*/
public Double getYishengNewMoney() {
return yishengNewMoney;
}
/**
*
*/
public void setYishengNewMoney(Double yishengNewMoney) {
this.yishengNewMoney = yishengNewMoney;
}
/**
*
*/
public String getYishengContent() {
return yishengContent;
}
/**
*
*/
public void setYishengContent(String yishengContent) {
this.yishengContent = yishengContent;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,267 @@
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
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String yonghuName;
/**
*
*/
private String yonghuPhoto;
/**
*
*/
private String yonghuPhone;
/**
*
*/
private String yonghuIdNumber;
/**
*
*/
private String yonghuEmail;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private Double newMoney;
/**
*
*/
private Integer yonghuDelete;
/**
*
*/
@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 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 getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public Double getNewMoney() {
return newMoney;
}
/**
*
*/
public void setNewMoney(Double newMoney) {
this.newMoney = newMoney;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,204 @@
package com.entity.view;
import com.entity.ChatEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 线
*
* 使
*/
@TableName("chat")
public class ChatView extends ChatEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String zhuangtaiValue;
/**
*
*/
private String chatValue;
//级联表 yonghu
/**
*
*/
private String yonghuName;
/**
*
*/
private String yonghuPhoto;
/**
*
*/
private String yonghuPhone;
/**
*
*/
private String yonghuIdNumber;
/**
*
*/
private String yonghuEmail;
/**
*
*/
private Double newMoney;
/**
*
*/
private Integer yonghuDelete;
public ChatView() {
}
public ChatView(ChatEntity chatEntity) {
try {
BeanUtils.copyProperties(this, chatEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getZhuangtaiValue() {
return zhuangtaiValue;
}
/**
*
*/
public void setZhuangtaiValue(String zhuangtaiValue) {
this.zhuangtaiValue = zhuangtaiValue;
}
/**
*
*/
public String getChatValue() {
return chatValue;
}
/**
*
*/
public void setChatValue(String chatValue) {
this.chatValue = chatValue;
}
//级联表的get和set yonghu
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Double getNewMoney() {
return newMoney;
}
/**
*
*/
public void setNewMoney(Double newMoney) {
this.newMoney = newMoney;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
}

@ -0,0 +1,57 @@
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 org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@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,443 @@
package com.entity.view;
import com.entity.GuahaoEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@TableName("guahao")
public class GuahaoView extends GuahaoEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String guahaoValue;
/**
*
*/
private String guahaoStatusValue;
/**
*
*/
private String guahaoYesnoValue;
//级联表 yisheng
/**
*
*/
private String yishengUuidNumber;
/**
*
*/
private String yishengName;
/**
*
*/
private Integer yishengTypes;
/**
*
*/
private String yishengValue;
/**
*
*/
private Integer zhiweiTypes;
/**
*
*/
private String zhiweiValue;
/**
*
*/
private String yishengZhichneg;
/**
*
*/
private String yishengPhoto;
/**
*
*/
private String yishengPhone;
/**
*
*/
private String yishengGuahao;
/**
*
*/
private String yishengEmail;
/**
*
*/
private Double yishengNewMoney;
/**
*
*/
private String yishengContent;
//级联表 yonghu
/**
*
*/
private String yonghuName;
/**
*
*/
private String yonghuPhoto;
/**
*
*/
private String yonghuPhone;
/**
*
*/
private String yonghuIdNumber;
/**
*
*/
private String yonghuEmail;
/**
*
*/
private Double newMoney;
/**
*
*/
private Integer yonghuDelete;
public GuahaoView() {
}
public GuahaoView(GuahaoEntity guahaoEntity) {
try {
BeanUtils.copyProperties(this, guahaoEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getGuahaoValue() {
return guahaoValue;
}
/**
*
*/
public void setGuahaoValue(String guahaoValue) {
this.guahaoValue = guahaoValue;
}
/**
*
*/
public String getGuahaoStatusValue() {
return guahaoStatusValue;
}
/**
*
*/
public void setGuahaoStatusValue(String guahaoStatusValue) {
this.guahaoStatusValue = guahaoStatusValue;
}
/**
*
*/
public String getGuahaoYesnoValue() {
return guahaoYesnoValue;
}
/**
*
*/
public void setGuahaoYesnoValue(String guahaoYesnoValue) {
this.guahaoYesnoValue = guahaoYesnoValue;
}
//级联表的get和set yisheng
/**
*
*/
public String getYishengUuidNumber() {
return yishengUuidNumber;
}
/**
*
*/
public void setYishengUuidNumber(String yishengUuidNumber) {
this.yishengUuidNumber = yishengUuidNumber;
}
/**
*
*/
public String getYishengName() {
return yishengName;
}
/**
*
*/
public void setYishengName(String yishengName) {
this.yishengName = yishengName;
}
/**
*
*/
public Integer getYishengTypes() {
return yishengTypes;
}
/**
*
*/
public void setYishengTypes(Integer yishengTypes) {
this.yishengTypes = yishengTypes;
}
/**
*
*/
public String getYishengValue() {
return yishengValue;
}
/**
*
*/
public void setYishengValue(String yishengValue) {
this.yishengValue = yishengValue;
}
/**
*
*/
public Integer getZhiweiTypes() {
return zhiweiTypes;
}
/**
*
*/
public void setZhiweiTypes(Integer zhiweiTypes) {
this.zhiweiTypes = zhiweiTypes;
}
/**
*
*/
public String getZhiweiValue() {
return zhiweiValue;
}
/**
*
*/
public void setZhiweiValue(String zhiweiValue) {
this.zhiweiValue = zhiweiValue;
}
/**
*
*/
public String getYishengZhichneg() {
return yishengZhichneg;
}
/**
*
*/
public void setYishengZhichneg(String yishengZhichneg) {
this.yishengZhichneg = yishengZhichneg;
}
/**
*
*/
public String getYishengPhoto() {
return yishengPhoto;
}
/**
*
*/
public void setYishengPhoto(String yishengPhoto) {
this.yishengPhoto = yishengPhoto;
}
/**
*
*/
public String getYishengPhone() {
return yishengPhone;
}
/**
*
*/
public void setYishengPhone(String yishengPhone) {
this.yishengPhone = yishengPhone;
}
/**
*
*/
public String getYishengGuahao() {
return yishengGuahao;
}
/**
*
*/
public void setYishengGuahao(String yishengGuahao) {
this.yishengGuahao = yishengGuahao;
}
/**
*
*/
public String getYishengEmail() {
return yishengEmail;
}
/**
*
*/
public void setYishengEmail(String yishengEmail) {
this.yishengEmail = yishengEmail;
}
/**
*
*/
public Double getYishengNewMoney() {
return yishengNewMoney;
}
/**
*
*/
public void setYishengNewMoney(Double yishengNewMoney) {
this.yishengNewMoney = yishengNewMoney;
}
/**
*
*/
public String getYishengContent() {
return yishengContent;
}
/**
*
*/
public void setYishengContent(String yishengContent) {
this.yishengContent = yishengContent;
}
//级联表的get和set yonghu
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Double getNewMoney() {
return newMoney;
}
/**
*
*/
public void setNewMoney(Double newMoney) {
this.newMoney = newMoney;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
}

@ -0,0 +1,65 @@
package com.entity.view;
import com.entity.JiankangjiaoyuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@TableName("jiankangjiaoyu")
public class JiankangjiaoyuView extends JiankangjiaoyuEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String jiankangjiaoyuValue;
public JiankangjiaoyuView() {
}
public JiankangjiaoyuView(JiankangjiaoyuEntity jiankangjiaoyuEntity) {
try {
BeanUtils.copyProperties(this, jiankangjiaoyuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getJiankangjiaoyuValue() {
return jiankangjiaoyuValue;
}
/**
*
*/
public void setJiankangjiaoyuValue(String jiankangjiaoyuValue) {
this.jiankangjiaoyuValue = jiankangjiaoyuValue;
}
}

@ -0,0 +1,65 @@
package com.entity.view;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@TableName("news")
public class NewsView extends NewsEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String newsValue;
public NewsView() {
}
public NewsView(NewsEntity newsEntity) {
try {
BeanUtils.copyProperties(this, newsEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getNewsValue() {
return newsValue;
}
/**
*
*/
public void setNewsValue(String newsValue) {
this.newsValue = newsValue;
}
}

@ -0,0 +1,81 @@
package com.entity.view;
import com.entity.YishengEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@TableName("yisheng")
public class YishengView extends YishengEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String yishengValue;
/**
*
*/
private String zhiweiValue;
public YishengView() {
}
public YishengView(YishengEntity yishengEntity) {
try {
BeanUtils.copyProperties(this, yishengEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
public String getYishengValue() {
return yishengValue;
}
/**
*
*/
public void setYishengValue(String yishengValue) {
this.yishengValue = yishengValue;
}
/**
*
*/
public String getZhiweiValue() {
return zhiweiValue;
}
/**
*
*/
public void setZhiweiValue(String zhiweiValue) {
this.zhiweiValue = zhiweiValue;
}
}

@ -0,0 +1,65 @@
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 org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* 使
*/
@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,236 @@
package com.entity.vo;
import com.entity.ChatEntity;
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;
/**
* 线
*
*
*/
@TableName("chat")
public class ChatVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "chat_issue")
private String chatIssue;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "issue_time")
private Date issueTime;
/**
*
*/
@TableField(value = "chat_reply")
private String chatReply;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "reply_time")
private Date replyTime;
/**
*
*/
@TableField(value = "zhuangtai_types")
private Integer zhuangtaiTypes;
/**
*
*/
@TableField(value = "chat_types")
private Integer chatTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getChatIssue() {
return chatIssue;
}
/**
*
*/
public void setChatIssue(String chatIssue) {
this.chatIssue = chatIssue;
}
/**
*
*/
public Date getIssueTime() {
return issueTime;
}
/**
*
*/
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
*
*/
public String getChatReply() {
return chatReply;
}
/**
*
*/
public void setChatReply(String chatReply) {
this.chatReply = chatReply;
}
/**
*
*/
public Date getReplyTime() {
return replyTime;
}
/**
*
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
*
*/
public Integer getZhuangtaiTypes() {
return zhuangtaiTypes;
}
/**
*
*/
public void setZhuangtaiTypes(Integer zhuangtaiTypes) {
this.zhuangtaiTypes = zhuangtaiTypes;
}
/**
*
*/
public Integer getChatTypes() {
return chatTypes;
}
/**
*
*/
public void setChatTypes(Integer chatTypes) {
this.chatTypes = chatTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
}

@ -0,0 +1,209 @@
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;
/**
*
*
*
*/
@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;
/**
*
*/
@TableField(value = "beizhu")
private String beizhu;
/**
*
*/
@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 String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,257 @@
package com.entity.vo;
import com.entity.GuahaoEntity;
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;
/**
*
*
*
*/
@TableName("guahao")
public class GuahaoVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "yisheng_id")
private Integer yishengId;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "guahao_uuin_number")
private String guahaoUuinNumber;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "guahao_time")
private Date guahaoTime;
/**
*
*/
@TableField(value = "guahao_types")
private Integer guahaoTypes;
/**
*
*/
@TableField(value = "guahao_status_types")
private Integer guahaoStatusTypes;
/**
*
*/
@TableField(value = "guahao_yesno_types")
private Integer guahaoYesnoTypes;
/**
*
*/
@TableField(value = "guahao_yesno_text")
private String guahaoYesnoText;
/**
*
*/
@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 Integer getYishengId() {
return yishengId;
}
/**
*
*/
public void setYishengId(Integer yishengId) {
this.yishengId = yishengId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getGuahaoUuinNumber() {
return guahaoUuinNumber;
}
/**
*
*/
public void setGuahaoUuinNumber(String guahaoUuinNumber) {
this.guahaoUuinNumber = guahaoUuinNumber;
}
/**
*
*/
public Date getGuahaoTime() {
return guahaoTime;
}
/**
*
*/
public void setGuahaoTime(Date guahaoTime) {
this.guahaoTime = guahaoTime;
}
/**
*
*/
public Integer getGuahaoTypes() {
return guahaoTypes;
}
/**
*
*/
public void setGuahaoTypes(Integer guahaoTypes) {
this.guahaoTypes = guahaoTypes;
}
/**
*
*/
public Integer getGuahaoStatusTypes() {
return guahaoStatusTypes;
}
/**
*
*/
public void setGuahaoStatusTypes(Integer guahaoStatusTypes) {
this.guahaoStatusTypes = guahaoStatusTypes;
}
/**
*
*/
public Integer getGuahaoYesnoTypes() {
return guahaoYesnoTypes;
}
/**
*
*/
public void setGuahaoYesnoTypes(Integer guahaoYesnoTypes) {
this.guahaoYesnoTypes = guahaoYesnoTypes;
}
/**
*
*/
public String getGuahaoYesnoText() {
return guahaoYesnoText;
}
/**
*
*/
public void setGuahaoYesnoText(String guahaoYesnoText) {
this.guahaoYesnoText = guahaoYesnoText;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,211 @@
package com.entity.vo;
import com.entity.JiankangjiaoyuEntity;
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;
/**
*
*
*
*/
@TableName("jiankangjiaoyu")
public class JiankangjiaoyuVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "jiankangjiaoyu_name")
private String jiankangjiaoyuName;
/**
*
*/
@TableField(value = "jiankangjiaoyu_types")
private Integer jiankangjiaoyuTypes;
/**
*
*/
@TableField(value = "jiankangjiaoyu_photo")
private String jiankangjiaoyuPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
*
*/
@TableField(value = "jiankangjiaoyu_content")
private String jiankangjiaoyuContent;
/**
*
*/
@TableField(value = "jiankangjiaoyu_delete")
private Integer jiankangjiaoyuDelete;
/**
* show1 show2 nameShow
*/
@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 getJiankangjiaoyuName() {
return jiankangjiaoyuName;
}
/**
*
*/
public void setJiankangjiaoyuName(String jiankangjiaoyuName) {
this.jiankangjiaoyuName = jiankangjiaoyuName;
}
/**
*
*/
public Integer getJiankangjiaoyuTypes() {
return jiankangjiaoyuTypes;
}
/**
*
*/
public void setJiankangjiaoyuTypes(Integer jiankangjiaoyuTypes) {
this.jiankangjiaoyuTypes = jiankangjiaoyuTypes;
}
/**
*
*/
public String getJiankangjiaoyuPhoto() {
return jiankangjiaoyuPhoto;
}
/**
*
*/
public void setJiankangjiaoyuPhoto(String jiankangjiaoyuPhoto) {
this.jiankangjiaoyuPhoto = jiankangjiaoyuPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangjiaoyuContent() {
return jiankangjiaoyuContent;
}
/**
*
*/
public void setJiankangjiaoyuContent(String jiankangjiaoyuContent) {
this.jiankangjiaoyuContent = jiankangjiaoyuContent;
}
/**
*
*/
public Integer getJiankangjiaoyuDelete() {
return jiankangjiaoyuDelete;
}
/**
*
*/
public void setJiankangjiaoyuDelete(Integer jiankangjiaoyuDelete) {
this.jiankangjiaoyuDelete = jiankangjiaoyuDelete;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,188 @@
package com.entity.vo;
import com.entity.NewsEntity;
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;
/**
*
*
*
*/
@TableName("news")
public class NewsVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "news_name")
private String newsName;
/**
*
*/
@TableField(value = "news_photo")
private String newsPhoto;
/**
*
*/
@TableField(value = "news_types")
private Integer newsTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
*
*/
@TableField(value = "news_content")
private String newsContent;
/**
* show1 show2 nameShow
*/
@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 getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,370 @@
package com.entity.vo;
import com.entity.YishengEntity;
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;
/**
*
*
*
*/
@TableName("yisheng")
public class YishengVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "yisheng_uuid_number")
private String yishengUuidNumber;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "yisheng_name")
private String yishengName;
/**
*
*/
@TableField(value = "yisheng_types")
private Integer yishengTypes;
/**
*
*/
@TableField(value = "zhiwei_types")
private Integer zhiweiTypes;
/**
*
*/
@TableField(value = "yisheng_zhichneg")
private String yishengZhichneg;
/**
*
*/
@TableField(value = "yisheng_photo")
private String yishengPhoto;
/**
*
*/
@TableField(value = "yisheng_phone")
private String yishengPhone;
/**
*
*/
@TableField(value = "yisheng_guahao")
private String yishengGuahao;
/**
*
*/
@TableField(value = "yisheng_email")
private String yishengEmail;
/**
*
*/
@TableField(value = "yisheng_new_money")
private Double yishengNewMoney;
/**
*
*/
@TableField(value = "yisheng_content")
private String yishengContent;
/**
* show1 show2 photoShow
*/
@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 getYishengUuidNumber() {
return yishengUuidNumber;
}
/**
*
*/
public void setYishengUuidNumber(String yishengUuidNumber) {
this.yishengUuidNumber = yishengUuidNumber;
}
/**
*
*/
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 getYishengName() {
return yishengName;
}
/**
*
*/
public void setYishengName(String yishengName) {
this.yishengName = yishengName;
}
/**
*
*/
public Integer getYishengTypes() {
return yishengTypes;
}
/**
*
*/
public void setYishengTypes(Integer yishengTypes) {
this.yishengTypes = yishengTypes;
}
/**
*
*/
public Integer getZhiweiTypes() {
return zhiweiTypes;
}
/**
*
*/
public void setZhiweiTypes(Integer zhiweiTypes) {
this.zhiweiTypes = zhiweiTypes;
}
/**
*
*/
public String getYishengZhichneg() {
return yishengZhichneg;
}
/**
*
*/
public void setYishengZhichneg(String yishengZhichneg) {
this.yishengZhichneg = yishengZhichneg;
}
/**
*
*/
public String getYishengPhoto() {
return yishengPhoto;
}
/**
*
*/
public void setYishengPhoto(String yishengPhoto) {
this.yishengPhoto = yishengPhoto;
}
/**
*
*/
public String getYishengPhone() {
return yishengPhone;
}
/**
*
*/
public void setYishengPhone(String yishengPhone) {
this.yishengPhone = yishengPhone;
}
/**
*
*/
public String getYishengGuahao() {
return yishengGuahao;
}
/**
*
*/
public void setYishengGuahao(String yishengGuahao) {
this.yishengGuahao = yishengGuahao;
}
/**
*
*/
public String getYishengEmail() {
return yishengEmail;
}
/**
*
*/
public void setYishengEmail(String yishengEmail) {
this.yishengEmail = yishengEmail;
}
/**
*
*/
public Double getYishengNewMoney() {
return yishengNewMoney;
}
/**
*
*/
public void setYishengNewMoney(Double yishengNewMoney) {
this.yishengNewMoney = yishengNewMoney;
}
/**
*
*/
public String getYishengContent() {
return yishengContent;
}
/**
*
*/
public void setYishengContent(String yishengContent) {
this.yishengContent = yishengContent;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,301 @@
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;
/**
*
*
*
*/
@TableName("yonghu")
public class YonghuVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "username")
private String username;
/**
*
*/
@TableField(value = "password")
private String password;
/**
*
*/
@TableField(value = "yonghu_name")
private String yonghuName;
/**
*
*/
@TableField(value = "yonghu_photo")
private String yonghuPhoto;
/**
*
*/
@TableField(value = "yonghu_phone")
private String yonghuPhone;
/**
*
*/
@TableField(value = "yonghu_id_number")
private String yonghuIdNumber;
/**
*
*/
@TableField(value = "yonghu_email")
private String yonghuEmail;
/**
*
*/
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@TableField(value = "new_money")
private Double newMoney;
/**
*
*/
@TableField(value = "yonghu_delete")
private Integer yonghuDelete;
/**
*
*/
@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 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 getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public Double getNewMoney() {
return newMoney;
}
/**
*
*/
public void setNewMoney(Double newMoney) {
this.newMoney = newMoney;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,94 @@
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)
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String servletPath = request.getServletPath();
if("/dictionary/page".equals(request.getServletPath()) || "/file/upload".equals(request.getServletPath()) || "/yonghu/register".equals(request.getServletPath()) ){//请求路径是字典表或者文件上传 直接放行
return true;
}
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
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");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
*
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close();
}
}
// throw new EIException("请先登录", 401);
return false;
}
}

@ -0,0 +1,31 @@
package com.model.enums;
import java.io.Serializable;
import com.baomidou.mybatisplus.enums.IEnum;
/**
* IEnum spring-mybatis.xml typeEnumsPackage
*/
public enum TypeEnum implements IEnum {
DISABLED(0, "禁用"),
NORMAL(1, "正常");
private final int value;
private final String desc;
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
@Override
public Serializable getValue() {
return this.value;
}
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.ChatEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
* 线
*/
public interface ChatService extends IService<ChatEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,139 @@
package com.service;
import java.util.List;
import java.util.Map;
public interface CommonService {
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(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>> chartBoth(Map<String, Object> params);
List<Map<String, Object>> chartOne(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
/**
tableName
condition1 1
condition1Value 1
average
* */
Map<String, Object> queryScore(Map<String, Object> params);
/**
*
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int plusCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int reduceCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int updateCloumValue(Map<String, Object> params);
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barCount(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,24 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DictionaryEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface DictionaryService extends IService<DictionaryEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
/**
*
* @param obj
*/
void dictionaryConvert(Object obj, HttpServletRequest request);
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.GuahaoEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface GuahaoService extends IService<GuahaoEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.JiankangjiaoyuEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface JiankangjiaoyuService extends IService<JiankangjiaoyuEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.NewsEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface NewsService extends IService<NewsEntity> {
/**
* @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,25 @@
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.UsersEntity;
import com.utils.PageUtils;
/**
*
* @author yangliyuan
* @date 20191010 9:18:20
*/
public interface UsersService extends IService<UsersEntity> {
PageUtils queryPage(Map<String, Object> params);
List<UsersEntity> selectListView(Wrapper<UsersEntity> wrapper);
PageUtils queryPage(Map<String, Object> params, Wrapper<UsersEntity> wrapper);
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YishengEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface YishengService extends IService<YishengEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,19 @@
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YonghuEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
*
*/
public interface YonghuService extends IService<YonghuEntity> {
/**
* @param params
* @return
*/
PageUtils queryPage(Map<String, Object> params);
}

@ -0,0 +1,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.ChatDao;
import com.entity.ChatEntity;
import com.service.ChatService;
import com.entity.view.ChatView;
/**
* 线
*/
@Service("chatService")
@Transactional
public class ChatServiceImpl extends ServiceImpl<ChatDao, ChatEntity> implements ChatService {
@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<ChatView> page =new Query<ChatView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,197 @@
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
* @date
*/
@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);
}
/**
tableName
condition1 1
condition1Value 1
average
* */
public Map<String, Object> queryScore(Map<String, Object> params){
return commonDao.queryScore(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);
}
@Override
public List<Map<String, Object>> chartBoth(Map<String, Object> params) {
return commonDao.chartBoth(params);
}
@Override
public List<Map<String, Object>> chartOne(Map<String, Object> params) {
return commonDao.chartOne(params);
}
/**
*
* @param params
* @return
*/
@Override
public List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params) {
return commonDao.newSelectGroupSum(params);
}
/**
*
* @param params
* @return
*/
@Override
public List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params) {
return commonDao.newSelectGroupCount(params);
}
/**
*
* @param params
* @return
*/
@Override
public List<Map<String, Object>> newSelectDateGroupSum(Map<String, Object> params) {
return commonDao.newSelectDateGroupSum(params);
}
/**
*
* @param params
* @return
*/
@Override
public List<Map<String, Object>> newSelectDateGroupCount(Map<String, Object> params) {
return commonDao.newSelectDateGroupCount(params);
}
@Override
public int plusCloumNumber(Map<String, Object> params) {
return commonDao.plusCloumNumber(params);
}
@Override
public int reduceCloumNumber(Map<String, Object> params) {
return commonDao.reduceCloumNumber(params);
}
@Override
public int updateCloumValue(Map<String, Object> params) {
return commonDao.updateCloumValue(params);
}
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
* @param params
* @return
*/
public List<Map<String, Object>> barSum(Map<String, Object> params){
return commonDao.barSum(params);
}
/**
*
* @param params
* @return
*/
public List<Map<String, Object>> barCount(Map<String, Object> params){
return commonDao.barCount(params);
}
}

@ -0,0 +1,34 @@
package com.service.impl;
import java.util.Map;
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.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.Query;
/**
*
* @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,129 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.DictionaryDao;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.entity.view.DictionaryView;
/**
*
*/
@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, HttpServletRequest request) {
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();
ServletContext servletContext = request.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
//把s1字符中的所有大写转小写,并在前面加 _
char[] chars = s.toCharArray();
StringBuffer sbf = new StringBuffer();
for(int b=0; b< chars.length; b++){
char ch = chars[b];
if(ch <= 90 && ch >= 65){
sbf.append("_");
ch += 32;
}
sbf.append(ch);
}
String s2 = dictionaryMap.get(sbf.toString()).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,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.GuahaoDao;
import com.entity.GuahaoEntity;
import com.service.GuahaoService;
import com.entity.view.GuahaoView;
/**
*
*/
@Service("guahaoService")
@Transactional
public class GuahaoServiceImpl extends ServiceImpl<GuahaoDao, GuahaoEntity> implements GuahaoService {
@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<GuahaoView> page =new Query<GuahaoView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.JiankangjiaoyuDao;
import com.entity.JiankangjiaoyuEntity;
import com.service.JiankangjiaoyuService;
import com.entity.view.JiankangjiaoyuView;
/**
*
*/
@Service("jiankangjiaoyuService")
@Transactional
public class JiankangjiaoyuServiceImpl extends ServiceImpl<JiankangjiaoyuDao, JiankangjiaoyuEntity> implements JiankangjiaoyuService {
@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<JiankangjiaoyuView> page =new Query<JiankangjiaoyuView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.NewsDao;
import com.entity.NewsEntity;
import com.service.NewsService;
import com.entity.view.NewsView;
/**
*
*/
@Service("newsService")
@Transactional
public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements NewsService {
@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<NewsView> page =new Query<NewsView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,80 @@
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
*/
@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,50 @@
package com.service.impl;
import java.util.List;
import java.util.Map;
import com.service.UsersService;
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.UsersDao;
import com.entity.UsersEntity;
import com.utils.PageUtils;
import com.utils.Query;
/**
*
* @author
*/
@Service("userService")
public class UsersServiceImpl extends ServiceImpl<UsersDao, UsersEntity> implements UsersService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<UsersEntity> page = this.selectPage(
new Query<UsersEntity>(params).getPage(),
new EntityWrapper<UsersEntity>()
);
return new PageUtils(page);
}
@Override
public List<UsersEntity> selectListView(Wrapper<UsersEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<UsersEntity> wrapper) {
Page<UsersEntity> page =new Query<UsersEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
}

@ -0,0 +1,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.YishengDao;
import com.entity.YishengEntity;
import com.service.YishengService;
import com.entity.view.YishengView;
/**
*
*/
@Service("yishengService")
@Transactional
public class YishengServiceImpl extends ServiceImpl<YishengDao, YishengEntity> implements YishengService {
@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<YishengView> page =new Query<YishengView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}

@ -0,0 +1,39 @@
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 javax.servlet.http.HttpServletRequest;
import com.dao.YonghuDao;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
/**
*
*/
@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,19 @@
package com.thread;
/**
* 线 30
*/
public class MyThreadMethod extends Thread {
public void run() {
while (!this.isInterrupted()) {// 线程未中断执行循环
try {
Thread.sleep(5000); //每隔2000ms执行一次
} catch (InterruptedException e) {
e.printStackTrace();
}
// ------------------ 开始执行 ---------------------------
// System.out.println("线程执行中:" + System.currentTimeMillis());
}
}
}

@ -0,0 +1,98 @@
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
* :
*/
public class BaiduUtil {
/**
*
* @param lon
* @param lat
* @param coordtype
* @return
*/
public static Map<String, String> getCityByLonLat(String key, String lng, String lat) {
String location = lat + "," + lng;
try {
//拼装url
String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location;
String result = HttpClientUtils.doGet(url);
JSONObject o = new JSONObject(result);
Map<String, String> area = new HashMap<>();
area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province"));
area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city"));
area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
return area;
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* API访token
* token.
* @param ak - API Key
* @param sk - Securet Key
* @return assess_token
*/
public static String getAuth(String ak, String sk) {
// 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
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);
org.json.JSONObject jsonObject = new org.json.JSONObject(result);
String access_token = jsonObject.getString("access_token");
return access_token;
} catch (Exception e) {
System.err.printf("获取token失败");
e.printStackTrace(System.err);
}
return null;
}
}

@ -0,0 +1,23 @@
package com.utils;
import java.util.Random;
public class CommonUtil {
/**
*
*
* @param num
* @return
*/
public static String getRandomString(Integer num) {
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < num; i++) {
int number = random.nextInt(base.length());
sb.append(base.charAt(number));
}
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,42 @@
package com.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* HttpClient
*/
public class HttpClientUtils {
/**
* @param uri
* @return String
* @description get
* @author: long.he01
*/
public static String doGet(String uri) {
StringBuilder result = new StringBuilder();
try {
String res = "";
URL url = new URL(uri);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
res += line+"\n";
}
in.close();
return res;
}catch (Exception e) {
e.printStackTrace();
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,184 @@
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
*/
public class MPUtil {
public static final char UNDERLINE = '_';
//mybatis plus allEQ 表达式转换
public static Map allEQMapPre(Object bean,String pre) {
Map<String, Object> map =BeanUtil.beanToMap(bean);
return camelToUnderlineMap(map,pre);
}
//mybatis plus allEQ 表达式转换
public static Map allEQMap(Object bean) {
Map<String, Object> map =BeanUtil.beanToMap(bean);
return camelToUnderlineMap(map,"");
}
public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) {
Map<String, Object> map =BeanUtil.beanToMap(bean);
Map result = camelToUnderlineMap(map,pre);
return genLike(wrapper,result);
}
public static Wrapper allLike(Wrapper wrapper,Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
return genLike(wrapper,result);
}
public static Wrapper genLike( Wrapper wrapper,Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i=0;
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);
i++;
}
return wrapper;
}
public static Wrapper likeOrEq(Wrapper wrapper,Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
return genLikeOrEq(wrapper,result);
}
public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i=0;
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());
}
i++;
}
return wrapper;
}
public static Wrapper allEq(Wrapper wrapper,Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
return genEq(wrapper,result);
}
public static Wrapper genEq( Wrapper wrapper,Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i=0;
while (it.hasNext()) {
if(i>0) wrapper.and();
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
wrapper.eq(key, entry.getValue());
i++;
}
return wrapper;
}
public static Wrapper between(Wrapper wrapper,Map<String, Object> params) {
for(String key : params.keySet()) {
String columnName = "";
if(key.endsWith("_start")) {
columnName = key.substring(0, key.indexOf("_start"));
if(StringUtils.isNotBlank(params.get(key).toString())) {
wrapper.ge(columnName, params.get(key));
}
}
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;
}
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 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"));
}
public static Map camelToUnderlineMap(Map param, String pre) {
Map<String, Object> newMap = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
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());
}
}
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,109 @@
package com.utils;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
public class PoiUtil {
/**
*
*
* @param url
* @return
* @throws Exception
*/
public static List<List<String>> poiImport(String url) throws Exception {
List<List<String>> list = new ArrayList<>();
// 创建Excel 读取文件内容
HSSFWorkbook workbook = new HSSFWorkbook(FileUtils.openInputStream(new File(url)));
/**
* Sheet
*/
// HSSFSheet sheet = workbook.getSheet("Sheet0");
/**
* Sheet
*/
HSSFSheet sheet = workbook.getSheetAt(0);//获取工作表
for (int i = 0; i < sheet.getLastRowNum()+1; i++) {
HSSFRow row = sheet.getRow(i);//获取行
List<String> rowlist = new ArrayList<>();//行数据
for (int j = 0; j < row.getLastCellNum(); j++) {
HSSFCell cell = row.getCell(j);
cell.setCellType(Cell.CELL_TYPE_STRING);
String value = cell.getStringCellValue();
rowlist.add(value);//行中数据添加到行中
}
list.add(rowlist);//将行数据添加到list中
}
return list;
}
// 导出
public static void poiExport(List<List<String>> list, String url) throws Exception {
//创建Excel工作薄
HSSFWorkbook workbook = new HSSFWorkbook();
//创建一个工作表shheet
HSSFSheet sheet = workbook.createSheet();
for (int i = 0; i < list.size(); i++) {
HSSFRow row = sheet.createRow(i);
List<String> dataList = list.get(i);
for (int j = 0; j < dataList.size(); j++) {
HSSFCell cell = row.createCell(j);
cell.setCellValue(dataList.get(j));
}
}
FileOutputStream stream = FileUtils.openOutputStream(new File(url));
workbook.write(stream);
stream.close();
}
public static void main(String[] args) {
try {
//导入
List<List<String>> lists = PoiUtil.poiImport("C:/Users/Administrator/Desktop/工作1.xls");
System.out.println();
//导出
PoiUtil.poiExport(lists, "C:/Users/Administrator/Desktop/工作1.xls");
//
// List<List<String>> list = new ArrayList<>();
// ArrayList<String> dataList = new ArrayList<>();
// dataList.add("标题1");
// dataList.add("标题2");
// dataList.add("标题3");
// list.add(dataList);
// // 追加数据
// for (int i = 1; i < 10; i++) {// 这里的int 起始是1 也就是第二行开始
// ArrayList<String> dataList111 = new ArrayList<>();
// dataList111.add("内容" + i);
// dataList111.add("内容1111111121222222222333333333377777777411111111477777777" + i);
// dataList111.add("内容" + i);
// list.add(dataList111);
// }
// PoiUtil.poiExport(list, "C:/Users/Administrator/Desktop/工作1.xls");
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,98 @@
package com.utils;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.plugins.Page;
/**
*
*/
public class Query<T> extends LinkedHashMap<String, Object> {
private static final long serialVersionUID = 1L;
/**
* mybatis-plus
*/
private Page<T> page;
/**
*
*/
private int currPage = 1;
/**
*
*/
private int limit = 10;
public Query(JQPageInfo pageInfo) {
//分页参数
if(pageInfo.getPage()!= null){
currPage = pageInfo.getPage();
}
if(pageInfo.getLimit()!= null){
limit = pageInfo.getLimit();
}
//防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String sidx = SQLFilter.sqlInject(pageInfo.getSidx());
String order = SQLFilter.sqlInject(pageInfo.getOrder());
//mybatis-plus分页
this.page = new Page<>(currPage, limit);
//排序
if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
public Query(Map<String, Object> params){
this.putAll(params);
//分页参数
if(params.get("page") != null){
currPage = Integer.parseInt((String)params.get("page"));
}
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注入风险
String sidx = SQLFilter.sqlInject((String)params.get("sidx"));
String order = SQLFilter.sqlInject((String)params.get("order"));
this.put("sidx", sidx);
this.put("order", order);
//mybatis-plus分页
this.page = new Page<>(currPage, limit);
//排序
if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
public Page<T> getPage() {
return page;
}
public int getCurrPage() {
return currPage;
}
public int getLimit() {
return limit;
}
}

@ -0,0 +1,51 @@
package com.utils;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class R extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
public R() {
put("code", 0);
}
public static R error() {
return error(500, "未知异常,请联系管理员");
}
public static R error(String msg) {
return error(500, msg);
}
public static R error(int code, String msg) {
R r = new R();
r.put("code", code);
r.put("msg", msg);
return r;
}
public static R ok(String msg) {
R r = new R();
r.put("msg", msg);
return r;
}
public static R ok(Map<String, Object> map) {
R r = new R();
r.putAll(map);
return r;
}
public static R ok() {
return new R();
}
public R put(String key, Object value) {
super.put(key, value);
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;
}
}

@ -0,0 +1,43 @@
package com.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Spring Context
*/
@Component
public class SpringContextUtils implements ApplicationContextAware {
public static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
SpringContextUtils.applicationContext = applicationContext;
}
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
public static <T> T getBean(String name, Class<T> requiredType) {
return applicationContext.getBean(name, requiredType);
}
public static boolean containsBean(String name) {
return applicationContext.containsBean(name);
}
public static boolean isSingleton(String name) {
return applicationContext.isSingleton(name);
}
public static Class<? extends Object> getType(String name) {
return applicationContext.getType(name);
}
}

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

Loading…
Cancel
Save