Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
27d5320f
提交
27d5320f
authored
5月 09, 2022
作者:
涂茂林
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev_lijing' 到 'dev_tml'
Dev lijing 查看合并请求 chemical-kesai/kshg-api!19
上级
7058ff2c
b965b527
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
73 个修改的文件
包含
2183 行增加
和
428 行删除
+2183
-428
KeyAlarm.java
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
+11
-0
KeyAlarmRules.java
...rc/main/java/com/yiring/app/domain/key/KeyAlarmRules.java
+60
-0
KeyAlarmRulesRepository.java
...va/com/yiring/app/domain/key/KeyAlarmRulesRepository.java
+17
-0
LocationBeacon.java
...n/java/com/yiring/app/domain/location/LocationBeacon.java
+4
-0
DepartmentExportExcel.java
...java/com/yiring/app/excel/dept/DepartmentExportExcel.java
+7
-2
DepartmentImportExcel.java
...java/com/yiring/app/excel/dept/DepartmentImportExcel.java
+4
-4
KeyAlarmRulesExportExcel.java
...va/com/yiring/app/excel/key/KeyAlarmRulesExportExcel.java
+54
-0
LocationBeaconExportExcel.java
.../app/excel/location/beacon/LocationBeaconExportExcel.java
+36
-0
LocationTagExportExcel.java
...yiring/app/excel/location/tag/LocationTagExportExcel.java
+1
-1
LocationTagImportExcel.java
...yiring/app/excel/location/tag/LocationTagImportExcel.java
+6
-5
UserImportExcel.java
.../main/java/com/yiring/app/excel/user/UserImportExcel.java
+9
-9
DepartmentClient.java
...n/java/com/yiring/app/feign/zy/dept/DepartmentClient.java
+33
-0
LocationBeaconClient.java
...ng/app/feign/zy/location/beacon/LocationBeaconClient.java
+21
-0
LocationTagClient.java
...m/yiring/app/feign/zy/location/tag/LocationTagClient.java
+37
-0
LocationTagTypeClient.java
...ring/app/feign/zy/location/tag/LocationTagTypeClient.java
+24
-0
UserClient.java
...rc/main/java/com/yiring/app/feign/zy/user/UserClient.java
+40
-0
DepartmentAddParam.java
...in/java/com/yiring/app/param/dept/DepartmentAddParam.java
+0
-5
DepartmentModifyParam.java
...java/com/yiring/app/param/dept/DepartmentModifyParam.java
+9
-8
KeyAlarmRulesAddParam.java
.../java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
+41
-0
KeyAlarmRulesExportParam.java
...va/com/yiring/app/param/key/KeyAlarmRulesExportParam.java
+34
-0
KeyAlarmRulesModifyParam.java
...va/com/yiring/app/param/key/KeyAlarmRulesModifyParam.java
+45
-0
KeyAlarmRulesPageParam.java
...java/com/yiring/app/param/key/KeyAlarmRulesPageParam.java
+34
-0
LocationBeaconAddParam.java
...ing/app/param/location/beacon/LocationBeaconAddParam.java
+76
-0
LocationBeaconExportParam.java
.../app/param/location/beacon/LocationBeaconExportParam.java
+31
-0
LocationBeaconFindParam.java
...ng/app/param/location/beacon/LocationBeaconFindParam.java
+31
-0
LocationTagDeleteParam.java
...yiring/app/param/location/tag/LocationTagDeleteParam.java
+0
-4
LocationTagModifyParam.java
...yiring/app/param/location/tag/LocationTagModifyParam.java
+6
-8
LocationTagTypeFindParam.java
...ring/app/param/location/tag/LocationTagTypeFindParam.java
+3
-0
LocationTagTypeSendParam.java
...ring/app/param/location/tag/LocationTagTypeSendParam.java
+36
-0
PostModifyParam.java
.../main/java/com/yiring/app/param/post/PostModifyParam.java
+5
-9
PostParam.java
app/src/main/java/com/yiring/app/param/post/PostParam.java
+1
-8
UserAddParam.java
...src/main/java/com/yiring/app/param/user/UserAddParam.java
+2
-7
UserModifyParam.java
.../main/java/com/yiring/app/param/user/UserModifyParam.java
+14
-16
ZyDepartmentAddParam.java
...va/com/yiring/app/param/zy/dept/ZyDepartmentAddParam.java
+71
-0
ZyDepartmentFindParam.java
...a/com/yiring/app/param/zy/dept/ZyDepartmentFindParam.java
+39
-0
ZyDepartmentModifyParam.java
...com/yiring/app/param/zy/dept/ZyDepartmentModifyParam.java
+76
-0
ZyLocationTagAddParam.java
...ring/app/param/zy/location/tag/ZyLocationTagAddParam.java
+5
-23
ZyLocationTagTypeSendParam.java
...app/param/zy/location/tag/ZyLocationTagTypeSendParam.java
+39
-0
ZyUserAddParam.java
...ain/java/com/yiring/app/param/zy/user/ZyUserAddParam.java
+65
-0
ZyUserFindParam.java
...in/java/com/yiring/app/param/zy/user/ZyUserFindParam.java
+43
-0
ZyUserModifyParam.java
.../java/com/yiring/app/param/zy/user/ZyUserModifyParam.java
+69
-0
DepartmentService.java
...n/java/com/yiring/app/service/dept/DepartmentService.java
+0
-7
DepartmentServiceImpl.java
...m/yiring/app/service/dept/impl/DepartmentServiceImpl.java
+0
-0
KeyAlarmRulesService.java
...java/com/yiring/app/service/key/KeyAlarmRulesService.java
+57
-0
KeyAlarmRulesServiceImpl.java
...yiring/app/service/key/impl/KeyAlarmRulesServiceImpl.java
+221
-0
LocationBeaconService.java
...ng/app/service/location/beacon/LocationBeaconService.java
+41
-0
LocationBeaconServiceImpl.java
...rvice/location/beacon/impl/LocationBeaconServiceImpl.java
+198
-0
LocationTagService.java
...m/yiring/app/service/location/tag/LocationTagService.java
+10
-3
LocationTagTypeService.java
...ring/app/service/location/tag/LocationTagTypeService.java
+8
-0
LocationTagServiceImpl.java
...app/service/location/tag/impl/LocationTagServiceImpl.java
+0
-0
LocationTagTypeServiceImpl.java
...service/location/tag/impl/LocationTagTypeServiceImpl.java
+62
-0
PostServiceImpl.java
...ava/com/yiring/app/service/post/impl/PostServiceImpl.java
+13
-7
UserService.java
...rc/main/java/com/yiring/app/service/user/UserService.java
+10
-2
UserServiceImpl.java
...ava/com/yiring/app/service/user/impl/UserServiceImpl.java
+0
-0
ZyHttpService.java
...rc/main/java/com/yiring/app/service/zy/ZyHttpService.java
+0
-49
ZyHttpServiceImpl.java
...ava/com/yiring/app/service/zy/impl/ZyHttpServiceImpl.java
+0
-118
ZyUtil.java
app/src/main/java/com/yiring/app/util/zy/ZyUtil.java
+121
-0
KeyAlarmRulesVo.java
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
+66
-0
LocationBeaconVo.java
...a/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
+56
-0
PostVo.java
app/src/main/java/com/yiring/app/vo/post/PostVo.java
+4
-0
UserInfoVo.java
app/src/main/java/com/yiring/app/vo/user/UserInfoVo.java
+6
-2
UserVo.java
app/src/main/java/com/yiring/app/vo/user/UserVo.java
+18
-1
HelloController.java
app/src/main/java/com/yiring/app/web/HelloController.java
+6
-0
DepartmentController.java
...in/java/com/yiring/app/web/dept/DepartmentController.java
+1
-7
KeyAlarmRulesController.java
.../java/com/yiring/app/web/key/KeyAlarmRulesController.java
+68
-0
LocationBeaconController.java
...ing/app/web/location/beacon/LocationBeaconController.java
+42
-1
LocationTagController.java
...om/yiring/app/web/location/tag/LocationTagController.java
+8
-2
LocationTagTypeController.java
...iring/app/web/location/tag/LocationTagTypeController.java
+8
-0
MapController.java
app/src/main/java/com/yiring/app/web/map/MapController.java
+3
-5
UserAppController.java
.../main/java/com/yiring/app/web/user/UserAppController.java
+9
-2
Department.java
...src/main/java/com/yiring/auth/domain/dept/Department.java
+4
-27
Post.java
...-auth/src/main/java/com/yiring/auth/domain/post/Post.java
+4
-19
ZyUtil.java
basic-auth/src/main/java/com/yiring/auth/util/ZyUtil.java
+0
-67
没有找到文件。
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
/**
*
*
* @author LJ-2204
* @date 2022/5/6
*/
public
class
KeyAlarm
{}
app/src/main/java/com/yiring/app/domain/key/KeyAlarmRules.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.HashSet
;
import
java.util.Set
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
/**
* 按键报警规则
*
* @author LJ-2204
* @date 2022/5/6
*/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_KEY_ALARM_RULES"
)
@Comment
(
"按键报警规则"
)
public
class
KeyAlarmRules
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
302167871277966250L
;
@Comment
(
"所属部门"
)
@ManyToOne
@JsonIgnore
@JoinColumn
(
name
=
"department_id"
)
Department
department
;
@JsonIgnore
@Builder
.
Default
@Comment
(
"用户集合"
)
@ManyToMany
(
fetch
=
FetchType
.
EAGER
)
@JoinTable
(
name
=
"BS_KEY_ALARM_RULES_USERS"
,
joinColumns
=
{
@JoinColumn
(
name
=
"key_id"
)
},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"user_id"
)
}
)
Set
<
User
>
users
=
new
HashSet
<>(
0
);
@Comment
(
"推送类型"
)
String
types
;
}
app/src/main/java/com/yiring/app/domain/key/KeyAlarmRulesRepository.java
0 → 100644
浏览文件 @
27d5320f
/* (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
KeyAlarmRulesRepository
extends
JpaRepository
<
KeyAlarmRules
,
Serializable
>,
JpaSpecificationExecutor
<
KeyAlarmRules
>
{}
app/src/main/java/com/yiring/app/domain/location/LocationBeacon.java
浏览文件 @
27d5320f
...
@@ -6,6 +6,7 @@ import com.yiring.common.domain.BasicEntity;
...
@@ -6,6 +6,7 @@ import com.yiring.common.domain.BasicEntity;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -94,6 +95,9 @@ public class LocationBeacon extends BasicEntity implements Serializable {
...
@@ -94,6 +95,9 @@ public class LocationBeacon extends BasicEntity implements Serializable {
@Comment
(
"电量单位"
)
@Comment
(
"电量单位"
)
String
voltUnit
;
String
voltUnit
;
@Comment
(
"状态更新时间"
)
LocalDateTime
time
;
@Comment
(
"围栏集合"
)
@Comment
(
"围栏集合"
)
@Builder
.
Default
@Builder
.
Default
@ManyToMany
@ManyToMany
...
...
app/src/main/java/com/yiring/app/excel/dept/DepartmentExportExcel.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
dept
;
package
com
.
yiring
.
app
.
excel
.
dept
;
import
cn.hutool.core.util.ObjectUtil
;
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.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
...
@@ -40,12 +41,16 @@ public class DepartmentExportExcel implements Serializable {
...
@@ -40,12 +41,16 @@ public class DepartmentExportExcel implements Serializable {
String
enable
;
String
enable
;
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
return
DepartmentExportExcel
DepartmentExportExcel
departmentExportExcel
=
DepartmentExportExcel
.
builder
()
.
builder
()
.
name
(
department
.
getName
())
.
name
(
department
.
getName
())
.
realName
(
department
.
getLeader
().
getRealName
())
.
mobile
(
department
.
getLeader
().
getMobile
())
.
mobile
(
department
.
getLeader
().
getMobile
())
.
enable
(
department
.
getEnable
()
?
"启用"
:
"禁用"
)
.
enable
(
department
.
getEnable
()
?
"启用"
:
"禁用"
)
.
build
();
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
departmentExportExcel
.
setRealName
(
department
.
getLeader
().
getRealName
());
}
return
departmentExportExcel
;
}
}
}
}
app/src/main/java/com/yiring/app/excel/dept/DepartmentImportExcel.java
浏览文件 @
27d5320f
...
@@ -27,17 +27,17 @@ public class DepartmentImportExcel implements Serializable {
...
@@ -27,17 +27,17 @@ public class DepartmentImportExcel implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
1287875741111587840L
;
private
static
final
long
serialVersionUID
=
-
1287875741111587840L
;
@ExcelColumn
(
index
=
0
)
@ExcelColumn
(
title
=
"部门名称"
)
@NotNull
@NotNull
String
name
;
String
name
;
@ExcelColumn
(
index
=
1
)
@ExcelColumn
(
title
=
"负责人"
)
String
realName
;
String
realName
;
@ExcelColumn
(
index
=
2
)
@ExcelColumn
(
title
=
"手机号码"
)
String
mobile
;
String
mobile
;
@ExcelColumn
(
index
=
3
)
@ExcelColumn
(
title
=
"状态"
)
String
enable
;
String
enable
;
public
static
Department
transform
(
DepartmentImportExcel
departmentImportExcel
)
{
public
static
Department
transform
(
DepartmentImportExcel
departmentImportExcel
)
{
...
...
app/src/main/java/com/yiring/app/excel/key/KeyAlarmRulesExportExcel.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
key
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.yiring.app.domain.key.KeyAlarmRules
;
import
com.yiring.auth.domain.user.User
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.Set
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警规则导出
*
* @author LJ-2204
* @date 2022/5/7
*/
@ExcelModel
@Data
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesExportExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
800228727313291675L
;
@ExcelColumn
(
title
=
"部门名称"
)
String
deptName
;
@ExcelColumn
(
title
=
"负责人"
)
String
userNames
;
@ExcelColumn
(
title
=
"通知类型"
)
String
types
;
public
static
KeyAlarmRulesExportExcel
transform
(
KeyAlarmRules
keyAlarmRules
)
{
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
StringBuilder
userNames
=
new
StringBuilder
();
for
(
User
user
:
users
)
{
userNames
.
append
(
user
.
getRealName
());
userNames
.
append
(
"、"
);
}
String
substring
=
userNames
.
substring
(
0
,
userNames
.
length
()
-
1
);
return
KeyAlarmRulesExportExcel
.
builder
()
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
userNames
(
substring
)
.
types
(
keyAlarmRules
.
getTypes
())
.
build
();
}
}
app/src/main/java/com/yiring/app/excel/location/beacon/LocationBeaconExportExcel.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
location
.
beacon
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.yiring.app.domain.location.LocationBeacon
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.AccessLevel
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.experimental.FieldDefaults
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/4/29
*/
@ExcelModel
@Data
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationBeaconExportExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
8548586352563859939L
;
@ExcelColumn
(
title
=
"编号"
)
String
code
;
public
static
LocationBeaconExportExcel
transform
(
LocationBeacon
locationBeacon
)
{
return
LocationBeaconExportExcel
.
builder
().
code
(
locationBeacon
.
getCode
()).
build
();
}
}
app/src/main/java/com/yiring/app/excel/location/LocationTagExportExcel.java
→
app/src/main/java/com/yiring/app/excel/location/
tag/
LocationTagExportExcel.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
location
;
package
com
.
yiring
.
app
.
excel
.
location
.
tag
;
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
;
...
...
app/src/main/java/com/yiring/app/excel/location/LocationTagImportExcel.java
→
app/src/main/java/com/yiring/app/excel/location/
tag/
LocationTagImportExcel.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
location
;
package
com
.
yiring
.
app
.
excel
.
location
.
tag
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
java.io.Serial
;
import
java.io.Serial
;
...
@@ -25,15 +26,15 @@ public class LocationTagImportExcel implements Serializable {
...
@@ -25,15 +26,15 @@ public class LocationTagImportExcel implements Serializable {
private
static
final
long
serialVersionUID
=
-
8817732062049005201L
;
private
static
final
long
serialVersionUID
=
-
8817732062049005201L
;
// 编号
// 编号
@ExcelColumn
(
index
=
0
)
@ExcelColumn
(
title
=
"编号"
)
String
code
;
String
code
;
// 标签型号
// 标签型号
@ExcelColumn
(
index
=
1
)
@ExcelColumn
(
title
=
"标签型号"
)
String
type
;
String
type
;
// 设备编码
// 设备编码
@ExcelColumn
(
index
=
2
)
@ExcelColumn
(
title
=
"imei"
)
String
imei
;
String
imei
;
public
static
LocationTag
transform
(
LocationTagImportExcel
locationTagImportExcel
)
{
public
static
LocationTag
transform
(
LocationTagImportExcel
locationTagImportExcel
)
{
...
@@ -41,7 +42,7 @@ public class LocationTagImportExcel implements Serializable {
...
@@ -41,7 +42,7 @@ public class LocationTagImportExcel implements Serializable {
.
builder
()
.
builder
()
.
code
(
locationTagImportExcel
.
code
)
.
code
(
locationTagImportExcel
.
code
)
.
type
(
LocationTag
.
Type
.
valueOf
(
locationTagImportExcel
.
type
))
.
type
(
LocationTag
.
Type
.
valueOf
(
locationTagImportExcel
.
type
))
.
imei
(
locationTagImportExcel
.
imei
)
.
imei
(
StrUtil
.
isEmpty
(
locationTagImportExcel
.
imei
)
?
null
:
locationTagImportExcel
.
imei
)
.
createTime
(
LocalDateTime
.
now
())
.
createTime
(
LocalDateTime
.
now
())
.
build
();
.
build
();
}
}
...
...
app/src/main/java/com/yiring/app/excel/user/UserImportExcel.java
浏览文件 @
27d5320f
...
@@ -26,39 +26,39 @@ public class UserImportExcel implements Serializable {
...
@@ -26,39 +26,39 @@ public class UserImportExcel implements Serializable {
private
static
final
long
serialVersionUID
=
3471291755743945051L
;
private
static
final
long
serialVersionUID
=
3471291755743945051L
;
// 姓名
// 姓名
@ExcelColumn
(
index
=
0
)
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
String
realName
;
// 工号
// 工号
@ExcelColumn
(
index
=
1
)
@ExcelColumn
(
title
=
"工号"
)
String
uuid
;
String
uuid
;
// 图标类型
// 图标类型
@ExcelColumn
(
index
=
2
)
@ExcelColumn
(
title
=
"图标类型"
)
String
type
;
String
type
;
// 手机号
// 手机号
@ExcelColumn
(
index
=
3
)
@ExcelColumn
(
title
=
"手机号码"
)
String
mobile
;
String
mobile
;
// 部门id
// 部门id
@ExcelColumn
(
index
=
4
)
@ExcelColumn
(
title
=
"部门名称"
)
String
deptName
;
String
deptName
;
// 职位id
// 职位id
@ExcelColumn
(
index
=
5
)
@ExcelColumn
(
title
=
"职位名称"
)
String
postName
;
String
postName
;
// 标签号
// 标签号
@ExcelColumn
(
index
=
6
)
@ExcelColumn
(
title
=
"标签编号"
)
String
code
;
String
code
;
// 性别
// 性别
@ExcelColumn
(
index
=
7
)
@ExcelColumn
(
title
=
"性别"
)
Boolean
gender
;
Boolean
gender
;
// 是否为特殊人员
// 是否为特殊人员
@ExcelColumn
(
index
=
8
)
@ExcelColumn
(
title
=
"特殊人员"
)
Boolean
isSpecial
;
Boolean
isSpecial
;
public
static
User
transform
(
UserImportExcel
userImportExcel
)
{
public
static
User
transform
(
UserImportExcel
userImportExcel
)
{
...
...
app/src/main/java/com/yiring/app/feign/zy/dept/DepartmentClient.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
feign
.
zy
.
dept
;
import
cn.hutool.json.JSONObject
;
import
com.yiring.app.param.zy.dept.ZyDepartmentFindParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.SpringQueryMap
;
import
org.springframework.web.bind.annotation.*
;
/**
* zy部门接口
*
* @author LJ-2204
* @date 2022/5/5
*/
@FeignClient
(
url
=
"${zy-config.proxy.api}"
,
name
=
"DepartmentClient"
)
public
interface
DepartmentClient
{
@PostMapping
(
value
=
"/position/system/dept"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
deptAdd
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@GetMapping
(
value
=
"/position/system/dept/list"
)
JSONObject
deptList
(
@SpringQueryMap
ZyDepartmentFindParam
zyDepartmentFindParam
,
@RequestHeader
(
"Authorization"
)
String
token
);
@DeleteMapping
(
value
=
"/position/system/dept/{id}"
)
JSONObject
deptDelete
(
@PathVariable
(
"id"
)
Long
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
@PutMapping
(
value
=
"/position/system/dept"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
deptModify
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
app/src/main/java/com/yiring/app/feign/zy/location/beacon/LocationBeaconClient.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
feign
.
zy
.
location
.
beacon
;
import
cn.hutool.json.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/4/28
*/
@FeignClient
(
url
=
"${zy-config.proxy.api}"
,
name
=
"LocationTagBeaconClient"
)
public
interface
LocationBeaconClient
{
@PostMapping
(
value
=
"/position/config/device/page"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
page
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
app/src/main/java/com/yiring/app/feign/zy/location/tag/LocationTagClient.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
feign
.
zy
.
location
.
tag
;
import
cn.hutool.json.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* 定位标签
*
* @author LJ-2204
* @date 2022/4/28
*/
@FeignClient
(
url
=
"${zy-config.proxy.api}"
,
name
=
"locationTagClient"
)
public
interface
LocationTagClient
{
@PostMapping
(
value
=
"/position/config/tag/page"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
tagPage
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@PostMapping
(
value
=
"/position/config/tag/save"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
tagSave
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@RequestMapping
(
value
=
"/position/config/tag/delete/{ids}"
,
method
=
RequestMethod
.
POST
)
JSONObject
tagDelete
(
@PathVariable
(
"ids"
)
String
ids
,
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@RequestMapping
(
value
=
"/position/config/tag/import"
,
method
=
RequestMethod
.
POST
)
JSONObject
tagImport
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
app/src/main/java/com/yiring/app/feign/zy/location/tag/LocationTagTypeClient.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
feign
.
zy
.
location
.
tag
;
import
cn.hutool.json.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
/**
* 标签分配
*
* @author LJ-2204
* @date 2022/5/6
*/
@FeignClient
(
url
=
"${zy-config.proxy.api}"
,
name
=
"LocationTagTypeClient"
)
public
interface
LocationTagTypeClient
{
@PostMapping
(
value
=
"/position/bizTag/updateEntityType"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
}
)
JSONObject
updateEntityType
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
app/src/main/java/com/yiring/app/feign/zy/user/UserClient.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
feign
.
zy
.
user
;
import
cn.hutool.json.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/5
*/
@FeignClient
(
url
=
"${zy-config.proxy.api}"
,
name
=
"UserClient"
)
public
interface
UserClient
{
@PostMapping
(
value
=
"/position/staff/save"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
save
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@PostMapping
(
value
=
"/position/staff/list"
,
headers
=
{
"Content-Type=application/json;charset=UTF-8"
})
JSONObject
list
(
@RequestBody
String
json
,
@RequestHeader
(
"Authorization"
)
String
token
);
@DeleteMapping
(
value
=
"/position/staff/delete/{id}"
)
JSONObject
delete
(
@PathVariable
(
"id"
)
String
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
@GetMapping
(
value
=
"position/staff/unbind/{id}"
)
JSONObject
unbind
(
@PathVariable
(
"id"
)
Long
id
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestHeader
(
"Authorization"
)
String
token
);
@GetMapping
(
value
=
"position/staff/bindTag/{id}/{code}/1"
)
JSONObject
unbind
(
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"code"
)
String
code
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
app/src/main/java/com/yiring/app/param/dept/DepartmentAddParam.java
浏览文件 @
27d5320f
...
@@ -2,12 +2,10 @@
...
@@ -2,12 +2,10 @@
package
com
.
yiring
.
app
.
param
.
dept
;
package
com
.
yiring
.
app
.
param
.
dept
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.user.User
;
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
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -48,10 +46,7 @@ public class DepartmentAddParam implements Serializable {
...
@@ -48,10 +46,7 @@ public class DepartmentAddParam implements Serializable {
.
builder
()
.
builder
()
.
pid
(
departmentAddParam
.
getId
())
.
pid
(
departmentAddParam
.
getId
())
.
name
(
departmentAddParam
.
getName
())
.
name
(
departmentAddParam
.
getName
())
.
leader
(
User
.
builder
().
id
(
departmentAddParam
.
getLeaderId
()).
build
())
.
enable
(
departmentAddParam
.
getEnable
())
.
enable
(
departmentAddParam
.
getEnable
())
.
createTime
(
LocalDateTime
.
now
())
.
updateTime
(
LocalDateTime
.
now
())
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/dept/DepartmentModifyParam.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
dept
;
package
com
.
yiring
.
app
.
param
.
dept
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
@@ -44,13 +46,12 @@ public class DepartmentModifyParam implements Serializable {
...
@@ -44,13 +46,12 @@ public class DepartmentModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
Long
leaderId
;
Long
leaderId
;
public
Department
transform
()
{
public
void
transform
(
DepartmentModifyParam
departmentModifyParam
,
Department
department
)
{
return
Department
department
.
setPid
(
departmentModifyParam
.
getPid
());
.
builder
()
department
.
setName
(
departmentModifyParam
.
getName
());
.
id
(
this
.
id
)
if
(
ObjectUtil
.
isNotEmpty
(
departmentModifyParam
.
getLeaderId
()))
{
.
pid
(
this
.
pid
)
department
.
setLeader
(
User
.
builder
().
id
(
departmentModifyParam
.
getLeaderId
()).
build
());
.
name
(
this
.
name
)
}
.
leader
(
User
.
builder
().
id
(
this
.
leaderId
).
build
())
department
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
0 → 100644
浏览文件 @
27d5320f
/* (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
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警规则
*
* @author LJ-2204
* @date 2022/5/6
*/
@ApiModel
(
"KeyAlarmRulesAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
758462772473378637L
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@NotEmpty
(
message
=
"部门ID不能为空"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
@NotEmpty
(
message
=
"用户ids不能为空"
)
String
userIds
;
@ApiModelProperty
(
value
=
"报警类型"
,
example
=
"APP/SMS/CALL_TTS"
,
required
=
true
)
@NotEmpty
(
message
=
"报警类型不能为空"
)
String
types
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesExportParam.java
0 → 100644
浏览文件 @
27d5320f
/* (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
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 导出按键报警规则
*
* @author LJ-2204
* @date 2022/5/6
*/
@ApiModel
(
"KeyAlarmRulesExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2940487513251067057L
;
@ApiModelProperty
(
value
=
"部门ids"
,
example
=
"100,101,102"
)
String
deptIds
;
@ApiModelProperty
(
value
=
"通知方式"
,
example
=
"APP/SMS"
)
String
types
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesModifyParam.java
0 → 100644
浏览文件 @
27d5320f
/* (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
javax.validation.constraints.NotEmpty
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 报警规则修改
*
* @author LJ-2204
* @date 2022/5/6
*/
@ApiModel
(
"KeyAlarmRulesAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesModifyParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
3526756145220971363L
;
@ApiModelProperty
(
value
=
"id"
,
example
=
"100"
,
required
=
true
)
@NotEmpty
(
message
=
"ID不能为空"
)
Long
id
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@NotEmpty
(
message
=
"部门ID不能为空"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
@NotEmpty
(
message
=
"用户ids不能为空"
)
String
userIds
;
@ApiModelProperty
(
value
=
"报警类型"
,
example
=
"APP/SMS/CALL_TTS"
,
required
=
true
)
@NotEmpty
(
message
=
"报警类型不能为空"
)
String
types
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesPageParam.java
0 → 100644
浏览文件 @
27d5320f
/* (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
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警规则分页
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"KeyAlarmRulesPageParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesPageParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2876239519436815639L
;
@ApiModelProperty
(
value
=
"部门ids"
,
example
=
"100,101,102"
)
String
deptIds
;
@ApiModelProperty
(
value
=
"通知方式"
,
example
=
"APP/SMS"
)
String
types
;
}
app/src/main/java/com/yiring/app/param/location/beacon/LocationBeaconAddParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
beacon
;
import
com.yiring.app.domain.location.LocationBeacon
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 定位信标
*
* @author LJ-2204
* @date 2022/4/28
*/
@ApiModel
(
"LocationBeaconAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationBeaconAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
3955765845330886658L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"地图"
,
example
=
"BTI88888888"
)
Long
areaId
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTI22085224"
)
String
deviceId
;
@ApiModelProperty
(
value
=
"x"
,
example
=
"661.6708034161"
)
BigDecimal
x
;
@ApiModelProperty
(
value
=
"y"
,
example
=
"64.609831996"
)
BigDecimal
y
;
@ApiModelProperty
(
value
=
"z"
,
example
=
"0"
)
BigDecimal
z
;
@ApiModelProperty
LocalDateTime
time
;
@ApiModelProperty
(
value
=
"电量"
,
example
=
"2900"
)
Integer
volt
;
@ApiModelProperty
(
value
=
"电量单位"
,
example
=
"mv"
)
String
voltUnit
;
public
static
LocationBeacon
transform
(
LocationBeaconAddParam
locationBeaconAddParam
)
{
return
LocationBeacon
.
builder
()
.
linkId
(
locationBeaconAddParam
.
getId
())
.
areaId
(
locationBeaconAddParam
.
getAreaId
())
.
code
(
locationBeaconAddParam
.
getDeviceId
())
.
x
(
locationBeaconAddParam
.
getX
())
.
y
(
locationBeaconAddParam
.
getY
())
.
z
(
locationBeaconAddParam
.
getZ
())
// .point(GeoUtils.xyzToPoint(
// locationBeaconAddParam.getPointX().doubleValue(),locationBeaconAddParam.getPointY().doubleValue(),locationBeaconAddParam.getPointZ().doubleValue()
// ))
.
time
(
locationBeaconAddParam
.
getTime
())
.
volt
(
locationBeaconAddParam
.
getVolt
())
.
voltUnit
(
locationBeaconAddParam
.
getVoltUnit
())
.
build
();
}
}
app/src/main/java/com/yiring/app/param/location/beacon/LocationBeaconExportParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
beacon
;
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/4/29
*/
@ApiModel
(
"LocationBeaconExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationBeaconExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2076855906391376170L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTI88888888"
)
String
code
;
}
app/src/main/java/com/yiring/app/param/location/beacon/LocationBeaconFindParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
beacon
;
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/4/28
*/
@ApiModel
(
"LocationBeaconFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationBeaconFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
8870987053623333234L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTI88888888"
)
String
code
;
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagDeleteParam.java
浏览文件 @
27d5320f
...
@@ -29,8 +29,4 @@ public class LocationTagDeleteParam implements Serializable {
...
@@ -29,8 +29,4 @@ public class LocationTagDeleteParam implements Serializable {
@ApiModelProperty
(
value
=
"ids"
,
example
=
"145235231,145235232"
,
required
=
true
)
@ApiModelProperty
(
value
=
"ids"
,
example
=
"145235231,145235232"
,
required
=
true
)
@NotNull
(
message
=
"ids 不能为空"
)
@NotNull
(
message
=
"ids 不能为空"
)
Long
[]
ids
;
Long
[]
ids
;
@ApiModelProperty
(
value
=
"codes"
,
example
=
"BTT99999998,BTT99999999"
,
required
=
true
)
@NotNull
(
message
=
"codes 不能为空"
)
String
[]
codes
;
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagModifyParam.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -38,13 +39,10 @@ public class LocationTagModifyParam implements Serializable {
...
@@ -38,13 +39,10 @@ public class LocationTagModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"imei 设备编码标识"
,
example
=
"88888888"
)
@ApiModelProperty
(
value
=
"imei 设备编码标识"
,
example
=
"88888888"
)
String
imei
;
String
imei
;
public
static
LocationTag
transform
(
LocationTagModifyParam
locationTagModifyParam
)
{
public
static
void
transform
(
LocationTagModifyParam
locationTagModifyParam
,
LocationTag
locationTag
)
{
return
LocationTag
locationTag
.
setCode
(
locationTagModifyParam
.
getCode
());
.
builder
()
locationTag
.
setType
(
locationTagModifyParam
.
getType
());
.
id
(
locationTagModifyParam
.
id
)
locationTag
.
setImei
(
locationTagModifyParam
.
getImei
());
.
code
(
locationTagModifyParam
.
code
)
locationTag
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
.
type
(
locationTagModifyParam
.
type
)
.
imei
(
locationTagModifyParam
.
imei
)
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagTypeFindParam.java
浏览文件 @
27d5320f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.*
;
...
@@ -25,7 +26,9 @@ public class LocationTagTypeFindParam implements Serializable {
...
@@ -25,7 +26,9 @@ public class LocationTagTypeFindParam implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
647961131755069990L
;
private
static
final
long
serialVersionUID
=
-
647961131755069990L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTT8888888"
)
String
code
;
String
code
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
Integer
category
;
Integer
category
;
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagTypeSendParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/4/28
*/
@ApiModel
(
"LocationTagTypeSendParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationTagTypeSendParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4964886106668963909L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111,222"
)
@NotNull
(
message
=
"主键不能为空"
)
String
ids
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1内部/2访客"
)
Integer
category
;
}
app/src/main/java/com/yiring/app/param/post/PostModifyParam.java
浏览文件 @
27d5320f
...
@@ -43,14 +43,10 @@ public class PostModifyParam implements Serializable {
...
@@ -43,14 +43,10 @@ public class PostModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enable
;
Boolean
enable
;
public
Post
transform
(
PostModifyParam
postParam
)
{
public
void
transform
(
PostModifyParam
postParam
,
Post
post
)
{
return
Post
post
.
setName
(
postParam
.
getName
());
.
builder
()
post
.
setDescribe
(
postParam
.
getDescribe
());
.
id
(
postParam
.
getId
())
post
.
setEnable
(
postParam
.
getEnable
());
.
name
(
postParam
.
getName
())
post
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
.
describe
(
postParam
.
getDescribe
())
.
enable
(
postParam
.
getEnable
())
.
createTime
(
LocalDateTimeUtil
.
now
())
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/post/PostParam.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
post
;
package
com
.
yiring
.
app
.
param
.
post
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.Post
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -39,12 +38,6 @@ public class PostParam implements Serializable {
...
@@ -39,12 +38,6 @@ public class PostParam implements Serializable {
Boolean
enable
;
Boolean
enable
;
public
static
Post
transform
(
PostParam
postParam
)
{
public
static
Post
transform
(
PostParam
postParam
)
{
return
Post
return
Post
.
builder
().
name
(
postParam
.
name
).
describe
(
postParam
.
describe
).
enable
(
postParam
.
enable
).
build
();
.
builder
()
.
name
(
postParam
.
name
)
.
describe
(
postParam
.
describe
)
.
enable
(
postParam
.
enable
)
.
createTime
(
LocalDateTimeUtil
.
now
())
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/user/UserAddParam.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
user
;
package
com
.
yiring
.
app
.
param
.
user
;
import
cn.hutool.core.convert.Convert
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -46,13 +43,13 @@ public class UserAddParam implements Serializable {
...
@@ -46,13 +43,13 @@ public class UserAddParam implements Serializable {
Boolean
gender
;
Boolean
gender
;
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
Stri
ng
deptId
;
Lo
ng
deptId
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1888888888"
,
required
=
true
)
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1888888888"
,
required
=
true
)
String
uuid
;
String
uuid
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"职位"
,
example
=
"1"
)
Stri
ng
postId
;
Lo
ng
postId
;
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
Boolean
isSpecial
;
Boolean
isSpecial
;
...
@@ -65,9 +62,7 @@ public class UserAddParam implements Serializable {
...
@@ -65,9 +62,7 @@ public class UserAddParam implements Serializable {
.
mobile
(
userAddParam
.
getMobile
())
.
mobile
(
userAddParam
.
getMobile
())
.
type
(
userAddParam
.
getType
())
.
type
(
userAddParam
.
getType
())
.
gender
(
userAddParam
.
getGender
())
.
gender
(
userAddParam
.
getGender
())
.
department
(
Department
.
builder
().
id
(
Convert
.
toLong
(
userAddParam
.
getDeptId
())).
build
())
.
uuid
(
userAddParam
.
getUuid
())
.
uuid
(
userAddParam
.
getUuid
())
.
post
(
Post
.
builder
().
id
(
Convert
.
toLong
(
userAddParam
.
getPostId
())).
build
())
.
isSpecial
(
userAddParam
.
getIsSpecial
())
.
isSpecial
(
userAddParam
.
getIsSpecial
())
.
build
();
.
build
();
}
}
...
...
app/src/main/java/com/yiring/app/param/user/UserModifyParam.java
浏览文件 @
27d5320f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
param
.
user
;
package
com
.
yiring
.
app
.
param
.
user
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
...
@@ -55,32 +56,29 @@ public class UserModifyParam implements Serializable {
...
@@ -55,32 +56,29 @@ public class UserModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
@NotNull
@NotNull
Stri
ng
deptId
;
Lo
ng
deptId
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1888888888"
,
required
=
true
)
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1888888888"
,
required
=
true
)
@NotNull
@NotNull
String
uuid
;
String
uuid
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"职位"
,
example
=
"1"
)
Stri
ng
postId
;
Lo
ng
postId
;
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
@NotNull
@NotNull
Boolean
isSpecial
;
Boolean
isSpecial
;
public
User
transform
()
{
public
static
void
transform
(
UserModifyParam
userModifyParam
,
User
user
)
{
return
User
user
.
setAvatar
(
userModifyParam
.
getAvatar
());
.
builder
()
user
.
setRealName
(
userModifyParam
.
getRealName
());
.
id
(
this
.
id
)
user
.
setMobile
(
userModifyParam
.
getMobile
());
.
avatar
(
this
.
avatar
)
user
.
setType
(
userModifyParam
.
getType
());
.
realName
(
this
.
realName
)
user
.
setGender
(
userModifyParam
.
getGender
());
.
mobile
(
this
.
mobile
)
user
.
setDepartment
(
Department
.
builder
().
id
(
Convert
.
toLong
(
userModifyParam
.
getDeptId
())).
build
());
.
type
(
this
.
type
)
user
.
setUuid
(
userModifyParam
.
getUuid
());
.
gender
(
this
.
gender
)
if
(
ObjectUtil
.
isNotEmpty
(
userModifyParam
.
getPostId
()))
{
.
department
(
Department
.
builder
().
id
(
Convert
.
toLong
(
this
.
deptId
)).
build
())
user
.
setPost
(
Post
.
builder
().
id
(
Convert
.
toLong
(
userModifyParam
.
getPostId
())).
build
());
.
uuid
(
this
.
uuid
)
}
.
post
(
Post
.
builder
().
id
(
Convert
.
toLong
(
this
.
postId
)).
build
())
.
isSpecial
(
this
.
isSpecial
)
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/param/zy/dept/ZyDepartmentAddParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
dept
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* zy部门新增参数
*
* @author LJ-2204
* @date 2022/5/5
*/
@ApiModel
(
"ZyDepartmentAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyDepartmentAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
2949706685712988765L
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@NotNull
String
deptName
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"@163.com"
)
String
email
;
@ApiModelProperty
(
value
=
"真实姓名"
,
example
=
"张三"
)
String
leader
;
@ApiModelProperty
(
value
=
"工厂"
,
example
=
"100"
)
Integer
orgId
;
@ApiModelProperty
(
value
=
"上级部门"
,
example
=
"1"
,
required
=
true
)
@NotNull
Long
parentId
;
@ApiModelProperty
(
value
=
"电话"
,
example
=
"18888888888"
)
String
phone
;
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"0/1"
)
String
status
;
public
static
ZyDepartmentAddParam
transform
(
Department
department
,
Integer
orgId
)
{
ZyDepartmentAddParam
zyDepartmentAddParam
=
ZyDepartmentAddParam
.
builder
()
.
deptName
(
department
.
getName
())
.
orgId
(
orgId
)
.
status
(
department
.
getEnable
()
?
"0"
:
"1"
)
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
zyDepartmentAddParam
.
setEmail
(
department
.
getLeader
().
getEmail
());
zyDepartmentAddParam
.
setLeader
(
department
.
getLeader
().
getRealName
());
zyDepartmentAddParam
.
setPhone
(
department
.
getLeader
().
getMobile
());
}
return
zyDepartmentAddParam
;
}
}
app/src/main/java/com/yiring/app/param/zy/dept/ZyDepartmentFindParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
dept
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* zy部门查询
*
* @author LJ-2204
* @date 2022/5/5
*/
@ApiModel
(
"ZyDepartmentFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyDepartmentFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1009265085945027885L
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"研发部"
)
String
deptName
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"f/t"
)
String
status
;
String
ancestors
;
@ApiModelProperty
(
value
=
"工厂"
,
example
=
"100"
)
String
orgId
;
}
app/src/main/java/com/yiring/app/param/zy/dept/ZyDepartmentModifyParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
dept
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* zy部门修改参数
*
* @author LJ-2204
* @date 2022/5/5
*/
@ApiModel
(
"ZyDepartmentModifyParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyDepartmentModifyParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
1008100771548933210L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"100"
,
required
=
true
)
@NotNull
Long
deptId
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@NotNull
String
deptName
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"@163.com"
)
String
email
;
@ApiModelProperty
(
value
=
"真实姓名"
,
example
=
"张三"
)
String
leader
;
@ApiModelProperty
(
value
=
"工厂"
,
example
=
"100"
)
Integer
orgId
;
@ApiModelProperty
(
value
=
"上级部门"
,
example
=
"1"
,
required
=
true
)
@NotNull
Long
parentId
;
@ApiModelProperty
(
value
=
"电话"
,
example
=
"18888888888"
)
String
phone
;
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"0/1"
)
String
status
;
public
static
ZyDepartmentModifyParam
transform
(
Department
department
,
Integer
orgId
)
{
ZyDepartmentModifyParam
zyDepartmentModifyParam
=
ZyDepartmentModifyParam
.
builder
()
.
deptId
(
department
.
getLinkId
())
.
deptName
(
department
.
getName
())
.
orgId
(
orgId
)
.
status
(
department
.
getEnable
()
?
"0"
:
"1"
)
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
zyDepartmentModifyParam
.
setEmail
(
department
.
getLeader
().
getEmail
());
zyDepartmentModifyParam
.
setLeader
(
department
.
getLeader
().
getRealName
());
zyDepartmentModifyParam
.
setPhone
(
department
.
getLeader
().
getMobile
());
}
return
zyDepartmentModifyParam
;
}
}
app/src/main/java/com/yiring/app/param/
location/zy
/ZyLocationTagAddParam.java
→
app/src/main/java/com/yiring/app/param/
zy/location/tag
/ZyLocationTagAddParam.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
zy
;
package
com
.
yiring
.
app
.
param
.
zy
.
location
.
tag
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.excel.location.LocationTagImportExcel
;
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.util.List
;
import
java.util.stream.Collectors
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -42,6 +39,9 @@ public class ZyLocationTagAddParam implements Serializable {
...
@@ -42,6 +39,9 @@ public class ZyLocationTagAddParam implements Serializable {
@ApiModelProperty
(
value
=
"实体类型"
,
example
=
"car"
,
required
=
true
)
@ApiModelProperty
(
value
=
"实体类型"
,
example
=
"car"
,
required
=
true
)
String
entityType
;
String
entityType
;
@ApiModelProperty
(
value
=
"card"
,
example
=
"card"
)
String
card
;
public
static
ZyLocationTagAddParam
transform
(
LocationTag
locationTag
,
Integer
orgId
)
{
public
static
ZyLocationTagAddParam
transform
(
LocationTag
locationTag
,
Integer
orgId
)
{
String
entityType
=
StrUtil
.
equals
(
locationTag
.
getType
().
name
(),
"BTT02"
)
?
"car"
:
"staff"
;
String
entityType
=
StrUtil
.
equals
(
locationTag
.
getType
().
name
(),
"BTT02"
)
?
"car"
:
"staff"
;
return
ZyLocationTagAddParam
return
ZyLocationTagAddParam
...
@@ -50,25 +50,7 @@ public class ZyLocationTagAddParam implements Serializable {
...
@@ -50,25 +50,7 @@ public class ZyLocationTagAddParam implements Serializable {
.
tagId
(
locationTag
.
getCode
())
.
tagId
(
locationTag
.
getCode
())
.
types
(
locationTag
.
getType
())
.
types
(
locationTag
.
getType
())
.
entityType
(
entityType
)
.
entityType
(
entityType
)
.
card
(
locationTag
.
getImei
())
.
build
();
.
build
();
}
}
public
static
List
<
ZyLocationTagAddParam
>
transforms
(
List
<
LocationTagImportExcel
>
locationTagImportExcels
,
Integer
orgId
)
{
return
locationTagImportExcels
.
stream
()
.
map
(
locationTagImportExcel
->
{
String
entityType
=
StrUtil
.
equals
(
locationTagImportExcel
.
getType
(),
"BTT02"
)
?
"car"
:
"staff"
;
return
ZyLocationTagAddParam
.
builder
()
.
entityType
(
entityType
)
.
orgId
(
orgId
)
.
tagId
(
locationTagImportExcel
.
getCode
())
.
types
(
LocationTag
.
Type
.
valueOf
(
locationTagImportExcel
.
getType
()))
.
build
();
})
.
collect
(
Collectors
.
toList
());
}
}
}
app/src/main/java/com/yiring/app/param/zy/location/tag/ZyLocationTagTypeSendParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
location
.
tag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/6
*/
@ApiModel
(
"ZyLocationTagTypeSendParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyLocationTagTypeSendParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2083251032811952742L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111,222"
)
@NotNull
(
message
=
"主键不能为空"
)
Long
[]
ids
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1:内部/2:访客"
)
Integer
category
;
@ApiModelProperty
(
value
=
"工厂ID"
,
example
=
"100"
)
Integer
orgId
;
}
app/src/main/java/com/yiring/app/param/zy/user/ZyUserAddParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
user
;
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
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* zy用户新增参数
*
* @author LJ-2204
* @date 2022/5/5
*/
@ApiModel
(
"ZyUserAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyUserAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
7945473190204335719L
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"真实姓名"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"工厂"
,
example
=
"100"
)
Integer
orgId
;
@ApiModelProperty
(
value
=
"电话"
,
example
=
"18888888888"
)
String
phone
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"男/1女2"
)
Integer
sex
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"YH10086"
)
String
jobNumber
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"1"
)
Integer
type
;
@ApiModelProperty
(
value
=
"图标类型"
,
example
=
"1普通,10028特殊"
)
Integer
entityIconId
;
public
static
ZyUserAddParam
transform
(
User
user
,
Integer
factoryId
)
{
return
ZyUserAddParam
.
builder
()
.
name
(
user
.
getRealName
())
.
orgId
(
factoryId
)
.
phone
(
user
.
getMobile
())
.
sex
(
user
.
getGender
()
?
1
:
2
)
.
jobNumber
(
user
.
getUuid
())
.
type
(
1
)
.
build
();
}
}
app/src/main/java/com/yiring/app/param/zy/user/ZyUserFindParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
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/5
*/
@ApiModel
(
"ZyUserFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyUserFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
8190370314958519070L
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1100"
)
String
jobNum
;
@ApiModelProperty
(
value
=
"工厂ID"
,
example
=
"100"
)
Integer
orgId
;
@ApiModelProperty
(
value
=
"起始页"
,
example
=
"1"
)
Integer
pageNum
;
@ApiModelProperty
(
value
=
"显示数"
,
example
=
"10"
)
Integer
pageSize
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"100"
)
Integer
type
;
}
app/src/main/java/com/yiring/app/param/zy/user/ZyUserModifyParam.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
zy
.
user
;
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
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户修改
*
* @author LJ-2204
* @date 2022/5/6
*/
@ApiModel
(
"ZyUserModifyParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
ZyUserModifyParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
4654860807059567162L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"真实姓名"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"工厂"
,
example
=
"100"
)
Integer
orgId
;
@ApiModelProperty
(
value
=
"电话"
,
example
=
"18888888888"
)
String
phone
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"男/1女2"
)
Integer
sex
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"YH10086"
)
String
jobNumber
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"1"
)
Integer
type
;
@ApiModelProperty
(
value
=
"图标类型"
,
example
=
"1普通,10028特殊"
)
Integer
entityIconId
;
public
static
ZyUserModifyParam
transform
(
User
user
,
Integer
factoryId
)
{
return
ZyUserModifyParam
.
builder
()
.
id
(
user
.
getId
())
.
name
(
user
.
getRealName
())
.
orgId
(
factoryId
)
.
phone
(
user
.
getMobile
())
.
sex
(
user
.
getGender
()
?
1
:
2
)
.
jobNumber
(
user
.
getUuid
())
.
type
(
1
)
.
build
();
}
}
app/src/main/java/com/yiring/app/service/dept/DepartmentService.java
浏览文件 @
27d5320f
...
@@ -58,13 +58,6 @@ public interface DepartmentService {
...
@@ -58,13 +58,6 @@ public interface DepartmentService {
Result
<
String
>
deleteDepartment
(
IdParam
idParam
);
Result
<
String
>
deleteDepartment
(
IdParam
idParam
);
/**
/**
* 启用/停用
* @param idParam IdParam
* @return Result<String>
*/
Result
<
String
>
stateDepartment
(
IdParam
idParam
);
/**
* 部门添加岗位
* 部门添加岗位
* @param idParam IdParam
* @param idParam IdParam
* @param idsParam IdsParam
* @param idsParam IdsParam
...
...
app/src/main/java/com/yiring/app/service/dept/impl/DepartmentServiceImpl.java
浏览文件 @
27d5320f
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/service/key/KeyAlarmRulesService.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
;
import
com.yiring.app.param.key.KeyAlarmRulesAddParam
;
import
com.yiring.app.param.key.KeyAlarmRulesExportParam
;
import
com.yiring.app.param.key.KeyAlarmRulesModifyParam
;
import
com.yiring.app.param.key.KeyAlarmRulesPageParam
;
import
com.yiring.app.vo.key.KeyAlarmRulesVo
;
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
javax.servlet.http.HttpServletResponse
;
/**
* 按键报警规则
*
* @author LJ-2204
* @date 2022/5/6
*/
public
interface
KeyAlarmRulesService
{
/**
* 添加报警类型
* @param keyAlarmRulesAddParam KeyAlarmRulesAddParam
* @return Result<String>
*/
Result
<
String
>
add
(
KeyAlarmRulesAddParam
keyAlarmRulesAddParam
);
/**
* 删除报警规则
* @param idParam IdParam
* @return Result<String>
*/
Result
<
String
>
delete
(
IdParam
idParam
);
/**
* 修改报警规则
* @param keyAlarmRulesModifyParam KeyAlarmRulesModifyParam
* @return Result<String>
*/
Result
<
String
>
modify
(
KeyAlarmRulesModifyParam
keyAlarmRulesModifyParam
);
/**
* 导出
* @param keyAlarmRulesExportParam KeyAlarmRulesExportParam
* @param response HttpServletResponse
*/
void
export
(
KeyAlarmRulesExportParam
keyAlarmRulesExportParam
,
HttpServletResponse
response
);
/**
* 分页
* @param keyAlarmRulesPageParam KeyAlarmRulesPageParam
* @param pageParam PageParam
* @return Result<PageVo<KeyAlarmRulesVo>>
*/
Result
<
PageVo
<
KeyAlarmRulesVo
>>
page
(
KeyAlarmRulesPageParam
keyAlarmRulesPageParam
,
PageParam
pageParam
);
}
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmRulesServiceImpl.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.app.domain.key.KeyAlarmRules
;
import
com.yiring.app.domain.key.KeyAlarmRulesRepository
;
import
com.yiring.app.excel.key.KeyAlarmRulesExportExcel
;
import
com.yiring.app.param.key.KeyAlarmRulesAddParam
;
import
com.yiring.app.param.key.KeyAlarmRulesExportParam
;
import
com.yiring.app.param.key.KeyAlarmRulesModifyParam
;
import
com.yiring.app.param.key.KeyAlarmRulesPageParam
;
import
com.yiring.app.service.key.KeyAlarmRulesService
;
import
com.yiring.app.vo.key.KeyAlarmRulesVo
;
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.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.concurrent.Executors
;
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
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
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/6
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
KeyAlarmRulesServiceImpl
implements
KeyAlarmRulesService
{
@Resource
KeyAlarmRulesRepository
keyAlarmRulesRepository
;
@Override
public
Result
<
String
>
add
(
KeyAlarmRulesAddParam
keyAlarmRulesAddParam
)
{
HashSet
<
User
>
users
=
new
HashSet
<>();
String
[]
strings
=
keyAlarmRulesAddParam
.
getUserIds
().
split
(
","
);
Long
[]
ids
=
Convert
.
toLongArray
(
strings
);
if
(
ids
.
length
<
3
)
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"报警接收人至少3个"
);
}
for
(
Long
id
:
ids
)
{
users
.
add
(
User
.
builder
().
id
(
id
).
build
());
}
KeyAlarmRules
keyAlarmRules
=
KeyAlarmRules
.
builder
()
.
department
(
Department
.
builder
().
id
(
keyAlarmRulesAddParam
.
getDeptId
()).
build
())
.
users
(
users
)
.
types
(
keyAlarmRulesAddParam
.
getTypes
())
.
build
();
keyAlarmRulesRepository
.
save
(
keyAlarmRules
);
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
delete
(
IdParam
idParam
)
{
Optional
<
KeyAlarmRules
>
keyAlarmRulesOptional
=
keyAlarmRulesRepository
.
findById
(
idParam
.
getId
());
if
(
keyAlarmRulesOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"报警规则不存在"
);
keyAlarmRulesRepository
.
delete
(
keyAlarmRulesOptional
.
get
());
return
Result
.
ok
();
}
@Override
public
Result
<
String
>
modify
(
KeyAlarmRulesModifyParam
keyAlarmRulesModifyParam
)
{
Optional
<
KeyAlarmRules
>
keyAlarmRulesOptional
=
keyAlarmRulesRepository
.
findById
(
keyAlarmRulesModifyParam
.
getId
()
);
if
(
keyAlarmRulesOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"报警规则不存在"
);
HashSet
<
User
>
users
=
new
HashSet
<>();
String
[]
strings
=
keyAlarmRulesModifyParam
.
getUserIds
().
split
(
","
);
Long
[]
ids
=
Convert
.
toLongArray
(
strings
);
if
(
ids
.
length
<
3
)
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"报警接收人至少3个"
);
}
for
(
Long
id
:
ids
)
{
users
.
add
(
User
.
builder
().
id
(
id
).
build
());
}
KeyAlarmRules
keyAlarmRules
=
keyAlarmRulesOptional
.
get
();
keyAlarmRules
.
setDepartment
(
Department
.
builder
().
id
(
keyAlarmRulesModifyParam
.
getDeptId
()).
build
());
keyAlarmRules
.
setUsers
(
users
);
keyAlarmRules
.
setTypes
(
keyAlarmRulesModifyParam
.
getTypes
());
keyAlarmRulesRepository
.
save
(
keyAlarmRules
);
return
Result
.
ok
();
}
@Override
public
void
export
(
KeyAlarmRulesExportParam
keyAlarmRulesExportParam
,
HttpServletResponse
response
)
{
Specification
<
KeyAlarmRules
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
keyAlarmRulesExportParam
.
getDeptIds
()))
{
String
[]
ids
=
keyAlarmRulesExportParam
.
getDeptIds
().
split
(
","
);
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
KeyAlarmRules
.
Fields
.
department
).
get
(
BasicEntity
.
Fields
.
id
)
);
for
(
String
id
:
ids
)
in
.
value
(
Convert
.
toLong
(
id
));
predicates
.
add
(
in
);
}
if
(
StrUtil
.
isNotEmpty
(
keyAlarmRulesExportParam
.
getTypes
()))
{
String
[]
types
=
keyAlarmRulesExportParam
.
getTypes
().
split
(
","
);
for
(
String
type
:
types
)
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
KeyAlarmRules
.
Fields
.
types
),
"%"
+
type
+
"%"
));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
KeyAlarmRules
>
keyAlarmRules
=
keyAlarmRulesRepository
.
findAll
(
specification
);
List
<
KeyAlarmRulesExportExcel
>
keyAlarmRulesExportExcels
=
keyAlarmRules
.
stream
()
.
map
(
KeyAlarmRulesExportExcel:
:
transform
)
.
collect
(
Collectors
.
toList
());
try
(
DefaultStreamExcelBuilder
<
KeyAlarmRulesExportExcel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
KeyAlarmRulesExportExcel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
style
(
"cell->vertical-align:center;text-align:center"
,
"title->vertical-align:center;text-align:center;font-weight:bold;font-family:等线"
)
.
start
()
)
{
streamExcelBuilder
.
append
(
keyAlarmRulesExportExcels
);
String
fileName
=
URLEncoder
.
encode
(
"按键报警规则信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
Workbook
workbook
=
streamExcelBuilder
.
fixedTitles
().
build
();
workbook
.
write
(
out
);
workbook
.
close
();
out
.
flush
();
out
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"导出按键报警规则信息失败: "
+
e
.
getMessage
());
}
}
@Override
public
Result
<
PageVo
<
KeyAlarmRulesVo
>>
page
(
KeyAlarmRulesPageParam
keyAlarmRulesPageParam
,
PageParam
pageParam
)
{
Specification
<
KeyAlarmRules
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
keyAlarmRulesPageParam
.
getDeptIds
()))
{
String
[]
ids
=
keyAlarmRulesPageParam
.
getDeptIds
().
split
(
","
);
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
KeyAlarmRules
.
Fields
.
department
).
get
(
BasicEntity
.
Fields
.
id
)
);
for
(
String
id
:
ids
)
in
.
value
(
Convert
.
toLong
(
id
));
predicates
.
add
(
in
);
}
if
(
StrUtil
.
isNotEmpty
(
keyAlarmRulesPageParam
.
getTypes
()))
{
String
[]
types
=
keyAlarmRulesPageParam
.
getTypes
().
split
(
","
);
for
(
String
type
:
types
)
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
KeyAlarmRules
.
Fields
.
types
),
"%"
+
type
+
"%"
));
}
}
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
<
KeyAlarmRules
>
pages
=
keyAlarmRulesRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmRulesVo
>
keyAlarmRulesVos
=
pages
.
getContent
()
.
stream
()
.
map
(
KeyAlarmRulesVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
KeyAlarmRulesVo
>
pageVo
=
PageVo
.
build
(
keyAlarmRulesVos
,
pages
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/location/beacon/LocationBeaconService.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
beacon
;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 定位信标
*
* @author LJ-2204
* @date 2022/4/28
*/
public
interface
LocationBeaconService
{
/**
* 数据同步
*/
void
saveLocationBeacon
();
/**
* 表格查询
* @param locationBeaconFindParam LocationBeaconFindParam
* @param pageParam PageParam
* @return Result<PageVo<LocationBeaconVo>>
*/
Result
<
PageVo
<
LocationBeaconVo
>>
findLocationBeacon
(
LocationBeaconFindParam
locationBeaconFindParam
,
PageParam
pageParam
);
/**
* 导出
* @param locationBeaconExportParam locationBeaconExportParam
* @param response HttpServletResponse
*/
void
exportLocationBeacon
(
LocationBeaconExportParam
locationBeaconExportParam
,
HttpServletResponse
response
);
}
app/src/main/java/com/yiring/app/service/location/beacon/impl/LocationBeaconServiceImpl.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
beacon
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.app.domain.location.LocationBeacon
;
import
com.yiring.app.domain.location.LocationBeaconRepository
;
import
com.yiring.app.excel.location.beacon.LocationBeaconExportExcel
;
import
com.yiring.app.feign.zy.location.beacon.LocationBeaconClient
;
import
com.yiring.app.param.location.beacon.LocationBeaconAddParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Optional
;
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.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.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 定位信标
*
* @author LJ-2204
* @date 2022/4/28
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
LocationBeaconServiceImpl
implements
LocationBeaconService
{
@Resource
LocationBeaconClient
locationTagBeaconClient
;
@Resource
LocationBeaconRepository
locationBeaconRepository
;
@Override
public
void
saveLocationBeacon
()
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"deviceType"
,
"BTI"
);
hashMap
.
put
(
"pageSize"
,
100
);
hashMap
.
put
(
"pageNum"
,
0
);
hashMap
.
put
(
"orgId"
,
100
);
hashMap
.
put
(
"deviceId"
,
""
);
JSONObject
jsonObject
=
locationTagBeaconClient
.
page
(
JSONUtil
.
toJsonStr
(
hashMap
),
ZyUtil
.
manageLogin
());
JSONObject
data
=
JSONUtil
.
parseObj
(
jsonObject
.
get
(
"data"
));
JSONArray
records
=
JSONUtil
.
parseArray
(
data
.
get
(
"records"
));
List
<
LocationBeaconAddParam
>
locationBeaconAddParams
=
JSONUtil
.
toList
(
JSONUtil
.
toJsonStr
(
records
),
LocationBeaconAddParam
.
class
);
locationBeaconAddParams
.
forEach
(
locationBeaconAddParam
->
{
Optional
<
LocationBeacon
>
locationBeaconOptional
=
locationBeaconRepository
.
findOne
(
Example
.
of
(
LocationBeacon
.
builder
()
.
code
(
locationBeaconAddParam
.
getDeviceId
())
.
linkId
(
locationBeaconAddParam
.
getId
())
.
build
()
)
);
if
(
locationBeaconOptional
.
isEmpty
())
{
LocationBeacon
locationBeacon
=
LocationBeaconAddParam
.
transform
(
locationBeaconAddParam
);
locationBeaconRepository
.
save
(
locationBeacon
);
}
else
{
LocationBeacon
locationBeacon
=
locationBeaconOptional
.
get
();
modifyLocationBeacon
(
locationBeacon
,
locationBeaconAddParam
);
}
});
}
@Override
public
Result
<
PageVo
<
LocationBeaconVo
>>
findLocationBeacon
(
LocationBeaconFindParam
locationBeaconFindParam
,
PageParam
pageParam
)
{
Specification
<
LocationBeacon
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationBeaconFindParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationBeacon
.
Fields
.
code
),
"%"
+
locationBeaconFindParam
.
getCode
()
+
"%"
)
);
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationBeacon
.
Fields
.
time
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
LocationBeacon
>
locationBeacons
=
locationBeaconRepository
.
findAll
(
specification
,
pageable
);
List
<
LocationBeaconVo
>
locationBeaconVos
=
locationBeacons
.
stream
()
.
map
(
LocationBeaconVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationBeaconVo
>
pageVo
=
PageVo
.
build
(
locationBeaconVos
,
locationBeacons
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
@Override
public
void
exportLocationBeacon
(
LocationBeaconExportParam
locationBeaconExportParam
,
HttpServletResponse
response
)
{
Specification
<
LocationBeacon
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationBeaconExportParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationBeacon
.
Fields
.
code
),
"%"
+
locationBeaconExportParam
.
getCode
()
+
"%"
)
);
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationBeacon
.
Fields
.
time
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
LocationBeacon
>
locationBeacons
=
locationBeaconRepository
.
findAll
(
specification
);
List
<
LocationBeaconExportExcel
>
locationBeaconExportExcels
=
locationBeacons
.
stream
()
.
map
(
LocationBeaconExportExcel:
:
transform
)
.
collect
(
Collectors
.
toList
());
try
(
DefaultStreamExcelBuilder
<
LocationBeaconExportExcel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
LocationBeaconExportExcel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
style
(
"cell->vertical-align:center;text-align:center"
,
"title->vertical-align:center;text-align:center;font-weight:bold;font-family:等线"
)
.
start
()
)
{
streamExcelBuilder
.
append
(
locationBeaconExportExcels
);
String
fileName
=
URLEncoder
.
encode
(
"信标信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
Workbook
workbook
=
streamExcelBuilder
.
fixedTitles
().
build
();
workbook
.
write
(
out
);
workbook
.
close
();
out
.
flush
();
out
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"导出信标信息失败: "
+
e
.
getMessage
());
}
}
private
void
modifyLocationBeacon
(
LocationBeacon
locationBeacon
,
LocationBeaconAddParam
locationBeaconAddParam
)
{
locationBeacon
.
setCode
(
locationBeaconAddParam
.
getDeviceId
());
locationBeacon
.
setAreaId
(
locationBeaconAddParam
.
getAreaId
());
locationBeacon
.
setLinkId
(
locationBeaconAddParam
.
getId
());
locationBeacon
.
setX
(
locationBeaconAddParam
.
getX
());
locationBeacon
.
setY
(
locationBeaconAddParam
.
getY
());
locationBeacon
.
setZ
(
locationBeaconAddParam
.
getZ
());
locationBeacon
.
setTime
(
locationBeaconAddParam
.
getTime
());
locationBeacon
.
setVolt
(
locationBeaconAddParam
.
getVolt
());
locationBeacon
.
setVoltUnit
(
locationBeaconAddParam
.
getVoltUnit
());
// locationBeacon.setPoint(GeoUtils.xyzToPoint(
// locationBeaconAddParam.getPointX().doubleValue(),locationBeaconAddParam.getPointY().doubleValue(),locationBeaconAddParam.getPointZ().doubleValue()
// ));
}
}
app/src/main/java/com/yiring/app/service/location/tag/LocationTagService.java
浏览文件 @
27d5320f
...
@@ -52,12 +52,12 @@ public interface LocationTagService {
...
@@ -52,12 +52,12 @@ public interface LocationTagService {
*/
*/
Result
<
String
>
importLocationTagInfo
(
MultipartFile
file
);
Result
<
String
>
importLocationTagInfo
(
MultipartFile
file
);
/**
/*
*//*
*
* 修改定位标签
* 修改定位标签
* @param locationTagModifyParam 入参
* @param locationTagModifyParam 入参
* @return Result<String>
* @return Result<String>
*/
*/
/*
Result
<
String
>
modifyLocationTag
(
LocationTagModifyParam
locationTagModifyParam
);
Result<String> modifyLocationTag(LocationTagModifyParam locationTagModifyParam);
*/
/**
/**
* 检索标签
* 检索标签
...
@@ -65,4 +65,11 @@ public interface LocationTagService {
...
@@ -65,4 +65,11 @@ public interface LocationTagService {
* @return Result<PageVo<LocationTagIndexVo>>
* @return Result<PageVo<LocationTagIndexVo>>
*/
*/
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
IndexParam
indexParam
);
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
IndexParam
indexParam
);
/**
* 条件查询
* @param locationTagFindParam LocationTagFindParam
* @return Result<PageVo<LocationTagVo>>
*/
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
LocationTagFindParam
locationTagFindParam
);
}
}
app/src/main/java/com/yiring/app/service/location/tag/LocationTagTypeService.java
浏览文件 @
27d5320f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
service
.
location
.
tag
;
package
com
.
yiring
.
app
.
service
.
location
.
tag
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeSendParam
;
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.param.PageParam
;
import
com.yiring.common.param.PageParam
;
...
@@ -24,4 +25,11 @@ public interface LocationTagTypeService {
...
@@ -24,4 +25,11 @@ public interface LocationTagTypeService {
LocationTagTypeFindParam
locationTagTypeFindParam
,
LocationTagTypeFindParam
locationTagTypeFindParam
,
PageParam
pageParam
PageParam
pageParam
);
);
/**
* 批量分配内部/外部
* @param locationtagtypeSendParam LocationTagTypeSendParam
* @return Result<String>
*/
Result
<
String
>
sendLocationTagType
(
LocationTagTypeSendParam
locationtagtypeSendParam
);
}
}
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagServiceImpl.java
浏览文件 @
27d5320f
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagTypeServiceImpl.java
浏览文件 @
27d5320f
...
@@ -2,19 +2,30 @@
...
@@ -2,19 +2,30 @@
package
com
.
yiring
.
app
.
service
.
location
.
tag
.
impl
;
package
com
.
yiring
.
app
.
service
.
location
.
tag
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
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
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.yiring.app.domain.location.LocationTag
;
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.feign.zy.location.tag.LocationTagTypeClient
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeSendParam
;
import
com.yiring.app.param.zy.location.tag.ZyLocationTagTypeSendParam
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
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.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
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -34,9 +45,14 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -34,9 +45,14 @@ import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Slf4j
public
class
LocationTagTypeServiceImpl
implements
LocationTagTypeService
{
public
class
LocationTagTypeServiceImpl
implements
LocationTagTypeService
{
final
Integer
FACTORY_ID
=
100
;
@Resource
@Resource
LocationTagRepository
locationTagRepository
;
LocationTagRepository
locationTagRepository
;
@Resource
LocationTagTypeClient
locationTagTypeClient
;
@Override
@Override
public
Result
<
PageVo
<
LocationTagTypeVo
>>
findLocationTagType
(
public
Result
<
PageVo
<
LocationTagTypeVo
>>
findLocationTagType
(
LocationTagTypeFindParam
locationTagTypeFindParam
,
LocationTagTypeFindParam
locationTagTypeFindParam
,
...
@@ -68,4 +84,50 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -68,4 +84,50 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
PageVo
<
LocationTagTypeVo
>
pageVo
=
PageVo
.
build
(
locationTagTypeVos
,
locationTagTypeVos
.
size
());
PageVo
<
LocationTagTypeVo
>
pageVo
=
PageVo
.
build
(
locationTagTypeVos
,
locationTagTypeVos
.
size
());
return
Result
.
ok
(
pageVo
);
return
Result
.
ok
(
pageVo
);
}
}
@Override
public
Result
<
String
>
sendLocationTagType
(
LocationTagTypeSendParam
locationtagtypeSendParam
)
{
ZyLocationTagTypeSendParam
zyLocationTagTypeSendParam
=
ZyLocationTagTypeSendParam
.
builder
()
.
orgId
(
FACTORY_ID
)
.
category
(
locationtagtypeSendParam
.
getCategory
())
.
build
();
String
[]
split
=
locationtagtypeSendParam
.
getIds
().
split
(
","
);
ArrayList
<
Long
>
ids
=
ListUtil
.
toList
();
ArrayList
<
String
>
list
=
ListUtil
.
toList
(
split
);
for
(
String
id
:
list
)
{
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findById
(
Convert
.
toLong
(
id
));
locationTagOptional
.
ifPresent
(
locationTag
->
ids
.
add
(
locationTag
.
getLinkId
()));
}
zyLocationTagTypeSendParam
.
setIds
(
Convert
.
toLongArray
(
ids
));
JSONObject
jsonObject
=
locationTagTypeClient
.
updateEntityType
(
JSONUtil
.
toJsonStr
(
zyLocationTagTypeSendParam
),
ZyUtil
.
manageLogin
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationtagtypeSendParam
.
getIds
()))
{
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
BasicEntity
.
Fields
.
id
));
for
(
String
id
:
list
)
in
.
value
(
Convert
.
toLong
(
id
));
predicates
.
add
(
cb
.
and
(
in
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
LocationTag
>
locationTags
=
locationTagRepository
.
findAll
(
specification
);
locationTags
=
locationTags
.
stream
()
.
peek
(
locationTag
->
locationTag
.
setCategory
(
locationtagtypeSendParam
.
getCategory
()))
.
collect
(
Collectors
.
toList
());
locationTagRepository
.
saveAll
(
locationTags
);
return
Result
.
ok
();
}
}
}
app/src/main/java/com/yiring/app/service/post/impl/PostServiceImpl.java
浏览文件 @
27d5320f
...
@@ -15,6 +15,7 @@ import com.yiring.auth.domain.post.PostRepository;
...
@@ -15,6 +15,7 @@ import com.yiring.auth.domain.post.PostRepository;
import
com.yiring.auth.excel.post.PostExcel
;
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.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
;
...
@@ -23,6 +24,7 @@ import java.io.OutputStream;
...
@@ -23,6 +24,7 @@ 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.List
;
import
java.util.List
;
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
;
...
@@ -62,16 +64,20 @@ public class PostServiceImpl implements PostService {
...
@@ -62,16 +64,20 @@ public class PostServiceImpl implements PostService {
@Override
@Override
public
Result
<
String
>
modifyPost
(
PostModifyParam
postModifyParam
)
{
public
Result
<
String
>
modifyPost
(
PostModifyParam
postModifyParam
)
{
// 是否变更 职位名称
// 是否变更 职位名称
long
count
=
postRepository
.
count
(
Optional
<
Post
>
postOptional
=
postRepository
.
findOne
(
Example
.
of
(
Post
.
builder
().
id
(
postModifyParam
.
getId
()).
name
(
postModifyParam
.
getName
()).
build
())
Example
.
of
(
Post
.
builder
().
id
(
postModifyParam
.
getId
()).
name
(
postModifyParam
.
getName
()).
build
())
);
);
if
(
postOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
Post
post
=
postOptional
.
get
();
// 变更处理
// 变更处理
if
(
count
==
0
&&
hasPostInfo
(
postModifyParam
.
getName
()))
{
if
(
!
StrUtil
.
equals
(
post
.
getName
(),
postModifyParam
.
getName
())
&&
hasPostInfo
(
postModifyParam
.
getName
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位名称重复"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位名称重复"
);
}
}
Post
post
=
postModifyParam
.
transform
(
postModifyParam
);
postModifyParam
.
transform
(
postModifyParam
,
post
);
postRepository
.
save
(
post
);
postRepository
.
save
(
post
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -96,7 +102,7 @@ public class PostServiceImpl implements PostService {
...
@@ -96,7 +102,7 @@ public class PostServiceImpl implements PostService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postFindParam
.
getEnable
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postFindParam
.
getEnable
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
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
();
};
};
...
@@ -105,7 +111,7 @@ public class PostServiceImpl implements PostService {
...
@@ -105,7 +111,7 @@ public class PostServiceImpl implements PostService {
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
Post
>
page
=
postRepository
.
findAll
(
specification
,
pageable
);
Page
<
Post
>
page
=
postRepository
.
findAll
(
specification
,
pageable
);
List
<
PostVo
>
postVos
=
page
.
getContent
().
stream
().
map
(
PostVo:
:
transform
).
collect
(
Collectors
.
toList
());
List
<
PostVo
>
postVos
=
page
.
getContent
().
stream
().
map
(
PostVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
PostVo
>
pageVo
=
PageVo
.
build
(
postVos
,
p
ostVos
.
size
());
PageVo
<
PostVo
>
pageVo
=
PageVo
.
build
(
postVos
,
p
age
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
return
Result
.
ok
(
pageVo
);
}
}
...
@@ -135,7 +141,7 @@ public class PostServiceImpl implements PostService {
...
@@ -135,7 +141,7 @@ public class PostServiceImpl implements PostService {
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postExportParam
.
getEnable
()));
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postExportParam
.
getEnable
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
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
();
};
};
...
@@ -184,7 +190,7 @@ public class PostServiceImpl implements PostService {
...
@@ -184,7 +190,7 @@ public class PostServiceImpl implements PostService {
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
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
();
});
});
...
...
app/src/main/java/com/yiring/app/service/user/UserService.java
浏览文件 @
27d5320f
...
@@ -4,6 +4,7 @@ package com.yiring.app.service.user;
...
@@ -4,6 +4,7 @@ package com.yiring.app.service.user;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
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.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.param.IndexParam
;
import
com.yiring.common.param.IndexParam
;
...
@@ -49,10 +50,10 @@ public interface UserService {
...
@@ -49,10 +50,10 @@ public interface UserService {
/**
/**
* 删除用户
* 删除用户
* @param id
Param Id
Param
* @param id
sParam Ids
Param
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
deleteUser
(
Id
Param
id
Param
);
Result
<
String
>
deleteUser
(
Id
sParam
ids
Param
);
/**
/**
* 导出用户
* 导出用户
...
@@ -95,4 +96,11 @@ public interface UserService {
...
@@ -95,4 +96,11 @@ public interface UserService {
* @return Result<PageVo<UserVo>>
* @return Result<PageVo<UserVo>>
*/
*/
Result
<
PageVo
<
UserVo
>>
indexUser
(
IndexParam
indexParam
);
Result
<
PageVo
<
UserVo
>>
indexUser
(
IndexParam
indexParam
);
/**
* 用户条件查询
* @param userFindParam UserFindParam
* @return Result<PageVo<UserVo>>
*/
Result
<
PageVo
<
UserVo
>>
findUser
(
UserFindParam
userFindParam
);
}
}
app/src/main/java/com/yiring/app/service/user/impl/UserServiceImpl.java
浏览文件 @
27d5320f
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/service/zy/ZyHttpService.java
deleted
100644 → 0
浏览文件 @
7058ff2c
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
zy
;
import
com.yiring.common.core.Result
;
import
java.io.Serializable
;
import
java.util.concurrent.CompletableFuture
;
/**
* ZyHttp请求
* @author LJ-2204
* @date 2022/4/18
*/
public
interface
ZyHttpService
{
/**
* get请求
* @param urlString 路径
* @param obj 参数
* @param timeout 请求时长
* @return json
*/
CompletableFuture
<
Result
<
Serializable
>>
get
(
String
urlString
,
Object
obj
,
int
timeout
);
/**
* post请求
* @param urlString 路径
* @param obj 参数
* @param timeout 请求时长
* @return json
*/
CompletableFuture
<
Result
<
Serializable
>>
post
(
String
urlString
,
Object
obj
,
int
timeout
);
/**
* put请求
* @param urlString 路径
* @param obj 参数
* @param timeout 请求时长
* @return json
*/
CompletableFuture
<
Result
<
Serializable
>>
put
(
String
urlString
,
Object
obj
,
int
timeout
);
/**
* delete请求
* @param urlString 路径
* @param obj 参数
* @param timeout 请求时长
* @return json
*/
CompletableFuture
<
Result
<
Serializable
>>
delete
(
String
urlString
,
Object
obj
,
int
timeout
);
}
app/src/main/java/com/yiring/app/service/zy/impl/ZyHttpServiceImpl.java
deleted
100644 → 0
浏览文件 @
7058ff2c
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
zy
.
impl
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.http.Header
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.json.JSONUtil
;
import
com.yiring.app.service.zy.ZyHttpService
;
import
com.yiring.auth.util.ZyUtil
;
import
com.yiring.common.core.Result
;
import
java.io.Serializable
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* ZyHttp请求
* @author LJ-2204
* @date 2022/4/18
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
ZyHttpServiceImpl
implements
ZyHttpService
{
public
final
String
TOKEN_TYPE
=
"bearer "
;
public
final
String
URL_PREFIX
=
"http://project.yz-online.com:789"
;
@Override
@Async
(
"httpThreadPool"
)
public
CompletableFuture
<
Result
<
Serializable
>>
get
(
String
urlString
,
Object
obj
,
int
timeout
)
{
String
json
=
JSONUtil
.
toJsonStr
(
obj
);
String
token
=
ZyUtil
.
login
();
String
body
=
HttpRequest
.
get
(
URL_PREFIX
+
urlString
)
.
header
(
Header
.
AUTHORIZATION
,
TOKEN_TYPE
+
token
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/json"
)
.
body
(
json
)
.
timeout
(
timeout
)
.
execute
()
.
body
();
return
CompletableFuture
.
completedFuture
(
getResult
(
body
));
}
@Override
@Async
(
"httpThreadPool"
)
public
CompletableFuture
<
Result
<
Serializable
>>
post
(
String
urlString
,
Object
obj
,
int
timeout
)
{
String
json
=
JSONUtil
.
toJsonStr
(
obj
);
String
token
=
ZyUtil
.
login
();
String
body
=
HttpRequest
.
post
(
URL_PREFIX
+
urlString
)
.
header
(
Header
.
AUTHORIZATION
,
TOKEN_TYPE
+
token
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/json"
)
.
body
(
json
)
.
timeout
(
timeout
)
.
execute
()
.
body
();
return
CompletableFuture
.
completedFuture
(
getResult
(
body
));
}
@Override
@Async
(
"httpThreadPool"
)
public
CompletableFuture
<
Result
<
Serializable
>>
put
(
String
urlString
,
Object
obj
,
int
timeout
)
{
String
json
=
JSONUtil
.
toJsonStr
(
obj
);
String
token
=
ZyUtil
.
login
();
String
body
=
HttpRequest
.
put
(
URL_PREFIX
+
urlString
)
.
header
(
Header
.
AUTHORIZATION
,
TOKEN_TYPE
+
token
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/json"
)
.
body
(
json
)
.
timeout
(
timeout
)
.
execute
()
.
body
();
return
CompletableFuture
.
completedFuture
(
getResult
(
body
));
}
@Override
@Async
(
"httpThreadPool"
)
public
CompletableFuture
<
Result
<
Serializable
>>
delete
(
String
urlString
,
Object
obj
,
int
timeout
)
{
String
json
=
JSONUtil
.
toJsonStr
(
obj
);
String
token
=
ZyUtil
.
login
();
String
body
=
HttpRequest
.
delete
(
URL_PREFIX
+
urlString
)
.
header
(
Header
.
AUTHORIZATION
,
TOKEN_TYPE
+
token
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/x-www-form-urlencoded"
)
.
body
(
json
)
.
timeout
(
timeout
)
.
execute
()
.
body
();
return
CompletableFuture
.
completedFuture
(
getResult
(
body
));
}
/**
* 返回类型转换
* @param body json
* @return Result
*/
private
static
Result
<
Serializable
>
getResult
(
String
body
)
{
String
data
=
null
;
Map
map
=
JSONUtil
.
toBean
(
body
,
Map
.
class
);
Integer
code
=
Convert
.
toInt
(
map
.
get
(
"code"
));
String
msg
=
Convert
.
toStr
(
map
.
get
(
"msg"
));
if
(
ObjectUtil
.
isNotEmpty
(
map
.
get
(
"data"
)))
{
data
=
Convert
.
toStr
(
map
.
get
(
"data"
));
}
return
Result
.
builder
().
status
(
code
).
message
(
msg
).
body
(
data
).
build
();
}
}
app/src/main/java/com/yiring/app/util/zy/ZyUtil.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
util
.
zy
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.extra.spring.SpringUtil
;
import
cn.hutool.http.Header
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.yiring.app.rabbit.config.ZyConfigProperties
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.data.redis.core.RedisTemplate
;
/**
* 真源授权工具
* @author LJ-2204
* @date 2022/4/15
*/
@UtilityClass
public
class
ZyUtil
{
RedisTemplate
<
String
,
Object
>
redisTemplate
;
ZyConfigProperties
.
ZyConfigOpen
zyConfigOpen
;
ZyConfigProperties
.
ZyConfigProxy
zyConfigProxy
;
static
{
redisTemplate
=
SpringUtil
.
getBean
(
"redisTemplate"
);
zyConfigOpen
=
SpringUtil
.
getBean
(
"zyConfigProperties.ZyConfigOpen"
);
zyConfigProxy
=
SpringUtil
.
getBean
(
"zyConfigProperties.ZyConfigProxy"
);
}
public
final
Integer
ORG_ID
=
100
;
public
final
String
OPEN_KEY
=
"zy_open_token"
;
// public final String CLIENT_KEY = "zy_client_token";
// public final String MANAGE_KEY = "zy_manage_token";
/**
* 获取openToken
* @return token
*/
public
static
String
openLogin
()
{
Object
obj
=
redisTemplate
.
opsForValue
().
get
(
OPEN_KEY
);
if
(
ObjectUtil
.
isNotEmpty
(
obj
))
{
return
String
.
valueOf
(
obj
);
}
Map
<
String
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
map
.
put
(
"client_id"
,
zyConfigOpen
.
getClientId
());
map
.
put
(
"client_secret"
,
zyConfigOpen
.
getClientSecret
());
map
.
put
(
"grant_type"
,
zyConfigOpen
.
getGrantType
());
String
json
=
HttpUtil
.
get
(
zyConfigOpen
.
getApi
()
+
"/oauth/token"
,
map
);
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
json
);
String
access_token
=
Convert
.
toStr
(
jsonObject
.
get
(
"access_token"
));
Integer
expires_in
=
Convert
.
toInt
(
jsonObject
.
get
(
"expires_in"
));
redisTemplate
.
opsForValue
().
set
(
OPEN_KEY
,
access_token
,
expires_in
,
TimeUnit
.
SECONDS
);
return
access_token
;
}
/**
* 获取应用平台token
* @return token
*/
public
static
String
clientLogin
()
{
// Object obj = redisTemplate.opsForValue().get(CLIENT_KEY);
// if (ObjectUtil.isNotEmpty(obj)) {
// return String.valueOf(obj);
// }
Map
<
String
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
map
.
put
(
"orgId"
,
ORG_ID
);
map
.
put
(
"tenantId"
,
zyConfigProxy
.
getTenant
());
map
.
put
(
"username"
,
zyConfigProxy
.
getClient
().
getUsername
());
map
.
put
(
"password"
,
zyConfigProxy
.
getClient
().
getPassword
());
String
json
=
HttpRequest
.
post
(
zyConfigProxy
.
getApi
()
+
"/position/login"
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/json"
)
.
body
(
JSONUtil
.
toJsonStr
(
map
))
.
execute
()
.
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
json
);
// String token = Convert.toStr(jsonObject.get("token"));
// redisTemplate.opsForValue().set(CLIENT_KEY, token, 1200, TimeUnit.SECONDS);
return
Convert
.
toStr
(
jsonObject
.
get
(
"token"
));
}
/**
* 获取管理平台token
* @return token
*/
public
static
String
manageLogin
()
{
// Object obj = redisTemplate.opsForValue().get(MANAGE_KEY);
// if (ObjectUtil.isNotEmpty(obj)) {
// return String.valueOf(obj);
// }
Map
<
String
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
map
.
put
(
"orgId"
,
ORG_ID
);
map
.
put
(
"tenantId"
,
zyConfigProxy
.
getTenant
());
map
.
put
(
"username"
,
zyConfigProxy
.
getManage
().
getUsername
());
map
.
put
(
"password"
,
zyConfigProxy
.
getManage
().
getPassword
());
String
json
=
HttpRequest
.
post
(
zyConfigProxy
.
getApi
()
+
"/position/login"
)
.
header
(
Header
.
CONTENT_TYPE
,
"application/json"
)
.
body
(
JSONUtil
.
toJsonStr
(
map
))
.
execute
()
.
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
json
);
// String token = Convert.toStr(jsonObject.get("token"));
// redisTemplate.opsForValue().set(MANAGE_KEY, token, 1200, TimeUnit.SECONDS);
return
Convert
.
toStr
(
jsonObject
.
get
(
"token"
));
}
}
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
0 → 100644
浏览文件 @
27d5320f
/* (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.KeyAlarmRules
;
import
com.yiring.app.vo.user.UserInfoVo
;
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.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警规则
*
* @author LJ-2204
* @date 2022/5/7
*/
@ApiModel
(
"KeyAlarmRulesVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmRulesVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5083435104462641333L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"111"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"Java"
)
String
deptName
;
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"111"
)
List
<
UserInfoVo
>
users
;
@ApiModelProperty
(
value
=
"推送类型"
,
example
=
"111"
)
String
types
;
public
static
KeyAlarmRulesVo
transform
(
KeyAlarmRules
keyAlarmRules
)
{
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
List
<
UserInfoVo
>
userInfoVos
=
users
.
stream
().
map
(
UserInfoVo:
:
transform
).
collect
(
Collectors
.
toList
());
return
KeyAlarmRulesVo
.
builder
()
.
id
(
keyAlarmRules
.
getId
())
.
deptId
(
keyAlarmRules
.
getDepartment
().
getId
())
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
users
(
userInfoVos
)
.
types
(
keyAlarmRules
.
getTypes
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
beacon
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.location.LocationBeacon
;
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/4/28
*/
@ApiModel
(
"LocationBeaconVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationBeaconVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
996556953940775577L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"188354391834"
)
Long
id
;
@ApiModelProperty
(
value
=
"信标"
,
example
=
"BTI88888888"
)
String
code
;
@ApiModelProperty
(
value
=
"最后一次在线时间"
,
example
=
"BTI88888888"
)
LocalDateTime
time
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"所属地图"
,
example
=
"1:总图2:一层3:二层"
)
Long
areaId
;
public
static
LocationBeaconVo
transform
(
LocationBeacon
locationBeacon
)
{
return
LocationBeaconVo
.
builder
()
.
id
(
locationBeacon
.
getId
())
.
code
(
locationBeacon
.
getCode
())
.
time
(
locationBeacon
.
getTime
())
.
areaId
(
locationBeacon
.
getAreaId
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/post/PostVo.java
浏览文件 @
27d5320f
...
@@ -39,6 +39,9 @@ public class PostVo implements Serializable {
...
@@ -39,6 +39,9 @@ public class PostVo implements Serializable {
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"创建时间"
)
LocalDateTime
createTime
;
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
String
describe
;
@ApiModelProperty
(
value
=
"职位状态"
,
example
=
"true"
)
@ApiModelProperty
(
value
=
"职位状态"
,
example
=
"true"
)
Boolean
enable
;
Boolean
enable
;
...
@@ -48,6 +51,7 @@ public class PostVo implements Serializable {
...
@@ -48,6 +51,7 @@ public class PostVo implements Serializable {
.
id
(
post
.
getId
())
.
id
(
post
.
getId
())
.
name
(
post
.
getName
())
.
name
(
post
.
getName
())
.
enable
(
post
.
getEnable
())
.
enable
(
post
.
getEnable
())
.
describe
(
post
.
getDescribe
())
.
createTime
(
post
.
getCreateTime
())
.
createTime
(
post
.
getCreateTime
())
.
build
();
.
build
();
}
}
...
...
app/src/main/java/com/yiring/app/vo/user/UserInfoVo.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
user
;
package
com
.
yiring
.
app
.
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.domain.user.User
;
...
@@ -77,7 +78,7 @@ public class UserInfoVo implements Serializable {
...
@@ -77,7 +78,7 @@ public class UserInfoVo implements Serializable {
LocalDateTime
updateTime
;
LocalDateTime
updateTime
;
public
static
UserInfoVo
transform
(
User
user
)
{
public
static
UserInfoVo
transform
(
User
user
)
{
return
UserInfoVo
UserInfoVo
userInfoVo
=
UserInfoVo
.
builder
()
.
builder
()
.
id
(
user
.
getId
())
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
realName
(
user
.
getRealName
())
...
@@ -85,7 +86,6 @@ public class UserInfoVo implements Serializable {
...
@@ -85,7 +86,6 @@ public class UserInfoVo implements Serializable {
.
type
(
user
.
getType
())
.
type
(
user
.
getType
())
.
department
(
user
.
getDepartment
().
getName
())
.
department
(
user
.
getDepartment
().
getName
())
.
mobile
(
user
.
getMobile
())
.
mobile
(
user
.
getMobile
())
.
post
(
user
.
getPost
().
getName
())
.
email
(
user
.
getEmail
())
.
email
(
user
.
getEmail
())
.
avatar
(
user
.
getAvatar
())
.
avatar
(
user
.
getAvatar
())
.
enabled
(
user
.
getEnabled
())
.
enabled
(
user
.
getEnabled
())
...
@@ -95,5 +95,9 @@ public class UserInfoVo implements Serializable {
...
@@ -95,5 +95,9 @@ public class UserInfoVo implements Serializable {
.
createTime
(
user
.
getCreateTime
())
.
createTime
(
user
.
getCreateTime
())
.
updateTime
(
user
.
getUpdateTime
())
.
updateTime
(
user
.
getUpdateTime
())
.
build
();
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
user
.
getPost
()))
{
userInfoVo
.
setPost
(
user
.
getPost
().
getName
());
}
return
userInfoVo
;
}
}
}
}
app/src/main/java/com/yiring/app/vo/user/UserVo.java
浏览文件 @
27d5320f
...
@@ -44,12 +44,20 @@ public class UserVo implements Serializable {
...
@@ -44,12 +44,20 @@ public class UserVo implements Serializable {
@ApiModelProperty
(
value
=
"部门"
,
example
=
"系统管理员"
)
@ApiModelProperty
(
value
=
"部门"
,
example
=
"系统管理员"
)
String
department
;
String
department
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"200"
)
Long
departmentId
;
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
String
mobile
;
String
mobile
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"系统管理员"
)
@ApiModelProperty
(
value
=
"职位"
,
example
=
"系统管理员"
)
String
post
;
String
post
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"职位id"
,
example
=
"100"
)
Long
postId
;
@ApiModelProperty
(
value
=
"标签编号"
,
example
=
"BTT88888888"
)
@ApiModelProperty
(
value
=
"标签编号"
,
example
=
"BTT88888888"
)
String
code
;
String
code
;
...
@@ -62,6 +70,9 @@ public class UserVo implements Serializable {
...
@@ -62,6 +70,9 @@ public class UserVo implements Serializable {
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
email
;
String
email
;
@ApiModelProperty
(
value
=
"头像"
,
example
=
"baidu.com"
)
String
avatar
;
public
UserVo
(
public
UserVo
(
Long
id
,
Long
id
,
String
realName
,
String
realName
,
...
@@ -72,7 +83,10 @@ public class UserVo implements Serializable {
...
@@ -72,7 +83,10 @@ public class UserVo implements Serializable {
String
post
,
String
post
,
String
code
,
String
code
,
Boolean
gender
,
Boolean
gender
,
Boolean
isSpecial
Boolean
isSpecial
,
Long
departmentId
,
Long
postId
,
String
avatar
)
{
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
realName
=
realName
;
this
.
realName
=
realName
;
...
@@ -84,6 +98,9 @@ public class UserVo implements Serializable {
...
@@ -84,6 +98,9 @@ public class UserVo implements Serializable {
this
.
code
=
code
;
this
.
code
=
code
;
this
.
gender
=
gender
;
this
.
gender
=
gender
;
this
.
isSpecial
=
isSpecial
;
this
.
isSpecial
=
isSpecial
;
this
.
departmentId
=
departmentId
;
this
.
postId
=
postId
;
this
.
avatar
=
avatar
;
}
}
public
static
UserVo
transformDept
(
User
user
)
{
public
static
UserVo
transformDept
(
User
user
)
{
...
...
app/src/main/java/com/yiring/app/web/HelloController.java
浏览文件 @
27d5320f
...
@@ -3,6 +3,7 @@ package com.yiring.app.web;
...
@@ -3,6 +3,7 @@ package com.yiring.app.web;
import
com.yiring.app.constant.Code
;
import
com.yiring.app.constant.Code
;
import
com.yiring.app.exception.CodeException
;
import
com.yiring.app.exception.CodeException
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
...
@@ -46,4 +47,9 @@ public class HelloController {
...
@@ -46,4 +47,9 @@ public class HelloController {
PageVo
<
String
>
vo
=
PageVo
.
build
(
data
,
data
.
size
());
PageVo
<
String
>
vo
=
PageVo
.
build
(
data
,
data
.
size
());
return
Result
.
ok
(
vo
);
return
Result
.
ok
(
vo
);
}
}
@GetMapping
(
"test"
)
public
Result
<
String
>
test
()
{
return
Result
.
ok
(
ZyUtil
.
manageLogin
());
}
}
}
app/src/main/java/com/yiring/app/web/dept/DepartmentController.java
浏览文件 @
27d5320f
...
@@ -68,12 +68,6 @@ public class DepartmentController {
...
@@ -68,12 +68,6 @@ public class DepartmentController {
return
departmentService
.
deleteDepartment
(
idParam
);
return
departmentService
.
deleteDepartment
(
idParam
);
}
}
@ApiOperation
(
"启用/停用"
)
@PutMapping
(
"stateDepartment"
)
public
Result
<
String
>
stateDepartment
(
@Valid
IdParam
idParam
)
{
return
departmentService
.
stateDepartment
(
idParam
);
}
@ApiOperation
(
"给部门添加职位"
)
@ApiOperation
(
"给部门添加职位"
)
@PutMapping
(
"deptBingPost"
)
@PutMapping
(
"deptBingPost"
)
public
Result
<
String
>
deptBingPost
(
@Valid
IdParam
idParam
,
@Valid
IdsParam
idsParam
)
{
public
Result
<
String
>
deptBingPost
(
@Valid
IdParam
idParam
,
@Valid
IdsParam
idsParam
)
{
...
@@ -87,7 +81,7 @@ public class DepartmentController {
...
@@ -87,7 +81,7 @@ public class DepartmentController {
}
}
@ApiOperation
(
"部门导入"
)
@ApiOperation
(
"部门导入"
)
@PostMapping
(
"Department"
)
@PostMapping
(
"
import
Department"
)
public
Result
<
String
>
importDepartment
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Result
<
String
>
importDepartment
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
return
departmentService
.
importDepartment
(
file
);
return
departmentService
.
importDepartment
(
file
);
}
}
...
...
app/src/main/java/com/yiring/app/web/key/KeyAlarmRulesController.java
0 → 100644
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
key
;
import
com.yiring.app.param.key.KeyAlarmRulesAddParam
;
import
com.yiring.app.param.key.KeyAlarmRulesExportParam
;
import
com.yiring.app.param.key.KeyAlarmRulesModifyParam
;
import
com.yiring.app.param.key.KeyAlarmRulesPageParam
;
import
com.yiring.app.service.key.KeyAlarmRulesService
;
import
com.yiring.app.vo.key.KeyAlarmRulesVo
;
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.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
/**
* 按键报警规则控制器
*
* @author LJ-2204
* @date 2022/5/6
*/
@Slf4j
@Validated
@Api
(
tags
=
"按键报警规则"
)
@RestController
@RequestMapping
(
"/key/alarm/rules"
)
public
class
KeyAlarmRulesController
{
@Resource
KeyAlarmRulesService
keyAlarmRulesService
;
@ApiOperation
(
"新增报警规则"
)
@PostMapping
(
"add"
)
public
Result
<
String
>
add
(
KeyAlarmRulesAddParam
keyAlarmRulesAddParam
)
{
return
keyAlarmRulesService
.
add
(
keyAlarmRulesAddParam
);
}
@ApiOperation
(
"删除报警规则"
)
@DeleteMapping
(
"delete"
)
public
Result
<
String
>
delete
(
IdParam
idParam
)
{
return
keyAlarmRulesService
.
delete
(
idParam
);
}
@ApiOperation
(
"更新报警规则"
)
@PutMapping
(
"modify"
)
public
Result
<
String
>
modify
(
KeyAlarmRulesModifyParam
keyAlarmRulesModifyParam
)
{
return
keyAlarmRulesService
.
modify
(
keyAlarmRulesModifyParam
);
}
@ApiOperation
(
"导出"
)
@GetMapping
(
"export"
)
public
void
export
(
KeyAlarmRulesExportParam
keyAlarmRulesExportParam
,
HttpServletResponse
response
)
{
keyAlarmRulesService
.
export
(
keyAlarmRulesExportParam
,
response
);
}
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"page"
)
public
Result
<
PageVo
<
KeyAlarmRulesVo
>>
page
(
KeyAlarmRulesPageParam
keyAlarmRulesPageParam
,
PageParam
pageParam
)
{
return
keyAlarmRulesService
.
page
(
keyAlarmRulesPageParam
,
pageParam
);
}
}
app/src/main/java/com/yiring/app/web/location/beacon/LocationBeaconController.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
location
.
beacon
;
package
com
.
yiring
.
app
.
web
.
location
.
beacon
;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
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.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
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.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -19,4 +32,32 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,4 +32,32 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
tags
=
"定位信标"
)
@Api
(
tags
=
"定位信标"
)
@RestController
@RestController
@RequestMapping
(
"/location/beacon/"
)
@RequestMapping
(
"/location/beacon/"
)
public
class
LocationBeaconController
{}
public
class
LocationBeaconController
{
@Resource
LocationBeaconService
locationBeaconService
;
@ApiOperation
(
"添加定位信标"
)
@PostMapping
(
"saveLocationBeacon"
)
public
void
saveLocationBeacon
()
{
locationBeaconService
.
saveLocationBeacon
();
}
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"findLocationBeacon"
)
public
Result
<
PageVo
<
LocationBeaconVo
>>
findLocationBeacon
(
@Valid
LocationBeaconFindParam
locationBeaconFindParam
,
@Valid
PageParam
pageParam
)
{
return
locationBeaconService
.
findLocationBeacon
(
locationBeaconFindParam
,
pageParam
);
}
@ApiOperation
(
"导出"
)
@GetMapping
(
"exportLocationBeacon"
)
public
void
exportLocationBeacon
(
@Valid
LocationBeaconExportParam
locationBeaconExportParam
,
HttpServletResponse
response
)
{
locationBeaconService
.
exportLocationBeacon
(
locationBeaconExportParam
,
response
);
}
}
app/src/main/java/com/yiring/app/web/location/tag/LocationTagController.java
浏览文件 @
27d5320f
...
@@ -50,6 +50,12 @@ public class LocationTagController {
...
@@ -50,6 +50,12 @@ public class LocationTagController {
return
locationTagService
.
findLocationTagPage
(
locationTagFindParam
,
pageParam
);
return
locationTagService
.
findLocationTagPage
(
locationTagFindParam
,
pageParam
);
}
}
@ApiOperation
(
"条件查询"
)
@GetMapping
(
"findLocationTag"
)
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
@Valid
LocationTagFindParam
locationTagFindParam
)
{
return
locationTagService
.
findLocationTag
(
locationTagFindParam
);
}
@ApiOperation
(
"销毁定位标签"
)
@ApiOperation
(
"销毁定位标签"
)
@DeleteMapping
(
"deleteLocationTag"
)
@DeleteMapping
(
"deleteLocationTag"
)
public
Result
<
String
>
deleteLocationTag
(
@Valid
LocationTagDeleteParam
locationTagDeleteParam
)
{
public
Result
<
String
>
deleteLocationTag
(
@Valid
LocationTagDeleteParam
locationTagDeleteParam
)
{
...
@@ -71,11 +77,11 @@ public class LocationTagController {
...
@@ -71,11 +77,11 @@ public class LocationTagController {
return
locationTagService
.
importLocationTagInfo
(
file
);
return
locationTagService
.
importLocationTagInfo
(
file
);
}
}
@ApiOperation
(
"修改定位标签"
)
/*
@ApiOperation("修改定位标签")
@PutMapping("modifyLocationTag")
@PutMapping("modifyLocationTag")
public Result<String> modifyLocationTag(@Valid LocationTagModifyParam locationTagModifyParam) {
public Result<String> modifyLocationTag(@Valid LocationTagModifyParam locationTagModifyParam) {
return locationTagService.modifyLocationTag(locationTagModifyParam);
return locationTagService.modifyLocationTag(locationTagModifyParam);
}
}
*/
@ApiOperation
(
"标签检索"
)
@ApiOperation
(
"标签检索"
)
@GetMapping
(
"indexLocationTag"
)
@GetMapping
(
"indexLocationTag"
)
...
...
app/src/main/java/com/yiring/app/web/location/tag/LocationTagTypeController.java
浏览文件 @
27d5320f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
web
.
location
.
tag
;
package
com
.
yiring
.
app
.
web
.
location
.
tag
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.param.location.tag.LocationTagTypeSendParam
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
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
;
...
@@ -14,6 +15,7 @@ import javax.validation.Valid;
...
@@ -14,6 +15,7 @@ import javax.validation.Valid;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
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.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -42,4 +44,10 @@ public class LocationTagTypeController {
...
@@ -42,4 +44,10 @@ public class LocationTagTypeController {
)
{
)
{
return
locationTagTypeService
.
findLocationTagType
(
locationTagTypeFindParam
,
pageParam
);
return
locationTagTypeService
.
findLocationTagType
(
locationTagTypeFindParam
,
pageParam
);
}
}
@ApiOperation
(
"批量分配内部/外部"
)
@PutMapping
(
"sendLocationTagType"
)
public
Result
<
String
>
sendLocationTagType
(
@Valid
LocationTagTypeSendParam
locationtagtypeSendParam
)
{
return
locationTagTypeService
.
sendLocationTagType
(
locationtagtypeSendParam
);
}
}
}
app/src/main/java/com/yiring/app/web/map/MapController.java
浏览文件 @
27d5320f
...
@@ -5,8 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -5,8 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yiring.app.feign.MapClient
;
import
com.yiring.app.feign.MapClient
;
import
com.yiring.app.vo.map.MapVo
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.auth.util.ZyUtil
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -25,7 +24,6 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -25,7 +24,6 @@ import org.springframework.web.bind.annotation.RestController;
*
*
* @author Administrator
* @author Administrator
* @version 1.0
* @version 1.0
* @description: TODO
* @date 2022/4/24 13:48
* @date 2022/4/24 13:48
*/
*/
@Slf4j
@Slf4j
...
@@ -40,8 +38,8 @@ public class MapController {
...
@@ -40,8 +38,8 @@ public class MapController {
@GetMapping
(
"/mapSelect"
)
@GetMapping
(
"/mapSelect"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
value
=
"orgId"
,
required
=
true
,
name
=
"orgId"
)
})
@ApiImplicitParams
({
@ApiImplicitParam
(
value
=
"orgId"
,
required
=
true
,
name
=
"orgId"
)
})
public
Result
<
MapVo
>
fail
(
String
orgId
)
{
public
Result
<
Serializable
>
fail
(
String
orgId
)
{
String
login
=
ZyUtil
.
l
ogin
();
String
login
=
ZyUtil
.
openL
ogin
();
JSONObject
jsonObject
=
mapClient
.
selectMap
(
orgId
,
"bearer "
+
login
);
JSONObject
jsonObject
=
mapClient
.
selectMap
(
orgId
,
"bearer "
+
login
);
// if (ObjectUtil.isNotNull(jsonObject.getJSONArray("data"))) {
// if (ObjectUtil.isNotNull(jsonObject.getJSONArray("data"))) {
// List<MapVo.MapVoReuslt> data = jsonObject.getJSONArray("data").toJavaList(MapVo.MapVoReuslt.class);
// List<MapVo.MapVoReuslt> data = jsonObject.getJSONArray("data").toJavaList(MapVo.MapVoReuslt.class);
...
...
app/src/main/java/com/yiring/app/web/user/UserAppController.java
浏览文件 @
27d5320f
...
@@ -5,6 +5,7 @@ import com.yiring.app.param.user.*;
...
@@ -5,6 +5,7 @@ import com.yiring.app.param.user.*;
import
com.yiring.app.service.user.UserService
;
import
com.yiring.app.service.user.UserService
;
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.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.param.IndexParam
;
import
com.yiring.common.param.IndexParam
;
...
@@ -64,8 +65,8 @@ public class UserAppController {
...
@@ -64,8 +65,8 @@ public class UserAppController {
@ApiOperation
(
"逻辑删除用户"
)
@ApiOperation
(
"逻辑删除用户"
)
@DeleteMapping
(
"deleteUser"
)
@DeleteMapping
(
"deleteUser"
)
public
Result
<
String
>
deleteUser
(
@Valid
Id
Param
id
Param
)
{
public
Result
<
String
>
deleteUser
(
@Valid
Id
sParam
ids
Param
)
{
return
userService
.
deleteUser
(
idParam
);
return
userService
.
deleteUser
(
id
s
Param
);
}
}
@ApiOperation
(
"用户导出"
)
@ApiOperation
(
"用户导出"
)
...
@@ -103,4 +104,10 @@ public class UserAppController {
...
@@ -103,4 +104,10 @@ public class UserAppController {
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
@Valid
IndexParam
indexParam
)
{
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
@Valid
IndexParam
indexParam
)
{
return
userService
.
indexUser
(
indexParam
);
return
userService
.
indexUser
(
indexParam
);
}
}
@ApiOperation
(
"条件查询"
)
@GetMapping
(
"findUser"
)
public
Result
<
PageVo
<
UserVo
>>
findUser
(
@Valid
UserFindParam
userFindParam
)
{
return
userService
.
findUser
(
userFindParam
);
}
}
}
basic-auth/src/main/java/com/yiring/auth/domain/dept/Department.java
浏览文件 @
27d5320f
...
@@ -5,20 +5,17 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
...
@@ -5,20 +5,17 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.annotation.FieldMapping
;
import
com.yiring.common.annotation.FieldMapping
;
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.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
org.hibernate.Hibernate
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.snowflake.SnowflakeId
;
/**
/**
* 部门
* 部门
...
@@ -30,7 +27,7 @@ import org.hibernate.snowflake.SnowflakeId;
...
@@ -30,7 +27,7 @@ import org.hibernate.snowflake.SnowflakeId;
@Getter
@Getter
@Setter
@Setter
@ToString
@ToString
@
Builder
@
SuperBuilder
(
toBuilder
=
true
)
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldNameConstants
...
@@ -38,17 +35,11 @@ import org.hibernate.snowflake.SnowflakeId;
...
@@ -38,17 +35,11 @@ import org.hibernate.snowflake.SnowflakeId;
@Entity
@Entity
@Comment
(
"系统部门"
)
@Comment
(
"系统部门"
)
@Table
(
name
=
"SYS_DEPARTMENT"
,
indexes
=
{
@Index
(
columnList
=
"pid"
),
@Index
(
columnList
=
"tree"
)
})
@Table
(
name
=
"SYS_DEPARTMENT"
,
indexes
=
{
@Index
(
columnList
=
"pid"
),
@Index
(
columnList
=
"tree"
)
})
public
class
Department
implements
Serializable
{
public
class
Department
extends
BasicEntity
implements
Serializable
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
5402731145404250150L
;
private
static
final
long
serialVersionUID
=
-
5402731145404250150L
;
@Comment
(
"主键"
)
@Id
@GeneratedValue
(
generator
=
SnowflakeId
.
GENERATOR
)
@GenericGenerator
(
name
=
SnowflakeId
.
GENERATOR
,
strategy
=
SnowflakeId
.
Strategy
.
LONG
)
Long
id
;
/**
/**
* 数据来源于【真源人员定位系统 - 部门】
* 数据来源于【真源人员定位系统 - 部门】
* 作用: 用于双向联动进行数据同步
* 作用: 用于双向联动进行数据同步
...
@@ -87,12 +78,6 @@ public class Department implements Serializable {
...
@@ -87,12 +78,6 @@ public class Department implements Serializable {
@Comment
(
"树节点标识"
)
@Comment
(
"树节点标识"
)
String
tree
;
String
tree
;
@Comment
(
"更新时间"
)
LocalDateTime
updateTime
;
@Comment
(
"创建时间"
)
LocalDateTime
createTime
;
@Comment
(
"岗位集合"
)
@Comment
(
"岗位集合"
)
@Builder
.
Default
@Builder
.
Default
@ToString
.
Exclude
@ToString
.
Exclude
...
@@ -105,14 +90,6 @@ public class Department implements Serializable {
...
@@ -105,14 +90,6 @@ public class Department implements Serializable {
Set
<
Post
>
posts
=
new
HashSet
<>(
0
);
Set
<
Post
>
posts
=
new
HashSet
<>(
0
);
@Override
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
Hibernate
.
getClass
(
this
)
!=
Hibernate
.
getClass
(
o
))
return
false
;
Department
that
=
(
Department
)
o
;
return
id
!=
null
&&
Objects
.
equals
(
id
,
that
.
id
);
}
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
getClass
().
hashCode
();
return
getClass
().
hashCode
();
}
}
...
...
basic-auth/src/main/java/com/yiring/auth/domain/post/Post.java
浏览文件 @
27d5320f
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
domain
.
post
;
package
com
.
yiring
.
auth
.
domain
.
post
;
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
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
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
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.hibernate.snowflake.SnowflakeId
;
/**
/**
* 岗位
* 岗位
...
@@ -25,7 +22,7 @@ import org.hibernate.snowflake.SnowflakeId;
...
@@ -25,7 +22,7 @@ import org.hibernate.snowflake.SnowflakeId;
@Getter
@Getter
@Setter
@Setter
@ToString
@ToString
@
Builder
@
SuperBuilder
(
toBuilder
=
true
)
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldNameConstants
...
@@ -33,29 +30,17 @@ import org.hibernate.snowflake.SnowflakeId;
...
@@ -33,29 +30,17 @@ import org.hibernate.snowflake.SnowflakeId;
@Entity
@Entity
@Comment
(
"系统岗位"
)
@Comment
(
"系统岗位"
)
@Table
(
name
=
"SYS_POST"
)
@Table
(
name
=
"SYS_POST"
)
public
class
Post
implements
Serializable
{
public
class
Post
extends
BasicEntity
implements
Serializable
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
3744892781714515997L
;
private
static
final
long
serialVersionUID
=
3744892781714515997L
;
@Comment
(
"主键"
)
@Id
@GeneratedValue
(
generator
=
SnowflakeId
.
GENERATOR
)
@GenericGenerator
(
name
=
SnowflakeId
.
GENERATOR
,
strategy
=
SnowflakeId
.
Strategy
.
LONG
)
Long
id
;
@Comment
(
"名称"
)
@Comment
(
"名称"
)
String
name
;
String
name
;
@Comment
(
"描述"
)
@Comment
(
"描述"
)
String
describe
;
String
describe
;
@Comment
(
"创建时间"
)
LocalDateTime
createTime
;
@Comment
(
"更新时间"
)
LocalDateTime
updateTime
;
@Comment
(
"是否启用"
)
@Comment
(
"是否启用"
)
Boolean
enable
;
Boolean
enable
;
}
}
basic-auth/src/main/java/com/yiring/auth/util/ZyUtil.java
deleted
100644 → 0
浏览文件 @
7058ff2c
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
util
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.extra.spring.SpringUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.data.redis.core.RedisTemplate
;
/**
* 真源授权工具
* @author LJ-2204
* @date 2022/4/15
*/
@UtilityClass
public
class
ZyUtil
{
RedisTemplate
<
String
,
Object
>
redisTemplate
;
static
{
redisTemplate
=
SpringUtil
.
getBean
(
"redisTemplate"
);
}
public
final
String
CLIENT_ID
=
"sc21080400"
;
public
final
String
CLIENT_SECRET
=
"12A14FDC"
;
public
final
String
GRANT_TYPE
=
"client_credentials"
;
public
final
String
KEY
=
"zy_token"
;
/**
* 获取token
* @return token
*/
public
static
String
login
()
{
Object
obj
=
redisTemplate
.
opsForValue
().
get
(
KEY
);
if
(
ObjectUtil
.
isNotEmpty
(
obj
))
{
return
String
.
valueOf
(
obj
);
}
Map
<
String
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
map
.
put
(
"client_id"
,
CLIENT_ID
);
map
.
put
(
"client_secret"
,
CLIENT_SECRET
);
map
.
put
(
"grant_type"
,
GRANT_TYPE
);
String
json
=
HttpUtil
.
get
(
"http://project.yz-online.com:789/positionApi/oauth/token"
,
map
);
Map
result
=
JSON
.
parseObject
(
json
,
Map
.
class
);
String
access_token
=
result
.
get
(
"access_token"
).
toString
();
String
expires_in
=
result
.
get
(
"expires_in"
).
toString
();
redisTemplate
.
opsForValue
().
set
(
KEY
,
access_token
,
Convert
.
toInt
(
expires_in
),
TimeUnit
.
SECONDS
);
return
access_token
;
}
/**
* 判断token是否有效
* @return T/F
*/
public
static
boolean
getToken
()
{
return
ObjectUtil
.
isNotEmpty
(
redisTemplate
.
opsForValue
().
get
(
KEY
));
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论