Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
c28135da
提交
c28135da
authored
5月 11, 2022
作者:
涂茂林
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'merge_dev' 到 'dev_tml'
Merge dev 查看合并请求 chemical-kesai/kshg-api!21
上级
d8a69070
08daed85
隐藏空白字符变更
内嵌
并排
正在显示
129 个修改的文件
包含
4541 行增加
和
556 行删除
+4541
-556
.gitignore
.gitignore
+1
-0
README.md
README.md
+2
-3
build.gradle
app/build.gradle
+5
-3
XxlJobConfig.java
app/src/main/java/com/yiring/app/config/XxlJobConfig.java
+61
-0
Broadcast.java
.../main/java/com/yiring/app/domain/broadcast/Broadcast.java
+73
-0
BroadcastAudio.java
.../java/com/yiring/app/domain/broadcast/BroadcastAudio.java
+51
-0
BroadcastAudioRepository.java
...yiring/app/domain/broadcast/BroadcastAudioRepository.java
+17
-0
BroadcastRepository.java
.../com/yiring/app/domain/broadcast/BroadcastRepository.java
+15
-0
Icon.java
app/src/main/java/com/yiring/app/domain/icon/Icon.java
+67
-0
IconRepository.java
.../main/java/com/yiring/app/domain/icon/IconRepository.java
+14
-0
KeyAlarm.java
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
+42
-1
KeyAlarmRepository.java
...in/java/com/yiring/app/domain/key/KeyAlarmRepository.java
+16
-0
LocationBeacon.java
...n/java/com/yiring/app/domain/location/LocationBeacon.java
+0
-18
LocationLog.java
...main/java/com/yiring/app/domain/location/LocationLog.java
+17
-30
LocationLogRepository.java
...com/yiring/app/domain/location/LocationLogRepository.java
+1
-2
LocationTag.java
...main/java/com/yiring/app/domain/location/LocationTag.java
+5
-10
TagTimeId.java
...c/main/java/com/yiring/app/domain/location/TagTimeId.java
+47
-0
ZyRealtimeLog.java
...rc/main/java/com/yiring/app/domain/log/ZyRealtimeLog.java
+6
-4
Invitation.java
...c/main/java/com/yiring/app/domain/visitor/Invitation.java
+18
-3
InvitationRepository.java
...a/com/yiring/app/domain/visitor/InvitationRepository.java
+13
-1
Visitor.java
app/src/main/java/com/yiring/app/domain/visitor/Visitor.java
+16
-2
VisitorRepository.java
...java/com/yiring/app/domain/visitor/VisitorRepository.java
+9
-0
BroadcastExportExcel.java
.../com/yiring/app/excel/broadcast/BroadcastExportExcel.java
+45
-0
BroadcastImportExcel.java
.../com/yiring/app/excel/broadcast/BroadcastImportExcel.java
+44
-0
DepartmentExportExcel.java
...java/com/yiring/app/excel/dept/DepartmentExportExcel.java
+5
-5
LocationBeaconExportExcel.java
.../app/excel/location/beacon/LocationBeaconExportExcel.java
+14
-2
LocationTagImportExcel.java
...yiring/app/excel/location/tag/LocationTagImportExcel.java
+1
-1
PostExportExcel.java
.../main/java/com/yiring/app/excel/post/PostExportExcel.java
+4
-4
UserExportExcel.java
.../main/java/com/yiring/app/excel/user/UserExportExcel.java
+4
-5
UserSendCardExcel.java
...ain/java/com/yiring/app/excel/user/UserSendCardExcel.java
+38
-0
VideoExportExcel.java
...ain/java/com/yiring/app/excel/video/VideoExportExcel.java
+5
-3
InvitationExportExcel.java
...a/com/yiring/app/excel/visitor/InvitationExportExcel.java
+2
-2
WxClient.java
app/src/main/java/com/yiring/app/feign/WxClient.java
+7
-11
LocationBeaconClient.java
...ng/app/feign/zy/location/beacon/LocationBeaconClient.java
+1
-1
UserClient.java
...rc/main/java/com/yiring/app/feign/zy/user/UserClient.java
+4
-4
MockZyMessageJob.java
app/src/main/java/com/yiring/app/job/MockZyMessageJob.java
+148
-0
AppletUserParam.java
...in/java/com/yiring/app/param/appUser/AppletUserParam.java
+36
-0
AppletUserQueryParam.java
...va/com/yiring/app/param/appUser/AppletUserQueryParam.java
+39
-0
BroadcastAudioAddParam.java
...om/yiring/app/param/broadcast/BroadcastAudioAddParam.java
+45
-0
BroadcastAudioFindParam.java
...m/yiring/app/param/broadcast/BroadcastAudioFindParam.java
+31
-0
BroadcastAudioModifyParam.java
...yiring/app/param/broadcast/BroadcastAudioModifyParam.java
+45
-0
BroadcastParam.java
...n/java/com/yiring/app/param/broadcast/BroadcastParam.java
+55
-0
BroadcastQueryParam.java
...a/com/yiring/app/param/broadcast/BroadcastQueryParam.java
+42
-0
DepartmentModifyParam.java
...java/com/yiring/app/param/dept/DepartmentModifyParam.java
+4
-0
IconParam.java
app/src/main/java/com/yiring/app/param/icon/IconParam.java
+46
-0
KeyAlarmFindParam.java
...main/java/com/yiring/app/param/key/KeyAlarmFindParam.java
+44
-0
KeyAlarmRulesAddParam.java
.../java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
+2
-1
LocationTagExportParam.java
...yiring/app/param/location/tag/LocationTagExportParam.java
+1
-1
LocationTagFindParam.java
...m/yiring/app/param/location/tag/LocationTagFindParam.java
+3
-0
LocationTagTypeFindParam.java
...ring/app/param/location/tag/LocationTagTypeFindParam.java
+1
-1
LocationTagTypeSendParam.java
...ring/app/param/location/tag/LocationTagTypeSendParam.java
+2
-2
InvitationAppQueryParam.java
...com/yiring/app/param/visitor/InvitationAppQueryParam.java
+38
-0
InvitationParam.java
...in/java/com/yiring/app/param/visitor/InvitationParam.java
+1
-1
InvitationQueryParam.java
...va/com/yiring/app/param/visitor/InvitationQueryParam.java
+4
-4
VisitorAppQueryParam.java
...va/com/yiring/app/param/visitor/VisitorAppQueryParam.java
+36
-0
VisitorParam.java
.../main/java/com/yiring/app/param/visitor/VisitorParam.java
+1
-0
VisitorQueryParam.java
.../java/com/yiring/app/param/visitor/VisitorQueryParam.java
+4
-2
ZyLocationTagTypeSendParam.java
...app/param/zy/location/tag/ZyLocationTagTypeSendParam.java
+2
-2
ZyUserFindParam.java
...in/java/com/yiring/app/param/zy/user/ZyUserFindParam.java
+1
-1
MockZyRabbitConfig.java
...java/com/yiring/app/rabbit/config/MockZyRabbitConfig.java
+48
-0
RabbitConfig.java
.../main/java/com/yiring/app/rabbit/config/RabbitConfig.java
+7
-2
ZyRabbitConfig.java
...ain/java/com/yiring/app/rabbit/config/ZyRabbitConfig.java
+7
-0
ZyRabbitReceiver.java
...java/com/yiring/app/rabbit/receiver/ZyRabbitReceiver.java
+9
-177
AppletUserService.java
.../com/yiring/app/service/appletUser/AppletUserService.java
+14
-6
AppletUserServiceImpl.java
...ng/app/service/appletUser/impl/AppletUserServiceImpl.java
+30
-3
BroadcastAudioService.java
...m/yiring/app/service/broadcast/BroadcastAudioService.java
+58
-0
BroadcastService.java
...va/com/yiring/app/service/broadcast/BroadcastService.java
+88
-0
BroadcastAudioServiceImpl.java
...app/service/broadcast/impl/BroadcastAudioServiceImpl.java
+125
-0
BroadcastServiceImpl.java
...ring/app/service/broadcast/impl/BroadcastServiceImpl.java
+314
-0
DepartmentServiceImpl.java
...m/yiring/app/service/dept/impl/DepartmentServiceImpl.java
+9
-7
IconService.java
...rc/main/java/com/yiring/app/service/icon/IconService.java
+49
-0
IconServiceImpl.java
...ava/com/yiring/app/service/icon/impl/IconServiceImpl.java
+97
-0
KeyAlarmService.java
...main/java/com/yiring/app/service/key/KeyAlarmService.java
+24
-0
KeyAlarmServiceImpl.java
.../com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
+122
-0
LocationBeaconServiceImpl.java
...rvice/location/beacon/impl/LocationBeaconServiceImpl.java
+8
-3
LocationTagServiceImpl.java
...app/service/location/tag/impl/LocationTagServiceImpl.java
+21
-7
LocationTagTypeServiceImpl.java
...service/location/tag/impl/LocationTagTypeServiceImpl.java
+7
-6
ZyMessageService.java
...java/com/yiring/app/service/message/ZyMessageService.java
+17
-0
ZyMessageServiceImpl.java
...yiring/app/service/message/impl/ZyMessageServiceImpl.java
+200
-0
PostServiceImpl.java
...ava/com/yiring/app/service/post/impl/PostServiceImpl.java
+7
-4
UserAppService.java
...main/java/com/yiring/app/service/user/UserAppService.java
+10
-3
UserAppServiceImpl.java
.../com/yiring/app/service/user/impl/UserAppServiceImpl.java
+99
-22
VideoServiceImpl.java
...a/com/yiring/app/service/video/impl/VideoServiceImpl.java
+4
-2
InvitationService.java
...ava/com/yiring/app/service/visitor/InvitationService.java
+23
-2
VisitorService.java
...n/java/com/yiring/app/service/visitor/VisitorService.java
+9
-6
InvitationServiceImpl.java
...iring/app/service/visitor/impl/InvitationServiceImpl.java
+168
-25
VisitorServiceImpl.java
...m/yiring/app/service/visitor/impl/VisitorServiceImpl.java
+118
-39
GeoUtils.java
app/src/main/java/com/yiring/app/util/GeoUtils.java
+57
-0
TimeIdGenerator.java
app/src/main/java/com/yiring/app/util/TimeIdGenerator.java
+23
-0
LonLatUtil.java
app/src/main/java/com/yiring/app/util/zy/LonLatUtil.java
+119
-0
BroadcastAudioIndexVo.java
...va/com/yiring/app/vo/broadcast/BroadcastAudioIndexVo.java
+50
-0
BroadcastAudioVo.java
...in/java/com/yiring/app/vo/broadcast/BroadcastAudioVo.java
+59
-0
BroadcastVo.java
...rc/main/java/com/yiring/app/vo/broadcast/BroadcastVo.java
+49
-0
BroadcastjcVo.java
.../main/java/com/yiring/app/vo/broadcast/BroadcastjcVo.java
+36
-0
IconVo.java
app/src/main/java/com/yiring/app/vo/icon/IconVo.java
+17
-0
KeyAlarmRulesVo.java
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
+3
-2
KeyAlarmVo.java
app/src/main/java/com/yiring/app/vo/key/KeyAlarmVo.java
+70
-0
LocationBeaconVo.java
...a/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
+5
-0
LocationTagTypeVo.java
...ava/com/yiring/app/vo/location/tag/LocationTagTypeVo.java
+4
-3
InvitationDetailsVo.java
...n/java/com/yiring/app/vo/visitor/InvitationDetailsVo.java
+81
-0
InvitationVo.java
...src/main/java/com/yiring/app/vo/visitor/InvitationVo.java
+24
-0
VisitorAppVo.java
...src/main/java/com/yiring/app/vo/visitor/VisitorAppVo.java
+57
-0
VisitorDetailsVo.java
...main/java/com/yiring/app/vo/visitor/VisitorDetailsVo.java
+30
-3
VisitorVo.java
app/src/main/java/com/yiring/app/vo/visitor/VisitorVo.java
+36
-17
HelloController.java
app/src/main/java/com/yiring/app/web/HelloController.java
+14
-0
AppletUserController.java
...java/com/yiring/app/web/appUser/AppletUserController.java
+46
-0
BroadcastAudioController.java
...om/yiring/app/web/broadcast/BroadcastAudioController.java
+73
-0
BroadcastController.java
...ava/com/yiring/app/web/broadcast/BroadcastController.java
+94
-0
DepartmentController.java
...in/java/com/yiring/app/web/dept/DepartmentController.java
+1
-1
IconController.java
...src/main/java/com/yiring/app/web/icon/IconController.java
+61
-0
KeyAlarmController.java
.../main/java/com/yiring/app/web/key/KeyAlarmController.java
+41
-0
UserAppController.java
.../main/java/com/yiring/app/web/user/UserAppController.java
+10
-4
VideoController.java
...c/main/java/com/yiring/app/web/video/VideoController.java
+1
-1
InvitationController.java
...java/com/yiring/app/web/visitor/InvitationController.java
+15
-2
VisitorController.java
...in/java/com/yiring/app/web/visitor/VisitorController.java
+10
-1
application-dev.yml
app/src/main/resources/application-dev.yml
+38
-18
application.yml
app/src/main/resources/application.yml
+1
-5
UserFindParam.java
...c/main/java/com/yiring/auth/param/user/UserFindParam.java
+37
-0
UserSaveParam.java
...c/main/java/com/yiring/auth/param/user/UserSaveParam.java
+106
-0
UserService.java
...c/main/java/com/yiring/auth/service/user/UserService.java
+32
-0
UserServiceImpl.java
...va/com/yiring/auth/service/user/impl/UserServiceImpl.java
+90
-0
UserVo.java
basic-auth/src/main/java/com/yiring/auth/vo/user/UserVo.java
+35
-22
UserController.java
...rc/main/java/com/yiring/auth/web/user/UserController.java
+16
-5
build.gradle
basic-common/core/build.gradle
+1
-6
BasicEntity.java
...e/src/main/java/com/yiring/common/domain/BasicEntity.java
+0
-15
Times.java
...til/src/main/java/com/yiring/common/annotation/Times.java
+23
-0
RequestAspect.java
...src/main/java/com/yiring/common/aspect/RequestAspect.java
+6
-3
TimesAspect.java
...l/src/main/java/com/yiring/common/aspect/TimesAspect.java
+67
-0
build.gradle
build.gradle
+10
-4
没有找到文件。
.gitignore
浏览文件 @
c28135da
...
@@ -38,3 +38,4 @@ out/
...
@@ -38,3 +38,4 @@ out/
node_modules
node_modules
logs/
logs/
.jpb/
README.md
浏览文件 @
c28135da
...
@@ -29,9 +29,8 @@
...
@@ -29,9 +29,8 @@
-
[
x
]
[
conventional-changelog
]
(https://www.cnblogs.com/mengfangui/p/12634845.html)
-
[
x
]
[
conventional-changelog
]
(https://www.cnblogs.com/mengfangui/p/12634845.html)
-
[
x
]
用户及权限模块(目录/菜单/按钮),预览初始化权限配置
[
SQL 脚本
](
./basic-auth/src/main/resources/init-test-mysql.sql
)
-
[
x
]
用户及权限模块(目录/菜单/按钮),预览初始化权限配置
[
SQL 脚本
](
./basic-auth/src/main/resources/init-test-mysql.sql
)
-
[
x
]
通用文件上传模块
-
[
x
]
通用文件上传模块
-
[
]
通用字典管理模块
-
[
x
]
通用字典管理模块
-
[
]
XXL-JOB 定时任务模块
-
[
x
]
XXL-JOB 定时任务模块
-
[
x
]
@Convert 处理 Raw JSON 数据格式转换
-
[
]
扩展 PostgresDialect 实现时序查询函数
-
[
]
扩展 PostgresDialect 实现时序查询函数
---
---
...
...
app/build.gradle
浏览文件 @
c28135da
...
@@ -13,6 +13,8 @@ dependencies {
...
@@ -13,6 +13,8 @@ dependencies {
implementation
'org.springframework.boot:spring-boot-starter-amqp'
implementation
'org.springframework.boot:spring-boot-starter-amqp'
implementation
"org.springframework.boot:spring-boot-starter-websocket"
implementation
"org.springframework.boot:spring-boot-starter-websocket"
implementation
"org.springframework.boot:spring-boot-starter-reactor-netty"
implementation
"org.springframework.boot:spring-boot-starter-reactor-netty"
implementation
"org.springframework.cloud:spring-cloud-starter-openfeign"
implementation
"org.springframework.cloud:spring-cloud-commons"
// 💬 Mock/Test Env
// 💬 Mock/Test Env
runtimeOnly
'com.h2database:h2'
runtimeOnly
'com.h2database:h2'
// 💬 Prod/Dev Env
// 💬 Prod/Dev Env
...
@@ -70,10 +72,10 @@ dependencies {
...
@@ -70,10 +72,10 @@ dependencies {
// myexcel
// myexcel
implementation
"com.github.liaochong:myexcel:${myexcelVersion}"
implementation
"com.github.liaochong:myexcel:${myexcelVersion}"
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
implementation
"org.springframework.cloud:spring-cloud-starter-openfeign:${openfeignVersion}"
// feign-okhttp
// feign-okhttp
implementation
"io.github.openfeign:feign-okhttp:${feignOkhttpVersion}"
implementation
"io.github.openfeign:feign-okhttp:${feignOkhttpVersion}"
// xxl-job
implementation
"com.xuxueli:xxl-job-core:${xxlJobVersion}"
}
}
app/src/main/java/com/yiring/app/config/XxlJobConfig.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
config
;
import
cn.hutool.core.util.StrUtil
;
import
com.xxl.job.core.executor.impl.XxlJobSpringExecutor
;
import
javax.annotation.Resource
;
import
lombok.AccessLevel
;
import
lombok.Data
;
import
lombok.experimental.FieldDefaults
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.cloud.commons.util.InetUtils
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* xxl-job 配置
*/
@Slf4j
@Data
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Configuration
@ConfigurationProperties
(
prefix
=
"xxl.job"
)
public
class
XxlJobConfig
{
@Resource
InetUtils
inetUtils
;
String
adminAddresses
;
String
accessToken
;
String
executorAppName
;
String
executorAddress
;
String
executorIp
;
Integer
executorPort
=
9999
;
String
executorLogPath
;
Integer
executorLogRetentionDays
=
30
;
@Bean
public
XxlJobSpringExecutor
xxlJobExecutor
()
{
log
.
info
(
">>>>>>>>>>> xxl-job init: {}"
,
adminAddresses
);
if
(
StrUtil
.
isBlank
(
executorIp
))
{
executorIp
=
inetUtils
.
findFirstNonLoopbackAddress
().
getHostAddress
();
}
if
(
StrUtil
.
isBlank
(
executorAddress
))
{
executorAddress
=
"http://"
+
executorIp
+
":"
+
executorPort
;
}
XxlJobSpringExecutor
xxlJobSpringExecutor
=
new
XxlJobSpringExecutor
();
xxlJobSpringExecutor
.
setAdminAddresses
(
adminAddresses
);
xxlJobSpringExecutor
.
setAppname
(
executorAppName
);
xxlJobSpringExecutor
.
setAddress
(
executorAddress
);
xxlJobSpringExecutor
.
setIp
(
executorIp
);
xxlJobSpringExecutor
.
setPort
(
executorPort
);
xxlJobSpringExecutor
.
setAccessToken
(
accessToken
);
xxlJobSpringExecutor
.
setLogPath
(
executorLogPath
);
xxlJobSpringExecutor
.
setLogRetentionDays
(
executorLogRetentionDays
);
return
xxlJobSpringExecutor
;
}
}
app/src/main/java/com/yiring/app/domain/broadcast/Broadcast.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
broadcast
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.annotations.UpdateTimestamp
;
import
org.hibernate.snowflake.SnowflakeId
;
import
org.locationtech.jts.geom.Point
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:06
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@Comment
(
"播报设备表"
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_BROADCAST"
)
public
class
Broadcast
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2856845594409003209L
;
@Comment
(
"编号"
)
@Id
@GeneratedValue
(
generator
=
SnowflakeId
.
GENERATOR
)
@GenericGenerator
(
name
=
SnowflakeId
.
GENERATOR
,
strategy
=
SnowflakeId
.
Strategy
.
LONG
)
Long
id
;
@Comment
(
"播报设备编号"
)
String
broadcastNum
;
@Comment
(
"播报设备名称"
)
String
broadcastName
;
@Comment
(
"坐标点信息"
)
Point
point
;
@Comment
(
"播报设备地址"
)
String
broadcastAdd
;
@Comment
(
"备注"
)
String
remark
;
@Comment
(
"是否启用"
)
String
status
;
@Comment
(
"创建时间"
)
@CreationTimestamp
LocalDateTime
createTime
;
@Comment
(
"修改时间"
)
@UpdateTimestamp
LocalDateTime
updateTime
;
}
app/src/main/java/com/yiring/app/domain/broadcast/BroadcastAudio.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
broadcast
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.CreationTimestamp
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_BROADCAST_AUDIO"
)
@Comment
(
"播报语音"
)
public
class
BroadcastAudio
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
7232247536987652847L
;
@Comment
(
"语音名称"
)
String
name
;
@Comment
(
"语音地址"
)
String
uri
;
@Comment
(
"上传时间"
)
@CreationTimestamp
LocalDateTime
uploadTime
;
@Comment
(
"备注"
)
String
describe
;
}
app/src/main/java/com/yiring/app/domain/broadcast/BroadcastAudioRepository.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
broadcast
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@Repository
public
interface
BroadcastAudioRepository
extends
JpaRepository
<
BroadcastAudio
,
Serializable
>,
JpaSpecificationExecutor
<
BroadcastAudio
>
{}
app/src/main/java/com/yiring/app/domain/broadcast/BroadcastRepository.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
broadcast
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
/**
* @author tzl
* 2022/5/5 17:13
*/
@Repository
public
interface
BroadcastRepository
extends
JpaRepository
<
Broadcast
,
Serializable
>,
JpaSpecificationExecutor
<
Broadcast
>
{}
app/src/main/java/com/yiring/app/domain/icon/Icon.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
icon
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.snowflake.SnowflakeId
;
/**
*
* @author tzl
* @version 1.0
* @description: 图标
* @date 2022/4/29 11:08
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_ICON"
)
@Comment
(
"图标"
)
public
class
Icon
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
7848846860889883431L
;
@Comment
(
"编号"
)
@Id
@GeneratedValue
(
generator
=
SnowflakeId
.
GENERATOR
)
@GenericGenerator
(
name
=
SnowflakeId
.
GENERATOR
,
strategy
=
SnowflakeId
.
Strategy
.
LONG
)
Long
id
;
@Comment
(
"图标名称"
)
String
iconName
;
@Comment
(
"图标类型"
)
String
iconType
;
@Comment
(
"图标分类"
)
String
iconSort
;
@Comment
(
"在线图标"
)
String
iconOnline
;
@Comment
(
"离线图标"
)
String
iconOffline
;
@Comment
(
"创建时间"
)
LocalDateTime
createTime
;
@Comment
(
"修改时间"
)
LocalDateTime
updateTime
;
}
app/src/main/java/com/yiring/app/domain/icon/IconRepository.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
icon
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
/**
* @author tzl
* 2022/4/29 13:49
*/
@Repository
public
interface
IconRepository
extends
JpaRepository
<
Icon
,
Serializable
>,
JpaSpecificationExecutor
<
Icon
>
{}
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
package
com
.
yiring
.
app
.
domain
.
key
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
/**
/**
*
*
*
*
...
@@ -8,4 +22,31 @@ package com.yiring.app.domain.key;
...
@@ -8,4 +22,31 @@ package com.yiring.app.domain.key;
* @date 2022/5/6
* @date 2022/5/6
*/
*/
public
class
KeyAlarm
{}
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_KEY_ALARM"
)
@Comment
(
"按键报警规则"
)
public
class
KeyAlarm
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
6050505164664867107L
;
@Comment
(
"地图 ID"
)
Long
areaId
;
@ManyToOne
@JoinColumn
(
name
=
"leader_id"
)
@JsonIgnore
@Comment
(
"负责人"
)
User
leader
;
@Comment
(
"报警状态"
)
Boolean
enable
;
}
app/src/main/java/com/yiring/app/domain/key/KeyAlarmRepository.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
/**
*
* @author LJ-2204
* @date 2022/5/6
*/
@Repository
public
interface
KeyAlarmRepository
extends
JpaRepository
<
KeyAlarm
,
Serializable
>,
JpaSpecificationExecutor
<
KeyAlarm
>
{}
app/src/main/java/com/yiring/app/domain/location/LocationBeacon.java
浏览文件 @
c28135da
...
@@ -8,16 +8,13 @@ import java.io.Serializable;
...
@@ -8,16 +8,13 @@ import java.io.Serializable;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.Set
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.SuperBuilder
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.Hibernate
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Type
;
import
org.locationtech.jts.geom.Point
;
import
org.locationtech.jts.geom.Point
;
/**
/**
...
@@ -83,8 +80,6 @@ public class LocationBeacon extends BasicEntity implements Serializable {
...
@@ -83,8 +80,6 @@ public class LocationBeacon extends BasicEntity implements Serializable {
Double
distance
;
Double
distance
;
@Comment
(
"坐标点信息"
)
@Comment
(
"坐标点信息"
)
@Type
(
type
=
"jts_geometry"
)
@Column
(
columnDefinition
=
"point"
)
Point
point
;
Point
point
;
@FieldMapping
@FieldMapping
...
@@ -103,17 +98,4 @@ public class LocationBeacon extends BasicEntity implements Serializable {
...
@@ -103,17 +98,4 @@ public class LocationBeacon extends BasicEntity implements Serializable {
@ManyToMany
@ManyToMany
@ToString
.
Exclude
@ToString
.
Exclude
Set
<
LocationFence
>
fences
=
new
HashSet
<>(
0
);
Set
<
LocationFence
>
fences
=
new
HashSet
<>(
0
);
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
Hibernate
.
getClass
(
this
)
!=
Hibernate
.
getClass
(
o
))
return
false
;
LocationBeacon
that
=
(
LocationBeacon
)
o
;
return
getId
()
!=
null
&&
Objects
.
equals
(
getId
(),
that
.
getId
());
}
@Override
public
int
hashCode
()
{
return
getClass
().
hashCode
();
}
}
}
app/src/main/java/com/yiring/app/domain/location/LocationLog.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
location
;
package
com
.
yiring
.
app
.
domain
.
location
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.vladmihalcea.hibernate.type.json.JsonType
;
import
com.vladmihalcea.hibernate.type.json.Json
Binary
Type
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.HashSet
;
import
java.util.Set
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.Type
;
import
org.hibernate.annotations.Type
;
import
org.hibernate.annotations.TypeDef
;
import
org.hibernate.annotations.TypeDef
;
import
org.locationtech.jts.geom.Point
;
import
org.locationtech.jts.geom.Point
;
...
@@ -40,19 +38,17 @@ import org.locationtech.jts.geom.Point;
...
@@ -40,19 +38,17 @@ import org.locationtech.jts.geom.Point;
@FieldNameConstants
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Entity
@TypeDef
(
name
=
"json
"
,
typeClass
=
Json
Type
.
class
)
@TypeDef
(
name
=
"json
b"
,
typeClass
=
JsonBinary
Type
.
class
)
@Table
(
name
=
"BS_LOCATION_LOG"
)
@Table
(
name
=
"BS_LOCATION_LOG"
,
indexes
=
{
@Index
(
name
=
"idx_time"
,
columnList
=
"time"
)
}
)
@Comment
(
"定位数据"
)
@Comment
(
"定位数据"
)
public
class
LocationLog
implements
Serializable
{
public
class
LocationLog
implements
Serializable
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
3467455881020691989L
;
private
static
final
long
serialVersionUID
=
3467455881020691989L
;
@Id
@Comment
(
"定位标签时序复合主键"
)
@Comment
(
"时间"
)
@EmbeddedId
@Column
(
nullable
=
false
,
columnDefinition
=
"timestamp without time zone"
)
TagTimeId
id
;
@CreationTimestamp
LocalDateTime
time
;
@Comment
(
"地图 ID"
)
@Comment
(
"地图 ID"
)
Long
areaId
;
Long
areaId
;
...
@@ -64,7 +60,7 @@ public class LocationLog implements Serializable {
...
@@ -64,7 +60,7 @@ public class LocationLog implements Serializable {
* 来源于定位数据产生时刻标签所属的人员
* 来源于定位数据产生时刻标签所属的人员
*/
*/
@Comment
(
"用户"
)
@Comment
(
"用户"
)
@ManyToOne
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JoinColumn
(
name
=
"user_id"
)
@JoinColumn
(
name
=
"user_id"
)
User
user
;
User
user
;
...
@@ -72,29 +68,20 @@ public class LocationLog implements Serializable {
...
@@ -72,29 +68,20 @@ public class LocationLog implements Serializable {
* 来源于定位标签定位时刻的人员状态
* 来源于定位标签定位时刻的人员状态
*/
*/
@Comment
(
"用户状态"
)
@Comment
(
"用户状态"
)
String
status
;
User
.
Status
status
;
@Comment
(
"标签"
)
@ManyToOne
@JoinColumn
(
name
=
"tag_id"
)
LocationTag
tag
;
@Comment
(
"坐标点信息"
)
@Comment
(
"坐标点信息"
)
@Type
(
type
=
"jts_geometry"
)
@Column
(
columnDefinition
=
"point"
)
Point
point
;
Point
point
;
@Comment
(
"信标集合"
)
@Comment
(
"信标集合"
)
@Builder
.
Default
@Type
(
type
=
"jsonb"
)
@OneToMany
@Column
(
columnDefinition
=
"jsonb"
)
@ToString
.
Exclude
JSONArray
beacons
;
Set
<
LocationBeacon
>
beacons
=
new
HashSet
<>(
0
);
@Comment
(
"围栏集合"
)
@Comment
(
"围栏集合"
)
@Builder
.
Default
@Type
(
type
=
"jsonb"
)
@OneToMany
@Column
(
columnDefinition
=
"jsonb"
)
@ToString
.
Exclude
JSONArray
fences
;
Set
<
LocationFence
>
fences
=
new
HashSet
<>(
0
);
@Comment
(
"静止/运动"
)
@Comment
(
"静止/运动"
)
Boolean
silent
;
Boolean
silent
;
...
@@ -106,8 +93,8 @@ public class LocationLog implements Serializable {
...
@@ -106,8 +93,8 @@ public class LocationLog implements Serializable {
String
voltUnit
;
String
voltUnit
;
@Comment
(
"原始数据"
)
@Comment
(
"原始数据"
)
@
org
.
hibernate
.
annotations
.
Type
(
type
=
"json
"
)
@
Type
(
type
=
"jsonb
"
)
@Column
(
columnDefinition
=
"json"
)
@Column
(
columnDefinition
=
"json
b
"
)
JSONObject
raw
;
JSONObject
raw
;
@Comment
(
"定位时间"
)
@Comment
(
"定位时间"
)
...
...
app/src/main/java/com/yiring/app/domain/location/LocationLogRepository.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
location
;
package
com
.
yiring
.
app
.
domain
.
location
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -14,4 +13,4 @@ import org.springframework.stereotype.Repository;
...
@@ -14,4 +13,4 @@ import org.springframework.stereotype.Repository;
@Repository
@Repository
public
interface
LocationLogRepository
public
interface
LocationLogRepository
extends
JpaRepository
<
LocationLog
,
Serializable
>,
JpaSpecificationExecutor
<
LocationLog
>
{}
extends
JpaRepository
<
LocationLog
,
TagTimeId
>,
JpaSpecificationExecutor
<
LocationLog
>
{}
app/src/main/java/com/yiring/app/domain/location/LocationTag.java
浏览文件 @
c28135da
...
@@ -6,7 +6,6 @@ import com.yiring.common.annotation.FieldMapping;
...
@@ -6,7 +6,6 @@ import com.yiring.common.annotation.FieldMapping;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Objects
;
import
java.util.Objects
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.*
;
...
@@ -15,6 +14,7 @@ import lombok.experimental.FieldNameConstants;
...
@@ -15,6 +14,7 @@ import lombok.experimental.FieldNameConstants;
import
lombok.experimental.SuperBuilder
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.Hibernate
;
import
org.hibernate.Hibernate
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.locationtech.jts.geom.Point
;
/**
/**
* 定位标签
* 定位标签
...
@@ -82,8 +82,7 @@ public class LocationTag extends BasicEntity implements Serializable {
...
@@ -82,8 +82,7 @@ public class LocationTag extends BasicEntity implements Serializable {
@Comment
(
"静止/运动"
)
@Comment
(
"静止/运动"
)
Boolean
silent
;
Boolean
silent
;
@OneToOne
@ManyToOne
@JoinColumn
(
name
=
"user_id"
)
@Comment
(
"绑定用户"
)
@Comment
(
"绑定用户"
)
User
user
;
User
user
;
...
@@ -100,15 +99,11 @@ public class LocationTag extends BasicEntity implements Serializable {
...
@@ -100,15 +99,11 @@ public class LocationTag extends BasicEntity implements Serializable {
String
voltUnit
;
String
voltUnit
;
@FieldMapping
@FieldMapping
@Comment
(
"类型(1:内部/2:访客
/3:承包商
)"
)
@Comment
(
"类型(1:内部/2:访客)"
)
Integer
category
;
Integer
category
;
@FieldMapping
(
value
=
"raiseTimestamp"
,
desc
=
"更新时间戳"
,
type
=
Long
.
class
)
@Comment
(
"最后定位坐标"
)
@Comment
(
"更新时间"
)
Point
point
;
LocalDateTime
updateTime
;
@Comment
(
"创建时间"
)
LocalDateTime
createTime
;
@SuppressWarnings
({
"unused"
})
@SuppressWarnings
({
"unused"
})
public
enum
Type
{
public
enum
Type
{
...
...
app/src/main/java/com/yiring/app/domain/location/TagTimeId.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
location
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
javax.persistence.Column
;
import
javax.persistence.Embeddable
;
import
javax.persistence.FetchType
;
import
javax.persistence.OneToOne
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
/**
* 定位标签时序联合主键
* @author Jim
* @version 0.1
* 2022/5/10 10:24
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Embeddable
public
class
TagTimeId
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
5254861902659471641L
;
@Comment
(
"定位标签"
)
@OneToOne
(
fetch
=
FetchType
.
LAZY
)
LocationTag
tag
;
@Comment
(
"定位时间"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"timestamp without time zone"
)
LocalDateTime
time
;
public
TagTimeId
(
LocationTag
tag
)
{
this
.
tag
=
tag
;
this
.
time
=
LocalDateTime
.
now
();
}
}
app/src/main/java/com/yiring/app/domain/log/ZyRealtimeLog.java
浏览文件 @
c28135da
...
@@ -11,7 +11,8 @@ import lombok.*;
...
@@ -11,7 +11,8 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.annotations.Type
;
import
org.hibernate.annotations.TypeDef
;
import
org.hibernate.annotations.TypeDef
;
/**
/**
...
@@ -45,10 +46,11 @@ public class ZyRealtimeLog implements Serializable {
...
@@ -45,10 +46,11 @@ public class ZyRealtimeLog implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
5545864821082386L
;
private
static
final
long
serialVersionUID
=
5545864821082386L
;
@Id
@Comment
(
"时间"
)
@Comment
(
"时间"
)
@Id
@GeneratedValue
(
generator
=
"time-id"
)
@GenericGenerator
(
name
=
"time-id"
,
strategy
=
"com.yiring.app.util.TimeIdGenerator"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"timestamp without time zone"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"timestamp without time zone"
)
@CreationTimestamp
LocalDateTime
time
;
LocalDateTime
time
;
@Comment
(
"类型"
)
@Comment
(
"类型"
)
...
@@ -56,7 +58,7 @@ public class ZyRealtimeLog implements Serializable {
...
@@ -56,7 +58,7 @@ public class ZyRealtimeLog implements Serializable {
String
method
;
String
method
;
@Comment
(
"内容"
)
@Comment
(
"内容"
)
@
org
.
hibernate
.
annotations
.
Type
(
type
=
"jsonb"
)
@Type
(
type
=
"jsonb"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"jsonb"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"jsonb"
)
JSONObject
raw
;
JSONObject
raw
;
}
}
app/src/main/java/com/yiring/app/domain/visitor/Invitation.java
浏览文件 @
c28135da
...
@@ -3,6 +3,7 @@ package com.yiring.app.domain.visitor;
...
@@ -3,6 +3,7 @@ package com.yiring.app.domain.visitor;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.yiring.auth.domain.user.User
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -11,6 +12,8 @@ import lombok.*;
...
@@ -11,6 +12,8 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.snowflake.SnowflakeId
;
import
org.hibernate.snowflake.SnowflakeId
;
...
@@ -31,6 +34,8 @@ import org.hibernate.snowflake.SnowflakeId;
...
@@ -31,6 +34,8 @@ import org.hibernate.snowflake.SnowflakeId;
@FieldNameConstants
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"BS_INVITATION"
)
@Table
(
name
=
"BS_INVITATION"
)
@Comment
(
"邀请信息"
)
@Comment
(
"邀请信息"
)
public
class
Invitation
implements
Serializable
{
public
class
Invitation
implements
Serializable
{
...
@@ -50,8 +55,8 @@ public class Invitation implements Serializable {
...
@@ -50,8 +55,8 @@ public class Invitation implements Serializable {
@Comment
(
"状态"
)
@Comment
(
"状态"
)
String
status
;
String
status
;
@Comment
(
"邀请人id"
)
//
@Comment("邀请人id")
Long
inviterId
;
//
Long inviterId;
@Comment
(
"邀请人数"
)
@Comment
(
"邀请人数"
)
Integer
numOfVisitor
;
Integer
numOfVisitor
;
...
@@ -60,12 +65,22 @@ public class Invitation implements Serializable {
...
@@ -60,12 +65,22 @@ public class Invitation implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
LocalDateTime
createTime
;
LocalDateTime
createTime
;
@Comment
(
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
LocalDateTime
updateTime
;
// @Comment("访客id")
// @Comment("访客id")
// Long visitorId;
// Long visitorId;
@Comment
(
"被邀请访客"
)
@Comment
(
"被邀请访客"
)
@JsonIgnore
@JsonIgnore
@OneToOne
@OneToOne
(
cascade
=
CascadeType
.
REMOVE
)
@JoinColumn
(
name
=
"visitor_id"
,
referencedColumnName
=
"id"
)
@JoinColumn
(
name
=
"visitor_id"
,
referencedColumnName
=
"id"
)
Visitor
visitor
;
Visitor
visitor
;
@Comment
(
"邀请人"
)
@JsonIgnore
@OneToOne
@JoinColumn
(
name
=
"inviter_id"
,
referencedColumnName
=
"id"
)
User
user
;
}
}
app/src/main/java/com/yiring/app/domain/visitor/InvitationRepository.java
浏览文件 @
c28135da
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
package
com
.
yiring
.
app
.
domain
.
visitor
;
package
com
.
yiring
.
app
.
domain
.
visitor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -12,4 +14,14 @@ import org.springframework.stereotype.Repository;
...
@@ -12,4 +14,14 @@ import org.springframework.stereotype.Repository;
*/
*/
@Repository
@Repository
public
interface
InvitationRepository
public
interface
InvitationRepository
extends
JpaRepository
<
Invitation
,
Serializable
>,
JpaSpecificationExecutor
<
Invitation
>
{}
extends
JpaRepository
<
Invitation
,
Serializable
>,
JpaSpecificationExecutor
<
Invitation
>
{
/**
* 小程序用户查看邀请信息
* @author tzl
* @date 2022/4/28 11:08
* @param mobile 手机
* @param deleted 是否删除
* @return java.util.List<com.yiring.app.domain.visitor.Invitation>
*/
Page
<
Invitation
>
findAllByVisitor_VisitorMobileAndVisitor_Deleted
(
String
mobile
,
String
deleted
,
Pageable
pageable
);
}
app/src/main/java/com/yiring/app/domain/visitor/Visitor.java
浏览文件 @
c28135da
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
domain
.
visitor
;
package
com
.
yiring
.
app
.
domain
.
visitor
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yiring.auth.domain.user.User
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -70,8 +71,8 @@ public class Visitor implements Serializable {
...
@@ -70,8 +71,8 @@ public class Visitor implements Serializable {
@Comment
(
"所属单位id"
)
@Comment
(
"所属单位id"
)
String
orgId
;
String
orgId
;
@Comment
(
"被访人id"
)
//
@Comment("被访人id")
Stri
ng
intervieweeId
;
// Lo
ng intervieweeId;
@Comment
(
"来访原因/邀请原因"
)
@Comment
(
"来访原因/邀请原因"
)
String
reason
;
String
reason
;
...
@@ -108,4 +109,17 @@ public class Visitor implements Serializable {
...
@@ -108,4 +109,17 @@ public class Visitor implements Serializable {
@Comment
(
"访客车辆"
)
@Comment
(
"访客车辆"
)
@OneToOne
(
cascade
=
{
CascadeType
.
ALL
})
@OneToOne
(
cascade
=
{
CascadeType
.
ALL
})
Car
car
;
Car
car
;
@Comment
(
"被访人信息"
)
@OneToOne
@JoinColumn
(
name
=
"interviewee_id"
,
referencedColumnName
=
"id"
)
User
user
;
@Comment
(
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
LocalDateTime
updateTime
;
// @Comment("邀请人")
// @OneToOne(cascade = { CascadeType.ALL })
// @JoinColumn(name = "main_visitor_id", referencedColumnName = "id")
// Visitor visitor;
}
}
app/src/main/java/com/yiring/app/domain/visitor/VisitorRepository.java
浏览文件 @
c28135da
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
package
com
.
yiring
.
app
.
domain
.
visitor
;
package
com
.
yiring
.
app
.
domain
.
visitor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -13,4 +16,10 @@ import org.springframework.stereotype.Repository;
...
@@ -13,4 +16,10 @@ import org.springframework.stereotype.Repository;
@Repository
@Repository
public
interface
VisitorRepository
extends
JpaRepository
<
Visitor
,
Serializable
>,
JpaSpecificationExecutor
<
Visitor
>
{
public
interface
VisitorRepository
extends
JpaRepository
<
Visitor
,
Serializable
>,
JpaSpecificationExecutor
<
Visitor
>
{
Visitor
findByIdAndDeleted
(
Long
id
,
String
deleted
);
Visitor
findByIdAndDeleted
(
Long
id
,
String
deleted
);
List
<
Visitor
>
findAllByMainVisitorIdAndDeletedEquals
(
Long
mainId
,
String
deleted
);
List
<
Visitor
>
findAllByMainVisitorIdAndDeletedEqualsAndIdIsNot
(
Long
mainId
,
String
deleted
,
Long
id
);
Page
<
Visitor
>
findAllByVisitorMobileAndDeletedEquals
(
String
mobile
,
String
deleted
,
Pageable
pageable
);
}
}
app/src/main/java/com/yiring/app/excel/broadcast/BroadcastExportExcel.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
broadcast
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/6 9:04
*/
@ExcelModel
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastExportExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2342047029622668894L
;
@ExcelColumn
(
title
=
"编号"
,
width
=
10
)
String
broadcastNum
;
@ExcelColumn
(
title
=
"设备名称"
,
width
=
10
)
String
broadcastName
;
@ExcelColumn
(
title
=
"经度"
)
double
lon
;
@ExcelColumn
(
title
=
"纬度"
)
double
lat
;
@ExcelColumn
(
title
=
"设备地址"
,
width
=
10
)
String
broadcastAdd
;
@ExcelColumn
(
title
=
"备注"
,
width
=
15
)
String
remark
;
}
app/src/main/java/com/yiring/app/excel/broadcast/BroadcastImportExcel.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
broadcast
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* 2022/5/6 09:12
*/
@ExcelModel
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastImportExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5422685189135254189L
;
@ExcelColumn
(
title
=
"编号"
)
String
broadcastNum
;
@ExcelColumn
(
title
=
"设备名称"
)
String
broadcastName
;
@ExcelColumn
(
title
=
"经度"
)
double
lon
;
@ExcelColumn
(
title
=
"纬度"
)
double
lat
;
@ExcelColumn
(
title
=
"设备地址"
)
String
broadcastAdd
;
@ExcelColumn
(
title
=
"备注"
)
String
remark
;
// String status;
}
app/src/main/java/com/yiring/app/excel/dept/DepartmentExportExcel.java
浏览文件 @
c28135da
...
@@ -13,7 +13,7 @@ import lombok.Data;
...
@@ -13,7 +13,7 @@ import lombok.Data;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
* 部门
信息控制器
* 部门
导出
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/22
* @date 2022/4/22
...
@@ -34,21 +34,21 @@ public class DepartmentExportExcel implements Serializable {
...
@@ -34,21 +34,21 @@ public class DepartmentExportExcel implements Serializable {
@ExcelColumn
(
title
=
"负责人"
)
@ExcelColumn
(
title
=
"负责人"
)
String
realName
;
String
realName
;
@ExcelColumn
(
title
=
"手机号"
)
@ExcelColumn
(
title
=
"手机号
码
"
)
String
mobile
;
String
mobile
;
@ExcelColumn
(
title
=
"
是否启用
"
)
@ExcelColumn
(
title
=
"
状态
"
)
String
enable
;
String
enable
;
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
DepartmentExportExcel
departmentExportExcel
=
DepartmentExportExcel
DepartmentExportExcel
departmentExportExcel
=
DepartmentExportExcel
.
builder
()
.
builder
()
.
name
(
department
.
getName
())
.
name
(
department
.
getName
())
.
mobile
(
department
.
getLeader
().
getMobile
())
.
enable
(
ObjectUtil
.
equals
(
department
.
getEnable
(),
true
)
?
"启用"
:
"禁用"
)
.
enable
(
department
.
getEnable
()
?
"启用"
:
"禁用"
)
.
build
();
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
departmentExportExcel
.
setRealName
(
department
.
getLeader
().
getRealName
());
departmentExportExcel
.
setRealName
(
department
.
getLeader
().
getRealName
());
departmentExportExcel
.
setMobile
(
department
.
getLeader
().
getMobile
());
}
}
return
departmentExportExcel
;
return
departmentExportExcel
;
...
...
app/src/main/java/com/yiring/app/excel/location/beacon/LocationBeaconExportExcel.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
location
.
beacon
;
package
com
.
yiring
.
app
.
excel
.
location
.
beacon
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.yiring.app.domain.location.LocationBeacon
;
import
com.yiring.app.domain.location.LocationBeacon
;
...
@@ -12,7 +13,7 @@ import lombok.Data;
...
@@ -12,7 +13,7 @@ import lombok.Data;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
部门信息控制器
*
信标导出
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/29
* @date 2022/4/29
...
@@ -30,7 +31,18 @@ public class LocationBeaconExportExcel implements Serializable {
...
@@ -30,7 +31,18 @@ public class LocationBeaconExportExcel implements Serializable {
@ExcelColumn
(
title
=
"编号"
)
@ExcelColumn
(
title
=
"编号"
)
String
code
;
String
code
;
@ExcelColumn
(
title
=
"最后更新时间"
)
String
time
;
@ExcelColumn
(
title
=
"图层"
)
Long
areaId
;
public
static
LocationBeaconExportExcel
transform
(
LocationBeacon
locationBeacon
)
{
public
static
LocationBeaconExportExcel
transform
(
LocationBeacon
locationBeacon
)
{
return
LocationBeaconExportExcel
.
builder
().
code
(
locationBeacon
.
getCode
()).
build
();
return
LocationBeaconExportExcel
.
builder
()
.
code
(
locationBeacon
.
getCode
())
.
time
(
LocalDateTimeUtil
.
format
(
locationBeacon
.
getTime
(),
"yyyy-MM-dd HH:mm:ss"
))
.
areaId
(
locationBeacon
.
getAreaId
())
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/excel/location/tag/LocationTagImportExcel.java
浏览文件 @
c28135da
...
@@ -30,7 +30,7 @@ public class LocationTagImportExcel implements Serializable {
...
@@ -30,7 +30,7 @@ public class LocationTagImportExcel implements Serializable {
String
code
;
String
code
;
// 标签型号
// 标签型号
@ExcelColumn
(
title
=
"标签
型号
"
)
@ExcelColumn
(
title
=
"标签
类型
"
)
String
type
;
String
type
;
// 设备编码
// 设备编码
...
...
basic-auth/src/main/java/com/yiring/auth/excel/post/Pos
tExcel.java
→
app/src/main/java/com/yiring/app/excel/post/PostExpor
tExcel.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
a
uth
.
excel
.
post
;
package
com
.
yiring
.
a
pp
.
excel
.
post
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
...
@@ -20,7 +20,7 @@ import lombok.experimental.FieldDefaults;
...
@@ -20,7 +20,7 @@ import lombok.experimental.FieldDefaults;
@Data
@Data
@Builder
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostExcel
{
public
class
PostEx
portEx
cel
{
/*@ExcelColumn(title = "编号")
/*@ExcelColumn(title = "编号")
@JsonSerialize(using = ToStringSerializer.class)
@JsonSerialize(using = ToStringSerializer.class)
...
@@ -38,8 +38,8 @@ public class PostExcel {
...
@@ -38,8 +38,8 @@ public class PostExcel {
@ExcelColumn
(
title
=
"创建时间"
)
@ExcelColumn
(
title
=
"创建时间"
)
String
createTime
;
String
createTime
;
public
static
PostExcel
transform
(
Post
post
)
{
public
static
PostEx
portEx
cel
transform
(
Post
post
)
{
return
PostExcel
return
PostEx
portEx
cel
.
builder
()
.
builder
()
.
name
(
post
.
getName
())
.
name
(
post
.
getName
())
.
describe
(
post
.
getDescribe
())
.
describe
(
post
.
getDescribe
())
...
...
app/src/main/java/com/yiring/app/excel/user/UserExportExcel.java
浏览文件 @
c28135da
...
@@ -25,18 +25,17 @@ public class UserExportExcel implements Serializable {
...
@@ -25,18 +25,17 @@ public class UserExportExcel implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
7104402721241163991L
;
private
static
final
long
serialVersionUID
=
7104402721241163991L
;
@ExcelColumn
(
title
=
"
真实
姓名"
)
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
String
realName
;
@ExcelColumn
(
title
=
"工号"
)
@ExcelColumn
(
title
=
"工号"
)
String
uuid
;
String
uuid
;
// 图标类型
@ExcelColumn
(
title
=
"图标类型"
)
@ExcelColumn
(
title
=
"图标类型"
)
String
type
;
String
type
;
// 手机号
// 手机号
@ExcelColumn
(
title
=
"手机号"
)
@ExcelColumn
(
title
=
"手机号
码
"
)
String
mobile
;
String
mobile
;
// 部门id
// 部门id
...
@@ -48,7 +47,7 @@ public class UserExportExcel implements Serializable {
...
@@ -48,7 +47,7 @@ public class UserExportExcel implements Serializable {
String
postName
;
String
postName
;
// 标签号
// 标签号
@ExcelColumn
(
title
=
"标签号"
)
@ExcelColumn
(
title
=
"标签
编
号"
)
String
code
;
String
code
;
// 性别
// 性别
...
@@ -56,7 +55,7 @@ public class UserExportExcel implements Serializable {
...
@@ -56,7 +55,7 @@ public class UserExportExcel implements Serializable {
Boolean
gender
;
Boolean
gender
;
// 是否为特殊人员
// 是否为特殊人员
@ExcelColumn
(
title
=
"
是否为
特殊人员"
)
@ExcelColumn
(
title
=
"特殊人员"
)
Boolean
isSpecial
;
Boolean
isSpecial
;
public
static
UserExportExcel
transform
(
UserVo
userVo
)
{
public
static
UserExportExcel
transform
(
UserVo
userVo
)
{
...
...
app/src/main/java/com/yiring/app/excel/user/UserSendCardExcel.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
user
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户批量绑卡
*
* @author LJ-2204
* @date 2022/5/9
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserSendCardExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
6094419272413042366L
;
// 姓名
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
// 工号
@ExcelColumn
(
title
=
"工号"
)
String
uuid
;
// 标签号
@ExcelColumn
(
title
=
"标签编号"
)
String
code
;
}
app/src/main/java/com/yiring/app/excel/video/VideoExportExcel.java
浏览文件 @
c28135da
...
@@ -7,7 +7,6 @@ import java.io.Serial;
...
@@ -7,7 +7,6 @@ import java.io.Serial;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
org.locationtech.jts.geom.Point
;
/**
/**
* @author tzl
* @author tzl
...
@@ -30,8 +29,11 @@ public class VideoExportExcel implements Serializable {
...
@@ -30,8 +29,11 @@ public class VideoExportExcel implements Serializable {
@ExcelColumn
(
title
=
"摄像头名称"
,
width
=
10
)
@ExcelColumn
(
title
=
"摄像头名称"
,
width
=
10
)
String
videoName
;
String
videoName
;
@ExcelColumn
(
title
=
"坐标点信息(经度,纬度)"
,
width
=
10
)
@ExcelColumn
(
title
=
"经度"
)
Point
point
;
double
lon
;
@ExcelColumn
(
title
=
"纬度"
)
double
lat
;
@ExcelColumn
(
title
=
"m3u8 地址"
,
width
=
10
)
@ExcelColumn
(
title
=
"m3u8 地址"
,
width
=
10
)
String
m3u8
;
String
m3u8
;
...
...
app/src/main/java/com/yiring/app/excel/visitor/InvitationExportExcel.java
浏览文件 @
c28135da
...
@@ -29,7 +29,7 @@ public class InvitationExportExcel implements Serializable {
...
@@ -29,7 +29,7 @@ public class InvitationExportExcel implements Serializable {
@ExcelColumn
(
title
=
"邀请原因"
)
@ExcelColumn
(
title
=
"邀请原因"
)
String
reason
;
String
reason
;
@ExcelColumn
(
title
=
"邀请方式"
)
@ExcelColumn
(
title
=
"邀请方式"
,
mapping
=
"1:个人,2:公司"
)
String
InvitationMethod
;
String
InvitationMethod
;
@ExcelColumn
(
title
=
"邀请人数"
)
@ExcelColumn
(
title
=
"邀请人数"
)
...
@@ -44,7 +44,7 @@ public class InvitationExportExcel implements Serializable {
...
@@ -44,7 +44,7 @@ public class InvitationExportExcel implements Serializable {
@ExcelColumn
(
title
=
"到访人电话"
)
@ExcelColumn
(
title
=
"到访人电话"
)
String
visitorMobile
;
String
visitorMobile
;
@ExcelColumn
(
title
=
"是否特殊任务"
)
@ExcelColumn
(
title
=
"是否特殊任务"
,
mapping
=
"false:否,true:是"
)
String
taskType
;
String
taskType
;
// Long inviterId;
// Long inviterId;
...
...
app/src/main/java/com/yiring/app/feign/WxClient.java
浏览文件 @
c28135da
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
package
com
.
yiring
.
app
.
feign
;
package
com
.
yiring
.
app
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
@FeignClient
(
url
=
"api.weixin.qq.com"
,
name
=
"wxclient"
)
@FeignClient
(
url
=
"api.weixin.qq.com"
,
name
=
"wxclient"
)
public
interface
WxClient
{
public
interface
WxClient
{
...
@@ -22,13 +21,10 @@ public interface WxClient {
...
@@ -22,13 +21,10 @@ public interface WxClient {
* @date 15:20
* @date 15:20
*/
*/
@RequestMapping
(
value
=
"/sns/jscode2session"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/sns/jscode2session"
,
method
=
RequestMethod
.
GET
)
@ApiImplicitParams
(
JSONObject
getOpenid
(
{
@RequestParam
(
"appid"
)
String
appid
,
@ApiImplicitParam
(
value
=
"appid"
,
required
=
true
,
name
=
"appid"
),
@RequestParam
(
"secret"
)
String
secret
,
@ApiImplicitParam
(
value
=
"secret"
,
required
=
true
,
name
=
"secret"
),
@RequestParam
(
"js_code"
)
String
js_code
,
@ApiImplicitParam
(
value
=
"js_code"
,
required
=
true
,
name
=
"js_code"
),
@RequestParam
(
"grant_type"
)
String
grant_type
@ApiImplicitParam
(
value
=
"grant_type"
,
required
=
true
,
name
=
"grant_type"
),
);
}
)
JSONObject
getOpenid
(
String
appid
,
String
secret
,
String
js_code
,
String
grant_type
);
}
}
app/src/main/java/com/yiring/app/feign/zy/location/beacon/LocationBeaconClient.java
浏览文件 @
c28135da
...
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestHeader
;
/**
/**
*
部门信息控制器
*
zy信标
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/28
* @date 2022/4/28
...
...
app/src/main/java/com/yiring/app/feign/zy/user/UserClient.java
浏览文件 @
c28135da
...
@@ -6,7 +6,7 @@ import org.springframework.cloud.openfeign.FeignClient;
...
@@ -6,7 +6,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
*
部门信息控制器
*
zy用户
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/5/5
* @date 2022/5/5
...
@@ -23,15 +23,15 @@ public interface UserClient {
...
@@ -23,15 +23,15 @@ public interface UserClient {
@DeleteMapping
(
value
=
"/position/staff/delete/{id}"
)
@DeleteMapping
(
value
=
"/position/staff/delete/{id}"
)
JSONObject
delete
(
@PathVariable
(
"id"
)
String
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
JSONObject
delete
(
@PathVariable
(
"id"
)
String
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
@GetMapping
(
value
=
"position/staff/unbind/{id}"
)
@GetMapping
(
value
=
"position/staff/unbind/{id
s
}"
)
JSONObject
unbind
(
JSONObject
unbind
(
@PathVariable
(
"id
"
)
Long
id
,
@PathVariable
(
"id
s"
)
String
ids
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestHeader
(
"Authorization"
)
String
token
@RequestHeader
(
"Authorization"
)
String
token
);
);
@GetMapping
(
value
=
"position/staff/bindTag/{id}/{code}/1"
)
@GetMapping
(
value
=
"position/staff/bindTag/{id}/{code}/1"
)
JSONObject
unbind
(
JSONObject
bindTag
(
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"code"
)
String
code
,
@PathVariable
(
"code"
)
String
code
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
...
...
app/src/main/java/com/yiring/app/job/MockZyMessageJob.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
job
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
com.yiring.app.domain.location.LocationLog
;
import
com.yiring.app.domain.location.LocationLogRepository
;
import
com.yiring.app.rabbit.config.ZyRabbitConfig
;
import
com.yiring.app.util.GeoUtils
;
import
com.yiring.common.constant.DateFormatter
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Component
;
/**
* 模拟真源消息日志推送
*
* @author Jim
* @version 0.1
* 2022/5/7 15:26
*/
@SuppressWarnings
(
"unused"
)
@Slf4j
@Component
public
class
MockZyMessageJob
{
@Resource
RabbitTemplate
rabbitTemplate
;
@Resource
LocationLogRepository
locationLogRepository
;
@XxlJob
(
"MockZyMessageHandler"
)
public
void
mockMessageHandler
()
{
log
.
info
(
"MockZyMessageHandler: {}"
,
LocalDateTime
.
now
().
format
(
DateFormatter
.
DATE_TIME
));
log
.
info
(
"[Mock] Position: {}"
,
mockPositionMessage
());
log
.
info
(
"[Mock] LowPower: {}"
,
mockLowPowerMessage
());
log
.
info
(
"[Mock] DeviceStatus: {}"
,
mockDeviceStatusMessage
());
log
.
info
(
"[Mock] KeyWarning: {}"
,
mockKeyWarningMessage
());
}
@XxlJob
(
"QueryMessageHandler"
)
public
void
queryMessageHandler
()
{
log
.
info
(
"QueryZyMessageHandler: {}"
,
LocalDateTime
.
now
().
format
(
DateFormatter
.
DATE_TIME
));
try
{
Specification
<
LocationLog
>
spec
=
(
root
,
query
,
cb
)
->
{
Predicate
predicate
=
cb
.
conjunction
();
predicate
.
getExpressions
().
add
(
cb
.
lessThanOrEqualTo
(
root
.
get
(
"id"
).
get
(
"time"
),
LocalDateTime
.
now
()));
return
predicate
;
};
List
<
LocationLog
>
logs
=
locationLogRepository
.
findAll
(
spec
);
log
.
info
(
"QueryZyMessageHandler: {}"
,
logs
.
size
());
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
public
JSONObject
send
(
JSONObject
body
)
{
rabbitTemplate
.
convertAndSend
(
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
,
body
.
toJSONString
());
return
body
;
}
private
String
mockTag
()
{
return
"BTT33333331"
;
}
private
Long
mockAreaId
()
{
return
10019L
;
}
private
JSONObject
mockPositionMessage
()
{
// 随机生成一个坐标点
Point
point
=
GeoUtils
.
randomPoint
(
GeoUtils
.
defaultBounds
(),
0
);
// 模拟定位数据
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"tagId"
,
mockTag
());
params
.
put
(
"areaId"
,
mockAreaId
());
params
.
put
(
"silent"
,
false
);
params
.
put
(
"beacons"
,
"BTI22085237,BTI22085238"
);
params
.
put
(
"longitude"
,
point
.
getCoordinate
().
getX
());
params
.
put
(
"latitude"
,
point
.
getCoordinate
().
getY
());
params
.
put
(
"altitude"
,
point
.
getCoordinate
().
getZ
());
params
.
put
(
"locationTime"
,
System
.
currentTimeMillis
());
params
.
put
(
"volt"
,
3650
);
params
.
put
(
"voltUnit"
,
"mV"
);
params
.
put
(
"floor"
,
1
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"method"
,
"position"
);
body
.
put
(
"params"
,
params
);
return
send
(
body
);
}
private
JSONObject
mockLowPowerMessage
()
{
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"tagId"
,
mockTag
());
params
.
put
(
"volt"
,
3650
);
params
.
put
(
"voltUnit"
,
"mV"
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"method"
,
"lowPower"
);
body
.
put
(
"params"
,
params
);
return
send
(
body
);
}
private
JSONObject
mockDeviceStatusMessage
()
{
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"deviceId"
,
mockTag
());
params
.
put
(
"areaId"
,
mockAreaId
());
params
.
put
(
"deviceType"
,
"BTI"
);
params
.
put
(
"volt"
,
3650
);
params
.
put
(
"field_21"
,
"mV"
);
params
.
put
(
"updateTime"
,
System
.
currentTimeMillis
());
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"method"
,
"deviceStatus"
);
body
.
put
(
"params"
,
params
);
return
send
(
body
);
}
private
JSONObject
mockKeyWarningMessage
()
{
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"tagId"
,
mockTag
());
params
.
put
(
"entityId"
,
"1522770547178475520"
);
params
.
put
(
"areaId"
,
mockAreaId
());
params
.
put
(
"raiseTime"
,
System
.
currentTimeMillis
());
params
.
put
(
"x"
,
100
);
params
.
put
(
"y"
,
100
);
params
.
put
(
"z"
,
0
);
params
.
put
(
"floor"
,
1
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"method"
,
"keyWarning"
);
body
.
put
(
"params"
,
params
);
return
send
(
body
);
}
}
app/src/main/java/com/yiring/app/param/appUser/AppletUserParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
appUser
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/4/28 13:40
*/
@ApiModel
(
"AppletUserParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
AppletUserParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1684195733142347657L
;
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"17674741309"
,
required
=
true
)
@NotEmpty
(
message
=
"手机号不能为空"
)
String
mobile
;
@ApiModelProperty
(
value
=
"微信唯一标识"
,
example
=
"17674741309"
,
required
=
true
)
@NotEmpty
(
message
=
"微信唯一标识不能为空"
)
String
openid
;
}
app/src/main/java/com/yiring/app/param/appUser/AppletUserQueryParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
appUser
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/4/28 13:52
*/
@ApiModel
(
"AppletUserQueryParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
AppletUserQueryParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1806727740548075365L
;
@ApiModelProperty
(
value
=
"小程序 appId"
,
example
=
"1"
,
required
=
true
)
String
appid
;
@ApiModelProperty
(
value
=
"小程序 appSecret"
,
example
=
"1"
,
required
=
true
)
String
secret
;
@ApiModelProperty
(
value
=
"登录时获取的 code"
,
example
=
"1"
,
required
=
true
)
String
js_code
;
@ApiModelProperty
(
value
=
"授权类型,此处只需填写 authorization_code"
,
example
=
"1"
,
required
=
true
)
String
grant_type
;
}
app/src/main/java/com/yiring/app/param/broadcast/BroadcastAudioAddParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
broadcast
;
import
com.yiring.app.domain.broadcast.BroadcastAudio
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"BroadcastAudioAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastAudioAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
7174160141071642430L
;
@ApiModelProperty
(
value
=
"语音名称"
,
example
=
"警告张三"
,
required
=
true
)
@NotEmpty
(
message
=
"语音名称不能为空"
)
String
name
;
@ApiModelProperty
(
value
=
"语音地址"
,
example
=
"uri"
,
required
=
true
)
@NotEmpty
(
message
=
"语音地址不能为空"
)
String
uri
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"请输入备注信息"
)
String
describe
;
public
static
BroadcastAudio
transform
(
BroadcastAudioAddParam
param
)
{
return
BroadcastAudio
.
builder
().
name
(
param
.
getName
()).
uri
(
param
.
getUri
()).
describe
(
param
.
getDescribe
()).
build
();
}
}
app/src/main/java/com/yiring/app/param/broadcast/BroadcastAudioFindParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
broadcast
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报语音
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"BroadcastAudioFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastAudioFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
7396234032011169171L
;
@ApiModelProperty
(
value
=
"音频名称"
,
example
=
"张三爱唱歌"
)
String
name
;
}
app/src/main/java/com/yiring/app/param/broadcast/BroadcastAudioModifyParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
broadcast
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报语音
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"BroadcastAudioModifyParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastAudioModifyParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
6319295457926858655L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"主键不能为空"
)
Long
id
;
@ApiModelProperty
(
value
=
"语音名称"
,
example
=
"警告张三"
,
required
=
true
)
@NotEmpty
(
message
=
"语音名称不能为空"
)
String
name
;
@ApiModelProperty
(
value
=
"语音地址"
,
example
=
"uri"
,
required
=
true
)
@NotEmpty
(
message
=
"语音地址不能为空"
)
String
uri
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"请输入备注信息"
)
String
describe
;
}
app/src/main/java/com/yiring/app/param/broadcast/BroadcastParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
broadcast
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报设备入参
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:14
*/
@ApiModel
(
"BroadcastParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2629601722942495674L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"编号"
)
String
broadcastNum
;
@ApiModelProperty
(
value
=
"经度"
,
example
=
"1.00"
,
required
=
true
)
@NotNull
(
message
=
"经度"
)
Double
lon
;
@ApiModelProperty
(
value
=
"纬度"
,
example
=
"1.00"
,
required
=
true
)
@NotNull
(
message
=
"纬度"
)
Double
lat
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"厂区喇叭"
)
@Size
(
max
=
100
,
message
=
"备注不能超过100字"
)
String
remark
;
@ApiModelProperty
(
value
=
"播报设备地址"
,
example
=
"音柱地址"
,
required
=
true
)
@NotEmpty
(
message
=
"播报设备地址不能为空"
)
String
broadcastAdd
;
@ApiModelProperty
(
value
=
"播报设备地址名称"
,
example
=
"喇叭1"
,
required
=
true
)
@NotEmpty
(
message
=
"播报设备地址名称不能为空"
)
String
broadcastName
;
}
app/src/main/java/com/yiring/app/param/broadcast/BroadcastQueryParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
broadcast
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:22
*/
@ApiModel
(
"BroadcastQueryParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastQueryParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
7181714985511069309L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"1"
)
String
broadcastNum
;
@ApiModelProperty
(
value
=
"播报设备地址名称"
,
example
=
"喇叭1"
)
String
broadcastName
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"1"
)
String
status
;
@ApiModelProperty
(
value
=
"分页条数"
,
example
=
"10"
,
required
=
true
)
Integer
pageSize
;
@ApiModelProperty
(
value
=
"当前页数"
,
example
=
"1"
,
required
=
true
)
Integer
pageNo
;
}
app/src/main/java/com/yiring/app/param/dept/DepartmentModifyParam.java
浏览文件 @
c28135da
...
@@ -46,6 +46,9 @@ public class DepartmentModifyParam implements Serializable {
...
@@ -46,6 +46,9 @@ public class DepartmentModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
Long
leaderId
;
Long
leaderId
;
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"T/F"
)
Boolean
enable
;
public
void
transform
(
DepartmentModifyParam
departmentModifyParam
,
Department
department
)
{
public
void
transform
(
DepartmentModifyParam
departmentModifyParam
,
Department
department
)
{
department
.
setPid
(
departmentModifyParam
.
getPid
());
department
.
setPid
(
departmentModifyParam
.
getPid
());
department
.
setName
(
departmentModifyParam
.
getName
());
department
.
setName
(
departmentModifyParam
.
getName
());
...
@@ -53,5 +56,6 @@ public class DepartmentModifyParam implements Serializable {
...
@@ -53,5 +56,6 @@ public class DepartmentModifyParam implements Serializable {
department
.
setLeader
(
User
.
builder
().
id
(
departmentModifyParam
.
getLeaderId
()).
build
());
department
.
setLeader
(
User
.
builder
().
id
(
departmentModifyParam
.
getLeaderId
()).
build
());
}
}
department
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
department
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
department
.
setEnable
(
departmentModifyParam
.
getEnable
());
}
}
}
}
app/src/main/java/com/yiring/app/param/icon/IconParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
icon
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 9:30
*/
@ApiModel
(
"IconParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
IconParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
666028441935810972L
;
@ApiModelProperty
(
value
=
"图标名称"
,
example
=
"访客头像"
,
required
=
true
)
@NotEmpty
(
message
=
"图标名称不能为空"
)
String
iconName
;
@ApiModelProperty
(
value
=
"图标类型"
,
example
=
"1"
,
required
=
true
)
@NotEmpty
(
message
=
"图标类型不能为空"
)
String
iconType
;
@ApiModelProperty
(
value
=
"图标分类"
,
example
=
"1"
,
required
=
true
)
@NotEmpty
(
message
=
"图标类型不能为空"
)
String
iconSort
;
@ApiModelProperty
(
value
=
"在线图标地址"
,
required
=
true
)
String
iconOnline
;
@ApiModelProperty
(
value
=
"离线图标地址"
,
required
=
true
)
String
iconOffline
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmFindParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
key
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"KeyAlarmFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
1011171442882543071L
;
@ApiModelProperty
(
value
=
"地图总图"
,
example
=
"1"
)
Long
areaId
;
@ApiModelProperty
(
value
=
"报警人员"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"报警状态"
,
example
=
"T/F"
)
Boolean
enable
;
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
endTime
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
浏览文件 @
c28135da
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -28,7 +29,7 @@ public class KeyAlarmRulesAddParam implements Serializable {
...
@@ -28,7 +29,7 @@ public class KeyAlarmRulesAddParam implements Serializable {
private
static
final
long
serialVersionUID
=
758462772473378637L
;
private
static
final
long
serialVersionUID
=
758462772473378637L
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@Not
Empty
(
message
=
"部门ID不能为空"
)
@Not
Null
(
message
=
"部门ID不能为空"
)
Long
deptId
;
Long
deptId
;
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
...
...
app/src/main/java/com/yiring/app/param/location/tag/LocationTagExportParam.java
浏览文件 @
c28135da
...
@@ -10,7 +10,7 @@ import lombok.*;
...
@@ -10,7 +10,7 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
部门信息控制器
*
定位标签导出
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/27
* @date 2022/4/27
...
...
app/src/main/java/com/yiring/app/param/location/tag/LocationTagFindParam.java
浏览文件 @
c28135da
...
@@ -34,4 +34,7 @@ public class LocationTagFindParam implements Serializable {
...
@@ -34,4 +34,7 @@ public class LocationTagFindParam implements Serializable {
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
Boolean
silent
;
Boolean
silent
;
@ApiModelProperty
(
value
=
"绑卡状态"
,
example
=
"true"
)
Boolean
used
;
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagTypeFindParam.java
浏览文件 @
c28135da
...
@@ -30,5 +30,5 @@ public class LocationTagTypeFindParam implements Serializable {
...
@@ -30,5 +30,5 @@ public class LocationTagTypeFindParam implements Serializable {
String
code
;
String
code
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
Integer
category
;
String
category
;
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagTypeSendParam.java
浏览文件 @
c28135da
...
@@ -10,7 +10,7 @@ import lombok.*;
...
@@ -10,7 +10,7 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
部门信息控制器
*
分配标签
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/28
* @date 2022/4/28
...
@@ -32,5 +32,5 @@ public class LocationTagTypeSendParam implements Serializable {
...
@@ -32,5 +32,5 @@ public class LocationTagTypeSendParam implements Serializable {
String
ids
;
String
ids
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
Integer
category
;
String
category
;
}
}
app/src/main/java/com/yiring/app/param/visitor/InvitationAppQueryParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
visitor
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description: TODO
* @date 2022/4/28 11:12
*/
@ApiModel
(
"InvitationAppQueryParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
InvitationAppQueryParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5194434249966317387L
;
@ApiModelProperty
(
value
=
"到访人电话"
,
example
=
"17688888888"
,
required
=
true
)
@NotEmpty
(
message
=
"到访人电话不能为空"
)
String
visitorMobile
;
@ApiModelProperty
(
value
=
"分页条数"
,
example
=
"10"
)
Integer
pageSize
;
@ApiModelProperty
(
value
=
"当前页数"
,
example
=
"1"
)
Integer
pageNo
;
}
app/src/main/java/com/yiring/app/param/visitor/InvitationParam.java
浏览文件 @
c28135da
...
@@ -53,7 +53,7 @@ public class InvitationParam implements Serializable {
...
@@ -53,7 +53,7 @@ public class InvitationParam implements Serializable {
@ApiModelProperty
(
value
=
"到访人身份证"
,
example
=
"430441190001255417"
)
@ApiModelProperty
(
value
=
"到访人身份证"
,
example
=
"430441190001255417"
)
String
visitorCarNum
;
String
visitorCarNum
;
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"
否
"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"
false
"
,
required
=
true
)
String
taskType
;
String
taskType
;
// @ApiModelProperty(value = "访客来源", example = "外部邀请", required = true)
// @ApiModelProperty(value = "访客来源", example = "外部邀请", required = true)
...
...
app/src/main/java/com/yiring/app/param/visitor/InvitationQueryParam.java
浏览文件 @
c28135da
...
@@ -38,11 +38,11 @@ public class InvitationQueryParam implements Serializable {
...
@@ -38,11 +38,11 @@ public class InvitationQueryParam implements Serializable {
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"fasle"
)
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"fasle"
)
String
taskType
;
String
taskType
;
@ApiModelProperty
(
value
=
"邀请人
id"
,
example
=
"1
"
)
@ApiModelProperty
(
value
=
"邀请人
"
,
example
=
"张三
"
)
Long
inviterId
;
String
realName
;
// @ApiModelProperty(value = "邀请人部门id", example = "1
")
@ApiModelProperty
(
value
=
"邀请人部门"
,
example
=
"研发
"
)
// Long deptId
;
String
deptName
;
@ApiModelProperty
(
value
=
"预约到访时间(开始)"
,
example
=
"2022-04-19 14:28:00"
)
@ApiModelProperty
(
value
=
"预约到访时间(开始)"
,
example
=
"2022-04-19 14:28:00"
)
LocalDateTime
appOfVisitTimeStart
;
LocalDateTime
appOfVisitTimeStart
;
...
...
app/src/main/java/com/yiring/app/param/visitor/VisitorAppQueryParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
visitor
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* 2022/4/19 14:15
*/
@ApiModel
(
"VisitorQueryParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
VisitorAppQueryParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1158888191240628613L
;
@ApiModelProperty
(
value
=
"到访人电话"
,
example
=
"17688888888"
,
required
=
true
)
@NotEmpty
(
message
=
"到访人电话不能为空"
)
String
visitorMobile
;
@ApiModelProperty
(
value
=
"分页条数"
,
example
=
"10"
)
Integer
pageSize
;
@ApiModelProperty
(
value
=
"当前页数"
,
example
=
"1"
)
Integer
pageNo
;
}
app/src/main/java/com/yiring/app/param/visitor/VisitorParam.java
浏览文件 @
c28135da
...
@@ -33,6 +33,7 @@ public class VisitorParam implements Serializable {
...
@@ -33,6 +33,7 @@ public class VisitorParam implements Serializable {
String
visitorName
;
String
visitorName
;
@ApiModelProperty
(
value
=
"到访人电话"
,
example
=
"17688888888"
,
required
=
true
)
@ApiModelProperty
(
value
=
"到访人电话"
,
example
=
"17688888888"
,
required
=
true
)
@Pattern
(
regexp
=
RegEx
.
MOBILE
,
message
=
"手机号码格式不正确"
)
@NotEmpty
(
message
=
"到访人电话不能为空"
)
@NotEmpty
(
message
=
"到访人电话不能为空"
)
String
visitorMobile
;
String
visitorMobile
;
...
...
app/src/main/java/com/yiring/app/param/visitor/VisitorQueryParam.java
浏览文件 @
c28135da
...
@@ -3,6 +3,7 @@ package com.yiring.app.param.visitor;
...
@@ -3,6 +3,7 @@ package com.yiring.app.param.visitor;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.*
;
...
@@ -20,6 +21,7 @@ import lombok.experimental.FieldDefaults;
...
@@ -20,6 +21,7 @@ import lombok.experimental.FieldDefaults;
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
VisitorQueryParam
implements
Serializable
{
public
class
VisitorQueryParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
4314254785949101573L
;
private
static
final
long
serialVersionUID
=
-
4314254785949101573L
;
@ApiModelProperty
(
value
=
"访客姓名"
,
example
=
"张三"
)
@ApiModelProperty
(
value
=
"访客姓名"
,
example
=
"张三"
)
...
@@ -46,8 +48,8 @@ public class VisitorQueryParam implements Serializable {
...
@@ -46,8 +48,8 @@ public class VisitorQueryParam implements Serializable {
@ApiModelProperty
(
value
=
"标签卡"
,
example
=
"DS41234231"
)
@ApiModelProperty
(
value
=
"标签卡"
,
example
=
"DS41234231"
)
String
labelCard
;
String
labelCard
;
@ApiModelProperty
(
value
=
"
标签卡状态"
,
example
=
"1
"
)
@ApiModelProperty
(
value
=
"
是否主访人"
,
example
=
"1:是,2否
"
)
String
labelCardStatus
;
String
isMain
;
@ApiModelProperty
(
value
=
"预约到访时间(开始)"
,
example
=
"2022-04-19 14:28:00"
)
@ApiModelProperty
(
value
=
"预约到访时间(开始)"
,
example
=
"2022-04-19 14:28:00"
)
LocalDateTime
appOfVisitTimeStart
;
LocalDateTime
appOfVisitTimeStart
;
...
...
app/src/main/java/com/yiring/app/param/zy/location/tag/ZyLocationTagTypeSendParam.java
浏览文件 @
c28135da
...
@@ -10,7 +10,7 @@ import lombok.*;
...
@@ -10,7 +10,7 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
部门信息控制器
*
zy标签
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/5/6
* @date 2022/5/6
...
@@ -32,7 +32,7 @@ public class ZyLocationTagTypeSendParam implements Serializable {
...
@@ -32,7 +32,7 @@ public class ZyLocationTagTypeSendParam implements Serializable {
Long
[]
ids
;
Long
[]
ids
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1:内部/2:访客"
)
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1:内部/2:访客"
)
Integer
category
;
String
category
;
@ApiModelProperty
(
value
=
"工厂ID"
,
example
=
"100"
)
@ApiModelProperty
(
value
=
"工厂ID"
,
example
=
"100"
)
Integer
orgId
;
Integer
orgId
;
...
...
app/src/main/java/com/yiring/app/param/zy/user/ZyUserFindParam.java
浏览文件 @
c28135da
...
@@ -9,7 +9,7 @@ import lombok.*;
...
@@ -9,7 +9,7 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
部门信息控制器
*
zy用户
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/5/5
* @date 2022/5/5
...
...
app/src/main/java/com/yiring/app/rabbit/config/MockZyRabbitConfig.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
rabbit
.
config
;
import
org.springframework.amqp.core.Binding
;
import
org.springframework.amqp.core.BindingBuilder
;
import
org.springframework.amqp.core.Queue
;
import
org.springframework.amqp.core.TopicExchange
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* 模拟真源 rabbitmq 消息队列配置
*
* @author ifzm
* 2019/8/21 15:44
*/
@Configuration
public
class
MockZyRabbitConfig
{
/**
* 消息交换机
*/
public
static
final
String
ZY_TOPIC_EXCHANGE
=
"zy.topic.exchange"
;
/**
* 订阅模式
*
* @return TopicExchange
*/
@Bean
(
ZY_TOPIC_EXCHANGE
)
TopicExchange
exchange
()
{
return
new
TopicExchange
(
ZY_TOPIC_EXCHANGE
,
true
,
false
);
}
@Bean
(
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
)
public
Queue
mockMessageQueue
()
{
return
new
Queue
(
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
,
true
,
false
,
false
);
}
@Bean
Binding
bindingExchangeMock
(
@Qualifier
(
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
)
Queue
queue
,
@Qualifier
(
ZY_TOPIC_EXCHANGE
)
TopicExchange
exchange
)
{
return
BindingBuilder
.
bind
(
queue
).
to
(
exchange
).
with
(
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
);
}
}
app/src/main/java/com/yiring/app/rabbit/config/RabbitConfig.java
浏览文件 @
c28135da
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
rabbit
.
config
;
package
com
.
yiring
.
app
.
rabbit
.
config
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
org.springframework.amqp.core.AcknowledgeMode
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
...
@@ -9,6 +10,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
...
@@ -9,6 +10,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.amqp.RabbitProperties
;
import
org.springframework.boot.autoconfigure.amqp.RabbitProperties
;
import
org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.context.annotation.Primary
;
...
@@ -25,7 +27,7 @@ public class RabbitConfig {
...
@@ -25,7 +27,7 @@ public class RabbitConfig {
@Resource
@Resource
RabbitProperties
rabbitProperties
;
RabbitProperties
rabbitProperties
;
p
rivate
static
final
String
CONNECTION_FACTORY_NAME
=
"rabbitConnectionFactory"
;
p
ublic
static
final
String
CONNECTION_FACTORY_NAME
=
"rabbitConnectionFactory"
;
@Bean
(
CONNECTION_FACTORY_NAME
)
@Bean
(
CONNECTION_FACTORY_NAME
)
@Primary
@Primary
...
@@ -42,10 +44,13 @@ public class RabbitConfig {
...
@@ -42,10 +44,13 @@ public class RabbitConfig {
@Bean
@Bean
@Primary
@Primary
public
RabbitListenerContainerFactory
<?>
rabbitListenerContainerFactory
(
public
RabbitListenerContainerFactory
<?>
rabbitListenerContainerFactory
(
SimpleRabbitListenerContainerFactoryConfigurer
configurer
,
@Qualifier
(
CONNECTION_FACTORY_NAME
)
ConnectionFactory
connectionFactory
@Qualifier
(
CONNECTION_FACTORY_NAME
)
ConnectionFactory
connectionFactory
)
{
)
{
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
factory
.
setConnectionFactory
(
connectionFactory
);
// 手动确认消息模式
factory
.
setAcknowledgeMode
(
AcknowledgeMode
.
MANUAL
);
configurer
.
configure
(
factory
,
connectionFactory
);
return
factory
;
return
factory
;
}
}
...
...
app/src/main/java/com/yiring/app/rabbit/config/ZyRabbitConfig.java
浏览文件 @
c28135da
...
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.amqp.core.AcknowledgeMode
;
import
org.springframework.amqp.core.AcknowledgeMode
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer
;
import
org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer
;
...
@@ -35,6 +36,7 @@ public class ZyRabbitConfig {
...
@@ -35,6 +36,7 @@ public class ZyRabbitConfig {
public
static
final
String
CONNECTION_FACTORY_NAME
=
"zyRabbitConnectionFactory"
;
public
static
final
String
CONNECTION_FACTORY_NAME
=
"zyRabbitConnectionFactory"
;
public
static
final
String
LISTENER_FACTORY_NAME
=
"zyRabbitListenerFactory"
;
public
static
final
String
LISTENER_FACTORY_NAME
=
"zyRabbitListenerFactory"
;
public
static
final
String
TEMPLATE_NAME
=
"zyRabbitTemplate"
;
/**
/**
* 消息队列名称(必须要与配置文件中的 queue-name 完全一致)
* 消息队列名称(必须要与配置文件中的 queue-name 完全一致)
...
@@ -72,4 +74,9 @@ public class ZyRabbitConfig {
...
@@ -72,4 +74,9 @@ public class ZyRabbitConfig {
configurer
.
configure
(
factory
,
connectionFactory
);
configurer
.
configure
(
factory
,
connectionFactory
);
return
factory
;
return
factory
;
}
}
@Bean
(
TEMPLATE_NAME
)
public
RabbitTemplate
rabbitTemplate
(
@Qualifier
(
CONNECTION_FACTORY_NAME
)
ConnectionFactory
connectionFactory
)
{
return
new
RabbitTemplate
(
connectionFactory
);
}
}
}
app/src/main/java/com/yiring/app/rabbit/receiver/ZyRabbitReceiver.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
rabbit
.
receiver
;
package
com
.
yiring
.
app
.
rabbit
.
receiver
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.rabbitmq.client.Channel
;
import
com.rabbitmq.client.Channel
;
import
com.yiring.app.domain.location.*
;
import
com.yiring.app.domain.log.ZyRealtimeLog
;
import
com.yiring.app.domain.log.ZyRealtimeLogRepository
;
import
com.yiring.app.rabbit.config.ZyRabbitConfig
;
import
com.yiring.app.rabbit.config.ZyRabbitConfig
;
import
com.yiring.app.
util.GeoUtils
;
import
com.yiring.app.
service.message.ZyMessageService
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.domain.Example
;
import
org.springframework.messaging.simp.SimpMessagingTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
* 真源 RabbitMQ 消息监听(消息消费者)
* 真源 RabbitMQ 消息监听(消息消费者)
...
@@ -48,19 +34,7 @@ public class ZyRabbitReceiver {
...
@@ -48,19 +34,7 @@ public class ZyRabbitReceiver {
// 3. 订阅 position(定位数据)、lowPower(低电量报警)、deviceStatus(设备状态)、keyWarning(按键报警)
// 3. 订阅 position(定位数据)、lowPower(低电量报警)、deviceStatus(设备状态)、keyWarning(按键报警)
@Resource
@Resource
LocationTagRepository
locationTagRepository
;
ZyMessageService
zyMessageService
;
@Resource
LocationBeaconRepository
locationBeaconRepository
;
@Resource
LocationLogRepository
locationLogRepository
;
@Resource
SimpMessagingTemplate
simpMessagingTemplate
;
@Resource
ZyRealtimeLogRepository
zyRealtimeLogRepository
;
/**
/**
* 订阅真源定位系统 RabbitMQ 推送过来的消息(主动订阅的一些消息类别)
* 订阅真源定位系统 RabbitMQ 推送过来的消息(主动订阅的一些消息类别)
...
@@ -71,157 +45,15 @@ public class ZyRabbitReceiver {
...
@@ -71,157 +45,15 @@ public class ZyRabbitReceiver {
* @throws IOException 消息确认异常
* @throws IOException 消息确认异常
*/
*/
@RabbitHandler
@RabbitHandler
@RabbitListener
(
// @RabbitListener(
queues
=
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
,
// queues = ZyRabbitConfig.MESSAGE_QUEUES_NAME,
containerFactory
=
ZyRabbitConfig
.
LISTENER_FACTORY_NAME
// containerFactory = ZyRabbitConfig.LISTENER_FACTORY_NAME
)
// )
@RabbitListener
(
queues
=
ZyRabbitConfig
.
MESSAGE_QUEUES_NAME
,
containerFactory
=
"rabbitListenerContainerFactory"
)
public
void
listen
(
String
msg
,
Channel
channel
,
Message
message
)
throws
IOException
{
public
void
listen
(
String
msg
,
Channel
channel
,
Message
message
)
throws
IOException
{
// 消费消息
zyMessageService
.
consume
(
msg
);
// 手动确认消息已收到
// 手动确认消息已收到
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
);
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
);
try
{
// 将消息转换成 JSON 格式
JSONObject
info
=
JSON
.
parseObject
(
msg
);
log
.
info
(
"Receiver Message: {}"
,
info
);
// 解构消息内容
JSONObject
data
=
info
.
getJSONObject
(
"params"
);
String
method
=
info
.
getString
(
"method"
);
// 记录日志
ZyRealtimeLog
realtimeLog
=
ZyRealtimeLog
.
builder
().
method
(
method
).
raw
(
info
).
build
();
zyRealtimeLogRepository
.
save
(
realtimeLog
);
// 业务处理
switch
(
method
)
{
// 实时定位
case
"position"
->
processPositionMessage
(
data
);
// 设备低电量
case
"lowPower"
->
processLowPowerMessage
(
data
);
// 设备状态变更
case
"deviceStatus"
->
processDeviceStatusMessage
(
data
);
// 按键报警
case
"keyWarning"
->
processKeyWarningMessage
(
data
);
// 围栏报警
case
"enclosure"
->
log
.
warn
(
"Ignore Message Type [enclosure]: {}"
,
info
);
default
->
log
.
warn
(
"Unknown Message Type: {}"
,
info
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
/**
* 处理定位消息
* @param data 消息内容
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
processPositionMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"Position Message: {}"
,
data
);
// 包装消息
// TODO
// 1. 解析消息内容,进行围栏、出入标识判断等处理,将定位记录录入数据库
// 2. 创建一条需要进行消息推送的记录
// 3. 将记录推送的消息推送模块
// 4. 检查是否触发围栏告警,记录告警数据,并推送消息
// 定位时间
Instant
instant
=
Instant
.
ofEpochMilli
(
data
.
getLongValue
(
"locationTime"
));
LocalDateTime
time
=
LocalDateTime
.
ofInstant
(
instant
,
ZoneId
.
systemDefault
());
// 定位的基本信息
LocationLog
locationLog
=
LocationLog
.
builder
()
.
raw
(
data
)
.
locationTime
(
time
)
.
silent
(
data
.
getBoolean
(
"silent"
))
.
volt
(
data
.
getInteger
(
"volt"
))
.
voltUnit
(
data
.
getString
(
"voltUnit"
))
.
build
();
// 设置空间点位信息
Point
point
=
GeoUtils
.
createPoint
(
data
.
getDoubleValue
(
"longitude"
),
data
.
getDoubleValue
(
"latitude"
),
data
.
getDoubleValue
(
"altitude"
)
);
locationLog
.
setPoint
(
point
);
// 查询定位标签
Example
<
LocationTag
>
example
=
Example
.
of
(
LocationTag
.
builder
().
code
(
data
.
getString
(
"tagId"
)).
build
());
Optional
<
LocationTag
>
optional
=
locationTagRepository
.
findOne
(
example
);
if
(
optional
.
isPresent
())
{
LocationTag
tag
=
optional
.
get
();
// 设置定位标签
locationLog
.
setTag
(
tag
);
// 定位标签当时所属的用户
locationLog
.
setUser
(
tag
.
getUser
());
// 查询当前用户的状态
// TODO
}
// 查询定位信标
Set
<
String
>
codes
=
Arrays
.
stream
(
data
.
getString
(
"beacons"
).
split
(
","
))
.
map
(
beacon
->
beacon
.
replaceAll
(
"\\(.*\\)"
,
""
))
.
collect
(
Collectors
.
toSet
());
Set
<
LocationBeacon
>
beacons
=
locationBeaconRepository
.
findByCodeIn
(
codes
);
locationLog
.
setBeacons
(
beacons
);
// 查询定位所在围栏信息
Set
<
LocationFence
>
fences
=
locationLog
.
getBeacons
()
.
stream
()
.
map
(
LocationBeacon:
:
getFences
)
.
flatMap
(
Set:
:
stream
)
.
collect
(
Collectors
.
toSet
());
locationLog
.
setFences
(
fences
);
// TODO
// 并计算出入标记(围栏、区域)
// 写入数据
locationLogRepository
.
saveAndFlush
(
locationLog
);
// 更新定位标签卡电量信息
// TODO
// WebSocket 推送定位消息
// 消息内容需要确定 TODO
simpMessagingTemplate
.
convertAndSend
(
"/topic/position"
,
"{}"
);
// TODO
// 判断围栏告警是否触发,触发写入告警记录,并推送消息
}
/**
* 处理低电量报警消息
* @param data 消息内容
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
processLowPowerMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"LowPower Message: {}"
,
data
);
}
/**
* 处理设备状态更新消息
* @param data 消息内容
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
processDeviceStatusMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"DeviceStatus Message: {}"
,
data
);
}
/**
* 处理按键报警消息
* @param data 消息内容
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
processKeyWarningMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"KeyWarning Message: {}"
,
data
);
}
}
}
}
app/src/main/java/com/yiring/app/service/appletUser/AppletUserService.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
appletUser
;
package
com
.
yiring
.
app
.
service
.
appletUser
;
import
com.yiring.app.param.appUser.AppletUserParam
;
import
com.yiring.app.param.appUser.AppletUserQueryParam
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
/**
/**
...
@@ -13,12 +15,18 @@ public interface AppletUserService {
...
@@ -13,12 +15,18 @@ public interface AppletUserService {
/**
/**
* 根据用户唯一标识获取手机号码,通过手机号码查询用户来访信息分页
* 根据用户唯一标识获取手机号码,通过手机号码查询用户来访信息分页
* @author tzl
* @author tzl
* @date 2022/4/24 9:34
* @date 2022/4/28 13:58
* @param appid String
* @param appletUserQueryParam
* @param secret String
* @param js_code String
* @param grant_type String
* @return com.yiring.common.core.Result<java.lang.String>
* @return com.yiring.common.core.Result<java.lang.String>
*/
*/
Result
<
String
>
selectMobile
(
String
appid
,
String
secret
,
String
js_code
,
String
grant_type
);
Result
<
String
>
selectMobile
(
AppletUserQueryParam
appletUserQueryParam
);
/**
* 小程序注册
* @author tzl
* @date 2022/4/28 13:43
* @param appletUserParam 入参
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
saveAppUser
(
AppletUserParam
appletUserParam
);
}
}
app/src/main/java/com/yiring/app/service/appletUser/impl/AppletUserServiceImpl.java
浏览文件 @
c28135da
...
@@ -6,10 +6,17 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -6,10 +6,17 @@ import com.alibaba.fastjson.JSONObject;
import
com.yiring.app.domain.appletUser.AppletUser
;
import
com.yiring.app.domain.appletUser.AppletUser
;
import
com.yiring.app.domain.appletUser.AppletUserRepository
;
import
com.yiring.app.domain.appletUser.AppletUserRepository
;
import
com.yiring.app.feign.WxClient
;
import
com.yiring.app.feign.WxClient
;
import
com.yiring.app.param.appUser.AppletUserParam
;
import
com.yiring.app.param.appUser.AppletUserQueryParam
;
import
com.yiring.app.service.appletUser.AppletUserService
;
import
com.yiring.app.service.appletUser.AppletUserService
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
java.util.Optional
;
import
java.util.Optional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
* @author Administrator
* @author Administrator
...
@@ -17,6 +24,9 @@ import javax.annotation.Resource;
...
@@ -17,6 +24,9 @@ import javax.annotation.Resource;
* @description: TODO
* @description: TODO
* @date 2022/4/24 9:25
* @date 2022/4/24 9:25
*/
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
AppletUserServiceImpl
implements
AppletUserService
{
public
class
AppletUserServiceImpl
implements
AppletUserService
{
@Resource
@Resource
...
@@ -26,18 +36,35 @@ public class AppletUserServiceImpl implements AppletUserService {
...
@@ -26,18 +36,35 @@ public class AppletUserServiceImpl implements AppletUserService {
WxClient
wxClient
;
WxClient
wxClient
;
@Override
@Override
public
Result
<
String
>
selectMobile
(
String
appid
,
String
secret
,
String
js_code
,
String
grant_type
)
{
public
Result
<
String
>
selectMobile
(
AppletUserQueryParam
appletUserQueryParam
)
{
JSONObject
jsonObject
=
wxClient
.
getOpenid
(
appid
,
secret
,
js_code
,
grant_type
);
JSONObject
jsonObject
=
wxClient
.
getOpenid
(
appletUserQueryParam
.
getAppid
(),
appletUserQueryParam
.
getSecret
(),
appletUserQueryParam
.
getJs_code
(),
appletUserQueryParam
.
getGrant_type
()
);
Object
openid
=
jsonObject
.
get
(
"openid"
);
Object
openid
=
jsonObject
.
get
(
"openid"
);
if
(
StrUtil
.
isNotBlank
(
openid
.
toString
()))
{
if
(
StrUtil
.
isNotBlank
(
openid
.
toString
()))
{
Optional
<
AppletUser
>
optional
=
appletUserRepository
.
findById
(
openid
.
toString
());
Optional
<
AppletUser
>
optional
=
appletUserRepository
.
findById
(
openid
.
toString
());
//如果该微信为第一次登录小程序
//如果该微信为第一次登录小程序
if
(
optional
.
isEmpty
())
{
if
(
optional
.
isEmpty
())
{
return
Result
.
ok
(
"绑定手机号码"
);
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
}
AppletUser
appletUser
=
optional
.
get
();
AppletUser
appletUser
=
optional
.
get
();
return
Result
.
ok
(
appletUser
.
getMobile
());
return
Result
.
ok
(
appletUser
.
getMobile
());
}
}
return
null
;
return
null
;
}
}
@Override
public
Result
<
String
>
saveAppUser
(
AppletUserParam
appletUserParam
)
{
Integer
integer
=
appletUserRepository
.
countMobile
(
appletUserParam
.
getMobile
());
if
(
integer
>
0
)
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"手机号已绑定"
);
}
AppletUser
appletUser
=
new
AppletUser
();
BeanUtils
.
copyProperties
(
appletUserParam
,
appletUser
);
appletUserRepository
.
saveAndFlush
(
appletUser
);
return
Result
.
ok
(
appletUser
.
getMobile
());
}
}
}
app/src/main/java/com/yiring/app/service/broadcast/BroadcastAudioService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
broadcast
;
import
com.yiring.app.param.broadcast.BroadcastAudioAddParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioFindParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioModifyParam
;
import
com.yiring.app.vo.broadcast.BroadcastAudioIndexVo
;
import
com.yiring.app.vo.broadcast.BroadcastAudioVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 播报语音
*
* @author LJ-2204
* @date 2022/5/7
*/
public
interface
BroadcastAudioService
{
/**
* 添加播报语音
* @param param BroadcastAudioAddParam
* @return Result<String>
*/
Result
<
String
>
save
(
BroadcastAudioAddParam
param
);
/**
* 删除播报语音
* @param idParam IdParam
* @return Result<String>
*/
Result
<
String
>
delete
(
IdParam
idParam
);
/**
* 修改播报语音
* @param param BroadcastAudioModifyParam
* @return Result<String>
*/
Result
<
String
>
modify
(
BroadcastAudioModifyParam
param
);
/**
* 表格查询
* @param param BroadcastAudioFindParam
* @param pageParam PageParam
* @return Result<PageVo<BroadcastAudioVo>>
*/
Result
<
PageVo
<
BroadcastAudioVo
>>
page
(
BroadcastAudioFindParam
param
,
PageParam
pageParam
);
/**
* 播报语音检索
* @param indexParam IndexParam
* @return Result<PageVo<BroadcastAudioIndexVo>>
*/
Result
<
PageVo
<
BroadcastAudioIndexVo
>>
index
(
IndexParam
indexParam
);
}
app/src/main/java/com/yiring/app/service/broadcast/BroadcastService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
broadcast
;
import
com.yiring.app.param.broadcast.BroadcastParam
;
import
com.yiring.app.param.broadcast.BroadcastQueryParam
;
import
com.yiring.app.vo.broadcast.BroadcastVo
;
import
com.yiring.app.vo.broadcast.BroadcastjcVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.vo.PageVo
;
import
javax.servlet.http.HttpServletResponse
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:31
*/
public
interface
BroadcastService
{
/**
* 新增播报设备
* @author tzl
* @date 2022/5/5 17:33
* @param broadcastParam BroadcastParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
saveBroadcast
(
BroadcastParam
broadcastParam
);
/**
* 修改播报设备
* @author tzl
* @date 2022/5/5 17:34
* @param broadcastParam BroadcastParam
* @param idParam IdParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
updateBroadcast
(
BroadcastParam
broadcastParam
,
IdParam
idParam
);
/**
* 删除播报设备
* @author tzl
* @date 2022/5/5 17:35
* @param idParam IdParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
deleteBroadcast
(
IdParam
idParam
);
/**
* 查看设备位置
* @author tzl
* @date 2022/5/5 17:47
* @param idParam IdParam
* @return com.yiring.common.core.Result<org.locationtech.jts.geom.Point>
*/
Result
<
Point
>
selectPoint
(
IdParam
idParam
);
/**
* 分页查询设备
* @author tzl
* @date 2022/5/5 17:49
* @param broadcastQueryParam BroadcastQueryParam
* @return com.yiring.common.core.Result<com.yiring.app.vo.broadcast.BroadcastVo>
*/
Result
<
PageVo
<
BroadcastVo
>>
pageBroadcast
(
BroadcastQueryParam
broadcastQueryParam
);
/**
* 导出播报设备
* @author tzl
* @date 2022/5/6 8:56
* @param broadcastQueryParam BroadcastQueryParam
* @param response HttpServletResponse
*/
void
exportBroadcast
(
BroadcastQueryParam
broadcastQueryParam
,
HttpServletResponse
response
);
/**
* 播报设备导入
* @author tzl
* @date 2022/5/6 10:00
* @param file 文件
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
importBroadcast
(
MultipartFile
file
);
/**
* 根据名字检索
* @author tzl
* @date 2022/5/6 10:26
* @param indexParam 入参
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.vo.broadcast.BroadcastVo>>
*/
Result
<
PageVo
<
BroadcastjcVo
>>
selectBroadcastName
(
IndexParam
indexParam
);
}
app/src/main/java/com/yiring/app/service/broadcast/impl/BroadcastAudioServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
broadcast
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.app.domain.broadcast.BroadcastAudio
;
import
com.yiring.app.domain.broadcast.BroadcastAudioRepository
;
import
com.yiring.app.param.broadcast.BroadcastAudioAddParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioFindParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioModifyParam
;
import
com.yiring.app.service.broadcast.BroadcastAudioService
;
import
com.yiring.app.vo.broadcast.BroadcastAudioIndexVo
;
import
com.yiring.app.vo.broadcast.BroadcastAudioVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@Slf4j
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
public
class
BroadcastAudioServiceImpl
implements
BroadcastAudioService
{
@Resource
BroadcastAudioRepository
broadcastAudioRepository
;
@Override
public
Result
<
String
>
save
(
BroadcastAudioAddParam
param
)
{
broadcastAudioRepository
.
save
(
BroadcastAudioAddParam
.
transform
(
param
));
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
delete
(
IdParam
idParam
)
{
Optional
<
BroadcastAudio
>
byId
=
broadcastAudioRepository
.
findById
(
idParam
.
getId
());
if
(
byId
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"信息不存在"
);
BroadcastAudio
broadcastAudio
=
byId
.
get
();
broadcastAudioRepository
.
delete
(
broadcastAudio
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
modify
(
BroadcastAudioModifyParam
param
)
{
Optional
<
BroadcastAudio
>
byId
=
broadcastAudioRepository
.
findById
(
param
.
getId
());
if
(
byId
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"信息不存在"
);
BroadcastAudio
broadcastAudio
=
byId
.
get
();
broadcastAudio
.
setDescribe
(
param
.
getDescribe
());
broadcastAudio
.
setName
(
param
.
getName
());
broadcastAudio
.
setUri
(
param
.
getUri
());
broadcastAudioRepository
.
save
(
broadcastAudio
);
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
BroadcastAudioVo
>>
page
(
BroadcastAudioFindParam
param
,
PageParam
pageParam
)
{
Specification
<
BroadcastAudio
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
BroadcastAudio
.
Fields
.
name
),
"%"
+
param
.
getName
()
+
"%"
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
BroadcastAudio
>
broadcastAudios
=
broadcastAudioRepository
.
findAll
(
specification
,
pageable
);
List
<
BroadcastAudioVo
>
broadcastAudioVos
=
broadcastAudios
.
getContent
()
.
stream
()
.
map
(
BroadcastAudioVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
BroadcastAudioVo
>
pageVo
=
PageVo
.
build
(
broadcastAudioVos
,
broadcastAudios
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
@Override
public
Result
<
PageVo
<
BroadcastAudioIndexVo
>>
index
(
IndexParam
indexParam
)
{
Specification
<
BroadcastAudio
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
ObjectUtil
.
isNotEmpty
(
indexParam
.
getStr
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
BroadcastAudio
.
Fields
.
name
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
BroadcastAudio
>
broadcastAudios
=
broadcastAudioRepository
.
findAll
(
specification
);
List
<
BroadcastAudioIndexVo
>
broadcastAudioIndexVos
=
broadcastAudios
.
stream
()
.
map
(
BroadcastAudioIndexVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
BroadcastAudioIndexVo
>
pageVo
=
PageVo
.
build
(
broadcastAudioIndexVos
,
broadcastAudioIndexVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/broadcast/impl/BroadcastServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
broadcast
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.github.liaochong.myexcel.core.SaxExcelReader
;
import
com.yiring.app.domain.broadcast.Broadcast
;
import
com.yiring.app.domain.broadcast.BroadcastRepository
;
import
com.yiring.app.excel.broadcast.BroadcastExportExcel
;
import
com.yiring.app.excel.broadcast.BroadcastImportExcel
;
import
com.yiring.app.param.broadcast.BroadcastParam
;
import
com.yiring.app.param.broadcast.BroadcastQueryParam
;
import
com.yiring.app.service.broadcast.BroadcastService
;
import
com.yiring.app.util.GeoUtils
;
import
com.yiring.app.vo.broadcast.BroadcastVo
;
import
com.yiring.app.vo.broadcast.BroadcastjcVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.vo.PageVo
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:32
*/
@Slf4j
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
public
class
BroadcastServiceImpl
implements
BroadcastService
{
@Resource
BroadcastRepository
broadcastRepository
;
@Override
public
Result
<
String
>
saveBroadcast
(
BroadcastParam
broadcastParam
)
{
if
(
has
(
broadcastParam
.
getBroadcastNum
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"播报设备编号已存在"
);
}
Broadcast
broadcast
=
new
Broadcast
();
BeanUtils
.
copyProperties
(
broadcastParam
,
broadcast
);
broadcast
.
setPoint
(
GeoUtils
.
createPoint
(
broadcastParam
.
getLon
(),
broadcastParam
.
getLat
()));
broadcastRepository
.
saveAndFlush
(
broadcast
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
updateBroadcast
(
BroadcastParam
broadcastParam
,
IdParam
idParam
)
{
Optional
<
Broadcast
>
byId
=
broadcastRepository
.
findById
(
idParam
.
getId
());
if
(
byId
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Broadcast
broadcast
=
byId
.
get
();
if
(!
broadcast
.
getBroadcastNum
().
equals
(
broadcastParam
.
getBroadcastNum
()))
{
if
(
has
(
broadcastParam
.
getBroadcastNum
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"播报设备编号已存在"
);
}
}
BeanUtils
.
copyProperties
(
broadcastParam
,
broadcast
);
broadcast
.
setPoint
(
GeoUtils
.
createPoint
(
broadcastParam
.
getLon
(),
broadcastParam
.
getLat
()));
broadcastRepository
.
saveAndFlush
(
broadcast
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
deleteBroadcast
(
IdParam
idParam
)
{
Optional
<
Broadcast
>
byId
=
broadcastRepository
.
findById
(
idParam
.
getId
());
if
(
byId
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Broadcast
broadcast
=
byId
.
get
();
broadcastRepository
.
delete
(
broadcast
);
return
Result
.
ok
();
}
@Override
public
Result
<
Point
>
selectPoint
(
IdParam
idParam
)
{
Optional
<
Broadcast
>
byId
=
broadcastRepository
.
findById
(
idParam
.
getId
());
if
(
byId
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Broadcast
broadcast
=
byId
.
get
();
return
Result
.
ok
(
broadcast
.
getPoint
());
}
@Override
public
Result
<
PageVo
<
BroadcastVo
>>
pageBroadcast
(
BroadcastQueryParam
broadcastQueryParam
)
{
PageVo
<
BroadcastVo
>
resultVo
;
//排序
Sort
sort
=
Sort
.
by
(
Sort
.
Order
.
desc
(
Broadcast
.
Fields
.
updateTime
));
if
(
Objects
.
nonNull
(
broadcastQueryParam
.
getPageNo
())
&&
Objects
.
nonNull
(
broadcastQueryParam
.
getPageSize
()))
{
//分页
Pageable
pageable
=
PageRequest
.
of
(
broadcastQueryParam
.
getPageNo
()
-
1
,
broadcastQueryParam
.
getPageSize
());
Page
<
Broadcast
>
all
=
broadcastRepository
.
findAll
(
condition
(
broadcastQueryParam
),
pageable
);
List
<
BroadcastVo
>
data
=
all
.
get
()
.
map
(
invitation
->
{
BroadcastVo
vo
=
new
BroadcastVo
();
BeanUtils
.
copyProperties
(
invitation
,
vo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
}
else
{
List
<
Broadcast
>
all
=
broadcastRepository
.
findAll
(
condition
(
broadcastQueryParam
),
sort
);
List
<
BroadcastVo
>
data
=
all
.
stream
()
.
map
(
invitation
->
{
BroadcastVo
vo
=
new
BroadcastVo
();
BeanUtils
.
copyProperties
(
invitation
,
vo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
data
.
size
());
}
return
Result
.
ok
(
resultVo
);
}
@Override
public
Result
<
String
>
importBroadcast
(
MultipartFile
file
)
{
if
(
file
.
isEmpty
())
{
throw
new
RuntimeException
(
"请选择文件"
);
}
List
<
BroadcastImportExcel
>
broadcastImportExcels
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
broadcastImportExcels
=
SaxExcelReader
.
of
(
BroadcastImportExcel
.
class
)
.
rowFilter
(
row
->
row
.
getRowNum
()
>
0
)
.
ignoreBlankRow
()
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
}
List
<
Broadcast
>
broadcasts
=
broadcastImportExcels
.
stream
()
.
map
(
broadcastImportExcel
->
{
Broadcast
broadcast
=
new
Broadcast
();
BeanUtils
.
copyProperties
(
broadcastImportExcel
,
broadcast
);
broadcast
.
setPoint
(
GeoUtils
.
createPoint
(
broadcastImportExcel
.
getLon
(),
broadcastImportExcel
.
getLat
()));
broadcast
.
setCreateTime
(
LocalDateTime
.
now
());
return
broadcast
;
})
.
toList
();
//检查是否有编号重复的数据
if
(
broadcasts
!=
null
)
{
broadcasts
.
forEach
(
broadcast
->
broadcastRepository
.
findOne
((
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
new
ArrayList
<>();
if
(
StrUtil
.
isNotBlank
(
broadcast
.
getBroadcastNum
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Broadcast
.
Fields
.
broadcastNum
).
as
(
String
.
class
),
broadcast
.
getBroadcastNum
()
)
);
}
return
cq
.
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
})
.
ifPresent
(
one
->
{
//如果存在则操作修改
broadcast
.
setId
(
one
.
getId
());
})
);
//根据编号去重
broadcasts
=
broadcasts
.
stream
()
.
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
Broadcast:
:
getBroadcastNum
))
),
ArrayList:
:
new
)
);
broadcastRepository
.
saveAllAndFlush
(
broadcasts
);
}
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
BroadcastjcVo
>>
selectBroadcastName
(
IndexParam
indexParam
)
{
Sort
sort
=
Sort
.
by
(
Sort
.
Order
.
desc
(
Broadcast
.
Fields
.
updateTime
));
List
<
Broadcast
>
all
=
broadcastRepository
.
findAll
(
condition
(
BroadcastQueryParam
.
builder
().
broadcastName
(
indexParam
.
getStr
()).
build
()),
sort
);
List
<
BroadcastjcVo
>
data
=
all
.
stream
()
.
map
(
broadcast
->
{
BroadcastjcVo
vo
=
new
BroadcastjcVo
();
BeanUtils
.
copyProperties
(
broadcast
,
vo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
PageVo
<
BroadcastjcVo
>
resultVo
=
PageVo
.
build
(
data
,
data
.
size
());
return
Result
.
ok
(
resultVo
);
}
@Override
public
void
exportBroadcast
(
BroadcastQueryParam
broadcastQueryParam
,
HttpServletResponse
response
)
{
List
<
Broadcast
>
broadcasts
=
broadcastRepository
.
findAll
(
condition
(
broadcastQueryParam
));
List
<
BroadcastExportExcel
>
broadcastExportExcels
=
broadcasts
.
stream
()
.
map
(
broadcast
->
{
BroadcastExportExcel
broadcastExportExcel
=
new
BroadcastExportExcel
();
BeanUtils
.
copyProperties
(
broadcast
,
broadcastExportExcel
);
broadcastExportExcel
.
setLon
(
broadcast
.
getPoint
().
getX
());
broadcastExportExcel
.
setLat
(
broadcast
.
getPoint
().
getY
());
return
broadcastExportExcel
;
})
.
toList
();
try
(
DefaultStreamExcelBuilder
<
BroadcastExportExcel
>
defaultStreamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
BroadcastExportExcel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
widths
(
8
)
.
style
(
"cell->vertical-align:center;text-align:center"
,
"title->vertical-align:center;text-align:center;font-weight:bold;font-family:等线"
)
.
start
()
)
{
defaultStreamExcelBuilder
.
append
(
broadcastExportExcels
);
String
fileName
=
URLEncoder
.
encode
(
"播报信息信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
Workbook
workbook
=
defaultStreamExcelBuilder
.
fixedTitles
().
build
();
workbook
.
write
(
out
);
workbook
.
close
();
out
.
flush
();
out
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"导出播报信息信息失败: "
+
e
.
getMessage
());
}
}
public
Specification
<
Broadcast
>
condition
(
BroadcastQueryParam
broadcastQueryParam
)
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
List
<
Predicate
>
list
=
new
ArrayList
<>();
if
(
StrUtil
.
isNotBlank
(
broadcastQueryParam
.
getBroadcastName
()))
{
list
.
add
(
criteriaBuilder
.
like
(
root
.
get
(
Broadcast
.
Fields
.
broadcastName
).
as
(
String
.
class
),
"%"
+
broadcastQueryParam
.
getBroadcastName
()
+
"%"
)
);
}
if
(
StrUtil
.
isNotBlank
(
broadcastQueryParam
.
getBroadcastNum
()))
{
list
.
add
(
criteriaBuilder
.
like
(
root
.
get
(
Broadcast
.
Fields
.
broadcastNum
).
as
(
String
.
class
),
"%"
+
broadcastQueryParam
.
getBroadcastNum
()
+
"%"
)
);
}
if
(
StrUtil
.
isNotBlank
(
broadcastQueryParam
.
getStatus
()))
{
list
.
add
(
criteriaBuilder
.
like
(
root
.
get
(
Broadcast
.
Fields
.
status
).
as
(
String
.
class
),
"%"
+
broadcastQueryParam
.
getStatus
()
+
"%"
)
);
}
Order
order
=
criteriaBuilder
.
desc
(
root
.
get
(
Broadcast
.
Fields
.
updateTime
));
Predicate
[]
predicates
=
new
Predicate
[
list
.
size
()];
query
.
where
(
list
.
toArray
(
predicates
));
query
.
orderBy
(
order
);
return
criteriaBuilder
.
and
(
list
.
toArray
(
predicates
));
};
}
boolean
has
(
String
param
)
{
Broadcast
broadcast
=
Broadcast
.
builder
().
broadcastNum
(
param
).
build
();
return
broadcastRepository
.
count
(
Example
.
of
(
broadcast
))
>
0
;
}
}
app/src/main/java/com/yiring/app/service/dept/impl/DepartmentServiceImpl.java
浏览文件 @
c28135da
...
@@ -77,7 +77,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -77,7 +77,7 @@ public class DepartmentServiceImpl implements DepartmentService {
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddParam
)
{
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddParam
)
{
// 查询用户相关信息
// 查询用户相关信息
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
departmentAddParam
.
getId
()).
build
())
Example
.
of
(
User
.
builder
().
id
(
departmentAddParam
.
get
Leader
Id
()).
build
())
);
);
Department
department
=
DepartmentAddParam
.
transform
(
departmentAddParam
);
Department
department
=
DepartmentAddParam
.
transform
(
departmentAddParam
);
userOptional
.
ifPresent
(
department:
:
setLeader
);
userOptional
.
ifPresent
(
department:
:
setLeader
);
...
@@ -101,7 +101,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -101,7 +101,7 @@ public class DepartmentServiceImpl implements DepartmentService {
ZyUtil
.
clientLogin
()
ZyUtil
.
clientLogin
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
ZyDepartmentFindParam
zyDepartmentFindParam
=
ZyDepartmentFindParam
ZyDepartmentFindParam
zyDepartmentFindParam
=
ZyDepartmentFindParam
...
@@ -205,7 +205,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -205,7 +205,7 @@ public class DepartmentServiceImpl implements DepartmentService {
JSONObject
jsonObject
=
departmentClient
.
deptDelete
(
departmentOptional
.
get
().
getLinkId
(),
ZyUtil
.
clientLogin
());
JSONObject
jsonObject
=
departmentClient
.
deptDelete
(
departmentOptional
.
get
().
getLinkId
(),
ZyUtil
.
clientLogin
());
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
departmentRepository
.
deleteById
(
idParam
.
getId
());
departmentRepository
.
deleteById
(
idParam
.
getId
());
return
Result
.
ok
();
return
Result
.
ok
();
...
@@ -250,6 +250,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -250,6 +250,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
Result
.
no
(
Status
.
BAD_REQUEST
);
return
Result
.
no
(
Status
.
BAD_REQUEST
);
}
}
Department
department
=
departmentOptional
.
get
();
departmentModifyParam
.
transform
(
departmentModifyParam
,
department
);
Long
linkId
=
pidDeptOptional
.
get
().
getLinkId
();
Long
linkId
=
pidDeptOptional
.
get
().
getLinkId
();
ZyDepartmentModifyParam
zyDepartmentModifyParam
=
ZyDepartmentModifyParam
.
transform
(
ZyDepartmentModifyParam
zyDepartmentModifyParam
=
ZyDepartmentModifyParam
.
transform
(
...
@@ -263,11 +266,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -263,11 +266,9 @@ public class DepartmentServiceImpl implements DepartmentService {
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
Department
department
=
departmentOptional
.
get
();
departmentModifyParam
.
transform
(
departmentModifyParam
,
department
);
departmentRepository
.
save
(
department
);
departmentRepository
.
save
(
department
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -285,7 +286,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -285,7 +286,7 @@ public class DepartmentServiceImpl implements DepartmentService {
.
read
(
inputStream
);
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"文件导入异常"
);
}
}
// 拿到所有部门
// 拿到所有部门
...
@@ -363,6 +364,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -363,6 +364,7 @@ public class DepartmentServiceImpl implements DepartmentService {
return
departmentVos
return
departmentVos
.
stream
()
.
stream
()
.
filter
(
departmentVo
->
pid
.
equals
(
departmentVo
.
getPid
()))
.
filter
(
departmentVo
->
pid
.
equals
(
departmentVo
.
getPid
()))
.
sorted
(
Comparator
.
comparing
(
DepartmentVo:
:
getCreateTime
).
reversed
())
.
peek
(
departmentVo
->
{
.
peek
(
departmentVo
->
{
departmentVo
.
setPName
(
pName
);
departmentVo
.
setPName
(
pName
);
departmentVo
.
setChildList
(
getChildrenList
(
departmentVo
.
getId
(),
departmentVo
.
getName
(),
departmentVos
));
departmentVo
.
setChildList
(
getChildrenList
(
departmentVo
.
getId
(),
departmentVo
.
getName
(),
departmentVos
));
...
...
app/src/main/java/com/yiring/app/service/icon/IconService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
icon
;
import
com.yiring.app.param.icon.IconParam
;
import
com.yiring.app.vo.icon.IconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* @author tzl
* @date 2022/5/5 9:28
*/
public
interface
IconService
{
/**
* 图标新增接口
* @author tzl
* @date 2022/5/5 10:03
* @param iconParam IconParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
saveIcon
(
IconParam
iconParam
);
/**
* 图标删除接口
* @author tzl
* @date 2022/5/5 10:23
* @param idParam IdParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
deleteIcon
(
IdParam
idParam
);
/**
* 图标修改接口
* @author tzl
* @date 2022/5/5 10:26
* @param iconParam IconParam
* @param idParam IdParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
String
>
updateIcon
(
IconParam
iconParam
,
IdParam
idParam
);
/**
* 分页查询
* @author tzl
* @date 2022/5/5 15:09
* @param pageParam PageParam
* @return com.yiring.common.core.Result<java.lang.String>
*/
Result
<
PageVo
<
IconVo
>>
pageIcon
(
PageParam
pageParam
);
}
app/src/main/java/com/yiring/app/service/icon/impl/IconServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
icon
.
impl
;
import
com.yiring.app.domain.icon.Icon
;
import
com.yiring.app.domain.icon.IconRepository
;
import
com.yiring.app.param.icon.IconParam
;
import
com.yiring.app.service.icon.IconService
;
import
com.yiring.app.vo.icon.IconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.*
;
import
org.springframework.stereotype.Service
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 9:28
*/
@Service
public
class
IconServiceImpl
implements
IconService
{
@Resource
IconRepository
iconRepository
;
@Override
public
Result
<
String
>
saveIcon
(
IconParam
iconParam
)
{
if
(
hasIconName
(
iconParam
.
getIconName
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"图标名称已存在"
);
}
Icon
icon
=
new
Icon
();
BeanUtils
.
copyProperties
(
iconParam
,
icon
);
iconRepository
.
saveAndFlush
(
icon
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
deleteIcon
(
IdParam
idParam
)
{
Optional
<
Icon
>
optional
=
iconRepository
.
findById
(
idParam
.
getId
());
if
(
optional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Icon
icon
=
optional
.
get
();
iconRepository
.
delete
(
icon
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
updateIcon
(
IconParam
iconParam
,
IdParam
idParam
)
{
Optional
<
Icon
>
optional
=
iconRepository
.
findById
(
idParam
.
getId
());
if
(
optional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Icon
icon
=
optional
.
get
();
//当修改图标名称时
if
(!
icon
.
getIconName
().
equals
(
iconParam
.
getIconName
()))
{
if
(
hasIconName
(
iconParam
.
getIconName
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"图标名称已存在"
);
}
}
BeanUtils
.
copyProperties
(
iconParam
,
icon
);
iconRepository
.
saveAndFlush
(
icon
);
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
IconVo
>>
pageIcon
(
PageParam
pageParam
)
{
//分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
Icon
>
all
=
iconRepository
.
findAll
(
pageable
);
List
<
IconVo
>
data
=
all
.
get
()
.
map
(
icon
->
{
IconVo
vo
=
new
IconVo
();
BeanUtils
.
copyProperties
(
icon
,
vo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
PageVo
<
IconVo
>
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
return
Result
.
ok
(
resultVo
);
}
public
boolean
hasIconName
(
String
param
)
{
Icon
icon
=
Icon
.
builder
().
iconName
(
param
).
build
();
long
count
=
iconRepository
.
count
(
Example
.
of
(
icon
));
return
count
>
0
;
}
}
app/src/main/java/com/yiring/app/service/key/KeyAlarmService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/10
*/
public
interface
KeyAlarmService
{
/**
* 表格查询
* @param param KeyAlarmFindParam
* @param pageParam PageParam
* @return Result<PageVo<KeyAlarmVo>>
*/
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
);
}
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.app.domain.key.KeyAlarm
;
import
com.yiring.app.domain.key.KeyAlarmRepository
;
import
com.yiring.app.domain.key.KeyAlarmRules
;
import
com.yiring.app.domain.key.KeyAlarmRulesRepository
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.service.key.KeyAlarmService
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
KeyAlarmServiceImpl
implements
KeyAlarmService
{
@Resource
KeyAlarmRepository
keyAlarmRepository
;
@Resource
KeyAlarmRulesRepository
keyAlarmRulesRepository
;
@Override
public
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
)
{
Specification
<
KeyAlarm
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getAreaId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
areaId
),
param
.
getAreaId
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
KeyAlarm
.
Fields
.
leader
).
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getName
()
+
"%"
)
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
enable
),
param
.
getEnable
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getCreateTime
()))
{
predicates
.
add
(
cb
.
lessThan
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
),
param
.
getCreateTime
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEndTime
()))
{
predicates
.
add
(
cb
.
greaterThan
(
root
.
get
(
BasicEntity
.
Fields
.
updateTime
),
param
.
getEndTime
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
KeyAlarm
>
keyAlarms
=
keyAlarmRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmVo
>
keyAlarmVos
=
keyAlarms
.
getContent
()
.
stream
()
.
map
(
keyAlarm
->
{
KeyAlarmVo
keyAlarmVo
=
KeyAlarmVo
.
transform
(
keyAlarm
);
User
leader
=
keyAlarm
.
getLeader
();
if
(
ObjectUtil
.
isNotEmpty
(
leader
))
{
UserVo
userVo
=
UserVo
.
builder
()
.
id
(
leader
.
getId
())
.
realName
(
leader
.
getRealName
())
.
uuid
(
leader
.
getUuid
())
.
departmentId
(
leader
.
getDepartment
().
getId
())
.
build
();
keyAlarmVo
.
setUser
(
userVo
);
}
Optional
<
KeyAlarmRules
>
keyAlarmRulesOptional
=
keyAlarmRulesRepository
.
findById
(
leader
.
getDepartment
().
getId
()
);
if
(
keyAlarmRulesOptional
.
isPresent
())
{
KeyAlarmRules
keyAlarmRules
=
keyAlarmRulesOptional
.
get
();
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
List
<
String
>
names
=
users
.
stream
().
map
(
User:
:
getRealName
).
collect
(
Collectors
.
toList
());
keyAlarmVo
.
setReceiver
(
StrUtil
.
join
(
","
,
names
));
}
return
keyAlarmVo
;
})
.
collect
(
Collectors
.
toList
());
PageVo
<
KeyAlarmVo
>
pageVo
=
PageVo
.
build
(
keyAlarmVos
,
keyAlarms
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/location/beacon/impl/LocationBeaconServiceImpl.java
浏览文件 @
c28135da
...
@@ -15,6 +15,7 @@ import com.yiring.app.param.location.beacon.LocationBeaconAddParam;
...
@@ -15,6 +15,7 @@ import com.yiring.app.param.location.beacon.LocationBeaconAddParam;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.util.GeoUtils
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
...
@@ -191,8 +192,12 @@ public class LocationBeaconServiceImpl implements LocationBeaconService {
...
@@ -191,8 +192,12 @@ public class LocationBeaconServiceImpl implements LocationBeaconService {
locationBeacon
.
setTime
(
locationBeaconAddParam
.
getTime
());
locationBeacon
.
setTime
(
locationBeaconAddParam
.
getTime
());
locationBeacon
.
setVolt
(
locationBeaconAddParam
.
getVolt
());
locationBeacon
.
setVolt
(
locationBeaconAddParam
.
getVolt
());
locationBeacon
.
setVoltUnit
(
locationBeaconAddParam
.
getVoltUnit
());
locationBeacon
.
setVoltUnit
(
locationBeaconAddParam
.
getVoltUnit
());
// locationBeacon.setPoint(GeoUtils.xyzToPoint(
locationBeacon
.
setPoint
(
// locationBeaconAddParam.getPointX().doubleValue(),locationBeaconAddParam.getPointY().doubleValue(),locationBeaconAddParam.getPointZ().doubleValue()
GeoUtils
.
xyzToPoint
(
// ));
locationBeaconAddParam
.
getX
().
doubleValue
(),
locationBeaconAddParam
.
getY
().
doubleValue
(),
locationBeaconAddParam
.
getZ
().
doubleValue
()
)
);
}
}
}
}
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagServiceImpl.java
浏览文件 @
c28135da
...
@@ -16,7 +16,10 @@ import com.yiring.app.domain.location.LocationTagRepository;
...
@@ -16,7 +16,10 @@ import com.yiring.app.domain.location.LocationTagRepository;
import
com.yiring.app.excel.location.tag.LocationTagExportExcel
;
import
com.yiring.app.excel.location.tag.LocationTagExportExcel
;
import
com.yiring.app.excel.location.tag.LocationTagImportExcel
;
import
com.yiring.app.excel.location.tag.LocationTagImportExcel
;
import
com.yiring.app.feign.zy.location.tag.LocationTagClient
;
import
com.yiring.app.feign.zy.location.tag.LocationTagClient
;
import
com.yiring.app.param.location.tag.*
;
import
com.yiring.app.param.location.tag.LocationTagAddParam
;
import
com.yiring.app.param.location.tag.LocationTagDeleteParam
;
import
com.yiring.app.param.location.tag.LocationTagExportParam
;
import
com.yiring.app.param.location.tag.LocationTagFindParam
;
import
com.yiring.app.param.zy.location.tag.ZyLocationTagAddParam
;
import
com.yiring.app.param.zy.location.tag.ZyLocationTagAddParam
;
import
com.yiring.app.service.location.tag.LocationTagService
;
import
com.yiring.app.service.location.tag.LocationTagService
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
...
@@ -24,6 +27,7 @@ import com.yiring.app.vo.location.tag.LocationTagIndexVo;
...
@@ -24,6 +27,7 @@ import com.yiring.app.vo.location.tag.LocationTagIndexVo;
import
com.yiring.app.vo.location.tag.LocationTagVo
;
import
com.yiring.app.vo.location.tag.LocationTagVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.param.PageParam
;
...
@@ -33,7 +37,10 @@ import java.io.InputStream;
...
@@ -33,7 +37,10 @@ import java.io.InputStream;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -42,7 +49,10 @@ import javax.persistence.criteria.Predicate;
...
@@ -42,7 +49,10 @@ import javax.persistence.criteria.Predicate;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.domain.Example
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -120,7 +130,7 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -120,7 +130,7 @@ public class LocationTagServiceImpl implements LocationTagService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagFindParam
.
getSilent
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagFindParam
.
getSilent
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
...
@@ -183,7 +193,7 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -183,7 +193,7 @@ public class LocationTagServiceImpl implements LocationTagService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagExportParam
.
getSilent
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagExportParam
.
getSilent
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
...
@@ -318,7 +328,7 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -318,7 +328,7 @@ public class LocationTagServiceImpl implements LocationTagService {
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
...
@@ -348,7 +358,11 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -348,7 +358,11 @@ public class LocationTagServiceImpl implements LocationTagService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagFindParam
.
getSilent
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagFindParam
.
getSilent
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
if
(
ObjectUtil
.
isNotEmpty
(
locationTagFindParam
.
getUsed
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
used
),
locationTagFindParam
.
getUsed
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
...
...
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagTypeServiceImpl.java
浏览文件 @
c28135da
...
@@ -17,6 +17,7 @@ import com.yiring.app.service.location.tag.LocationTagTypeService;
...
@@ -17,6 +17,7 @@ import com.yiring.app.service.location.tag.LocationTagTypeService;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
...
@@ -34,7 +35,7 @@ import org.springframework.stereotype.Service;
...
@@ -34,7 +35,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
*
部门信息控制器
*
标签分配
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/27
* @date 2022/4/27
...
@@ -71,7 +72,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -71,7 +72,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
category
),
locationTagTypeFindParam
.
getCategory
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
category
),
locationTagTypeFindParam
.
getCategory
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
...
@@ -90,7 +91,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -90,7 +91,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
ZyLocationTagTypeSendParam
zyLocationTagTypeSendParam
=
ZyLocationTagTypeSendParam
ZyLocationTagTypeSendParam
zyLocationTagTypeSendParam
=
ZyLocationTagTypeSendParam
.
builder
()
.
builder
()
.
orgId
(
FACTORY_ID
)
.
orgId
(
FACTORY_ID
)
.
category
(
locationtagtypeSendParam
.
getCategory
(
))
.
category
(
Convert
.
toStr
(
locationtagtypeSendParam
.
getCategory
()
))
.
build
();
.
build
();
String
[]
split
=
locationtagtypeSendParam
.
getIds
().
split
(
","
);
String
[]
split
=
locationtagtypeSendParam
.
getIds
().
split
(
","
);
...
@@ -107,7 +108,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -107,7 +108,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
ZyUtil
.
manageLogin
()
ZyUtil
.
manageLogin
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
...
@@ -118,14 +119,14 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -118,14 +119,14 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
predicates
.
add
(
cb
.
and
(
in
));
predicates
.
add
(
cb
.
and
(
in
));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
List
<
LocationTag
>
locationTags
=
locationTagRepository
.
findAll
(
specification
);
List
<
LocationTag
>
locationTags
=
locationTagRepository
.
findAll
(
specification
);
locationTags
=
locationTags
=
locationTags
locationTags
.
stream
()
.
stream
()
.
peek
(
locationTag
->
locationTag
.
setCategory
(
locationtagtypeSendParam
.
getCategory
(
)))
.
peek
(
locationTag
->
locationTag
.
setCategory
(
Convert
.
toInt
(
locationtagtypeSendParam
.
getCategory
()
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
locationTagRepository
.
saveAll
(
locationTags
);
locationTagRepository
.
saveAll
(
locationTags
);
return
Result
.
ok
();
return
Result
.
ok
();
...
...
app/src/main/java/com/yiring/app/service/message/ZyMessageService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
message
;
/**
* 真源消息处理 Service
*
* @author Jim
* @version 0.1
* 2022/5/9 10:16
*/
public
interface
ZyMessageService
{
/**
* 消费消息
* @param message 消息内容
*/
void
consume
(
String
message
);
}
app/src/main/java/com/yiring/app/service/message/impl/ZyMessageServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
message
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yiring.app.domain.location.*
;
import
com.yiring.app.domain.log.ZyRealtimeLog
;
import
com.yiring.app.domain.log.ZyRealtimeLogRepository
;
import
com.yiring.app.service.message.ZyMessageService
;
import
com.yiring.app.util.GeoUtils
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.annotation.Times
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.util.Arrays
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.data.domain.Example
;
import
org.springframework.messaging.simp.SimpMessagingTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 真源消息处理实现类
*
* @author Jim
* @version 0.1
* 2022/5/9 10:22
*/
@Slf4j
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
ZyMessageServiceImpl
implements
ZyMessageService
{
@Resource
LocationTagRepository
locationTagRepository
;
@Resource
LocationLogRepository
locationLogRepository
;
@Resource
SimpMessagingTemplate
simpMessagingTemplate
;
@Resource
ZyRealtimeLogRepository
zyRealtimeLogRepository
;
@Times
@Override
public
void
consume
(
String
message
)
{
// 将消息转换成 JSON 格式
JSONObject
info
=
JSON
.
parseObject
(
message
);
log
.
info
(
"Receiver Message: {}"
,
info
);
// 解构消息内容
JSONObject
data
=
info
.
getJSONObject
(
"params"
);
String
method
=
info
.
getString
(
"method"
);
// 记录日志
ZyRealtimeLog
realtimeLog
=
ZyRealtimeLog
.
builder
().
method
(
method
).
raw
(
info
).
build
();
zyRealtimeLogRepository
.
save
(
realtimeLog
);
// 业务处理
switch
(
method
)
{
// 实时定位
case
"position"
->
processPositionMessage
(
data
);
// 设备低电量
case
"lowPower"
->
processLowPowerMessage
(
data
);
// 设备状态变更
case
"deviceStatus"
->
processDeviceStatusMessage
(
data
);
// 按键报警
case
"keyWarning"
->
processKeyWarningMessage
(
data
);
// 围栏报警
case
"enclosure"
->
log
.
warn
(
"Ignore Message Type [enclosure]: {}"
,
info
);
default
->
log
.
warn
(
"Unknown Message Type: {}"
,
info
);
}
}
/**
* 处理定位消息
* @param data 消息内容
*/
public
void
processPositionMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"Position Message: {}"
,
data
);
// 包装消息
// TODO
// 1. 解析消息内容,进行围栏、出入标识判断等处理,将定位记录录入数据库
// 2. 创建一条需要进行消息推送的记录
// 3. 将记录推送的消息推送模块
// 4. 检查是否触发围栏告警,记录告警数据,并推送消息
// 查询定位标签
String
tagId
=
data
.
getString
(
"tagId"
);
Example
<
LocationTag
>
example
=
Example
.
of
(
LocationTag
.
builder
().
code
(
tagId
).
build
());
Optional
<
LocationTag
>
optional
=
locationTagRepository
.
findOne
(
example
);
if
(
optional
.
isEmpty
())
{
log
.
warn
(
"Tag Not Found: {}"
,
tagId
);
return
;
}
// 构建复合主键
LocationTag
tag
=
optional
.
get
();
TagTimeId
id
=
new
TagTimeId
(
tag
);
// 定位时间
Instant
instant
=
Instant
.
ofEpochMilli
(
data
.
getLongValue
(
"locationTime"
));
LocalDateTime
locationTime
=
LocalDateTime
.
ofInstant
(
instant
,
ZoneId
.
systemDefault
());
// 定位的基本信息
LocationLog
locationLog
=
LocationLog
.
builder
()
.
id
(
id
)
.
locationTime
(
locationTime
)
.
areaId
(
data
.
getLong
(
"areaId"
))
.
floor
(
data
.
getString
(
"floor"
))
.
silent
(
data
.
getBoolean
(
"silent"
))
.
volt
(
data
.
getInteger
(
"volt"
))
.
voltUnit
(
data
.
getString
(
"voltUnit"
))
.
raw
(
data
)
.
build
();
// 获取定位卡当前绑定的用户
User
user
=
tag
.
getUser
();
if
(
user
!=
null
)
{
// 定位标签当时所属的用户
locationLog
.
setUser
(
user
);
// 查询当前用户的状态
locationLog
.
setStatus
(
user
.
getStatus
());
}
// 设置空间点位信息
Point
point
=
GeoUtils
.
createPoint
(
data
.
getDoubleValue
(
"longitude"
),
data
.
getDoubleValue
(
"latitude"
),
data
.
getDoubleValue
(
"altitude"
)
);
locationLog
.
setPoint
(
point
);
// 定位信标
Set
<
String
>
codes
=
Arrays
.
stream
(
data
.
getString
(
"beacons"
).
split
(
","
))
.
map
(
beacon
->
beacon
.
replaceAll
(
"\\(.*\\)"
,
""
))
.
collect
(
Collectors
.
toSet
());
locationLog
.
setBeacons
(
new
JSONArray
().
fluentAddAll
(
codes
));
// TODO
// 并计算出入标记(围栏、区域)
// 写入数据
locationLogRepository
.
saveAndFlush
(
locationLog
);
// 更新定位标签卡状态信息
tag
.
setPoint
(
locationLog
.
getPoint
());
tag
.
setVolt
(
locationLog
.
getVolt
());
tag
.
setVoltUnit
(
locationLog
.
getVoltUnit
());
tag
.
setSilent
(
locationLog
.
getSilent
());
locationTagRepository
.
save
(
tag
);
// WebSocket 推送定位消息
// 消息内容需要确定 TODO
simpMessagingTemplate
.
convertAndSend
(
"/topic/position"
,
"{}"
);
// TODO
// 判断围栏告警是否触发,触发写入告警记录,并推送消息
}
/**
* 处理低电量报警消息
* @param data 消息内容
*/
public
void
processLowPowerMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"LowPower Message: {}"
,
data
);
}
/**
* 处理设备状态更新消息
* @param data 消息内容
*/
public
void
processDeviceStatusMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"DeviceStatus Message: {}"
,
data
);
}
/**
* 处理按键报警消息
* @param data 消息内容
*/
public
void
processKeyWarningMessage
(
JSONObject
data
)
{
// TODO
log
.
info
(
"KeyWarning Message: {}"
,
data
);
}
}
app/src/main/java/com/yiring/app/service/post/impl/PostServiceImpl.java
浏览文件 @
c28135da
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.ListUtil;
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.ListUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.app.excel.post.PostExportExcel
;
import
com.yiring.app.param.post.*
;
import
com.yiring.app.param.post.*
;
import
com.yiring.app.service.post.PostService
;
import
com.yiring.app.service.post.PostService
;
import
com.yiring.app.vo.post.PostIndexVo
;
import
com.yiring.app.vo.post.PostIndexVo
;
...
@@ -12,7 +13,6 @@ import com.yiring.app.vo.post.PostInfoVo;
...
@@ -12,7 +13,6 @@ import com.yiring.app.vo.post.PostInfoVo;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.PostRepository
;
import
com.yiring.auth.domain.post.PostRepository
;
import
com.yiring.auth.excel.post.PostExcel
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.domain.BasicEntity
;
...
@@ -147,10 +147,13 @@ public class PostServiceImpl implements PostService {
...
@@ -147,10 +147,13 @@ public class PostServiceImpl implements PostService {
};
};
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
PostExcel
>
postExcels
=
postList
.
stream
().
map
(
PostExcel:
:
transform
).
collect
(
Collectors
.
toList
());
List
<
PostExportExcel
>
postExcels
=
postList
.
stream
()
.
map
(
PostExportExcel:
:
transform
)
.
collect
(
Collectors
.
toList
());
try
(
try
(
DefaultStreamExcelBuilder
<
PostExcel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
DefaultStreamExcelBuilder
<
PostEx
portEx
cel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
PostExcel
.
class
)
.
of
(
PostEx
portEx
cel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
titleRowHeight
(
14
)
...
...
app/src/main/java/com/yiring/app/service/user/UserService.java
→
app/src/main/java/com/yiring/app/service/user/User
App
Service.java
浏览文件 @
c28135da
...
@@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/20
* @date 2022/4/20
*/
*/
public
interface
UserService
{
public
interface
User
App
Service
{
/**
/**
* 表格查询
* 表格查询
* @param userFindParam UserByNameParam
* @param userFindParam UserByNameParam
...
@@ -43,10 +43,10 @@ public interface UserService {
...
@@ -43,10 +43,10 @@ public interface UserService {
/**
/**
* 收卡
* 收卡
* @param id
Param Id
Param
* @param id
sParam Ids
Param
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
userUnBingTag
(
Id
Param
id
Param
);
Result
<
String
>
userUnBingTag
(
Id
sParam
ids
Param
);
/**
/**
* 删除用户
* 删除用户
...
@@ -103,4 +103,11 @@ public interface UserService {
...
@@ -103,4 +103,11 @@ public interface UserService {
* @return Result<PageVo<UserVo>>
* @return Result<PageVo<UserVo>>
*/
*/
Result
<
PageVo
<
UserVo
>>
findUser
(
UserFindParam
userFindParam
);
Result
<
PageVo
<
UserVo
>>
findUser
(
UserFindParam
userFindParam
);
/**
* 批量发卡
* @param file MultipartFile
* @return Result<String>
*/
Result
<
String
>
batchSendCard
(
MultipartFile
file
);
}
}
app/src/main/java/com/yiring/app/service/user/impl/UserServiceImpl.java
→
app/src/main/java/com/yiring/app/service/user/impl/User
App
ServiceImpl.java
浏览文件 @
c28135da
...
@@ -14,13 +14,14 @@ import com.yiring.app.domain.location.LocationTag;
...
@@ -14,13 +14,14 @@ import com.yiring.app.domain.location.LocationTag;
import
com.yiring.app.domain.location.LocationTagRepository
;
import
com.yiring.app.domain.location.LocationTagRepository
;
import
com.yiring.app.excel.user.UserExportExcel
;
import
com.yiring.app.excel.user.UserExportExcel
;
import
com.yiring.app.excel.user.UserImportExcel
;
import
com.yiring.app.excel.user.UserImportExcel
;
import
com.yiring.app.excel.user.UserSendCardExcel
;
import
com.yiring.app.feign.zy.user.UserClient
;
import
com.yiring.app.feign.zy.user.UserClient
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.zy.user.ZyUserAddParam
;
import
com.yiring.app.param.zy.user.ZyUserAddParam
;
import
com.yiring.app.param.zy.user.ZyUserFindParam
;
import
com.yiring.app.param.zy.user.ZyUserFindParam
;
import
com.yiring.app.param.zy.user.ZyUserModifyParam
;
import
com.yiring.app.param.zy.user.ZyUserModifyParam
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.user.UserService
;
import
com.yiring.app.service.user.User
App
Service
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
...
@@ -68,7 +69,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -68,7 +69,7 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Service
@Slf4j
@Slf4j
public
class
User
ServiceImpl
implements
User
Service
{
public
class
User
AppServiceImpl
implements
UserApp
Service
{
final
Integer
FACTORY_ID
=
100
;
final
Integer
FACTORY_ID
=
100
;
...
@@ -138,11 +139,11 @@ public class UserServiceImpl implements UserService {
...
@@ -138,11 +139,11 @@ public class UserServiceImpl implements UserService {
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
}
}
JSONObject
jsonObject
=
userClient
.
unbind
(
JSONObject
jsonObject
=
userClient
.
bindTag
(
user
.
getLinkId
(),
user
.
getLinkId
(),
userBingTagParam
.
getCode
(),
userBingTagParam
.
getCode
(),
FACTORY_ID
,
FACTORY_ID
,
ZyUtil
.
client
Login
()
ZyUtil
.
manage
Login
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
...
@@ -155,29 +156,36 @@ public class UserServiceImpl implements UserService {
...
@@ -155,29 +156,36 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
String
>
userUnBingTag
(
IdParam
idParam
)
{
public
Result
<
String
>
userUnBingTag
(
IdsParam
idsParam
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
idParam
.
getId
());
String
[]
split
=
idsParam
.
getIds
().
split
(
","
);
Long
[]
ids
=
Convert
.
toLongArray
(
split
);
for
(
Long
id
:
ids
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
id
);
if
(
userOptional
.
isEmpty
())
{
if
(
userOptional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"员工不存在"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"员工不存在"
);
}
}
User
user
=
userOptional
.
get
();
User
user
=
userOptional
.
get
();
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
user
(
User
.
builder
().
id
(
idParam
.
getId
()
).
build
()).
build
())
Example
.
of
(
LocationTag
.
builder
().
user
(
User
.
builder
().
id
(
id
).
build
()).
build
())
);
);
if
(
locationTagOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
if
(
locationTagOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
JSONObject
jsonObject
=
userClient
.
unbind
(
user
.
getLinkId
(),
FACTORY_ID
,
ZyUtil
.
clientLogin
());
JSONObject
jsonObject
=
userClient
.
unbind
(
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
Convert
.
toStr
(
user
.
getLinkId
()),
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
FACTORY_ID
,
ZyUtil
.
clientLogin
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
LocationTag
locationTag
=
locationTagOptional
.
get
();
locationTag
.
setUser
(
null
);
locationTag
.
setUsed
(
false
);
locationTagRepository
.
save
(
locationTag
);
}
}
LocationTag
locationTag
=
locationTagOptional
.
get
();
locationTag
.
setUser
(
null
);
locationTag
.
setUsed
(
false
);
locationTagRepository
.
save
(
locationTag
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -578,6 +586,75 @@ public class UserServiceImpl implements UserService {
...
@@ -578,6 +586,75 @@ public class UserServiceImpl implements UserService {
return
Result
.
ok
(
pageVo
);
return
Result
.
ok
(
pageVo
);
}
}
@Override
public
Result
<
String
>
batchSendCard
(
MultipartFile
file
)
{
if
(
file
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"请选择文件"
);
List
<
UserSendCardExcel
>
userSendCardExcels
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
userSendCardExcels
=
SaxExcelReader
.
of
(
UserSendCardExcel
.
class
)
.
rowFilter
(
row
->
row
.
getRowNum
()
>
0
)
.
ignoreBlankRow
()
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
}
userSendCardExcels
=
userSendCardExcels
.
stream
()
.
filter
(
userSendCardExcel
->
userRepository
.
count
(
Example
.
of
(
User
.
builder
()
.
realName
(
userSendCardExcel
.
getRealName
())
.
uuid
(
userSendCardExcel
.
getUuid
())
.
build
()
)
)
>
0
)
.
filter
(
userSendCardExcel
->
locationTagRepository
.
count
(
Example
.
of
(
LocationTag
.
builder
().
user
(
null
).
used
(
false
).
build
()))
>
0
)
.
collect
(
Collectors
.
toList
());
userSendCardExcels
.
forEach
(
userSendCardExcel
->
{
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
realName
(
userSendCardExcel
.
getRealName
()).
uuid
(
userSendCardExcel
.
getUuid
()).
build
()
)
);
if
(
userOptional
.
isPresent
())
{
User
user
=
userOptional
.
get
();
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
code
(
userSendCardExcel
.
getCode
()).
build
())
);
if
(
locationTagOptional
.
isPresent
())
{
LocationTag
locationTag
=
locationTagOptional
.
get
();
JSONObject
jsonObject
=
userClient
.
bindTag
(
user
.
getLinkId
(),
locationTag
.
getCode
(),
FACTORY_ID
,
ZyUtil
.
clientLogin
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
locationTag
.
setUser
(
User
.
builder
().
id
(
user
.
getId
()).
build
());
locationTag
.
setUsed
(
true
);
locationTagRepository
.
save
(
locationTag
);
}
}
});
return
Result
.
ok
();
}
@NotNull
@NotNull
private
CriteriaQuery
<
UserVo
>
getUserVoCriteriaQuery
(
UserFindParam
param
)
{
private
CriteriaQuery
<
UserVo
>
getUserVoCriteriaQuery
(
UserFindParam
param
)
{
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
app/src/main/java/com/yiring/app/service/video/impl/VideoServiceImpl.java
浏览文件 @
c28135da
...
@@ -258,6 +258,8 @@ public class VideoServiceImpl implements VideoService {
...
@@ -258,6 +258,8 @@ public class VideoServiceImpl implements VideoService {
.
map
(
video
->
{
.
map
(
video
->
{
VideoExportExcel
videoExportExcel
=
new
VideoExportExcel
();
VideoExportExcel
videoExportExcel
=
new
VideoExportExcel
();
BeanUtils
.
copyProperties
(
video
,
videoExportExcel
);
BeanUtils
.
copyProperties
(
video
,
videoExportExcel
);
videoExportExcel
.
setLon
(
video
.
getPoint
().
getX
());
videoExportExcel
.
setLat
(
video
.
getPoint
().
getY
());
return
videoExportExcel
;
return
videoExportExcel
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -295,7 +297,7 @@ public class VideoServiceImpl implements VideoService {
...
@@ -295,7 +297,7 @@ public class VideoServiceImpl implements VideoService {
@Override
@Override
public
Result
<
String
>
importVideo
(
MultipartFile
file
)
{
public
Result
<
String
>
importVideo
(
MultipartFile
file
)
{
if
(
file
.
isEmpty
())
{
if
(
file
.
isEmpty
())
{
throw
new
RuntimeException
(
"请选择文件"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"请选择文件"
);
}
}
List
<
VideoImportExcel
>
videoImportExcels
;
List
<
VideoImportExcel
>
videoImportExcels
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
...
@@ -307,7 +309,7 @@ public class VideoServiceImpl implements VideoService {
...
@@ -307,7 +309,7 @@ public class VideoServiceImpl implements VideoService {
.
read
(
inputStream
);
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"文件导入异常"
);
}
}
List
<
Video
>
videos
=
videoImportExcels
List
<
Video
>
videos
=
videoImportExcels
...
...
app/src/main/java/com/yiring/app/service/visitor/InvitationService.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
visitor
;
package
com
.
yiring
.
app
.
service
.
visitor
;
import
com.yiring.app.param.visitor.InvitationAppQueryParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.vo.visitor.InvitationVo
;
import
com.yiring.app.vo.visitor.Invitation
Details
Vo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
...
@@ -38,7 +39,7 @@ public interface InvitationService {
...
@@ -38,7 +39,7 @@ public interface InvitationService {
* @date 2022/4/24 17:56
* @date 2022/4/24 17:56
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<java.lang.String>>
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<java.lang.String>>
*/
*/
Result
<
PageVo
<
InvitationVo
>>
pageInv
(
InvitationQueryParam
invitationQueryParam
);
Result
<
PageVo
<
Invitation
Details
Vo
>>
pageInv
(
InvitationQueryParam
invitationQueryParam
);
/**
/**
* 撤回邀请
* 撤回邀请
...
@@ -65,4 +66,24 @@ public interface InvitationService {
...
@@ -65,4 +66,24 @@ public interface InvitationService {
* @param invitationQueryParam 筛选条件
* @param invitationQueryParam 筛选条件
*/
*/
void
exportInv
(
InvitationQueryParam
invitationQueryParam
,
HttpServletResponse
response
);
void
exportInv
(
InvitationQueryParam
invitationQueryParam
,
HttpServletResponse
response
);
/**
* 小程序查询全部
* @author tzl
* @date 2022/4/28 10:56
* @param idParam 主键id
* @return com.yiring.common.core.Result<com.yiring.app.vo.visitor.InvitationDetailsVo>
*/
Result
<
InvitationDetailsVo
>
detailsInv
(
IdParam
idParam
);
/**
* 小程序用户查看邀请信息
* @author tzl
* @date 2022/4/28 11:30
* @param invitationAppQueryParam 入参
* @return com.yiring.common.core.Result<com.yiring.common.vo.PageVo<com.yiring.app.vo.visitor.InvitationVo>>
*/
Result
<
PageVo
<
InvitationDetailsVo
>>
findAllByVisitor_VisitorMobileAndVisitor_Deleted
(
InvitationAppQueryParam
invitationAppQueryParam
);
}
}
app/src/main/java/com/yiring/app/service/visitor/VisitorService.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
visitor
;
package
com
.
yiring
.
app
.
service
.
visitor
;
import
com.yiring.app.param.visitor.VisitorAppQueryParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.vo.visitor.VisitorAppVo
;
import
com.yiring.app.vo.visitor.VisitorDetailsVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
...
@@ -15,7 +18,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -15,7 +18,7 @@ import javax.servlet.http.HttpServletResponse;
*/
*/
public
interface
VisitorService
{
public
interface
VisitorService
{
/**
/**
* 访客
新增
* 访客
登记
* @param visitorParam 新增访客入参
* @param visitorParam 新增访客入参
* @return 是否成功
* @return 是否成功
*/
*/
...
@@ -41,7 +44,7 @@ public interface VisitorService {
...
@@ -41,7 +44,7 @@ public interface VisitorService {
* @param idParam 主键id
* @param idParam 主键id
* @return 访客信息
* @return 访客信息
*/
*/
Result
<
VisitorVo
>
selectVisitor
(
IdParam
idParam
);
Result
<
Visitor
Details
Vo
>
selectVisitor
(
IdParam
idParam
);
/**
/**
* 分页查询
* 分页查询
...
@@ -73,11 +76,11 @@ public interface VisitorService {
...
@@ -73,11 +76,11 @@ public interface VisitorService {
Result
<
String
>
cardRec
(
IdParam
idParam
);
Result
<
String
>
cardRec
(
IdParam
idParam
);
/**
/**
*
查看详情,并且带出该访客的随访人信息
*
小程序查看来访记录
* @author tzl
* @author tzl
* @date 2022/4/2
5 16:48
* @date 2022/4/2
9 15:03
* @param
idParam 主键id
* @param
visitorAppQueryParam 入参
* @return com.yiring.common.core.Result<com.yiring.app.vo.visitor.VisitorVo>
* @return com.yiring.common.core.Result<com.yiring.app.vo.visitor.VisitorVo>
*/
*/
Result
<
VisitorVo
>
selectInfo
(
IdParam
id
Param
);
Result
<
PageVo
<
VisitorAppVo
>>
selectInfo
(
VisitorAppQueryParam
visitorAppQuery
Param
);
}
}
app/src/main/java/com/yiring/app/service/visitor/impl/InvitationServiceImpl.java
浏览文件 @
c28135da
...
@@ -8,10 +8,13 @@ import com.yiring.app.domain.visitor.InvitationRepository;
...
@@ -8,10 +8,13 @@ import com.yiring.app.domain.visitor.InvitationRepository;
import
com.yiring.app.domain.visitor.Visitor
;
import
com.yiring.app.domain.visitor.Visitor
;
import
com.yiring.app.domain.visitor.VisitorRepository
;
import
com.yiring.app.domain.visitor.VisitorRepository
;
import
com.yiring.app.excel.visitor.InvitationExportExcel
;
import
com.yiring.app.excel.visitor.InvitationExportExcel
;
import
com.yiring.app.param.visitor.InvitationAppQueryParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.service.visitor.InvitationService
;
import
com.yiring.app.service.visitor.InvitationService
;
import
com.yiring.app.vo.visitor.InvitationVo
;
import
com.yiring.app.vo.visitor.InvitationDetailsVo
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
...
@@ -29,6 +32,7 @@ import java.util.stream.Collectors;
...
@@ -29,6 +32,7 @@ import java.util.stream.Collectors;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Join
;
import
javax.persistence.criteria.Join
;
import
javax.persistence.criteria.JoinType
;
import
javax.persistence.criteria.JoinType
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -58,21 +62,30 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -58,21 +62,30 @@ public class InvitationServiceImpl implements InvitationService {
@Override
@Override
public
Result
<
String
>
saveInv
(
InvitationParam
invitationParam
)
{
public
Result
<
String
>
saveInv
(
InvitationParam
invitationParam
)
{
User
user
=
User
.
builder
().
id
(
invitationParam
.
getInviterId
()).
build
();
Visitor
visitor
=
new
Visitor
();
Visitor
visitor
=
new
Visitor
();
BeanUtils
.
copyProperties
(
invitationParam
,
visitor
);
BeanUtils
.
copyProperties
(
invitationParam
,
visitor
);
visitor
.
setUser
(
user
);
visitor
.
setCreateTime
(
LocalDateTime
.
now
());
visitor
.
setCreateTime
(
LocalDateTime
.
now
());
//身份证验证
// if(StrUtil.isNotBlank(invitationParam.getVisitorCarNum())){
// if (invitationParam.getVisitorCarNum().matches(RegEx.)) {
// return Result.no(Status.BAD_REQUEST, "请输入正确的车牌号码");
// }
// }
//设置创建时间和默认状态
//设置创建时间和默认状态
Invitation
invitation
=
Invitation
Invitation
invitation
=
Invitation
.
builder
()
.
builder
()
.
createTime
(
LocalDateTime
.
now
())
.
createTime
(
LocalDateTime
.
now
())
.
updateTime
(
LocalDateTime
.
now
())
.
status
(
"已发送"
)
.
status
(
"已发送"
)
.
visitor
(
visitor
)
.
visitor
(
visitor
)
.
InvitationMethod
(
invitationParam
.
getInvitationMethod
())
.
InvitationMethod
(
invitationParam
.
getInvitationMethod
())
.
numOfVisitor
(
invitationParam
.
getNumOfVisitor
())
.
numOfVisitor
(
invitationParam
.
getNumOfVisitor
())
.
inviterId
(
invitationParam
.
getInviterId
()
)
.
user
(
user
)
.
build
();
.
build
();
//添加一条访客未到访信息
//添加一条访客未到访信息
if
(
invitationParam
.
getInvitationMethod
().
equals
(
"
个人
"
))
{
if
(
invitationParam
.
getInvitationMethod
().
equals
(
"
1
"
))
{
visitor
.
setVisitorSource
(
"邀请个人"
);
visitor
.
setVisitorSource
(
"邀请个人"
);
}
else
{
}
else
{
visitor
.
setVisitorSource
(
"邀请公司"
);
visitor
.
setVisitorSource
(
"邀请公司"
);
...
@@ -95,7 +108,12 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -95,7 +108,12 @@ public class InvitationServiceImpl implements InvitationService {
Invitation
invitation
=
optional
.
get
();
Invitation
invitation
=
optional
.
get
();
Visitor
visitor2
=
invitation
.
getVisitor
();
Visitor
visitor2
=
invitation
.
getVisitor
();
if
(
invitation
.
getVisitor
().
getCardSendTime
()
!=
null
)
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"访客已到访,无法修改"
);
}
BeanUtils
.
copyProperties
(
invitationParam
,
invitation
);
BeanUtils
.
copyProperties
(
invitationParam
,
invitation
);
invitation
.
setUpdateTime
(
LocalDateTime
.
now
());
invitationRepository
.
saveAndFlush
(
invitation
);
invitationRepository
.
saveAndFlush
(
invitation
);
//修改访客未到访信息
//修改访客未到访信息
if
(
visitor2
==
null
)
{
if
(
visitor2
==
null
)
{
...
@@ -103,10 +121,13 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -103,10 +121,13 @@ public class InvitationServiceImpl implements InvitationService {
visitor2
=
new
Visitor
();
visitor2
=
new
Visitor
();
}
}
BeanUtils
.
copyProperties
(
invitationParam
,
visitor2
);
BeanUtils
.
copyProperties
(
invitationParam
,
visitor2
);
visitor2
.
setUser
(
invitation
.
getUser
());
// visitor2.setIntervieweeId(invitationParam.getInviterId());
visitorRepository
.
saveAndFlush
(
visitor2
);
visitorRepository
.
saveAndFlush
(
visitor2
);
//短信通知该手机用户
//短信通知该手机用户
//
//
//
//
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -118,7 +139,7 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -118,7 +139,7 @@ public class InvitationServiceImpl implements InvitationService {
}
}
Invitation
invitation
=
optional
.
get
();
Invitation
invitation
=
optional
.
get
();
invitationRepository
.
delete
(
invitation
);
invitationRepository
.
delete
(
invitation
);
visitorRepository
.
delete
(
invitation
.
getVisitor
());
//
visitorRepository.delete(invitation.getVisitor());
//短信通知该手机用户邀请取消
//短信通知该手机用户邀请取消
//
//
//
//
...
@@ -126,10 +147,10 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -126,10 +147,10 @@ public class InvitationServiceImpl implements InvitationService {
}
}
@Override
@Override
public
Result
<
PageVo
<
InvitationVo
>>
pageInv
(
InvitationQueryParam
invitationQueryParam
)
{
public
Result
<
PageVo
<
Invitation
Details
Vo
>>
pageInv
(
InvitationQueryParam
invitationQueryParam
)
{
PageVo
<
InvitationVo
>
resultVo
;
PageVo
<
Invitation
Details
Vo
>
resultVo
;
//排序
//排序
Sort
sort
=
Sort
.
by
(
Sort
.
Order
.
desc
(
Visitor
.
Fields
.
cre
ateTime
));
Sort
sort
=
Sort
.
by
(
Sort
.
Order
.
desc
(
Invitation
.
Fields
.
upd
ateTime
));
if
(
Objects
.
nonNull
(
invitationQueryParam
.
getPageNo
())
&&
Objects
.
nonNull
(
invitationQueryParam
.
getPageSize
()))
{
if
(
Objects
.
nonNull
(
invitationQueryParam
.
getPageNo
())
&&
Objects
.
nonNull
(
invitationQueryParam
.
getPageSize
()))
{
//分页
//分页
Pageable
pageable
=
PageRequest
.
of
(
Pageable
pageable
=
PageRequest
.
of
(
...
@@ -137,22 +158,40 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -137,22 +158,40 @@ public class InvitationServiceImpl implements InvitationService {
invitationQueryParam
.
getPageSize
()
invitationQueryParam
.
getPageSize
()
);
);
Page
<
Invitation
>
all
=
invitationRepository
.
findAll
(
condition
(
invitationQueryParam
),
pageable
);
Page
<
Invitation
>
all
=
invitationRepository
.
findAll
(
condition
(
invitationQueryParam
),
pageable
);
List
<
InvitationVo
>
data
=
all
List
<
Invitation
Details
Vo
>
data
=
all
.
get
()
.
get
()
.
map
(
invitation
->
{
.
map
(
invitation
->
{
Invitation
Vo
vo
=
new
Invitation
Vo
();
Invitation
DetailsVo
vo
=
new
InvitationDetails
Vo
();
BeanUtils
.
copyProperties
(
invitation
,
vo
);
BeanUtils
.
copyProperties
(
invitation
,
vo
);
//翻译邀请人姓名,部门
if
(
invitation
.
getUser
()
!=
null
)
{
InvitationDetailsVo
.
User
user
=
new
InvitationDetailsVo
.
User
();
user
.
setDeptName
(
invitation
.
getUser
().
getDepartment
().
getName
());
user
.
setRealName
(
invitation
.
getUser
().
getRealName
());
user
.
setMobile
(
invitation
.
getUser
().
getMobile
());
user
.
setId
(
invitation
.
getUser
().
getId
());
vo
.
setUser
(
user
);
}
return
vo
;
return
vo
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
}
else
{
}
else
{
List
<
Invitation
>
all
=
invitationRepository
.
findAll
(
condition
(
invitationQueryParam
),
sort
);
List
<
Invitation
>
all
=
invitationRepository
.
findAll
(
condition
(
invitationQueryParam
),
sort
);
List
<
InvitationVo
>
data
=
all
List
<
Invitation
Details
Vo
>
data
=
all
.
stream
()
.
stream
()
.
map
(
invitation
->
{
.
map
(
invitation
->
{
Invitation
Vo
vo
=
new
Invitation
Vo
();
Invitation
DetailsVo
vo
=
new
InvitationDetails
Vo
();
BeanUtils
.
copyProperties
(
invitation
,
vo
);
BeanUtils
.
copyProperties
(
invitation
,
vo
);
//翻译邀请人姓名,部门
if
(
invitation
.
getUser
()
!=
null
)
{
InvitationDetailsVo
.
User
user
=
new
InvitationDetailsVo
.
User
();
user
.
setDeptName
(
invitation
.
getUser
().
getDepartment
().
getName
());
user
.
setRealName
(
invitation
.
getUser
().
getRealName
());
user
.
setMobile
(
invitation
.
getUser
().
getMobile
());
user
.
setId
(
invitation
.
getUser
().
getId
());
vo
.
setUser
(
user
);
}
return
vo
;
return
vo
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -168,10 +207,14 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -168,10 +207,14 @@ public class InvitationServiceImpl implements InvitationService {
return
Result
.
no
(
Status
.
NOT_FOUND
);
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
}
Invitation
invitation
=
optional
.
get
();
Invitation
invitation
=
optional
.
get
();
if
(
invitation
.
getVisitor
().
getCardSendTime
()
!=
null
)
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"访客已到访,无法修改"
);
}
if
(
invitation
.
getVisitor
().
getAppOfVisitTime
().
isBefore
(
LocalDateTime
.
now
()))
{
if
(
invitation
.
getVisitor
().
getAppOfVisitTime
().
isBefore
(
LocalDateTime
.
now
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"预约时间已过"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"预约时间已过"
);
}
}
invitation
.
setStatus
(
"已撤回"
);
invitation
.
setStatus
(
"已撤回"
);
invitation
.
setUpdateTime
(
LocalDateTime
.
now
());
Visitor
visitor
=
invitation
.
getVisitor
();
Visitor
visitor
=
invitation
.
getVisitor
();
// 逻辑删除对应访客信息
// 逻辑删除对应访客信息
if
(
visitor
!=
null
)
{
if
(
visitor
!=
null
)
{
...
@@ -193,10 +236,10 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -193,10 +236,10 @@ public class InvitationServiceImpl implements InvitationService {
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"预约时间已过"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"预约时间已过"
);
}
}
invitation
.
setStatus
(
"已发送"
);
invitation
.
setStatus
(
"已发送"
);
invitation
.
setUpdateTime
(
LocalDateTime
.
now
());
//添加访客信息
//添加访客信息
Visitor
visitor
=
invitation
.
getVisitor
();
Visitor
visitor
=
invitation
.
getVisitor
();
//
逻辑删除对应访客信息
//
if
(
visitor
!=
null
)
{
if
(
visitor
!=
null
)
{
visitor
.
setDeleted
(
"N"
);
visitor
.
setDeleted
(
"N"
);
visitorRepository
.
saveAndFlush
(
visitor
);
visitorRepository
.
saveAndFlush
(
visitor
);
...
@@ -215,6 +258,9 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -215,6 +258,9 @@ public class InvitationServiceImpl implements InvitationService {
InvitationExportExcel
invitationExportExcel
=
new
InvitationExportExcel
();
InvitationExportExcel
invitationExportExcel
=
new
InvitationExportExcel
();
BeanUtils
.
copyProperties
(
invitation
,
invitationExportExcel
);
BeanUtils
.
copyProperties
(
invitation
,
invitationExportExcel
);
BeanUtils
.
copyProperties
(
invitation
.
getVisitor
(),
invitationExportExcel
);
BeanUtils
.
copyProperties
(
invitation
.
getVisitor
(),
invitationExportExcel
);
invitationExportExcel
.
setInviterName
(
invitation
.
getUser
().
getRealName
());
invitationExportExcel
.
setInviterDept
(
invitation
.
getUser
().
getDepartment
().
getName
());
return
invitationExportExcel
;
return
invitationExportExcel
;
})
})
.
toList
();
.
toList
();
...
@@ -250,14 +296,101 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -250,14 +296,101 @@ public class InvitationServiceImpl implements InvitationService {
}
}
}
}
@Override
public
Result
<
InvitationDetailsVo
>
detailsInv
(
IdParam
idParam
)
{
Optional
<
Invitation
>
byId
=
invitationRepository
.
findById
(
idParam
.
getId
());
if
(
byId
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Invitation
invitation
=
byId
.
get
();
InvitationDetailsVo
vo
=
new
InvitationDetailsVo
();
BeanUtils
.
copyProperties
(
invitation
,
vo
);
//翻译邀请人姓名,部门
if
(
invitation
.
getUser
()
!=
null
)
{
InvitationDetailsVo
.
User
user
=
new
InvitationDetailsVo
.
User
();
user
.
setDeptName
(
invitation
.
getUser
().
getDepartment
().
getName
());
user
.
setRealName
(
invitation
.
getUser
().
getRealName
());
user
.
setMobile
(
invitation
.
getUser
().
getMobile
());
vo
.
setUser
(
user
);
}
return
Result
.
ok
(
vo
);
}
@Override
public
Result
<
PageVo
<
InvitationDetailsVo
>>
findAllByVisitor_VisitorMobileAndVisitor_Deleted
(
InvitationAppQueryParam
invitationAppQueryParam
)
{
PageVo
<
InvitationDetailsVo
>
resultVo
;
//排序
Sort
sort
=
Sort
.
by
(
Sort
.
Order
.
desc
(
Visitor
.
Fields
.
createTime
));
if
(
Objects
.
nonNull
(
invitationAppQueryParam
.
getPageNo
())
&&
Objects
.
nonNull
(
invitationAppQueryParam
.
getPageSize
())
)
{
//分页
Pageable
pageable
=
PageRequest
.
of
(
invitationAppQueryParam
.
getPageNo
()
-
1
,
invitationAppQueryParam
.
getPageSize
()
);
Page
<
Invitation
>
all
=
invitationRepository
.
findAllByVisitor_VisitorMobileAndVisitor_Deleted
(
invitationAppQueryParam
.
getVisitorMobile
(),
"N"
,
pageable
);
List
<
InvitationDetailsVo
>
data
=
all
.
get
()
.
map
(
invitationResult
->
{
InvitationDetailsVo
vo
=
new
InvitationDetailsVo
();
BeanUtils
.
copyProperties
(
invitationResult
,
vo
);
//翻译邀请人姓名,部门
return
getInvitationDetailsVo
(
invitationResult
,
vo
);
})
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
}
else
{
Visitor
visitor
=
Visitor
.
builder
()
.
visitorMobile
(
invitationAppQueryParam
.
getVisitorMobile
())
.
deleted
(
"N"
)
.
build
();
Invitation
invitation
=
Invitation
.
builder
().
visitor
(
visitor
).
build
();
List
<
Invitation
>
all
=
invitationRepository
.
findAll
(
Example
.
of
(
invitation
),
sort
);
List
<
InvitationDetailsVo
>
data
=
all
.
stream
()
.
map
(
invitationResult
->
{
InvitationDetailsVo
vo
=
new
InvitationDetailsVo
();
BeanUtils
.
copyProperties
(
invitationResult
,
vo
);
//翻译邀请人姓名,部门
return
getInvitationDetailsVo
(
invitationResult
,
vo
);
})
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
data
.
size
());
}
return
Result
.
ok
(
resultVo
);
}
private
InvitationDetailsVo
getInvitationDetailsVo
(
Invitation
invitationResult
,
InvitationDetailsVo
vo
)
{
if
(
invitationResult
.
getUser
()
!=
null
)
{
InvitationDetailsVo
.
User
user
=
new
InvitationDetailsVo
.
User
();
user
.
setDeptName
(
invitationResult
.
getUser
().
getDepartment
().
getName
());
user
.
setRealName
(
invitationResult
.
getUser
().
getRealName
());
user
.
setMobile
(
invitationResult
.
getUser
().
getMobile
());
vo
.
setUser
(
user
);
}
return
vo
;
}
public
Specification
<
Invitation
>
condition
(
InvitationQueryParam
invitationQueryParam
)
{
public
Specification
<
Invitation
>
condition
(
InvitationQueryParam
invitationQueryParam
)
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
Join
<
Invitation
,
Visitor
>
join
=
root
.
join
(
"visitor"
,
JoinType
.
LEFT
);
Join
<
Invitation
,
Visitor
>
joinVisitor
=
root
.
join
(
"visitor"
,
JoinType
.
LEFT
);
Join
<
Invitation
,
User
>
joinUser
=
joinVisitor
.
join
(
"user"
,
JoinType
.
LEFT
);
Join
<
User
,
Department
>
departmentJoin
=
joinUser
.
join
(
"department"
,
JoinType
.
LEFT
);
// Join<User, Department> joinDepartment = root.join(User.Fields.department, JoinType.LEFT);
List
<
Predicate
>
list
=
new
ArrayList
<>();
List
<
Predicate
>
list
=
new
ArrayList
<>();
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getVisitorName
()))
{
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getVisitorName
()))
{
list
.
add
(
list
.
add
(
criteriaBuilder
.
like
(
criteriaBuilder
.
like
(
join
.
get
(
Visitor
.
Fields
.
visitorName
).
as
(
String
.
class
),
join
Visitor
.
get
(
Visitor
.
Fields
.
visitorName
).
as
(
String
.
class
),
"%"
+
invitationQueryParam
.
getVisitorName
()
+
"%"
"%"
+
invitationQueryParam
.
getVisitorName
()
+
"%"
)
)
);
);
...
@@ -266,7 +399,7 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -266,7 +399,7 @@ public class InvitationServiceImpl implements InvitationService {
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getVisitorMobile
()))
{
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getVisitorMobile
()))
{
list
.
add
(
list
.
add
(
criteriaBuilder
.
like
(
criteriaBuilder
.
like
(
join
.
get
(
Visitor
.
Fields
.
visitorMobile
).
as
(
String
.
class
),
join
Visitor
.
get
(
Visitor
.
Fields
.
visitorMobile
).
as
(
String
.
class
),
"%"
+
invitationQueryParam
.
getVisitorMobile
()
+
"%"
"%"
+
invitationQueryParam
.
getVisitorMobile
()
+
"%"
)
)
);
);
...
@@ -275,7 +408,7 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -275,7 +408,7 @@ public class InvitationServiceImpl implements InvitationService {
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getOrgId
()))
{
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getOrgId
()))
{
list
.
add
(
list
.
add
(
criteriaBuilder
.
like
(
criteriaBuilder
.
like
(
join
.
get
(
Visitor
.
Fields
.
orgId
).
as
(
String
.
class
),
join
Visitor
.
get
(
Visitor
.
Fields
.
orgId
).
as
(
String
.
class
),
"%"
+
invitationQueryParam
.
getOrgId
()
+
"%"
"%"
+
invitationQueryParam
.
getOrgId
()
+
"%"
)
)
);
);
...
@@ -283,20 +416,30 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -283,20 +416,30 @@ public class InvitationServiceImpl implements InvitationService {
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getTaskType
()))
{
if
(
StrUtil
.
isNotBlank
(
invitationQueryParam
.
getTaskType
()))
{
list
.
add
(
list
.
add
(
criteriaBuilder
.
equal
(
criteriaBuilder
.
equal
(
join
.
get
(
Visitor
.
Fields
.
taskType
).
as
(
String
.
class
),
join
Visitor
.
get
(
Visitor
.
Fields
.
taskType
).
as
(
String
.
class
),
invitationQueryParam
.
getTaskType
()
invitationQueryParam
.
getTaskType
()
)
)
);
);
}
}
if
(
invitationQueryParam
.
get
InviterId
()
!=
null
)
{
if
(
invitationQueryParam
.
get
RealName
()
!=
null
)
{
list
.
add
(
list
.
add
(
criteriaBuilder
.
equal
(
criteriaBuilder
.
like
(
root
.
get
(
Invitation
.
Fields
.
inviterId
).
as
(
String
.
class
),
joinUser
.
get
(
User
.
Fields
.
realName
).
as
(
String
.
class
),
invitationQueryParam
.
getInviterId
()
"%"
+
invitationQueryParam
.
getRealName
()
+
"%"
)
);
}
if
(
invitationQueryParam
.
getDeptName
()
!=
null
)
{
list
.
add
(
criteriaBuilder
.
like
(
departmentJoin
.
get
(
Department
.
Fields
.
name
).
as
(
String
.
class
),
"%"
+
invitationQueryParam
.
getDeptName
()
+
"%"
)
)
);
);
}
}
if
(
if
(
Objects
.
nonNull
(
invitationQueryParam
.
getAppOfVisitTimeStart
())
&&
Objects
.
nonNull
(
invitationQueryParam
.
getAppOfVisitTimeStart
())
&&
Objects
.
nonNull
(
invitationQueryParam
.
getAppOfVisitTimeEnd
())
Objects
.
nonNull
(
invitationQueryParam
.
getAppOfVisitTimeEnd
())
...
@@ -304,16 +447,16 @@ public class InvitationServiceImpl implements InvitationService {
...
@@ -304,16 +447,16 @@ public class InvitationServiceImpl implements InvitationService {
//预约到访时间区间段查询
//预约到访时间区间段查询
list
.
add
(
list
.
add
(
criteriaBuilder
.
between
(
criteriaBuilder
.
between
(
join
.
get
(
Visitor
.
Fields
.
appOfVisitTime
),
join
Visitor
.
get
(
Visitor
.
Fields
.
appOfVisitTime
),
invitationQueryParam
.
getAppOfVisitTimeStart
(),
invitationQueryParam
.
getAppOfVisitTimeStart
(),
invitationQueryParam
.
getAppOfVisitTimeEnd
()
invitationQueryParam
.
getAppOfVisitTimeEnd
()
)
)
);
);
}
}
Order
order
=
criteriaBuilder
.
desc
(
root
.
get
(
Invitation
.
Fields
.
updateTime
));
Predicate
[]
predicates
=
new
Predicate
[
list
.
size
()];
Predicate
[]
predicates
=
new
Predicate
[
list
.
size
()];
query
.
where
(
list
.
toArray
(
predicates
));
query
.
where
(
list
.
toArray
(
predicates
));
query
.
orderBy
(
order
);
return
criteriaBuilder
.
and
(
list
.
toArray
(
predicates
));
return
criteriaBuilder
.
and
(
list
.
toArray
(
predicates
));
};
};
}
}
...
...
app/src/main/java/com/yiring/app/service/visitor/impl/VisitorServiceImpl.java
浏览文件 @
c28135da
...
@@ -3,19 +3,23 @@ package com.yiring.app.service.visitor.impl;
...
@@ -3,19 +3,23 @@ package com.yiring.app.service.visitor.impl;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.app.domain.appletUser.AppletUserRepository
;
import
com.yiring.app.domain.visitor.Car
;
import
com.yiring.app.domain.visitor.Car
;
import
com.yiring.app.domain.visitor.Visitor
;
import
com.yiring.app.domain.visitor.Visitor
;
import
com.yiring.app.domain.visitor.VisitorRepository
;
import
com.yiring.app.domain.visitor.VisitorRepository
;
import
com.yiring.app.excel.visitor.VisitorExportExcel
;
import
com.yiring.app.excel.visitor.VisitorExportExcel
;
import
com.yiring.app.param.visitor.VisitorAppQueryParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.service.visitor.CarService
;
import
com.yiring.app.service.visitor.CarService
;
import
com.yiring.app.service.visitor.VisitorService
;
import
com.yiring.app.service.visitor.VisitorService
;
import
com.yiring.app.vo.visitor.VisitorAppVo
;
import
com.yiring.app.vo.visitor.VisitorDetailsVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.constant.RegEx
;
import
com.yiring.common.constant.RegEx
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
...
@@ -29,6 +33,9 @@ import java.util.Optional;
...
@@ -29,6 +33,9 @@ import java.util.Optional;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Join
;
import
javax.persistence.criteria.JoinType
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -54,21 +61,25 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -54,21 +61,25 @@ public class VisitorServiceImpl implements VisitorService {
@Resource
@Resource
CarService
carService
;
CarService
carService
;
@Resource
AppletUserRepository
appletUserRepository
;
@Override
@Override
public
Result
<
String
>
saveVisitor
(
VisitorParam
visitorParam
)
{
public
Result
<
String
>
saveVisitor
(
VisitorParam
visitorParam
)
{
//设置创建时间和默认状态
Visitor
visitor
=
Visitor
.
builder
()
.
createTime
(
LocalDateTime
.
now
())
.
updateTime
(
LocalDateTime
.
now
())
.
cardSendTime
(
LocalDateTime
.
now
())
.
build
();
BeanUtils
.
copyProperties
(
visitorParam
,
visitor
);
if
(
visitorParam
.
getMainVisitorId
()
!=
null
)
{
if
(
visitorParam
.
getMainVisitorId
()
!=
null
)
{
//如果主访人员id不为空,
//如果主访人员id不为空,
Visitor
optional
=
visitorRepository
.
findByIdAndDeleted
(
visitorParam
.
getMainVisitorId
(),
"N"
);
Visitor
optional
=
visitorRepository
.
findByIdAndDeleted
(
visitorParam
.
getMainVisitorId
(),
"N"
);
if
(
optional
==
null
)
{
if
(
optional
==
null
)
{
return
Result
.
no
(
Status
.
NOT_FOUND
,
"信息失效,请联系管理员"
);
return
Result
.
no
(
Status
.
NOT_FOUND
,
"信息失效,请联系管理员"
);
}
}
visitor
.
setMainVisitorId
(
visitorParam
.
getMainVisitorId
());
}
}
//设置创建时间和默认状态
Visitor
visitor
=
Visitor
.
builder
().
createTime
(
LocalDateTime
.
now
()).
build
();
BeanUtils
.
copyProperties
(
visitorParam
,
visitor
);
//如果有车, 填车辆信息,
//如果有车, 填车辆信息,
if
(
visitorParam
.
getHasCar
()
==
1
)
{
if
(
visitorParam
.
getHasCar
()
==
1
)
{
//校验车辆必填信息
//校验车辆必填信息
...
@@ -127,20 +138,52 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -127,20 +138,52 @@ public class VisitorServiceImpl implements VisitorService {
}
}
}
}
BeanUtils
.
copyProperties
(
visitorParam
,
optional
);
BeanUtils
.
copyProperties
(
visitorParam
,
optional
);
optional
.
setUpdateTime
(
LocalDateTime
.
now
());
visitorRepository
.
saveAndFlush
(
optional
);
visitorRepository
.
saveAndFlush
(
optional
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
VisitorVo
>
selectVisitor
(
IdParam
idParam
)
{
public
Result
<
Visitor
Details
Vo
>
selectVisitor
(
IdParam
idParam
)
{
Optional
<
Visitor
>
optional
=
visitorRepository
.
findById
(
idParam
.
getId
());
Optional
<
Visitor
>
optional
=
visitorRepository
.
findById
(
idParam
.
getId
());
if
(
optional
.
isEmpty
())
{
if
(
optional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
NOT_FOUND
);
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
}
Visitor
visitor
=
optional
.
get
();
Visitor
visitor
=
optional
.
get
();
VisitorVo
vo
=
new
VisitorVo
();
List
<
Visitor
>
list
=
new
ArrayList
<>();
List
<
VisitorDetailsVo
.
VisitorResultVo
>
listResult
=
new
ArrayList
<>();
//主访人id为空 为主访问人,查询出其下面的随访人的姓名和电话
if
(
visitor
.
getMainVisitorId
()
==
null
)
{
list
=
visitorRepository
.
findAllByMainVisitorIdAndDeletedEquals
(
visitor
.
getId
(),
"N"
);
}
else
{
//查询此随访访客的主访客,
Visitor
n
=
visitorRepository
.
findByIdAndDeleted
(
visitor
.
getMainVisitorId
(),
"N"
);
if
(
n
!=
null
)
{
//添加此随访人一同的随访人
list
=
visitorRepository
.
findAllByMainVisitorIdAndDeletedEqualsAndIdIsNot
(
n
.
getId
(),
"N"
,
visitor
.
getId
());
list
.
add
(
n
);
}
}
//处理返回数据的结构
if
(
list
!=
null
)
{
list
.
forEach
(
visitorEntity
->
{
VisitorDetailsVo
.
VisitorResultVo
visitorResultVo
=
new
VisitorDetailsVo
.
VisitorResultVo
();
BeanUtils
.
copyProperties
(
visitorEntity
,
visitorResultVo
);
listResult
.
add
(
visitorResultVo
);
});
}
VisitorDetailsVo
vo
=
new
VisitorDetailsVo
();
BeanUtils
.
copyProperties
(
visitor
,
vo
);
BeanUtils
.
copyProperties
(
visitor
,
vo
);
VisitorDetailsVo
.
UserVo
userVo
=
VisitorDetailsVo
.
UserVo
.
builder
()
.
realName
(
visitor
.
getUser
().
getRealName
())
.
mobile
(
visitor
.
getUser
().
getMobile
())
.
deptName
(
visitor
.
getUser
().
getDepartment
().
getName
())
.
build
();
vo
.
setUserVo
(
userVo
);
vo
.
setList
(
listResult
);
return
Result
.
ok
(
vo
);
return
Result
.
ok
(
vo
);
}
}
...
@@ -158,6 +201,16 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -158,6 +201,16 @@ public class VisitorServiceImpl implements VisitorService {
.
map
(
visitor
->
{
.
map
(
visitor
->
{
VisitorVo
vo
=
new
VisitorVo
();
VisitorVo
vo
=
new
VisitorVo
();
BeanUtils
.
copyProperties
(
visitor
,
vo
);
BeanUtils
.
copyProperties
(
visitor
,
vo
);
VisitorVo
.
UserVo
userVo
=
VisitorVo
.
UserVo
.
builder
()
.
realName
(
visitor
.
getUser
().
getRealName
())
.
build
();
vo
.
setUserVo
(
userVo
);
//翻译被访问人姓名
// if (vo.getIntervieweeId() != null) {
// Optional<User> byId = userRepository.findById(vo.getIntervieweeId());
// byId.ifPresent(user -> vo.setIntervieweeName(user.getRealName()));
// }
return
vo
;
return
vo
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -169,6 +222,11 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -169,6 +222,11 @@ public class VisitorServiceImpl implements VisitorService {
.
map
(
visitor
->
{
.
map
(
visitor
->
{
VisitorVo
vo
=
new
VisitorVo
();
VisitorVo
vo
=
new
VisitorVo
();
BeanUtils
.
copyProperties
(
visitor
,
vo
);
BeanUtils
.
copyProperties
(
visitor
,
vo
);
VisitorVo
.
UserVo
userVo
=
VisitorVo
.
UserVo
.
builder
()
.
realName
(
visitor
.
getUser
().
getRealName
())
.
build
();
vo
.
setUserVo
(
userVo
);
return
vo
;
return
vo
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -206,6 +264,7 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -206,6 +264,7 @@ public class VisitorServiceImpl implements VisitorService {
String
fileName
=
URLEncoder
.
encode
(
"访客信息.xlsx"
,
StandardCharsets
.
UTF_8
);
String
fileName
=
URLEncoder
.
encode
(
"访客信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
OutputStream
out
=
response
.
getOutputStream
();
...
@@ -243,35 +302,47 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -243,35 +302,47 @@ public class VisitorServiceImpl implements VisitorService {
}
}
Visitor
visitor
=
optional
.
get
();
Visitor
visitor
=
optional
.
get
();
visitor
.
setLabelCardStatus
(
"3"
);
visitor
.
setLabelCardStatus
(
"3"
);
visitor
.
setUpdateTime
(
LocalDateTime
.
now
());
visitor
.
setCardRecTime
(
LocalDateTime
.
now
());
visitor
.
setCardRecTime
(
LocalDateTime
.
now
());
visitorRepository
.
saveAndFlush
(
visitor
);
visitorRepository
.
saveAndFlush
(
visitor
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
VisitorVo
>
selectInfo
(
IdParam
id
Param
)
{
public
Result
<
PageVo
<
VisitorAppVo
>>
selectInfo
(
VisitorAppQueryParam
visitorAppQuery
Param
)
{
return
null
;
PageVo
<
VisitorAppVo
>
resultVo
;
}
//排序
// public boolean hasCarNum(String carNum) {
//分页
// Visitor visitor = Visitor.builder().visitorCarNum(carNum).labelCardStatus("1").build();
Pageable
pageable
=
PageRequest
.
of
(
visitorAppQueryParam
.
getPageNo
()
-
1
,
visitorAppQueryParam
.
getPageSize
());
// long count = visitorRepository.count(Example.of(visitor));
Page
<
Visitor
>
all
=
visitorRepository
.
findAllByVisitorMobileAndDeletedEquals
(
// Visitor visitor1 = Visitor.builder().visitorCarNum(carNum).labelCardStatus("2").build();
visitorAppQueryParam
.
getVisitorMobile
(),
// long count1 = visitorRepository.count(Example.of(visitor1));
"N"
,
// return count + count1 > 0;
pageable
// }
);
//
List
<
VisitorAppVo
>
data
=
all
// public boolean hasVisitorMobile(String mobile) {
.
get
()
// Visitor visitor = Visitor.builder().visitorMobile(mobile).labelCardStatus("1").build();
.
map
(
visitor
->
{
// long count = visitorRepository.count(Example.of(visitor));
VisitorAppVo
vo
=
new
VisitorAppVo
();
// Visitor visitor1 = Visitor.builder().visitorMobile(mobile).labelCardStatus("1").build();
vo
.
setId
(
visitor
.
getId
());
// long count1 = visitorRepository.count(Example.of(visitor1));
vo
.
setCardSendTime
(
visitor
.
getCardSendTime
());
// return count + count1 > 0;
VisitorAppVo
.
UserVo
userVo
=
VisitorAppVo
.
UserVo
// }
.
builder
()
.
realName
(
visitor
.
getUser
().
getRealName
())
.
mobile
(
visitor
.
getVisitorMobile
())
.
build
();
vo
.
setUserVo
(
userVo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
resultVo
=
PageVo
.
build
(
data
,
all
.
getTotalElements
());
return
Result
.
ok
(
resultVo
);
}
public
Specification
<
Visitor
>
condition
(
VisitorQueryParam
visitorQueryParam
)
{
public
Specification
<
Visitor
>
condition
(
VisitorQueryParam
visitorQueryParam
)
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
return
(
root
,
query
,
criteriaBuilder
)
->
{
List
<
Predicate
>
list
=
new
ArrayList
<>();
List
<
Predicate
>
list
=
new
ArrayList
<>();
Join
<
Visitor
,
User
>
join
=
root
.
join
(
"user"
,
JoinType
.
LEFT
);
//查询条件
//查询条件
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getVisitorName
()))
{
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getVisitorName
()))
{
//访客姓名
//访客姓名
...
@@ -329,9 +400,7 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -329,9 +400,7 @@ public class VisitorServiceImpl implements VisitorService {
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getIntervieweeId
()))
{
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getIntervieweeId
()))
{
//被访人
//被访人
list
.
add
(
list
.
add
(
criteriaBuilder
.
equal
(
join
.
get
(
BasicEntity
.
Fields
.
id
),
visitorQueryParam
.
getIntervieweeId
()));
criteriaBuilder
.
equal
(
root
.
get
(
Visitor
.
Fields
.
intervieweeId
),
visitorQueryParam
.
getIntervieweeId
())
);
}
}
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getLabelCard
()))
{
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getLabelCard
()))
{
...
@@ -344,16 +413,25 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -344,16 +413,25 @@ public class VisitorServiceImpl implements VisitorService {
);
);
}
}
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getLabelCardStatus
()))
{
if
(
StrUtil
.
isNotBlank
(
visitorQueryParam
.
getIsMain
()))
{
//标签卡状态
//标签卡号查询
list
.
add
(
if
(
visitorQueryParam
.
getIsMain
().
equals
(
"1"
))
{
criteriaBuilder
.
like
(
list
.
add
(
criteriaBuilder
.
isNull
(
root
.
get
(
Visitor
.
Fields
.
mainVisitorId
)));
root
.
get
(
Visitor
.
Fields
.
labelCardStatus
),
}
else
{
"%"
+
visitorQueryParam
.
getLabelCardStatus
()
+
"%"
list
.
add
(
criteriaBuilder
.
isNotNull
(
root
.
get
(
Visitor
.
Fields
.
mainVisitorId
)));
)
}
);
}
}
// if (StrUtil.isNotBlank(visitorQueryParam.getLabelCardStatus())) {
// //标签卡状态
// list.add(
// criteriaBuilder.like(
// root.get(Visitor.Fields.labelCardStatus),
// "%" + visitorQueryParam.getLabelCardStatus() + "%"
// )
// );
// }
if
(
if
(
Objects
.
nonNull
(
visitorQueryParam
.
getAppOfVisitTimeStart
())
&&
Objects
.
nonNull
(
visitorQueryParam
.
getAppOfVisitTimeStart
())
&&
Objects
.
nonNull
(
visitorQueryParam
.
getAppOfVisitTimeEnd
())
Objects
.
nonNull
(
visitorQueryParam
.
getAppOfVisitTimeEnd
())
...
@@ -395,9 +473,10 @@ public class VisitorServiceImpl implements VisitorService {
...
@@ -395,9 +473,10 @@ public class VisitorServiceImpl implements VisitorService {
)
)
);
);
}
}
Order
order
=
criteriaBuilder
.
desc
(
root
.
get
(
Visitor
.
Fields
.
updateTime
));
Predicate
[]
predicates
=
new
Predicate
[
list
.
size
()];
Predicate
[]
predicates
=
new
Predicate
[
list
.
size
()];
query
.
where
(
list
.
toArray
(
predicates
));
query
.
where
(
list
.
toArray
(
predicates
));
query
.
orderBy
(
order
);
return
criteriaBuilder
.
and
(
list
.
toArray
(
predicates
));
return
criteriaBuilder
.
and
(
list
.
toArray
(
predicates
));
};
};
}
}
...
...
app/src/main/java/com/yiring/app/util/GeoUtils.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
util
;
package
com
.
yiring
.
app
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yiring.app.util.zy.LonLatUtil
;
import
lombok.experimental.UtilityClass
;
import
lombok.experimental.UtilityClass
;
import
org.locationtech.jts.geom.Coordinate
;
import
org.locationtech.jts.geom.Coordinate
;
import
org.locationtech.jts.geom.GeometryFactory
;
import
org.locationtech.jts.geom.GeometryFactory
;
...
@@ -53,6 +55,61 @@ public class GeoUtils {
...
@@ -53,6 +55,61 @@ public class GeoUtils {
// TODO
// TODO
// 根据真源定位系统设置的坐标系,转换为经纬度
// 根据真源定位系统设置的坐标系,转换为经纬度
// 根据北向的地图左下角坐标点,矩形长宽距离,结合二维图片的像素比,计算经纬度
// 根据北向的地图左下角坐标点,矩形长宽距离,结合二维图片的像素比,计算经纬度
// 左下角经纬度信息(基准点)
// TODO: 需要从真源获取后更新
JSONObject
root
=
LonLatUtil
.
getRoot
();
// 计算经纬度
JSONObject
result
=
LonLatUtil
.
ComputeLonLat
(
root
.
getDoubleValue
(
"lon"
),
root
.
getDoubleValue
(
"lat"
),
root
.
getDoubleValue
(
"x"
),
root
.
getDoubleValue
(
"y"
),
x
,
y
);
// 构建经纬度坐标信息
Coordinate
coordinate
=
new
Coordinate
(
result
.
getDoubleValue
(
"lon"
),
result
.
getDoubleValue
(
"lat"
),
root
.
getDoubleValue
(
"altitude"
)
+
z
);
return
factory
.
createPoint
(
coordinate
);
}
/**
* 获取经纬度边界
* @return 经纬度边界
*/
public
static
double
[]
defaultBounds
()
{
// 数据来源于 2D 正射影像图转 mbtiles 描述文件
return
new
double
[]
{
112.858891
,
30.473306
,
112.866217
,
30.481243
};
}
/**
* 根据经纬度边界随机生成一个坐标点
* @param bounds 经纬度边界
* @param z 高度
* @return 坐标点
*/
public
Point
randomPoint
(
double
[]
bounds
,
double
z
)
{
return
randomPoint
(
bounds
[
0
],
bounds
[
1
],
bounds
[
2
],
bounds
[
3
],
z
);
}
/**
* 根据经纬度边界随机生成一个坐标点
* @param minX 最小经度
* @param minY 最小纬度
* @param maxX 最大经度
* @param maxY 最大纬度
* @param z 高度
* @return 坐标点
*/
public
Point
randomPoint
(
double
minX
,
double
minY
,
double
maxX
,
double
maxY
,
double
z
)
{
double
x
=
minX
+
(
maxX
-
minX
)
*
Math
.
random
();
double
y
=
minY
+
(
maxY
-
minY
)
*
Math
.
random
();
return
factory
.
createPoint
(
new
Coordinate
(
x
,
y
,
z
));
return
factory
.
createPoint
(
new
Coordinate
(
x
,
y
,
z
));
}
}
}
}
app/src/main/java/com/yiring/app/util/TimeIdGenerator.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
util
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
org.hibernate.HibernateException
;
import
org.hibernate.engine.spi.SharedSessionContractImplementor
;
import
org.hibernate.id.IdentifierGenerator
;
import
org.springframework.stereotype.Component
;
/**
* @author Jim
* @version 0.1
* 2022/5/10 18:26
*/
@Component
public
class
TimeIdGenerator
implements
IdentifierGenerator
{
public
Serializable
generate
(
SharedSessionContractImplementor
session
,
Object
object
)
throws
HibernateException
{
return
LocalDateTime
.
now
();
}
}
app/src/main/java/com/yiring/app/util/zy/LonLatUtil.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
util
.
zy
;
import
com.alibaba.fastjson.JSONObject
;
/**
* @author Jim
* @version 0.1
* 2022/5/9 16:41
*/
public
class
LonLatUtil
{
static
final
long
LonLat_A
=
6378137
;
static
final
double
LonLat_B
=
6356752.3142
;
static
final
double
LonLat_F
=
1
/
298.257223563
;
public
static
JSONObject
getRoot
()
{
JSONObject
root
=
new
JSONObject
();
root
.
put
(
"lon"
,
0
D
);
root
.
put
(
"lat"
,
0
D
);
root
.
put
(
"x"
,
0
D
);
root
.
put
(
"y"
,
0
D
);
root
.
put
(
"altitude"
,
0
D
);
return
root
;
}
// lon:基准点经度
// lat:基准点纬度
// distance:目标点离基准点距离
// angle:目标点与基准点连线和正北方向夹角
public
static
JSONObject
ComputeLonLat
(
double
lon
,
double
lat
,
double
rootX
,
double
rootY
,
double
postX
,
double
postY
)
{
double
distance
=
getDistance
(
rootX
,
rootY
,
postX
,
postY
);
double
alpha1
=
(
Math
.
PI
/
2
)
-
Math
.
atan2
(
postY
-
rootY
,
postX
-
rootX
);
double
sinAlpha1
=
Math
.
sin
(
alpha1
);
double
cosAlpha1
=
Math
.
cos
(
alpha1
);
double
tanU1
=
(
1
-
LonLat_F
)
*
Math
.
tan
(
Rad
(
lat
));
double
cosU1
=
1
/
Math
.
sqrt
((
1
+
tanU1
*
tanU1
));
double
sinU1
=
tanU1
*
cosU1
;
double
sigma1
=
Math
.
atan2
(
tanU1
,
cosAlpha1
);
double
sinAlpha
=
cosU1
*
sinAlpha1
;
double
cosSqAlpha
=
1
-
sinAlpha
*
sinAlpha
;
double
uSq
=
cosSqAlpha
*
((
LonLat_A
*
LonLat_A
)
-
LonLat_B
*
LonLat_B
)
/
(
LonLat_B
*
LonLat_B
);
double
A
=
1
+
uSq
/
16384
*
(
4096
+
uSq
*
(-
768
+
uSq
*
(
320
-
175
*
uSq
)));
double
B
=
uSq
/
1024
*
(
256
+
uSq
*
(-
128
+
uSq
*
(
74
-
47
*
uSq
)));
double
sigma
=
distance
/
(
LonLat_B
*
A
);
double
sigmaP
=
2
*
Math
.
PI
;
double
cos2SigmaM
=
Math
.
cos
(
2
*
sigma1
+
sigma
);
double
sinSigma
=
Math
.
sin
(
sigma
);
double
cosSigma
=
Math
.
cos
(
sigma
);
while
(
Math
.
abs
(
sigma
-
sigmaP
)
>
1
e
-
12
)
{
cos2SigmaM
=
Math
.
cos
(
2
*
sigma1
+
sigma
);
sinSigma
=
Math
.
sin
(
sigma
);
cosSigma
=
Math
.
cos
(
sigma
);
double
deltaSigma
=
B
*
sinSigma
*
(
cos2SigmaM
+
B
/
4
*
(
cosSigma
*
(-
1
+
2
*
cos2SigmaM
*
cos2SigmaM
)
-
B
/
6
*
cos2SigmaM
*
(-
3
+
4
*
sinSigma
*
sinSigma
)
*
(-
3
+
4
*
cos2SigmaM
*
cos2SigmaM
)
)
);
sigmaP
=
sigma
;
sigma
=
distance
/
(
LonLat_B
*
A
)
+
deltaSigma
;
}
double
tmp
=
sinU1
*
sinSigma
-
cosU1
*
cosSigma
*
cosAlpha1
;
double
lat2
=
Math
.
atan2
(
sinU1
*
cosSigma
+
cosU1
*
sinSigma
*
cosAlpha1
,
(
1
-
LonLat_F
)
*
Math
.
sqrt
(
sinAlpha
*
sinAlpha
+
tmp
*
tmp
)
);
double
lambda
=
Math
.
atan2
(
sinSigma
*
sinAlpha1
,
cosU1
*
cosSigma
-
sinU1
*
sinSigma
*
cosAlpha1
);
double
C
=
LonLat_F
/
16
*
cosSqAlpha
*
(
4
+
LonLat_F
*
(
4
-
3
*
cosSqAlpha
));
double
L
=
lambda
-
(
1
-
C
)
*
LonLat_F
*
sinAlpha
*
(
sigma
+
C
*
sinSigma
*
(
cos2SigmaM
+
C
*
cosSigma
*
(-
1
+
2
*
cos2SigmaM
*
cos2SigmaM
)));
// double revAz = Math.atan2(sinAlpha, -tmp); // final bearing4
JSONObject
lonLat
=
new
JSONObject
();
lonLat
.
put
(
"lon"
,
lon
+
Deg
(
L
));
lonLat
.
put
(
"lat"
,
Deg
(
lat2
));
return
lonLat
;
}
public
static
double
Rad
(
double
d
)
{
return
d
*
Math
.
PI
/
180.0
;
}
public
static
double
Deg
(
double
d
)
{
return
d
*
180
/
Math
.
PI
;
}
public
static
double
getDistance
(
double
rootX
,
double
rootY
,
double
postX
,
double
postY
)
{
double
dx2
=
Math
.
pow
((
rootX
-
postX
),
2
);
double
dy2
=
Math
.
pow
((
rootY
-
postY
),
2
);
double
dz2
=
Math
.
pow
((
0
),
2
);
return
Math
.
sqrt
(
dx2
+
dy2
+
dz2
);
}
}
app/src/main/java/com/yiring/app/vo/broadcast/BroadcastAudioIndexVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
broadcast
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.broadcast.BroadcastAudio
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报语音
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"BroadcastAudioIndexVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastAudioIndexVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2734529136001729248L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"100"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
Long
id
;
@ApiModelProperty
(
value
=
"语音名称"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"语音地址"
,
example
=
"uri"
)
String
uri
;
public
static
BroadcastAudioIndexVo
transform
(
BroadcastAudio
broadcastAudio
)
{
return
BroadcastAudioIndexVo
.
builder
()
.
id
(
broadcastAudio
.
getId
())
.
name
(
broadcastAudio
.
getName
())
.
uri
(
broadcastAudio
.
getUri
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/broadcast/BroadcastAudioVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
broadcast
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.broadcast.BroadcastAudio
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"BroadcastAudioVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastAudioVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1092099954728361919L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"100"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
Long
id
;
@ApiModelProperty
(
value
=
"语音名称"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"语音地址"
,
example
=
"uri"
)
String
uri
;
@ApiModelProperty
(
value
=
"上传时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
uploadTime
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"1"
)
String
describe
;
public
static
BroadcastAudioVo
transform
(
BroadcastAudio
broadcastAudio
)
{
return
BroadcastAudioVo
.
builder
()
.
id
(
broadcastAudio
.
getId
())
.
name
(
broadcastAudio
.
getName
())
.
uri
(
broadcastAudio
.
getUri
())
.
uploadTime
(
broadcastAudio
.
getUploadTime
())
.
describe
(
broadcastAudio
.
getDescribe
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/broadcast/BroadcastVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
broadcast
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
org.locationtech.jts.geom.Point
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 17:26
*/
@ApiModel
(
"BroadcastVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2927556677143859520L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"1"
)
String
broadcastNum
;
@ApiModelProperty
(
value
=
"坐标点信息"
)
Point
point
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"厂区喇叭"
)
String
remark
;
@ApiModelProperty
(
value
=
"音柱地址"
,
example
=
"音柱地址"
)
String
broadcastAdd
;
@ApiModelProperty
(
value
=
"播报设备名称"
,
example
=
"喇叭1"
)
String
broadcastName
;
}
app/src/main/java/com/yiring/app/vo/broadcast/BroadcastjcVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
broadcast
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/6 11:33
*/
@ApiModel
(
"BroadcastjcVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
BroadcastjcVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5301756979737544186L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"播报设备名称"
,
example
=
"喇叭1"
)
String
broadcastName
;
}
app/src/main/java/com/yiring/app/vo/icon/IconVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
icon
;
import
java.io.Serial
;
import
java.io.Serializable
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 15:10
*/
public
class
IconVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2334297671118394950L
;
}
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
浏览文件 @
c28135da
...
@@ -38,6 +38,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -38,6 +38,7 @@ public class KeyAlarmRulesVo implements Serializable {
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
Long
id
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"111"
)
Long
deptId
;
Long
deptId
;
...
@@ -48,7 +49,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -48,7 +49,7 @@ public class KeyAlarmRulesVo implements Serializable {
List
<
UserInfoVo
>
users
;
List
<
UserInfoVo
>
users
;
@ApiModelProperty
(
value
=
"推送类型"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"推送类型"
,
example
=
"111"
)
String
types
;
String
[]
types
;
public
static
KeyAlarmRulesVo
transform
(
KeyAlarmRules
keyAlarmRules
)
{
public
static
KeyAlarmRulesVo
transform
(
KeyAlarmRules
keyAlarmRules
)
{
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
...
@@ -60,7 +61,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -60,7 +61,7 @@ public class KeyAlarmRulesVo implements Serializable {
.
deptId
(
keyAlarmRules
.
getDepartment
().
getId
())
.
deptId
(
keyAlarmRules
.
getDepartment
().
getId
())
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
users
(
userInfoVos
)
.
users
(
userInfoVos
)
.
types
(
keyAlarmRules
.
getTypes
())
.
types
(
keyAlarmRules
.
getTypes
()
.
split
(
","
)
)
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/vo/key/KeyAlarmVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
key
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.key.KeyAlarm
;
import
com.yiring.app.vo.user.UserVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"KeyAlarmVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
4534979609749122415L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
@ApiModelProperty
(
value
=
"地图 ID"
,
example
=
"1"
)
Long
areaId
;
@ApiModelProperty
(
value
=
"用户"
,
example
=
"111"
)
UserVo
user
;
@ApiModelProperty
(
value
=
"报警时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
endTime
;
@ApiModelProperty
(
value
=
"报警类型"
,
example
=
"按键报警"
)
String
type
;
@ApiModelProperty
(
value
=
"报警接收人"
,
example
=
"张三、李四"
)
String
receiver
;
@ApiModelProperty
(
value
=
"报警状态"
,
example
=
"T/F"
)
Boolean
enable
;
public
static
KeyAlarmVo
transform
(
KeyAlarm
keyAlarm
)
{
return
KeyAlarmVo
.
builder
()
.
id
(
keyAlarm
.
getId
())
.
areaId
(
keyAlarm
.
getAreaId
())
.
createTime
(
keyAlarm
.
getCreateTime
())
.
endTime
(
keyAlarm
.
getUpdateTime
())
.
type
(
"按键报警"
)
.
enable
(
keyAlarm
.
getEnable
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
浏览文件 @
c28135da
...
@@ -11,6 +11,7 @@ import java.io.Serializable;
...
@@ -11,6 +11,7 @@ import java.io.Serializable;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
org.locationtech.jts.geom.Point
;
/**
/**
* 定位信标模型
* 定位信标模型
...
@@ -40,6 +41,9 @@ public class LocationBeaconVo implements Serializable {
...
@@ -40,6 +41,9 @@ public class LocationBeaconVo implements Serializable {
@ApiModelProperty
(
value
=
"最后一次在线时间"
,
example
=
"BTI88888888"
)
@ApiModelProperty
(
value
=
"最后一次在线时间"
,
example
=
"BTI88888888"
)
LocalDateTime
time
;
LocalDateTime
time
;
@ApiModelProperty
(
value
=
"坐标"
,
example
=
"01010000805C8FC2F528D4734033333333335B7D400000000000000000"
)
Point
point
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"所属地图"
,
example
=
"1:总图2:一层3:二层"
)
@ApiModelProperty
(
value
=
"所属地图"
,
example
=
"1:总图2:一层3:二层"
)
Long
areaId
;
Long
areaId
;
...
@@ -50,6 +54,7 @@ public class LocationBeaconVo implements Serializable {
...
@@ -50,6 +54,7 @@ public class LocationBeaconVo implements Serializable {
.
id
(
locationBeacon
.
getId
())
.
id
(
locationBeacon
.
getId
())
.
code
(
locationBeacon
.
getCode
())
.
code
(
locationBeacon
.
getCode
())
.
time
(
locationBeacon
.
getTime
())
.
time
(
locationBeacon
.
getTime
())
.
point
(
locationBeacon
.
getPoint
())
.
areaId
(
locationBeacon
.
getAreaId
())
.
areaId
(
locationBeacon
.
getAreaId
())
.
build
();
.
build
();
}
}
...
...
app/src/main/java/com/yiring/app/vo/location/tag/LocationTagTypeVo.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
tag
;
package
com
.
yiring
.
app
.
vo
.
location
.
tag
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
...
@@ -43,8 +44,8 @@ public class LocationTagTypeVo implements Serializable {
...
@@ -43,8 +44,8 @@ public class LocationTagTypeVo implements Serializable {
@ApiModelProperty
(
value
=
"标签类型"
,
example
=
"人员"
)
@ApiModelProperty
(
value
=
"标签类型"
,
example
=
"人员"
)
String
tagType
;
String
tagType
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"类型(1:内部/2:访客
/3:承包商
)"
)
@ApiModelProperty
(
value
=
"类型"
,
example
=
"类型(1:内部/2:访客)"
)
Integer
category
;
String
category
;
public
static
LocationTagTypeVo
transform
(
LocationTag
locationTag
)
{
public
static
LocationTagTypeVo
transform
(
LocationTag
locationTag
)
{
String
entityType
=
StrUtil
.
equals
(
locationTag
.
getType
().
name
(),
"BTT02"
)
?
"car"
:
"staff"
;
String
entityType
=
StrUtil
.
equals
(
locationTag
.
getType
().
name
(),
"BTT02"
)
?
"car"
:
"staff"
;
...
@@ -54,7 +55,7 @@ public class LocationTagTypeVo implements Serializable {
...
@@ -54,7 +55,7 @@ public class LocationTagTypeVo implements Serializable {
.
code
(
locationTag
.
getCode
())
.
code
(
locationTag
.
getCode
())
.
type
(
locationTag
.
getType
())
.
type
(
locationTag
.
getType
())
.
tagType
(
entityType
)
.
tagType
(
entityType
)
.
category
(
locationTag
.
getCategory
(
))
.
category
(
Convert
.
toStr
(
locationTag
.
getCategory
()
))
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/vo/visitor/InvitationDetailsVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
visitor
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.visitor.Visitor
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 邀请反参
* @author tzl
* @version 1.0
* @description:
* @date 2022/4/28 10:48
*/
@ApiModel
(
"InvitationDetailsVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
InvitationDetailsVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5496232471863298479L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1548548545755"
)
Long
id
;
@ApiModelProperty
(
value
=
"邀请原因/来访原因"
,
example
=
"随便看看"
)
String
reason
;
@ApiModelProperty
(
value
=
"邀请方式:个人 公司"
,
example
=
"个人"
)
String
InvitationMethod
;
@ApiModelProperty
(
value
=
"邀请人数"
,
example
=
"1"
)
Integer
numOfVisitor
;
@ApiModelProperty
(
value
=
"邀请人id"
,
example
=
"1"
)
Long
inviterId
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"撤回"
)
String
status
;
@ApiModelProperty
(
value
=
"被邀请访客"
)
Visitor
visitor
;
@ApiModelProperty
(
value
=
"邀请人信息"
)
User
user
;
@ApiModel
(
"User"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
static
class
User
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4115779013003587949L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"邀请人姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"邀请人部门"
,
example
=
"研发部"
)
String
deptName
;
@ApiModelProperty
(
value
=
"邀请人电话"
,
example
=
"17688888888"
)
String
mobile
;
}
}
app/src/main/java/com/yiring/app/vo/visitor/InvitationVo.java
浏览文件 @
c28135da
...
@@ -56,4 +56,28 @@ public class InvitationVo implements Serializable {
...
@@ -56,4 +56,28 @@ public class InvitationVo implements Serializable {
@ApiModelProperty
(
value
=
"被邀请访客"
)
@ApiModelProperty
(
value
=
"被邀请访客"
)
Visitor
visitor
;
Visitor
visitor
;
@ApiModelProperty
(
value
=
"邀请人信息"
)
User
user
;
@ApiModel
(
"User"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
static
class
User
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4115779013003587949L
;
// @JsonSerialize(using = ToStringSerializer.class)
// @ApiModelProperty(value = "id", example = "1")
// Long id;
@ApiModelProperty
(
value
=
"邀请人姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"邀请人部门"
,
example
=
"研发部"
)
String
deptName
;
}
}
}
app/src/main/java/com/yiring/app/vo/visitor/VisitorAppVo.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
visitor
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* @author tzl
* 2022/4/19 14:16
*/
@ApiModel
(
"VisitorVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
VisitorAppVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
9004209982164273860L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1548548545755"
)
Long
id
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"发卡时间"
,
example
=
"2022-04-19 14:28:00"
)
LocalDateTime
cardSendTime
;
UserVo
userVo
;
@ApiModel
(
"UserVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
static
class
UserVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4115779013003587949L
;
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"张三"
)
String
mobile
;
}
}
app/src/main/java/com/yiring/app/vo/visitor/VisitorDetailsVo.java
浏览文件 @
c28135da
...
@@ -62,8 +62,8 @@ public class VisitorDetailsVo implements Serializable {
...
@@ -62,8 +62,8 @@ public class VisitorDetailsVo implements Serializable {
@ApiModelProperty
(
value
=
"所属单位id"
,
example
=
"壹润科技"
)
@ApiModelProperty
(
value
=
"所属单位id"
,
example
=
"壹润科技"
)
String
orgId
;
String
orgId
;
@ApiModelProperty
(
value
=
"被访人id"
,
example
=
"1"
)
//
@ApiModelProperty(value = "被访人id", example = "1")
Long
intervieweeId
;
//
Long intervieweeId;
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"李四"
)
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"李四"
)
String
intervieweeName
;
String
intervieweeName
;
...
@@ -90,12 +90,14 @@ public class VisitorDetailsVo implements Serializable {
...
@@ -90,12 +90,14 @@ public class VisitorDetailsVo implements Serializable {
@ApiModelProperty
(
value
=
"车辆反参"
)
@ApiModelProperty
(
value
=
"车辆反参"
)
Car
car
;
Car
car
;
UserVo
userVo
;
@ApiModelProperty
(
value
=
"主访人id"
)
@ApiModelProperty
(
value
=
"主访人id"
)
Long
mainVisitorId
;
Long
mainVisitorId
;
List
<
VisitorResultVo
>
list
;
List
<
VisitorResultVo
>
list
;
@ApiModel
(
"
MapVoReuslt
"
)
@ApiModel
(
"
VisitorResultVo
"
)
@Data
@Data
@Builder
@Builder
@NoArgsConstructor
@NoArgsConstructor
...
@@ -119,4 +121,29 @@ public class VisitorDetailsVo implements Serializable {
...
@@ -119,4 +121,29 @@ public class VisitorDetailsVo implements Serializable {
@ApiModelProperty
(
value
=
"主访人id"
)
@ApiModelProperty
(
value
=
"主访人id"
)
Long
mainVisitorId
;
Long
mainVisitorId
;
}
}
@ApiModel
(
"UserVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
static
class
UserVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4115779013003587949L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"被访人电话"
,
example
=
"17688888888"
)
String
mobile
;
@ApiModelProperty
(
value
=
"被访人部门"
)
String
deptName
;
}
}
}
app/src/main/java/com/yiring/app/vo/visitor/VisitorVo.java
浏览文件 @
c28135da
...
@@ -4,7 +4,6 @@ package com.yiring.app.vo.visitor;
...
@@ -4,7 +4,6 @@ package com.yiring.app.vo.visitor;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.visitor.Car
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serial
;
...
@@ -41,11 +40,11 @@ public class VisitorVo implements Serializable {
...
@@ -41,11 +40,11 @@ public class VisitorVo implements Serializable {
@ApiModelProperty
(
value
=
"到访人身份证"
,
example
=
"430441190001255417"
)
@ApiModelProperty
(
value
=
"到访人身份证"
,
example
=
"430441190001255417"
)
String
visitorCarNum
;
String
visitorCarNum
;
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"
tru
e"
)
@ApiModelProperty
(
value
=
"是否特殊作业"
,
example
=
"
fals
e"
)
boolean
taskType
;
String
taskType
;
@ApiModelProperty
(
value
=
"邀请人数"
,
example
=
"1"
)
//
@ApiModelProperty(value = "邀请人数", example = "1")
Integer
numOfVisitor
;
//
Integer numOfVisitor;
@ApiModelProperty
(
value
=
"访客来源"
,
example
=
"内部邀请"
)
@ApiModelProperty
(
value
=
"访客来源"
,
example
=
"内部邀请"
)
String
visitorSource
;
String
visitorSource
;
...
@@ -53,14 +52,14 @@ public class VisitorVo implements Serializable {
...
@@ -53,14 +52,14 @@ public class VisitorVo implements Serializable {
@ApiModelProperty
(
value
=
"标签卡"
,
example
=
"WE34421231"
)
@ApiModelProperty
(
value
=
"标签卡"
,
example
=
"WE34421231"
)
String
labelCard
;
String
labelCard
;
@ApiModelProperty
(
value
=
"标签卡状态"
,
example
=
"使用中"
)
//
@ApiModelProperty(value = "标签卡状态", example = "使用中")
String
labelCardStatus
;
//
String labelCardStatus;
@ApiModelProperty
(
value
=
"所属单位id"
,
example
=
"壹润科技"
)
@ApiModelProperty
(
value
=
"所属单位id"
,
example
=
"壹润科技"
)
String
orgId
;
String
orgId
;
@ApiModelProperty
(
value
=
"被访人
id"
,
example
=
"1
"
)
@ApiModelProperty
(
value
=
"被访人
姓名"
,
example
=
"李四
"
)
String
interviewee
Id
;
String
interviewee
Name
;
@ApiModelProperty
(
value
=
"来访原因"
,
example
=
"来访原因"
)
@ApiModelProperty
(
value
=
"来访原因"
,
example
=
"来访原因"
)
String
reason
;
String
reason
;
...
@@ -69,18 +68,38 @@ public class VisitorVo implements Serializable {
...
@@ -69,18 +68,38 @@ public class VisitorVo implements Serializable {
@ApiModelProperty
(
value
=
"收卡时间"
,
example
=
"2022-04-19 14:28:00"
)
@ApiModelProperty
(
value
=
"收卡时间"
,
example
=
"2022-04-19 14:28:00"
)
LocalDateTime
cardRecTime
;
LocalDateTime
cardRecTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
//
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty
(
value
=
"预约到访时间"
,
example
=
"2022-04-19 14:28:00"
)
//
@ApiModelProperty(value = "预约到访时间", example = "2022-04-19 14:28:00")
LocalDateTime
appOfVisitTime
;
//
LocalDateTime appOfVisitTime;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
//
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2022-04-19 14:28:00"
)
//
@ApiModelProperty(value = "创建时间", example = "2022-04-19 14:28:00")
LocalDateTime
createTime
;
//
LocalDateTime createTime;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"发卡时间"
,
example
=
"2022-04-19 14:28:00"
)
@ApiModelProperty
(
value
=
"发卡时间"
,
example
=
"2022-04-19 14:28:00"
)
LocalDateTime
cardSendTime
;
LocalDateTime
cardSendTime
;
@ApiModelProperty
(
value
=
"车辆反参"
)
// @ApiModelProperty(value = "车辆反参")
Car
car
;
// Car car;
@ApiModelProperty
(
value
=
"主访人id"
)
Long
mainVisitorId
;
UserVo
userVo
;
@ApiModel
(
"UserVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
static
class
UserVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4115779013003587949L
;
@ApiModelProperty
(
value
=
"被访人姓名"
,
example
=
"张三"
)
String
realName
;
}
}
}
app/src/main/java/com/yiring/app/web/HelloController.java
浏览文件 @
c28135da
...
@@ -12,6 +12,10 @@ import java.util.Arrays;
...
@@ -12,6 +12,10 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.locationtech.jts.geom.Geometry
;
import
org.locationtech.jts.geom.Polygon
;
import
org.locationtech.jts.io.ParseException
;
import
org.locationtech.jts.io.WKTReader
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -52,4 +56,14 @@ public class HelloController {
...
@@ -52,4 +56,14 @@ public class HelloController {
public
Result
<
String
>
test
()
{
public
Result
<
String
>
test
()
{
return
Result
.
ok
(
ZyUtil
.
manageLogin
());
return
Result
.
ok
(
ZyUtil
.
manageLogin
());
}
}
@GetMapping
(
"test2"
)
public
Result
<
Geometry
>
test2
()
throws
ParseException
{
WKTReader
reader
=
new
WKTReader
();
Geometry
geometry
=
reader
.
read
(
"POLYGON((114.13726247683384 22.57453153296995,114.13726253585672 22.57362062876488,114.1379932868094 22.57336379439826,114.13860672275516 22.573820711775532,114.13726247683384 22.57453153296995))"
);
Polygon
polygon
=
(
Polygon
)
geometry
;
return
Result
.
ok
(
polygon
);
}
}
}
app/src/main/java/com/yiring/app/web/appUser/AppletUserController.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
appUser
;
import
com.yiring.app.param.appUser.AppletUserParam
;
import
com.yiring.app.param.appUser.AppletUserQueryParam
;
import
com.yiring.app.service.appletUser.AppletUserService
;
import
com.yiring.common.core.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/4/28 13:48
*/
@Slf4j
@Validated
@Api
(
tags
=
"小程序用户"
)
@RestController
@RequestMapping
(
"/appUser/"
)
public
class
AppletUserController
{
@Resource
AppletUserService
appletUserService
;
@ApiOperation
(
"微信绑定手机号码"
)
@PostMapping
(
"saveAppUser"
)
public
Result
<
String
>
saveAppUser
(
@Valid
AppletUserParam
appletUserParam
)
{
return
appletUserService
.
saveAppUser
(
appletUserParam
);
}
@ApiOperation
(
"根据code获取微信用户唯一标识,返回其绑定的手机号码"
)
@GetMapping
(
"selectMobile"
)
public
Result
<
String
>
selectMobile
(
@Valid
AppletUserQueryParam
appletUserQueryParam
)
{
return
appletUserService
.
selectMobile
(
appletUserQueryParam
);
}
}
app/src/main/java/com/yiring/app/web/broadcast/BroadcastAudioController.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
broadcast
;
import
com.yiring.app.param.broadcast.BroadcastAudioAddParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioFindParam
;
import
com.yiring.app.param.broadcast.BroadcastAudioModifyParam
;
import
com.yiring.app.service.broadcast.BroadcastAudioService
;
import
com.yiring.app.vo.broadcast.BroadcastAudioIndexVo
;
import
com.yiring.app.vo.broadcast.BroadcastAudioVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
/**
* 播报音频
*
* @author LJ-2204
* @date 2022/5/7
*/
@Slf4j
@Api
(
tags
=
"播报音频"
)
@Validated
@RestController
@RequestMapping
(
"/broadcast/audio"
)
public
class
BroadcastAudioController
{
@Resource
BroadcastAudioService
broadcastAudioService
;
@ApiOperation
(
"添加"
)
@PostMapping
(
"save"
)
public
Result
<
String
>
save
(
@Valid
BroadcastAudioAddParam
param
)
{
return
broadcastAudioService
.
save
(
param
);
}
@ApiOperation
(
"删除"
)
@DeleteMapping
(
"delete"
)
public
Result
<
String
>
delete
(
IdParam
idParam
)
{
return
broadcastAudioService
.
delete
(
idParam
);
}
@ApiOperation
(
"修改"
)
@PutMapping
(
"modify"
)
public
Result
<
String
>
modify
(
@Valid
BroadcastAudioModifyParam
param
)
{
return
broadcastAudioService
.
modify
(
param
);
}
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"page"
)
public
Result
<
PageVo
<
BroadcastAudioVo
>>
page
(
@Valid
BroadcastAudioFindParam
param
,
PageParam
pageParam
)
{
return
broadcastAudioService
.
page
(
param
,
pageParam
);
}
@ApiOperation
(
"播报语音检索"
)
@GetMapping
(
"index"
)
public
Result
<
PageVo
<
BroadcastAudioIndexVo
>>
index
(
IndexParam
indexParam
)
{
return
broadcastAudioService
.
index
(
indexParam
);
}
@ApiOperation
(
"批量下载"
)
@GetMapping
(
"download"
)
public
void
download
()
{}
}
app/src/main/java/com/yiring/app/web/broadcast/BroadcastController.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
broadcast
;
import
com.yiring.app.param.broadcast.BroadcastParam
;
import
com.yiring.app.param.broadcast.BroadcastQueryParam
;
import
com.yiring.app.service.broadcast.BroadcastService
;
import
com.yiring.app.vo.broadcast.BroadcastVo
;
import
com.yiring.app.vo.broadcast.BroadcastjcVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.locationtech.jts.geom.Point
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/6 10:15
*/
@Slf4j
@Validated
@Api
(
tags
=
"Broadcast(播报设备管理)"
)
@RestController
@RequestMapping
(
"/broadcast/"
)
public
class
BroadcastController
{
@Resource
BroadcastService
broadcastService
;
@ApiOperation
(
value
=
"新增设备信息"
)
@PostMapping
(
"saveBroadcast"
)
public
Result
<
String
>
saveBroadcast
(
@Valid
BroadcastParam
broadcastParam
)
{
return
broadcastService
.
saveBroadcast
(
broadcastParam
);
}
@ApiOperation
(
value
=
"删除设备信息"
)
@PostMapping
(
"deleteBroadcast"
)
public
Result
<
String
>
deleteBroadcast
(
@Valid
IdParam
idParam
)
{
return
broadcastService
.
deleteBroadcast
(
idParam
);
}
@ApiOperation
(
value
=
"修改设备信息"
)
@PostMapping
(
"updateBroadcast"
)
public
Result
<
String
>
updateBroadcast
(
@Valid
BroadcastParam
broadcastParam
,
@Valid
IdParam
idParam
)
{
return
broadcastService
.
updateBroadcast
(
broadcastParam
,
idParam
);
}
@ApiOperation
(
value
=
"查看设备位置"
)
@GetMapping
(
"selectPoint"
)
public
Result
<
Point
>
selectPoint
(
@Valid
IdParam
idParam
)
{
return
broadcastService
.
selectPoint
(
idParam
);
}
@ApiOperation
(
value
=
"分页设备信息"
)
@GetMapping
(
"pageBroadcast"
)
public
Result
<
PageVo
<
BroadcastVo
>>
pageBroadcast
(
@Valid
BroadcastQueryParam
broadcastQueryParam
)
{
return
broadcastService
.
pageBroadcast
(
broadcastQueryParam
);
}
@ApiOperation
(
value
=
"导出"
,
produces
=
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
)
@PostMapping
(
"exportBroadcast"
)
public
void
exportBroadcast
(
HttpServletResponse
response
,
@Valid
BroadcastQueryParam
broadcastQueryParam
)
{
broadcastService
.
exportBroadcast
(
broadcastQueryParam
,
response
);
}
@ApiOperation
(
value
=
"导入"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
value
=
"文件"
,
required
=
true
,
name
=
"file"
)
})
@PostMapping
(
"importVideo"
)
public
Result
<
String
>
importVideo
(
MultipartFile
file
)
{
return
broadcastService
.
importBroadcast
(
file
);
}
@ApiOperation
(
value
=
"根据名字检索"
)
@GetMapping
(
"selectBroadcastName"
)
public
Result
<
PageVo
<
BroadcastjcVo
>>
selectBroadcastName
(
@Valid
IndexParam
indexParam
)
{
return
broadcastService
.
selectBroadcastName
(
indexParam
);
}
}
app/src/main/java/com/yiring/app/web/dept/DepartmentController.java
浏览文件 @
c28135da
...
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
/**
/**
* 部门
信息
控制器
* 部门控制器
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/19
* @date 2022/4/19
*/
*/
...
...
app/src/main/java/com/yiring/app/web/icon/IconController.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
icon
;
import
com.yiring.app.param.icon.IconParam
;
import
com.yiring.app.service.icon.IconService
;
import
com.yiring.app.vo.icon.IconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author tzl
* @version 1.0
* @description:
* @date 2022/5/5 15:18
*/
@Slf4j
@Validated
@Api
(
tags
=
"Icon(图标管理)"
)
@RestController
@RequestMapping
(
"/icon/"
)
public
class
IconController
{
@Resource
IconService
iconService
;
@ApiOperation
(
value
=
"新增图标信息"
)
@PostMapping
(
"saveIcon"
)
public
Result
<
String
>
saveIcon
(
@Valid
IconParam
iconParam
)
{
return
iconService
.
saveIcon
(
iconParam
);
}
@ApiOperation
(
value
=
"删除图标信息"
)
@PostMapping
(
"deleteIcon"
)
public
Result
<
String
>
deleteIcon
(
@Valid
IdParam
idParam
)
{
return
iconService
.
deleteIcon
(
idParam
);
}
@ApiOperation
(
value
=
"修改图标信息"
)
@PostMapping
(
"updateIcon"
)
public
Result
<
String
>
updateIcon
(
@Valid
IconParam
iconParam
,
@Valid
IdParam
idParam
)
{
return
iconService
.
updateIcon
(
iconParam
,
idParam
);
}
@ApiOperation
(
value
=
"分页图标信息"
)
@GetMapping
(
"pageIcon"
)
public
Result
<
PageVo
<
IconVo
>>
pageIcon
(
@Valid
PageParam
pageParam
)
{
return
iconService
.
pageIcon
(
pageParam
);
}
}
app/src/main/java/com/yiring/app/web/key/KeyAlarmController.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
key
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.service.key.KeyAlarmService
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@Slf4j
@Validated
@Api
(
tags
=
"按键报警"
)
@RestController
@RequestMapping
(
"/key/alarm"
)
public
class
KeyAlarmController
{
@Resource
KeyAlarmService
keyAlarmService
;
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"page"
)
public
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
)
{
return
keyAlarmService
.
page
(
param
,
pageParam
);
}
}
app/src/main/java/com/yiring/app/web/user/UserAppController.java
浏览文件 @
c28135da
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
package
com
.
yiring
.
app
.
web
.
user
;
package
com
.
yiring
.
app
.
web
.
user
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.service.user.UserService
;
import
com.yiring.app.service.user.User
App
Service
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.IdsParam
;
...
@@ -37,7 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -37,7 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
public
class
UserAppController
{
public
class
UserAppController
{
@Resource
@Resource
UserService
userService
;
User
App
Service
userService
;
@ApiOperation
(
"表格查询"
)
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"findUserPage"
)
@GetMapping
(
"findUserPage"
)
...
@@ -59,8 +59,8 @@ public class UserAppController {
...
@@ -59,8 +59,8 @@ public class UserAppController {
@ApiOperation
(
"收卡"
)
@ApiOperation
(
"收卡"
)
@PutMapping
(
"userUnBingTag"
)
@PutMapping
(
"userUnBingTag"
)
public
Result
<
String
>
userUnBingTag
(
@Valid
Id
Param
id
Param
)
{
public
Result
<
String
>
userUnBingTag
(
@Valid
Id
sParam
ids
Param
)
{
return
userService
.
userUnBingTag
(
idParam
);
return
userService
.
userUnBingTag
(
id
s
Param
);
}
}
@ApiOperation
(
"逻辑删除用户"
)
@ApiOperation
(
"逻辑删除用户"
)
...
@@ -110,4 +110,10 @@ public class UserAppController {
...
@@ -110,4 +110,10 @@ public class UserAppController {
public
Result
<
PageVo
<
UserVo
>>
findUser
(
@Valid
UserFindParam
userFindParam
)
{
public
Result
<
PageVo
<
UserVo
>>
findUser
(
@Valid
UserFindParam
userFindParam
)
{
return
userService
.
findUser
(
userFindParam
);
return
userService
.
findUser
(
userFindParam
);
}
}
@ApiOperation
(
"批量发卡"
)
@PutMapping
(
"batchSendCard"
)
public
Result
<
String
>
batchSendCard
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
return
userService
.
batchSendCard
(
file
);
}
}
}
app/src/main/java/com/yiring/app/web/video/VideoController.java
浏览文件 @
c28135da
...
@@ -45,7 +45,7 @@ public class VideoController {
...
@@ -45,7 +45,7 @@ public class VideoController {
@ApiOperation
(
value
=
"新增监控点位信息"
)
@ApiOperation
(
value
=
"新增监控点位信息"
)
@PostMapping
(
"saveVideo"
)
@PostMapping
(
"saveVideo"
)
public
Result
<
String
>
findLatest
(
@Valid
VideoParam
videoParam
)
{
public
Result
<
String
>
saveVideo
(
@Valid
VideoParam
videoParam
)
{
return
videoService
.
saveVideo
(
videoParam
);
return
videoService
.
saveVideo
(
videoParam
);
}
}
...
...
app/src/main/java/com/yiring/app/web/visitor/InvitationController.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
visitor
;
package
com
.
yiring
.
app
.
web
.
visitor
;
import
com.yiring.app.param.visitor.InvitationAppQueryParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.param.visitor.InvitationQueryParam
;
import
com.yiring.app.service.visitor.InvitationService
;
import
com.yiring.app.service.visitor.InvitationService
;
import
com.yiring.app.vo.visitor.InvitationVo
;
import
com.yiring.app.vo.visitor.Invitation
Details
Vo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
...
@@ -69,7 +70,7 @@ public class InvitationController {
...
@@ -69,7 +70,7 @@ public class InvitationController {
@ApiOperation
(
value
=
"查看邀请信息(分页)"
)
@ApiOperation
(
value
=
"查看邀请信息(分页)"
)
@GetMapping
(
"pageInv"
)
@GetMapping
(
"pageInv"
)
public
Result
<
PageVo
<
InvitationVo
>>
pageInv
(
@Valid
InvitationQueryParam
invitationQueryParam
)
{
public
Result
<
PageVo
<
Invitation
Details
Vo
>>
pageInv
(
@Valid
InvitationQueryParam
invitationQueryParam
)
{
return
invitationService
.
pageInv
(
invitationQueryParam
);
return
invitationService
.
pageInv
(
invitationQueryParam
);
}
}
...
@@ -78,4 +79,16 @@ public class InvitationController {
...
@@ -78,4 +79,16 @@ public class InvitationController {
public
void
exportInv
(
HttpServletResponse
response
,
@Valid
InvitationQueryParam
invitationQueryParam
)
{
public
void
exportInv
(
HttpServletResponse
response
,
@Valid
InvitationQueryParam
invitationQueryParam
)
{
invitationService
.
exportInv
(
invitationQueryParam
,
response
);
invitationService
.
exportInv
(
invitationQueryParam
,
response
);
}
}
@ApiOperation
(
value
=
"小程序查看邀请详情"
)
@GetMapping
(
"detailsInv"
)
public
Result
<
InvitationDetailsVo
>
detailsInv
(
@Valid
IdParam
idParam
)
{
return
invitationService
.
detailsInv
(
idParam
);
}
@ApiOperation
(
value
=
"小程序查看邀请"
)
@GetMapping
(
"appGetInv"
)
public
Result
<
PageVo
<
InvitationDetailsVo
>>
appGetInv
(
@Valid
InvitationAppQueryParam
invitationAppQueryParam
)
{
return
invitationService
.
findAllByVisitor_VisitorMobileAndVisitor_Deleted
(
invitationAppQueryParam
);
}
}
}
app/src/main/java/com/yiring/app/web/visitor/VisitorController.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
visitor
;
package
com
.
yiring
.
app
.
web
.
visitor
;
import
com.yiring.app.param.visitor.VisitorAppQueryParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.param.visitor.VisitorQueryParam
;
import
com.yiring.app.service.visitor.VisitorService
;
import
com.yiring.app.service.visitor.VisitorService
;
import
com.yiring.app.vo.visitor.VisitorAppVo
;
import
com.yiring.app.vo.visitor.VisitorDetailsVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.app.vo.visitor.VisitorVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
...
@@ -69,7 +72,7 @@ public class VisitorController {
...
@@ -69,7 +72,7 @@ public class VisitorController {
@ApiOperation
(
value
=
"查看访客信息详情"
)
@ApiOperation
(
value
=
"查看访客信息详情"
)
@GetMapping
(
"selectVisitor"
)
@GetMapping
(
"selectVisitor"
)
public
Result
<
VisitorVo
>
selectVisitor
(
@Valid
IdParam
idParam
)
{
public
Result
<
Visitor
Details
Vo
>
selectVisitor
(
@Valid
IdParam
idParam
)
{
return
visitorService
.
selectVisitor
(
idParam
);
return
visitorService
.
selectVisitor
(
idParam
);
}
}
...
@@ -84,4 +87,10 @@ public class VisitorController {
...
@@ -84,4 +87,10 @@ public class VisitorController {
public
void
exportVisitor
(
HttpServletResponse
response
,
@Valid
VisitorQueryParam
visitorQueryParam
)
{
public
void
exportVisitor
(
HttpServletResponse
response
,
@Valid
VisitorQueryParam
visitorQueryParam
)
{
visitorService
.
exportVisitor
(
visitorQueryParam
,
response
);
visitorService
.
exportVisitor
(
visitorQueryParam
,
response
);
}
}
@ApiOperation
(
value
=
"小程序查看来访历史(分页)"
)
@GetMapping
(
"selectInfo"
)
public
Result
<
PageVo
<
VisitorAppVo
>>
selectInfo
(
@Valid
VisitorAppQueryParam
visitorAppQueryParam
)
{
return
visitorService
.
selectInfo
(
visitorAppQueryParam
);
}
}
}
app/src/main/resources/application-dev.yml
浏览文件 @
c28135da
...
@@ -3,6 +3,11 @@ env:
...
@@ -3,6 +3,11 @@ env:
host
:
192.168.0.156
host
:
192.168.0.156
spring
:
spring
:
servlet
:
multipart
:
enabled
:
true
max-file-size
:
50MB
max-request-size
:
100MB
datasource
:
datasource
:
url
:
jdbc:postgresql://${env.host}:5432/kshg_app
url
:
jdbc:postgresql://${env.host}:5432/kshg_app
username
:
admin
username
:
admin
...
@@ -26,24 +31,16 @@ spring:
...
@@ -26,24 +31,16 @@ spring:
username
:
admin
username
:
admin
password
:
123456
password
:
123456
virtual-host
:
/
virtual-host
:
/
# 开启发送端确认
data
:
publisher-confirm-type
:
correlated
redis
:
# 开启接收端确认
repositories
:
publisher-returns
:
true
enabled
:
false
template
:
# 处理多网卡选举
# 消息抵达队列,异步回调 confirm
cloud
:
mandatory
:
true
inetutils
:
listener
:
preferred-networks
:
192.168.0
simple
:
# 手动确认消息
acknowledge-mode
:
manual
servlet
:
multipart
:
enabled
:
true
max-file-size
:
50MB
max-request-size
:
100MB
# knife4j
# knife4j
(swagger)
knife4j
:
knife4j
:
enable
:
true
enable
:
true
basic
:
basic
:
...
@@ -62,10 +59,33 @@ minio:
...
@@ -62,10 +59,33 @@ minio:
bucket
:
kshg
bucket
:
kshg
domain
:
${minio.endpoint}/${minio.bucket}
domain
:
${minio.endpoint}/${minio.bucket}
# 任务调度
xxl
:
job
:
### 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
admin-addresses
:
http://${env.host}:8080/xxl-job-admin
### 执行器通讯TOKEN [选填]:非空时启用;
access-token
:
local
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
executor-app-name
:
kshg-app
### 执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
executor-address
:
### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
executor-ip
:
### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
executor-port
:
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
executor-log-path
:
/data/applogs/xxl-job/jobhandler
### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
executor-log-retention-days
:
30
# 日志
logging
:
logging
:
level
:
level
:
# sql bind parameter
# sql bind parameter
org.hibernate.type.descriptor.sql.BasicBinder
:
trace
# org.hibernate.type.descriptor.sql.BasicBinder: trace
org.hibernate.type.descriptor.sql.BasicBinder
:
error
# 真源定位系统相关配置
# 真源定位系统相关配置
zy-config
:
zy-config
:
host
:
project.yz-online.com
host
:
project.yz-online.com
...
...
app/src/main/resources/application.yml
浏览文件 @
c28135da
...
@@ -9,11 +9,7 @@ spring:
...
@@ -9,11 +9,7 @@ spring:
profiles
:
profiles
:
include
:
auth, conf-patch
include
:
auth, conf-patch
active
:
dev
active
:
dev
servlet
:
multipart
:
enabled
:
true
max-file-size
:
10MB
max-request-size
:
10MB
# DEBUG
# DEBUG
debug
:
false
debug
:
false
basic-auth/src/main/java/com/yiring/auth/param/user/UserFindParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
param
.
user
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户查询
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"UserFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
708988930160146138L
;
@ApiModelProperty
(
value
=
"姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"部门ID"
,
example
=
"100"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"角色ID"
,
example
=
"100"
)
String
roles
;
}
basic-auth/src/main/java/com/yiring/auth/param/user/UserSaveParam.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
param
.
user
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.role.Role
;
import
com.yiring.auth.domain.user.User
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.HashSet
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户新增参数
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"UserAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserSaveParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2256725474621511610L
;
@ApiModelProperty
(
value
=
"用户昵称"
,
example
=
"张三"
,
required
=
true
)
@NotEmpty
(
message
=
"用户昵称不能为空"
)
String
realName
;
@ApiModelProperty
(
value
=
"手机号码"
,
example
=
"1888888888"
)
String
mobile
;
@ApiModelProperty
(
value
=
"用户名称"
,
example
=
"admin"
,
required
=
true
)
@NotEmpty
(
message
=
"用户名称不能为空"
)
String
username
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"0/1"
)
Boolean
gender
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"100"
)
Long
postId
;
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"归属部门不能为空"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"zhansan@163.com"
)
String
email
;
@ApiModelProperty
(
value
=
"用户密码"
,
example
=
"*******"
,
required
=
true
)
@NotEmpty
(
message
=
"用户密码不能为空"
)
String
password
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"0/1"
)
Boolean
enabled
;
@ApiModelProperty
(
value
=
"角色id"
,
example
=
"1,2,3"
,
required
=
true
)
@NotEmpty
(
message
=
"角色id不能为空"
)
String
roles
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"请输入备注"
)
String
introduction
;
public
static
User
transform
(
UserSaveParam
param
)
{
User
user
=
User
.
builder
()
.
realName
(
param
.
getRealName
())
.
mobile
(
param
.
getMobile
())
.
username
(
param
.
getUsername
())
.
gender
(
param
.
getGender
())
.
department
(
Department
.
builder
().
id
(
param
.
getDeptId
()).
build
())
.
email
(
param
.
getEmail
())
.
password
(
param
.
getPassword
())
.
enabled
(
param
.
getEnabled
())
.
introduction
(
param
.
getIntroduction
())
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getPostId
()))
{
user
.
setPost
(
Post
.
builder
().
id
(
param
.
getPostId
()).
build
());
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
HashSet
<
Role
>
hashSet
=
new
HashSet
<>();
for
(
Long
role
:
roles
)
{
hashSet
.
add
(
Role
.
builder
().
id
(
role
).
build
());
}
user
.
setRoles
(
hashSet
);
}
return
user
;
}
}
basic-auth/src/main/java/com/yiring/auth/service/user/UserService.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.vo.user.UserVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 用户
*
* @author LJ-2204
* @date 2022/5/10
*/
public
interface
UserService
{
/**
* 添加系统用户
* @param param UserSaveParam
* @return Result<String>
*/
Result
<
String
>
add
(
UserSaveParam
param
);
/**
* 分页查询
* @param param UserFindParam
* @param pageParam PageParam
* @return Result<PageVo<UserVo>>
*/
Result
<
PageVo
<
UserVo
>>
page
(
UserFindParam
param
,
PageParam
pageParam
);
}
basic-auth/src/main/java/com/yiring/auth/service/user/impl/UserServiceImpl.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
import
com.yiring.auth.vo.user.UserVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/10
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
UserServiceImpl
implements
UserService
{
@Resource
UserRepository
userRepository
;
@Override
public
Result
<
String
>
add
(
UserSaveParam
param
)
{
userRepository
.
save
(
UserSaveParam
.
transform
(
param
));
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
UserVo
>>
page
(
UserFindParam
param
,
PageParam
pageParam
)
{
Specification
<
User
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
predicates
.
add
(
cb
.
isNotNull
(
root
.
get
(
User
.
Fields
.
username
)));
if
(
StrUtil
.
isNotEmpty
(
param
.
getRealName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getRealName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getDeptId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
User
.
Fields
.
department
).
get
(
BasicEntity
.
Fields
.
id
),
param
.
getDeptId
())
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
User
.
Fields
.
post
).
get
(
BasicEntity
.
Fields
.
id
));
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
for
(
Long
role
:
roles
)
in
.
value
(
role
);
predicates
.
add
(
cb
.
and
(
in
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
User
>
users
=
userRepository
.
findAll
(
specification
,
pageable
);
List
<
UserVo
>
userVos
=
users
.
getContent
().
stream
().
map
(
UserVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
UserVo
>
pageVo
=
PageVo
.
build
(
userVos
,
users
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
}
basic-auth/src/main/java/com/yiring/auth/vo/user/UserVo.java
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
vo
.
user
;
package
com
.
yiring
.
auth
.
vo
.
user
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.vo.role.RoleVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Set
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -32,36 +36,45 @@ public class UserVo implements Serializable {
...
@@ -32,36 +36,45 @@ public class UserVo implements Serializable {
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
Long
id
;
@ApiModelProperty
(
value
=
"
真实姓名"
,
example
=
"超级用户
"
)
@ApiModelProperty
(
value
=
"
姓名"
,
example
=
"张三
"
)
String
realName
;
String
realName
;
@ApiModelProperty
(
value
=
"
用户名"
,
example
=
"admin
"
)
@ApiModelProperty
(
value
=
"
工号"
,
example
=
"1234566
"
)
String
u
sername
;
String
u
uid
;
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
@ApiModelProperty
(
value
=
"部门ID"
,
example
=
"100"
)
String
mobile
;
Long
deptId
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
email
;
@ApiModelProperty
(
value
=
"职称"
,
example
=
"系统管理员"
)
String
title
;
@ApiModelProperty
(
value
=
"头像"
,
example
=
"https://s1.ax1x.com/2022/03/30/qggJH0.jpg"
)
String
avatar
;
@ApiModelProperty
(
value
=
"
是否启用"
,
example
=
"true
"
)
@ApiModelProperty
(
value
=
"
部门名称"
,
example
=
"研发
"
)
Boolean
enabled
;
String
deptName
;
@ApiModelProperty
(
value
=
"
是否删除"
,
example
=
"false
"
)
@ApiModelProperty
(
value
=
"
手机号"
,
example
=
"13012345678
"
)
Boolean
deleted
;
String
mobile
;
@ApiModelProperty
(
value
=
"
最后登录IP地址"
,
example
=
"127.0.0.1
"
)
@ApiModelProperty
(
value
=
"
角色"
,
example
=
"系统管理员
"
)
S
tring
lastLoginIp
;
S
et
<
RoleVo
>
roles
;
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
LocalDateTime
lastLoginTime
;
LocalDateTime
lastLoginTime
;
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-01-01 00:00:00"
)
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
LocalDateTime
createTime
;
Boolean
enabled
;
public
static
UserVo
transform
(
User
user
)
{
UserVo
userVo
=
UserVo
.
builder
()
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
uuid
(
user
.
getUuid
())
.
mobile
(
user
.
getMobile
())
.
lastLoginTime
(
user
.
getLastLoginTime
())
.
enabled
(
user
.
getEnabled
())
.
deptName
(
user
.
getDepartment
().
getName
())
.
deptId
(
user
.
getDepartment
().
getId
())
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
user
.
getRoles
()))
{}
return
userVo
;
}
}
}
basic-auth/src/main/java/com/yiring/auth/web/user/UserController.java
浏览文件 @
c28135da
...
@@ -7,6 +7,9 @@ import com.yiring.auth.domain.role.RoleRepository;
...
@@ -7,6 +7,9 @@ import com.yiring.auth.domain.role.RoleRepository;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
import
com.yiring.auth.util.Auths
;
import
com.yiring.auth.util.Auths
;
import
com.yiring.auth.util.Permissions
;
import
com.yiring.auth.util.Permissions
;
import
com.yiring.auth.vo.permission.MenuVo
;
import
com.yiring.auth.vo.permission.MenuVo
;
...
@@ -27,8 +30,6 @@ import java.util.stream.Collectors;
...
@@ -27,8 +30,6 @@ import java.util.stream.Collectors;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -59,6 +60,9 @@ public class UserController {
...
@@ -59,6 +60,9 @@ public class UserController {
@Resource
@Resource
RoleRepository
roleRepository
;
RoleRepository
roleRepository
;
@Resource
UserService
userService
;
@ApiOperation
(
value
=
"获取登录用户信息"
)
@ApiOperation
(
value
=
"获取登录用户信息"
)
@GetMapping
(
"getUserInfo"
)
@GetMapping
(
"getUserInfo"
)
public
Result
<
UserInfoVo
>
getUserInfo
()
{
public
Result
<
UserInfoVo
>
getUserInfo
()
{
...
@@ -121,8 +125,9 @@ public class UserController {
...
@@ -121,8 +125,9 @@ public class UserController {
@ApiOperation
(
value
=
"分页查询"
)
@ApiOperation
(
value
=
"分页查询"
)
@GetMapping
(
"/manage/page"
)
@GetMapping
(
"/manage/page"
)
public
Result
<
PageVo
<
UserVo
>>
page
(
@Valid
PageParam
param
)
{
public
Result
<
PageVo
<
UserVo
>>
page
(
@Valid
UserFindParam
param
,
@Valid
PageParam
pageParam
)
{
Page
<
User
>
page
=
userRepository
.
findAll
(
PageParam
.
toPageable
(
param
));
return
userService
.
page
(
param
,
pageParam
);
/* Page<User> page = userRepository.findAll(PageParam.toPageable(pageParam));
List<UserVo> data = page
List<UserVo> data = page
.get()
.get()
.map(role -> {
.map(role -> {
...
@@ -132,6 +137,12 @@ public class UserController {
...
@@ -132,6 +137,12 @@ public class UserController {
})
})
.collect(Collectors.toList());
.collect(Collectors.toList());
PageVo<UserVo> vo = PageVo.build(data, page.getTotalElements());
PageVo<UserVo> vo = PageVo.build(data, page.getTotalElements());
return
Result
.
ok
(
vo
);
return Result.ok(vo);*/
}
@ApiOperation
(
"添加用户"
)
@PostMapping
(
"add"
)
public
Result
<
String
>
add
(
@Valid
UserSaveParam
param
)
{
return
userService
.
add
(
param
);
}
}
}
}
basic-common/core/build.gradle
浏览文件 @
c28135da
...
@@ -17,12 +17,7 @@ dependencies {
...
@@ -17,12 +17,7 @@ dependencies {
// JTS 几何对象操作库
// JTS 几何对象操作库
implementation
"org.locationtech.jts:jts-core:${jtsVersion}"
implementation
"org.locationtech.jts:jts-core:${jtsVersion}"
/*// https://mvnrepository.com/artifact/com.graphhopper.external/jackson-datatype-jts
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts/1.2.10
implementation("com.graphhopper.external:jackson-datatype-jts:1.0-2.7") {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'org.locationtech.jts', module: 'jts-core'
}*/
// https://mvnrepository.com/artifact/com.graphhopper.external/jackson-datatype-jts
implementation
(
"org.n52.jackson:jackson-datatype-jts:1.2.10"
)
{
implementation
(
"org.n52.jackson:jackson-datatype-jts:1.2.10"
)
{
exclude
group:
'com.fasterxml.jackson.core'
,
module:
'jackson-databind'
exclude
group:
'com.fasterxml.jackson.core'
,
module:
'jackson-databind'
exclude
group:
'com.fasterxml.jackson.core'
,
module:
'jackson-annotations'
exclude
group:
'com.fasterxml.jackson.core'
,
module:
'jackson-annotations'
...
...
basic-common/core/src/main/java/com/yiring/common/domain/BasicEntity.java
浏览文件 @
c28135da
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
package
com
.
yiring
.
common
.
domain
;
package
com
.
yiring
.
common
.
domain
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Objects
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
...
@@ -11,7 +10,6 @@ import lombok.*;
...
@@ -11,7 +10,6 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.SuperBuilder
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.Hibernate
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.annotations.GenericGenerator
;
...
@@ -52,17 +50,4 @@ public abstract class BasicEntity {
...
@@ -52,17 +50,4 @@ public abstract class BasicEntity {
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
@UpdateTimestamp
@UpdateTimestamp
LocalDateTime
updateTime
;
LocalDateTime
updateTime
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
Hibernate
.
getClass
(
this
)
!=
Hibernate
.
getClass
(
o
))
return
false
;
BasicEntity
that
=
(
BasicEntity
)
o
;
return
id
!=
null
&&
Objects
.
equals
(
id
,
that
.
id
);
}
@Override
public
int
hashCode
()
{
return
getClass
().
hashCode
();
}
}
}
basic-common/util/src/main/java/com/yiring/common/annotation/Times.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
common
.
annotation
;
import
java.lang.annotation.*
;
/**
* 耗时计算注解
*
* @author Jim
* @version 0.1
* 2022/4/7 15:21
*/
@SuppressWarnings
({
"unused"
})
@Target
({
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
Times
{
/**
* 描述
*/
String
value
()
default
""
;
}
basic-common/util/src/main/java/com/yiring/common/aspect/RequestAspect.java
浏览文件 @
c28135da
...
@@ -3,6 +3,7 @@ package com.yiring.common.aspect;
...
@@ -3,6 +3,7 @@ package com.yiring.common.aspect;
import
cn.hutool.extra.servlet.ServletUtil
;
import
cn.hutool.extra.servlet.ServletUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yiring.common.constant.DateFormatter
;
import
com.yiring.common.constant.DateFormatter
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.util.Commons
;
import
com.yiring.common.util.Commons
;
...
@@ -34,7 +35,7 @@ public class RequestAspect {
...
@@ -34,7 +35,7 @@ public class RequestAspect {
Boolean
debug
;
Boolean
debug
;
@Pointcut
(
@Pointcut
(
"@annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.ExceptionHandler)"
"@annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.
PutMapping) || @annotation(org.springframework.web.bind.annotation.DeleteMapping) || @annotation(org.springframework.web.bind.annotation.PatchMapping) || @annotation(org.springframework.web.bind.annotation.
ExceptionHandler)"
)
)
public
void
apiPointCut
()
{}
public
void
apiPointCut
()
{}
...
@@ -52,8 +53,10 @@ public class RequestAspect {
...
@@ -52,8 +53,10 @@ public class RequestAspect {
// Print Request Log (Optional Replace: MDC)
// Print Request Log (Optional Replace: MDC)
String
extra
=
""
;
String
extra
=
""
;
if
(
Boolean
.
TRUE
.
equals
(
debug
))
{
if
(
Boolean
.
TRUE
.
equals
(
debug
))
{
extra
+=
String
.
format
(
"\nHeaders: %s"
,
JSONObject
.
toJSONString
(
ServletUtil
.
getHeaderMap
(
request
),
true
));
String
headers
=
JSONObject
.
toJSONString
(
ServletUtil
.
getHeaderMap
(
request
),
SerializerFeature
.
PrettyFormat
);
extra
+=
String
.
format
(
"\nParams: %s"
,
JSONObject
.
toJSONString
(
ServletUtil
.
getParamMap
(
request
),
true
));
String
params
=
JSONObject
.
toJSONString
(
ServletUtil
.
getParamMap
(
request
),
SerializerFeature
.
PrettyFormat
);
extra
+=
String
.
format
(
"\nHeaders: %s"
,
headers
);
extra
+=
String
.
format
(
"\nParams: %s"
,
params
);
if
(
result
instanceof
Result
)
{
if
(
result
instanceof
Result
)
{
extra
+=
extra
+=
String
.
format
(
String
.
format
(
...
...
basic-common/util/src/main/java/com/yiring/common/aspect/TimesAspect.java
0 → 100644
浏览文件 @
c28135da
/* (C) 2021 YiRing, Inc. */
package
com
.
yiring
.
common
.
aspect
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.common.annotation.Times
;
import
java.lang.reflect.Method
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.stereotype.Component
;
/**
* 耗时计算注解切面
*
* @author ifzm
* @version 0.1
*/
@Slf4j
@Aspect
@Component
public
class
TimesAspect
{
@Pointcut
(
"@annotation(com.yiring.common.annotation.Times)"
)
public
void
pointCut
()
{}
@Around
(
"pointCut()"
)
public
Object
around
(
ProceedingJoinPoint
point
)
throws
Throwable
{
long
start
=
System
.
currentTimeMillis
();
Object
result
=
point
.
proceed
();
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"[Times] {}: {} ms"
,
getTimesValue
(
point
),
end
-
start
);
return
result
;
}
public
String
getTimesValue
(
JoinPoint
joinPoint
)
{
// 获取切入点的目标类
Class
<?>
targetClass
=
joinPoint
.
getTarget
().
getClass
();
// 获取切入方法名
String
methodName
=
joinPoint
.
getSignature
().
getName
();
// 获取切入方法参数
Object
[]
arguments
=
joinPoint
.
getArgs
();
// 获取目标类的所有方法
Method
[]
methods
=
targetClass
.
getMethods
();
String
timesValue
=
methodName
;
for
(
Method
method
:
methods
)
{
// 方法名相同、包含目标注解、方法参数个数相同(避免有重载)
if
(
method
.
getName
().
equals
(
methodName
)
&&
method
.
isAnnotationPresent
(
Times
.
class
)
&&
method
.
getParameterTypes
().
length
==
arguments
.
length
)
{
String
value
=
method
.
getAnnotation
(
Times
.
class
).
value
();
if
(
StrUtil
.
isNotEmpty
(
value
))
{
timesValue
=
value
;
}
}
}
return
timesValue
;
}
}
build.gradle
浏览文件 @
c28135da
...
@@ -3,6 +3,8 @@ buildscript {
...
@@ -3,6 +3,8 @@ buildscript {
maven
{
url
"https://plugins.gradle.org/m2/"
}
maven
{
url
"https://plugins.gradle.org/m2/"
}
}
}
ext
{
ext
{
// https://start.spring.io/
springCloudVersion
=
'2021.0.2'
// https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter
// https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter
knife4jVersion
=
'2.0.9'
knife4jVersion
=
'2.0.9'
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
...
@@ -26,11 +28,9 @@ buildscript {
...
@@ -26,11 +28,9 @@ buildscript {
// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
jtsVersion
=
'1.18.2'
jtsVersion
=
'1.18.2'
// https://mvnrepository.com/artifact/com.vladmihalcea/hibernate-types-55
// https://mvnrepository.com/artifact/com.vladmihalcea/hibernate-types-55
hibernateTypesVersion
=
'2.16.
1
'
hibernateTypesVersion
=
'2.16.
2
'
// https://mvnrepository.com/artifact/com.github.liaochong/myexcel
// https://mvnrepository.com/artifact/com.github.liaochong/myexcel
myexcelVersion
=
'4.1.1'
myexcelVersion
=
'4.1.1'
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
openfeignVersion
=
'3.1.1'
// https://mvnrepository.com/artifact/io.github.openfeign/feign-okhttp
// https://mvnrepository.com/artifact/io.github.openfeign/feign-okhttp
feignOkhttpVersion
=
'11.8'
feignOkhttpVersion
=
'11.8'
}
}
...
@@ -38,7 +38,7 @@ buildscript {
...
@@ -38,7 +38,7 @@ buildscript {
plugins
{
plugins
{
id
'java'
id
'java'
id
'org.springframework.boot'
version
'2.6.
6
'
id
'org.springframework.boot'
version
'2.6.
7
'
// https://plugins.gradle.org/plugin/io.spring.dependency-management
// https://plugins.gradle.org/plugin/io.spring.dependency-management
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
// https://plugins.gradle.org/plugin/com.diffplug.spotless
// https://plugins.gradle.org/plugin/com.diffplug.spotless
...
@@ -81,6 +81,12 @@ subprojects {
...
@@ -81,6 +81,12 @@ subprojects {
annotationProcessor
'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor
'org.springframework.boot:spring-boot-configuration-processor'
}
}
dependencyManagement
{
imports
{
mavenBom
"org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
[
compileJava
,
compileTestJava
,
javadoc
]*.
options
*.
encoding
=
'UTF-8'
[
compileJava
,
compileTestJava
,
javadoc
]*.
options
*.
encoding
=
'UTF-8'
tasks
.
withType
(
JavaCompile
)
{
tasks
.
withType
(
JavaCompile
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论