Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
89b9a7cb
提交
89b9a7cb
authored
5月 10, 2022
作者:
17607474349
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:
1、修复提示信息 2、分配标签 3、按键报警数据
上级
eeab7460
隐藏空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
910 行增加
和
98 行删除
+910
-98
KeyAlarm.java
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
+42
-1
KeyAlarmRepository.java
...in/java/com/yiring/app/domain/key/KeyAlarmRepository.java
+16
-0
LocationBeacon.java
...n/java/com/yiring/app/domain/location/LocationBeacon.java
+0
-3
DepartmentExportExcel.java
...java/com/yiring/app/excel/dept/DepartmentExportExcel.java
+4
-4
LocationBeaconExportExcel.java
.../app/excel/location/beacon/LocationBeaconExportExcel.java
+13
-1
LocationTagImportExcel.java
...yiring/app/excel/location/tag/LocationTagImportExcel.java
+1
-1
PostExportExcel.java
.../main/java/com/yiring/app/excel/post/PostExportExcel.java
+4
-4
UserExportExcel.java
.../main/java/com/yiring/app/excel/user/UserExportExcel.java
+4
-4
UserSendCardExcel.java
...ain/java/com/yiring/app/excel/user/UserSendCardExcel.java
+38
-0
UserClient.java
...rc/main/java/com/yiring/app/feign/zy/user/UserClient.java
+3
-3
BroadcastAudioFindParam.java
...m/yiring/app/param/broadcast/BroadcastAudioFindParam.java
+1
-1
DepartmentModifyParam.java
...java/com/yiring/app/param/dept/DepartmentModifyParam.java
+4
-0
KeyAlarmFindParam.java
...main/java/com/yiring/app/param/key/KeyAlarmFindParam.java
+44
-0
KeyAlarmRulesAddParam.java
.../java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
+2
-1
DepartmentServiceImpl.java
...m/yiring/app/service/dept/impl/DepartmentServiceImpl.java
+9
-7
KeyAlarmService.java
...main/java/com/yiring/app/service/key/KeyAlarmService.java
+24
-0
KeyAlarmServiceImpl.java
.../com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
+122
-0
LocationBeaconServiceImpl.java
...rvice/location/beacon/impl/LocationBeaconServiceImpl.java
+8
-3
LocationTagTypeServiceImpl.java
...service/location/tag/impl/LocationTagTypeServiceImpl.java
+2
-1
PostServiceImpl.java
...ava/com/yiring/app/service/post/impl/PostServiceImpl.java
+7
-4
UserAppService.java
...main/java/com/yiring/app/service/user/UserAppService.java
+10
-3
UserAppServiceImpl.java
.../com/yiring/app/service/user/impl/UserAppServiceImpl.java
+99
-22
VideoServiceImpl.java
...a/com/yiring/app/service/video/impl/VideoServiceImpl.java
+2
-2
KeyAlarmRulesVo.java
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
+3
-2
KeyAlarmVo.java
app/src/main/java/com/yiring/app/vo/key/KeyAlarmVo.java
+70
-0
LocationBeaconVo.java
...a/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
+5
-0
BroadcastAudioController.java
...om/yiring/app/web/broadcast/BroadcastAudioController.java
+4
-0
KeyAlarmController.java
.../main/java/com/yiring/app/web/key/KeyAlarmController.java
+41
-0
MapController.java
app/src/main/java/com/yiring/app/web/map/MapController.java
+2
-0
UserAppController.java
.../main/java/com/yiring/app/web/user/UserAppController.java
+10
-4
UserFindParam.java
...c/main/java/com/yiring/auth/param/user/UserFindParam.java
+37
-0
UserSaveParam.java
...c/main/java/com/yiring/auth/param/user/UserSaveParam.java
+106
-0
UserService.java
...c/main/java/com/yiring/auth/service/user/UserService.java
+32
-0
UserServiceImpl.java
...va/com/yiring/auth/service/user/impl/UserServiceImpl.java
+90
-0
UserVo.java
basic-auth/src/main/java/com/yiring/auth/vo/user/UserVo.java
+35
-22
UserController.java
...rc/main/java/com/yiring/auth/web/user/UserController.java
+16
-5
没有找到文件。
app/src/main/java/com/yiring/app/domain/key/KeyAlarm.java
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
package
com
.
yiring
.
app
.
domain
.
key
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.domain.BasicEntity
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldNameConstants
;
import
org.hibernate.annotations.Comment
;
/**
/**
*
*
*
*
...
@@ -8,4 +22,31 @@ package com.yiring.app.domain.key;
...
@@ -8,4 +22,31 @@ package com.yiring.app.domain.key;
* @date 2022/5/6
* @date 2022/5/6
*/
*/
public
class
KeyAlarm
{}
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Entity
@Table
(
name
=
"BS_KEY_ALARM"
)
@Comment
(
"按键报警规则"
)
public
class
KeyAlarm
extends
BasicEntity
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
6050505164664867107L
;
@Comment
(
"地图 ID"
)
Long
areaId
;
@ManyToOne
@JoinColumn
(
name
=
"leader_id"
)
@JsonIgnore
@Comment
(
"负责人"
)
User
leader
;
@Comment
(
"报警状态"
)
Boolean
enable
;
}
app/src/main/java/com/yiring/app/domain/key/KeyAlarmRepository.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
key
;
import
java.io.Serializable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
/**
*
* @author LJ-2204
* @date 2022/5/6
*/
@Repository
public
interface
KeyAlarmRepository
extends
JpaRepository
<
KeyAlarm
,
Serializable
>,
JpaSpecificationExecutor
<
KeyAlarm
>
{}
app/src/main/java/com/yiring/app/domain/location/LocationBeacon.java
浏览文件 @
89b9a7cb
...
@@ -17,7 +17,6 @@ import lombok.experimental.FieldNameConstants;
...
@@ -17,7 +17,6 @@ import lombok.experimental.FieldNameConstants;
import
lombok.experimental.SuperBuilder
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.Hibernate
;
import
org.hibernate.Hibernate
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Type
;
import
org.locationtech.jts.geom.Point
;
import
org.locationtech.jts.geom.Point
;
/**
/**
...
@@ -83,8 +82,6 @@ public class LocationBeacon extends BasicEntity implements Serializable {
...
@@ -83,8 +82,6 @@ public class LocationBeacon extends BasicEntity implements Serializable {
Double
distance
;
Double
distance
;
@Comment
(
"坐标点信息"
)
@Comment
(
"坐标点信息"
)
@Type
(
type
=
"jts_geometry"
)
@Column
(
columnDefinition
=
"point"
)
Point
point
;
Point
point
;
@FieldMapping
@FieldMapping
...
...
app/src/main/java/com/yiring/app/excel/dept/DepartmentExportExcel.java
浏览文件 @
89b9a7cb
...
@@ -34,21 +34,21 @@ public class DepartmentExportExcel implements Serializable {
...
@@ -34,21 +34,21 @@ public class DepartmentExportExcel implements Serializable {
@ExcelColumn
(
title
=
"负责人"
)
@ExcelColumn
(
title
=
"负责人"
)
String
realName
;
String
realName
;
@ExcelColumn
(
title
=
"手机号"
)
@ExcelColumn
(
title
=
"手机号
码
"
)
String
mobile
;
String
mobile
;
@ExcelColumn
(
title
=
"
是否启用
"
)
@ExcelColumn
(
title
=
"
状态
"
)
String
enable
;
String
enable
;
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
public
static
DepartmentExportExcel
transform
(
Department
department
)
{
DepartmentExportExcel
departmentExportExcel
=
DepartmentExportExcel
DepartmentExportExcel
departmentExportExcel
=
DepartmentExportExcel
.
builder
()
.
builder
()
.
name
(
department
.
getName
())
.
name
(
department
.
getName
())
.
mobile
(
department
.
getLeader
().
getMobile
())
.
enable
(
ObjectUtil
.
equals
(
department
.
getEnable
(),
true
)
?
"启用"
:
"禁用"
)
.
enable
(
department
.
getEnable
()
?
"启用"
:
"禁用"
)
.
build
();
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
departmentExportExcel
.
setRealName
(
department
.
getLeader
().
getRealName
());
departmentExportExcel
.
setRealName
(
department
.
getLeader
().
getRealName
());
departmentExportExcel
.
setMobile
(
department
.
getLeader
().
getMobile
());
}
}
return
departmentExportExcel
;
return
departmentExportExcel
;
...
...
app/src/main/java/com/yiring/app/excel/location/beacon/LocationBeaconExportExcel.java
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
location
.
beacon
;
package
com
.
yiring
.
app
.
excel
.
location
.
beacon
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.yiring.app.domain.location.LocationBeacon
;
import
com.yiring.app.domain.location.LocationBeacon
;
...
@@ -30,7 +31,18 @@ public class LocationBeaconExportExcel implements Serializable {
...
@@ -30,7 +31,18 @@ public class LocationBeaconExportExcel implements Serializable {
@ExcelColumn
(
title
=
"编号"
)
@ExcelColumn
(
title
=
"编号"
)
String
code
;
String
code
;
@ExcelColumn
(
title
=
"最后更新时间"
)
String
time
;
@ExcelColumn
(
title
=
"图层"
)
Long
areaId
;
public
static
LocationBeaconExportExcel
transform
(
LocationBeacon
locationBeacon
)
{
public
static
LocationBeaconExportExcel
transform
(
LocationBeacon
locationBeacon
)
{
return
LocationBeaconExportExcel
.
builder
().
code
(
locationBeacon
.
getCode
()).
build
();
return
LocationBeaconExportExcel
.
builder
()
.
code
(
locationBeacon
.
getCode
())
.
time
(
LocalDateTimeUtil
.
format
(
locationBeacon
.
getTime
(),
"yyyy-MM-dd HH:mm:ss"
))
.
areaId
(
locationBeacon
.
getAreaId
())
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/excel/location/tag/LocationTagImportExcel.java
浏览文件 @
89b9a7cb
...
@@ -30,7 +30,7 @@ public class LocationTagImportExcel implements Serializable {
...
@@ -30,7 +30,7 @@ public class LocationTagImportExcel implements Serializable {
String
code
;
String
code
;
// 标签型号
// 标签型号
@ExcelColumn
(
title
=
"标签
型号
"
)
@ExcelColumn
(
title
=
"标签
类型
"
)
String
type
;
String
type
;
// 设备编码
// 设备编码
...
...
basic-auth/src/main/java/com/yiring/auth/excel/post/Pos
tExcel.java
→
app/src/main/java/com/yiring/app/excel/post/PostExpor
tExcel.java
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
a
uth
.
excel
.
post
;
package
com
.
yiring
.
a
pp
.
excel
.
post
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
...
@@ -20,7 +20,7 @@ import lombok.experimental.FieldDefaults;
...
@@ -20,7 +20,7 @@ import lombok.experimental.FieldDefaults;
@Data
@Data
@Builder
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostExcel
{
public
class
PostEx
portEx
cel
{
/*@ExcelColumn(title = "编号")
/*@ExcelColumn(title = "编号")
@JsonSerialize(using = ToStringSerializer.class)
@JsonSerialize(using = ToStringSerializer.class)
...
@@ -38,8 +38,8 @@ public class PostExcel {
...
@@ -38,8 +38,8 @@ public class PostExcel {
@ExcelColumn
(
title
=
"创建时间"
)
@ExcelColumn
(
title
=
"创建时间"
)
String
createTime
;
String
createTime
;
public
static
PostExcel
transform
(
Post
post
)
{
public
static
PostEx
portEx
cel
transform
(
Post
post
)
{
return
PostExcel
return
PostEx
portEx
cel
.
builder
()
.
builder
()
.
name
(
post
.
getName
())
.
name
(
post
.
getName
())
.
describe
(
post
.
getDescribe
())
.
describe
(
post
.
getDescribe
())
...
...
app/src/main/java/com/yiring/app/excel/user/UserExportExcel.java
浏览文件 @
89b9a7cb
...
@@ -25,7 +25,7 @@ public class UserExportExcel implements Serializable {
...
@@ -25,7 +25,7 @@ public class UserExportExcel implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
7104402721241163991L
;
private
static
final
long
serialVersionUID
=
7104402721241163991L
;
@ExcelColumn
(
title
=
"
真实
姓名"
)
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
String
realName
;
@ExcelColumn
(
title
=
"工号"
)
@ExcelColumn
(
title
=
"工号"
)
...
@@ -35,7 +35,7 @@ public class UserExportExcel implements Serializable {
...
@@ -35,7 +35,7 @@ public class UserExportExcel implements Serializable {
String
type
;
String
type
;
// 手机号
// 手机号
@ExcelColumn
(
title
=
"手机号"
)
@ExcelColumn
(
title
=
"手机号
码
"
)
String
mobile
;
String
mobile
;
// 部门id
// 部门id
...
@@ -47,7 +47,7 @@ public class UserExportExcel implements Serializable {
...
@@ -47,7 +47,7 @@ public class UserExportExcel implements Serializable {
String
postName
;
String
postName
;
// 标签号
// 标签号
@ExcelColumn
(
title
=
"标签号"
)
@ExcelColumn
(
title
=
"标签
编
号"
)
String
code
;
String
code
;
// 性别
// 性别
...
@@ -55,7 +55,7 @@ public class UserExportExcel implements Serializable {
...
@@ -55,7 +55,7 @@ public class UserExportExcel implements Serializable {
Boolean
gender
;
Boolean
gender
;
// 是否为特殊人员
// 是否为特殊人员
@ExcelColumn
(
title
=
"
是否为
特殊人员"
)
@ExcelColumn
(
title
=
"特殊人员"
)
Boolean
isSpecial
;
Boolean
isSpecial
;
public
static
UserExportExcel
transform
(
UserVo
userVo
)
{
public
static
UserExportExcel
transform
(
UserVo
userVo
)
{
...
...
app/src/main/java/com/yiring/app/excel/user/UserSendCardExcel.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
excel
.
user
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户批量绑卡
*
* @author LJ-2204
* @date 2022/5/9
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserSendCardExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
6094419272413042366L
;
// 姓名
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
// 工号
@ExcelColumn
(
title
=
"工号"
)
String
uuid
;
// 标签号
@ExcelColumn
(
title
=
"标签编号"
)
String
code
;
}
app/src/main/java/com/yiring/app/feign/zy/user/UserClient.java
浏览文件 @
89b9a7cb
...
@@ -23,15 +23,15 @@ public interface UserClient {
...
@@ -23,15 +23,15 @@ public interface UserClient {
@DeleteMapping
(
value
=
"/position/staff/delete/{id}"
)
@DeleteMapping
(
value
=
"/position/staff/delete/{id}"
)
JSONObject
delete
(
@PathVariable
(
"id"
)
String
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
JSONObject
delete
(
@PathVariable
(
"id"
)
String
id
,
@RequestHeader
(
"Authorization"
)
String
token
);
@GetMapping
(
value
=
"position/staff/unbind/{id}"
)
@GetMapping
(
value
=
"position/staff/unbind/{id
s
}"
)
JSONObject
unbind
(
JSONObject
unbind
(
@PathVariable
(
"id
"
)
Long
id
,
@PathVariable
(
"id
s"
)
String
ids
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestHeader
(
"Authorization"
)
String
token
@RequestHeader
(
"Authorization"
)
String
token
);
);
@GetMapping
(
value
=
"position/staff/bindTag/{id}/{code}/1"
)
@GetMapping
(
value
=
"position/staff/bindTag/{id}/{code}/1"
)
JSONObject
unbind
(
JSONObject
bindTag
(
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"code"
)
String
code
,
@PathVariable
(
"code"
)
String
code
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
@RequestParam
(
"orgId"
)
Integer
orgId
,
...
...
app/src/main/java/com/yiring/app/param/broadcast/BroadcastAudioFindParam.java
浏览文件 @
89b9a7cb
...
@@ -26,6 +26,6 @@ public class BroadcastAudioFindParam implements Serializable {
...
@@ -26,6 +26,6 @@ public class BroadcastAudioFindParam implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
7396234032011169171L
;
private
static
final
long
serialVersionUID
=
-
7396234032011169171L
;
@ApiModelProperty
(
value
=
"
备注"
,
example
=
"请输入备注信息
"
)
@ApiModelProperty
(
value
=
"
音频名称"
,
example
=
"张三爱唱歌
"
)
String
name
;
String
name
;
}
}
app/src/main/java/com/yiring/app/param/dept/DepartmentModifyParam.java
浏览文件 @
89b9a7cb
...
@@ -46,6 +46,9 @@ public class DepartmentModifyParam implements Serializable {
...
@@ -46,6 +46,9 @@ public class DepartmentModifyParam implements Serializable {
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"负责人"
,
example
=
"1"
)
Long
leaderId
;
Long
leaderId
;
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"T/F"
)
Boolean
enable
;
public
void
transform
(
DepartmentModifyParam
departmentModifyParam
,
Department
department
)
{
public
void
transform
(
DepartmentModifyParam
departmentModifyParam
,
Department
department
)
{
department
.
setPid
(
departmentModifyParam
.
getPid
());
department
.
setPid
(
departmentModifyParam
.
getPid
());
department
.
setName
(
departmentModifyParam
.
getName
());
department
.
setName
(
departmentModifyParam
.
getName
());
...
@@ -53,5 +56,6 @@ public class DepartmentModifyParam implements Serializable {
...
@@ -53,5 +56,6 @@ public class DepartmentModifyParam implements Serializable {
department
.
setLeader
(
User
.
builder
().
id
(
departmentModifyParam
.
getLeaderId
()).
build
());
department
.
setLeader
(
User
.
builder
().
id
(
departmentModifyParam
.
getLeaderId
()).
build
());
}
}
department
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
department
.
setUpdateTime
(
LocalDateTimeUtil
.
now
());
department
.
setEnable
(
departmentModifyParam
.
getEnable
());
}
}
}
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmFindParam.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
key
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"KeyAlarmFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
1011171442882543071L
;
@ApiModelProperty
(
value
=
"地图总图"
,
example
=
"1"
)
Long
areaId
;
@ApiModelProperty
(
value
=
"报警人员"
,
example
=
"张三"
)
String
name
;
@ApiModelProperty
(
value
=
"报警状态"
,
example
=
"T/F"
)
Boolean
enable
;
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
endTime
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmRulesAddParam.java
浏览文件 @
89b9a7cb
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -28,7 +29,7 @@ public class KeyAlarmRulesAddParam implements Serializable {
...
@@ -28,7 +29,7 @@ public class KeyAlarmRulesAddParam implements Serializable {
private
static
final
long
serialVersionUID
=
758462772473378637L
;
private
static
final
long
serialVersionUID
=
758462772473378637L
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"100"
,
required
=
true
)
@Not
Empty
(
message
=
"部门ID不能为空"
)
@Not
Null
(
message
=
"部门ID不能为空"
)
Long
deptId
;
Long
deptId
;
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
@ApiModelProperty
(
value
=
"用户ids"
,
example
=
"1111,2222"
,
required
=
true
)
...
...
app/src/main/java/com/yiring/app/service/dept/impl/DepartmentServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -77,7 +77,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -77,7 +77,7 @@ public class DepartmentServiceImpl implements DepartmentService {
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddParam
)
{
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddParam
)
{
// 查询用户相关信息
// 查询用户相关信息
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
departmentAddParam
.
getId
()).
build
())
Example
.
of
(
User
.
builder
().
id
(
departmentAddParam
.
get
Leader
Id
()).
build
())
);
);
Department
department
=
DepartmentAddParam
.
transform
(
departmentAddParam
);
Department
department
=
DepartmentAddParam
.
transform
(
departmentAddParam
);
userOptional
.
ifPresent
(
department:
:
setLeader
);
userOptional
.
ifPresent
(
department:
:
setLeader
);
...
@@ -101,7 +101,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -101,7 +101,7 @@ public class DepartmentServiceImpl implements DepartmentService {
ZyUtil
.
clientLogin
()
ZyUtil
.
clientLogin
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
ZyDepartmentFindParam
zyDepartmentFindParam
=
ZyDepartmentFindParam
ZyDepartmentFindParam
zyDepartmentFindParam
=
ZyDepartmentFindParam
...
@@ -205,7 +205,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -205,7 +205,7 @@ public class DepartmentServiceImpl implements DepartmentService {
JSONObject
jsonObject
=
departmentClient
.
deptDelete
(
departmentOptional
.
get
().
getLinkId
(),
ZyUtil
.
clientLogin
());
JSONObject
jsonObject
=
departmentClient
.
deptDelete
(
departmentOptional
.
get
().
getLinkId
(),
ZyUtil
.
clientLogin
());
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
departmentRepository
.
deleteById
(
idParam
.
getId
());
departmentRepository
.
deleteById
(
idParam
.
getId
());
return
Result
.
ok
();
return
Result
.
ok
();
...
@@ -250,6 +250,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -250,6 +250,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
Result
.
no
(
Status
.
BAD_REQUEST
);
return
Result
.
no
(
Status
.
BAD_REQUEST
);
}
}
Department
department
=
departmentOptional
.
get
();
departmentModifyParam
.
transform
(
departmentModifyParam
,
department
);
Long
linkId
=
pidDeptOptional
.
get
().
getLinkId
();
Long
linkId
=
pidDeptOptional
.
get
().
getLinkId
();
ZyDepartmentModifyParam
zyDepartmentModifyParam
=
ZyDepartmentModifyParam
.
transform
(
ZyDepartmentModifyParam
zyDepartmentModifyParam
=
ZyDepartmentModifyParam
.
transform
(
...
@@ -263,11 +266,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -263,11 +266,9 @@ public class DepartmentServiceImpl implements DepartmentService {
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
Department
department
=
departmentOptional
.
get
();
departmentModifyParam
.
transform
(
departmentModifyParam
,
department
);
departmentRepository
.
save
(
department
);
departmentRepository
.
save
(
department
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -285,7 +286,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -285,7 +286,7 @@ public class DepartmentServiceImpl implements DepartmentService {
.
read
(
inputStream
);
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"文件导入异常"
);
}
}
// 拿到所有部门
// 拿到所有部门
...
@@ -363,6 +364,7 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -363,6 +364,7 @@ public class DepartmentServiceImpl implements DepartmentService {
return
departmentVos
return
departmentVos
.
stream
()
.
stream
()
.
filter
(
departmentVo
->
pid
.
equals
(
departmentVo
.
getPid
()))
.
filter
(
departmentVo
->
pid
.
equals
(
departmentVo
.
getPid
()))
.
sorted
(
Comparator
.
comparing
(
DepartmentVo:
:
getCreateTime
).
reversed
())
.
peek
(
departmentVo
->
{
.
peek
(
departmentVo
->
{
departmentVo
.
setPName
(
pName
);
departmentVo
.
setPName
(
pName
);
departmentVo
.
setChildList
(
getChildrenList
(
departmentVo
.
getId
(),
departmentVo
.
getName
(),
departmentVos
));
departmentVo
.
setChildList
(
getChildrenList
(
departmentVo
.
getId
(),
departmentVo
.
getName
(),
departmentVos
));
...
...
app/src/main/java/com/yiring/app/service/key/KeyAlarmService.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/10
*/
public
interface
KeyAlarmService
{
/**
* 表格查询
* @param param KeyAlarmFindParam
* @param pageParam PageParam
* @return Result<PageVo<KeyAlarmVo>>
*/
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
);
}
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
key
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.app.domain.key.KeyAlarm
;
import
com.yiring.app.domain.key.KeyAlarmRepository
;
import
com.yiring.app.domain.key.KeyAlarmRules
;
import
com.yiring.app.domain.key.KeyAlarmRulesRepository
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.service.key.KeyAlarmService
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
KeyAlarmServiceImpl
implements
KeyAlarmService
{
@Resource
KeyAlarmRepository
keyAlarmRepository
;
@Resource
KeyAlarmRulesRepository
keyAlarmRulesRepository
;
@Override
public
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
)
{
Specification
<
KeyAlarm
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getAreaId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
areaId
),
param
.
getAreaId
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
KeyAlarm
.
Fields
.
leader
).
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getName
()
+
"%"
)
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
enable
),
param
.
getEnable
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getCreateTime
()))
{
predicates
.
add
(
cb
.
lessThan
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
),
param
.
getCreateTime
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEndTime
()))
{
predicates
.
add
(
cb
.
greaterThan
(
root
.
get
(
BasicEntity
.
Fields
.
updateTime
),
param
.
getEndTime
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
KeyAlarm
>
keyAlarms
=
keyAlarmRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmVo
>
keyAlarmVos
=
keyAlarms
.
getContent
()
.
stream
()
.
map
(
keyAlarm
->
{
KeyAlarmVo
keyAlarmVo
=
KeyAlarmVo
.
transform
(
keyAlarm
);
User
leader
=
keyAlarm
.
getLeader
();
if
(
ObjectUtil
.
isNotEmpty
(
leader
))
{
UserVo
userVo
=
UserVo
.
builder
()
.
id
(
leader
.
getId
())
.
realName
(
leader
.
getRealName
())
.
uuid
(
leader
.
getUuid
())
.
departmentId
(
leader
.
getDepartment
().
getId
())
.
build
();
keyAlarmVo
.
setUser
(
userVo
);
}
Optional
<
KeyAlarmRules
>
keyAlarmRulesOptional
=
keyAlarmRulesRepository
.
findById
(
leader
.
getDepartment
().
getId
()
);
if
(
keyAlarmRulesOptional
.
isPresent
())
{
KeyAlarmRules
keyAlarmRules
=
keyAlarmRulesOptional
.
get
();
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
List
<
String
>
names
=
users
.
stream
().
map
(
User:
:
getRealName
).
collect
(
Collectors
.
toList
());
keyAlarmVo
.
setReceiver
(
StrUtil
.
join
(
","
,
names
));
}
return
keyAlarmVo
;
})
.
collect
(
Collectors
.
toList
());
PageVo
<
KeyAlarmVo
>
pageVo
=
PageVo
.
build
(
keyAlarmVos
,
keyAlarms
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/location/beacon/impl/LocationBeaconServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -15,6 +15,7 @@ import com.yiring.app.param.location.beacon.LocationBeaconAddParam;
...
@@ -15,6 +15,7 @@ import com.yiring.app.param.location.beacon.LocationBeaconAddParam;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconExportParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.param.location.beacon.LocationBeaconFindParam
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.service.location.beacon.LocationBeaconService
;
import
com.yiring.app.util.GeoUtils
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.app.vo.location.beacon.LocationBeaconVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
...
@@ -191,8 +192,12 @@ public class LocationBeaconServiceImpl implements LocationBeaconService {
...
@@ -191,8 +192,12 @@ public class LocationBeaconServiceImpl implements LocationBeaconService {
locationBeacon
.
setTime
(
locationBeaconAddParam
.
getTime
());
locationBeacon
.
setTime
(
locationBeaconAddParam
.
getTime
());
locationBeacon
.
setVolt
(
locationBeaconAddParam
.
getVolt
());
locationBeacon
.
setVolt
(
locationBeaconAddParam
.
getVolt
());
locationBeacon
.
setVoltUnit
(
locationBeaconAddParam
.
getVoltUnit
());
locationBeacon
.
setVoltUnit
(
locationBeaconAddParam
.
getVoltUnit
());
// locationBeacon.setPoint(GeoUtils.xyzToPoint(
locationBeacon
.
setPoint
(
// locationBeaconAddParam.getPointX().doubleValue(),locationBeaconAddParam.getPointY().doubleValue(),locationBeaconAddParam.getPointZ().doubleValue()
GeoUtils
.
xyzToPoint
(
// ));
locationBeaconAddParam
.
getX
().
doubleValue
(),
locationBeaconAddParam
.
getY
().
doubleValue
(),
locationBeaconAddParam
.
getZ
().
doubleValue
()
)
);
}
}
}
}
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagTypeServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -17,6 +17,7 @@ import com.yiring.app.service.location.tag.LocationTagTypeService;
...
@@ -17,6 +17,7 @@ import com.yiring.app.service.location.tag.LocationTagTypeService;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
...
@@ -107,7 +108,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
...
@@ -107,7 +108,7 @@ public class LocationTagTypeServiceImpl implements LocationTagTypeService {
ZyUtil
.
manageLogin
()
ZyUtil
.
manageLogin
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
return
Result
.
no
(
Status
.
BAD_REQUEST
,
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
}
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
...
...
app/src/main/java/com/yiring/app/service/post/impl/PostServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.ListUtil;
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.ListUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.app.excel.post.PostExportExcel
;
import
com.yiring.app.param.post.*
;
import
com.yiring.app.param.post.*
;
import
com.yiring.app.service.post.PostService
;
import
com.yiring.app.service.post.PostService
;
import
com.yiring.app.vo.post.PostIndexVo
;
import
com.yiring.app.vo.post.PostIndexVo
;
...
@@ -12,7 +13,6 @@ import com.yiring.app.vo.post.PostInfoVo;
...
@@ -12,7 +13,6 @@ import com.yiring.app.vo.post.PostInfoVo;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.post.PostRepository
;
import
com.yiring.auth.domain.post.PostRepository
;
import
com.yiring.auth.excel.post.PostExcel
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.domain.BasicEntity
;
...
@@ -147,10 +147,13 @@ public class PostServiceImpl implements PostService {
...
@@ -147,10 +147,13 @@ public class PostServiceImpl implements PostService {
};
};
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
PostExcel
>
postExcels
=
postList
.
stream
().
map
(
PostExcel:
:
transform
).
collect
(
Collectors
.
toList
());
List
<
PostExportExcel
>
postExcels
=
postList
.
stream
()
.
map
(
PostExportExcel:
:
transform
)
.
collect
(
Collectors
.
toList
());
try
(
try
(
DefaultStreamExcelBuilder
<
PostExcel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
DefaultStreamExcelBuilder
<
PostEx
portEx
cel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
PostExcel
.
class
)
.
of
(
PostEx
portEx
cel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
titleRowHeight
(
14
)
...
...
app/src/main/java/com/yiring/app/service/user/UserService.java
→
app/src/main/java/com/yiring/app/service/user/User
App
Service.java
浏览文件 @
89b9a7cb
...
@@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/20
* @date 2022/4/20
*/
*/
public
interface
UserService
{
public
interface
User
App
Service
{
/**
/**
* 表格查询
* 表格查询
* @param userFindParam UserByNameParam
* @param userFindParam UserByNameParam
...
@@ -43,10 +43,10 @@ public interface UserService {
...
@@ -43,10 +43,10 @@ public interface UserService {
/**
/**
* 收卡
* 收卡
* @param id
Param Id
Param
* @param id
sParam Ids
Param
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
userUnBingTag
(
Id
Param
id
Param
);
Result
<
String
>
userUnBingTag
(
Id
sParam
ids
Param
);
/**
/**
* 删除用户
* 删除用户
...
@@ -103,4 +103,11 @@ public interface UserService {
...
@@ -103,4 +103,11 @@ public interface UserService {
* @return Result<PageVo<UserVo>>
* @return Result<PageVo<UserVo>>
*/
*/
Result
<
PageVo
<
UserVo
>>
findUser
(
UserFindParam
userFindParam
);
Result
<
PageVo
<
UserVo
>>
findUser
(
UserFindParam
userFindParam
);
/**
* 批量发卡
* @param file MultipartFile
* @return Result<String>
*/
Result
<
String
>
batchSendCard
(
MultipartFile
file
);
}
}
app/src/main/java/com/yiring/app/service/user/impl/UserServiceImpl.java
→
app/src/main/java/com/yiring/app/service/user/impl/User
App
ServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -14,13 +14,14 @@ import com.yiring.app.domain.location.LocationTag;
...
@@ -14,13 +14,14 @@ import com.yiring.app.domain.location.LocationTag;
import
com.yiring.app.domain.location.LocationTagRepository
;
import
com.yiring.app.domain.location.LocationTagRepository
;
import
com.yiring.app.excel.user.UserExportExcel
;
import
com.yiring.app.excel.user.UserExportExcel
;
import
com.yiring.app.excel.user.UserImportExcel
;
import
com.yiring.app.excel.user.UserImportExcel
;
import
com.yiring.app.excel.user.UserSendCardExcel
;
import
com.yiring.app.feign.zy.user.UserClient
;
import
com.yiring.app.feign.zy.user.UserClient
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.zy.user.ZyUserAddParam
;
import
com.yiring.app.param.zy.user.ZyUserAddParam
;
import
com.yiring.app.param.zy.user.ZyUserFindParam
;
import
com.yiring.app.param.zy.user.ZyUserFindParam
;
import
com.yiring.app.param.zy.user.ZyUserModifyParam
;
import
com.yiring.app.param.zy.user.ZyUserModifyParam
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.user.UserService
;
import
com.yiring.app.service.user.User
App
Service
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
...
@@ -68,7 +69,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -68,7 +69,7 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Service
@Slf4j
@Slf4j
public
class
User
ServiceImpl
implements
User
Service
{
public
class
User
AppServiceImpl
implements
UserApp
Service
{
final
Integer
FACTORY_ID
=
100
;
final
Integer
FACTORY_ID
=
100
;
...
@@ -138,11 +139,11 @@ public class UserServiceImpl implements UserService {
...
@@ -138,11 +139,11 @@ public class UserServiceImpl implements UserService {
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
}
}
JSONObject
jsonObject
=
userClient
.
unbind
(
JSONObject
jsonObject
=
userClient
.
bindTag
(
user
.
getLinkId
(),
user
.
getLinkId
(),
userBingTagParam
.
getCode
(),
userBingTagParam
.
getCode
(),
FACTORY_ID
,
FACTORY_ID
,
ZyUtil
.
client
Login
()
ZyUtil
.
manage
Login
()
);
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
...
@@ -155,29 +156,36 @@ public class UserServiceImpl implements UserService {
...
@@ -155,29 +156,36 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
String
>
userUnBingTag
(
IdParam
idParam
)
{
public
Result
<
String
>
userUnBingTag
(
IdsParam
idsParam
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
idParam
.
getId
());
String
[]
split
=
idsParam
.
getIds
().
split
(
","
);
Long
[]
ids
=
Convert
.
toLongArray
(
split
);
for
(
Long
id
:
ids
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
id
);
if
(
userOptional
.
isEmpty
())
{
if
(
userOptional
.
isEmpty
())
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"员工不存在"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"员工不存在"
);
}
}
User
user
=
userOptional
.
get
();
User
user
=
userOptional
.
get
();
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
user
(
User
.
builder
().
id
(
idParam
.
getId
()
).
build
()).
build
())
Example
.
of
(
LocationTag
.
builder
().
user
(
User
.
builder
().
id
(
id
).
build
()).
build
())
);
);
if
(
locationTagOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
if
(
locationTagOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
JSONObject
jsonObject
=
userClient
.
unbind
(
user
.
getLinkId
(),
FACTORY_ID
,
ZyUtil
.
clientLogin
());
JSONObject
jsonObject
=
userClient
.
unbind
(
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
Convert
.
toStr
(
user
.
getLinkId
()),
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
FACTORY_ID
,
ZyUtil
.
clientLogin
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
LocationTag
locationTag
=
locationTagOptional
.
get
();
locationTag
.
setUser
(
null
);
locationTag
.
setUsed
(
false
);
locationTagRepository
.
save
(
locationTag
);
}
}
LocationTag
locationTag
=
locationTagOptional
.
get
();
locationTag
.
setUser
(
null
);
locationTag
.
setUsed
(
false
);
locationTagRepository
.
save
(
locationTag
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -578,6 +586,75 @@ public class UserServiceImpl implements UserService {
...
@@ -578,6 +586,75 @@ public class UserServiceImpl implements UserService {
return
Result
.
ok
(
pageVo
);
return
Result
.
ok
(
pageVo
);
}
}
@Override
public
Result
<
String
>
batchSendCard
(
MultipartFile
file
)
{
if
(
file
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"请选择文件"
);
List
<
UserSendCardExcel
>
userSendCardExcels
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
userSendCardExcels
=
SaxExcelReader
.
of
(
UserSendCardExcel
.
class
)
.
rowFilter
(
row
->
row
.
getRowNum
()
>
0
)
.
ignoreBlankRow
()
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
}
userSendCardExcels
=
userSendCardExcels
.
stream
()
.
filter
(
userSendCardExcel
->
userRepository
.
count
(
Example
.
of
(
User
.
builder
()
.
realName
(
userSendCardExcel
.
getRealName
())
.
uuid
(
userSendCardExcel
.
getUuid
())
.
build
()
)
)
>
0
)
.
filter
(
userSendCardExcel
->
locationTagRepository
.
count
(
Example
.
of
(
LocationTag
.
builder
().
user
(
null
).
used
(
false
).
build
()))
>
0
)
.
collect
(
Collectors
.
toList
());
userSendCardExcels
.
forEach
(
userSendCardExcel
->
{
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
realName
(
userSendCardExcel
.
getRealName
()).
uuid
(
userSendCardExcel
.
getUuid
()).
build
()
)
);
if
(
userOptional
.
isPresent
())
{
User
user
=
userOptional
.
get
();
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
code
(
userSendCardExcel
.
getCode
()).
build
())
);
if
(
locationTagOptional
.
isPresent
())
{
LocationTag
locationTag
=
locationTagOptional
.
get
();
JSONObject
jsonObject
=
userClient
.
bindTag
(
user
.
getLinkId
(),
locationTag
.
getCode
(),
FACTORY_ID
,
ZyUtil
.
clientLogin
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
}
locationTag
.
setUser
(
User
.
builder
().
id
(
user
.
getId
()).
build
());
locationTag
.
setUsed
(
true
);
locationTagRepository
.
save
(
locationTag
);
}
}
});
return
Result
.
ok
();
}
@NotNull
@NotNull
private
CriteriaQuery
<
UserVo
>
getUserVoCriteriaQuery
(
UserFindParam
param
)
{
private
CriteriaQuery
<
UserVo
>
getUserVoCriteriaQuery
(
UserFindParam
param
)
{
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
app/src/main/java/com/yiring/app/service/video/impl/VideoServiceImpl.java
浏览文件 @
89b9a7cb
...
@@ -295,7 +295,7 @@ public class VideoServiceImpl implements VideoService {
...
@@ -295,7 +295,7 @@ public class VideoServiceImpl implements VideoService {
@Override
@Override
public
Result
<
String
>
importVideo
(
MultipartFile
file
)
{
public
Result
<
String
>
importVideo
(
MultipartFile
file
)
{
if
(
file
.
isEmpty
())
{
if
(
file
.
isEmpty
())
{
throw
new
RuntimeException
(
"请选择文件"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"请选择文件"
);
}
}
List
<
VideoImportExcel
>
videoImportExcels
;
List
<
VideoImportExcel
>
videoImportExcels
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
...
@@ -307,7 +307,7 @@ public class VideoServiceImpl implements VideoService {
...
@@ -307,7 +307,7 @@ public class VideoServiceImpl implements VideoService {
.
read
(
inputStream
);
.
read
(
inputStream
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
info
(
e
.
getMessage
());
log
.
info
(
e
.
getMessage
());
throw
new
RuntimeException
(
"文件导入异常"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"文件导入异常"
);
}
}
List
<
Video
>
videos
=
videoImportExcels
List
<
Video
>
videos
=
videoImportExcels
...
...
app/src/main/java/com/yiring/app/vo/key/KeyAlarmRulesVo.java
浏览文件 @
89b9a7cb
...
@@ -38,6 +38,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -38,6 +38,7 @@ public class KeyAlarmRulesVo implements Serializable {
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
Long
id
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"111"
)
Long
deptId
;
Long
deptId
;
...
@@ -48,7 +49,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -48,7 +49,7 @@ public class KeyAlarmRulesVo implements Serializable {
List
<
UserInfoVo
>
users
;
List
<
UserInfoVo
>
users
;
@ApiModelProperty
(
value
=
"推送类型"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"推送类型"
,
example
=
"111"
)
String
types
;
String
[]
types
;
public
static
KeyAlarmRulesVo
transform
(
KeyAlarmRules
keyAlarmRules
)
{
public
static
KeyAlarmRulesVo
transform
(
KeyAlarmRules
keyAlarmRules
)
{
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
Set
<
User
>
users
=
keyAlarmRules
.
getUsers
();
...
@@ -60,7 +61,7 @@ public class KeyAlarmRulesVo implements Serializable {
...
@@ -60,7 +61,7 @@ public class KeyAlarmRulesVo implements Serializable {
.
deptId
(
keyAlarmRules
.
getDepartment
().
getId
())
.
deptId
(
keyAlarmRules
.
getDepartment
().
getId
())
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
deptName
(
keyAlarmRules
.
getDepartment
().
getName
())
.
users
(
userInfoVos
)
.
users
(
userInfoVos
)
.
types
(
keyAlarmRules
.
getTypes
())
.
types
(
keyAlarmRules
.
getTypes
()
.
split
(
","
)
)
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/vo/key/KeyAlarmVo.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
key
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.key.KeyAlarm
;
import
com.yiring.app.vo.user.UserVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"KeyAlarmVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
KeyAlarmVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
4534979609749122415L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
@ApiModelProperty
(
value
=
"地图 ID"
,
example
=
"1"
)
Long
areaId
;
@ApiModelProperty
(
value
=
"用户"
,
example
=
"111"
)
UserVo
user
;
@ApiModelProperty
(
value
=
"报警时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2022-11-11 22:22:22"
)
LocalDateTime
endTime
;
@ApiModelProperty
(
value
=
"报警类型"
,
example
=
"按键报警"
)
String
type
;
@ApiModelProperty
(
value
=
"报警接收人"
,
example
=
"张三、李四"
)
String
receiver
;
@ApiModelProperty
(
value
=
"报警状态"
,
example
=
"T/F"
)
Boolean
enable
;
public
static
KeyAlarmVo
transform
(
KeyAlarm
keyAlarm
)
{
return
KeyAlarmVo
.
builder
()
.
id
(
keyAlarm
.
getId
())
.
areaId
(
keyAlarm
.
getAreaId
())
.
createTime
(
keyAlarm
.
getCreateTime
())
.
endTime
(
keyAlarm
.
getUpdateTime
())
.
type
(
"按键报警"
)
.
enable
(
keyAlarm
.
getEnable
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/beacon/LocationBeaconVo.java
浏览文件 @
89b9a7cb
...
@@ -11,6 +11,7 @@ import java.io.Serializable;
...
@@ -11,6 +11,7 @@ import java.io.Serializable;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
import
org.locationtech.jts.geom.Point
;
/**
/**
* 定位信标模型
* 定位信标模型
...
@@ -40,6 +41,9 @@ public class LocationBeaconVo implements Serializable {
...
@@ -40,6 +41,9 @@ public class LocationBeaconVo implements Serializable {
@ApiModelProperty
(
value
=
"最后一次在线时间"
,
example
=
"BTI88888888"
)
@ApiModelProperty
(
value
=
"最后一次在线时间"
,
example
=
"BTI88888888"
)
LocalDateTime
time
;
LocalDateTime
time
;
@ApiModelProperty
(
value
=
"坐标"
,
example
=
"01010000805C8FC2F528D4734033333333335B7D400000000000000000"
)
Point
point
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"所属地图"
,
example
=
"1:总图2:一层3:二层"
)
@ApiModelProperty
(
value
=
"所属地图"
,
example
=
"1:总图2:一层3:二层"
)
Long
areaId
;
Long
areaId
;
...
@@ -50,6 +54,7 @@ public class LocationBeaconVo implements Serializable {
...
@@ -50,6 +54,7 @@ public class LocationBeaconVo implements Serializable {
.
id
(
locationBeacon
.
getId
())
.
id
(
locationBeacon
.
getId
())
.
code
(
locationBeacon
.
getCode
())
.
code
(
locationBeacon
.
getCode
())
.
time
(
locationBeacon
.
getTime
())
.
time
(
locationBeacon
.
getTime
())
.
point
(
locationBeacon
.
getPoint
())
.
areaId
(
locationBeacon
.
getAreaId
())
.
areaId
(
locationBeacon
.
getAreaId
())
.
build
();
.
build
();
}
}
...
...
app/src/main/java/com/yiring/app/web/broadcast/BroadcastAudioController.java
浏览文件 @
89b9a7cb
...
@@ -66,4 +66,8 @@ public class BroadcastAudioController {
...
@@ -66,4 +66,8 @@ public class BroadcastAudioController {
public
Result
<
PageVo
<
BroadcastAudioIndexVo
>>
index
(
IndexParam
indexParam
)
{
public
Result
<
PageVo
<
BroadcastAudioIndexVo
>>
index
(
IndexParam
indexParam
)
{
return
broadcastAudioService
.
index
(
indexParam
);
return
broadcastAudioService
.
index
(
indexParam
);
}
}
@ApiOperation
(
"批量下载"
)
@GetMapping
(
"download"
)
public
void
download
()
{}
}
}
app/src/main/java/com/yiring/app/web/key/KeyAlarmController.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
key
;
import
com.yiring.app.param.key.KeyAlarmFindParam
;
import
com.yiring.app.service.key.KeyAlarmService
;
import
com.yiring.app.vo.key.KeyAlarmVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 按键报警
*
* @author LJ-2204
* @date 2022/5/10
*/
@Slf4j
@Validated
@Api
(
tags
=
"按键报警"
)
@RestController
@RequestMapping
(
"/key/alarm"
)
public
class
KeyAlarmController
{
@Resource
KeyAlarmService
keyAlarmService
;
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"page"
)
public
Result
<
PageVo
<
KeyAlarmVo
>>
page
(
KeyAlarmFindParam
param
,
PageParam
pageParam
)
{
return
keyAlarmService
.
page
(
param
,
pageParam
);
}
}
app/src/main/java/com/yiring/app/web/map/MapController.java
浏览文件 @
89b9a7cb
...
@@ -6,11 +6,13 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -6,11 +6,13 @@ 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.util.zy.ZyUtil
;
import
com.yiring.app.util.zy.ZyUtil
;
import
com.yiring.app.vo.map.MapVo
;
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
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
app/src/main/java/com/yiring/app/web/user/UserAppController.java
浏览文件 @
89b9a7cb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
package
com
.
yiring
.
app
.
web
.
user
;
package
com
.
yiring
.
app
.
web
.
user
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.service.user.UserService
;
import
com.yiring.app.service.user.User
App
Service
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.IdsParam
;
...
@@ -37,7 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -37,7 +37,7 @@ import org.springframework.web.multipart.MultipartFile;
public
class
UserAppController
{
public
class
UserAppController
{
@Resource
@Resource
UserService
userService
;
User
App
Service
userService
;
@ApiOperation
(
"表格查询"
)
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"findUserPage"
)
@GetMapping
(
"findUserPage"
)
...
@@ -59,8 +59,8 @@ public class UserAppController {
...
@@ -59,8 +59,8 @@ public class UserAppController {
@ApiOperation
(
"收卡"
)
@ApiOperation
(
"收卡"
)
@PutMapping
(
"userUnBingTag"
)
@PutMapping
(
"userUnBingTag"
)
public
Result
<
String
>
userUnBingTag
(
@Valid
Id
Param
id
Param
)
{
public
Result
<
String
>
userUnBingTag
(
@Valid
Id
sParam
ids
Param
)
{
return
userService
.
userUnBingTag
(
idParam
);
return
userService
.
userUnBingTag
(
id
s
Param
);
}
}
@ApiOperation
(
"逻辑删除用户"
)
@ApiOperation
(
"逻辑删除用户"
)
...
@@ -110,4 +110,10 @@ public class UserAppController {
...
@@ -110,4 +110,10 @@ public class UserAppController {
public
Result
<
PageVo
<
UserVo
>>
findUser
(
@Valid
UserFindParam
userFindParam
)
{
public
Result
<
PageVo
<
UserVo
>>
findUser
(
@Valid
UserFindParam
userFindParam
)
{
return
userService
.
findUser
(
userFindParam
);
return
userService
.
findUser
(
userFindParam
);
}
}
@ApiOperation
(
"批量发卡"
)
@PutMapping
(
"batchSendCard"
)
public
Result
<
String
>
batchSendCard
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
return
userService
.
batchSendCard
(
file
);
}
}
}
basic-auth/src/main/java/com/yiring/auth/param/user/UserFindParam.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
param
.
user
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户查询
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"UserFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
708988930160146138L
;
@ApiModelProperty
(
value
=
"姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"部门ID"
,
example
=
"100"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"角色ID"
,
example
=
"100"
)
String
roles
;
}
basic-auth/src/main/java/com/yiring/auth/param/user/UserSaveParam.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
param
.
user
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.post.Post
;
import
com.yiring.auth.domain.role.Role
;
import
com.yiring.auth.domain.user.User
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.HashSet
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户新增参数
*
* @author LJ-2204
* @date 2022/5/10
*/
@ApiModel
(
"UserAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserSaveParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
2256725474621511610L
;
@ApiModelProperty
(
value
=
"用户昵称"
,
example
=
"张三"
,
required
=
true
)
@NotEmpty
(
message
=
"用户昵称不能为空"
)
String
realName
;
@ApiModelProperty
(
value
=
"手机号码"
,
example
=
"1888888888"
)
String
mobile
;
@ApiModelProperty
(
value
=
"用户名称"
,
example
=
"admin"
,
required
=
true
)
@NotEmpty
(
message
=
"用户名称不能为空"
)
String
username
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"0/1"
)
Boolean
gender
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"100"
)
Long
postId
;
@ApiModelProperty
(
value
=
"归属部门"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"归属部门不能为空"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"zhansan@163.com"
)
String
email
;
@ApiModelProperty
(
value
=
"用户密码"
,
example
=
"*******"
,
required
=
true
)
@NotEmpty
(
message
=
"用户密码不能为空"
)
String
password
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"0/1"
)
Boolean
enabled
;
@ApiModelProperty
(
value
=
"角色id"
,
example
=
"1,2,3"
,
required
=
true
)
@NotEmpty
(
message
=
"角色id不能为空"
)
String
roles
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"请输入备注"
)
String
introduction
;
public
static
User
transform
(
UserSaveParam
param
)
{
User
user
=
User
.
builder
()
.
realName
(
param
.
getRealName
())
.
mobile
(
param
.
getMobile
())
.
username
(
param
.
getUsername
())
.
gender
(
param
.
getGender
())
.
department
(
Department
.
builder
().
id
(
param
.
getDeptId
()).
build
())
.
email
(
param
.
getEmail
())
.
password
(
param
.
getPassword
())
.
enabled
(
param
.
getEnabled
())
.
introduction
(
param
.
getIntroduction
())
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getPostId
()))
{
user
.
setPost
(
Post
.
builder
().
id
(
param
.
getPostId
()).
build
());
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
HashSet
<
Role
>
hashSet
=
new
HashSet
<>();
for
(
Long
role
:
roles
)
{
hashSet
.
add
(
Role
.
builder
().
id
(
role
).
build
());
}
user
.
setRoles
(
hashSet
);
}
return
user
;
}
}
basic-auth/src/main/java/com/yiring/auth/service/user/UserService.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.vo.user.UserVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 用户
*
* @author LJ-2204
* @date 2022/5/10
*/
public
interface
UserService
{
/**
* 添加系统用户
* @param param UserSaveParam
* @return Result<String>
*/
Result
<
String
>
add
(
UserSaveParam
param
);
/**
* 分页查询
* @param param UserFindParam
* @param pageParam PageParam
* @return Result<PageVo<UserVo>>
*/
Result
<
PageVo
<
UserVo
>>
page
(
UserFindParam
param
,
PageParam
pageParam
);
}
basic-auth/src/main/java/com/yiring/auth/service/user/impl/UserServiceImpl.java
0 → 100644
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
import
com.yiring.auth.vo.user.UserVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.domain.BasicEntity
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/10
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
UserServiceImpl
implements
UserService
{
@Resource
UserRepository
userRepository
;
@Override
public
Result
<
String
>
add
(
UserSaveParam
param
)
{
userRepository
.
save
(
UserSaveParam
.
transform
(
param
));
return
Result
.
ok
();
}
@Override
public
Result
<
PageVo
<
UserVo
>>
page
(
UserFindParam
param
,
PageParam
pageParam
)
{
Specification
<
User
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
predicates
.
add
(
cb
.
isNotNull
(
root
.
get
(
User
.
Fields
.
username
)));
if
(
StrUtil
.
isNotEmpty
(
param
.
getRealName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getRealName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getDeptId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
User
.
Fields
.
department
).
get
(
BasicEntity
.
Fields
.
id
),
param
.
getDeptId
())
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
User
.
Fields
.
post
).
get
(
BasicEntity
.
Fields
.
id
));
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
for
(
Long
role
:
roles
)
in
.
value
(
role
);
predicates
.
add
(
cb
.
and
(
in
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
User
>
users
=
userRepository
.
findAll
(
specification
,
pageable
);
List
<
UserVo
>
userVos
=
users
.
getContent
().
stream
().
map
(
UserVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
UserVo
>
pageVo
=
PageVo
.
build
(
userVos
,
users
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
}
basic-auth/src/main/java/com/yiring/auth/vo/user/UserVo.java
浏览文件 @
89b9a7cb
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
vo
.
user
;
package
com
.
yiring
.
auth
.
vo
.
user
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.vo.role.RoleVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Set
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -32,36 +36,45 @@ public class UserVo implements Serializable {
...
@@ -32,36 +36,45 @@ public class UserVo implements Serializable {
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
Long
id
;
@ApiModelProperty
(
value
=
"
真实姓名"
,
example
=
"超级用户
"
)
@ApiModelProperty
(
value
=
"
姓名"
,
example
=
"张三
"
)
String
realName
;
String
realName
;
@ApiModelProperty
(
value
=
"
用户名"
,
example
=
"admin
"
)
@ApiModelProperty
(
value
=
"
工号"
,
example
=
"1234566
"
)
String
u
sername
;
String
u
uid
;
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
@ApiModelProperty
(
value
=
"部门ID"
,
example
=
"100"
)
String
mobile
;
Long
deptId
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
email
;
@ApiModelProperty
(
value
=
"职称"
,
example
=
"系统管理员"
)
String
title
;
@ApiModelProperty
(
value
=
"头像"
,
example
=
"https://s1.ax1x.com/2022/03/30/qggJH0.jpg"
)
String
avatar
;
@ApiModelProperty
(
value
=
"
是否启用"
,
example
=
"true
"
)
@ApiModelProperty
(
value
=
"
部门名称"
,
example
=
"研发
"
)
Boolean
enabled
;
String
deptName
;
@ApiModelProperty
(
value
=
"
是否删除"
,
example
=
"false
"
)
@ApiModelProperty
(
value
=
"
手机号"
,
example
=
"13012345678
"
)
Boolean
deleted
;
String
mobile
;
@ApiModelProperty
(
value
=
"
最后登录IP地址"
,
example
=
"127.0.0.1
"
)
@ApiModelProperty
(
value
=
"
角色"
,
example
=
"系统管理员
"
)
S
tring
lastLoginIp
;
S
et
<
RoleVo
>
roles
;
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
LocalDateTime
lastLoginTime
;
LocalDateTime
lastLoginTime
;
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-01-01 00:00:00"
)
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
LocalDateTime
createTime
;
Boolean
enabled
;
public
static
UserVo
transform
(
User
user
)
{
UserVo
userVo
=
UserVo
.
builder
()
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
uuid
(
user
.
getUuid
())
.
mobile
(
user
.
getMobile
())
.
lastLoginTime
(
user
.
getLastLoginTime
())
.
enabled
(
user
.
getEnabled
())
.
deptName
(
user
.
getDepartment
().
getName
())
.
deptId
(
user
.
getDepartment
().
getId
())
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
user
.
getRoles
()))
{}
return
userVo
;
}
}
}
basic-auth/src/main/java/com/yiring/auth/web/user/UserController.java
浏览文件 @
89b9a7cb
...
@@ -7,6 +7,9 @@ import com.yiring.auth.domain.role.RoleRepository;
...
@@ -7,6 +7,9 @@ import com.yiring.auth.domain.role.RoleRepository;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
import
com.yiring.auth.util.Auths
;
import
com.yiring.auth.util.Auths
;
import
com.yiring.auth.util.Permissions
;
import
com.yiring.auth.util.Permissions
;
import
com.yiring.auth.vo.permission.MenuVo
;
import
com.yiring.auth.vo.permission.MenuVo
;
...
@@ -27,8 +30,6 @@ import java.util.stream.Collectors;
...
@@ -27,8 +30,6 @@ import java.util.stream.Collectors;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -59,6 +60,9 @@ public class UserController {
...
@@ -59,6 +60,9 @@ public class UserController {
@Resource
@Resource
RoleRepository
roleRepository
;
RoleRepository
roleRepository
;
@Resource
UserService
userService
;
@ApiOperation
(
value
=
"获取登录用户信息"
)
@ApiOperation
(
value
=
"获取登录用户信息"
)
@GetMapping
(
"getUserInfo"
)
@GetMapping
(
"getUserInfo"
)
public
Result
<
UserInfoVo
>
getUserInfo
()
{
public
Result
<
UserInfoVo
>
getUserInfo
()
{
...
@@ -121,8 +125,9 @@ public class UserController {
...
@@ -121,8 +125,9 @@ public class UserController {
@ApiOperation
(
value
=
"分页查询"
)
@ApiOperation
(
value
=
"分页查询"
)
@GetMapping
(
"/manage/page"
)
@GetMapping
(
"/manage/page"
)
public
Result
<
PageVo
<
UserVo
>>
page
(
@Valid
PageParam
param
)
{
public
Result
<
PageVo
<
UserVo
>>
page
(
@Valid
UserFindParam
param
,
@Valid
PageParam
pageParam
)
{
Page
<
User
>
page
=
userRepository
.
findAll
(
PageParam
.
toPageable
(
param
));
return
userService
.
page
(
param
,
pageParam
);
/* Page<User> page = userRepository.findAll(PageParam.toPageable(pageParam));
List<UserVo> data = page
List<UserVo> data = page
.get()
.get()
.map(role -> {
.map(role -> {
...
@@ -132,6 +137,12 @@ public class UserController {
...
@@ -132,6 +137,12 @@ public class UserController {
})
})
.collect(Collectors.toList());
.collect(Collectors.toList());
PageVo<UserVo> vo = PageVo.build(data, page.getTotalElements());
PageVo<UserVo> vo = PageVo.build(data, page.getTotalElements());
return
Result
.
ok
(
vo
);
return Result.ok(vo);*/
}
@ApiOperation
(
"添加用户"
)
@PostMapping
(
"add"
)
public
Result
<
String
>
add
(
@Valid
UserSaveParam
param
)
{
return
userService
.
add
(
param
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论