Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
spring-timeloit-update
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
loit-Infrastructure-example
spring-timeloit-update
Commits
33891963
提交
33891963
authored
9月 01, 2020
作者:
陈世营
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
loit-notice
上级
a8839722
显示空白字符变更
内嵌
并排
正在显示
67 个修改的文件
包含
7054 行增加
和
364 行删除
+7054
-364
pom.xml
loit-service-api/loit-portal-api/pom.xml
+49
-0
ApiProxyBeanFactory.java
...api/src/main/java/com/loit/Proxy/ApiProxyBeanFactory.java
+37
-0
ApiProxyConfig.java
...rtal-api/src/main/java/com/loit/Proxy/ApiProxyConfig.java
+18
-0
ApiProxyHandler.java
...tal-api/src/main/java/com/loit/Proxy/ApiProxyHandler.java
+35
-0
ApiProxyPackageScan.java
...api/src/main/java/com/loit/Proxy/ApiProxyPackageScan.java
+165
-0
ApiProxyRegistry.java
...al-api/src/main/java/com/loit/Proxy/ApiProxyRegistry.java
+73
-0
AccoutInfo.java
...portal-api/src/main/java/com/loit/api/dto/AccoutInfo.java
+249
-0
ApplicationManage.java
...api/src/main/java/com/loit/api/dto/ApplicationManage.java
+38
-0
Colour.java
...oit-portal-api/src/main/java/com/loit/api/dto/Colour.java
+106
-0
ContextConfiguration.java
.../src/main/java/com/loit/api/dto/ContextConfiguration.java
+73
-0
ContextConfigurationDTO.java
...c/main/java/com/loit/api/dto/ContextConfigurationDTO.java
+58
-0
Dict.java
.../loit-portal-api/src/main/java/com/loit/api/dto/Dict.java
+90
-0
DictData.java
...t-portal-api/src/main/java/com/loit/api/dto/DictData.java
+86
-0
Org.java
...i/loit-portal-api/src/main/java/com/loit/api/dto/Org.java
+233
-0
OrgExtattr.java
...portal-api/src/main/java/com/loit/api/dto/OrgExtattr.java
+114
-0
PersonBase.java
...portal-api/src/main/java/com/loit/api/dto/PersonBase.java
+567
-0
PersonApiServiceProxy.java
...c/main/java/com/loit/api/proxy/PersonApiServiceProxy.java
+18
-0
ActRightApiService.java
...rc/main/java/com/loit/api/service/ActRightApiService.java
+29
-0
ApplicationManagerApiService.java
...va/com/loit/api/service/ApplicationManagerApiService.java
+31
-0
AreaCodeApiService.java
...rc/main/java/com/loit/api/service/AreaCodeApiService.java
+22
-0
ColourApiService.java
.../src/main/java/com/loit/api/service/ColourApiService.java
+34
-0
ContextConfigurationApiService.java
.../com/loit/api/service/ContextConfigurationApiService.java
+66
-0
DictApiService.java
...pi/src/main/java/com/loit/api/service/DictApiService.java
+50
-0
DictDataApiService.java
...rc/main/java/com/loit/api/service/DictDataApiService.java
+83
-0
JPushApiService.java
...i/src/main/java/com/loit/api/service/JPushApiService.java
+26
-0
NoticeReceiveApiService.java
...in/java/com/loit/api/service/NoticeReceiveApiService.java
+28
-0
OrgApiService.java
...api/src/main/java/com/loit/api/service/OrgApiService.java
+137
-0
PersonApiService.java
.../src/main/java/com/loit/api/service/PersonApiService.java
+181
-0
WebSocketApiService.java
...c/main/java/com/loit/api/service/WebSocketApiService.java
+43
-0
PermissionService.java
...-api/src/main/java/com/loit/getway/PermissionService.java
+17
-0
pom.xml
loit-service-api/pom.xml
+33
-0
pom.xml
loit-service/loit-notice/pom.xml
+117
-1
NoticeApplication.java
...loit-notice/src/main/java/com/loit/NoticeApplication.java
+34
-0
application-dev.yml
...ervice/loit-notice/src/main/resources/application-dev.yml
+140
-0
application-prod.yml
...rvice/loit-notice/src/main/resources/application-prod.yml
+133
-0
application-test5002.yml
...e/loit-notice/src/main/resources/application-test5002.yml
+133
-0
application-test5003.yml
...e/loit-notice/src/main/resources/application-test5003.yml
+133
-0
application-test5102.yml
...e/loit-notice/src/main/resources/application-test5102.yml
+129
-0
application-test5103.yml
...e/loit-notice/src/main/resources/application-test5103.yml
+133
-0
application-test7005s231.yml
...it-notice/src/main/resources/application-test7005s231.yml
+132
-0
bootstrap.properties
...rvice/loit-notice/src/main/resources/bootstrap.properties
+7
-0
logback-dev.xml
...ce/loit-notice/src/main/resources/logback/logback-dev.xml
+60
-0
logback-test5002.xml
...it-notice/src/main/resources/logback/logback-test5002.xml
+60
-0
logback-test5003.xml
...it-notice/src/main/resources/logback/logback-test5003.xml
+60
-0
logback-test5102.xml
...it-notice/src/main/resources/logback/logback-test5102.xml
+60
-0
logback-test5103.xml
...it-notice/src/main/resources/logback/logback-test5103.xml
+60
-0
FeignMessageController.java
.../loit/v1/api/controller/feign/FeignMessageController.java
+152
-0
OpenMessageController.java
...om/loit/v1/api/controller/open/OpenMessageController.java
+51
-0
WebSocketClient.java
...tice/java/com/loit/v1/modules/config/WebSocketClient.java
+48
-0
NoticeConstants.java
...ce/java/com/loit/v1/modules/constant/NoticeConstants.java
+29
-0
MessageController.java
...ava/com/loit/v1/modules/controller/MessageController.java
+169
-0
MessageReceiveController.java
.../loit/v1/modules/controller/MessageReceiveController.java
+143
-0
MessageDao.java
...e/src/notice/java/com/loit/v1/modules/dao/MessageDao.java
+44
-0
MessageESDao.java
...src/notice/java/com/loit/v1/modules/dao/MessageESDao.java
+7
-0
MessageReceiveDao.java
...otice/java/com/loit/v1/modules/dao/MessageReceiveDao.java
+52
-0
Message.java
...e/src/notice/java/com/loit/v1/modules/entity/Message.java
+482
-0
MessageES.java
...src/notice/java/com/loit/v1/modules/entity/MessageES.java
+216
-0
MessageReceive.java
...otice/java/com/loit/v1/modules/entity/MessageReceive.java
+137
-0
MessageReveiveES.java
...ice/java/com/loit/v1/modules/entity/MessageReveiveES.java
+48
-0
MessageSchedule.java
...ce/java/com/loit/v1/modules/schedule/MessageSchedule.java
+71
-0
MessageESService.java
...ce/java/com/loit/v1/modules/service/MessageESService.java
+133
-0
MessageReceiveService.java
...va/com/loit/v1/modules/service/MessageReceiveService.java
+66
-0
MessageService.java
...tice/java/com/loit/v1/modules/service/MessageService.java
+571
-0
MessageDaoMapper.xml
...c/notice/resources/mapper/v1/modules/MessageDaoMapper.xml
+283
-0
MessageReceiveDaoMapper.xml
...e/resources/mapper/v1/modules/MessageReceiveDaoMapper.xml
+169
-0
TestController.java
...l/java/com/loit/v1/modules/controller/TestController.java
+0
-361
pom.xml
pom.xml
+3
-2
没有找到文件。
loit-service-api/loit-portal-api/pom.xml
0 → 100644
浏览文件 @
33891963
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
loit-service-api
</artifactId>
<groupId>
com.loit
</groupId>
<version>
1.0.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
loit-portal-api
</artifactId>
<name>
loit-portal-api
</name>
<version>
1.4-SNAPSHOT
</version>
<description>
门户api
</description>
<dependencies>
<dependency>
<groupId>
com.loit
</groupId>
<artifactId>
loit-common
</artifactId>
<version>
1.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
loit-portal-api
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
2.4
</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>
true
</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>
true
</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
loit-service-api/loit-portal-api/src/main/java/com/loit/Proxy/ApiProxyBeanFactory.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
Proxy
;
import
org.springframework.beans.factory.FactoryBean
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Proxy
;
/**
* 接口实例工厂,这里主要是用于提供接口的实例对象
*
* @author Demon add by 2020-05-28
*/
public
class
ApiProxyBeanFactory
<
T
>
implements
FactoryBean
<
T
>
{
private
Class
<
T
>
interfaceType
;
public
ApiProxyBeanFactory
(
Class
<
T
>
interfaceType
)
{
this
.
interfaceType
=
interfaceType
;
}
@Override
public
T
getObject
()
throws
Exception
{
//这里主要是创建接口对应的实例,便于注入到spring容器中
InvocationHandler
handler
=
new
ApiProxyHandler
<>(
interfaceType
);
return
(
T
)
Proxy
.
newProxyInstance
(
interfaceType
.
getClassLoader
(),
new
Class
[]
{
interfaceType
},
handler
);
}
@Override
public
Class
<
T
>
getObjectType
()
{
return
interfaceType
;
}
@Override
public
boolean
isSingleton
()
{
return
true
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/Proxy/ApiProxyConfig.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
Proxy
;
/**
* 代理配置文件
*
* @author Demon add by 2020-05-28
*/
public
interface
ApiProxyConfig
{
/**
* 扫描需要被动态代理的接口包名
*/
public
static
String
[]
PACKAGE_SCAN
={
"com.loit.api.service"
,
"com.loit.getway"
};
}
loit-service-api/loit-portal-api/src/main/java/com/loit/Proxy/ApiProxyHandler.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
Proxy
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.utils.LoitStatusCode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Method
;
/**
* 动态代理,需要注意的是,这里用到的是JDK自带的动态代理,代理对象只能是接口,不能是类
*
* @author Demon add by 2020-05-28
*/
public
class
ApiProxyHandler
<
T
>
implements
InvocationHandler
{
private
Class
<
T
>
interfaceType
;
public
ApiProxyHandler
(
Class
<
T
>
intefaceType
)
{
this
.
interfaceType
=
interfaceType
;
}
@Override
public
Object
invoke
(
Object
proxy
,
Method
method
,
Object
[]
args
)
{
Logger
logger
=
LoggerFactory
.
getLogger
(
method
.
getDeclaringClass
());
AjaxJson
json
=
new
AjaxJson
();
logger
.
info
(
"服务未在线。"
);
json
.
setMsg
(
"服务未在线,请稍后重试。"
);
json
.
setSuccess
(
false
);
json
.
setCode
(
LoitStatusCode
.
FAIL
.
statusCode
);
return
json
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/Proxy/ApiProxyPackageScan.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
Proxy
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.io.IOException
;
import
java.net.JarURLConnection
;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.jar.JarEntry
;
import
java.util.jar.JarFile
;
/**
* 包扫描器-扫描包内所有类和接口
*
* @author Demon add by 2020-05-26
*/
public
class
ApiProxyPackageScan
{
/**
* 测试
* @param args
*/
public
static
void
main
(
String
[]
args
)
{
List
<
Class
<?>>
classes
=
getClasses
(
"com.loit.api.service"
,
"com.loit.getway"
);
for
(
Class
<?>
class1
:
classes
)
{
System
.
out
.
println
(
class1
);
}
}
/**
* 根据包全名,获取包内类和接口的Class列表-支持多包名扫描
* @param packageNames
* @return
*/
public
static
List
<
Class
<?>>
getClasses
(
String
...
packageNames
){
List
<
Class
<?>>
classes
=
new
ArrayList
<
Class
<?>>();
for
(
String
packageName
:
packageNames
)
{
classes
.
addAll
(
ApiProxyPackageScan
.
getClasses
(
packageName
));
}
return
classes
;
}
/**
* 根据包全名,获取包内类和接口的Class列表
* @param packageName
* @return
*/
public
static
List
<
Class
<?>>
getClasses
(
String
packageName
){
//第一个class类的集合
List
<
Class
<?>>
classes
=
new
ArrayList
<
Class
<?>>();
//是否循环迭代
boolean
recursive
=
true
;
//获取包的名字 并进行替换
String
packageDirName
=
packageName
.
replace
(
'.'
,
'/'
);
//定义一个枚举的集合 并进行循环来处理这个目录下的things
Enumeration
<
URL
>
dirs
;
try
{
dirs
=
Thread
.
currentThread
().
getContextClassLoader
().
getResources
(
packageDirName
);
//循环迭代下去
while
(
dirs
.
hasMoreElements
()){
//获取下一个元素
URL
url
=
dirs
.
nextElement
();
//得到协议的名称
String
protocol
=
url
.
getProtocol
();
//如果是以文件的形式保存在服务器上
if
(
"file"
.
equals
(
protocol
))
{
//获取包的物理路径
String
filePath
=
URLDecoder
.
decode
(
url
.
getFile
(),
"UTF-8"
);
//以文件的方式扫描整个包下的文件 并添加到集合中
findAndAddClassesInPackageByFile
(
packageName
,
filePath
,
recursive
,
classes
);
}
else
if
(
"jar"
.
equals
(
protocol
)){
//如果是jar包文件
//定义一个JarFile
JarFile
jar
;
try
{
//获取jar
jar
=
((
JarURLConnection
)
url
.
openConnection
()).
getJarFile
();
//从此jar包 得到一个枚举类
Enumeration
<
JarEntry
>
entries
=
jar
.
entries
();
//同样的进行循环迭代
while
(
entries
.
hasMoreElements
())
{
//获取jar里的一个实体 可以是目录 和一些jar包里的其他文件 如META-INF等文件
JarEntry
entry
=
entries
.
nextElement
();
String
name
=
entry
.
getName
();
//如果是以/开头的
if
(
name
.
charAt
(
0
)
==
'/'
)
{
//获取后面的字符串
name
=
name
.
substring
(
1
);
}
//如果前半部分和定义的包名相同
if
(
name
.
startsWith
(
packageDirName
))
{
int
idx
=
name
.
lastIndexOf
(
'/'
);
//如果以"/"结尾 是一个包
if
(
idx
!=
-
1
)
{
//获取包名 把"/"替换成"."
packageName
=
name
.
substring
(
0
,
idx
).
replace
(
'/'
,
'.'
);
}
//如果可以迭代下去 并且是一个包
if
((
idx
!=
-
1
)
||
recursive
){
//如果是一个.class文件 而且不是目录
if
(
name
.
endsWith
(
".class"
)
&&
!
entry
.
isDirectory
())
{
//去掉后面的".class" 获取真正的类名
String
className
=
name
.
substring
(
packageName
.
length
()
+
1
,
name
.
length
()
-
6
);
try
{
//添加到classes
classes
.
add
(
Class
.
forName
(
packageName
+
'.'
+
className
));
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
classes
;
}
public
static
void
findAndAddClassesInPackageByFile
(
String
packageName
,
String
packagePath
,
final
boolean
recursive
,
List
<
Class
<?>>
classes
){
//获取此包的目录 建立一个File
File
dir
=
new
File
(
packagePath
);
//如果不存在或者 也不是目录就直接返回
if
(!
dir
.
exists
()
||
!
dir
.
isDirectory
())
{
return
;
}
//如果存在 就获取包下的所有文件 包括目录
File
[]
dirfiles
=
dir
.
listFiles
(
new
FileFilter
()
{
//自定义过滤规则 如果可以循环(包含子目录) 或则是以.class结尾的文件(编译好的java类文件)
public
boolean
accept
(
File
file
)
{
return
(
recursive
&&
file
.
isDirectory
())
||
(
file
.
getName
().
endsWith
(
".class"
));
}
});
//循环所有文件
for
(
File
file
:
dirfiles
)
{
//如果是目录 则继续扫描
if
(
file
.
isDirectory
())
{
findAndAddClassesInPackageByFile
(
packageName
+
"."
+
file
.
getName
(),
file
.
getAbsolutePath
(),
recursive
,
classes
);
}
else
{
//如果是java类文件 去掉后面的.class 只留下类名
String
className
=
file
.
getName
().
substring
(
0
,
file
.
getName
().
length
()
-
6
);
try
{
//添加到集合中去
classes
.
add
(
Class
.
forName
(
packageName
+
'.'
+
className
));
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/Proxy/ApiProxyRegistry.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
Proxy
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.beans.factory.support.BeanDefinitionBuilder
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
;
import
org.springframework.beans.factory.support.GenericBeanDefinition
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.ResourceLoaderAware
;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 用于Spring动态注入自定义接口
* 继承BeanDefinitionRegistryPostProcessor,ResourceLoaderAware,ApplicationContextAware,实现项目启动自动执行
*
* @author Demon add by 2020-05-26
*/
@Component
public
class
ApiProxyRegistry
implements
BeanDefinitionRegistryPostProcessor
,
ResourceLoaderAware
,
ApplicationContextAware
{
/**
* 扫描包内所有接口,通过ApiProxyBeanFactory的动态代理产生接口的实现类并批量注册到spring中
*/
@Override
public
void
postProcessBeanDefinitionRegistry
(
BeanDefinitionRegistry
registry
)
throws
BeansException
{
// 通过反射获取需要代理的接口的clazz列表
List
<
Class
<?>>
beanClazzs
=
ApiProxyPackageScan
.
getClasses
(
ApiProxyConfig
.
PACKAGE_SCAN
);
// 将扫描到的接口列表循环注入到spring的管理中
for
(
Class
beanClazz
:
beanClazzs
)
{
BeanDefinitionBuilder
builder
=
BeanDefinitionBuilder
.
genericBeanDefinition
(
beanClazz
);
GenericBeanDefinition
definition
=
(
GenericBeanDefinition
)
builder
.
getRawBeanDefinition
();
/*
* 在这里,我们可以给该对象的属性注入对应的实例。
* 比如mybatis,就在这里注入了dataSource和sqlSessionFactory,
* 注意,如果采用definition.getPropertyValues()方式的话,
* 类似definition.getPropertyValues().add("interfaceType", beanClazz);
* 则要求在FactoryBean(本应用中即ApiProxyBeanFactory)提供setter方法,否则会注入失败
* 如果采用definition.getConstructorArgumentValues(),
* 则FactoryBean中需要提供包含该属性的构造方法,否则会注入失败
*/
definition
.
getConstructorArgumentValues
().
addGenericArgumentValue
(
beanClazz
);
/*
* 注意,这里的BeanClass是生成Bean实例的工厂,不是Bean本身。
* ApiProxyBeanFactory是一种特殊的Bean,其返回的对象不是指定类的一个实例,
* 其返回的是该工厂Bean的getObject方法所返回的对象。
*/
definition
.
setBeanClass
(
ApiProxyBeanFactory
.
class
);
//这里采用的是byType方式注入,类似的还有byName等
definition
.
setAutowireMode
(
GenericBeanDefinition
.
AUTOWIRE_BY_TYPE
);
registry
.
registerBeanDefinition
(
beanClazz
.
getSimpleName
(),
definition
);
}
}
@Override
public
void
postProcessBeanFactory
(
ConfigurableListableBeanFactory
arg0
)
throws
BeansException
{}
@Override
public
void
setApplicationContext
(
ApplicationContext
arg0
)
throws
BeansException
{}
@Override
public
void
setResourceLoader
(
ResourceLoader
arg0
)
{}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/AccoutInfo.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
* @ClassName: AccoutInfo
* @Description: 人员账号信息表
* @author zhaokz
* @date 2019-10-23 15:22:25
* @version V1.0
**/
@ApiModel
(
value
=
"AccoutInfo"
,
description
=
"人员账号信息表数据对象"
)
public
class
AccoutInfo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"人员唯一ID"
,
example
=
"1"
)
private
Integer
accountId
;
/**
* (0,访客1,普通用户2,一般管理员)
*/
@ApiModelProperty
(
value
=
"账号类别"
,
example
=
"1"
)
private
String
userType
;
@ApiModelProperty
(
value
=
"账号"
,
example
=
"1"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"未加密密码"
,
example
=
"123456"
)
private
String
unPassword
;
@ApiModelProperty
(
value
=
"密码"
,
example
=
"f@sdgfd%d$dsfs"
)
private
String
passWord
;
/**
* (0,正常1,锁定2,一般管理员禁止)
*/
@ApiModelProperty
(
value
=
"账号状态"
,
example
=
"0"
)
private
String
userStat
;
@ApiModelProperty
(
value
=
"失败登录次数"
,
example
=
"2"
)
private
Integer
loginFailnum
;
@ApiModelProperty
(
value
=
"最近登录IP"
,
example
=
"17.34.56.213"
)
private
String
lastLoginIp
;
@ApiModelProperty
(
value
=
"最近登录日期"
,
example
=
"2019-10-24 15:45:23"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-ddHH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
lastLoginDate
;
@ApiModelProperty
(
value
=
"密码问题"
,
example
=
"我是谁"
)
private
String
passQuestion
;
@ApiModelProperty
(
value
=
"密码答案"
,
example
=
"小马哥"
)
private
String
passAnswer
;
/**
* (0:普通帐号1:临时账号2:应用管理帐号3:超级管理帐号)
*/
@ApiModelProperty
(
value
=
"账号类型"
,
example
=
"0"
)
private
String
accountType
;
@ApiModelProperty
(
value
=
"账号有效期限"
,
example
=
"4"
)
private
Integer
accountTimelimit
;
@ApiModelProperty
(
value
=
"密码修改时间"
,
example
=
"2019-10-24 15:45:23"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
passUpdateTime
;
@ApiModelProperty
(
value
=
"创建者类型"
,
example
=
"2"
)
private
String
cteateBy
;
@ApiModelProperty
(
value
=
"扩展1"
,
example
=
""
)
private
String
ext1
;
@ApiModelProperty
(
value
=
"扩展2"
,
example
=
""
)
private
String
ext2
;
@ApiModelProperty
(
value
=
"人员基本信息ID"
,
example
=
"1"
)
private
Integer
personBaseId
;
public
void
setAccountId
(
Integer
accountId
){
this
.
accountId
=
accountId
;
}
public
Integer
getAccountId
(){
return
this
.
accountId
;
}
public
void
setUserType
(
String
userType
){
this
.
userType
=
userType
;
}
public
String
getUserType
(){
return
this
.
userType
;
}
public
void
setUserId
(
String
userId
){
this
.
userId
=
userId
;
}
public
String
getUserId
(){
return
this
.
userId
;
}
public
void
setUnPassword
(
String
unPassword
){
this
.
unPassword
=
unPassword
;
}
public
String
getUnPassword
(){
return
this
.
unPassword
;
}
public
void
setPassWord
(
String
passWord
){
this
.
passWord
=
passWord
;
}
public
String
getPassWord
(){
return
this
.
passWord
;
}
public
void
setUserStat
(
String
userStat
){
this
.
userStat
=
userStat
;
}
public
String
getUserStat
(){
return
this
.
userStat
;
}
public
void
setLoginFailnum
(
Integer
loginFailnum
){
this
.
loginFailnum
=
loginFailnum
;
}
public
Integer
getLoginFailnum
(){
return
this
.
loginFailnum
;
}
public
void
setLastLoginIp
(
String
lastLoginIp
){
this
.
lastLoginIp
=
lastLoginIp
;
}
public
String
getLastLoginIp
(){
return
this
.
lastLoginIp
;
}
public
void
setLastLoginDate
(
Date
lastLoginDate
){
this
.
lastLoginDate
=
lastLoginDate
;
}
public
Date
getLastLoginDate
(){
return
this
.
lastLoginDate
;
}
public
void
setPassQuestion
(
String
passQuestion
){
this
.
passQuestion
=
passQuestion
;
}
public
String
getPassQuestion
(){
return
this
.
passQuestion
;
}
public
void
setPassAnswer
(
String
passAnswer
){
this
.
passAnswer
=
passAnswer
;
}
public
String
getPassAnswer
(){
return
this
.
passAnswer
;
}
public
void
setAccountType
(
String
accountType
){
this
.
accountType
=
accountType
;
}
public
String
getAccountType
(){
return
this
.
accountType
;
}
public
void
setAccountTimelimit
(
Integer
accountTimelimit
){
this
.
accountTimelimit
=
accountTimelimit
;
}
public
Integer
getAccountTimelimit
(){
return
this
.
accountTimelimit
;
}
public
void
setPassUpdateTime
(
Date
passUpdateTime
){
this
.
passUpdateTime
=
passUpdateTime
;
}
public
Date
getPassUpdateTime
(){
return
this
.
passUpdateTime
;
}
public
void
setCteateBy
(
String
cteateBy
){
this
.
cteateBy
=
cteateBy
;
}
public
String
getCteateBy
(){
return
this
.
cteateBy
;
}
public
void
setExt1
(
String
ext1
){
this
.
ext1
=
ext1
;
}
public
String
getExt1
(){
return
this
.
ext1
;
}
public
void
setExt2
(
String
ext2
){
this
.
ext2
=
ext2
;
}
public
String
getExt2
(){
return
this
.
ext2
;
}
public
void
setPersonBaseId
(
Integer
personBaseId
){
this
.
personBaseId
=
personBaseId
;
}
public
Integer
getPersonBaseId
(){
return
this
.
personBaseId
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/ApplicationManage.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @description 应用管理entity
* @author xutao
* @date 2019-10-21
*/
@ApiModel
(
value
=
"ApplicationManage"
,
description
=
"应用管理实体"
)
public
class
ApplicationManage
{
public
ApplicationManage
ApplicationManage
()
{
return
this
;
}
@ApiModelProperty
(
name
=
"appId"
,
value
=
"应用ID"
,
example
=
"1"
)
private
Integer
appId
;
@ApiModelProperty
(
name
=
"appCode"
,
value
=
"应用代码"
,
example
=
"qinwubaobei"
)
private
String
appCode
;
public
Integer
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Integer
appId
)
{
this
.
appId
=
appId
;
}
public
String
getAppCode
()
{
return
appCode
;
}
public
void
setAppCode
(
String
appCode
)
{
this
.
appCode
=
appCode
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/Colour.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
java.util.Date
;
/**
* 颜色Entity
* @author liwl
* @version 2020-08-24
*/
@ApiModel
(
value
=
"Colour"
,
description
=
"颜色实体类"
)
public
class
Colour
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 唯一标识
*/
private
Integer
id
;
/**
* 字典编码
*/
private
String
dictCode
;
/**
* 数据项编码
*/
private
String
dataCode
;
/**
* 颜色值
*/
private
String
colourValue
;
private
Date
createTime
;
private
String
createUserId
;
private
Date
updateTime
;
private
String
updateUserId
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getDictCode
()
{
return
dictCode
;
}
public
void
setDictCode
(
String
dictCode
)
{
this
.
dictCode
=
dictCode
;
}
public
String
getDataCode
()
{
return
dataCode
;
}
public
void
setDataCode
(
String
dataCode
)
{
this
.
dataCode
=
dataCode
;
}
public
String
getColourValue
()
{
return
colourValue
;
}
public
void
setColourValue
(
String
colourValue
)
{
this
.
colourValue
=
colourValue
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateUserId
()
{
return
createUserId
;
}
public
void
setCreateUserId
(
String
createUserId
)
{
this
.
createUserId
=
createUserId
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getUpdateUserId
()
{
return
updateUserId
;
}
public
void
setUpdateUserId
(
String
updateUserId
)
{
this
.
updateUserId
=
updateUserId
;
}
}
\ No newline at end of file
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/ContextConfiguration.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Description 上下文配置entity
* @author xutao
* @date 2019-10-18
*/
@ApiModel
(
value
=
"ContextConfiguration"
,
description
=
"上下文配置实体"
)
public
class
ContextConfiguration
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"contextId"
,
value
=
"上下文ID"
,
example
=
"1"
)
private
int
contextId
;
@ApiModelProperty
(
name
=
"contextValue"
,
value
=
"上下文值,默认为空"
,
example
=
"http://localhost:7007/"
)
private
String
contextValue
;
@ApiModelProperty
(
name
=
"contextDesc"
,
value
=
"描述"
,
required
=
true
,
example
=
"门户系统"
)
private
String
contextDesc
;
@ApiModelProperty
(
name
=
"contextWebValue"
,
value
=
"客户端上下文值(web或移动端)"
,
example
=
"http://localhost:7007/"
)
private
String
contextWebValue
;
@ApiModelProperty
(
name
=
"enableDel"
,
value
=
"是否允许删除(0:否 1:是)"
)
private
String
enableDel
;
public
ContextConfiguration
()
{
super
();
}
public
ContextConfiguration
(
String
contextValue
){
this
.
contextValue
=
contextValue
;
}
public
int
getContextId
()
{
return
contextId
;
}
public
void
setContextId
(
int
contextId
)
{
this
.
contextId
=
contextId
;
}
public
String
getContextValue
()
{
return
contextValue
;
}
public
void
setContextValue
(
String
contextValue
)
{
this
.
contextValue
=
contextValue
;
}
public
String
getContextDesc
()
{
return
contextDesc
;
}
public
void
setContextDesc
(
String
contextDesc
)
{
this
.
contextDesc
=
contextDesc
;
}
public
String
getContextWebValue
()
{
return
contextWebValue
;
}
public
void
setContextWebValue
(
String
contextWebValue
)
{
this
.
contextWebValue
=
contextWebValue
;
}
public
String
getEnableDel
()
{
return
enableDel
;
}
public
void
setEnableDel
(
String
enableDel
)
{
this
.
enableDel
=
enableDel
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/ContextConfigurationDTO.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @Description 上下文配置数据传输实体类
* @Author xutao
* @Date 2019-10-18
*/
@ApiModel
(
value
=
"ContextConfigurationDTO"
,
description
=
"上下文配置数据传输实体类"
)
public
class
ContextConfigurationDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"contextValue"
,
value
=
"上下文值,默认为空"
,
example
=
"http://localhost:7007/"
)
private
String
contextValue
;
@ApiModelProperty
(
name
=
"contextDesc"
,
value
=
"描述"
,
required
=
true
,
example
=
"门户系统"
)
private
String
contextDesc
;
@ApiModelProperty
(
name
=
"contextWebValue"
,
value
=
"客户端上下文值(web或移动端)"
,
example
=
"http://localhost:7007/"
)
private
String
contextWebValue
;
@ApiModelProperty
(
name
=
"enableDel"
,
value
=
"是否允许删除(0:否 1:是)"
)
private
String
enableDel
;
public
String
getContextValue
()
{
return
contextValue
;
}
public
void
setContextValue
(
String
contextValue
)
{
this
.
contextValue
=
contextValue
;
}
public
String
getContextDesc
()
{
return
contextDesc
;
}
public
void
setContextDesc
(
String
contextDesc
)
{
this
.
contextDesc
=
contextDesc
;
}
public
String
getContextWebValue
()
{
return
contextWebValue
;
}
public
void
setContextWebValue
(
String
contextWebValue
)
{
this
.
contextWebValue
=
contextWebValue
;
}
public
String
getEnableDel
()
{
return
enableDel
;
}
public
void
setEnableDel
(
String
enableDel
)
{
this
.
enableDel
=
enableDel
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/Dict.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
/**
* 字典Entity
* @author gzx
* @version 2019-11-03
*/
@ApiModel
(
value
=
"Dict"
,
description
=
"字典实体类"
)
public
class
Dict
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 唯一标识
*/
private
Integer
dictId
;
/**
* 字典编码
*/
@ApiModelProperty
(
"字典编码"
)
private
String
dictCode
;
/**
* 字典名称
*/
private
String
dictName
;
/**
* 字典描述
*/
private
String
dictDesc
;
/**
* 父Id
*/
private
Integer
pId
=
0
;
/**
* 1、系统内置 2、用户自定义字典数据,默认为2
*/
private
String
baseFlag
;
/**
* 子字典列表
*/
private
List
<
Dict
>
children
;
public
Integer
getDictId
()
{
return
dictId
;
}
public
void
setDictId
(
Integer
dictId
)
{
this
.
dictId
=
dictId
;
}
public
String
getDictCode
()
{
return
dictCode
;
}
public
void
setDictCode
(
String
dictCode
)
{
this
.
dictCode
=
dictCode
;
}
public
String
getDictName
()
{
return
dictName
;
}
public
void
setDictName
(
String
dictName
)
{
this
.
dictName
=
dictName
;
}
public
String
getDictDesc
()
{
return
dictDesc
;
}
public
void
setDictDesc
(
String
dictDesc
)
{
this
.
dictDesc
=
dictDesc
;
}
public
Integer
getpId
()
{
return
pId
;
}
public
void
setpId
(
Integer
pId
)
{
this
.
pId
=
pId
;
}
public
String
getBaseFlag
()
{
return
baseFlag
;
}
public
void
setBaseFlag
(
String
baseFlag
)
{
this
.
baseFlag
=
baseFlag
;
}
public
List
<
Dict
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
Dict
>
children
)
{
this
.
children
=
children
;
}
}
\ No newline at end of file
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/DictData.java
0 → 100644
浏览文件 @
33891963
/**
* Copyright © 2015-2020 isaac All rights reserved.
*/
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.xml.bind.annotation.XmlAttribute
;
/**
* 系统字典数据项实体
* @author xutao
* @date 2019-10-17
*/
@ApiModel
(
value
=
"DictData"
,
description
=
"系统字典数据项实体"
)
public
class
DictData
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"dataId"
,
value
=
"数据项ID"
,
example
=
"1"
)
private
Integer
dataId
;
@ApiModelProperty
(
name
=
"dataCode"
,
value
=
"数据项编码"
,
required
=
true
,
example
=
"0"
)
private
String
dataCode
;
@ApiModelProperty
(
name
=
"dataName"
,
value
=
"数据项名称"
,
required
=
true
,
example
=
"汉族"
)
private
String
dataName
;
@ApiModelProperty
(
name
=
"dataDesc"
,
value
=
"数据项描述"
,
example
=
"汉族"
)
private
String
dataDesc
;
@ApiModelProperty
(
name
=
"serialIndex"
,
value
=
"排序号"
,
example
=
"1"
)
private
Integer
serialIndex
;
@ApiModelProperty
(
name
=
"dictId"
,
required
=
true
,
value
=
"数据字典ID"
)
private
Integer
dictId
;
public
DictData
()
{
super
();
}
public
DictData
(
String
dataCode
,
String
dataName
){
this
.
dataCode
=
dataCode
;
this
.
dataName
=
dataName
;
}
public
Integer
getDataId
()
{
return
dataId
;
}
public
void
setDataId
(
Integer
dataId
)
{
this
.
dataId
=
dataId
;
}
@XmlAttribute
public
String
getDataCode
()
{
return
dataCode
;
}
public
void
setDataCode
(
String
dataCode
)
{
this
.
dataCode
=
dataCode
;
}
@XmlAttribute
public
String
getDataName
()
{
return
dataName
;
}
public
void
setDataName
(
String
dataName
)
{
this
.
dataName
=
dataName
;
}
@XmlAttribute
public
String
getDataDesc
()
{
return
dataDesc
;
}
public
void
setDataDesc
(
String
dataDesc
)
{
this
.
dataDesc
=
dataDesc
;
}
public
Integer
getSerialIndex
()
{
return
serialIndex
;
}
public
void
setSerialIndex
(
Integer
serialIndex
)
{
this
.
serialIndex
=
serialIndex
;
}
public
Integer
getDictId
()
{
return
dictId
;
}
public
void
setDictId
(
Integer
dictId
)
{
this
.
dictId
=
dictId
;
}
}
\ No newline at end of file
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/Org.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
/**
* @ClassName: Org
* @Description: 组织机构表
* @author zhaokz
* @date 2019-10-22 18:36:40
* @version V1.0
**/
@ApiModel
(
value
=
"Org"
,
description
=
"组织机构表数据对象"
)
public
class
Org
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"组织uuID,物联子平台需要"
,
example
=
"1"
)
private
String
sid
;
@ApiModelProperty
(
value
=
"组织唯一ID"
,
example
=
"1"
)
private
Integer
orgId
;
@ApiModelProperty
(
value
=
"组织版本"
,
example
=
"1"
)
private
String
orgVersion
;
@ApiModelProperty
(
value
=
"组织简称"
,
example
=
"北京市城管局"
)
private
String
orgShortName
;
@ApiModelProperty
(
value
=
"组织名称"
,
example
=
"北京市城市管理综合执法监察局"
)
private
String
orgName
;
@ApiModelProperty
(
value
=
"组织编码"
,
example
=
"12312"
)
private
String
orgCode
;
@ApiModelProperty
(
value
=
"组织邮箱"
,
example
=
"293932@163.com"
)
private
String
orgMail
;
@ApiModelProperty
(
value
=
"联系方式"
,
example
=
"15944553322"
)
private
String
contact
;
@ApiModelProperty
(
value
=
"组织行政级别"
,
example
=
"1"
)
private
String
orgGrade
;
@ApiModelProperty
(
value
=
"组织层数"
,
example
=
"2"
)
private
Integer
orgLevel
;
@ApiModelProperty
(
value
=
"排序号"
,
example
=
"23"
)
private
Integer
serialIndex
;
@ApiModelProperty
(
value
=
"说明"
,
example
=
"阿斯顿发斯蒂芬"
)
private
String
orgDesc
;
@ApiModelProperty
(
value
=
"父组织ID"
,
example
=
"1"
)
private
Integer
parentId
;
@ApiModelProperty
(
value
=
"状态(0正常1禁用2删除)"
,
example
=
"0"
)
private
String
orgStatus
;
@ApiModelProperty
(
value
=
"机构层次代码"
,
example
=
"3424"
)
private
String
orgLevelCode
;
@ApiModelProperty
(
value
=
"删除标记"
,
example
=
"0"
)
private
String
deltag
;
@ApiModelProperty
(
value
=
"应用id"
,
example
=
"23"
)
private
Integer
appId
;
@ApiModelProperty
(
value
=
"用户组id"
,
example
=
"23"
)
private
Integer
grpId
;
/**
* 组织扩展属性
*/
List
<
OrgExtattr
>
orgExtattrs
;
public
String
getSid
()
{
return
sid
;
}
public
void
setSid
(
String
sid
)
{
this
.
sid
=
sid
;
}
public
void
setOrgId
(
Integer
orgId
){
this
.
orgId
=
orgId
;
}
public
Integer
getOrgId
(){
return
this
.
orgId
;
}
public
void
setOrgVersion
(
String
orgVersion
){
this
.
orgVersion
=
orgVersion
;
}
public
String
getOrgVersion
(){
return
this
.
orgVersion
;
}
public
void
setOrgShortName
(
String
orgShortName
){
this
.
orgShortName
=
orgShortName
;
}
public
String
getOrgShortName
(){
return
this
.
orgShortName
;
}
public
void
setOrgName
(
String
orgName
){
this
.
orgName
=
orgName
;
}
public
String
getOrgName
(){
return
this
.
orgName
;
}
public
void
setOrgCode
(
String
orgCode
){
this
.
orgCode
=
orgCode
;
}
public
String
getOrgCode
(){
return
this
.
orgCode
;
}
public
void
setOrgMail
(
String
orgMail
){
this
.
orgMail
=
orgMail
;
}
public
String
getOrgMail
(){
return
this
.
orgMail
;
}
public
void
setContact
(
String
contact
){
this
.
contact
=
contact
;
}
public
String
getContact
(){
return
this
.
contact
;
}
public
void
setOrgGrade
(
String
orgGrade
){
this
.
orgGrade
=
orgGrade
;
}
public
String
getOrgGrade
(){
return
this
.
orgGrade
;
}
public
void
setOrgLevel
(
Integer
orgLevel
){
this
.
orgLevel
=
orgLevel
;
}
public
Integer
getOrgLevel
(){
return
this
.
orgLevel
;
}
public
void
setSerialIndex
(
Integer
serialIndex
){
this
.
serialIndex
=
serialIndex
;
}
public
Integer
getSerialIndex
(){
return
this
.
serialIndex
;
}
public
void
setOrgDesc
(
String
orgDesc
){
this
.
orgDesc
=
orgDesc
;
}
public
String
getOrgDesc
(){
return
this
.
orgDesc
;
}
public
void
setParentId
(
Integer
parentId
){
this
.
parentId
=
parentId
;
}
public
Integer
getParentId
(){
return
this
.
parentId
;
}
public
void
setOrgStatus
(
String
orgStatus
){
this
.
orgStatus
=
orgStatus
;
}
public
String
getOrgStatus
(){
return
this
.
orgStatus
;
}
public
void
setOrgLevelCode
(
String
orgLevelCode
){
this
.
orgLevelCode
=
orgLevelCode
;
}
public
String
getOrgLevelCode
(){
return
this
.
orgLevelCode
;
}
public
void
setDeltag
(
String
deltag
){
this
.
deltag
=
deltag
;
}
public
String
getDeltag
(){
return
this
.
deltag
;
}
public
Integer
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Integer
appId
)
{
this
.
appId
=
appId
;
}
public
Integer
getGrpId
()
{
return
grpId
;
}
public
void
setGrpId
(
Integer
grpId
)
{
this
.
grpId
=
grpId
;
}
public
List
<
OrgExtattr
>
getOrgExtattrs
()
{
return
orgExtattrs
;
}
public
void
setOrgExtattrs
(
List
<
OrgExtattr
>
orgExtattrs
)
{
this
.
orgExtattrs
=
orgExtattrs
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/OrgExtattr.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @ClassName: OrgExtattr
* @Description: 组织扩展属性表
* @author zhaokz
* @date 2019-10-23 15:24:06
* @version V1.0
**/
@ApiModel
(
value
=
"OrgExtattr"
,
description
=
"组织扩展属性表数据对象"
)
public
class
OrgExtattr
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"组织属性ID"
,
example
=
"1"
)
private
Integer
orgAttrId
;
@ApiModelProperty
(
value
=
"属性代码"
)
private
String
attrCode
;
@ApiModelProperty
(
value
=
"属性名称"
)
private
String
attrName
;
@ApiModelProperty
(
value
=
"属性类型"
)
private
String
attrType
;
@ApiModelProperty
(
value
=
"是否必填"
)
private
String
isHave
;
@ApiModelProperty
(
value
=
"描述"
)
private
String
attrDesc
;
@ApiModelProperty
(
value
=
"组织id"
,
example
=
"1"
)
private
Integer
orgId
;
@ApiModelProperty
(
value
=
"属性实例值"
)
private
String
orgAttrValue
;
public
void
setOrgAttrId
(
Integer
orgAttrId
){
this
.
orgAttrId
=
orgAttrId
;
}
public
Integer
getOrgAttrId
(){
return
this
.
orgAttrId
;
}
public
void
setAttrCode
(
String
attrCode
){
this
.
attrCode
=
attrCode
;
}
public
String
getAttrCode
(){
return
this
.
attrCode
;
}
public
void
setAttrName
(
String
attrName
){
this
.
attrName
=
attrName
;
}
public
String
getAttrName
(){
return
this
.
attrName
;
}
public
void
setAttrType
(
String
attrType
){
this
.
attrType
=
attrType
;
}
public
String
getAttrType
(){
return
this
.
attrType
;
}
public
void
setIsHave
(
String
isHave
){
this
.
isHave
=
isHave
;
}
public
String
getIsHave
(){
return
this
.
isHave
;
}
public
void
setAttrDesc
(
String
attrDesc
){
this
.
attrDesc
=
attrDesc
;
}
public
String
getAttrDesc
(){
return
this
.
attrDesc
;
}
public
Integer
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Integer
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getOrgAttrValue
()
{
return
orgAttrValue
;
}
public
void
setOrgAttrValue
(
String
orgAttrValue
)
{
this
.
orgAttrValue
=
orgAttrValue
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/dto/PersonBase.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @ClassName: PersonBase
* @Description: 人员基础信息表
* @author zhaokz
* @date 2019-10-23 15:24:06
* @version V1.0
**/
@ApiModel
(
value
=
"PersonBase"
,
description
=
"人员基础信息表数据对象"
)
public
class
PersonBase
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
private
Integer
personBaseId
;
@ApiModelProperty
(
value
=
"人员名称"
)
private
String
personName
;
@ApiModelProperty
(
value
=
"人员统一编码"
)
private
String
personCode
;
@ApiModelProperty
(
value
=
"证件号"
)
private
String
idNum
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
idType
;
/**
* (0,保密1,男2,女)
*/
@ApiModelProperty
(
value
=
"性别"
)
private
Integer
pbSex
;
@ApiModelProperty
(
value
=
"婚姻状况"
)
private
String
marryCode
;
@ApiModelProperty
(
value
=
"政治面貌"
)
private
String
pbPcode
;
@ApiModelProperty
(
value
=
"家庭电话"
)
private
String
homeTel
;
@ApiModelProperty
(
value
=
"办公电话"
)
private
String
officeTel
;
@ApiModelProperty
(
value
=
"家庭传真"
)
private
String
homeFax
;
@ApiModelProperty
(
value
=
"办公传真"
)
private
String
officeFax
;
@ApiModelProperty
(
value
=
"手机号"
)
private
String
pbMobile
;
@ApiModelProperty
(
value
=
"电子邮件"
)
private
String
pbEmail
;
@ApiModelProperty
(
value
=
"国家"
)
private
String
pbCountry
;
@ApiModelProperty
(
value
=
"省份"
)
private
String
provinceCode
;
@ApiModelProperty
(
value
=
"市区"
)
private
String
cityCode
;
@ApiModelProperty
(
value
=
"街道"
)
private
String
streetCode
;
@ApiModelProperty
(
value
=
"联系地址"
)
private
String
connectAddr
;
@ApiModelProperty
(
value
=
"邮编"
)
private
String
postCode
;
@ApiModelProperty
(
value
=
"最高学历"
)
private
String
eduCode
;
@ApiModelProperty
(
value
=
"最高学位"
)
private
String
degreeCode
;
@ApiModelProperty
(
value
=
"其他信息"
)
private
String
otherInfo
;
@ApiModelProperty
(
value
=
"排序号"
)
private
java
.
math
.
BigDecimal
serialIndex
;
@ApiModelProperty
(
value
=
"图片地址"
)
private
String
photoUrl
;
@ApiModelProperty
(
value
=
"民族"
)
private
String
pbNation
;
@ApiModelProperty
(
value
=
"身份证特征码"
)
private
String
idCode
;
@ApiModelProperty
(
value
=
"是否发放证书"
)
private
String
caStatus
;
@ApiModelProperty
(
value
=
"现任职务"
)
private
String
pbJob
;
@ApiModelProperty
(
value
=
"扩展1"
)
private
String
ext1
;
@ApiModelProperty
(
value
=
"扩展2"
)
private
String
ext2
;
@ApiModelProperty
(
value
=
"扩展3"
)
private
String
ext3
;
@ApiModelProperty
(
value
=
"账号id"
,
example
=
"1"
)
private
Integer
accountId
;
@ApiModelProperty
(
value
=
"账号"
,
example
=
"1"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"用户类型"
,
example
=
"1"
)
private
String
userType
;
@ApiModelProperty
(
value
=
"账号状态"
,
example
=
"1"
)
private
String
userStat
;
@ApiModelProperty
(
value
=
"账号有效期限"
,
example
=
"1"
)
private
Integer
accountTimelimit
;
@ApiModelProperty
(
value
=
"应用id"
,
example
=
"1"
)
private
Integer
appId
;
@ApiModelProperty
(
value
=
"用户组id"
,
example
=
"1"
)
private
Integer
grpId
;
@ApiModelProperty
(
value
=
"角色id"
,
example
=
"1"
)
private
Integer
roleId
;
@ApiModelProperty
(
value
=
"组织id"
,
example
=
"1"
)
private
Integer
orgId
;
/**
* (0:普通帐号1:组织管理员账号2:应用管理帐号3:超级管理帐号)
*/
@ApiModelProperty
(
value
=
"账号类型"
,
example
=
"0"
)
private
String
accountType
;
@ApiModelProperty
(
value
=
"组织名称"
)
private
String
orgName
;
/**
* 查询条件使用-职务ID
*/
@ApiModelProperty
(
value
=
"职务ID"
)
private
String
positionId
;
/**
* 查询条件使用-职级ID
*/
@ApiModelProperty
(
value
=
"职级ID"
)
private
String
rankId
;
@ApiModelProperty
(
name
=
"enableDel"
,
value
=
"是否允许删除(0:否 1:是)"
)
private
String
enableDel
;
public
void
setPersonBaseId
(
Integer
personBaseId
){
this
.
personBaseId
=
personBaseId
;
}
public
Integer
getPersonBaseId
(){
return
this
.
personBaseId
;
}
public
void
setPersonName
(
String
personName
){
this
.
personName
=
personName
;
}
public
String
getPersonName
(){
return
this
.
personName
;
}
public
void
setPersonCode
(
String
personCode
){
this
.
personCode
=
personCode
;
}
public
String
getPersonCode
(){
return
this
.
personCode
;
}
public
void
setIdNum
(
String
idNum
){
this
.
idNum
=
idNum
;
}
public
String
getIdNum
(){
return
this
.
idNum
;
}
public
void
setIdType
(
String
idType
){
this
.
idType
=
idType
;
}
public
String
getIdType
(){
return
this
.
idType
;
}
public
void
setPbSex
(
Integer
pbSex
){
this
.
pbSex
=
pbSex
;
}
public
Integer
getPbSex
(){
return
this
.
pbSex
;
}
public
void
setMarryCode
(
String
marryCode
){
this
.
marryCode
=
marryCode
;
}
public
String
getMarryCode
(){
return
this
.
marryCode
;
}
public
void
setPbPcode
(
String
pbPcode
){
this
.
pbPcode
=
pbPcode
;
}
public
String
getPbPcode
(){
return
this
.
pbPcode
;
}
public
void
setHomeTel
(
String
homeTel
){
this
.
homeTel
=
homeTel
;
}
public
String
getHomeTel
(){
return
this
.
homeTel
;
}
public
void
setOfficeTel
(
String
officeTel
){
this
.
officeTel
=
officeTel
;
}
public
String
getOfficeTel
(){
return
this
.
officeTel
;
}
public
void
setHomeFax
(
String
homeFax
){
this
.
homeFax
=
homeFax
;
}
public
String
getHomeFax
(){
return
this
.
homeFax
;
}
public
void
setOfficeFax
(
String
officeFax
){
this
.
officeFax
=
officeFax
;
}
public
String
getOfficeFax
(){
return
this
.
officeFax
;
}
public
void
setPbMobile
(
String
pbMobile
){
this
.
pbMobile
=
pbMobile
;
}
public
String
getPbMobile
(){
return
this
.
pbMobile
;
}
public
void
setPbEmail
(
String
pbEmail
){
this
.
pbEmail
=
pbEmail
;
}
public
String
getPbEmail
(){
return
this
.
pbEmail
;
}
public
void
setPbCountry
(
String
pbCountry
){
this
.
pbCountry
=
pbCountry
;
}
public
String
getPbCountry
(){
return
this
.
pbCountry
;
}
public
void
setProvinceCode
(
String
provinceCode
){
this
.
provinceCode
=
provinceCode
;
}
public
String
getProvinceCode
(){
return
this
.
provinceCode
;
}
public
void
setCityCode
(
String
cityCode
){
this
.
cityCode
=
cityCode
;
}
public
String
getCityCode
(){
return
this
.
cityCode
;
}
public
void
setStreetCode
(
String
streetCode
){
this
.
streetCode
=
streetCode
;
}
public
String
getStreetCode
(){
return
this
.
streetCode
;
}
public
void
setConnectAddr
(
String
connectAddr
){
this
.
connectAddr
=
connectAddr
;
}
public
String
getConnectAddr
(){
return
this
.
connectAddr
;
}
public
void
setPostCode
(
String
postCode
){
this
.
postCode
=
postCode
;
}
public
String
getPostCode
(){
return
this
.
postCode
;
}
public
void
setEduCode
(
String
eduCode
){
this
.
eduCode
=
eduCode
;
}
public
String
getEduCode
(){
return
this
.
eduCode
;
}
public
void
setDegreeCode
(
String
degreeCode
){
this
.
degreeCode
=
degreeCode
;
}
public
String
getDegreeCode
(){
return
this
.
degreeCode
;
}
public
void
setOtherInfo
(
String
otherInfo
){
this
.
otherInfo
=
otherInfo
;
}
public
String
getOtherInfo
(){
return
this
.
otherInfo
;
}
public
void
setSerialIndex
(
java
.
math
.
BigDecimal
serialIndex
){
this
.
serialIndex
=
serialIndex
;
}
public
java
.
math
.
BigDecimal
getSerialIndex
(){
return
this
.
serialIndex
;
}
public
void
setPhotoUrl
(
String
photoUrl
){
this
.
photoUrl
=
photoUrl
;
}
public
String
getPhotoUrl
(){
return
this
.
photoUrl
;
}
public
void
setPbNation
(
String
pbNation
){
this
.
pbNation
=
pbNation
;
}
public
String
getPbNation
(){
return
this
.
pbNation
;
}
public
void
setIdCode
(
String
idCode
){
this
.
idCode
=
idCode
;
}
public
String
getIdCode
(){
return
this
.
idCode
;
}
public
void
setCaStatus
(
String
caStatus
){
this
.
caStatus
=
caStatus
;
}
public
String
getCaStatus
(){
return
this
.
caStatus
;
}
public
void
setPbJob
(
String
pbJob
){
this
.
pbJob
=
pbJob
;
}
public
String
getPbJob
(){
return
this
.
pbJob
;
}
public
void
setExt1
(
String
ext1
){
this
.
ext1
=
ext1
;
}
public
String
getExt1
(){
return
this
.
ext1
;
}
public
void
setExt2
(
String
ext2
){
this
.
ext2
=
ext2
;
}
public
String
getExt2
(){
return
this
.
ext2
;
}
public
void
setExt3
(
String
ext3
){
this
.
ext3
=
ext3
;
}
public
String
getExt3
(){
return
this
.
ext3
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
String
userType
)
{
this
.
userType
=
userType
;
}
public
String
getUserStat
()
{
return
userStat
;
}
public
void
setUserStat
(
String
userStat
)
{
this
.
userStat
=
userStat
;
}
public
Integer
getAccountTimelimit
()
{
return
accountTimelimit
;
}
public
void
setAccountTimelimit
(
Integer
accountTimelimit
)
{
this
.
accountTimelimit
=
accountTimelimit
;
}
public
Integer
getAccountId
()
{
return
accountId
;
}
public
void
setAccountId
(
Integer
accountId
)
{
this
.
accountId
=
accountId
;
}
public
Integer
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Integer
appId
)
{
this
.
appId
=
appId
;
}
public
Integer
getGrpId
()
{
return
grpId
;
}
public
void
setGrpId
(
Integer
grpId
)
{
this
.
grpId
=
grpId
;
}
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getAccountType
()
{
return
accountType
;
}
public
void
setAccountType
(
String
accountType
)
{
this
.
accountType
=
accountType
;
}
public
String
getOrgName
()
{
return
orgName
;
}
public
void
setOrgName
(
String
orgName
)
{
this
.
orgName
=
orgName
;
}
public
Integer
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Integer
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
String
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getRankId
()
{
return
rankId
;
}
public
void
setRankId
(
String
rankId
)
{
this
.
rankId
=
rankId
;
}
public
String
getEnableDel
()
{
return
enableDel
;
}
public
void
setEnableDel
(
String
enableDel
)
{
this
.
enableDel
=
enableDel
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/proxy/PersonApiServiceProxy.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
proxy
;
import
com.loit.api.service.PersonApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* feign接口代理, 可在util工具类中获取feign接口并调用
*/
@Service
(
value
=
"personApiServiceProxy"
)
public
class
PersonApiServiceProxy
{
@Autowired
PersonApiService
personApiService
;
public
PersonApiService
getPersonApiService
(){
return
personApiService
;
}
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/ActRightApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* @ClassName: ActRightController
* @Description:
* @author zhaokz
* @date 2019年10月28日 下午3:56:15
* @version V1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
ActRightApiService
{
@ApiOperation
(
value
=
"根据菜单ID获取当前用户对本资源的操作权限"
,
notes
=
"根据菜单ID获取当前用户对本资源的操作权限"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"menuId"
,
value
=
"菜单ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/actRight/getActRightByMenuId"
)
public
AjaxJson
getActRightByMenuId
(
@RequestParam
(
value
=
"menuId"
,
required
=
true
)
Integer
menuId
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/ApplicationManagerApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description 组织
* @author liwl
* @date 2020年8月24日
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
ApplicationManagerApiService
{
/**
* @description 根据AppCode获取ApplicationManage
* @author liwl
* @date:2020年8月24日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/applicationManage/getByAppCode"
)
@ApiOperation
(
value
=
"根据AppCode获取ApplicationManage"
,
notes
=
"根据AppCode获取ApplicationManage"
)
@ApiImplicitParam
(
name
=
"appCode"
,
value
=
"应用编码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
public
AjaxJson
getByAppCode
(
@RequestParam
(
value
=
"appCode"
,
required
=
true
)
String
appCode
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/AreaCodeApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@FeignClient
(
name
=
"loit-portal"
)
public
interface
AreaCodeApiService
{
@ApiOperation
(
value
=
"行政区域列表-根据父id"
,
notes
=
"行政区域列表-根据父id"
)
@ApiImplicitParam
(
name
=
"pcode"
,
value
=
"父id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
@GetMapping
(
value
=
"api/v1/feign/area/areaList"
)
public
AjaxJson
areaCodeList
(
@RequestParam
(
value
=
"pcode"
,
required
=
true
)
Long
pcode
);
@ApiOperation
(
value
=
"行政区域树-根据父id"
,
notes
=
"行政区域树-根据父id"
)
@ApiImplicitParam
(
name
=
"pcode"
,
value
=
"id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
@GetMapping
(
value
=
"api/v1/feign/area/areaList/tree"
)
public
AjaxJson
areaCodeListTree
(
@RequestParam
(
value
=
"pcode"
,
required
=
true
)
Long
pcode
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/ColourApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* @description 颜色
* @author liwl
* @date 2020年8月24日
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
ColourApiService
{
/**
* @description 根据DictCode和DataCode获取颜色
* @author liwl
* @date:2020年8月24日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/colour/findByDictCodeAndDataCode"
)
@ApiOperation
(
value
=
"根据DictCode和DataCode获取颜色"
,
notes
=
"根据DictCode和DataCode获取颜色"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"dictCode"
,
value
=
"字典编码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dataCode"
,
value
=
"数据项编码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
public
AjaxJson
findByDictCodeAndDataCode
(
@RequestParam
(
value
=
"dictCode"
,
required
=
true
)
String
dictCode
,
@RequestParam
(
value
=
"dataCode"
,
required
=
true
)
String
dataCode
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/ContextConfigurationApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.api.dto.ContextConfigurationDTO
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description 上下文配置
* @author xutao
* @date 2019-10-18
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
ContextConfigurationApiService
{
@GetMapping
(
value
=
"api/v1/feign/contextConfig/list"
)
@ApiOperation
(
value
=
"列表"
,
notes
=
"获取上下文配置列表"
)
public
AjaxJson
list
();
@GetMapping
(
value
=
"api/v1/feign/contextConfig/page"
)
@ApiOperation
(
value
=
"分页列表"
,
notes
=
"获取上下文配置分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contextValue"
,
value
=
"上下文值"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contextDesc"
,
value
=
"描述"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)})
public
AjaxJson
page
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"contextValue"
,
required
=
false
)
String
contextValue
,
@RequestParam
(
value
=
"contextDesc"
,
required
=
false
)
String
contextDesc
);
@GetMapping
(
value
=
"api/v1/feign/contextConfig/{contextId}"
)
@ApiOperation
(
value
=
"详情"
,
notes
=
"根据contextId获取上下文配置详情"
)
@ApiImplicitParam
(
name
=
"contextId"
,
value
=
"上下文配置ID"
,
required
=
true
,
dataType
=
"String"
)
public
AjaxJson
get
(
@PathVariable
(
required
=
false
)
String
contextId
);
@PostMapping
(
value
=
"api/v1/feign/contextConfig/save"
)
@ApiOperation
(
value
=
"保存"
,
notes
=
"新增上下文配置"
)
@ApiImplicitParam
(
name
=
"contextConfigurationDTO"
,
value
=
"上下文配置数据传输实体类"
,
required
=
true
,
dataType
=
"ContextConfigurationDTO"
)
public
AjaxJson
save
(
@RequestBody
ContextConfigurationDTO
contextConfigurationDTO
);
@PostMapping
(
value
=
"api/v1/feign/contextConfig/{contextId}"
)
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改上下文配置"
)
public
AjaxJson
update
(
@PathVariable
int
contextId
,
@RequestBody
ContextConfigurationDTO
contextConfigurationDTO
);
@ApiOperation
(
value
=
"删除"
,
notes
=
"单个或批量删除上下文配置,多ID时,以逗号分隔"
)
@DeleteMapping
(
value
=
"api/v1/feign/contextConfig/{contextId}"
)
public
AjaxJson
deleteAll
(
@PathVariable
(
"contextId"
)
String
ids
);
@GetMapping
(
value
=
"api/v1/feign/contextConfig/serviceId/{serviceId}"
)
public
AjaxJson
getByserviceId
(
@PathVariable
(
"contextId"
)
String
ids
);
@ApiOperation
(
value
=
"检查上下文描述是否重复"
,
notes
=
"检查上下文描述是否重复"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contextId"
,
value
=
"上下文ID"
,
required
=
false
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contextDesc"
,
value
=
"上下文描述"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)})
@GetMapping
(
value
=
"api/v1/feign/contextConfig/checkDescUnique"
)
public
AjaxJson
checkDictNameUnique
(
@RequestParam
(
value
=
"contextId"
,
required
=
false
)
Integer
contextId
,
@RequestParam
(
value
=
"contextDesc"
,
required
=
true
)
String
contextDesc
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/DictApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description 字典controller
* @author: gzx
* @date: 2019年11月4日 上午9:40:29
* @version: V1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
DictApiService
{
/**
* @description 系统字典分页列表
* @author xutao
* @date:2019年10月18日
* @return
*/
@RequestMapping
(
value
=
"api/v1/feign/dict/list"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
list
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"dictCode"
,
required
=
false
)
String
dictCode
,
@RequestParam
(
value
=
"dictName"
,
required
=
false
)
String
dictName
,
@RequestParam
(
value
=
"baseFlag"
,
required
=
false
)
String
baseFlag
);
/**
* @description 系统字典详情
* @author xutao
* @date:2019年10月18日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dict/{dictId}"
)
public
AjaxJson
get
(
@PathVariable
(
required
=
true
)
String
dictId
);
/**
* @description 检查字典名称是否重复
* @param dictId
* @param dictName
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dict/checkDictNameUnique"
)
public
AjaxJson
checkDictNameUnique
(
@RequestParam
(
value
=
"dictId"
,
required
=
false
)
Integer
dictId
,
@RequestParam
(
value
=
"dictName"
,
required
=
true
)
String
dictName
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/DictDataApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description 系统字典数据项Controller
* @author xutao
* @date 2019-10-18
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
DictDataApiService
{
/**
* @description 系统字典数据项分页列表
* @author xutao
* @date:2019年10月18日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dictData/page"
)
@ApiOperation
(
value
=
"分页列表"
,
notes
=
"获取系统字典数据项分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
public
AjaxJson
page
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"dictId"
,
required
=
true
)
Integer
dictId
);
/**
* @description 系统字典数据项列表
* @author xutao
* @date:2019年10月18日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dictData/list"
)
@ApiOperation
(
value
=
"列表"
,
notes
=
"获取系统字典数据项列表"
)
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
public
AjaxJson
list
(
@RequestParam
(
value
=
"dictId"
,
required
=
true
)
Integer
dictId
);
/**
* @description 系统字典数据项详情
* @author xutao
* @date:2019年10月18日
* @param dataId
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dictData/{dataId}"
)
@ApiOperation
(
value
=
"详情"
,
notes
=
"根据dataId获取系统字典数据项详情"
)
@ApiImplicitParam
(
name
=
"dataId"
,
value
=
"系统字典数据项ID"
,
required
=
true
,
dataType
=
"String"
)
public
AjaxJson
get
(
@PathVariable
(
required
=
true
)
String
dataId
);
/**
* @description 从缓存中获取某字典数据项列表,如果缓存中没有,则从数据库中获取
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/dictData/getDictDataByDictId"
)
@ApiOperation
(
value
=
"从缓存中获取某字典数据项列表"
,
notes
=
"从缓存中获取某字典数据项列表,如果缓存中没有,则从数据库中获取"
)
@ApiImplicitParam
(
name
=
"dictCode"
,
value
=
"字典dictCode"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
public
AjaxJson
listDictDataByDictId
(
@RequestParam
(
value
=
"dictCode"
,
required
=
true
)
String
dictCode
);
/**
* @description 检查字典项名称是否重复
* @return
*/
@ApiOperation
(
value
=
"检查字典项名称是否重复"
,
notes
=
"检查字典项名称是否重复"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典ID"
,
required
=
true
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dataId"
,
value
=
"字典项ID"
,
required
=
false
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dataName"
,
value
=
"字典项名称"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/dictData/checkDataNameUnique"
)
public
AjaxJson
checkDataNameUnique
(
@RequestParam
(
value
=
"dictId"
,
required
=
true
)
Integer
dictId
,
@RequestParam
(
value
=
"dataId"
,
required
=
false
)
Integer
dataId
,
@RequestParam
(
value
=
"dataName"
,
required
=
true
)
String
dataName
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/JPushApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.Map
;
/**
* @description: websocket消息推送
* @date: 2020/5/7 10:16
* @author: wubj
* @version v1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
JPushApiService
{
/**
* 极光推送
* Map<String, String> map {"userIds":"", "message":""})
* @return
*/
@PostMapping
(
value
=
"api/v1/feign/jPush/pushAndroid"
)
AjaxJson
pushAndroid
(
@RequestBody
Map
<
String
,
String
>
map
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/NoticeReceiveApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Map
;
/**
* @description: 通知接收人信息
* @date: 2020/5/7 10:16
* @author: wubj
* @version v1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
NoticeReceiveApiService
{
/**
* 更新阅读状态
* @return
*/
@PostMapping
(
value
=
"api/v1/feign/noticeReceive/updateStatus"
)
AjaxJson
updateStatus
(
@RequestParam
List
<
Long
>
noticeIds
,
@RequestParam
String
userId
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/OrgApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
org.springframework.cloud.openfeign.FeignClient
;
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.RequestParam
;
import
com.loit.api.dto.Org
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
/**
* @ClassName: OrgController
* @Description:
* @author zhaokz
* @date 2019年10月22日 下午5:41:41
* @version V1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
OrgApiService
{
/**
* 获取组织树形列表
* @return
*/
@ApiOperation
(
value
=
"获取组织树形列表"
,
notes
=
"获取组织树形列表"
)
@GetMapping
(
value
=
"api/v1/feign/org/treeList"
)
public
AjaxJson
treeList
();
/**
* 获取当前应用组织树形列表
* @return
*/
@ApiOperation
(
value
=
"获取当前应用组织树形列表"
,
notes
=
"获取当前应用组织树形列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"应用id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/org/currentApp/treeList1"
)
public
AjaxJson
treeList1
(
@RequestParam
(
value
=
"appId"
,
required
=
true
)
String
appId
);
/**
* @description 根据组织编码获取当前应用组织树形列表
* @return
*/
@ApiOperation
(
value
=
"根据组织编码获取当前应用组织树形列表"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"应用id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgCode"
,
value
=
"组织编码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/org/currentApp/treeList2"
)
public
AjaxJson
treeList2
(
@RequestParam
(
value
=
"appId"
,
required
=
true
)
String
appId
,
@RequestParam
(
value
=
"orgCode"
,
required
=
true
)
String
orgCode
);
/**
* 获取组织分页列表
* @return
*/
@ApiOperation
(
value
=
"获取组织分页列表"
,
notes
=
"获取组织分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"应用id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
,
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"组织ID"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgName"
,
value
=
"组织名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgCode"
,
value
=
"组织编码"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"deltag"
,
value
=
"删除标记"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"queryLabelName"
,
value
=
"标签名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/org/pageList"
)
public
AjaxJson
list
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"appId"
,
required
=
false
)
String
appId
,
@RequestParam
(
value
=
"orgId"
,
required
=
false
)
String
orgId
,
@RequestParam
(
value
=
"orgName"
,
required
=
false
)
String
orgName
,
@RequestParam
(
value
=
"orgCode"
,
required
=
false
)
String
orgCode
,
@RequestParam
(
value
=
"deltag"
,
required
=
true
)
String
deltag
,
@RequestParam
(
value
=
"queryLabelName"
,
required
=
false
)
String
queryLabelName
);
/**
* 获取组织分页列表
* @return
*/
@ApiOperation
(
value
=
"获取组织分页列表-无登录用户"
,
notes
=
"获取组织分页列表-无登录用户"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"应用id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
,
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"组织ID"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgName"
,
value
=
"组织名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgCode"
,
value
=
"组织编码"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"deltag"
,
value
=
"删除标记"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"queryLabelName"
,
value
=
"标签名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/org/nouser/pageList"
)
public
AjaxJson
noUserList
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"appId"
,
required
=
false
)
String
appId
,
@RequestParam
(
value
=
"orgId"
,
required
=
false
)
String
orgId
,
@RequestParam
(
value
=
"orgName"
,
required
=
false
)
String
orgName
,
@RequestParam
(
value
=
"orgCode"
,
required
=
false
)
String
orgCode
,
@RequestParam
(
value
=
"deltag"
,
required
=
true
)
String
deltag
,
@RequestParam
(
value
=
"queryLabelName"
,
required
=
false
)
String
queryLabelName
);
/**
* 获取组织详细信息
* @param orgId
* @return
*/
@ApiOperation
(
value
=
"获取组织详细信息"
,
notes
=
"根据id来获取Org详细信息"
)
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"orgId"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
)
@GetMapping
(
value
=
"api/v1/feign/org/{orgId}"
)
public
AjaxJson
detail
(
@PathVariable
String
orgId
);
/**
* 验证组织唯一
* @param
* @return
*/
@ApiOperation
(
value
=
"组织唯一验证"
,
notes
=
"组织唯一验证"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"orgName"
,
value
=
"组织名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgShortName"
,
value
=
"组织简称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"parentId"
,
value
=
"父组织id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
})
@PostMapping
(
value
=
"api/v1/feign/org/validateOrgName"
)
public
AjaxJson
validateOrgName
(
@RequestBody
Org
org
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/PersonApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@FeignClient
(
name
=
"loit-portal"
)
public
interface
PersonApiService
{
/**
* 获取人员信息列表
* @return
*/
@ApiOperation
(
value
=
"获取人员信息列表"
,
notes
=
"获取人员信息列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"delFlag"
,
value
=
"是否删除"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"应用Id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"personName"
,
value
=
"人员名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/pageList"
)
public
AjaxJson
list
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"delFlag"
,
required
=
true
)
String
delFlag
,
@RequestParam
(
value
=
"appId"
,
required
=
false
)
Integer
appId
,
@RequestParam
(
value
=
"personName"
,
required
=
false
)
String
personName
,
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
);
/**
* 根据组织id获取人员信息列表
* @return
*/
@ApiOperation
(
value
=
"根据组织id获取人员信息列表"
,
notes
=
"根据组织id获取人员信息列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"组织id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"delFlag"
,
value
=
"是否删除"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/orgPersonList"
)
public
AjaxJson
getPersonByOrgId
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"orgId"
,
required
=
true
)
String
orgId
,
@RequestParam
(
value
=
"delFlag"
,
required
=
true
)
String
delFlag
);
/**
* @description 根据用户id获取该用户所在组织下的人员列表
* @return
*/
@ApiOperation
(
value
=
"根据用户id获取该用户所在组织下的人员列表"
,
notes
=
"根据用户id获取该用户所在组织下的人员列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"accountId"
,
value
=
"用户id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"delFlag"
,
value
=
"是否删除"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/ownOrgPersonList"
)
public
AjaxJson
getListByUserId
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"accountId"
,
required
=
true
)
String
accountId
,
@RequestParam
(
value
=
"delFlag"
,
required
=
true
)
String
delFlag
);
/**
* 获取人员详细信息
* @param accountId
* @return
*/
@ApiOperation
(
value
=
"获取人员详细信息"
,
notes
=
"根据id来获取人员详细信息"
)
@ApiImplicitParam
(
name
=
"accountId"
,
value
=
"id"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
)
@GetMapping
(
value
=
"api/v1/feign/person/{accountId}"
)
public
AjaxJson
detail
(
@PathVariable
(
value
=
"accountId"
)
String
accountId
);
/**
* 获取密码策略
* @param
* @return
*/
@ApiOperation
(
value
=
"获取密码策略"
,
notes
=
"获取密码策略"
)
@GetMapping
(
value
=
"api/v1/feign/person/passwordApolicy"
)
public
AjaxJson
passwordApolicy
();
/**
* 验证账号唯一
* @param
* @return
*/
@ApiOperation
(
value
=
"账号唯一验证"
,
notes
=
"账号唯一验证"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"账号"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"accountId"
,
value
=
"账号id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/validateUserId"
)
public
AjaxJson
validateUserId
(
@RequestParam
(
value
=
"userId"
,
required
=
true
)
String
userId
,
@RequestParam
(
value
=
"accountId"
,
required
=
false
)
Integer
accountId
);
/**
* 验证人员名称唯一
* @param
* @return
*/
@ApiOperation
(
value
=
"人员名称唯一验证"
,
notes
=
"人员名称唯一验证"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"personName"
,
value
=
"人员名称"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"personBaseId"
,
value
=
"人员基本信息id"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/validatePersonName"
)
public
AjaxJson
validatePersonName
(
@RequestParam
(
value
=
"personName"
,
required
=
true
)
String
personName
,
@RequestParam
(
value
=
"personBaseId"
,
required
=
false
)
Integer
personBaseId
);
/**
* 密码策略校验
* @param
* @return
*/
@ApiOperation
(
value
=
"密码策略校验"
,
notes
=
"密码策略校验"
)
@ApiImplicitParam
(
name
=
"passWord"
,
value
=
"密码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
@PostMapping
(
value
=
"api/v1/feign/person/validatePassword"
)
public
AjaxJson
validatePassword
(
@RequestParam
(
value
=
"passWord"
,
required
=
true
)
String
passWord
);
/**
* 获取人员详细信息
* @param
* @return
*/
@ApiOperation
(
value
=
"获取当前登录用户"
,
notes
=
"获取当前登录用户"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户登录账号"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"api/v1/feign/person/getCurretUser"
)
public
AjaxJson
getCurretUser
(
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
);
/**
* 获取所有的账号信息
* @param
* @return
*/
@ApiOperation
(
value
=
"获取所有的账号信息"
,
notes
=
"获取所有的账号信息"
)
@GetMapping
(
value
=
"api/v1/feign/person/getAccoutInfoList"
)
public
AjaxJson
getAccoutInfoList
();
/**
* 根据登录账号列表获取账号信息列表
* @param
* @return
*/
@ApiOperation
(
value
=
"根据登录账号列表获取账号信息列表"
,
notes
=
"根据登录账号列表获取账号信息列表"
)
@GetMapping
(
value
=
"api/v1/feign/person/getAccountByUserIds"
)
public
AjaxJson
getAccountByUserIds
(
@RequestParam
List
<
String
>
userIds
);
/**
* @description 根据角色获取人员分页列表
* @author xutao
* @date:2019年10月18日
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/person/findPersonPageByRole"
)
@ApiOperation
(
value
=
"根据角色获取人员分页列表"
,
notes
=
"根据角色获取人员分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"roleId"
,
value
=
"角色ID(和角色编码2选1)"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"roleCode"
,
value
=
"角色编码(和角色ID2选1)"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
public
AjaxJson
findPersonPageByRole
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"roleId"
,
required
=
false
)
Integer
roleId
,
@RequestParam
(
value
=
"roleCode"
,
required
=
false
)
String
roleCode
);
}
loit-service-api/loit-portal-api/src/main/java/com/loit/api/service/WebSocketApiService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
api
.
service
;
import
com.loit.common.json.AjaxJson
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.Map
;
/**
* @description: websocket消息推送
* @date: 2020/5/7 10:16
* @author: wubj
* @version v1.0
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
WebSocketApiService
{
/**
* 广播所有在线用户
* @return
*/
@PostMapping
(
value
=
"api/v1/feign/websocket/broadcast"
)
AjaxJson
sendMessageBroadcast
(
@RequestBody
String
message
);
/**
* 发送指定用户
* Map<String, String> sendMap(key:userId, value:消息)
* @return
*/
@PostMapping
(
value
=
"api/v1/feign/websocket/toUsers"
)
AjaxJson
sendMessageToUsers
(
@RequestBody
Map
<
String
,
String
>
sendMap
);
/**
* 获取用户连接的websocket服务器信息
* @return
*/
@GetMapping
(
value
=
"api/v1/feign/websocket/websocketServer"
)
@ApiOperation
(
value
=
"获取用户连接的websocket服务器信息"
)
AjaxJson
getWebsocketServer
();
}
loit-service-api/loit-portal-api/src/main/java/com/loit/getway/PermissionService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
getway
;
import
com.loit.common.json.AjaxJson
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* @Description: 提供给网关资源权限校验专用
* @Author: yangwenbin
* @Date: 2020/4/27 22:36
*/
@FeignClient
(
name
=
"loit-portal"
)
public
interface
PermissionService
{
@GetMapping
(
value
=
"api/v1/feign/permission/checkUrlPermission"
)
public
AjaxJson
<
Boolean
>
checkUrlPermission
(
@RequestParam
(
value
=
"userId"
,
required
=
true
)
String
userId
,
@RequestParam
(
value
=
"actUrl"
,
required
=
true
)
String
actUrl
,
@RequestParam
(
value
=
"method"
,
required
=
true
)
String
method
);
}
loit-service-api/pom.xml
0 → 100644
浏览文件 @
33891963
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
demo
</artifactId>
<groupId>
com.loit
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
loit-service-api
</artifactId>
<version>
1.0.0
</version>
<modules>
<module>
loit-portal-api
</module>
</modules>
<packaging>
pom
</packaging>
<dependencies>
<dependency>
<groupId>
com.loit
</groupId>
<artifactId>
loit-common
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
loit-service/loit-notice/pom.xml
浏览文件 @
33891963
...
@@ -7,9 +7,124 @@
...
@@ -7,9 +7,124 @@
<groupId>
com.loit
</groupId>
<groupId>
com.loit
</groupId>
<version>
1.0.0
</version>
<version>
1.0.0
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
loit-notice
</artifactId>
<artifactId>
loit-notice
</artifactId>
<name>
loit-notice
</name>
<version>
1.0.0
</version>
<url>
http://maven.apache.org
</url>
<dependencies>
<!-- nacos 注册中心 -->
<dependency>
<groupId>
com.timeloit.cloud
</groupId>
<artifactId>
spring-cloud-starter-timeloit-nacos-discovery
</artifactId>
</dependency>
<!-- 微服务:Feign -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
<dependency>
<groupId>
com.timeloit.cloud
</groupId>
<artifactId>
spring-cloud-starter-timeloit-nacos-config
</artifactId>
</dependency>
<dependency>
<groupId>
com.loit
</groupId>
<artifactId>
loit-core-boot
</artifactId>
<version>
${loit-core-boot}
</version>
</dependency>
<dependency>
<groupId>
com.loit
</groupId>
<artifactId>
loit-common
</artifactId>
<version>
${loit-common}
</version>
</dependency>
<dependency>
<groupId>
com.loit
</groupId>
<artifactId>
loit-portal-api
</artifactId>
<version>
${loit-portal-api}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
loit-notice
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<mainClass>
com.loit.NoticeApplication
</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<configuration>
<skipTests>
true
</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<encoding>
UTF-8
</encoding>
<compilerArgs>
<arg>
-extdirs
</arg>
<arg>
${project.basedir}/src/main/resources/lib
</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<executions>
<execution>
<id>
add-source
</id>
<phase>
generate-sources
</phase>
<goals>
<goal>
add-source
</goal>
</goals>
<configuration>
<sources>
<source>
${basedir}/src/notice/java
</source>
<!-- 我们可以通过在这里添加多个source节点,来添加任意多个源文件夹 -->
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<!-- 打包时将jsp文件拷贝到META-INF目录下 -->
<resource>
<directory>
${project.basedir}/src/main/resources/lib
</directory>
<targetPath>
BOOT-INF/lib/
</targetPath>
<includes>
<include>
**/*.jar
</include>
</includes>
</resource>
<resource>
<directory>
src/main/resources
</directory>
<includes>
<include>
**/**
</include>
</includes>
<filtering>
false
</filtering>
</resource>
<resource>
<directory>
src/notice/resources
</directory>
<includes>
<include>
**/**
</include>
</includes>
<filtering>
false
</filtering>
</resource>
</resources>
</build>
</project>
</project>
\ No newline at end of file
loit-service/loit-notice/src/main/java/com/loit/NoticeApplication.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
;
import
com.loit.common.spring.timeloit.utils.LogUtil
;
import
com.loit.loitcasclient.utils.ClientSpringContextUtil
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@SpringBootApplication
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@RestController
@EnableSwagger2
@EnableScheduling
public
class
NoticeApplication
{
public
static
void
main
(
String
[]
args
)
{
long
startTime
=
System
.
currentTimeMillis
();
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
NoticeApplication
.
class
,
args
);
ClientSpringContextUtil
.
setApplicationContext
(
context
);
long
endTime
=
System
.
currentTimeMillis
();
float
excTime
=
(
float
)
(
endTime
-
startTime
)
/
1000
;
System
.
out
.
println
(
LogUtil
.
print
(
"loit-notice项目启动成功,执行用时:"
+
excTime
+
"秒"
));
}
}
loit-service/loit-notice/src/main/resources/application-dev.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
5002
tomcat
:
uriEncoding
:
UTF-8
max-connections
:
20000
threads
:
max
:
1000
servlet
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
39.100.254.140:8103
namespace
:
3ac84119-5558-4bf8-b309-034dd0e458e0
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30MB
max-request-size
:
30MB
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.100.254.140:3306/loitnotice_5002?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
loit2019ABC
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
0
host
:
localhost
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
activemq
:
in-memory
:
true
packages
:
trust-all
:
true
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
main
:
allow-bean-definition-overriding
:
true
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-prod.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
7005
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
192.168.111.150:8103
namespace
:
6a40f019-770a-4fee-8079-900a9151ef61
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://192.168.111.152:3306/loitnotice?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
root
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
6
host
:
192.168.111.152
port
:
8000
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
activemq
:
broker-url
:
tcp://192.168.111.150:61616
user
:
admin
password
:
admin
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://192.168.111.150
# 图标文件上传
fileUpload
:
uploadDir
:
/home/loit/icon
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-test5002.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
5002
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
39.100.254.140:8103
namespace
:
3ac84119-5558-4bf8-b309-034dd0e458e0
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.100.254.140:3306/loitnotice_5002?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
loit2019ABC
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
1
host
:
39.100.254.140
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
activemq
:
broker-url
:
tcp://localhost:61616
user
:
admin
password
:
admin
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-test5003.yml
0 → 100644
浏览文件 @
33891963
#测试环境
server
:
port
:
5003
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
47.114.50.99:8010
namespace
:
f59261e2-1572-439e-ac44-0fbb645c04a3
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.100.254.140:3306/loitnotice_5003?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
loit2019ABC
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
2
host
:
39.100.254.140
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
activemq
:
broker-url
:
tcp://localhost:61616
user
:
admin
password
:
admin
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-test5102.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
5102
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
39.100.254.140:8103
namespace
:
6c8fa2e5-a3b8-48a0-9ab6-c1097ecc0dc3
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.100.254.140:3306/loitnotice_5102?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
loit2019ABC
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
5
host
:
39.100.254.140
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-test5103.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
5103
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
39.100.254.140:8103
namespace
:
27dccadb-ad5e-4036-b63e-dd2ccd136a45
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.100.254.140:3306/loitnotice_5103?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
loit2019ABC
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
database
:
6
host
:
39.100.254.140
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
activemq
:
broker-url
:
tcp://localhost:61616
user
:
admin
password
:
admin
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/application-test7005s231.yml
0 → 100644
浏览文件 @
33891963
server
:
port
:
7005
tomcat
:
uriEncoding
:
UTF-8
max-threads
:
1000
max-connections
:
20000
spring
:
application
:
name
:
loit-notice
cloud
:
nacos
:
discovery
:
# Nacos 注册中心地址
server-addr
:
39.100.254.140:8103
namespace
:
27dccadb-ad5e-4036-b63e-dd2ccd136a45
metadata
:
management
:
context-path
:
/actuator
servlet
:
multipart
:
max-file-size
:
30Mb
max-request-size
:
30Mb
http
:
encoding
:
charset
:
UTF-8
enabled
:
true
force
:
true
messages
:
encoding
:
UTF-8
banner
:
charset
:
UTF-8
devtools
:
restart
:
enabled
:
true
cache
:
type
:
ehcache
ehcache
:
config
:
classpath:config/ehcache.xml
datasource
:
url
:
jdbc:mysql://39.104.177.231:3306/loitnotice?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
type
:
com.alibaba.druid.pool.DruidDataSource
username
:
root
password
:
2018time1
driver-class-name
:
com.mysql.jdbc.Driver
initialSize
:
5
minIdle
:
5
maxActive
:
20
maxWait
:
60000
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1
thymeleaf
:
cache
:
false
enabled
:
false
suffix
:
.html
jackson
:
time-zone
:
GMT+8
redis
:
host
:
39.100.254.140
port
:
6379
jedis
:
pool
:
max-idle
:
20
min-idle
:
0
max-active
:
8
max-wait
:
-1
timeout
:
10000
password
:
portal2019
activemq
:
broker-url
:
tcp://localhost:61616
user
:
admin
password
:
admin
resources
:
static-locations
:
classpath:/templates/
data
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-nodes
:
127.0.0.1:9300
mybatis
:
configuration
:
map-underscore-to-camel-case
:
true
typeAliasesPackage
:
com.loit
mapperLocations
:
classpath*:mapper/**/*.xml
#security:
# basic:
# enabled: false
management
:
security
:
enabled
:
false
endpoints
:
web
:
exposure
:
include
:
"
*"
endpoint
:
health
:
show-details
:
ALWAYS
info
:
name
:
'
@project.name@'
# 打印sql
logging
:
level
:
com.loit.*
:
DEBUG
# hystrix断路器设置
feign
:
hystrix
:
enabled
:
true
# hystrix 超时时间设置
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
3000
fastdfs
:
file_server_prefix
:
http://120.52.185.173
# 图标文件上传
fileUpload
:
uploadDir
:
E:/img/
# 单点登录配置
loit
:
swagger
:
basePackage
:
com.loit.v1
loit-service/loit-notice/src/main/resources/bootstrap.properties
0 → 100644
浏览文件 @
33891963
spring.profiles.active
=
dev
spring.application.name
=
loit-notice
# Nacos \u914D\u7F6E\u4E2D\u5FC3\u5730\u5740http://39.100.254.140/
spring.cloud.nacos.config.server-addr
=
39.100.254.140:8103
spring.cloud.nacos.config.namespace
=
184ffed2-fa90-4ebc-abf6-fe1ca5c73756
spring.cloud.nacos.config.file-extension
=
yaml
\ No newline at end of file
loit-service/loit-notice/src/main/resources/logback/logback-dev.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!--
以外部载入指定logback.xml java -jar -Dlogging.config=logback.xml
scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。
scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义日志文件的项目名 -->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<!-- 定义日志文件的存储地址,默认jar同级目录logs文件夹,如需更改路径加参数: -Dlogging.path=/var/logs 没有设定直接在将日志存放到jar同级目录logs下 -->
<property
name=
"logPath"
value=
"${logging.path:-./logs}"
/>
<!-- 定义日志归档大小 单位KB,MB,GB 默认200MB 如需更改大小加参数: -Dlogging.maxFileSize=200MB -->
<property
name=
"maxFileSize"
value=
"${logging.maxFileSize:-200MB}"
/>
<!-- 定义日志最多保留天数 默认保留天数60天,如需更改加参数 -Dlogging.maxHistory=60-->
<property
name=
"maxHistory"
value=
"${logging.maxHistory:-60}"
/>
<!-- 定义日志最大总大小 默认40GB,如需更改加参数 -Dlogging.totalSizeCap=40GB-->
<property
name=
"totalSizeCap"
value=
"${logging.totalSizeCap:-40GB}"
/>
<property
name=
"appName"
value=
"${applicationName}"
/>
<!-- 定义日志格式-->
<!--格式化输出:开通已[%d{yyyy-MM-dd HH:mm:ss.SSS}] 为了logstash使用grok遇到堆栈多行异常时匹配合并多行, %d表示日期,${APP_ANME}表示服务名, %thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%ex:堆栈信息 %n是换行符-->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] ${appName} [%X{hostIp} %X{hostPort} %X{reqUri} %X{queryString} ] [%thread] %-5level %logger - %msg%n"
/>
<!--输出到控制台-->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 输出到文件-->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${logPath}/${appName}.log
</file>
<append>
true
</append>
<!--基于大小以及时间的轮转策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 %d表示按天轮转 %i表示在当前时间还没有到达周期轮转之前,日志文件达到了 maxFileSize 指定的大小,会进行归档,递增索引从 0 开始-->
<fileNamePattern>
${logPath}/${appName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- maxFileSize 指定的大小进行归档-->
<maxFileSize>
${maxFileSize}
</maxFileSize>
<!--这个可选的属性用来控制最多保留多少数量的归档文件,将会异步删除旧的文件 当天按天轮转表示有效期60天-->
<maxHistory>
${maxHistory}
</maxHistory>
<!--当达到这个大小后,旧的归档文件将会被异步的删除 -->
<totalSizeCap>
${totalSizeCap}
</totalSizeCap>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<logger
name=
"com.loit"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
\ No newline at end of file
loit-service/loit-notice/src/main/resources/logback/logback-test5002.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!--
以外部载入指定logback.xml java -jar -Dlogging.config=logback.xml
scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。
scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义日志文件的项目名 -->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<!-- 定义日志文件的存储地址,默认jar同级目录logs文件夹,如需更改路径加参数: -Dlogging.path=/var/logs 没有设定直接在将日志存放到jar同级目录logs下 -->
<property
name=
"logPath"
value=
"${logging.path:-./logs}"
/>
<!-- 定义日志归档大小 单位KB,MB,GB 默认200MB 如需更改大小加参数: -Dlogging.maxFileSize=200MB -->
<property
name=
"maxFileSize"
value=
"${logging.maxFileSize:-200MB}"
/>
<!-- 定义日志最多保留天数 默认保留天数60天,如需更改加参数 -Dlogging.maxHistory=60-->
<property
name=
"maxHistory"
value=
"${logging.maxHistory:-60}"
/>
<!-- 定义日志最大总大小 默认40GB,如需更改加参数 -Dlogging.totalSizeCap=40GB-->
<property
name=
"totalSizeCap"
value=
"${logging.totalSizeCap:-40GB}"
/>
<property
name=
"appName"
value=
"${applicationName}"
/>
<!-- 定义日志格式-->
<!--格式化输出:开通已[%d{yyyy-MM-dd HH:mm:ss.SSS}] 为了logstash使用grok遇到堆栈多行异常时匹配合并多行, %d表示日期,${APP_ANME}表示服务名, %thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%ex:堆栈信息 %n是换行符-->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] ${appName} [%X{hostIp} %X{hostPort} %X{reqUri} %X{queryString} ] [%thread] %-5level %logger - %msg%n"
/>
<!--输出到控制台-->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 输出到文件-->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${logPath}/${appName}.log
</file>
<append>
true
</append>
<!--基于大小以及时间的轮转策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 %d表示按天轮转 %i表示在当前时间还没有到达周期轮转之前,日志文件达到了 maxFileSize 指定的大小,会进行归档,递增索引从 0 开始-->
<fileNamePattern>
${logPath}/${appName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- maxFileSize 指定的大小进行归档-->
<maxFileSize>
${maxFileSize}
</maxFileSize>
<!--这个可选的属性用来控制最多保留多少数量的归档文件,将会异步删除旧的文件 当天按天轮转表示有效期60天-->
<maxHistory>
${maxHistory}
</maxHistory>
<!--当达到这个大小后,旧的归档文件将会被异步的删除 -->
<totalSizeCap>
${totalSizeCap}
</totalSizeCap>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<logger
name=
"com.loit"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
\ No newline at end of file
loit-service/loit-notice/src/main/resources/logback/logback-test5003.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!--
以外部载入指定logback.xml java -jar -Dlogging.config=logback.xml
scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。
scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义日志文件的项目名 -->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<!-- 定义日志文件的存储地址,默认jar同级目录logs文件夹,如需更改路径加参数: -Dlogging.path=/var/logs 没有设定直接在将日志存放到jar同级目录logs下 -->
<property
name=
"logPath"
value=
"${logging.path:-./logs}"
/>
<!-- 定义日志归档大小 单位KB,MB,GB 默认200MB 如需更改大小加参数: -Dlogging.maxFileSize=200MB -->
<property
name=
"maxFileSize"
value=
"${logging.maxFileSize:-200MB}"
/>
<!-- 定义日志最多保留天数 默认保留天数60天,如需更改加参数 -Dlogging.maxHistory=60-->
<property
name=
"maxHistory"
value=
"${logging.maxHistory:-60}"
/>
<!-- 定义日志最大总大小 默认40GB,如需更改加参数 -Dlogging.totalSizeCap=40GB-->
<property
name=
"totalSizeCap"
value=
"${logging.totalSizeCap:-40GB}"
/>
<property
name=
"appName"
value=
"${applicationName}"
/>
<!-- 定义日志格式-->
<!--格式化输出:开通已[%d{yyyy-MM-dd HH:mm:ss.SSS}] 为了logstash使用grok遇到堆栈多行异常时匹配合并多行, %d表示日期,${APP_ANME}表示服务名, %thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%ex:堆栈信息 %n是换行符-->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] ${appName} [%X{hostIp} %X{hostPort} %X{reqUri} %X{queryString} ] [%thread] %-5level %logger - %msg%n"
/>
<!--输出到控制台-->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 输出到文件-->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${logPath}/${appName}.log
</file>
<append>
true
</append>
<!--基于大小以及时间的轮转策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 %d表示按天轮转 %i表示在当前时间还没有到达周期轮转之前,日志文件达到了 maxFileSize 指定的大小,会进行归档,递增索引从 0 开始-->
<fileNamePattern>
${logPath}/${appName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- maxFileSize 指定的大小进行归档-->
<maxFileSize>
${maxFileSize}
</maxFileSize>
<!--这个可选的属性用来控制最多保留多少数量的归档文件,将会异步删除旧的文件 当天按天轮转表示有效期60天-->
<maxHistory>
${maxHistory}
</maxHistory>
<!--当达到这个大小后,旧的归档文件将会被异步的删除 -->
<totalSizeCap>
${totalSizeCap}
</totalSizeCap>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<logger
name=
"com.loit"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
\ No newline at end of file
loit-service/loit-notice/src/main/resources/logback/logback-test5102.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!--
以外部载入指定logback.xml java -jar -Dlogging.config=logback.xml
scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。
scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义日志文件的项目名 -->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<!-- 定义日志文件的存储地址,默认jar同级目录logs文件夹,如需更改路径加参数: -Dlogging.path=/var/logs 没有设定直接在将日志存放到jar同级目录logs下 -->
<property
name=
"logPath"
value=
"${logging.path:-./logs}"
/>
<!-- 定义日志归档大小 单位KB,MB,GB 默认200MB 如需更改大小加参数: -Dlogging.maxFileSize=200MB -->
<property
name=
"maxFileSize"
value=
"${logging.maxFileSize:-200MB}"
/>
<!-- 定义日志最多保留天数 默认保留天数60天,如需更改加参数 -Dlogging.maxHistory=60-->
<property
name=
"maxHistory"
value=
"${logging.maxHistory:-60}"
/>
<!-- 定义日志最大总大小 默认40GB,如需更改加参数 -Dlogging.totalSizeCap=40GB-->
<property
name=
"totalSizeCap"
value=
"${logging.totalSizeCap:-40GB}"
/>
<property
name=
"appName"
value=
"${applicationName}"
/>
<!-- 定义日志格式-->
<!--格式化输出:开通已[%d{yyyy-MM-dd HH:mm:ss.SSS}] 为了logstash使用grok遇到堆栈多行异常时匹配合并多行, %d表示日期,${APP_ANME}表示服务名, %thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%ex:堆栈信息 %n是换行符-->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] ${appName} [%X{hostIp} %X{hostPort} %X{reqUri} %X{queryString} ] [%thread] %-5level %logger - %msg%n"
/>
<!--输出到控制台-->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 输出到文件-->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${logPath}/${appName}.log
</file>
<append>
true
</append>
<!--基于大小以及时间的轮转策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 %d表示按天轮转 %i表示在当前时间还没有到达周期轮转之前,日志文件达到了 maxFileSize 指定的大小,会进行归档,递增索引从 0 开始-->
<fileNamePattern>
${logPath}/${appName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- maxFileSize 指定的大小进行归档-->
<maxFileSize>
${maxFileSize}
</maxFileSize>
<!--这个可选的属性用来控制最多保留多少数量的归档文件,将会异步删除旧的文件 当天按天轮转表示有效期60天-->
<maxHistory>
${maxHistory}
</maxHistory>
<!--当达到这个大小后,旧的归档文件将会被异步的删除 -->
<totalSizeCap>
${totalSizeCap}
</totalSizeCap>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<logger
name=
"com.loit"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
\ No newline at end of file
loit-service/loit-notice/src/main/resources/logback/logback-test5103.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!--
以外部载入指定logback.xml java -jar -Dlogging.config=logback.xml
scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。
scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration
scan=
"true"
scanPeriod=
"60 seconds"
debug=
"false"
>
<!-- 定义日志文件的项目名 -->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<!-- 定义日志文件的存储地址,默认jar同级目录logs文件夹,如需更改路径加参数: -Dlogging.path=/var/logs 没有设定直接在将日志存放到jar同级目录logs下 -->
<property
name=
"logPath"
value=
"${logging.path:-./logs}"
/>
<!-- 定义日志归档大小 单位KB,MB,GB 默认200MB 如需更改大小加参数: -Dlogging.maxFileSize=200MB -->
<property
name=
"maxFileSize"
value=
"${logging.maxFileSize:-200MB}"
/>
<!-- 定义日志最多保留天数 默认保留天数60天,如需更改加参数 -Dlogging.maxHistory=60-->
<property
name=
"maxHistory"
value=
"${logging.maxHistory:-60}"
/>
<!-- 定义日志最大总大小 默认40GB,如需更改加参数 -Dlogging.totalSizeCap=40GB-->
<property
name=
"totalSizeCap"
value=
"${logging.totalSizeCap:-40GB}"
/>
<property
name=
"appName"
value=
"${applicationName}"
/>
<!-- 定义日志格式-->
<!--格式化输出:开通已[%d{yyyy-MM-dd HH:mm:ss.SSS}] 为了logstash使用grok遇到堆栈多行异常时匹配合并多行, %d表示日期,${APP_ANME}表示服务名, %thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%ex:堆栈信息 %n是换行符-->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] ${appName} [%X{hostIp} %X{hostPort} %X{reqUri} %X{queryString} ] [%thread] %-5level %logger - %msg%n"
/>
<!--输出到控制台-->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 输出到文件-->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${logPath}/${appName}.log
</file>
<append>
true
</append>
<!--基于大小以及时间的轮转策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 %d表示按天轮转 %i表示在当前时间还没有到达周期轮转之前,日志文件达到了 maxFileSize 指定的大小,会进行归档,递增索引从 0 开始-->
<fileNamePattern>
${logPath}/${appName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- maxFileSize 指定的大小进行归档-->
<maxFileSize>
${maxFileSize}
</maxFileSize>
<!--这个可选的属性用来控制最多保留多少数量的归档文件,将会异步删除旧的文件 当天按天轮转表示有效期60天-->
<maxHistory>
${maxHistory}
</maxHistory>
<!--当达到这个大小后,旧的归档文件将会被异步的删除 -->
<totalSizeCap>
${totalSizeCap}
</totalSizeCap>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<logger
name=
"com.loit"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</configuration>
\ No newline at end of file
loit-service/loit-notice/src/notice/java/com/loit/v1/api/controller/feign/FeignMessageController.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
api
.
controller
.
feign
;
import
com.alibaba.fastjson.JSON
;
import
com.loit.api.dto.ApplicationManage
;
import
com.loit.api.service.ApplicationManagerApiService
;
import
com.loit.common.annotation.BeforeAuditAnnotation
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.persistence.Page
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.v1.modules.entity.Message
;
import
com.loit.v1.modules.service.MessageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
/**
* 消息管理接口
* Created by WBJ on 2020-04-23.
**/
@RestController
@RequestMapping
(
value
=
"api/v1/feign/message"
)
@Api
(
tags
=
"Feign 消息管理"
,
value
=
"FeignMessageController"
)
public
class
FeignMessageController
{
/**
* 日志工具
*/
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
MessageService
messageService
;
@Autowired
private
ApplicationManagerApiService
appService
;
/**
* 消息详情
*/
@ApiOperation
(
value
=
"消息详情"
,
notes
=
"根据id获取消息详情信息"
)
@ApiImplicitParam
(
paramType
=
"path"
,
name
=
"id"
,
value
=
"消息id"
,
required
=
true
,
dataType
=
"Long"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
get
(
@PathVariable
(
"id"
)
Integer
id
)
{
Message
notice
=
messageService
.
get
(
id
);
AjaxJson
json
=
new
AjaxJson
();
json
.
put
(
"obj"
,
notice
);
return
json
;
}
/**
* 消息中心分页列表
*/
@ApiOperation
(
value
=
"消息中心分页列表"
,
notes
=
"消息中心分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeTopic"
,
value
=
"消息标题"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeType"
,
value
=
"消息类型"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeSource"
,
value
=
"消息来源"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeLevel"
,
value
=
"紧急程度(1一般,2紧急)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeStatus"
,
value
=
"状态(0未读,1已读)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"showFlag"
,
value
=
"是否展示所有接收人信息(0 否 1是)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeStart"
,
value
=
"开始时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeEnd"
,
value
=
"结束时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orderByName"
,
value
=
"排序字段名称"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orderBy"
,
value
=
"排序(asc/desc)"
,
required
=
false
,
dataType
=
"String"
)
})
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
findPage
(
@ApiIgnore
Message
notice
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
json
=
new
AjaxJson
();
Page
<
Message
>
page
=
messageService
.
findPage
(
new
Page
<
Message
>(
request
,
response
),
notice
);
json
.
put
(
"page"
,
page
);
return
json
;
}
/**
* 消息推送
*/
@ApiOperation
(
value
=
"消息推送"
,
notes
=
"消息推送"
)
@PostMapping
(
"/propel"
)
@BeforeAuditAnnotation
public
AjaxJson
propel
(
@RequestBody
Message
notice
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
if
(
notice
!=
null
){
if
(
notice
.
getAppId
()==
null
&&
StringUtils
.
isNotBlank
(
notice
.
getAppCode
())){
AjaxJson
appJson
=
appService
.
getByAppCode
(
notice
.
getAppCode
());
if
(
appJson
!=
null
){
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
LinkedHashMap
map
=
(
LinkedHashMap
)
((
LinkedHashMap
)
obj
).
get
(
"manager"
);
ApplicationManage
manager
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
ApplicationManage
.
class
);
if
(
manager
!=
null
&&
manager
.
getAppId
()!=
null
){
notice
.
setAppId
(
manager
.
getAppId
());
}
}
}
}
}
messageService
.
propel
(
notice
);
json
.
setMsg
(
"推送成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"推送异常"
);
}
return
json
;
}
/**
* 统计未读消息数量
*/
@ApiOperation
(
value
=
"统计未读消息数量"
,
notes
=
"统计未读消息数量"
)
@GetMapping
(
"/unread"
)
public
AjaxJson
getUnreadList
()
{
AjaxJson
json
=
new
AjaxJson
();
List
<
Message
>
list
=
messageService
.
getUnreadList
();
json
.
put
(
"list"
,
list
);
json
.
put
(
"count"
,
list
.
size
());
return
json
;
}
/**
* 标记消息为已读
*/
@ApiOperation
(
value
=
"标记消息为已读"
,
notes
=
"标记消息为已读"
)
@PostMapping
(
"/updateStatus"
)
public
AjaxJson
updateStatus
(
@RequestBody
Message
notice
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageService
.
updateStatus
(
notice
);
json
.
setMsg
(
"标记成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"标记异常"
);
}
return
json
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/api/controller/open/OpenMessageController.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
api
.
controller
.
open
;
import
com.loit.common.annotation.BeforeAuditAnnotation
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.v1.modules.entity.Message
;
import
com.loit.v1.modules.service.MessageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.RestController
;
/**
* 消息管理接口
* Created by WBJ on 2020-04-23.
**/
@RestController
@RequestMapping
(
value
=
"api/v1/open/message"
)
@Api
(
tags
=
"Open 消息管理"
,
value
=
"OpenMessageController"
)
public
class
OpenMessageController
{
/**
* 日志工具
*/
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
MessageService
messageService
;
/**
* 消息推送
*/
@ApiOperation
(
value
=
"消息推送"
,
notes
=
"消息推送"
)
@PostMapping
(
"/propel"
)
public
AjaxJson
propel
(
@RequestBody
Message
notice
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageService
.
propel
(
notice
);
json
.
setMsg
(
"推送成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"推送异常"
);
}
return
json
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/config/WebSocketClient.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
config
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.websocket.*
;
import
java.net.URI
;
/**
* @description: WebSocketClient
* @date: 2020/5/13 15:26
* @author: wubj
* @version v1.0
*/
@ClientEndpoint
public
class
WebSocketClient
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WebSocketClient
.
class
);
@OnOpen
public
void
open
(
Session
session
){
logger
.
info
(
"Client WebSocket is opening..."
);
this
.
session
=
session
;
}
@OnMessage
public
void
onMessage
(
String
message
){
logger
.
info
(
"Server send message: "
+
message
);
}
@OnClose
public
void
onClose
(){
logger
.
info
(
"Websocket closed"
);
}
public
Session
session
;
public
void
start
(
String
uri
)
{
WebSocketContainer
container
=
null
;
try
{
container
=
ContainerProvider
.
getWebSocketContainer
();
URI
r
=
URI
.
create
(
uri
);
session
=
container
.
connectToServer
(
WebSocketClient
.
class
,
r
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"WebSocketClient连接异常: "
,
e
);
}
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/constant/NoticeConstants.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
constant
;
/**
* 常量
* Created by WBJ on 2020-04-23.
**/
public
class
NoticeConstants
{
/**
* 消息类型字典code
*/
public
static
final
String
NOTICE_TYPE
=
"NOTICE_TYPE"
;
/**
* 消息来源字典code
*/
public
static
final
String
NOTICE_SOURCE
=
"NOTICE_SOURCE"
;
/**
* 消息定时器
*/
public
static
final
String
NOTICE_TASK
=
"noticeTask"
;
/**
* 消息等级
*/
public
static
final
String
NOTICE_GRADE
=
"NOTICE_GRADE"
;
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/controller/MessageController.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
controller
;
import
com.loit.common.annotation.BeforeAuditAnnotation
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.persistence.Page
;
import
com.loit.v1.modules.entity.Message
;
import
com.loit.v1.modules.service.MessageESService
;
import
com.loit.v1.modules.service.MessageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
/**
* 消息管理
* Created by WBJ on 2020-04-23.
**/
@RestController
@RequestMapping
(
value
=
"/api/v1/message"
)
@Api
(
tags
=
"消息接口"
,
value
=
"MessageController"
)
public
class
MessageController
{
/**
* 日志工具
*/
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
MessageService
messageService
;
@Autowired
private
MessageESService
messageESService
;
/**
* 消息详情
*/
@ApiOperation
(
value
=
"消息详情"
,
notes
=
"根据id获取消息详情信息"
)
@ApiImplicitParam
(
paramType
=
"path"
,
name
=
"id"
,
value
=
"消息id"
,
required
=
true
,
dataType
=
"Long"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
get
(
@PathVariable
(
"id"
)
Integer
id
)
{
Message
notice
=
messageService
.
get
(
id
);
AjaxJson
json
=
new
AjaxJson
();
json
.
put
(
"obj"
,
notice
);
return
json
;
}
/**
* 消息分页列表
*/
@ApiOperation
(
value
=
"消息分页列表"
,
notes
=
"消息分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeTopic"
,
value
=
"消息标题"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeType"
,
value
=
"消息类型"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeSource"
,
value
=
"消息来源"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeLevel"
,
value
=
"紧急程度(1一般,2紧急)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeStatus"
,
value
=
"状态(0未读,1已读)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"showFlag"
,
value
=
"是否展示所有接收人信息(0 否 1是)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeStart"
,
value
=
"开始时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeEnd"
,
value
=
"结束时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orderByName"
,
value
=
"排序字段名称"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orderBy"
,
value
=
"排序(asc/desc)"
,
required
=
false
,
dataType
=
"String"
)
})
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
findPage
(
@ApiIgnore
Message
notice
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
json
=
new
AjaxJson
();
Page
<
Message
>
page
=
messageService
.
findPage
(
new
Page
<
Message
>(
request
,
response
),
notice
);
json
.
put
(
"page"
,
page
);
return
json
;
}
/**
* 消息推送
*/
@ApiOperation
(
value
=
"消息推送"
,
notes
=
"消息推送"
)
@PostMapping
(
"/propel"
)
@BeforeAuditAnnotation
public
AjaxJson
propel
(
@RequestBody
Message
notice
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageService
.
propel
(
notice
);
json
.
setMsg
(
"推送成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"推送异常"
);
}
return
json
;
}
/**
* 统计未读消息数量
*/
@ApiOperation
(
value
=
"统计未读消息数量"
,
notes
=
"统计未读消息数量"
)
@GetMapping
(
"/unread"
)
public
AjaxJson
getUnreadList
()
{
AjaxJson
json
=
new
AjaxJson
();
List
<
Message
>
list
=
messageService
.
getUnreadList
();
json
.
put
(
"list"
,
list
);
json
.
put
(
"count"
,
list
.
size
());
return
json
;
}
/**
* 标记消息为已读
*/
@ApiOperation
(
value
=
"标记消息为已读"
,
notes
=
"标记消息为已读"
)
@PostMapping
(
"/updateStatus"
)
public
AjaxJson
updateStatus
(
@RequestBody
Message
notice
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageService
.
updateStatus
(
notice
);
json
.
setMsg
(
"标记成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"标记异常"
);
}
return
json
;
}
@ApiOperation
(
value
=
"历史消息分页列表"
,
notes
=
"历史消息分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeTopic"
,
value
=
"消息标题"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeType"
,
value
=
"消息类型"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeLevel"
,
value
=
"紧急程度(1一般,2紧急)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeStart"
,
value
=
"开始时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTimeEnd"
,
value
=
"结束时间"
,
required
=
false
,
dataType
=
"Date"
)
})
@RequestMapping
(
value
=
"/historyPage"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
findHistoryPage
(
@RequestParam
(
value
=
"pageNo"
,
required
=
true
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
true
)
Integer
pageSize
,
@RequestParam
(
value
=
"noticeTopic"
,
required
=
false
)
String
noticeTopic
,
@RequestParam
(
value
=
"noticeType"
,
required
=
false
)
String
noticeType
,
@RequestParam
(
value
=
"noticeLevel"
,
required
=
false
)
String
noticeLevel
,
@RequestParam
(
value
=
"createTimeStart"
,
required
=
false
)
Date
createTimeStart
,
@RequestParam
(
value
=
"createTimeEnd"
,
required
=
false
)
Date
createTimeEnd
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
json
=
messageESService
.
findHistoryPage
(
pageNo
,
pageSize
,
noticeTopic
,
noticeType
,
noticeLevel
,
createTimeStart
,
createTimeEnd
);
}
catch
(
Exception
e
)
{
Message
notice
=
new
Message
();
notice
.
setNoticeTopic
(
noticeTopic
);
notice
.
setNoticeType
(
noticeType
);
notice
.
setNoticeLevel
(
noticeLevel
);
notice
.
setCreateTimeStart
(
createTimeStart
);
notice
.
setCreateTimeEnd
(
createTimeEnd
);
Page
<
Message
>
page
=
messageService
.
findPage
(
new
Page
<
Message
>(
request
,
response
),
notice
);
json
.
put
(
"page"
,
page
);
logger
.
error
(
"es查询消息失败:{}"
,
e
.
getMessage
());
}
return
json
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/controller/MessageReceiveController.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
controller
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.persistence.Page
;
import
com.loit.v1.modules.entity.MessageReceive
;
import
com.loit.v1.modules.service.MessageReceiveService
;
import
io.swagger.annotations.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* 消息接收接口
* Created by WBJ on 2020-04-23.
**/
@RestController
@RequestMapping
(
value
=
"/api/v1/messageReceive"
)
@Api
(
tags
=
"消息接收接口"
,
value
=
"MessageReceiveController"
)
public
class
MessageReceiveController
{
/**
* 日志工具
*/
private
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
MessageReceiveService
messageReceiveService
;
/**
* 消息接收列表
*/
@ApiOperation
(
value
=
"消息接收列表"
,
notes
=
"消息接收列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeId"
,
value
=
"消息id"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"receiveId"
,
value
=
"接收人"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeStatus"
,
value
=
"状态(0未读,1已读)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTime"
,
value
=
"创建时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"handleStatus"
,
value
=
"处理状态(0未处理,1已处理)"
,
required
=
false
,
dataType
=
"String"
)
})
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
findAll
(
@ApiIgnore
MessageReceive
noticeReceive
)
{
AjaxJson
json
=
new
AjaxJson
();
List
<
MessageReceive
>
list
=
messageReceiveService
.
findList
(
noticeReceive
);
json
.
put
(
"list"
,
list
);
return
json
;
}
/**
* 消息接收分页列表
*/
@ApiOperation
(
value
=
"消息接收分页列表"
,
notes
=
"消息接收分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageNo"
,
value
=
"当前页码"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页大小"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeId"
,
value
=
"消息id"
,
required
=
false
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"receiveId"
,
value
=
"接收人"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"noticeStatus"
,
value
=
"状态(0未读,1已读)"
,
required
=
false
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"createTime"
,
value
=
"创建时间"
,
required
=
false
,
dataType
=
"Date"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"handleStatus"
,
value
=
"处理状态(0未处理,1已处理)"
,
required
=
false
,
dataType
=
"String"
)
})
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
findPage
(
@ApiIgnore
MessageReceive
noticeReceive
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
json
=
new
AjaxJson
();
Page
<
MessageReceive
>
page
=
messageReceiveService
.
findPage
(
new
Page
<
MessageReceive
>(
request
,
response
),
noticeReceive
);
json
.
put
(
"page"
,
page
);
return
json
;
}
/**
* 消息接收详情
*/
@ApiOperation
(
value
=
"消息接收详情"
,
notes
=
"根据id获取消息接收详情信息"
)
@ApiImplicitParam
(
paramType
=
"path"
,
name
=
"id"
,
value
=
"消息接收id"
,
required
=
true
,
dataType
=
"Long"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
AjaxJson
get
(
@PathVariable
(
"id"
)
Integer
id
)
{
MessageReceive
noticeReceive
=
messageReceiveService
.
get
(
id
);
AjaxJson
json
=
new
AjaxJson
();
json
.
put
(
"obj"
,
noticeReceive
);
return
json
;
}
/**
* 消息接收保存
*/
@ApiOperation
(
value
=
"消息接收保存"
,
notes
=
"消息接收保存"
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
public
AjaxJson
save
(
@RequestBody
MessageReceive
noticeReceive
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageReceiveService
.
insert
(
noticeReceive
);
json
.
setMsg
(
"保存成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"保存异常"
);
}
return
json
;
}
/**
* 消息接收修改
*/
@ApiOperation
(
value
=
"消息接收修改"
,
notes
=
"消息接收修改"
)
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
)
public
AjaxJson
update
(
@RequestBody
MessageReceive
noticeReceive
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageReceiveService
.
update
(
noticeReceive
);
json
.
setMsg
(
"修改成功"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"修改异常"
);
}
return
json
;
}
/**
* 消息接收删除
*/
@ApiOperation
(
value
=
"消息接收删除"
,
notes
=
"消息接收删除"
)
@ApiImplicitParam
(
paramType
=
"path"
,
name
=
"id"
,
value
=
"消息接收id"
,
required
=
true
,
dataType
=
"Long"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
public
AjaxJson
delete
(
@PathVariable
(
"id"
)
String
ids
)
{
AjaxJson
json
=
new
AjaxJson
();
try
{
messageReceiveService
.
deleteAll
(
ids
,
new
MessageReceive
());
json
.
setMsg
(
"删除成功!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
"删除失败"
+
e
.
getMessage
());
}
return
json
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/dao/MessageDao.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
dao
;
import
com.loit.common.persistence.CrudDao
;
import
com.loit.v1.modules.entity.Message
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 消息表数据层数据库操作接口类.
* Created by WBJ on 2020-04-23.
**/
@Mapper
public
interface
MessageDao
extends
CrudDao
<
Message
>
{
/**
* 获取近期消息ids
* @return
*/
List
<
Long
>
getRecentNoticeIds
();
/**
* 根据ids删除数据
*/
void
deleteByIds
(
List
<
Long
>
list
);
/**
* 根据ids获取消息信息
* @param list
* @return
*/
List
<
Message
>
findListByIds
(
List
<
Long
>
list
);
/**
* 根据接收人ids获取消息
* @param list
* @return
*/
List
<
Message
>
findListByReceiveIds
(
List
<
String
>
list
);
Long
findIdByNoticeTypeId
(
Integer
noticeTypeId
);
}
\ No newline at end of file
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/dao/MessageESDao.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
dao
;
import
com.loit.v1.modules.entity.MessageES
;
import
org.springframework.data.elasticsearch.repository.ElasticsearchRepository
;
public
interface
MessageESDao
extends
ElasticsearchRepository
<
MessageES
,
Integer
>
{
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/dao/MessageReceiveDao.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
dao
;
import
com.loit.common.persistence.CrudDao
;
import
com.loit.v1.modules.entity.MessageReceive
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 消息接收表数据层数据库操作接口类.
* Created by YZB on 2020-04-23.
**/
@Mapper
public
interface
MessageReceiveDao
extends
CrudDao
<
MessageReceive
>
{
/**
* 标记消息为已读
* @param list
*/
void
updateStatus
(
String
receiveId
,
List
<
Long
>
list
);
/**
* 获取接收人未读消息数量
* @param receiveUser
* @return
*/
int
getUnreadCount
(
String
receiveUser
);
/**
* 获取近期消息ids
* @return
*/
List
<
Long
>
getRecentNoticeIds
();
/**
* 根据ids删除数据
*/
void
deleteByIds
(
List
<
Long
>
list
);
/**
* 根据noticeIds删除数据
*/
void
deleteByNoticeIds
(
List
<
Long
>
list
);
/**
* 批量插入
* @param list
*/
void
insertBatch
(
List
<
MessageReceive
>
list
);
}
\ No newline at end of file
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/entity/Message.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.loit.common.persistence.DataEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* 消息表数据对象.
* Created by WBJ on 2020-04-23.
**/
@ApiModel
(
value
=
"Message"
,
description
=
"消息表对象"
)
public
class
Message
extends
DataEntity
<
Message
>
implements
Serializable
{
/**
* 消息id
*/
@ApiModelProperty
(
value
=
"消息id"
)
private
Integer
id
;
/**
* 消息类型
*/
@ApiModelProperty
(
value
=
"消息类型"
)
private
String
noticeType
;
/**
* 消息标题
*/
@ApiModelProperty
(
value
=
"消息标题"
)
private
String
noticeTopic
;
/**
* 消息内容
*/
@ApiModelProperty
(
value
=
"消息内容"
)
private
String
noticeContent
;
/**
* 消息来源
*/
@ApiModelProperty
(
value
=
"消息来源"
)
private
String
noticeSource
;
/**
* 发送人
*/
@ApiModelProperty
(
value
=
"发送人"
)
private
String
sendId
;
/**
* 发送人名称
*/
@ApiModelProperty
(
value
=
"发送人名称"
)
private
String
sendName
;
/**
* 紧急程度(1一般,2紧急)
*/
@ApiModelProperty
(
value
=
"紧急程度(1一般,2紧急)"
)
private
String
noticeLevel
;
/**
* 消息等级颜色
*/
private
String
noticeLevelColour
;
/**
* 广播消息标记
*/
@ApiModelProperty
(
value
=
"广播消息标记"
)
private
String
allFlag
;
/**
* url
*/
@ApiModelProperty
(
value
=
"url"
)
private
String
urlName
;
/**
* 按钮
*/
@ApiModelProperty
(
value
=
"按钮"
)
private
String
buttonName
;
/**
* 接收人list
*/
@ApiModelProperty
(
value
=
"接收人list"
)
private
String
receiveIds
;
/**
* 消息ids
*/
@ApiModelProperty
(
value
=
"消息ids"
)
private
String
noticeIds
;
/**
* 状态(未读0,已读1)
*/
private
String
noticeStatus
;
/**
* 接收人
*/
private
String
receiveId
;
/**
* 接收人姓名
*/
private
String
receiveName
;
/**
* 消息类型name
*/
@ApiModelProperty
(
value
=
"消息类型name"
)
private
String
noticeTypeName
;
/**
* 消息来源name
*/
@ApiModelProperty
(
value
=
"消息来源name"
)
private
String
noticeSourceName
;
@ApiModelProperty
(
value
=
"开始时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+08"
)
private
Date
createTimeStart
;
@ApiModelProperty
(
value
=
"结束日期"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+08"
)
private
Date
createTimeEnd
;
/**
*排序字段名
*/
@ApiModelProperty
(
value
=
"排序字段名"
)
private
String
orderByName
;
/**
*排序类型
*/
@ApiModelProperty
(
value
=
"排序类型 asc/desc"
)
private
String
orderBy
;
@ApiModelProperty
(
value
=
"app_id"
)
private
Integer
appId
;
@ApiModelProperty
(
value
=
"app_code"
)
private
String
appCode
;
@ApiModelProperty
(
value
=
"resource_url"
)
private
String
resourceUrl
;
@ApiModelProperty
(
value
=
"menu_name"
)
private
String
menuName
;
@ApiModelProperty
(
value
=
"res_context_value"
)
private
String
resContextValue
;
@ApiModelProperty
(
value
=
"entrance_url"
)
private
String
entranceUrl
;
@ApiModelProperty
(
value
=
"entrance_name"
)
private
String
entranceName
;
@ApiModelProperty
(
value
=
"menu_context_value"
)
private
String
menuContextValue
;
@ApiModelProperty
(
value
=
"children"
)
private
List
children
;
@ApiModelProperty
(
value
=
"app_url"
)
private
String
appUrl
;
@ApiModelProperty
(
value
=
"发布时间"
)
private
String
publishTime
;
@ApiModelProperty
(
value
=
"通知管理id"
)
private
Integer
noticeTypeId
;
@ApiModelProperty
(
value
=
"是否展示所有接收人信息(0 否 1是)"
)
private
String
showFlag
;
public
Message
()
{
}
public
void
setId
(
Integer
id
){
this
.
id
=
id
;
}
public
Integer
getId
(){
return
this
.
id
;
}
public
void
setNoticeType
(
String
noticeType
){
this
.
noticeType
=
noticeType
;
}
public
String
getNoticeType
(){
return
this
.
noticeType
;
}
public
void
setNoticeTopic
(
String
noticeTopic
){
this
.
noticeTopic
=
noticeTopic
;
}
public
String
getNoticeTopic
(){
return
this
.
noticeTopic
;
}
public
void
setNoticeContent
(
String
noticeContent
){
this
.
noticeContent
=
noticeContent
;
}
public
String
getNoticeContent
(){
return
this
.
noticeContent
;
}
public
void
setNoticeSource
(
String
noticeSource
){
this
.
noticeSource
=
noticeSource
;
}
public
String
getNoticeSource
(){
return
this
.
noticeSource
;
}
public
void
setNoticeLevel
(
String
noticeLevel
){
this
.
noticeLevel
=
noticeLevel
;
}
public
String
getNoticeLevel
(){
return
this
.
noticeLevel
;
}
public
void
setAllFlag
(
String
allFlag
){
this
.
allFlag
=
allFlag
;
}
public
String
getAllFlag
(){
return
this
.
allFlag
;
}
public
String
getNoticeSourceName
()
{
return
noticeSourceName
;
}
public
void
setNoticeSourceName
(
String
noticeSourceName
)
{
this
.
noticeSourceName
=
noticeSourceName
;
}
public
String
getNoticeTypeName
()
{
return
noticeTypeName
;
}
public
void
setNoticeTypeName
(
String
noticeTypeName
)
{
this
.
noticeTypeName
=
noticeTypeName
;
}
public
String
getNoticeStatus
()
{
return
noticeStatus
;
}
public
void
setNoticeStatus
(
String
noticeStatus
)
{
this
.
noticeStatus
=
noticeStatus
;
}
public
Date
getCreateTimeStart
()
{
return
createTimeStart
;
}
public
void
setCreateTimeStart
(
Date
createTimeStart
)
{
this
.
createTimeStart
=
createTimeStart
;
}
public
Date
getCreateTimeEnd
()
{
return
createTimeEnd
;
}
public
void
setCreateTimeEnd
(
Date
createTimeEnd
)
{
this
.
createTimeEnd
=
createTimeEnd
;
}
public
String
getNoticeIds
()
{
return
noticeIds
;
}
public
void
setNoticeIds
(
String
noticeIds
)
{
this
.
noticeIds
=
noticeIds
;
}
public
String
getOrderByName
()
{
return
orderByName
;
}
public
void
setOrderByName
(
String
orderByName
)
{
this
.
orderByName
=
orderByName
;
}
public
String
getOrderBy
()
{
return
orderBy
;
}
public
void
setOrderBy
(
String
orderBy
)
{
this
.
orderBy
=
orderBy
;
}
public
String
getSendId
()
{
return
sendId
;
}
public
String
getSendName
()
{
return
sendName
;
}
public
void
setSendName
(
String
sendName
)
{
this
.
sendName
=
sendName
;
}
public
void
setSendId
(
String
sendId
)
{
this
.
sendId
=
sendId
;
}
public
String
getReceiveIds
()
{
return
receiveIds
;
}
public
void
setReceiveIds
(
String
receiveIds
)
{
this
.
receiveIds
=
receiveIds
;
}
public
String
getReceiveId
()
{
return
receiveId
;
}
public
void
setReceiveId
(
String
receiveId
)
{
this
.
receiveId
=
receiveId
;
}
public
String
getUrlName
()
{
return
urlName
;
}
public
void
setUrlName
(
String
urlName
)
{
this
.
urlName
=
urlName
;
}
public
String
getButtonName
()
{
return
buttonName
;
}
public
void
setButtonName
(
String
buttonName
)
{
this
.
buttonName
=
buttonName
;
}
public
void
setAppId
(
Integer
appId
){
this
.
appId
=
appId
;
}
public
Integer
getAppId
(){
return
this
.
appId
;
}
public
String
getAppCode
()
{
return
appCode
;
}
public
void
setAppCode
(
String
appCode
)
{
this
.
appCode
=
appCode
;
}
public
void
setResourceUrl
(
String
resourceUrl
){
this
.
resourceUrl
=
resourceUrl
;
}
public
String
getResourceUrl
(){
return
this
.
resourceUrl
;
}
public
void
setMenuName
(
String
menuName
){
this
.
menuName
=
menuName
;
}
public
String
getMenuName
(){
return
this
.
menuName
;
}
public
void
setResContextValue
(
String
resContextValue
){
this
.
resContextValue
=
resContextValue
;
}
public
String
getResContextValue
(){
return
this
.
resContextValue
;
}
public
void
setEntranceUrl
(
String
entranceUrl
){
this
.
entranceUrl
=
entranceUrl
;
}
public
String
getEntranceUrl
(){
return
this
.
entranceUrl
;
}
public
void
setEntranceName
(
String
entranceName
){
this
.
entranceName
=
entranceName
;
}
public
String
getEntranceName
(){
return
this
.
entranceName
;
}
public
void
setMenuContextValue
(
String
menuContextValue
){
this
.
menuContextValue
=
menuContextValue
;
}
public
String
getMenuContextValue
(){
return
this
.
menuContextValue
;
}
public
List
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
children
)
{
this
.
children
=
children
;
}
public
String
getAppUrl
()
{
return
appUrl
;
}
public
void
setAppUrl
(
String
appUrl
)
{
this
.
appUrl
=
appUrl
;
}
public
String
getPublishTime
()
{
return
publishTime
;
}
public
void
setPublishTime
(
String
publishTime
)
{
this
.
publishTime
=
publishTime
;
}
public
Integer
getNoticeTypeId
()
{
return
noticeTypeId
;
}
public
void
setNoticeTypeId
(
Integer
noticeTypeId
)
{
this
.
noticeTypeId
=
noticeTypeId
;
}
public
String
getReceiveName
()
{
return
receiveName
;
}
public
void
setReceiveName
(
String
receiveName
)
{
this
.
receiveName
=
receiveName
;
}
public
String
getShowFlag
()
{
return
showFlag
;
}
public
void
setShowFlag
(
String
showFlag
)
{
this
.
showFlag
=
showFlag
;
}
public
String
getNoticeLevelColour
()
{
return
noticeLevelColour
;
}
public
void
setNoticeLevelColour
(
String
noticeLevelColour
)
{
this
.
noticeLevelColour
=
noticeLevelColour
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/entity/MessageES.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* @description: 历史消息数据表
* @date: 2020/5/28 13:33
* @author: wubj
* @version v1.0
*/
@Document
(
indexName
=
"notice"
,
type
=
"message"
)
public
class
MessageES
implements
Serializable
{
/**
* 消息id
*/
@Id
private
Integer
id
;
/**
* 消息类型
*/
@Field
private
String
noticeType
;
/**
* 消息类型名称
*/
@Field
private
String
noticeTypeName
;
/**
* 消息标题
*/
@Field
(
type
=
FieldType
.
Text
,
analyzer
=
"ik_max_word"
,
searchAnalyzer
=
"ik_max_word"
)
private
String
noticeTopic
;
/**
* 消息内容
*/
@Field
private
String
noticeContent
;
/**
* 消息来源
*/
@Field
private
String
noticeSource
;
/**
* 消息来源名称
*/
@Field
private
String
noticeSourceName
;
/**
* 发送人
*/
@Field
private
String
sendId
;
/**
* 发送人名称
*/
@Field
private
String
sendName
;
/**
* 紧急程度(1一般,2紧急)
*/
@Field
private
String
noticeLevel
;
/**
* 广播消息标记
*/
@Field
private
String
allFlag
;
/**
* 状态(未读0,已读1)
*/
@Field
private
String
noticeStatus
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
date_optional_time
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
/**
* 接收人
*/
@Field
(
type
=
FieldType
.
Nested
)
private
List
<
MessageReveiveES
>
receive
;
public
void
setId
(
Integer
id
){
this
.
id
=
id
;
}
public
Integer
getId
(){
return
this
.
id
;
}
public
void
setNoticeType
(
String
noticeType
){
this
.
noticeType
=
noticeType
;
}
public
String
getNoticeType
(){
return
this
.
noticeType
;
}
public
String
getNoticeTopic
()
{
return
noticeTopic
;
}
public
void
setNoticeTopic
(
String
noticeTopic
)
{
this
.
noticeTopic
=
noticeTopic
;
}
public
String
getNoticeContent
()
{
return
noticeContent
;
}
public
void
setNoticeContent
(
String
noticeContent
)
{
this
.
noticeContent
=
noticeContent
;
}
public
String
getNoticeSource
()
{
return
noticeSource
;
}
public
void
setNoticeSource
(
String
noticeSource
)
{
this
.
noticeSource
=
noticeSource
;
}
public
String
getSendId
()
{
return
sendId
;
}
public
void
setSendId
(
String
sendId
)
{
this
.
sendId
=
sendId
;
}
public
String
getSendName
()
{
return
sendName
;
}
public
void
setSendName
(
String
sendName
)
{
this
.
sendName
=
sendName
;
}
public
String
getNoticeLevel
()
{
return
noticeLevel
;
}
public
void
setNoticeLevel
(
String
noticeLevel
)
{
this
.
noticeLevel
=
noticeLevel
;
}
public
String
getAllFlag
()
{
return
allFlag
;
}
public
void
setAllFlag
(
String
allFlag
)
{
this
.
allFlag
=
allFlag
;
}
public
String
getNoticeStatus
()
{
return
noticeStatus
;
}
public
void
setNoticeStatus
(
String
noticeStatus
)
{
this
.
noticeStatus
=
noticeStatus
;
}
public
String
getNoticeTypeName
()
{
return
noticeTypeName
;
}
public
void
setNoticeTypeName
(
String
noticeTypeName
)
{
this
.
noticeTypeName
=
noticeTypeName
;
}
public
String
getNoticeSourceName
()
{
return
noticeSourceName
;
}
public
void
setNoticeSourceName
(
String
noticeSourceName
)
{
this
.
noticeSourceName
=
noticeSourceName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
List
<
MessageReveiveES
>
getReceive
()
{
return
receive
;
}
public
void
setReceive
(
List
<
MessageReveiveES
>
receive
)
{
this
.
receive
=
receive
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/entity/MessageReceive.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
entity
;
import
com.loit.common.persistence.DataEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 消息接收表数据对象.
* Created by WBJ on 2020-04-23.
**/
@ApiModel
(
value
=
"MessageReceive"
,
description
=
"消息接收表对象"
)
public
class
MessageReceive
extends
DataEntity
<
MessageReceive
>
implements
Serializable
{
/**
* 主id
*/
@ApiModelProperty
(
value
=
"主id"
)
private
Integer
id
;
/**
* 消息id
*/
@ApiModelProperty
(
value
=
"消息id"
)
private
Integer
noticeId
;
/**
* 接收人
*/
@ApiModelProperty
(
value
=
"接收人"
)
private
String
receiveId
;
/**
* 状态(0未读,1已读)
*/
@ApiModelProperty
(
value
=
"状态(0未读,1已读)"
)
private
String
noticeStatus
;
/**
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
/**
* 处理状态(0未处理,1已处理)
*/
@ApiModelProperty
(
value
=
"处理状态(0未处理,1已处理)"
)
private
String
handleStatus
;
@ApiModelProperty
(
value
=
"接收人姓名"
)
private
String
receiveName
;
@ApiModelProperty
(
value
=
"部门名称"
)
private
String
orgName
;
/**
* 消息ids
*/
@ApiModelProperty
(
value
=
"消息ids"
)
private
String
noticeIds
;
public
void
setId
(
Integer
id
){
this
.
id
=
id
;
}
public
Integer
getId
(){
return
this
.
id
;
}
public
void
setNoticeId
(
Integer
noticeId
){
this
.
noticeId
=
noticeId
;
}
public
Integer
getNoticeId
(){
return
this
.
noticeId
;
}
public
void
setNoticeStatus
(
String
noticeStatus
){
this
.
noticeStatus
=
noticeStatus
;
}
public
String
getNoticeStatus
(){
return
this
.
noticeStatus
;
}
public
void
setCreateTime
(
Date
createTime
){
this
.
createTime
=
createTime
;
}
public
Date
getCreateTime
(){
return
this
.
createTime
;
}
public
void
setHandleStatus
(
String
handleStatus
){
this
.
handleStatus
=
handleStatus
;
}
public
String
getHandleStatus
(){
return
this
.
handleStatus
;
}
public
String
getNoticeIds
()
{
return
noticeIds
;
}
public
void
setNoticeIds
(
String
noticeIds
)
{
this
.
noticeIds
=
noticeIds
;
}
public
String
getReceiveId
()
{
return
receiveId
;
}
public
void
setReceiveId
(
String
receiveId
)
{
this
.
receiveId
=
receiveId
;
}
public
String
getReceiveName
()
{
return
receiveName
;
}
public
void
setReceiveName
(
String
receiveName
)
{
this
.
receiveName
=
receiveName
;
}
public
String
getOrgName
()
{
return
orgName
;
}
public
void
setOrgName
(
String
orgName
)
{
this
.
orgName
=
orgName
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/entity/MessageReveiveES.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @description: 消息接收数据表
* @date: 2020/5/28 13:33
* @author: wubj
* @version v1.0
*/
public
class
MessageReveiveES
implements
Serializable
{
/**
* 接收人
*/
@Field
(
type
=
FieldType
.
Keyword
)
private
String
receiveId
;
/**
* 状态(未读0,已读1)
*/
@Field
(
type
=
FieldType
.
Keyword
)
private
String
noticeStatus
;
public
String
getReceiveId
()
{
return
receiveId
;
}
public
void
setReceiveId
(
String
receiveId
)
{
this
.
receiveId
=
receiveId
;
}
public
String
getNoticeStatus
()
{
return
noticeStatus
;
}
public
void
setNoticeStatus
(
String
noticeStatus
)
{
this
.
noticeStatus
=
noticeStatus
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/schedule/MessageSchedule.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
schedule
;
import
com.loit.common.utils.ListUtil
;
import
com.loit.v1.modules.constant.NoticeConstants
;
import
com.loit.v1.modules.service.MessageReceiveService
;
import
com.loit.v1.modules.service.MessageService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* @description: 消息定时器
* @date: 2020/4/26 10:38
* @author: wubj
* @version v1.0
*/
@Component
public
class
MessageSchedule
{
private
Logger
log
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
MessageService
messageService
;
@Autowired
private
MessageReceiveService
messageReceiveService
;
private
static
ExecutorService
singleThreadExecutor
=
Executors
.
newSingleThreadExecutor
();
/**
* 定时任务:删除三个月以前的已读消息和广播消息
*/
// @Scheduled(cron = "0 0 1 * * ?")
public
void
scheduledTask
()
{
synchronized
(
NoticeConstants
.
NOTICE_TASK
)
{
singleThreadExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
doNoticeTask
();
}
});
}
}
public
void
doNoticeTask
()
{
log
.
info
(
"删除三个月以前的已读消息和广播消息开始执行"
);
long
begin
=
System
.
currentTimeMillis
();
// 删除消息接收表
List
<
Long
>
ids
=
messageReceiveService
.
getRecentNoticeIds
();
if
(
ListUtil
.
isNotEmpty
(
ids
))
{
messageReceiveService
.
deleteByIds
(
ids
);
}
// 删除消息表
List
<
Long
>
noticeIds
=
messageService
.
getRecentNoticeIds
();
if
(
ListUtil
.
isNotEmpty
(
noticeIds
))
{
messageService
.
deleteByIds
(
noticeIds
);
}
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"删除三个月以前的已读消息和广播消息执行结束,花费时间为"
+
(
end
-
begin
)
+
"毫秒"
);
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/service/MessageESService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.loit.api.service.PersonApiService
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.utils.ListUtil
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.modules.sys.entity.User
;
import
com.loit.v1.modules.dao.MessageESDao
;
import
com.loit.v1.modules.entity.MessageES
;
import
com.loit.v1.modules.entity.MessageReveiveES
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.RangeQueryBuilder
;
import
org.elasticsearch.index.query.WildcardQueryBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @description: 历史消息services
* @date: 2020/6/17 19:07
* @author: wubj
* @version v1.0
*/
@Service
public
class
MessageESService
{
@Autowired
private
MessageESDao
messageESDao
;
@Autowired
private
PersonApiService
personApiService
;
/**
* 分页查询
* @return
*/
public
AjaxJson
findHistoryPage
(
Integer
pageNo
,
Integer
pageSize
,
String
noticeTopic
,
String
noticeType
,
String
noticeLevel
,
Date
createTimeStart
,
Date
createTimeEnd
)
{
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createTime"
);
// Sort.Order statusOrder = new Sort.Order(Sort.Direction.ASC,"receive.noticeStatus");
// Sort.Order timeOrder = new Sort.Order(Sort.Direction.DESC,"createTime");
// Sort sort = Sort.by(statusOrder, timeOrder);
Pageable
pageable
=
PageRequest
.
of
(
pageNo
-
1
,
pageSize
,
sort
);
// 查询条件
BoolQueryBuilder
bql
=
QueryBuilders
.
boolQuery
();
User
user
=
this
.
getCurretUserId
();
if
(
user
!=
null
)
{
bql
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"receive.receiveId"
,
user
.
getUserId
()));
}
if
(
StringUtils
.
isNotEmpty
(
noticeTopic
))
{
bql
.
must
(
QueryBuilders
.
matchQuery
(
"noticeTopic"
,
noticeTopic
));
}
if
(
StringUtils
.
isNotEmpty
(
noticeType
))
{
bql
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"noticeType"
,
noticeType
));
}
if
(
StringUtils
.
isNotEmpty
(
noticeLevel
))
{
bql
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"noticeLevel"
,
noticeLevel
));
}
if
(
createTimeStart
!=
null
||
createTimeEnd
!=
null
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss"
);
RangeQueryBuilder
rqb
=
QueryBuilders
.
rangeQuery
(
"createTime"
);
if
(
createTimeStart
!=
null
)
{
String
start
=
sdf
.
format
(
createTimeStart
);
rqb
.
from
(
start
);
}
if
(
createTimeEnd
!=
null
)
{
String
end
=
sdf
.
format
(
createTimeEnd
);
rqb
.
to
(
end
);
}
bql
.
must
(
rqb
);
}
// 分页查询
Page
<
MessageES
>
page
=
messageESDao
.
search
(
bql
,
pageable
);
// 组装数据
AjaxJson
json
=
new
AjaxJson
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
page
!=
null
)
{
if
(
ListUtil
.
isNotEmpty
(
page
.
getContent
()))
{
List
<
MessageES
>
list
=
page
.
getContent
();
for
(
MessageES
messageES
:
list
)
{
if
(
ListUtil
.
isNotEmpty
(
messageES
.
getReceive
()))
{
for
(
MessageReveiveES
messageReveiveES
:
messageES
.
getReceive
())
{
if
(
user
.
getUserId
().
equals
(
messageReveiveES
.
getReceiveId
()))
{
messageES
.
setNoticeStatus
(
messageReveiveES
.
getNoticeStatus
());
break
;
}
}
}
}
}
map
.
put
(
"pageNo"
,
page
.
getPageable
().
getPageNumber
()
+
1
);
map
.
put
(
"pageSize"
,
page
.
getPageable
().
getPageSize
());
map
.
put
(
"count"
,
page
.
getTotalElements
());
map
.
put
(
"pageTotal"
,
page
.
getTotalPages
());
map
.
put
(
"list"
,
page
.
getContent
());
}
json
.
put
(
"page"
,
map
);
return
json
;
}
/**
* 获取当前用户信息
* @return
*/
private
User
getCurretUserId
()
{
//获取当前用户
User
user
=
null
;
AjaxJson
personJson
=
personApiService
.
getCurretUser
(
null
);
if
(
personJson
.
isSuccess
())
{
Object
obj
=
personJson
.
getBody
();
if
(
obj
!=
null
)
{
LinkedHashMap
accout
=
(
LinkedHashMap
)
((
LinkedHashMap
)
obj
).
get
(
"accout"
);
user
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
accout
),
User
.
class
);
}
}
return
user
;
}
}
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/service/MessageReceiveService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
service
;
import
com.loit.v1.modules.dao.MessageReceiveDao
;
import
com.loit.v1.modules.entity.MessageReceive
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.loit.common.service.CrudService
;
import
java.util.List
;
/**
* 消息接收表服务实现.
* Created by WBJ on 2020-04-23.
**/
@Service
@Transactional
(
readOnly
=
true
)
public
class
MessageReceiveService
extends
CrudService
<
MessageReceiveDao
,
MessageReceive
>
{
/**
* 标记消息为已读
* @param noticeIds
*/
@Transactional
(
readOnly
=
false
)
public
void
updateStatus
(
String
receiveId
,
List
<
Long
>
noticeIds
)
{
dao
.
updateStatus
(
receiveId
,
noticeIds
);
}
/**
* 获取未读消息的数量
* @param receiveId
* @return
*/
public
int
getUnreadCount
(
String
receiveId
)
{
return
dao
.
getUnreadCount
(
receiveId
);
}
/**
* 根据ids删除数据
*/
@Transactional
(
readOnly
=
false
)
public
void
deleteByIds
(
List
<
Long
>
noticeIds
)
{
dao
.
deleteByIds
(
noticeIds
);
}
/**
* 根据noticeIds删除数据
*/
@Transactional
(
readOnly
=
false
)
public
void
deleteByNoticeIds
(
List
<
Long
>
noticeIds
)
{
dao
.
deleteByNoticeIds
(
noticeIds
);
}
/**
* 获取近期消息ids
* @return
*/
public
List
<
Long
>
getRecentNoticeIds
()
{
return
dao
.
getRecentNoticeIds
();
}
public
void
insertBatch
(
List
<
MessageReceive
>
receiveList
)
{
dao
.
insertBatch
(
receiveList
);
}
}
\ No newline at end of file
loit-service/loit-notice/src/notice/java/com/loit/v1/modules/service/MessageService.java
0 → 100644
浏览文件 @
33891963
package
com
.
loit
.
v1
.
modules
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.loit.api.dto.AccoutInfo
;
import
com.loit.api.dto.Colour
;
import
com.loit.api.dto.DictData
;
import
com.loit.api.dto.PersonBase
;
import
com.loit.api.service.*
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.persistence.Page
;
import
com.loit.common.service.CrudService
;
import
com.loit.common.utils.JSONUtils
;
import
com.loit.common.utils.ListUtil
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.modules.sys.entity.User
;
import
com.loit.v1.modules.config.WebSocketClient
;
import
com.loit.v1.modules.constant.NoticeConstants
;
import
com.loit.v1.modules.dao.MessageDao
;
import
com.loit.v1.modules.dao.MessageESDao
;
import
com.loit.v1.modules.entity.Message
;
import
com.loit.v1.modules.entity.MessageES
;
import
com.loit.v1.modules.entity.MessageReceive
;
import
com.loit.v1.modules.entity.MessageReveiveES
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 消息表服务实现.
* Created by WBJ on 2020-04-23.
**/
@Service
public
class
MessageService
extends
CrudService
<
MessageDao
,
Message
>
{
@Autowired
private
MessageReceiveService
messageReceiveService
;
@Autowired
private
DictDataApiService
dictDataApiService
;
@Autowired
private
ColourApiService
colourApiService
;
@Autowired
private
PersonApiService
personApiService
;
@Autowired
private
WebSocketApiService
webSocketApiService
;
@Autowired
private
JPushApiService
jPushApiService
;
@Autowired
private
MessageESDao
messageESDao
;
// 批量存储数据个数
private
static
final
int
NOTICE_NUM
=
5000
;
// 字典map
private
Map
<
String
,
String
>
dictMap
=
new
HashMap
<>();
/**
* 消息中心分页列表
* @param page 分页对象
* @param notice
* @return
*/
public
Page
<
Message
>
findPage
(
Page
<
Message
>
page
,
Message
notice
)
{
notice
.
setPage
(
page
);
//查询所有接收人
if
(
notice
.
getShowFlag
()
!=
null
&&
"1"
.
equals
(
notice
.
getShowFlag
())){
notice
.
setReceiveId
(
null
);
}
else
if
(
StringUtils
.
isEmpty
(
notice
.
getReceiveId
()))
{
// 当前登录用户名
User
user
=
this
.
getCurretUserId
();
notice
.
setReceiveId
(
user
.
getUserId
());
}
List
<
Message
>
list
=
dao
.
findList
(
notice
);
this
.
assemblyNoticeData
(
list
);
page
.
setList
(
list
);
return
page
;
}
/**
* 消息详情
* @param id
* @return
*/
public
Message
get
(
Integer
id
)
{
Message
notice
=
dao
.
get
(
id
);
if
(
notice
!=
null
)
{
this
.
getDictMap
();
notice
.
setChildren
(
new
ArrayList
());
notice
.
setNoticeTypeName
(
dictMap
.
get
(
notice
.
getNoticeType
()));
notice
.
setNoticeSourceName
(
dictMap
.
get
(
notice
.
getNoticeSource
()));
this
.
assemblyNoticeLevelColour
(
notice
);
}
return
notice
;
}
/**
* 组装列表数据
* @param list
* @return
*/
private
List
<
Message
>
assemblyNoticeData
(
List
<
Message
>
list
)
{
if
(
ListUtil
.
isNotEmpty
(
list
))
{
this
.
getDictMap
();
List
<
String
>
receiveIds
=
list
.
stream
().
map
(
p
->
p
.
getReceiveId
()).
collect
(
Collectors
.
toList
());
List
<
PersonBase
>
personBases
=
this
.
getAccountByUserIds
(
receiveIds
);
Map
<
String
,
String
>
personMap
=
personBases
.
stream
().
collect
(
Collectors
.
toMap
(
PersonBase:
:
getUserId
,
PersonBase:
:
getPersonName
));
List
children
=
new
ArrayList
();
for
(
Message
entity
:
list
)
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getNoticeType
())
&&
StringUtils
.
isNotEmpty
(
dictMap
.
get
(
entity
.
getNoticeType
())))
{
entity
.
setNoticeTypeName
(
dictMap
.
get
(
entity
.
getNoticeType
()));
}
if
(
StringUtils
.
isNotEmpty
(
entity
.
getNoticeSource
())
&&
StringUtils
.
isNotEmpty
(
dictMap
.
get
(
entity
.
getNoticeSource
())))
{
entity
.
setNoticeSourceName
(
dictMap
.
get
(
entity
.
getNoticeSource
()));
}
if
(
entity
.
getReceiveId
()
!=
null
&&
personMap
!=
null
&&
personMap
.
get
(
entity
.
getReceiveId
())
!=
null
)
{
entity
.
setReceiveName
(
personMap
.
get
(
entity
.
getReceiveId
()));
}
this
.
assemblyNoticeLevelColour
(
entity
);
entity
.
setChildren
(
children
);
}
}
return
list
;
}
private
void
assemblyNoticeLevelColour
(
Message
message
){
if
(
message
!=
null
&&
StringUtils
.
isNotBlank
(
message
.
getNoticeLevel
())){
AjaxJson
json
=
colourApiService
.
findByDictCodeAndDataCode
(
NoticeConstants
.
NOTICE_GRADE
,
message
.
getNoticeLevel
());
if
(
json
.
isSuccess
())
{
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
LinkedHashMap
map
=
(
LinkedHashMap
)((
LinkedHashMap
)
obj
).
get
(
"colour"
);
Colour
colour
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
Colour
.
class
);
if
(
colour
!=
null
&&
StringUtils
.
isNotBlank
(
colour
.
getColourValue
())){
message
.
setNoticeLevelColour
(
colour
.
getColourValue
());
}
}
}
}
}
/**
* 获取字典数据
*/
private
void
getDictMap
()
{
if
(
dictMap
==
null
||
dictMap
.
size
()
==
0
)
{
// 获取字典信息
List
<
DictData
>
typeDict
=
this
.
getDictDataList
(
NoticeConstants
.
NOTICE_TYPE
);
List
<
DictData
>
sourceDict
=
this
.
getDictDataList
(
NoticeConstants
.
NOTICE_SOURCE
);
for
(
DictData
dictData
:
typeDict
)
{
dictMap
.
put
(
dictData
.
getDataCode
(),
dictData
.
getDataName
());
}
for
(
DictData
dictData
:
sourceDict
)
{
dictMap
.
put
(
dictData
.
getDataCode
(),
dictData
.
getDataName
());
}
}
}
/**
* 根据dictCode获取字典值
* @param dictCode
* @return
*/
private
List
<
DictData
>
getDictDataList
(
String
dictCode
)
{
List
<
DictData
>
dictDataList
=
new
ArrayList
<>();
AjaxJson
json
=
dictDataApiService
.
listDictDataByDictId
(
dictCode
);
if
(
json
.
isSuccess
())
{
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
List
<
LinkedHashMap
>
map
=
(
List
<
LinkedHashMap
>)((
LinkedHashMap
)
obj
).
get
(
"dictDataList"
);
dictDataList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
map
),
DictData
.
class
);
}
}
return
dictDataList
;
}
/**
* 获取当前用户信息
* @return
*/
private
User
getCurretUserId
()
{
User
user
=
new
User
();
//获取当前用户
AjaxJson
personJson
=
personApiService
.
getCurretUser
(
null
);
if
(
personJson
.
isSuccess
())
{
Object
obj
=
personJson
.
getBody
();
if
(
obj
!=
null
)
{
LinkedHashMap
accout
=
(
LinkedHashMap
)
((
LinkedHashMap
)
obj
).
get
(
"accout"
);
user
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
accout
),
User
.
class
);
}
}
return
user
;
}
/**
* 获取所有的账号信息
* @return
*/
private
List
<
PersonBase
>
getAccountByUserIds
(
List
<
String
>
receiveIds
)
{
List
<
PersonBase
>
accoutInfos
=
new
ArrayList
<>();
AjaxJson
json
=
personApiService
.
getAccountByUserIds
(
receiveIds
);
if
(
json
.
isSuccess
())
{
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
List
<
LinkedHashMap
>
map
=
(
List
<
LinkedHashMap
>)((
LinkedHashMap
)
obj
).
get
(
"list"
);
accoutInfos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
map
),
PersonBase
.
class
);
}
}
return
accoutInfos
;
}
/**
* 获取所有的账号信息
* @return
*/
private
List
<
AccoutInfo
>
getAccoutInfoList
()
{
List
<
AccoutInfo
>
accoutInfos
=
new
ArrayList
<>();
AjaxJson
json
=
personApiService
.
getAccoutInfoList
();
if
(
json
.
isSuccess
())
{
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
List
<
LinkedHashMap
>
map
=
(
List
<
LinkedHashMap
>)((
LinkedHashMap
)
obj
).
get
(
"list"
);
accoutInfos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
map
),
AccoutInfo
.
class
);
}
}
return
accoutInfos
;
}
/**
* 推送消息
* @param notice
*/
@Transactional
(
readOnly
=
false
)
public
void
propel
(
Message
notice
)
{
// 保存消息实体
this
.
save
(
notice
);
try
{
this
.
publish
(
notice
);
// 推送消息
}
catch
(
Exception
e
)
{
logger
.
error
(
"消息推送异常:{}"
,
e
.
getMessage
());
}
}
/**
* 批量插入数据到消息接收表
* @param receiveList
*/
private
void
insertNoticeReceiveList
(
List
<
MessageReceive
>
receiveList
){
int
listSize
=
receiveList
.
size
();
int
toIndex
=
NOTICE_NUM
;
for
(
int
i
=
0
;
i
<
listSize
;
i
+=
NOTICE_NUM
)
{
// 作用为toIndex最后没有1000条数据则剩余几条newList中就装几条
if
(
i
+
NOTICE_NUM
>
listSize
)
{
toIndex
=
listSize
-
i
;
}
List
<
MessageReceive
>
newList
=
receiveList
.
subList
(
i
,
i
+
toIndex
);
// 批量插入
messageReceiveService
.
insertBatch
(
newList
);
}
}
/**
* 把数据转存到历史表
*/
private
void
saveHistoryData
(
Message
message
)
{
MessageES
messageES
=
new
MessageES
();
messageES
.
setId
(
message
.
getId
());
messageES
.
setNoticeType
(
message
.
getNoticeType
());
messageES
.
setNoticeTypeName
(
message
.
getNoticeTypeName
());
messageES
.
setNoticeTopic
(
message
.
getNoticeTopic
());
messageES
.
setNoticeContent
(
message
.
getNoticeContent
());
messageES
.
setSendId
(
message
.
getSendId
());
messageES
.
setSendName
(
message
.
getSendName
());
messageES
.
setNoticeSource
(
message
.
getNoticeSource
());
messageES
.
setNoticeSourceName
(
message
.
getNoticeSourceName
());
messageES
.
setNoticeLevel
(
message
.
getNoticeLevel
());
messageES
.
setCreateTime
(
message
.
getCreateTime
());
if
(
message
.
getReceiveIds
()
!=
null
)
{
String
[]
receiveIds
=
message
.
getReceiveIds
().
split
(
","
);
List
<
MessageReveiveES
>
list
=
new
ArrayList
<>();
for
(
String
receiveId
:
receiveIds
)
{
MessageReveiveES
messageReveiveES
=
new
MessageReveiveES
();
messageReveiveES
.
setReceiveId
(
receiveId
);
list
.
add
(
messageReveiveES
);
}
messageES
.
setReceive
(
list
);
}
try
{
messageESDao
.
save
(
messageES
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"消息存到ES异常:{}"
,
e
.
getMessage
());
}
}
/**
* 统计未读消息数量
* @return
*/
public
List
<
Message
>
getUnreadList
()
{
Message
notice
=
new
Message
();
// 当前登录用户名
User
user
=
this
.
getCurretUserId
();
notice
.
setReceiveId
(
user
.
getUserId
());
notice
.
setNoticeStatus
(
"0"
);
List
<
Message
>
list
=
dao
.
findList
(
notice
);
this
.
assemblyNoticeData
(
list
);
return
list
;
}
/**
* 标记消息为已读
* @param noticeDto
*/
@Transactional
(
readOnly
=
false
)
public
void
updateStatus
(
Message
noticeDto
)
{
List
<
Long
>
ids
=
new
ArrayList
<>();
if
(
noticeDto
.
getNoticeTypeId
()
!=
null
)
{
Long
id
=
dao
.
findIdByNoticeTypeId
(
noticeDto
.
getNoticeTypeId
());
ids
.
add
(
id
);
}
else
{
String
[]
strIds
=
noticeDto
.
getNoticeIds
().
split
(
","
);
for
(
String
strId
:
strIds
)
{
ids
.
add
(
Long
.
valueOf
(
strId
));
}
}
String
userId
=
noticeDto
.
getReceiveId
();
if
(
StringUtils
.
isEmpty
(
userId
))
{
User
user
=
this
.
getCurretUserId
();
userId
=
user
.
getUserId
();
}
if
(
ids
!=
null
&&
ids
.
size
()
>
0
&&
userId
!=
null
)
{
// 标记消息为已读
messageReceiveService
.
updateStatus
(
userId
,
ids
);
}
}
/**
* 根据ids删除数据
*/
@Transactional
(
readOnly
=
false
)
public
void
deleteByIds
(
List
<
Long
>
noticeIds
)
{
dao
.
deleteByIds
(
noticeIds
);
}
/**
* 获取近期消息ids
* @return
*/
public
List
<
Long
>
getRecentNoticeIds
()
{
return
dao
.
getRecentNoticeIds
();
}
/**
* 新增或修改消息
* @param notice
*/
@Transactional
(
readOnly
=
false
)
public
void
save
(
Message
notice
)
{
if
(
notice
.
getId
()
!=
null
)
{
// 修改消息实体
notice
.
setUpdateTime
(
new
Date
());
dao
.
update
(
notice
);
// 修改接收人信息
messageReceiveService
.
deleteByNoticeIds
(
Arrays
.
asList
(
notice
.
getId
().
longValue
()));
}
else
{
if
(!
StringUtils
.
isNotEmpty
(
notice
.
getSendId
()))
{
// 保存消息实体
User
user
=
this
.
getCurretUserId
();
notice
.
setSendId
(
user
.
getUserId
());
notice
.
setSendName
(
user
.
getPersonName
());
}
notice
.
setUpdateTime
(
new
Date
());
notice
.
setCreateTime
(
new
Date
());
dao
.
insert
(
notice
);
}
// 判断是否保存消息接收表
int
noticeId
=
notice
.
getId
();
String
allFlag
=
notice
.
getAllFlag
();
List
<
String
>
accoutList
=
new
ArrayList
<>();
List
<
MessageReceive
>
receiveList
=
new
ArrayList
<>();
// 是广播消息
if
(
"1"
.
equals
(
allFlag
))
{
// 获取所有的账号信息
List
<
AccoutInfo
>
accoutInfos
=
this
.
getAccoutInfoList
();
if
(
ListUtil
.
isNotEmpty
(
accoutInfos
))
{
accoutList
=
accoutInfos
.
stream
().
map
(
p
->
p
.
getUserId
()).
collect
(
Collectors
.
toList
());
}
// 不是广播消息
}
else
if
(
"0"
.
equals
(
allFlag
)
&&
StringUtils
.
isNotEmpty
(
notice
.
getReceiveIds
()))
{
// 存储消息接收人信息
String
[]
receiveIds
=
notice
.
getReceiveIds
().
split
(
","
);
accoutList
=
Arrays
.
asList
(
receiveIds
);
}
if
(
ListUtil
.
isNotEmpty
(
accoutList
))
{
notice
.
setReceiveIds
(
StringUtils
.
join
(
accoutList
,
","
));
for
(
String
receiveId
:
accoutList
)
{
MessageReceive
noticeReceive
=
new
MessageReceive
();
noticeReceive
.
setNoticeId
(
noticeId
);
noticeReceive
.
setReceiveId
(
receiveId
);
noticeReceive
.
setNoticeStatus
(
"0"
);
noticeReceive
.
setCreateTime
(
new
Date
());
receiveList
.
add
(
noticeReceive
);
}
// 批量存储消息接收表信息
this
.
insertNoticeReceiveList
(
receiveList
);
}
// 保存消息到ES
if
(
notice
!=
null
)
{
this
.
getDictMap
();
notice
.
setNoticeTypeName
(
dictMap
.
get
(
notice
.
getNoticeType
()));
notice
.
setNoticeSourceName
(
dictMap
.
get
(
notice
.
getNoticeSource
()));
}
this
.
saveHistoryData
(
notice
);
}
/**
* 消息推送
* @param notice
*/
@Transactional
(
readOnly
=
false
)
public
void
publish
(
Message
notice
)
{
Integer
noticeId
=
notice
.
getId
();
// 极光推送到手机端
// 获取接收人信息
List
<
String
>
receiveIds
=
new
ArrayList
<>();
MessageReceive
receive
=
new
MessageReceive
();
receive
.
setNoticeId
(
noticeId
);
List
<
MessageReceive
>
receiveList
=
messageReceiveService
.
findList
(
receive
);
if
(
ListUtil
.
isNotEmpty
(
receiveList
))
{
receiveIds
=
receiveList
.
stream
().
map
(
p
->
p
.
getReceiveId
()).
collect
(
Collectors
.
toList
());
}
notice
=
dao
.
get
(
noticeId
);
String
allFlag
=
notice
.
getAllFlag
();
Map
<
String
,
String
>
pushMap
=
new
HashMap
<>();
pushMap
.
put
(
"message"
,
JSONUtils
.
obj2json
(
notice
));
if
(
"0"
.
equals
(
allFlag
))
{
// 推送到手机端,指定用户
pushMap
.
put
(
"userIds"
,
StringUtils
.
join
(
receiveIds
,
","
));
try
{
jPushApiService
.
pushAndroid
(
pushMap
);
}
catch
(
Exception
e
){
logger
.
error
(
"极光推送异常:{}"
,
e
.
getMessage
());
}
}
// 推送到PC端
List
<
Message
>
list
=
dao
.
findListByReceiveIds
(
receiveIds
);
if
(
ListUtil
.
isNotEmpty
(
list
)
&&
ListUtil
.
isNotEmpty
(
receiveIds
))
{
this
.
assemblyNoticeData
(
list
);
Map
<
String
,
List
<
Message
>>
map
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Message:
:
getReceiveId
));
Map
<
String
,
String
>
sendMap
=
new
HashMap
<>();
for
(
String
receiveId
:
receiveIds
)
{
if
(
map
.
containsKey
(
receiveId
))
{
// 最多只推送15条
List
<
Message
>
tempList
=
map
.
get
(
receiveId
);
Map
<
String
,
Object
>
receiveMap
=
new
HashMap
<>();
int
size
=
tempList
.
size
();
receiveMap
.
put
(
"count"
,
size
);
if
(
size
>
15
)
{
tempList
=
tempList
.
subList
(
0
,
15
);
}
receiveMap
.
put
(
"list"
,
tempList
);
// 服务端发送消息给指定客户
sendMap
.
put
(
receiveId
,
JSONUtils
.
obj2json
(
receiveMap
));
}
}
//webSocketApiService.sendMessageToUsers(sendMap);
try
{
this
.
sendMessage
(
sendMap
);
}
catch
(
Exception
e
){
logger
.
error
(
"websocket推送异常:{}"
,
e
.
getMessage
());
}
}
}
/**
* 推送消息
* @param sendMap
*/
private
void
sendMessage
(
Map
<
String
,
String
>
sendMap
)
{
String
serverInfo
=
this
.
getWebsocketServer
();
if
(!
StringUtils
.
isNotEmpty
(
serverInfo
))
{
return
;
}
try
{
WebSocketClient
webSocketClient
=
new
WebSocketClient
();
JSONArray
jsonArray
=
JSON
.
parseArray
(
serverInfo
);
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
(
JSONObject
)
jsonArray
.
get
(
i
);
String
userIdsStr
=
jsonObject
.
getString
(
"userIds"
);
if
(
StringUtils
.
isNotEmpty
(
userIdsStr
))
{
String
[]
userIds
=
userIdsStr
.
split
(
","
);
String
address
=
jsonObject
.
getString
(
"address"
);
String
uri
=
"ws://"
+
address
+
"/websocket?userId=webSocketClient"
;
webSocketClient
.
start
(
uri
);
if
(
webSocketClient
.
session
==
null
)
{
continue
;
}
JSONArray
sendArray
=
new
JSONArray
();
for
(
String
userId
:
userIds
)
{
if
(
sendMap
.
containsKey
(
userId
))
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"userId"
,
userId
);
object
.
put
(
"msg"
,
sendMap
.
get
(
userId
));
sendArray
.
add
(
object
);
}
}
webSocketClient
.
session
.
getBasicRemote
().
sendText
(
sendArray
.
toString
());
webSocketClient
.
session
.
close
();
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 获取用户连接的websocket服务器信息
* @return
*/
private
String
getWebsocketServer
()
{
String
serverInfo
=
null
;
AjaxJson
json
=
webSocketApiService
.
getWebsocketServer
();
if
(
json
.
isSuccess
())
{
Object
obj
=
json
.
getBody
();
if
(
obj
!=
null
)
{
serverInfo
=
(
String
)
((
LinkedHashMap
)
obj
).
get
(
"serverInfo"
);
}
}
return
serverInfo
;
}
/**
* 消息删除
* @param ids
*/
@Transactional
(
readOnly
=
false
)
public
void
deleteAll
(
String
ids
)
{
if
(
StringUtils
.
isNotEmpty
(
ids
))
{
List
<
Long
>
noticeIds
=
new
ArrayList
<>();
String
[]
str
=
ids
.
split
(
","
);
for
(
String
id
:
str
)
{
noticeIds
.
add
(
Long
.
valueOf
(
id
));
}
messageReceiveService
.
deleteByNoticeIds
(
noticeIds
);
dao
.
deleteByIds
(
noticeIds
);
}
}
}
\ No newline at end of file
loit-service/loit-notice/src/notice/resources/mapper/v1/modules/MessageDaoMapper.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- loit_message 消息表 -->
<mapper
namespace=
"com.loit.v1.modules.dao.MessageDao"
>
<resultMap
id=
"entityResultMap"
type=
"com.loit.v1.modules.entity.Message"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"noticeType"
column=
"notice_type"
/>
<result
property=
"noticeTopic"
column=
"notice_topic"
/>
<result
property=
"noticeContent"
column=
"notice_content"
/>
<result
property=
"noticeSource"
column=
"notice_source"
/>
<result
property=
"sendId"
column=
"send_id"
/>
<result
property=
"sendName"
column=
"send_name"
/>
<result
property=
"noticeLevel"
column=
"notice_level"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"allFlag"
column=
"all_flag"
/>
<result
property=
"urlName"
column=
"url_name"
/>
<result
property=
"buttonName"
column=
"button_name"
/>
<result
property=
"appId"
column=
"app_id"
/>
<result
property=
"appCode"
column=
"app_code"
/>
<result
property=
"resourceUrl"
column=
"resource_url"
/>
<result
property=
"menuName"
column=
"menu_name"
/>
<result
property=
"resContextValue"
column=
"res_context_value"
/>
<result
property=
"entranceUrl"
column=
"entrance_url"
/>
<result
property=
"entranceName"
column=
"entrance_name"
/>
<result
property=
"menuContextValue"
column=
"menu_context_value"
/>
<result
property=
"appUrl"
column=
"app_url"
/>
<result
property=
"noticeTypeId"
column=
"notice_type_id"
/>
</resultMap>
<!-- 排序 -->
<sql
id=
"Base_Page"
>
<choose>
<when
test=
"orderByName != null and orderByName != ''"
>
<choose>
<when
test=
"orderBy != null and orderBy != ''"
>
ORDER BY n.${orderByName} ${orderBy}
</when>
<otherwise>
ORDER BY n.${orderByName} DESC
</otherwise>
</choose>
</when>
<otherwise>
<choose>
<when
test=
"orderBy != null and orderBy != ''"
>
ORDER BY n.CREATE_TIME ${orderBy}
</when>
<otherwise>
ORDER BY r.notice_status, n.CREATE_TIME DESC
</otherwise>
</choose>
</otherwise>
</choose>
</sql>
<sql
id=
"EntityColumns"
>
n.`id`,
n.`notice_type`,
n.`notice_topic`,
n.`notice_content`,
n.`notice_source`,
n.`send_id`,
n.`send_name`,
n.`notice_level`,
n.`update_time`,
n.`create_time`,
n.`del_flag`,
n.`all_flag`,
n.`url_name`,
n.`button_name`,
n.`app_id`,
n.`app_code`,
n.`resource_url`,
n.`menu_name`,
n.`res_context_value`,
n.`entrance_url`,
n.`entrance_name`,
n.`menu_context_value`,
n.`app_url`,
n.`notice_type_id`,
n.`update_time` as publishTime
</sql>
<!-- 查询 -->
<select
id=
"get"
resultMap=
"entityResultMap"
>
SELECT
<include
refid=
"EntityColumns"
/>
FROM loit_message n
WHERE n.id = #{id}
</select>
<!-- 查询列表 -->
<select
id=
"findList"
resultMap=
"entityResultMap"
parameterType=
"com.loit.v1.modules.entity.Message"
>
SELECT
<include
refid=
"EntityColumns"
/>
,
r.`notice_status`,
r.`receive_id`
FROM loit_message n
INNER JOIN loit_message_receive r ON n.id = r.notice_id
WHERE n.del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"noticeType!=null and noticeType!=''"
>
AND n.notice_type = #{noticeType}
</if>
<if
test=
"noticeTopic!=null and noticeTopic!=''"
>
AND n.notice_topic LIKE CONCAT('%', #{noticeTopic}, '%')
</if>
<if
test=
"noticeContent!=null and noticeContent!=''"
>
AND n.notice_content = #{noticeContent}
</if>
<if
test=
"noticeSource!=null and noticeSource!=''"
>
AND n.notice_source = #{noticeSource}
</if>
<if
test=
"noticeLevel!=null and noticeLevel!=''"
>
AND n.notice_level = #{noticeLevel}
</if>
<if
test=
"createTimeStart != null"
>
AND n.CREATE_TIME
>
= #{createTimeStart}
</if>
<if
test=
"createTimeEnd != null"
>
AND n.CREATE_TIME
<
= #{createTimeEnd}
</if>
<if
test=
"receiveId!=null and receiveId!=''"
>
AND r.receive_id = #{receiveId}
</if>
<if
test=
"noticeStatus!=null and noticeStatus!=''"
>
AND r.notice_status = #{noticeStatus}
</if>
<include
refid=
"Base_Page"
/>
</select>
<!-- 保存 -->
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.loit.v1.modules.entity.Message"
>
INSERT INTO loit_message
(notice_type,notice_topic,notice_content,notice_source,send_id,send_name,notice_level,update_time,create_time,del_flag,all_flag,url_name,button_name,app_id,app_code,resource_url,menu_name,res_context_value,entrance_url,entrance_name,menu_context_value,app_url,notice_type_id)
VALUES
(#{noticeType},#{noticeTopic},#{noticeContent},#{noticeSource},#{sendId},#{sendName},#{noticeLevel},#{updateTime},#{createTime},#{delFlag},#{allFlag},#{urlName},#{buttonName},#{appId},#{appCode},#{resourceUrl},#{menuName},#{resContextValue},#{entranceUrl},#{entranceName},#{menuContextValue},#{appUrl},#{noticeTypeId})
</insert>
<!-- 更新 -->
<update
id=
"update"
parameterType=
"com.loit.v1.modules.entity.Message"
>
UPDATE loit_message
SET
<if
test=
"noticeType!=null and noticeType!=''"
>
notice_type = #{noticeType},
</if>
<if
test=
"noticeTopic!=null and noticeTopic!=''"
>
notice_topic = #{noticeTopic},
</if>
<if
test=
"noticeContent!=null and noticeContent!=''"
>
notice_content = #{noticeContent},
</if>
<if
test=
"noticeSource!=null and noticeSource!=''"
>
notice_source = #{noticeSource},
</if>
<if
test=
"sendId!=null and sendId!=''"
>
send_id = #{sendId},
</if>
<if
test=
"sendName!=null and sendName!=''"
>
send_name = #{sendName},
</if>
<if
test=
"noticeLevel!=null and noticeLevel!=''"
>
notice_level = #{noticeLevel},
</if>
<if
test=
"updateTime!=null "
>
update_time = #{updateTime},
</if>
<if
test=
"createTime!=null "
>
create_time = #{createTime},
</if>
<if
test=
"delFlag!=null and delFlag!=''"
>
del_flag = #{delFlag},
</if>
<if
test=
"allFlag!=null and allFlag!=''"
>
all_flag = #{allFlag},
</if>
<if
test=
"urlName!=null and urlName!=''"
>
url_name = #{urlName},
</if>
<if
test=
"buttonName!=null and buttonName!=''"
>
button_name = #{buttonName},
</if>
<if
test=
"appId!=null "
>
app_id = #{appId},
</if>
<if
test=
"appCode!=null "
>
app_code = #{appCode},
</if>
<if
test=
"resourceUrl!=null and resourceUrl!=''"
>
resource_url = #{resourceUrl},
</if>
<if
test=
"menuName!=null and menuName!=''"
>
menu_name = #{menuName},
</if>
<if
test=
"resContextValue!=null and resContextValue!=''"
>
res_context_value = #{resContextValue},
</if>
<if
test=
"entranceUrl!=null and entranceUrl!=''"
>
entrance_url = #{entranceUrl},
</if>
<if
test=
"entranceName!=null and entranceName!=''"
>
entrance_name = #{entranceName},
</if>
<if
test=
"menuContextValue!=null and menuContextValue!=''"
>
menu_context_value = #{menuContextValue},
</if>
<if
test=
"appUrl!=null and appUrl!=''"
>
app_url = #{appUrl}
</if>
WHERE id = #{id}
</update>
<!-- 删除 -->
<delete
id=
"delete"
>
delete from loit_message where id = #{id}
</delete>
<!-- 获取三个月以前的已读消息和广播消息 -->
<select
id=
"getRecentNoticeIds"
resultType=
"java.lang.Integer"
>
SELECT n.id
FROM
loit_message n
WHERE
DATE(n.create_time)
<
= DATE(DATE_SUB(NOW(), INTERVAL 3 MONTH))
AND
(
EXISTS (SELECT r.notice_id FROM loit_message_receive r WHERE r.notice_id = n.id AND r.notice_status = 1)
OR NOT EXISTS (SELECT r.notice_id FROM loit_message_receive r WHERE r.notice_id = n.id)
)
</select>
<!-- 根据ids删除数据 -->
<delete
id=
"deleteByIds"
>
DELETE
FROM
loit_message
WHERE
id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</delete>
<!-- 根据ids获取消息信息 -->
<select
id=
"findListByIds"
resultMap=
"entityResultMap"
>
SELECT
<include
refid=
"EntityColumns"
/>
FROM loit_message n
WHERE
n.id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
<!-- 根据接收人ids获取消息 -->
<select
id=
"findListByReceiveIds"
resultMap=
"entityResultMap"
>
SELECT
<include
refid=
"EntityColumns"
/>
,
r.`receive_id`
FROM loit_message n
INNER JOIN loit_message_receive r ON n.id = r.notice_id
WHERE r.notice_status = 0
AND r.receive_id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
ORDER BY n.create_time DESC
</select>
<select
id=
"findIdByNoticeTypeId"
resultType=
"java.lang.Long"
>
SELECT
id
FROM loit_message
WHERE notice_type_id = #{noticeTypeId}
</select>
</mapper>
\ No newline at end of file
loit-service/loit-notice/src/notice/resources/mapper/v1/modules/MessageReceiveDaoMapper.xml
0 → 100644
浏览文件 @
33891963
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- loit_message_receive 消息接收表 -->
<mapper
namespace=
"com.loit.v1.modules.dao.MessageReceiveDao"
>
<resultMap
id=
"entityResultMap"
type=
"com.loit.v1.modules.entity.MessageReceive"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"noticeId"
column=
"notice_id"
/>
<result
property=
"receiveId"
column=
"receive_id"
/>
<result
property=
"noticeStatus"
column=
"notice_status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"handleStatus"
column=
"handle_status"
/>
</resultMap>
<!-- 查询 -->
<select
id=
"get"
resultMap=
"entityResultMap"
>
SELECT
`id`,
`notice_id`,
`receive_id`,
`notice_status`,
`create_time`,
`handle_status`
FROM loit_notice_receive
WHERE id = #{id}
</select>
<!-- 查询列表 -->
<select
id=
"findList"
resultMap=
"entityResultMap"
parameterType=
"com.loit.v1.modules.entity.MessageReceive"
>
SELECT
`id`,
`notice_id`,
`receive_id`,
`notice_status`,
`create_time`,
`handle_status`
FROM loit_message_receive
WHERE del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"id!=null "
>
AND id = #{id}
</if>
<if
test=
"noticeId!=null "
>
AND notice_id = #{noticeId}
</if>
<if
test=
"receiveId!=null "
>
AND receive_id = #{receiveId}
</if>
<if
test=
"noticeStatus!=null and noticeStatus!=''"
>
AND notice_status = #{noticeStatus}
</if>
<if
test=
"createTime!=null "
>
AND create_time = #{createTime}
</if>
<if
test=
"handleStatus!=null and handleStatus!=''"
>
AND handle_status = #{handleStatus}
</if>
</select>
<!-- 保存 -->
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.loit.v1.modules.entity.MessageReceive"
>
INSERT INTO loit_message_receive
(notice_id,receive_id,notice_status,create_time,handle_status)
VALUES
(#{noticeId},#{receiveId},#{noticeStatus},#{createTime},#{handleStatus})
</insert>
<!-- 更新 -->
<update
id=
"update"
parameterType=
"com.loit.v1.modules.entity.MessageReceive"
>
UPDATE loit_message_receive
SET
<if
test=
"noticeId!=null "
>
notice_id = #{noticeId},
</if>
<if
test=
"receiveId!=null "
>
receive_id = #{receiveId},
</if>
<if
test=
"noticeStatus!=null and noticeStatus!=''"
>
notice_status = #{noticeStatus},
</if>
<if
test=
"createTime!=null "
>
create_time = #{createTime},
</if>
<if
test=
"handleStatus!=null and handleStatus!=''"
>
handle_status = #{handleStatus}
</if>
WHERE id = #{id}
</update>
<!-- 删除 -->
<delete
id=
"delete"
>
delete from loit_message_receive where id = #{id}
</delete>
<!-- 更新消息为已读 -->
<update
id=
"updateStatus"
parameterType=
"com.loit.v1.modules.entity.MessageReceive"
>
UPDATE loit_message_receive
SET
notice_status = '1'
WHERE
notice_id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
<if
test=
"receiveId!=null"
>
AND receive_id = #{receiveId}
</if>
</update>
<!-- 获取接收人未读消息数量 -->
<select
id=
"getUnreadCount"
resultType=
"java.lang.Integer"
>
SELECT COUNT(notice_id)
FROM loit_message_receive
WHERE
notice_status = '0'
<if
test=
"receiveId!=null"
>
AND receive_id = #{receiveId}
</if>
</select>
<!-- 获取三个月以前的已读消息和广播消息 -->
<select
id=
"getRecentNoticeIds"
resultType=
"java.lang.Integer"
>
SELECT r.id
FROM
loit_message_receive r
WHERE
EXISTS
(SELECT n.id FROM loit_message n WHERE n.id = r.notice_id
AND DATE(n.create_time)
<
= DATE(DATE_SUB(NOW(), INTERVAL 3 MONTH))
AND r.notice_status = 1
)
</select>
<!-- 根据ids删除数据 -->
<delete
id=
"deleteByIds"
>
DELETE
FROM
loit_message_receive
WHERE
id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</delete>
<!-- 根据noticeIds删除数据 -->
<delete
id=
"deleteByNoticeIds"
>
DELETE
FROM
loit_message_receive
WHERE
notice_id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</delete>
<insert
id=
"insertBatch"
parameterType=
"java.util.List"
>
INSERT INTO loit_message_receive
(notice_id,receive_id,notice_status,create_time,handle_status)
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.noticeId},#{item.receiveId},#{item.noticeStatus},#{item.createTime},#{item.handleStatus})
</foreach>
</insert>
</mapper>
\ No newline at end of file
loit-service/loit-portal/src/portal/java/com/loit/v1/modules/controller/TestController.java
deleted
100644 → 0
浏览文件 @
a8839722
package
com
.
loit
.
v1
.
modules
.
controller
;
import
com.loit.api.service.loituser.TestFeignApiService
;
import
com.loit.common.json.AjaxJson
;
import
com.loit.common.persistence.Page
;
import
com.loit.common.spring.timeloit.utils.LoitStatusCode
;
import
com.loit.common.utils.StringUtils
;
import
com.loit.modules.sys.entity.Dict
;
import
com.loit.modules.sys.service.DictService
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.loadbalancer.LoadBalanced
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
/**
* Description: TODO
* Author: yangwenbin
* Date: Created in 2020/7/30 10:58
* Version: 1.0
* Modified By:
*/
@RestController
@RequestMapping
(
value
=
"test"
)
public
class
TestController
{
protected
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Autowired
private
DictService
dictService
;
@Autowired
@LoadBalanced
private
RestTemplate
restTemplate
;
@Autowired
private
TestFeignApiService
testFeignApiService
;
/**
* 空测试用
*
* @return
*/
@GetMapping
(
value
=
"json"
)
public
AjaxJson
test
()
{
AjaxJson
ajaxJson
=
new
AjaxJson
();
return
ajaxJson
;
}
@GetMapping
(
value
=
"hello"
)
public
String
hello
()
{
return
"hello"
;
}
/**
* @param dict 系统字典实体类
* @param request
* @param response
* @return
* @description 系统字典分页列表
* @author xutao
* @date:2019年10月18日
*/
@GetMapping
(
value
=
"dict/page"
)
@ApiOperation
(
value
=
"分页列表"
,
notes
=
"获取系统字典分页列表"
)
@ApiImplicitParams
({
// @ApiImplicitParam(name = "pageNo", value = "当前页码", required = true, dataType = "String", paramType = "query"),
// @ApiImplicitParam(name = "pageSize", value = "分页大小", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam
(
name
=
"dictCode"
,
value
=
"字典编码"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dictName"
,
value
=
"字典名称"
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"baseFlag"
,
value
=
"1、系统内置 2、用户自定义 "
,
required
=
false
,
dataType
=
"String"
,
paramType
=
"query"
)
})
public
AjaxJson
list
(
@ApiIgnore
Dict
dict
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
logger
.
info
(
"分页查询"
);
Page
<
Dict
>
page
=
dictService
.
findTreePage
(
new
Page
<
Dict
>(
request
,
response
),
dict
);
AjaxJson
json
=
new
AjaxJson
();
json
.
put
(
"page"
,
page
);
return
json
;
}
/**
* @param dictId 系统字典ID
* @return
* @description 系统字典详情
* @author xutao
* @date:2019年10月18日
*/
@GetMapping
(
value
=
"dict/{dictId}"
)
@ApiOperation
(
value
=
"详情"
,
notes
=
"根据dictId获取系统字典详情"
)
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"系统字典ID"
,
required
=
true
,
dataType
=
"String"
)
public
AjaxJson
get
(
@PathVariable
(
required
=
false
)
String
dictId
)
{
logger
.
info
(
"获取详情"
);
if
(
StringUtils
.
isBlank
(
dictId
))
{
return
AjaxJson
.
returnExceptionInfo
(
LoitStatusCode
.
PRIMARY_KEY_ISNULL
);
}
Dict
dict
=
dictService
.
get
(
dictId
);
AjaxJson
json
=
new
AjaxJson
();
json
.
put
(
"obj"
,
dict
);
return
json
;
}
/**
* @return
* @description 系统字典新增或更新
* @author xutao
* @date:2019年10月18日
*/
@PostMapping
(
value
=
"dict/save"
)
@ApiOperation
(
value
=
"保存(新增或修改)"
,
notes
=
"保存或更新系统字典"
)
// @ApiImplicitParam(name = "dict", value = "字典实体类", required = true, dataType = "Dict")
public
AjaxJson
save
()
{
AjaxJson
json
=
new
AjaxJson
();
try
{
// List<Dict> list = dictService.findList(dict);
// if(list.size()>0) {
// return AjaxJson.returnExceptionInfo(LoitStatusCode.DICT_IS_EXIST);
// }else {
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
"test"
);
dict
.
setDictName
(
"loit"
);
dictService
.
save
(
dict
);
json
.
setMsg
(
"字典保存成功"
);
// }
logger
.
info
(
"保存"
);
return
json
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"erroCode:{},info:保存字典数据异常"
,
LoitStatusCode
.
FAIL
.
statusCode
);
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
LoitStatusCode
.
SAVE_EXCEPTION
);
}
}
@GetMapping
(
value
=
"dict/getSave"
)
@ApiOperation
(
value
=
"保存(新增或修改)"
,
notes
=
"保存或更新系统字典"
)
public
AjaxJson
getSave
()
{
AjaxJson
json
=
new
AjaxJson
();
try
{
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
"test"
);
dict
.
setDictName
(
"loit"
);
dictService
.
save
(
dict
);
json
.
setMsg
(
"字典保存成功"
);
// }
logger
.
info
(
"保存"
);
return
json
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"erroCode:{},info:保存字典数据异常"
,
LoitStatusCode
.
FAIL
.
statusCode
);
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
LoitStatusCode
.
SAVE_EXCEPTION
);
}
}
/**
* 批量添加新的对象
*
* @return
*/
@RequestMapping
(
value
=
"/batAdd"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
void
batAdd
()
{
long
startTime
=
System
.
currentTimeMillis
();
for
(
int
i
=
1
;
i
<=
1000000
;
i
++)
{
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
"test"
);
dict
.
setDictName
(
"loit"
);
dictService
.
save
(
dict
);
}
}
/**
* 批量添加新的对象
*
* @return
*/
@RequestMapping
(
value
=
"/batAddList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
String
batAddList
()
{
List
<
Dict
>
resultList
=
new
ArrayList
<>(
1000
);
long
startTime
=
System
.
currentTimeMillis
();
int
count
=
1000000
;
for
(
int
i
=
0
;
i
<=
1000000
;
i
++)
{
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
"test"
+
i
);
dict
.
setDictName
(
"loit"
);
resultList
.
add
(
dict
);
if
(
resultList
.
size
()
==
1000
)
{
dictService
.
insertResultBatch
(
resultList
);
resultList
.
clear
();
}
}
long
millis
=
System
.
currentTimeMillis
()
-
startTime
;
long
sec
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
millis
);
long
qps
=
count
/
sec
;
return
"插入表loit_sys_dict: 插入记录数"
+
count
+
"条; 耗时"
+
sec
+
"秒; "
+
"QPS:"
+
qps
;
}
/**
* 验证for循环删除
*/
@RequestMapping
(
value
=
"/batDelete"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
String
batDelete
()
{
long
startTime
=
System
.
currentTimeMillis
();
int
count
=
1000000
;
for
(
int
i
=
0
;
i
<=
1000000
;
i
++)
{
Dict
dict
=
new
Dict
();
Integer
dictId
=
i
+
10
;
dict
.
setDictId
(
dictId
);
dictService
.
delete
(
dict
);
}
long
millis
=
System
.
currentTimeMillis
()
-
startTime
;
long
sec
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
millis
);
long
qps
=
count
/
sec
;
return
"表loit_sys_dict: 删除记录数"
+
count
+
"条; 耗时"
+
sec
+
"秒; "
+
"QPS:"
+
qps
;
}
@RequestMapping
(
value
=
"/batDeleteList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
String
batDeleteList
()
{
List
<
Integer
>
resultList
=
new
ArrayList
<>(
1000
);
long
startTime
=
System
.
currentTimeMillis
();
int
count
=
1000000
;
for
(
int
i
=
0
;
i
<=
1000000
;
i
++)
{
Integer
dictId
=
i
+
10
;
resultList
.
add
(
dictId
);
if
(
resultList
.
size
()
==
1000
)
{
dictService
.
deleteResultBatch
(
resultList
);
resultList
.
clear
();
}
}
long
millis
=
System
.
currentTimeMillis
()
-
startTime
;
long
sec
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
millis
);
long
qps
=
count
/
sec
;
return
"表loit_sys_dict: 删除记录数"
+
count
+
"条; 耗时"
+
sec
+
"秒; "
+
"QPS:"
+
qps
;
}
/**
* 批量更新
*
* @return
*/
@RequestMapping
(
value
=
"/batUpdateList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
String
batUpdateList
()
{
List
<
Dict
>
resultList
=
new
ArrayList
<>(
1000
);
long
startTime
=
System
.
currentTimeMillis
();
int
count
=
1000000
;
for
(
int
i
=
0
;
i
<=
1000000
;
i
++)
{
Dict
dict
=
new
Dict
();
Integer
dictId
=
i
+
10
;
dict
.
setDictId
(
dictId
);
resultList
.
add
(
dict
);
if
(
resultList
.
size
()
==
1000
)
{
dictService
.
updateResultBatch
(
resultList
);
resultList
.
clear
();
}
}
long
millis
=
System
.
currentTimeMillis
()
-
startTime
;
long
sec
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
millis
);
long
qps
=
count
/
sec
;
return
"插入表loit_sys_dict: 插入记录数"
+
count
+
"条; 耗时"
+
sec
+
"秒; "
+
"QPS:"
+
qps
;
}
/**
* @param dictId 字典ID,多ID时,以逗号分隔
* @return
* @description 系统字典删除
* @author xutao
* @date:2019年10月18日
*/
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除单个dictId"
)
@DeleteMapping
(
value
=
"dict/{dictId}"
)
public
AjaxJson
deleteAll
(
@PathVariable
(
"dictId"
)
String
dictId
)
{
logger
.
info
(
"删除"
);
if
(
StringUtils
.
isBlank
(
dictId
))
{
return
AjaxJson
.
returnExceptionInfo
(
LoitStatusCode
.
PRIMARY_KEY_ISNULL
);
}
AjaxJson
json
=
new
AjaxJson
();
try
{
Dict
dict
=
new
Dict
();
dict
.
setDictId
(
Integer
.
valueOf
(
dictId
));
dictService
.
delete
(
dict
);
json
.
setMsg
(
"删除字典成功"
);
return
json
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"erroCode:{},info:删除字典异常"
,
LoitStatusCode
.
REDIS_LINK_FAIL
.
statusCode
);
e
.
printStackTrace
();
return
AjaxJson
.
returnExceptionInfo
(
LoitStatusCode
.
REDIS_LINK_FAIL
);
}
}
/**
* @param dictId
* @param dictName
* @return
* @description 检查字典名称是否重复
*/
@ApiOperation
(
value
=
"检查字典名称是否重复"
,
notes
=
"检查字典名称是否重复"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典ID"
,
required
=
false
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dictName"
,
value
=
"字典名称"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"/checkDictNameUnique"
)
public
AjaxJson
checkDictNameUnique
(
Integer
dictId
,
String
dictName
)
{
boolean
uniqueFlag
=
dictService
.
checkNameUnique
(
dictId
,
dictName
);
AjaxJson
json
=
new
AjaxJson
();
if
(
uniqueFlag
)
{
json
.
setMsg
(
"字典名称不重复"
);
}
else
{
json
.
setMsg
(
"字典名称重复"
);
json
.
setCode
(
LoitStatusCode
.
FAIL
.
statusCode
);
}
return
json
;
}
@GetMapping
(
value
=
"fileRibbon"
)
public
AjaxJson
testFileRibbon
()
{
String
url
=
"http://loit-file/file/test"
;
AjaxJson
ajaxJson
=
restTemplate
.
getForObject
(
url
,
AjaxJson
.
class
);
return
ajaxJson
;
}
@GetMapping
(
value
=
"testFeign"
)
public
AjaxJson
testFeign
()
{
AjaxJson
ajaxJson
=
new
AjaxJson
();
return
testFeignApiService
.
testFeign
();
}
}
pom.xml
浏览文件 @
33891963
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<module>
loit-common
</module>
<module>
loit-common
</module>
<module>
loit-core-boot
</module>
<module>
loit-core-boot
</module>
<module>
loit-service
</module>
<module>
loit-service
</module>
<module>
loit-service-api
</module>
</modules>
</modules>
<parent>
<parent>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
@@ -36,8 +37,8 @@
...
@@ -36,8 +37,8 @@
<loit-core-boot>
1.0.24
</loit-core-boot>
<loit-core-boot>
1.0.24
</loit-core-boot>
<loit-core-common>
1.0.2
</loit-core-common>
<loit-core-common>
1.0.2
</loit-core-common>
<loit-common>
1.0.2
</loit-common>
<loit-common>
1.0.2
</loit-common>
<loit-file-api>
1.0.
1
</loit-file-api>
<loit-file-api>
1.0.
0
</loit-file-api>
<loit-portal-api>
1.
0.3
</loit-portal-api>
<loit-portal-api>
1.
4-SNAPSHOT
</loit-portal-api>
</properties>
</properties>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论