Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
6a615c7b
提交
6a615c7b
authored
4月 27, 2022
作者:
17607474349
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:
1、加入feign-okhttp 2、相关检索、分配标签
上级
1f0cb788
隐藏空白字符变更
内嵌
并排
正在显示
46 个修改的文件
包含
1107 行增加
和
373 行删除
+1107
-373
build.gradle
app/build.gradle
+3
-0
FeignOkHttpConfig.java
...rc/main/java/com/yiring/app/config/FeignOkHttpConfig.java
+34
-0
LocationTag.java
...main/java/com/yiring/app/domain/location/LocationTag.java
+4
-0
DepartmentAddParam.java
...in/java/com/yiring/app/param/dept/DepartmentAddParam.java
+5
-5
DepartmentExportParam.java
...java/com/yiring/app/param/dept/DepartmentExportParam.java
+31
-0
LocationTagAddParam.java
...om/yiring/app/param/location/tag/LocationTagAddParam.java
+5
-5
LocationTagDeleteParam.java
...yiring/app/param/location/tag/LocationTagDeleteParam.java
+1
-1
LocationTagExportParam.java
...yiring/app/param/location/tag/LocationTagExportParam.java
+38
-0
LocationTagFindParam.java
...m/yiring/app/param/location/tag/LocationTagFindParam.java
+1
-1
LocationTagModifyParam.java
...yiring/app/param/location/tag/LocationTagModifyParam.java
+1
-1
LocationTagTypeFindParam.java
...ring/app/param/location/tag/LocationTagTypeFindParam.java
+31
-0
PostAddParam.java
...src/main/java/com/yiring/app/param/post/PostAddParam.java
+44
-0
PostExportParam.java
.../main/java/com/yiring/app/param/post/PostExportParam.java
+34
-0
PostFindParam.java
...rc/main/java/com/yiring/app/param/post/PostFindParam.java
+1
-1
PostModifyParam.java
.../main/java/com/yiring/app/param/post/PostModifyParam.java
+2
-2
PostParam.java
app/src/main/java/com/yiring/app/param/post/PostParam.java
+1
-1
UserAddParam.java
...src/main/java/com/yiring/app/param/user/UserAddParam.java
+10
-10
DepartmentService.java
...n/java/com/yiring/app/service/dept/DepartmentService.java
+9
-8
DepartmentServiceImpl.java
...m/yiring/app/service/dept/impl/DepartmentServiceImpl.java
+25
-19
LocationTagService.java
...m/yiring/app/service/location/tag/LocationTagService.java
+22
-16
LocationTagTypeService.java
...ring/app/service/location/tag/LocationTagTypeService.java
+27
-0
LocationTagServiceImpl.java
...app/service/location/tag/impl/LocationTagServiceImpl.java
+84
-42
LocationTagTypeServiceImpl.java
...service/location/tag/impl/LocationTagTypeServiceImpl.java
+71
-0
PostService.java
...rc/main/java/com/yiring/app/service/post/PostService.java
+24
-21
PostServiceImpl.java
...ava/com/yiring/app/service/post/impl/PostServiceImpl.java
+61
-34
UserService.java
...rc/main/java/com/yiring/app/service/user/UserService.java
+15
-19
UserServiceImpl.java
...ava/com/yiring/app/service/user/impl/UserServiceImpl.java
+31
-33
DepartmentInfoVo.java
...rc/main/java/com/yiring/app/vo/dept/DepartmentInfoVo.java
+1
-1
DepartmentVo.java
app/src/main/java/com/yiring/app/vo/dept/DepartmentVo.java
+5
-5
LocationTagIndexVo.java
...va/com/yiring/app/vo/location/tag/LocationTagIndexVo.java
+54
-0
LocationTagTypeVo.java
...ava/com/yiring/app/vo/location/tag/LocationTagTypeVo.java
+60
-0
LocationTagVo.java
...in/java/com/yiring/app/vo/location/tag/LocationTagVo.java
+4
-4
PostIndexVo.java
app/src/main/java/com/yiring/app/vo/post/PostIndexVo.java
+42
-0
PostInfoVo.java
app/src/main/java/com/yiring/app/vo/post/PostInfoVo.java
+63
-0
PostVo.java
app/src/main/java/com/yiring/app/vo/post/PostVo.java
+1
-9
UserInfoVo.java
app/src/main/java/com/yiring/app/vo/user/UserInfoVo.java
+99
-0
UserVo.java
app/src/main/java/com/yiring/app/vo/user/UserVo.java
+5
-72
DepartmentController.java
...in/java/com/yiring/app/web/dept/DepartmentController.java
+9
-8
LocationBeaconController.java
...ing/app/web/location/beacon/LocationBeaconController.java
+22
-0
LocationTagController.java
...om/yiring/app/web/location/tag/LocationTagController.java
+27
-16
LocationTagTypeController.java
...iring/app/web/location/tag/LocationTagTypeController.java
+45
-0
PostController.java
...src/main/java/com/yiring/app/web/post/PostController.java
+18
-14
UserAppController.java
.../main/java/com/yiring/app/web/user/UserAppController.java
+15
-19
application-dev.yml
app/src/main/resources/application-dev.yml
+12
-0
IndexParam.java
...ore/src/main/java/com/yiring/common/param/IndexParam.java
+8
-6
build.gradle
build.gradle
+2
-0
没有找到文件。
app/build.gradle
浏览文件 @
6a615c7b
...
@@ -73,4 +73,7 @@ dependencies {
...
@@ -73,4 +73,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
implementation
"org.springframework.cloud:spring-cloud-starter-openfeign:${openfeignVersion}"
implementation
"org.springframework.cloud:spring-cloud-starter-openfeign:${openfeignVersion}"
// feign-okhttp
implementation
"io.github.openfeign:feign-okhttp:${feignOkhttpVersion}"
}
}
app/src/main/java/com/yiring/app/config/FeignOkHttpConfig.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
config
;
import
feign.Feign
;
import
java.util.concurrent.TimeUnit
;
import
okhttp3.ConnectionPool
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.cloud.openfeign.FeignAutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* feignOkhttp
*
* @author LJ-2204
* @date 2022/4/27
*/
@Configuration
@ConditionalOnClass
(
Feign
.
class
)
@AutoConfigureBefore
(
FeignAutoConfiguration
.
class
)
public
class
FeignOkHttpConfig
{
@Bean
public
okhttp3
.
OkHttpClient
okHttpClient
()
{
return
new
okhttp3
.
OkHttpClient
.
Builder
()
.
readTimeout
(
60
,
TimeUnit
.
SECONDS
)
.
connectTimeout
(
60
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
120
,
TimeUnit
.
SECONDS
)
.
connectionPool
(
new
ConnectionPool
())
.
build
();
}
}
app/src/main/java/com/yiring/app/domain/location/LocationTag.java
浏览文件 @
6a615c7b
...
@@ -99,6 +99,10 @@ public class LocationTag extends BasicEntity implements Serializable {
...
@@ -99,6 +99,10 @@ public class LocationTag extends BasicEntity implements Serializable {
@Comment
(
"电量单位"
)
@Comment
(
"电量单位"
)
String
voltUnit
;
String
voltUnit
;
@FieldMapping
@Comment
(
"类型(1:内部/2:访客/3:承包商)"
)
Integer
category
;
@FieldMapping
(
value
=
"raiseTimestamp"
,
desc
=
"更新时间戳"
,
type
=
Long
.
class
)
@FieldMapping
(
value
=
"raiseTimestamp"
,
desc
=
"更新时间戳"
,
type
=
Long
.
class
)
@Comment
(
"更新时间"
)
@Comment
(
"更新时间"
)
LocalDateTime
updateTime
;
LocalDateTime
updateTime
;
...
...
app/src/main/java/com/yiring/app/param/dept/DepartmentAddParam.java
浏览文件 @
6a615c7b
...
@@ -43,13 +43,13 @@ public class DepartmentAddParam implements Serializable {
...
@@ -43,13 +43,13 @@ public class DepartmentAddParam implements Serializable {
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"1"
)
Boolean
enable
;
Boolean
enable
;
public
Department
transform
(
)
{
public
static
Department
transform
(
DepartmentAddParam
departmentAddParam
)
{
return
Department
return
Department
.
builder
()
.
builder
()
.
pid
(
this
.
id
)
.
pid
(
departmentAddParam
.
getId
()
)
.
name
(
this
.
name
)
.
name
(
departmentAddParam
.
getName
()
)
.
leader
(
User
.
builder
().
id
(
this
.
leaderId
).
build
())
.
leader
(
User
.
builder
().
id
(
departmentAddParam
.
getLeaderId
()
).
build
())
.
enable
(
this
.
enable
)
.
enable
(
departmentAddParam
.
getEnable
()
)
.
createTime
(
LocalDateTime
.
now
())
.
createTime
(
LocalDateTime
.
now
())
.
updateTime
(
LocalDateTime
.
now
())
.
updateTime
(
LocalDateTime
.
now
())
.
build
();
.
build
();
...
...
app/src/main/java/com/yiring/app/param/dept/DepartmentExportParam.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
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
;
/**
* 部门导入
*
* @author LJ-2204
* @date 2022/4/27
*/
@ApiModel
(
"DepartmentExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
DepartmentExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
6314061369190511168L
;
@ApiModelProperty
(
value
=
"部门状态"
,
example
=
"启用/禁用"
)
Boolean
enable
;
}
app/src/main/java/com/yiring/app/param/location/LocationTagAddParam.java
→
app/src/main/java/com/yiring/app/param/location/
tag/
LocationTagAddParam.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
@@ -39,12 +39,12 @@ public class LocationTagAddParam implements Serializable {
...
@@ -39,12 +39,12 @@ public class LocationTagAddParam implements Serializable {
@ApiModelProperty
(
value
=
"imei 设备编码标识"
,
example
=
"88888888"
)
@ApiModelProperty
(
value
=
"imei 设备编码标识"
,
example
=
"88888888"
)
String
imei
;
String
imei
;
public
LocationTag
transform
(
)
{
public
static
LocationTag
transform
(
LocationTagAddParam
locationTagAddParam
)
{
return
LocationTag
return
LocationTag
.
builder
()
.
builder
()
.
code
(
this
.
code
)
.
code
(
locationTagAddParam
.
getCode
()
)
.
type
(
this
.
type
)
.
type
(
locationTagAddParam
.
getType
()
)
.
imei
(
this
.
imei
)
.
imei
(
locationTagAddParam
.
getImei
()
)
.
used
(
false
)
.
used
(
false
)
.
silent
(
false
)
.
silent
(
false
)
.
volt
(
0
)
.
volt
(
0
)
...
...
app/src/main/java/com/yiring/app/param/location/LocationTagDeleteParam.java
→
app/src/main/java/com/yiring/app/param/location/
tag/
LocationTagDeleteParam.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
app/src/main/java/com/yiring/app/param/location/tag/LocationTagExportParam.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
com.yiring.app.domain.location.LocationTag
;
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/27
*/
@ApiModel
(
"LocationTagExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationTagExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
344458727454884014L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTT88888888"
)
String
code
;
@ApiModelProperty
(
value
=
"标签类型"
,
example
=
"蓝牙人员定位卡"
)
LocationTag
.
Type
type
;
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
Boolean
silent
;
}
app/src/main/java/com/yiring/app/param/location/LocationTagFindParam.java
→
app/src/main/java/com/yiring/app/param/location/
tag/
LocationTagFindParam.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
...
app/src/main/java/com/yiring/app/param/location/LocationTagModifyParam.java
→
app/src/main/java/com/yiring/app/param/location/
tag/
LocationTagModifyParam.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
;
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTag
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
...
app/src/main/java/com/yiring/app/param/location/tag/LocationTagTypeFindParam.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
location
.
tag
;
import
io.swagger.annotations.ApiModel
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 标签分配
*
* @author LJ-2204
* @date 2022/4/27
*/
@ApiModel
(
"LocationTagTypeFindParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationTagTypeFindParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
647961131755069990L
;
String
code
;
Integer
category
;
}
app/src/main/java/com/yiring/app/param/post/PostAddParam.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
post
;
import
com.yiring.auth.domain.post.Post
;
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/27
*/
@ApiModel
(
"PostAddParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostAddParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
7451952048517810923L
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@NotNull
(
message
=
"名称不能为空"
)
String
name
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
String
describe
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enable
;
public
static
Post
transform
(
PostAddParam
param
)
{
return
Post
.
builder
().
name
(
param
.
getName
()).
describe
(
param
.
getDescribe
()).
enable
(
param
.
getEnable
()).
build
();
}
}
app/src/main/java/com/yiring/app/param/post/PostExportParam.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
post
;
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/27
*/
@ApiModel
(
"PostExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
86398868302287802L
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
)
String
name
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enable
;
}
app/src/main/java/com/yiring/app/param/post/PostFindParam.java
浏览文件 @
6a615c7b
...
@@ -9,7 +9,7 @@ import lombok.*;
...
@@ -9,7 +9,7 @@ import lombok.*;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
* 职位
分页
入参
* 职位
条件
入参
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/13
* @date 2022/4/13
*/
*/
...
...
app/src/main/java/com/yiring/app/param/post/PostModifyParam.java
浏览文件 @
6a615c7b
...
@@ -30,11 +30,11 @@ public class PostModifyParam implements Serializable {
...
@@ -30,11 +30,11 @@ public class PostModifyParam implements Serializable {
private
static
final
long
serialVersionUID
=
9182648236336186660L
;
private
static
final
long
serialVersionUID
=
9182648236336186660L
;
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
,
required
=
true
)
@NotNull
@NotNull
(
message
=
"编号不能为空"
)
Long
id
;
Long
id
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@NotNull
@NotNull
(
message
=
"名称不能为空"
)
String
name
;
String
name
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
...
...
app/src/main/java/com/yiring/app/param/post/PostParam.java
浏览文件 @
6a615c7b
...
@@ -29,7 +29,7 @@ public class PostParam implements Serializable {
...
@@ -29,7 +29,7 @@ public class PostParam implements Serializable {
private
static
final
long
serialVersionUID
=
5247408856592333466L
;
private
static
final
long
serialVersionUID
=
5247408856592333466L
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
,
required
=
true
)
@NotNull
@NotNull
(
message
=
"名称不能为空"
)
String
name
;
String
name
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
...
...
app/src/main/java/com/yiring/app/param/user/UserAddParam.java
浏览文件 @
6a615c7b
...
@@ -57,18 +57,18 @@ public class UserAddParam implements Serializable {
...
@@ -57,18 +57,18 @@ public class UserAddParam implements Serializable {
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否特殊人员"
,
example
=
"0/1"
,
required
=
true
)
Boolean
isSpecial
;
Boolean
isSpecial
;
public
User
transform
(
)
{
public
static
User
transform
(
UserAddParam
userAddParam
)
{
return
User
return
User
.
builder
()
.
builder
()
.
avatar
(
this
.
avatar
)
.
avatar
(
userAddParam
.
getAvatar
()
)
.
realName
(
this
.
realName
)
.
realName
(
userAddParam
.
getRealName
()
)
.
mobile
(
this
.
mobile
)
.
mobile
(
userAddParam
.
getMobile
()
)
.
type
(
this
.
type
)
.
type
(
userAddParam
.
getType
()
)
.
gender
(
this
.
gender
)
.
gender
(
userAddParam
.
getGender
()
)
.
department
(
Department
.
builder
().
id
(
Convert
.
toLong
(
this
.
deptId
)).
build
())
.
department
(
Department
.
builder
().
id
(
Convert
.
toLong
(
userAddParam
.
getDeptId
()
)).
build
())
.
uuid
(
this
.
uuid
)
.
uuid
(
userAddParam
.
getUuid
()
)
.
post
(
Post
.
builder
().
id
(
Convert
.
toLong
(
this
.
postId
)).
build
())
.
post
(
Post
.
builder
().
id
(
Convert
.
toLong
(
userAddParam
.
getPostId
()
)).
build
())
.
isSpecial
(
this
.
isSpecial
)
.
isSpecial
(
userAddParam
.
getIsSpecial
()
)
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/service/dept/DepartmentService.java
浏览文件 @
6a615c7b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
service
.
dept
;
package
com
.
yiring
.
app
.
service
.
dept
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentExportParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.vo.dept.DepartmentInfoVo
;
import
com.yiring.app.vo.dept.DepartmentInfoVo
;
...
@@ -23,17 +24,17 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -23,17 +24,17 @@ import org.springframework.web.multipart.MultipartFile;
public
interface
DepartmentService
{
public
interface
DepartmentService
{
/**
/**
* 新增部门
* 新增部门
* @param
p
aram DepartmentAddParam
* @param
departmentAddP
aram DepartmentAddParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
addDepartment
(
DepartmentAddParam
p
aram
);
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddP
aram
);
/**
/**
* 查询树状图
* 查询树状图
* @param
p
aram DepartmentFindParam
* @param
departmentFindP
aram DepartmentFindParam
* @return Result<PageVo<DepartmentVo>>
* @return Result<PageVo<DepartmentVo>>
*/
*/
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
DepartmentFindParam
p
aram
);
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
DepartmentFindParam
departmentFindP
aram
);
/**
/**
* 根据id查询详细信息
* 根据id查询详细信息
...
@@ -44,10 +45,10 @@ public interface DepartmentService {
...
@@ -44,10 +45,10 @@ public interface DepartmentService {
/**
/**
* 导出部门
* 导出部门
* @param
p
aram DepartmentFindParam
* @param
departmentExportP
aram DepartmentFindParam
* @param response HttpServletResponse
* @param response HttpServletResponse
*/
*/
void
exportDepartment
(
Department
FindParam
p
aram
,
HttpServletResponse
response
);
void
exportDepartment
(
Department
ExportParam
departmentExportP
aram
,
HttpServletResponse
response
);
/**
/**
* 逻辑删除部门
* 逻辑删除部门
...
@@ -73,10 +74,10 @@ public interface DepartmentService {
...
@@ -73,10 +74,10 @@ public interface DepartmentService {
/**
/**
* 部门修改
* 部门修改
* @param
p
aram DepartmentModifyParam
* @param
departmentModifyP
aram DepartmentModifyParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
modifyDept
(
DepartmentModifyParam
p
aram
);
Result
<
String
>
modifyDept
(
DepartmentModifyParam
departmentModifyP
aram
);
/**
/**
* 导入部门
* 导入部门
...
...
app/src/main/java/com/yiring/app/service/dept/impl/DepartmentServiceImpl.java
浏览文件 @
6a615c7b
...
@@ -10,10 +10,10 @@ import com.github.liaochong.myexcel.core.SaxExcelReader;
...
@@ -10,10 +10,10 @@ import com.github.liaochong.myexcel.core.SaxExcelReader;
import
com.yiring.app.excel.dept.DepartmentExportExcel
;
import
com.yiring.app.excel.dept.DepartmentExportExcel
;
import
com.yiring.app.excel.dept.DepartmentImportExcel
;
import
com.yiring.app.excel.dept.DepartmentImportExcel
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentExportParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.zy.ZyHttpService
;
import
com.yiring.app.vo.dept.DepartmentInfoVo
;
import
com.yiring.app.vo.dept.DepartmentInfoVo
;
import
com.yiring.app.vo.dept.DepartmentVo
;
import
com.yiring.app.vo.dept.DepartmentVo
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
...
@@ -55,30 +55,28 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -55,30 +55,28 @@ public class DepartmentServiceImpl implements DepartmentService {
@Resource
@Resource
DepartmentRepository
departmentRepository
;
DepartmentRepository
departmentRepository
;
@Resource
ZyHttpService
zyHttpService
;
// todo
@Override
@Override
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
param
)
{
public
Result
<
String
>
addDepartment
(
DepartmentAddParam
departmentAddParam
)
{
long
pidExist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
id
(
param
.
getId
()).
build
()));
long
pidExist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
id
(
departmentAddParam
.
getId
()).
build
())
);
if
(
pidExist
==
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"上级部门不存在"
);
if
(
pidExist
==
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"上级部门不存在"
);
long
exist
=
departmentRepository
.
count
(
long
exist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
name
(
param
.
getName
()).
pid
(
p
aram
.
getId
()).
build
())
Example
.
of
(
Department
.
builder
().
name
(
departmentAddParam
.
getName
()).
pid
(
departmentAddP
aram
.
getId
()).
build
())
);
);
if
(
exist
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"同级目录下,已存在该部门"
);
if
(
exist
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"同级目录下,已存在该部门"
);
Department
department
=
param
.
transform
(
);
Department
department
=
DepartmentAddParam
.
transform
(
departmentAddParam
);
departmentRepository
.
save
(
department
);
departmentRepository
.
save
(
department
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
DepartmentFindParam
p
aram
)
{
public
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
DepartmentFindParam
departmentFindP
aram
)
{
List
<
Department
>
departments
=
departmentRepository
.
findAll
(
List
<
Department
>
departments
=
departmentRepository
.
findAll
(
Example
.
of
(
Department
.
builder
().
enable
(
p
aram
.
getEnable
()).
build
())
Example
.
of
(
Department
.
builder
().
enable
(
departmentFindP
aram
.
getEnable
()).
build
())
);
);
List
<
DepartmentVo
>
departmentVos
=
departments
List
<
DepartmentVo
>
departmentVos
=
departments
.
stream
()
.
stream
()
...
@@ -112,9 +110,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -112,9 +110,9 @@ public class DepartmentServiceImpl implements DepartmentService {
}
}
@Override
@Override
public
void
exportDepartment
(
Department
FindParam
p
aram
,
HttpServletResponse
response
)
{
public
void
exportDepartment
(
Department
ExportParam
departmentExportP
aram
,
HttpServletResponse
response
)
{
List
<
Department
>
departments
=
departmentRepository
.
findAll
(
List
<
Department
>
departments
=
departmentRepository
.
findAll
(
Example
.
of
(
Department
.
builder
().
enable
(
p
aram
.
getEnable
()).
build
())
Example
.
of
(
Department
.
builder
().
enable
(
departmentExportP
aram
.
getEnable
()).
build
())
);
);
List
<
DepartmentExportExcel
>
departmentExportExcels
=
departments
List
<
DepartmentExportExcel
>
departmentExportExcels
=
departments
.
stream
()
.
stream
()
...
@@ -197,24 +195,32 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -197,24 +195,32 @@ public class DepartmentServiceImpl implements DepartmentService {
}
}
@Override
@Override
public
Result
<
String
>
modifyDept
(
DepartmentModifyParam
p
aram
)
{
public
Result
<
String
>
modifyDept
(
DepartmentModifyParam
departmentModifyP
aram
)
{
Optional
<
Department
>
departmentOptional
=
departmentRepository
.
findOne
(
Optional
<
Department
>
departmentOptional
=
departmentRepository
.
findOne
(
Example
.
of
(
Department
.
builder
().
id
(
p
aram
.
getId
()).
build
())
Example
.
of
(
Department
.
builder
().
id
(
departmentModifyP
aram
.
getId
()).
build
())
);
);
if
(
departmentOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
if
(
departmentOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
);
long
pidExist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
id
(
param
.
getPid
()).
build
()));
long
pidExist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
id
(
departmentModifyParam
.
getPid
()).
build
())
);
if
(
pidExist
==
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"上级部门不存在"
);
if
(
pidExist
==
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"上级部门不存在"
);
Department
department
=
departmentOptional
.
get
();
Department
department
=
departmentOptional
.
get
();
if
(!
StrUtil
.
equals
(
department
.
getName
(),
p
aram
.
getName
()))
{
if
(!
StrUtil
.
equals
(
department
.
getName
(),
departmentModifyP
aram
.
getName
()))
{
long
exist
=
departmentRepository
.
count
(
long
exist
=
departmentRepository
.
count
(
Example
.
of
(
Department
.
builder
().
name
(
param
.
getName
()).
pid
(
param
.
getId
()).
build
())
Example
.
of
(
Department
.
builder
()
.
name
(
departmentModifyParam
.
getName
())
.
pid
(
departmentModifyParam
.
getId
())
.
build
()
)
);
);
if
(
exist
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"同级目录下,已存在该部门"
);
if
(
exist
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"同级目录下,已存在该部门"
);
}
}
Department
newDepartment
=
p
aram
.
transform
();
Department
newDepartment
=
departmentModifyP
aram
.
transform
();
departmentRepository
.
save
(
newDepartment
);
departmentRepository
.
save
(
newDepartment
);
return
Result
.
ok
();
return
Result
.
ok
();
...
...
app/src/main/java/com/yiring/app/service/location/LocationTagService.java
→
app/src/main/java/com/yiring/app/service/location/
tag/
LocationTagService.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
;
package
com
.
yiring
.
app
.
service
.
location
.
tag
;
import
com.yiring.app.param.location.LocationTagAddParam
;
import
com.yiring.app.param.location.tag.*
;
import
com.yiring.app.param.location.LocationTagDeleteParam
;
import
com.yiring.app.vo.location.tag.LocationTagIndexVo
;
import
com.yiring.app.param.location.LocationTagFindParam
;
import
com.yiring.app.vo.location.tag.LocationTagVo
;
import
com.yiring.app.param.location.LocationTagModifyParam
;
import
com.yiring.app.vo.location.LocationTagVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IndexParam
;
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
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -20,31 +19,31 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -20,31 +19,31 @@ import org.springframework.web.multipart.MultipartFile;
public
interface
LocationTagService
{
public
interface
LocationTagService
{
/**
/**
* 新增定位标签
* 新增定位标签
* @param
param 入参
* @param
locationTagAddParam LocationTagAddParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
addLocationTag
(
LocationTagAddParam
p
aram
);
Result
<
String
>
addLocationTag
(
LocationTagAddParam
locationTagAddP
aram
);
/**
/**
* 分页查询
* 分页查询
* @param
param 入参
* @param
locationTagFindParam LocationTagFindParam
* @return Result<PageVo<LocationTagVo>>
* @return Result<PageVo<LocationTagVo>>
*/
*/
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
LocationTagFindParam
p
aram
,
PageParam
pageParam
);
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
LocationTagFindParam
locationTagFindP
aram
,
PageParam
pageParam
);
/**
/**
* 销毁定位标签
* 销毁定位标签
* @param
p
aram 入参
* @param
locationTagDeleteP
aram 入参
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
deleteLocationTag
(
LocationTagDeleteParam
p
aram
);
Result
<
String
>
deleteLocationTag
(
LocationTagDeleteParam
locationTagDeleteP
aram
);
/**
/**
* 导出定位标签
* 导出定位标签
* @param
p
aram 入参
* @param
locationTagExportP
aram 入参
* @param response 响应信息
* @param response 响应信息
*/
*/
void
exportLocationTagInfo
(
LocationTag
FindParam
p
aram
,
HttpServletResponse
response
);
void
exportLocationTagInfo
(
LocationTag
ExportParam
locationTagExportP
aram
,
HttpServletResponse
response
);
/**
/**
* 导入定位标签
* 导入定位标签
...
@@ -55,8 +54,15 @@ public interface LocationTagService {
...
@@ -55,8 +54,15 @@ public interface LocationTagService {
/**
/**
* 修改定位标签
* 修改定位标签
* @param
p
aram 入参
* @param
locationTagModifyP
aram 入参
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
modifyLocationTag
(
LocationTagModifyParam
param
);
Result
<
String
>
modifyLocationTag
(
LocationTagModifyParam
locationTagModifyParam
);
/**
* 检索标签
* @param indexParam IndexParam
* @return Result<PageVo<LocationTagIndexVo>>
*/
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
IndexParam
indexParam
);
}
}
app/src/main/java/com/yiring/app/service/location/tag/LocationTagTypeService.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
tag
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* 标签分配
*
* @author LJ-2204
* @date 2022/4/27
*/
public
interface
LocationTagTypeService
{
/**
* 分页查询
* @param locationTagTypeFindParam LocationTagTypeFindParam
* @param pageParam PageParam
* @return Result<PageVo<LocationTagTypeVo>>
*/
Result
<
PageVo
<
LocationTagTypeVo
>>
findLocationTagType
(
LocationTagTypeFindParam
locationTagTypeFindParam
,
PageParam
pageParam
);
}
app/src/main/java/com/yiring/app/service/location/impl/LocationTagServiceImpl.java
→
app/src/main/java/com/yiring/app/service/location/
tag/
impl/LocationTagServiceImpl.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
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.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
...
@@ -11,16 +11,15 @@ import com.yiring.app.domain.location.LocationTag;
...
@@ -11,16 +11,15 @@ 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.location.LocationTagExportExcel
;
import
com.yiring.app.excel.location.LocationTagExportExcel
;
import
com.yiring.app.excel.location.LocationTagImportExcel
;
import
com.yiring.app.excel.location.LocationTagImportExcel
;
import
com.yiring.app.param.location.LocationTagAddParam
;
import
com.yiring.app.param.location.tag.*
;
import
com.yiring.app.param.location.LocationTagDeleteParam
;
import
com.yiring.app.param.location.LocationTagFindParam
;
import
com.yiring.app.param.location.LocationTagModifyParam
;
import
com.yiring.app.param.location.zy.ZyLocationTagAddParam
;
import
com.yiring.app.param.location.zy.ZyLocationTagAddParam
;
import
com.yiring.app.service.location.LocationTagService
;
import
com.yiring.app.service.location.
tag.
LocationTagService
;
import
com.yiring.app.service.zy.ZyHttpService
;
import
com.yiring.app.service.zy.ZyHttpService
;
import
com.yiring.app.vo.location.LocationTagVo
;
import
com.yiring.app.vo.location.tag.LocationTagIndexVo
;
import
com.yiring.app.vo.location.tag.LocationTagVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.core.Status
;
import
com.yiring.common.param.IndexParam
;
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.io.IOException
;
import
java.io.IOException
;
...
@@ -37,7 +36,6 @@ import javax.persistence.criteria.Predicate;
...
@@ -37,7 +36,6 @@ import javax.persistence.criteria.Predicate;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -64,9 +62,10 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -64,9 +62,10 @@ public class LocationTagServiceImpl implements LocationTagService {
LocationTagRepository
locationTagRepository
;
LocationTagRepository
locationTagRepository
;
@Override
@Override
public
Result
<
String
>
addLocationTag
(
LocationTagAddParam
param
)
{
public
Result
<
String
>
addLocationTag
(
LocationTagAddParam
locationTagAddParam
)
{
if
(
hasLocationTagInfoByCode
(
param
.
getCode
()))
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"编号已存在"
);
if
(
hasLocationTagInfoByCode
(
locationTagAddParam
.
getCode
()))
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"编号已存在"
);
LocationTag
locationTag
=
param
.
transform
();
LocationTag
locationTag
=
LocationTagAddParam
.
transform
(
locationTagAddParam
);
ZyLocationTagAddParam
zyLocationTagAddParam
=
ZyLocationTagAddParam
.
transform
(
locationTag
,
FACTORY_ID
);
ZyLocationTagAddParam
zyLocationTagAddParam
=
ZyLocationTagAddParam
.
transform
(
locationTag
,
FACTORY_ID
);
List
<
ZyLocationTagAddParam
>
of
=
ListUtil
.
of
(
zyLocationTagAddParam
);
List
<
ZyLocationTagAddParam
>
of
=
ListUtil
.
of
(
zyLocationTagAddParam
);
zyHttpService
.
post
(
"/positionApi/api/tag/saveTag"
,
of
,
3000
);
zyHttpService
.
post
(
"/positionApi/api/tag/saveTag"
,
of
,
3000
);
...
@@ -76,8 +75,30 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -76,8 +75,30 @@ public class LocationTagServiceImpl implements LocationTagService {
}
}
@Override
@Override
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
LocationTagFindParam
param
,
PageParam
pageParam
)
{
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
Specification
<
LocationTag
>
specification
=
getLocationTagPageSpecification
(
param
);
LocationTagFindParam
locationTagFindParam
,
PageParam
pageParam
)
{
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationTagFindParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
locationTagFindParam
.
getCode
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
locationTagFindParam
.
getType
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
type
),
locationTagFindParam
.
getType
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
locationTagFindParam
.
getSilent
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagFindParam
.
getSilent
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
...
@@ -91,18 +112,39 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -91,18 +112,39 @@ public class LocationTagServiceImpl implements LocationTagService {
}
}
@Override
@Override
public
Result
<
String
>
deleteLocationTag
(
LocationTagDeleteParam
p
aram
)
{
public
Result
<
String
>
deleteLocationTag
(
LocationTagDeleteParam
locationTagDeleteP
aram
)
{
Map
<
Object
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
Map
<
Object
,
Object
>
map
=
MapUtil
.
createMap
(
HashMap
.
class
);
map
.
put
(
"tagIds"
,
p
aram
.
getCodes
());
map
.
put
(
"tagIds"
,
locationTagDeleteP
aram
.
getCodes
());
map
.
put
(
"orgId"
,
FACTORY_ID
);
map
.
put
(
"orgId"
,
FACTORY_ID
);
zyHttpService
.
delete
(
"/positionApi/api/tag/delete"
,
map
,
3000
);
zyHttpService
.
delete
(
"/positionApi/api/tag/delete"
,
map
,
3000
);
locationTagRepository
.
deleteAllById
(
ListUtil
.
toList
(
p
aram
.
getIds
()));
locationTagRepository
.
deleteAllById
(
ListUtil
.
toList
(
locationTagDeleteP
aram
.
getIds
()));
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@Override
@Override
public
void
exportLocationTagInfo
(
LocationTagFindParam
param
,
HttpServletResponse
response
)
{
public
void
exportLocationTagInfo
(
LocationTagExportParam
locationTagExportParam
,
HttpServletResponse
response
)
{
Specification
<
LocationTag
>
specification
=
getLocationTagPageSpecification
(
param
);
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationTagExportParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
locationTagExportParam
.
getCode
()
+
"%"
)
);
}
if
(
ObjectUtil
.
isNotEmpty
(
locationTagExportParam
.
getType
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
type
),
locationTagExportParam
.
getType
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
locationTagExportParam
.
getSilent
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
locationTagExportParam
.
getSilent
()));
}
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
);
List
<
LocationTag
>
locationTags
=
locationTagRepository
.
findAll
(
specification
);
List
<
LocationTagExportExcel
>
locationTagExportExcels
=
locationTags
List
<
LocationTagExportExcel
>
locationTagExportExcels
=
locationTags
.
stream
()
.
stream
()
...
@@ -173,47 +215,47 @@ public class LocationTagServiceImpl implements LocationTagService {
...
@@ -173,47 +215,47 @@ public class LocationTagServiceImpl implements LocationTagService {
}
}
@Override
@Override
public
Result
<
String
>
modifyLocationTag
(
LocationTagModifyParam
p
aram
)
{
public
Result
<
String
>
modifyLocationTag
(
LocationTagModifyParam
locationTagModifyP
aram
)
{
long
count
=
locationTagRepository
.
count
(
long
count
=
locationTagRepository
.
count
(
Example
.
of
(
LocationTag
.
builder
().
id
(
param
.
getId
()).
code
(
param
.
getCode
()).
build
())
Example
.
of
(
LocationTag
.
builder
().
id
(
locationTagModifyParam
.
getId
()).
code
(
locationTagModifyParam
.
getCode
()).
build
()
)
);
);
// code相同
// code相同
if
(
count
==
0
&&
hasLocationTagInfoByCode
(
p
aram
.
getCode
()))
{
if
(
count
==
0
&&
hasLocationTagInfoByCode
(
locationTagModifyP
aram
.
getCode
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"编号重复"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"编号重复"
);
}
}
LocationTag
locationTag
=
LocationTagModifyParam
.
transform
(
p
aram
);
LocationTag
locationTag
=
LocationTagModifyParam
.
transform
(
locationTagModifyP
aram
);
locationTagRepository
.
save
(
locationTag
);
locationTagRepository
.
save
(
locationTag
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
private
boolean
hasLocationTagInfoByCode
(
String
code
)
{
@Override
LocationTag
locationTag
=
LocationTag
.
builder
().
code
(
code
).
build
();
public
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
IndexParam
indexParam
)
{
return
locationTagRepository
.
count
(
Example
.
of
(
locationTag
))
>
0
;
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
}
@NotNull
private
Specification
<
LocationTag
>
getLocationTagPageSpecification
(
LocationTagFindParam
param
)
{
return
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
indexParam
.
getStr
()))
{
if
(
StrUtil
.
isNotEmpty
(
param
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
param
.
getCode
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getType
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
type
),
param
.
getType
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getSilent
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
silent
),
param
.
getSilent
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
LocationTag
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
};
List
<
LocationTag
>
locationTags
=
locationTagRepository
.
findAll
(
specification
);
List
<
LocationTagIndexVo
>
locationTagIndexVos
=
locationTags
.
stream
()
.
map
(
LocationTagIndexVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationTagIndexVo
>
pageVo
=
PageVo
.
build
(
locationTagIndexVos
,
locationTagIndexVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
private
boolean
hasLocationTagInfoByCode
(
String
code
)
{
LocationTag
locationTag
=
LocationTag
.
builder
().
code
(
code
).
build
();
return
locationTagRepository
.
count
(
Example
.
of
(
locationTag
))
>
0
;
}
}
}
}
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagTypeServiceImpl.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
location
.
tag
.
impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.domain.location.LocationTagRepository
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
import
com.yiring.common.core.Result
;
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.Order
;
import
javax.persistence.criteria.Predicate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/4/27
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Service
@Slf4j
public
class
LocationTagTypeServiceImpl
implements
LocationTagTypeService
{
@Resource
LocationTagRepository
locationTagRepository
;
@Override
public
Result
<
PageVo
<
LocationTagTypeVo
>>
findLocationTagType
(
LocationTagTypeFindParam
locationTagTypeFindParam
,
PageParam
pageParam
)
{
Specification
<
LocationTag
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationTagTypeFindParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationTag
.
Fields
.
code
),
"%"
+
locationTagTypeFindParam
.
getCode
()
+
"%"
)
);
}
if
(
ObjectUtil
.
isNotEmpty
(
locationTagTypeFindParam
.
getCategory
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
LocationTag
.
Fields
.
category
),
locationTagTypeFindParam
.
getCategory
()));
}
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
);
List
<
LocationTagTypeVo
>
locationTagTypeVos
=
locationTags
.
stream
()
.
map
(
LocationTagTypeVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationTagTypeVo
>
pageVo
=
PageVo
.
build
(
locationTagTypeVos
,
locationTagTypeVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/post/PostService.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
post
;
package
com
.
yiring
.
app
.
service
.
post
;
import
com.yiring.app.param.post.
PostFindParam
;
import
com.yiring.app.param.post.
*
;
import
com.yiring.app.
param.post.PostModifyParam
;
import
com.yiring.app.
vo.post.PostIndexVo
;
import
com.yiring.app.
param.post.PostParam
;
import
com.yiring.app.
vo.post.PostInfoVo
;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.app.vo.post.PostVo
;
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.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -19,56 +20,58 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -19,56 +20,58 @@ import javax.servlet.http.HttpServletResponse;
public
interface
PostService
{
public
interface
PostService
{
/**
/**
* 新增职位信息
* 新增职位信息
* @param post
Param 入参
* @param post
AddParam PostAddParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
addPost
(
Post
Param
post
Param
);
Result
<
String
>
addPost
(
Post
AddParam
postAdd
Param
);
/**
/**
* 修改职位信息
* 修改职位信息
* @param post
Param 入参
* @param post
ModifyParam PostModifyParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
modifyPost
(
PostModifyParam
postParam
);
Result
<
String
>
modifyPost
(
PostModifyParam
post
Modify
Param
);
/**
/**
* 销毁职位信息
* 销毁职位信息
* @param idParam
id
* @param idParam
IdParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
deletePost
(
IdParam
idParam
);
Result
<
String
>
deletePost
(
IdParam
idParam
);
/**
/**
* 职位信息分页
* 职位信息分页
* @param param 入参
* @param postFindParam PostFindParam
* @param pageParam PageParam
* @return Result<PageVo<PostVo>>
* @return Result<PageVo<PostVo>>
*/
*/
Result
<
PageVo
<
PostVo
>>
findPostPage
(
PostFindParam
param
,
PageParam
pageParam
);
Result
<
PageVo
<
PostVo
>>
findPostPage
(
PostFindParam
p
ostFindP
aram
,
PageParam
pageParam
);
/**
/**
* 详细信息查询
* 详细信息查询
* @param idParam
id
* @param idParam
IdParam
* @return Result<PostVo>
* @return Result<Post
Info
Vo>
*/
*/
Result
<
PostVo
>
findPostById
(
IdParam
idParam
);
Result
<
Post
Info
Vo
>
findPostById
(
IdParam
idParam
);
/**
/**
* 根据名称判断是否存在职业信息
* 根据名称判断是否存在职业信息
* @param name
职业名称
* @param name
String
* @return
T/F
* @return
boolean
*/
*/
boolean
hasPostInfo
(
String
name
);
boolean
hasPostInfo
(
String
name
);
/**
/**
* 导出职位信息
* 导出职位信息
* @param p
aram 入参
* @param p
ostExportParam PostExportParam
* @param response
响应信息
* @param response
HttpServletResponse
*/
*/
void
exportPostInfo
(
Post
FindParam
p
aram
,
HttpServletResponse
response
);
void
exportPostInfo
(
Post
ExportParam
postExportP
aram
,
HttpServletResponse
response
);
/**
/**
* 下拉菜单
* 职位检索
* @return Result<PageVo<PostVo>>
* @param indexParam IndexParam
* @return Result<PageVo<PostIndexVo>>
*/
*/
Result
<
PageVo
<
Post
Vo
>>
selectPost
(
);
Result
<
PageVo
<
Post
IndexVo
>>
indexPost
(
IndexParam
indexParam
);
}
}
app/src/main/java/com/yiring/app/service/post/impl/PostServiceImpl.java
浏览文件 @
6a615c7b
...
@@ -5,10 +5,10 @@ import cn.hutool.core.collection.ListUtil;
...
@@ -5,10 +5,10 @@ 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.param.post.PostFindParam
;
import
com.yiring.app.param.post.*
;
import
com.yiring.app.param.post.PostModifyParam
;
import
com.yiring.app.param.post.PostParam
;
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.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
;
...
@@ -16,6 +16,7 @@ import com.yiring.auth.excel.post.PostExcel;
...
@@ -16,6 +16,7 @@ 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.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
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.io.OutputStream
;
import
java.io.OutputStream
;
...
@@ -49,26 +50,28 @@ public class PostServiceImpl implements PostService {
...
@@ -49,26 +50,28 @@ public class PostServiceImpl implements PostService {
PostRepository
postRepository
;
PostRepository
postRepository
;
@Override
@Override
public
Result
<
String
>
addPost
(
Post
Param
post
Param
)
{
public
Result
<
String
>
addPost
(
Post
AddParam
postAdd
Param
)
{
// 判断职位是否存在
// 判断职位是否存在
if
(
hasPostInfo
(
postParam
.
getName
()))
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位已存在"
);
if
(
hasPostInfo
(
postAddParam
.
getName
()))
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位已存在"
);
Post
post
=
PostParam
.
transform
(
postParam
);
Post
post
=
PostAddParam
.
transform
(
postAddParam
);
postRepository
.
save
(
post
);
postRepository
.
save
(
post
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
String
>
modifyPost
(
PostModifyParam
postParam
)
{
public
Result
<
String
>
modifyPost
(
PostModifyParam
post
Modify
Param
)
{
// 是否变更 职位名称
// 是否变更 职位名称
long
count
=
postRepository
.
count
(
long
count
=
postRepository
.
count
(
Example
.
of
(
Post
.
builder
().
id
(
post
Param
.
getId
()).
name
(
post
Param
.
getName
()).
build
())
Example
.
of
(
Post
.
builder
().
id
(
post
ModifyParam
.
getId
()).
name
(
postModify
Param
.
getName
()).
build
())
);
);
// 变更处理
// 变更处理
if
(
count
==
0
&&
hasPostInfo
(
postParam
.
getName
()))
{
if
(
count
==
0
&&
hasPostInfo
(
post
Modify
Param
.
getName
()))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位名称重复"
);
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"职位名称重复"
);
}
}
Post
post
=
postParam
.
transform
(
postParam
);
Post
post
=
postModifyParam
.
transform
(
postModifyParam
);
postRepository
.
save
(
post
);
postRepository
.
save
(
post
);
return
Result
.
ok
();
return
Result
.
ok
();
}
}
...
@@ -81,11 +84,25 @@ public class PostServiceImpl implements PostService {
...
@@ -81,11 +84,25 @@ public class PostServiceImpl implements PostService {
}
}
@Override
@Override
public
Result
<
PageVo
<
PostVo
>>
findPostPage
(
PostFindParam
param
,
PageParam
pageParam
)
{
public
Result
<
PageVo
<
PostVo
>>
findPostPage
(
PostFindParam
postFindParam
,
PageParam
pageParam
)
{
Specification
<
Post
>
specification
=
getPostPageSpecification
(
param
);
Specification
<
Post
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
postFindParam
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
postFindParam
.
getName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
postFindParam
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postFindParam
.
getEnable
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
// 分页
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
,
postVos
.
size
());
PageVo
<
PostVo
>
pageVo
=
PageVo
.
build
(
postVos
,
postVos
.
size
());
...
@@ -93,10 +110,10 @@ public class PostServiceImpl implements PostService {
...
@@ -93,10 +110,10 @@ public class PostServiceImpl implements PostService {
}
}
@Override
@Override
public
Result
<
PostVo
>
findPostById
(
IdParam
idParam
)
{
public
Result
<
Post
Info
Vo
>
findPostById
(
IdParam
idParam
)
{
Post
post
=
postRepository
.
getById
(
idParam
.
getId
());
Post
post
=
postRepository
.
getById
(
idParam
.
getId
());
Post
Vo
postVo
=
Post
Vo
.
transform
(
post
);
Post
InfoVo
postInfoVo
=
PostInfo
Vo
.
transform
(
post
);
return
Result
.
ok
(
postVo
);
return
Result
.
ok
(
post
Info
Vo
);
}
}
@Override
@Override
...
@@ -106,8 +123,23 @@ public class PostServiceImpl implements PostService {
...
@@ -106,8 +123,23 @@ public class PostServiceImpl implements PostService {
}
}
@Override
@Override
public
void
exportPostInfo
(
PostFindParam
param
,
HttpServletResponse
response
)
{
public
void
exportPostInfo
(
PostExportParam
postExportParam
,
HttpServletResponse
response
)
{
Specification
<
Post
>
specification
=
getPostPageSpecification
(
param
);
Specification
<
Post
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
postExportParam
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
postExportParam
.
getName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
postExportParam
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postExportParam
.
getEnable
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
List
<
PostExcel
>
postExcels
=
postList
.
stream
().
map
(
PostExcel:
:
transform
).
collect
(
Collectors
.
toList
());
List
<
PostExcel
>
postExcels
=
postList
.
stream
().
map
(
PostExcel:
:
transform
).
collect
(
Collectors
.
toList
());
try
(
try
(
...
@@ -125,9 +157,11 @@ public class PostServiceImpl implements PostService {
...
@@ -125,9 +157,11 @@ public class PostServiceImpl implements PostService {
streamExcelBuilder
.
append
(
postExcels
);
streamExcelBuilder
.
append
(
postExcels
);
String
fileName
=
URLEncoder
.
encode
(
"职位信息.xlsx"
,
StandardCharsets
.
UTF_8
);
String
fileName
=
URLEncoder
.
encode
(
"职位信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
OutputStream
out
=
response
.
getOutputStream
();
Workbook
workbook
=
streamExcelBuilder
.
fixedTitles
().
build
();
Workbook
workbook
=
streamExcelBuilder
.
fixedTitles
().
build
();
...
@@ -142,28 +176,21 @@ public class PostServiceImpl implements PostService {
...
@@ -142,28 +176,21 @@ public class PostServiceImpl implements PostService {
}
}
@Override
@Override
public
Result
<
PageVo
<
PostVo
>>
selectPost
()
{
public
Result
<
PageVo
<
PostIndexVo
>>
indexPost
(
IndexParam
indexParam
)
{
List
<
Post
>
posts
=
postRepository
.
findAll
();
List
<
Post
>
posts
=
postRepository
.
findAll
((
root
,
cq
,
cb
)
->
{
List
<
PostVo
>
postVos
=
posts
.
stream
().
map
(
PostVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
PostVo
>
pageVo
=
PageVo
.
build
(
postVos
,
postVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
private
Specification
<
Post
>
getPostPageSpecification
(
PostFindParam
param
)
{
return
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
param
.
getName
()))
{
if
(
StrUtil
.
isNotEmpty
(
indexParam
.
getStr
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
param
.
getName
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
indexParam
.
getStr
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
param
.
getEnable
()));
}
}
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
Fields
.
createTime
));
Order
order
=
cb
.
desc
(
root
.
get
(
Post
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
});
List
<
PostIndexVo
>
postIndexVos
=
posts
.
stream
().
map
(
PostIndexVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
PostIndexVo
>
pageVo
=
PageVo
.
build
(
postIndexVos
,
postIndexVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
}
}
}
app/src/main/java/com/yiring/app/service/user/UserService.java
浏览文件 @
6a615c7b
...
@@ -2,9 +2,11 @@
...
@@ -2,9 +2,11 @@
package
com
.
yiring
.
app
.
service
.
user
;
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.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
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.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -18,25 +20,25 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -18,25 +20,25 @@ import org.springframework.web.multipart.MultipartFile;
public
interface
UserService
{
public
interface
UserService
{
/**
/**
* 表格查询
* 表格查询
* @param
p
aram UserByNameParam
* @param
userFindP
aram UserByNameParam
* @param pageParam PageParam
* @param pageParam PageParam
* @return Result<PageVo<UserAutoVo>>
* @return Result<PageVo<UserAutoVo>>
*/
*/
Result
<
PageVo
<
UserVo
>>
findUserPage
(
UserFindParam
p
aram
,
PageParam
pageParam
);
Result
<
PageVo
<
UserVo
>>
findUserPage
(
UserFindParam
userFindP
aram
,
PageParam
pageParam
);
/**
/**
* 用户详细信息
* 用户详细信息
* @param idParam IdParam
* @param idParam IdParam
* @return Result<UserVo>
* @return Result<UserVo>
*/
*/
Result
<
UserVo
>
findUserById
(
IdParam
idParam
);
Result
<
User
Info
Vo
>
findUserById
(
IdParam
idParam
);
/**
/**
* 用户绑定标签
* 用户绑定标签
* @param
p
aram UserBingTagParam
* @param
userBingTagP
aram UserBingTagParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
userBingTag
(
UserBingTagParam
p
aram
);
Result
<
String
>
userBingTag
(
UserBingTagParam
userBingTagP
aram
);
/**
/**
* 收卡
* 收卡
...
@@ -53,17 +55,11 @@ public interface UserService {
...
@@ -53,17 +55,11 @@ public interface UserService {
Result
<
String
>
deleteUser
(
IdParam
idParam
);
Result
<
String
>
deleteUser
(
IdParam
idParam
);
/**
/**
* 下拉菜单
* @return Result<PageVo<UserVo>>
*/
Result
<
PageVo
<
UserVo
>>
selectUser
();
/**
* 导出用户
* 导出用户
* @param
p
aram UserFindParam
* @param
userFindP
aram UserFindParam
* @param response HttpServletResponse
* @param response HttpServletResponse
*/
*/
void
exportUser
(
UserFindParam
p
aram
,
HttpServletResponse
response
);
void
exportUser
(
UserFindParam
userFindP
aram
,
HttpServletResponse
response
);
/**
/**
* 启用/停用
* 启用/停用
...
@@ -74,17 +70,17 @@ public interface UserService {
...
@@ -74,17 +70,17 @@ public interface UserService {
/**
/**
* 修改用户
* 修改用户
* @param
p
aram UserModifyParam
* @param
userModifyP
aram UserModifyParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
modifyUser
(
UserModifyParam
p
aram
);
Result
<
String
>
modifyUser
(
UserModifyParam
userModifyP
aram
);
/**
/**
* 新增用户
* 新增用户
* @param
p
aram UserAddParam
* @param
userAddP
aram UserAddParam
* @return Result<String>
* @return Result<String>
*/
*/
Result
<
String
>
addUser
(
UserAddParam
p
aram
);
Result
<
String
>
addUser
(
UserAddParam
userAddP
aram
);
/**
/**
* 导入
* 导入
...
@@ -95,8 +91,8 @@ public interface UserService {
...
@@ -95,8 +91,8 @@ public interface UserService {
/**
/**
* 用户索引
* 用户索引
* @param
param User
IndexParam
* @param
indexParam
IndexParam
* @return Result<PageVo<UserVo>>
* @return Result<PageVo<UserVo>>
*/
*/
Result
<
PageVo
<
UserVo
>>
indexUser
(
UserIndexParam
p
aram
);
Result
<
PageVo
<
UserVo
>>
indexUser
(
IndexParam
indexP
aram
);
}
}
app/src/main/java/com/yiring/app/service/user/impl/UserServiceImpl.java
浏览文件 @
6a615c7b
...
@@ -13,6 +13,7 @@ import com.yiring.app.excel.user.UserImportExcel;
...
@@ -13,6 +13,7 @@ import com.yiring.app.excel.user.UserImportExcel;
import
com.yiring.app.param.user.*
;
import
com.yiring.app.param.user.*
;
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.UserService
;
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.domain.dept.Department
;
import
com.yiring.auth.domain.dept.Department
;
import
com.yiring.auth.domain.dept.DepartmentRepository
;
import
com.yiring.auth.domain.dept.DepartmentRepository
;
...
@@ -24,6 +25,7 @@ import com.yiring.common.core.Result;
...
@@ -24,6 +25,7 @@ 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
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.IndexParam
;
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.io.IOException
;
import
java.io.IOException
;
...
@@ -76,8 +78,8 @@ public class UserServiceImpl implements UserService {
...
@@ -76,8 +78,8 @@ public class UserServiceImpl implements UserService {
PostRepository
postRepository
;
PostRepository
postRepository
;
@Override
@Override
public
Result
<
PageVo
<
UserVo
>>
findUserPage
(
UserFindParam
p
aram
,
PageParam
pageParam
)
{
public
Result
<
PageVo
<
UserVo
>>
findUserPage
(
UserFindParam
userFindP
aram
,
PageParam
pageParam
)
{
CriteriaQuery
<
UserVo
>
cq
=
getUserVoCriteriaQuery
(
p
aram
);
CriteriaQuery
<
UserVo
>
cq
=
getUserVoCriteriaQuery
(
userFindP
aram
);
List
<
UserVo
>
userVos
=
em
List
<
UserVo
>
userVos
=
em
.
createQuery
(
cq
)
.
createQuery
(
cq
)
...
@@ -89,19 +91,19 @@ public class UserServiceImpl implements UserService {
...
@@ -89,19 +91,19 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
UserVo
>
findUserById
(
IdParam
idParam
)
{
public
Result
<
User
Info
Vo
>
findUserById
(
IdParam
idParam
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
idParam
.
getId
()).
build
()));
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
idParam
.
getId
()).
build
()));
if
(
userOptional
.
isPresent
())
{
if
(
userOptional
.
isPresent
())
{
User
Vo
userVo
=
UserVo
.
transformUserInfo
(
userOptional
.
get
());
User
InfoVo
userInfoVo
=
UserInfoVo
.
transform
(
userOptional
.
get
());
return
Result
.
ok
(
userVo
);
return
Result
.
ok
(
user
Info
Vo
);
}
}
return
Result
.
no
(
Status
.
BAD_REQUEST
);
return
Result
.
no
(
Status
.
BAD_REQUEST
);
}
}
@Override
@Override
public
Result
<
String
>
userBingTag
(
UserBingTagParam
p
aram
)
{
public
Result
<
String
>
userBingTag
(
UserBingTagParam
userBingTagP
aram
)
{
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
code
(
p
aram
.
getCode
()).
build
())
Example
.
of
(
LocationTag
.
builder
().
code
(
userBingTagP
aram
.
getCode
()).
build
())
);
);
if
(
locationTagOptional
.
isEmpty
())
throw
new
RuntimeException
(
"标签卡不存在"
);
if
(
locationTagOptional
.
isEmpty
())
throw
new
RuntimeException
(
"标签卡不存在"
);
...
@@ -110,7 +112,7 @@ public class UserServiceImpl implements UserService {
...
@@ -110,7 +112,7 @@ public class UserServiceImpl implements UserService {
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
throw
new
RuntimeException
(
"已绑定其他用户 : "
+
locationTag
.
getUser
().
getRealName
());
}
}
locationTag
.
setUser
(
User
.
builder
().
id
(
p
aram
.
getId
()).
build
());
locationTag
.
setUser
(
User
.
builder
().
id
(
userBingTagP
aram
.
getId
()).
build
());
locationTag
.
setUsed
(
true
);
locationTag
.
setUsed
(
true
);
locationTagRepository
.
save
(
locationTag
);
locationTagRepository
.
save
(
locationTag
);
...
@@ -147,16 +149,8 @@ public class UserServiceImpl implements UserService {
...
@@ -147,16 +149,8 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
PageVo
<
UserVo
>>
selectUser
()
{
public
void
exportUser
(
UserFindParam
userFindParam
,
HttpServletResponse
response
)
{
List
<
User
>
users
=
userRepository
.
findAll
();
CriteriaQuery
<
UserVo
>
cq
=
getUserVoCriteriaQuery
(
userFindParam
);
List
<
UserVo
>
userVos
=
UserVo
.
transforms
(
users
);
PageVo
<
UserVo
>
pageVo
=
PageVo
.
build
(
userVos
,
userVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
@Override
public
void
exportUser
(
UserFindParam
param
,
HttpServletResponse
response
)
{
CriteriaQuery
<
UserVo
>
cq
=
getUserVoCriteriaQuery
(
param
);
List
<
UserVo
>
userVos
=
em
.
createQuery
(
cq
).
getResultList
();
List
<
UserVo
>
userVos
=
em
.
createQuery
(
cq
).
getResultList
();
List
<
UserExportExcel
>
userExportExcels
=
userVos
List
<
UserExportExcel
>
userExportExcels
=
userVos
.
stream
()
.
stream
()
...
@@ -215,20 +209,22 @@ public class UserServiceImpl implements UserService {
...
@@ -215,20 +209,22 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
String
>
modifyUser
(
UserModifyParam
param
)
{
public
Result
<
String
>
modifyUser
(
UserModifyParam
userModifyParam
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
param
.
getId
()).
build
()));
Optional
<
User
>
userOptional
=
userRepository
.
findOne
(
Example
.
of
(
User
.
builder
().
id
(
userModifyParam
.
getId
()).
build
())
);
if
(
userOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"用户不存在"
);
if
(
userOptional
.
isEmpty
())
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"用户不存在"
);
User
user
=
userOptional
.
get
();
User
user
=
userOptional
.
get
();
if
(!
StrUtil
.
equals
(
user
.
getUuid
(),
p
aram
.
getUuid
()))
{
if
(!
StrUtil
.
equals
(
user
.
getUuid
(),
userModifyP
aram
.
getUuid
()))
{
long
count
=
userRepository
.
count
(
Example
.
of
(
User
.
builder
().
uuid
(
p
aram
.
getUuid
()).
build
()));
long
count
=
userRepository
.
count
(
Example
.
of
(
User
.
builder
().
uuid
(
userModifyP
aram
.
getUuid
()).
build
()));
if
(
count
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"工号相同"
);
if
(
count
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"工号相同"
);
}
}
User
newUser
=
p
aram
.
transform
();
User
newUser
=
userModifyP
aram
.
transform
();
userRepository
.
save
(
newUser
);
userRepository
.
save
(
newUser
);
...
@@ -236,12 +232,12 @@ public class UserServiceImpl implements UserService {
...
@@ -236,12 +232,12 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
String
>
addUser
(
UserAddParam
p
aram
)
{
public
Result
<
String
>
addUser
(
UserAddParam
userAddP
aram
)
{
long
count
=
userRepository
.
count
(
Example
.
of
(
User
.
builder
().
uuid
(
p
aram
.
getUuid
()).
build
()));
long
count
=
userRepository
.
count
(
Example
.
of
(
User
.
builder
().
uuid
(
userAddP
aram
.
getUuid
()).
build
()));
if
(
count
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"工号相同"
);
if
(
count
>
0
)
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"工号相同"
);
User
user
=
param
.
transform
(
);
User
user
=
UserAddParam
.
transform
(
userAddParam
);
userRepository
.
save
(
user
);
userRepository
.
save
(
user
);
return
Result
.
ok
();
return
Result
.
ok
();
...
@@ -302,10 +298,11 @@ public class UserServiceImpl implements UserService {
...
@@ -302,10 +298,11 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
UserIndexParam
p
aram
)
{
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
IndexParam
indexP
aram
)
{
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
UserVo
>
cq
=
cb
.
createQuery
(
UserVo
.
class
);
CriteriaQuery
<
UserVo
>
cq
=
cb
.
createQuery
(
UserVo
.
class
);
Root
<
User
>
root
=
cq
.
from
(
User
.
class
);
Root
<
User
>
root
=
cq
.
from
(
User
.
class
);
Expression
<
Long
>
id
=
root
.
get
(
BasicEntity
.
Fields
.
id
);
Expression
<
String
>
realName
=
root
.
get
(
User
.
Fields
.
realName
);
Expression
<
String
>
realName
=
root
.
get
(
User
.
Fields
.
realName
);
Expression
<
String
>
uuid
=
root
.
get
(
User
.
Fields
.
uuid
);
Expression
<
String
>
uuid
=
root
.
get
(
User
.
Fields
.
uuid
);
Expression
<
User
.
Type
>
type
=
root
.
get
(
User
.
Fields
.
type
);
Expression
<
User
.
Type
>
type
=
root
.
get
(
User
.
Fields
.
type
);
...
@@ -320,14 +317,14 @@ public class UserServiceImpl implements UserService {
...
@@ -320,14 +317,14 @@ public class UserServiceImpl implements UserService {
query
.
select
(
tagRoot
.
get
(
LocationTag
.
Fields
.
code
));
query
.
select
(
tagRoot
.
get
(
LocationTag
.
Fields
.
code
));
query
.
where
(
cb
.
equal
(
tagRoot
.
get
(
LocationTag
.
Fields
.
user
),
root
));
query
.
where
(
cb
.
equal
(
tagRoot
.
get
(
LocationTag
.
Fields
.
user
),
root
));
cq
.
multiselect
(
realName
,
uuid
,
type
,
department
,
mobile
,
post
,
query
,
gender
,
isSpecial
);
cq
.
multiselect
(
id
,
realName
,
uuid
,
type
,
department
,
mobile
,
post
,
query
,
gender
,
isSpecial
);
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
p
aram
.
getStr
()))
{
if
(
StrUtil
.
isNotEmpty
(
indexP
aram
.
getStr
()))
{
if
(
StrUtil
.
isNumeric
(
p
aram
.
getStr
()))
{
if
(
StrUtil
.
isNumeric
(
indexP
aram
.
getStr
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
mobile
),
p
aram
.
getStr
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
mobile
),
indexP
aram
.
getStr
()
+
"%"
));
}
else
{
}
else
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
p
aram
.
getStr
()
+
"%"
));
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
indexP
aram
.
getStr
()
+
"%"
));
}
}
}
}
...
@@ -346,6 +343,7 @@ public class UserServiceImpl implements UserService {
...
@@ -346,6 +343,7 @@ public class UserServiceImpl implements UserService {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
UserVo
>
cq
=
cb
.
createQuery
(
UserVo
.
class
);
CriteriaQuery
<
UserVo
>
cq
=
cb
.
createQuery
(
UserVo
.
class
);
Root
<
User
>
root
=
cq
.
from
(
User
.
class
);
Root
<
User
>
root
=
cq
.
from
(
User
.
class
);
Expression
<
Long
>
id
=
root
.
get
(
BasicEntity
.
Fields
.
id
);
Expression
<
String
>
realName
=
root
.
get
(
User
.
Fields
.
realName
);
Expression
<
String
>
realName
=
root
.
get
(
User
.
Fields
.
realName
);
Expression
<
String
>
uuid
=
root
.
get
(
User
.
Fields
.
uuid
);
Expression
<
String
>
uuid
=
root
.
get
(
User
.
Fields
.
uuid
);
Expression
<
User
.
Type
>
type
=
root
.
get
(
User
.
Fields
.
type
);
Expression
<
User
.
Type
>
type
=
root
.
get
(
User
.
Fields
.
type
);
...
@@ -360,7 +358,7 @@ public class UserServiceImpl implements UserService {
...
@@ -360,7 +358,7 @@ public class UserServiceImpl implements UserService {
query
.
select
(
tagRoot
.
get
(
LocationTag
.
Fields
.
code
));
query
.
select
(
tagRoot
.
get
(
LocationTag
.
Fields
.
code
));
query
.
where
(
cb
.
equal
(
tagRoot
.
get
(
LocationTag
.
Fields
.
user
),
root
));
query
.
where
(
cb
.
equal
(
tagRoot
.
get
(
LocationTag
.
Fields
.
user
),
root
));
cq
.
multiselect
(
realName
,
uuid
,
type
,
department
,
mobile
,
post
,
query
,
gender
,
isSpecial
);
cq
.
multiselect
(
id
,
realName
,
uuid
,
type
,
department
,
mobile
,
post
,
query
,
gender
,
isSpecial
);
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
...
...
app/src/main/java/com/yiring/app/vo/dept/DepartmentInfoVo.java
浏览文件 @
6a615c7b
...
@@ -64,7 +64,7 @@ public class DepartmentInfoVo implements Serializable {
...
@@ -64,7 +64,7 @@ public class DepartmentInfoVo implements Serializable {
return
DepartmentInfoVo
return
DepartmentInfoVo
.
builder
()
.
builder
()
.
name
(
department
.
getName
())
.
name
(
department
.
getName
())
.
userVo
(
UserVo
.
transform
(
department
.
getLeader
()))
.
userVo
(
UserVo
.
transform
Dept
(
department
.
getLeader
()))
.
enable
(
department
.
getEnable
())
.
enable
(
department
.
getEnable
())
.
posts
(
department
.
getPosts
())
.
posts
(
department
.
getPosts
())
.
pid
(
department
.
getPid
())
.
pid
(
department
.
getPid
())
...
...
app/src/main/java/com/yiring/app/vo/dept/DepartmentVo.java
浏览文件 @
6a615c7b
...
@@ -37,6 +37,10 @@ public class DepartmentVo implements Serializable {
...
@@ -37,6 +37,10 @@ public class DepartmentVo implements Serializable {
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"111"
)
Long
id
;
Long
id
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"上级部门"
,
example
=
"0根目录"
)
Long
pid
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"研发部"
)
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"研发部"
)
String
name
;
String
name
;
...
@@ -46,10 +50,6 @@ public class DepartmentVo implements Serializable {
...
@@ -46,10 +50,6 @@ public class DepartmentVo implements Serializable {
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"T/F"
)
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"T/F"
)
Boolean
enable
;
Boolean
enable
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"上级部门"
,
example
=
"0根目录"
)
Long
pid
;
@ApiModelProperty
(
value
=
"上级部门名称"
,
example
=
"前端"
)
@ApiModelProperty
(
value
=
"上级部门名称"
,
example
=
"前端"
)
String
pName
;
String
pName
;
...
@@ -73,7 +73,7 @@ public class DepartmentVo implements Serializable {
...
@@ -73,7 +73,7 @@ public class DepartmentVo implements Serializable {
.
createTime
(
department
.
getCreateTime
())
.
createTime
(
department
.
getCreateTime
())
.
build
();
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
department
.
getLeader
()))
{
departmentVo
.
setLeader
(
UserVo
.
transform
(
department
.
getLeader
()));
departmentVo
.
setLeader
(
UserVo
.
transform
Dept
(
department
.
getLeader
()));
}
}
return
departmentVo
;
return
departmentVo
;
}
}
...
...
app/src/main/java/com/yiring/app/vo/location/tag/LocationTagIndexVo.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
tag
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.location.LocationTag
;
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/27
*/
@ApiModel
(
"LocationTagIndexVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationTagIndexVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
1459205162627200071L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"188354391834"
)
Long
id
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTT88888888"
)
String
code
;
@ApiModelProperty
(
value
=
"标签型号"
,
example
=
"BTT01"
)
LocationTag
.
Type
type
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"0/1"
)
Boolean
used
;
public
static
LocationTagIndexVo
transform
(
LocationTag
locationTag
)
{
return
LocationTagIndexVo
.
builder
()
.
id
(
locationTag
.
getId
())
.
code
(
locationTag
.
getCode
())
.
type
(
locationTag
.
getType
())
.
used
(
locationTag
.
getUsed
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/tag/LocationTagTypeVo.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
.
tag
;
import
cn.hutool.core.util.StrUtil
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.location.LocationTag
;
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/27
*/
@ApiModel
(
"LocationTagTypeVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
LocationTagTypeVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
5223102796143763942L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"188354391834"
)
Long
id
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"BTT88888888"
)
String
code
;
@ApiModelProperty
(
value
=
"标签型号"
,
example
=
"BTT01"
)
LocationTag
.
Type
type
;
@ApiModelProperty
(
value
=
"标签类型"
,
example
=
"人员"
)
String
tagType
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"类型(1:内部/2:访客/3:承包商)"
)
Integer
category
;
public
static
LocationTagTypeVo
transform
(
LocationTag
locationTag
)
{
String
entityType
=
StrUtil
.
equals
(
locationTag
.
getType
().
name
(),
"BTT02"
)
?
"car"
:
"staff"
;
return
LocationTagTypeVo
.
builder
()
.
id
(
locationTag
.
getId
())
.
code
(
locationTag
.
getCode
())
.
type
(
locationTag
.
getType
())
.
tagType
(
entityType
)
.
category
(
locationTag
.
getCategory
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/location/LocationTagVo.java
→
app/src/main/java/com/yiring/app/vo/location/
tag/
LocationTagVo.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
location
;
package
com
.
yiring
.
app
.
vo
.
location
.
tag
;
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
;
...
@@ -42,12 +42,12 @@ public class LocationTagVo implements Serializable {
...
@@ -42,12 +42,12 @@ public class LocationTagVo implements Serializable {
@ApiModelProperty
(
value
=
"状态"
,
example
=
"静止"
)
@ApiModelProperty
(
value
=
"状态"
,
example
=
"静止"
)
Boolean
silent
;
Boolean
silent
;
@ApiModelProperty
(
value
=
"电量"
,
example
=
"1"
)
Integer
volt
;
@ApiModelProperty
(
value
=
"imei 设备编码"
,
example
=
"88888888"
)
@ApiModelProperty
(
value
=
"imei 设备编码"
,
example
=
"88888888"
)
String
imei
;
String
imei
;
@ApiModelProperty
(
value
=
"电量"
,
example
=
"1"
)
Integer
volt
;
@ApiModelProperty
(
value
=
"最近更新时间"
,
example
=
"2022-01-01 00:00:00"
)
@ApiModelProperty
(
value
=
"最近更新时间"
,
example
=
"2022-01-01 00:00:00"
)
LocalDateTime
updateTime
;
LocalDateTime
updateTime
;
...
...
app/src/main/java/com/yiring/app/vo/post/PostIndexVo.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
post
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.auth.domain.post.Post
;
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/27
*/
@ApiModel
(
"PostIndexVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostIndexVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
6787422359697016766L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
)
String
name
;
public
static
PostIndexVo
transform
(
Post
post
)
{
return
PostIndexVo
.
builder
().
id
(
post
.
getId
()).
name
(
post
.
getName
()).
build
();
}
}
app/src/main/java/com/yiring/app/vo/post/PostInfoVo.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
post
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.auth.domain.post.Post
;
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/27
*/
@ApiModel
(
"PostInfoVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
PostInfoVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
8256863200798776816L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
)
String
name
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
String
describe
;
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"创建时间"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"更新时间"
)
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"职位状态"
,
example
=
"true"
)
Boolean
enable
;
public
static
PostInfoVo
transform
(
Post
post
)
{
return
PostInfoVo
.
builder
()
.
id
(
post
.
getId
())
.
name
(
post
.
getName
())
.
describe
(
post
.
getDescribe
())
.
enable
(
post
.
getEnable
())
.
createTime
(
post
.
getCreateTime
())
.
updateTime
(
post
.
getUpdateTime
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/post/PostVo.java
浏览文件 @
6a615c7b
...
@@ -36,16 +36,10 @@ public class PostVo implements Serializable {
...
@@ -36,16 +36,10 @@ public class PostVo implements Serializable {
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
)
@ApiModelProperty
(
value
=
"名称"
,
example
=
"Java"
)
String
name
;
String
name
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述"
)
String
describe
;
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"创建时间"
)
LocalDateTime
createTime
;
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"更新时间"
)
@ApiModelProperty
(
value
=
"职位状态"
,
example
=
"true"
)
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enable
;
Boolean
enable
;
public
static
PostVo
transform
(
Post
post
)
{
public
static
PostVo
transform
(
Post
post
)
{
...
@@ -53,10 +47,8 @@ public class PostVo implements Serializable {
...
@@ -53,10 +47,8 @@ public class PostVo implements Serializable {
.
builder
()
.
builder
()
.
id
(
post
.
getId
())
.
id
(
post
.
getId
())
.
name
(
post
.
getName
())
.
name
(
post
.
getName
())
.
describe
(
post
.
getDescribe
())
.
enable
(
post
.
getEnable
())
.
enable
(
post
.
getEnable
())
.
createTime
(
post
.
getCreateTime
())
.
createTime
(
post
.
getCreateTime
())
.
updateTime
(
post
.
getUpdateTime
())
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/vo/user/UserInfoVo.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
vo
.
user
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
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.time.LocalDateTime
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户详细信息模型
*
* @author LJ-2204
* @date 2022/4/27
*/
@ApiModel
(
"UserInfoVo"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserInfoVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
-
1040199557851348068L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@ApiModelProperty
(
value
=
"主键"
,
example
=
"1"
)
Long
id
;
@ApiModelProperty
(
value
=
"真实姓名"
,
example
=
"超级用户"
)
String
realName
;
@ApiModelProperty
(
value
=
"工号"
,
example
=
"8888888"
)
String
uuid
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"员工"
)
User
.
Type
type
;
@ApiModelProperty
(
value
=
"部门"
,
example
=
"系统管理员"
)
String
department
;
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
String
mobile
;
@ApiModelProperty
(
value
=
"职位"
,
example
=
"系统管理员"
)
String
post
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
email
;
@ApiModelProperty
(
value
=
"头像"
,
example
=
"https://s1.ax1x.com/2022/03/30/qggJH0.jpg"
)
String
avatar
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enabled
;
@ApiModelProperty
(
value
=
"是否删除"
,
example
=
"false"
)
Boolean
deleted
;
@ApiModelProperty
(
value
=
"是否特殊"
,
example
=
"false"
)
Boolean
isSpecial
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"false"
)
Boolean
gender
;
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2022-01-01 00:00:00"
)
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"2022-01-01 00:00:00"
)
LocalDateTime
updateTime
;
public
static
UserInfoVo
transform
(
User
user
)
{
return
UserInfoVo
.
builder
()
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
uuid
(
user
.
getUuid
())
.
type
(
user
.
getType
())
.
department
(
user
.
getDepartment
().
getName
())
.
mobile
(
user
.
getMobile
())
.
post
(
user
.
getPost
().
getName
())
.
email
(
user
.
getEmail
())
.
avatar
(
user
.
getAvatar
())
.
enabled
(
user
.
getEnabled
())
.
deleted
(
user
.
getDeleted
())
.
isSpecial
(
user
.
getIsSpecial
())
.
gender
(
user
.
getGender
())
.
createTime
(
user
.
getCreateTime
())
.
updateTime
(
user
.
getUpdateTime
())
.
build
();
}
}
app/src/main/java/com/yiring/app/vo/user/UserVo.java
浏览文件 @
6a615c7b
...
@@ -8,9 +8,6 @@ import io.swagger.annotations.ApiModel;
...
@@ -8,9 +8,6 @@ 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.util.List
;
import
java.util.stream.Collectors
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
...
@@ -56,75 +53,17 @@ public class UserVo implements Serializable {
...
@@ -56,75 +53,17 @@ public class UserVo implements Serializable {
@ApiModelProperty
(
value
=
"标签编号"
,
example
=
"BTT88888888"
)
@ApiModelProperty
(
value
=
"标签编号"
,
example
=
"BTT88888888"
)
String
code
;
String
code
;
@ApiModelProperty
(
value
=
"用户名"
,
example
=
"admin"
)
String
username
;
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
email
;
@ApiModelProperty
(
value
=
"头像"
,
example
=
"https://s1.ax1x.com/2022/03/30/qggJH0.jpg"
)
String
avatar
;
@ApiModelProperty
(
value
=
"是否启用"
,
example
=
"true"
)
Boolean
enabled
;
@ApiModelProperty
(
value
=
"是否删除"
,
example
=
"false"
)
Boolean
deleted
;
@ApiModelProperty
(
value
=
"是否特殊"
,
example
=
"false"
)
@ApiModelProperty
(
value
=
"是否特殊"
,
example
=
"false"
)
Boolean
isSpecial
;
Boolean
isSpecial
;
@ApiModelProperty
(
value
=
"性别"
,
example
=
"false"
)
@ApiModelProperty
(
value
=
"性别"
,
example
=
"false"
)
Boolean
gender
;
Boolean
gender
;
@ApiModelProperty
(
value
=
"最后登录IP地址"
,
example
=
"127.0.0.1"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"developer@yiring.com"
)
String
lastLoginIp
;
String
email
;
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
LocalDateTime
lastLoginTime
;
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2022-01-01 00:00:00"
)
LocalDateTime
createTime
;
public
static
UserVo
transform
(
User
user
)
{
return
UserVo
.
builder
()
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
username
(
user
.
getUsername
())
.
mobile
(
user
.
getMobile
())
.
email
(
user
.
getEmail
())
.
enabled
(
user
.
getEnabled
())
.
deleted
(
user
.
getDeleted
())
.
lastLoginIp
(
user
.
getLastLoginIp
())
.
lastLoginTime
(
user
.
getLastLoginTime
())
.
createTime
(
user
.
getCreateTime
())
.
build
();
}
public
static
List
<
UserVo
>
transforms
(
List
<
User
>
users
)
{
return
users
.
stream
()
.
map
(
user
->
UserVo
.
builder
()
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
username
(
user
.
getUsername
())
.
mobile
(
user
.
getMobile
())
.
email
(
user
.
getEmail
())
.
avatar
(
user
.
getAvatar
())
.
enabled
(
user
.
getEnabled
())
.
deleted
(
user
.
getDeleted
())
.
lastLoginIp
(
user
.
getLastLoginIp
())
.
lastLoginTime
(
user
.
getLastLoginTime
())
.
createTime
(
user
.
getCreateTime
())
.
build
()
)
.
collect
(
Collectors
.
toList
());
}
public
UserVo
(
public
UserVo
(
Long
id
,
String
realName
,
String
realName
,
String
uuid
,
String
uuid
,
User
.
Type
type
,
User
.
Type
type
,
...
@@ -135,6 +74,7 @@ public class UserVo implements Serializable {
...
@@ -135,6 +74,7 @@ public class UserVo implements Serializable {
Boolean
gender
,
Boolean
gender
,
Boolean
isSpecial
Boolean
isSpecial
)
{
)
{
this
.
id
=
id
;
this
.
realName
=
realName
;
this
.
realName
=
realName
;
this
.
uuid
=
uuid
;
this
.
uuid
=
uuid
;
this
.
type
=
type
;
this
.
type
=
type
;
...
@@ -146,20 +86,13 @@ public class UserVo implements Serializable {
...
@@ -146,20 +86,13 @@ public class UserVo implements Serializable {
this
.
isSpecial
=
isSpecial
;
this
.
isSpecial
=
isSpecial
;
}
}
public
static
UserVo
transform
UserInfo
(
User
user
)
{
public
static
UserVo
transform
Dept
(
User
user
)
{
return
UserVo
return
UserVo
.
builder
()
.
builder
()
.
id
(
user
.
getId
())
.
id
(
user
.
getId
())
.
realName
(
user
.
getRealName
())
.
realName
(
user
.
getRealName
())
.
username
(
user
.
getUsername
())
.
mobile
(
user
.
getMobile
())
.
mobile
(
user
.
getMobile
())
.
email
(
user
.
getEmail
())
.
email
(
user
.
getEmail
())
.
avatar
(
user
.
getAvatar
())
.
enabled
(
user
.
getEnabled
())
.
deleted
(
user
.
getDeleted
())
.
lastLoginIp
(
user
.
getLastLoginIp
())
.
lastLoginTime
(
user
.
getLastLoginTime
())
.
createTime
(
user
.
getCreateTime
())
.
build
();
.
build
();
}
}
}
}
app/src/main/java/com/yiring/app/web/dept/DepartmentController.java
浏览文件 @
6a615c7b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
app
.
web
.
dept
;
package
com
.
yiring
.
app
.
web
.
dept
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentAddParam
;
import
com.yiring.app.param.dept.DepartmentExportParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentFindParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.param.dept.DepartmentModifyParam
;
import
com.yiring.app.service.dept.DepartmentService
;
import
com.yiring.app.service.dept.DepartmentService
;
...
@@ -39,14 +40,14 @@ public class DepartmentController {
...
@@ -39,14 +40,14 @@ public class DepartmentController {
@ApiOperation
(
"新增部门"
)
@ApiOperation
(
"新增部门"
)
@PostMapping
(
"addDepartment"
)
@PostMapping
(
"addDepartment"
)
public
Result
<
String
>
addDepartment
(
@Valid
DepartmentAddParam
p
aram
)
{
public
Result
<
String
>
addDepartment
(
@Valid
DepartmentAddParam
departmentAddP
aram
)
{
return
departmentService
.
addDepartment
(
p
aram
);
return
departmentService
.
addDepartment
(
departmentAddP
aram
);
}
}
@ApiOperation
(
"树形表格"
)
@ApiOperation
(
"树形表格"
)
@GetMapping
(
"findDepartmentTree"
)
@GetMapping
(
"findDepartmentTree"
)
public
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
@Valid
DepartmentFindParam
p
aram
)
{
public
Result
<
PageVo
<
DepartmentVo
>>
findDepartmentTree
(
@Valid
DepartmentFindParam
departmentFindP
aram
)
{
return
departmentService
.
findDepartmentTree
(
p
aram
);
return
departmentService
.
findDepartmentTree
(
departmentFindP
aram
);
}
}
@ApiOperation
(
"部门详细信息"
)
@ApiOperation
(
"部门详细信息"
)
...
@@ -57,8 +58,8 @@ public class DepartmentController {
...
@@ -57,8 +58,8 @@ public class DepartmentController {
@ApiOperation
(
"部门导出"
)
@ApiOperation
(
"部门导出"
)
@GetMapping
(
"exportDepartment"
)
@GetMapping
(
"exportDepartment"
)
public
void
exportDepartment
(
@Valid
Department
FindParam
p
aram
,
HttpServletResponse
response
)
{
public
void
exportDepartment
(
@Valid
Department
ExportParam
departmentExportP
aram
,
HttpServletResponse
response
)
{
departmentService
.
exportDepartment
(
p
aram
,
response
);
departmentService
.
exportDepartment
(
departmentExportP
aram
,
response
);
}
}
@ApiOperation
(
"逻辑删除部门"
)
@ApiOperation
(
"逻辑删除部门"
)
...
@@ -81,8 +82,8 @@ public class DepartmentController {
...
@@ -81,8 +82,8 @@ public class DepartmentController {
@ApiOperation
(
"部门编辑"
)
@ApiOperation
(
"部门编辑"
)
@PutMapping
(
"modifyDepartment"
)
@PutMapping
(
"modifyDepartment"
)
public
Result
<
String
>
modifyDepartment
(
@Valid
DepartmentModifyParam
p
aram
)
{
public
Result
<
String
>
modifyDepartment
(
@Valid
DepartmentModifyParam
departmentModifyP
aram
)
{
return
departmentService
.
modifyDept
(
p
aram
);
return
departmentService
.
modifyDept
(
departmentModifyP
aram
);
}
}
@ApiOperation
(
"部门导入"
)
@ApiOperation
(
"部门导入"
)
...
...
app/src/main/java/com/yiring/app/web/location/beacon/LocationBeaconController.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
location
.
beacon
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 定位信标
*
* @author LJ-2204
* @date 2022/4/27
*/
@Slf4j
@Validated
@Api
(
tags
=
"定位信标"
)
@RestController
@RequestMapping
(
"/location/beacon/"
)
public
class
LocationBeaconController
{}
app/src/main/java/com/yiring/app/web/location/tag/LocationTagController.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
location
.
tag
;
package
com
.
yiring
.
app
.
web
.
location
.
tag
;
import
com.yiring.app.param.location.LocationTagAddParam
;
import
com.yiring.app.param.location.tag.*
;
import
com.yiring.app.param.location.LocationTagDeleteParam
;
import
com.yiring.app.service.location.tag.LocationTagService
;
import
com.yiring.app.param.location.LocationTagFindParam
;
import
com.yiring.app.vo.location.tag.LocationTagIndexVo
;
import
com.yiring.app.param.location.LocationTagModifyParam
;
import
com.yiring.app.vo.location.tag.LocationTagVo
;
import
com.yiring.app.service.location.LocationTagService
;
import
com.yiring.app.vo.location.LocationTagVo
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.param.IndexParam
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -38,26 +37,32 @@ public class LocationTagController {
...
@@ -38,26 +37,32 @@ public class LocationTagController {
@ApiOperation
(
"新增定位标签"
)
@ApiOperation
(
"新增定位标签"
)
@PostMapping
(
"addLocationTag"
)
@PostMapping
(
"addLocationTag"
)
public
Result
<
String
>
addLocationTag
(
@Valid
LocationTagAddParam
p
aram
)
{
public
Result
<
String
>
addLocationTag
(
@Valid
LocationTagAddParam
locationTagAddP
aram
)
{
return
locationTagService
.
addLocationTag
(
p
aram
);
return
locationTagService
.
addLocationTag
(
locationTagAddP
aram
);
}
}
@ApiOperation
(
"分页查询"
)
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"findLocationTagPage"
)
@GetMapping
(
"findLocationTagPage"
)
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
@Valid
LocationTagFindParam
param
,
PageParam
pageParam
)
{
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
return
locationTagService
.
findLocationTagPage
(
param
,
pageParam
);
@Valid
LocationTagFindParam
locationTagFindParam
,
@Valid
PageParam
pageParam
)
{
return
locationTagService
.
findLocationTagPage
(
locationTagFindParam
,
pageParam
);
}
}
@ApiOperation
(
"销毁定位标签"
)
@ApiOperation
(
"销毁定位标签"
)
@DeleteMapping
(
"deleteLocationTag"
)
@DeleteMapping
(
"deleteLocationTag"
)
public
Result
<
String
>
deleteLocationTag
(
@Valid
LocationTagDeleteParam
p
aram
)
{
public
Result
<
String
>
deleteLocationTag
(
@Valid
LocationTagDeleteParam
locationTagDeleteP
aram
)
{
return
locationTagService
.
deleteLocationTag
(
p
aram
);
return
locationTagService
.
deleteLocationTag
(
locationTagDeleteP
aram
);
}
}
@ApiOperation
(
"导出定位标签"
)
@ApiOperation
(
"导出定位标签"
)
@GetMapping
(
"exportLocationTagInfo"
)
@GetMapping
(
"exportLocationTagInfo"
)
public
void
exportLocationTagInfo
(
@Valid
LocationTagFindParam
param
,
HttpServletResponse
response
)
{
public
void
exportLocationTagInfo
(
locationTagService
.
exportLocationTagInfo
(
param
,
response
);
@Valid
LocationTagExportParam
locationTagExportParam
,
HttpServletResponse
response
)
{
locationTagService
.
exportLocationTagInfo
(
locationTagExportParam
,
response
);
}
}
@ApiOperation
(
"导入定位标签"
)
@ApiOperation
(
"导入定位标签"
)
...
@@ -68,7 +73,13 @@ public class LocationTagController {
...
@@ -68,7 +73,13 @@ public class LocationTagController {
@ApiOperation
(
"修改定位标签"
)
@ApiOperation
(
"修改定位标签"
)
@PutMapping
(
"modifyLocationTag"
)
@PutMapping
(
"modifyLocationTag"
)
public
Result
<
String
>
modifyLocationTag
(
@Valid
LocationTagModifyParam
param
)
{
public
Result
<
String
>
modifyLocationTag
(
@Valid
LocationTagModifyParam
locationTagModifyParam
)
{
return
locationTagService
.
modifyLocationTag
(
param
);
return
locationTagService
.
modifyLocationTag
(
locationTagModifyParam
);
}
@ApiOperation
(
"标签检索"
)
@GetMapping
(
"indexLocationTag"
)
public
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
@Valid
IndexParam
indexParam
)
{
return
locationTagService
.
indexLocationTag
(
indexParam
);
}
}
}
}
app/src/main/java/com/yiring/app/web/location/tag/LocationTagTypeController.java
0 → 100644
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
location
.
tag
;
import
com.yiring.app.param.location.tag.LocationTagTypeFindParam
;
import
com.yiring.app.service.location.tag.LocationTagTypeService
;
import
com.yiring.app.vo.location.tag.LocationTagTypeVo
;
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
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 标签分配
*
* @author LJ-2204
* @date 2022/4/27
*/
@Slf4j
@Validated
@Api
(
tags
=
"标签分配"
)
@RestController
@RequestMapping
(
"/location/tag/type"
)
public
class
LocationTagTypeController
{
@Resource
LocationTagTypeService
locationTagTypeService
;
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"findLocationTagType"
)
public
Result
<
PageVo
<
LocationTagTypeVo
>>
findLocationTagType
(
@Valid
LocationTagTypeFindParam
locationTagTypeFindParam
,
@Valid
PageParam
pageParam
)
{
return
locationTagTypeService
.
findLocationTagType
(
locationTagTypeFindParam
,
pageParam
);
}
}
app/src/main/java/com/yiring/app/web/post/PostController.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
post
;
package
com
.
yiring
.
app
.
web
.
post
;
import
com.yiring.app.param.post.PostAddParam
;
import
com.yiring.app.param.post.PostExportParam
;
import
com.yiring.app.param.post.PostFindParam
;
import
com.yiring.app.param.post.PostFindParam
;
import
com.yiring.app.param.post.PostModifyParam
;
import
com.yiring.app.param.post.PostModifyParam
;
import
com.yiring.app.param.post.PostParam
;
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.PostInfoVo
;
import
com.yiring.app.vo.post.PostVo
;
import
com.yiring.app.vo.post.PostVo
;
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.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -37,14 +41,14 @@ public class PostController {
...
@@ -37,14 +41,14 @@ public class PostController {
@ApiOperation
(
value
=
"新增职位"
)
@ApiOperation
(
value
=
"新增职位"
)
@PostMapping
(
"addPost"
)
@PostMapping
(
"addPost"
)
public
Result
<
String
>
addPost
(
@Valid
Post
Param
post
Param
)
{
public
Result
<
String
>
addPost
(
@Valid
Post
AddParam
postAdd
Param
)
{
return
postService
.
addPost
(
postParam
);
return
postService
.
addPost
(
post
Add
Param
);
}
}
@ApiOperation
(
value
=
"修改职位"
)
@ApiOperation
(
value
=
"修改职位"
)
@PutMapping
(
"modifyPost"
)
@PutMapping
(
"modifyPost"
)
public
Result
<
String
>
modifyPost
(
@Valid
PostModifyParam
postParam
)
{
public
Result
<
String
>
modifyPost
(
@Valid
PostModifyParam
post
Modify
Param
)
{
return
postService
.
modifyPost
(
postParam
);
return
postService
.
modifyPost
(
post
Modify
Param
);
}
}
@ApiOperation
(
value
=
"销毁职位"
)
@ApiOperation
(
value
=
"销毁职位"
)
...
@@ -55,25 +59,25 @@ public class PostController {
...
@@ -55,25 +59,25 @@ public class PostController {
@ApiOperation
(
value
=
"分页查询"
)
@ApiOperation
(
value
=
"分页查询"
)
@GetMapping
(
"findPostPage"
)
@GetMapping
(
"findPostPage"
)
public
Result
<
PageVo
<
PostVo
>>
findPostPage
(
@Valid
PostFindParam
param
,
@Valid
PageParam
pageParam
)
{
public
Result
<
PageVo
<
PostVo
>>
findPostPage
(
@Valid
PostFindParam
p
ostFindP
aram
,
@Valid
PageParam
pageParam
)
{
return
postService
.
findPostPage
(
param
,
pageParam
);
return
postService
.
findPostPage
(
p
ostFindP
aram
,
pageParam
);
}
}
@ApiOperation
(
value
=
"详细信息查询"
)
@ApiOperation
(
value
=
"详细信息查询"
)
@GetMapping
(
"findPostById"
)
@GetMapping
(
"findPostById"
)
public
Result
<
PostVo
>
findPostById
(
@Valid
IdParam
idParam
)
{
public
Result
<
Post
Info
Vo
>
findPostById
(
@Valid
IdParam
idParam
)
{
return
postService
.
findPostById
(
idParam
);
return
postService
.
findPostById
(
idParam
);
}
}
@ApiOperation
(
value
=
"导出职位信息"
)
@ApiOperation
(
value
=
"导出职位信息"
)
@GetMapping
(
"exportPostInfo"
)
@GetMapping
(
"exportPostInfo"
)
public
void
exportPostInfo
(
@Valid
Post
FindParam
p
aram
,
HttpServletResponse
response
)
{
public
void
exportPostInfo
(
@Valid
Post
ExportParam
postExportP
aram
,
HttpServletResponse
response
)
{
postService
.
exportPostInfo
(
param
,
response
);
postService
.
exportPostInfo
(
p
ostExportP
aram
,
response
);
}
}
@ApiOperation
(
value
=
"
下拉菜单
"
)
@ApiOperation
(
value
=
"
职位检索
"
)
@GetMapping
(
"
select
Post"
)
@GetMapping
(
"
index
Post"
)
public
Result
<
PageVo
<
Post
Vo
>>
selectPost
(
)
{
public
Result
<
PageVo
<
Post
IndexVo
>>
indexPost
(
@Valid
IndexParam
indexParam
)
{
return
postService
.
selectPost
(
);
return
postService
.
indexPost
(
indexParam
);
}
}
}
}
app/src/main/java/com/yiring/app/web/user/UserAppController.java
浏览文件 @
6a615c7b
...
@@ -3,9 +3,11 @@ package com.yiring.app.web.user;
...
@@ -3,9 +3,11 @@ 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.UserService
;
import
com.yiring.app.vo.user.UserInfoVo
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.user.UserVo
;
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.PageParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -38,20 +40,20 @@ public class UserAppController {
...
@@ -38,20 +40,20 @@ public class UserAppController {
@ApiOperation
(
"表格查询"
)
@ApiOperation
(
"表格查询"
)
@GetMapping
(
"findUserPage"
)
@GetMapping
(
"findUserPage"
)
public
Result
<
PageVo
<
UserVo
>>
findUserPage
(
@Valid
UserFindParam
p
aram
,
@Valid
PageParam
pageParam
)
{
public
Result
<
PageVo
<
UserVo
>>
findUserPage
(
@Valid
UserFindParam
userFindP
aram
,
@Valid
PageParam
pageParam
)
{
return
userService
.
findUserPage
(
p
aram
,
pageParam
);
return
userService
.
findUserPage
(
userFindP
aram
,
pageParam
);
}
}
@ApiOperation
(
"用户详细信息查询"
)
@ApiOperation
(
"用户详细信息查询"
)
@GetMapping
(
"findUserById"
)
@GetMapping
(
"findUserById"
)
public
Result
<
UserVo
>
findUserById
(
@Valid
IdParam
idParam
)
{
public
Result
<
User
Info
Vo
>
findUserById
(
@Valid
IdParam
idParam
)
{
return
userService
.
findUserById
(
idParam
);
return
userService
.
findUserById
(
idParam
);
}
}
@ApiOperation
(
"给用户分配标签卡"
)
@ApiOperation
(
"给用户分配标签卡"
)
@PutMapping
(
"userBingTag"
)
@PutMapping
(
"userBingTag"
)
public
Result
<
String
>
userBingTag
(
@Valid
UserBingTagParam
p
aram
)
{
public
Result
<
String
>
userBingTag
(
@Valid
UserBingTagParam
userBingTagP
aram
)
{
return
userService
.
userBingTag
(
p
aram
);
return
userService
.
userBingTag
(
userBingTagP
aram
);
}
}
@ApiOperation
(
"收卡"
)
@ApiOperation
(
"收卡"
)
...
@@ -66,16 +68,10 @@ public class UserAppController {
...
@@ -66,16 +68,10 @@ public class UserAppController {
return
userService
.
deleteUser
(
idParam
);
return
userService
.
deleteUser
(
idParam
);
}
}
@ApiOperation
(
"下拉菜单"
)
@GetMapping
(
"selectUser"
)
public
Result
<
PageVo
<
UserVo
>>
selectUser
()
{
return
userService
.
selectUser
();
}
@ApiOperation
(
"用户导出"
)
@ApiOperation
(
"用户导出"
)
@GetMapping
(
"exportUser"
)
@GetMapping
(
"exportUser"
)
public
void
exportUser
(
@Valid
UserFindParam
p
aram
,
HttpServletResponse
response
)
{
public
void
exportUser
(
@Valid
UserFindParam
userFindP
aram
,
HttpServletResponse
response
)
{
userService
.
exportUser
(
p
aram
,
response
);
userService
.
exportUser
(
userFindP
aram
,
response
);
}
}
@ApiOperation
(
"启用/停用"
)
@ApiOperation
(
"启用/停用"
)
...
@@ -86,14 +82,14 @@ public class UserAppController {
...
@@ -86,14 +82,14 @@ public class UserAppController {
@ApiOperation
(
"编辑用户"
)
@ApiOperation
(
"编辑用户"
)
@PutMapping
(
"modifyUser"
)
@PutMapping
(
"modifyUser"
)
public
Result
<
String
>
modifyUser
(
@Valid
UserModifyParam
p
aram
)
{
public
Result
<
String
>
modifyUser
(
@Valid
UserModifyParam
userModifyP
aram
)
{
return
userService
.
modifyUser
(
p
aram
);
return
userService
.
modifyUser
(
userModifyP
aram
);
}
}
@ApiOperation
(
"新增用户"
)
@ApiOperation
(
"新增用户"
)
@PostMapping
(
"addUser"
)
@PostMapping
(
"addUser"
)
public
Result
<
String
>
addUser
(
@Valid
UserAddParam
p
aram
)
{
public
Result
<
String
>
addUser
(
@Valid
UserAddParam
userAddP
aram
)
{
return
userService
.
addUser
(
p
aram
);
return
userService
.
addUser
(
userAddP
aram
);
}
}
@ApiOperation
(
"导入"
)
@ApiOperation
(
"导入"
)
...
@@ -104,7 +100,7 @@ public class UserAppController {
...
@@ -104,7 +100,7 @@ public class UserAppController {
@ApiOperation
(
"用户信息检索"
)
@ApiOperation
(
"用户信息检索"
)
@GetMapping
(
"indexUser"
)
@GetMapping
(
"indexUser"
)
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
@Valid
UserIndexParam
p
aram
)
{
public
Result
<
PageVo
<
UserVo
>>
indexUser
(
@Valid
IndexParam
indexP
aram
)
{
return
userService
.
indexUser
(
p
aram
);
return
userService
.
indexUser
(
indexP
aram
);
}
}
}
}
app/src/main/resources/application-dev.yml
浏览文件 @
6a615c7b
...
@@ -37,6 +37,11 @@ spring:
...
@@ -37,6 +37,11 @@ spring:
simple
:
simple
:
# 手动确认消息
# 手动确认消息
acknowledge-mode
:
manual
acknowledge-mode
:
manual
servlet
:
multipart
:
enabled
:
true
max-file-size
:
50MB
max-request-size
:
100MB
# knife4j
# knife4j
knife4j
:
knife4j
:
...
@@ -92,3 +97,10 @@ zy-config:
...
@@ -92,3 +97,10 @@ zy-config:
manage
:
manage
:
username
:
test123
username
:
test123
password
:
test123
password
:
test123
feign
:
httpclient
:
enabled
:
false
okhttp
:
enabled
:
true
app/src/main/java/com/yiring/app/param/user/User
IndexParam.java
→
basic-common/core/src/main/java/com/yiring/common/param/
IndexParam.java
浏览文件 @
6a615c7b
/* (C) 2022 YiRing, Inc. */
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
param
.
user
;
package
com
.
yiring
.
common
.
param
;
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
javax.validation.Valid
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
lombok.experimental.FieldDefaults
;
/**
/**
*
用户检索
*
公共下拉str查询入参
*
*
* @author LJ-2204
* @author LJ-2204
* @date 2022/4/26
* @date 2022/4/26
*/
*/
@ApiModel
(
"UserIndexParam"
)
@ApiModel
(
"IndexParam"
)
@Valid
@Data
@Data
@Builder
@Builder
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
User
IndexParam
implements
Serializable
{
public
class
IndexParam
implements
Serializable
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
5843843146263025946
L
;
private
static
final
long
serialVersionUID
=
1175269732754454737
L
;
@ApiModelProperty
(
value
=
"
真实姓名or手机号码
"
)
@ApiModelProperty
(
value
=
"
下拉查询
"
)
String
str
;
String
str
;
}
}
build.gradle
浏览文件 @
6a615c7b
...
@@ -31,6 +31,8 @@ buildscript {
...
@@ -31,6 +31,8 @@ buildscript {
myexcelVersion
=
'4.1.1'
myexcelVersion
=
'4.1.1'
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-openfeign
openfeignVersion
=
'3.1.1'
openfeignVersion
=
'3.1.1'
// https://mvnrepository.com/artifact/io.github.openfeign/feign-okhttp
feignOkhttpVersion
=
'11.8'
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论