Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
6920d067
提交
6920d067
authored
3月 05, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'gwj' 到 'master'
Gwj 查看合并请求
!14
上级
9800aa16
bf32063e
流水线
#20
已取消 于阶段
变更
4
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
12 行删除
+22
-12
User.java
...s-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
+1
-5
ConfigServiceImpl.java
.../com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
+2
-2
UserServiceImpl.java
...va/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
+18
-1
UserVo.java
...ava/com/zjty/tynotes/weekly/subject/entity/vo/UserVo.java
+1
-4
没有找到文件。
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
浏览文件 @
6920d067
...
@@ -53,15 +53,12 @@ public class User implements UserDetails, Serializable {
...
@@ -53,15 +53,12 @@ public class User implements UserDetails, Serializable {
@ApiModelProperty
(
value
=
"联系方式"
,
example
=
"113665465465"
)
@ApiModelProperty
(
value
=
"联系方式"
,
example
=
"113665465465"
)
private
String
phone2
;
private
String
phone2
;
@NotEmpty
(
message
=
"部门1不可为空"
)
@ApiModelProperty
(
value
=
"部门1"
,
example
=
"研发部"
)
@ApiModelProperty
(
value
=
"部门1"
,
example
=
"研发部"
)
private
String
department1
;
private
String
department1
;
@NotEmpty
(
message
=
"部门2不可为空"
)
@ApiModelProperty
(
value
=
"部门2"
,
example
=
"技术中心"
)
@ApiModelProperty
(
value
=
"部门2"
,
example
=
"技术中心"
)
private
String
department2
;
private
String
department2
;
@NotEmpty
(
message
=
"部门3不可为空"
)
@ApiModelProperty
(
value
=
"部门3"
,
example
=
"工作簿项目组"
)
@ApiModelProperty
(
value
=
"部门3"
,
example
=
"工作簿项目组"
)
private
String
department3
;
private
String
department3
;
...
@@ -72,7 +69,7 @@ public class User implements UserDetails, Serializable {
...
@@ -72,7 +69,7 @@ public class User implements UserDetails, Serializable {
@NotNull
(
message
=
"入职时间不可为空"
)
@NotNull
(
message
=
"入职时间不可为空"
)
@ApiModelProperty
(
value
=
"入职时间"
,
example
=
"2019-01-45 12:12:12"
)
@ApiModelProperty
(
value
=
"入职时间"
,
example
=
"2019-01-45 12:12:12"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Integer
entryTime
;
private
String
entryTime
;
@NotEmpty
(
message
=
"邮箱不可为空"
)
@NotEmpty
(
message
=
"邮箱不可为空"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"123456789@qq.com"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"123456789@qq.com"
)
...
@@ -81,7 +78,6 @@ public class User implements UserDetails, Serializable {
...
@@ -81,7 +78,6 @@ public class User implements UserDetails, Serializable {
@NotEmpty
(
message
=
"用户名不可为空"
)
@NotEmpty
(
message
=
"用户名不可为空"
)
@ApiModelProperty
(
value
=
"用户名"
,
example
=
"username"
)
@ApiModelProperty
(
value
=
"用户名"
,
example
=
"username"
)
private
String
username
;
private
String
username
;
@NotEmpty
(
message
=
"密码不可为空"
)
@ApiModelProperty
(
value
=
"密码"
,
example
=
"password"
)
@ApiModelProperty
(
value
=
"密码"
,
example
=
"password"
)
private
String
password
;
private
String
password
;
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
浏览文件 @
6920d067
...
@@ -68,7 +68,7 @@ public class ConfigServiceImpl implements ConfigService {
...
@@ -68,7 +68,7 @@ public class ConfigServiceImpl implements ConfigService {
@Override
@Override
public
List
<
Day
>
findHolidaysByMonth
(
String
date
)
{
public
List
<
Day
>
findHolidaysByMonth
(
String
date
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM
-dd
"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
try
{
try
{
Date
date1
=
sdf
.
parse
(
date
);
Date
date1
=
sdf
.
parse
(
date
);
int
year
=
date1
.
getYear
()+
1900
;
int
year
=
date1
.
getYear
()+
1900
;
...
@@ -101,7 +101,7 @@ public class ConfigServiceImpl implements ConfigService {
...
@@ -101,7 +101,7 @@ public class ConfigServiceImpl implements ConfigService {
return
dayDao
.
saveAll
(
days1
);
return
dayDao
.
saveAll
(
days1
);
}
}
calendar
.
set
(
Calendar
.
MONTH
,
month
-
1
);
calendar
.
set
(
Calendar
.
MONTH
,
month
-
1
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
firstDate
=
calendar
.
getTime
();
firstDate
=
calendar
.
getTime
();
calendar
.
set
(
Calendar
.
MONTH
,
month
);
calendar
.
set
(
Calendar
.
MONTH
,
month
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
浏览文件 @
6920d067
...
@@ -16,6 +16,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
...
@@ -16,6 +16,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -36,6 +37,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -36,6 +37,8 @@ public class UserServiceImpl implements IUserService {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UserServiceImpl
.
class
);
@Autowired
@Autowired
MongoTemplate
mongoTemplate
;
MongoTemplate
mongoTemplate
;
@Autowired
private
BCryptPasswordEncoder
bCryptPasswordEncoder
;
@Autowired
@Autowired
RedisTemplate
<
String
,
Object
>
defaultRedisTpl
;
RedisTemplate
<
String
,
Object
>
defaultRedisTpl
;
...
@@ -128,7 +131,19 @@ public class UserServiceImpl implements IUserService {
...
@@ -128,7 +131,19 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
User
findUserById
(
String
id
)
{
public
User
findUserById
(
String
id
)
{
Optional
<
User
>
byId
=
pasUserDao
.
findById
(
id
);
Optional
<
User
>
byId
=
pasUserDao
.
findById
(
id
);
return
byId
.
orElseGet
(
User:
:
new
);
List
<
String
>
roleIds
=
new
ArrayList
<>();
User
user
=
null
;
if
(
byId
.
isPresent
()){
user
=
byId
.
get
();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
for
(
UserRole
userRole
:
userRoles
)
{
roleIds
.
add
(
userRole
.
getRoleId
());
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
user
.
setRoles
(
roles
);
}
return
user
;
}
}
@Override
@Override
...
@@ -173,6 +188,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -173,6 +188,8 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
User
addUser
(
User
user
)
{
public
User
addUser
(
User
user
)
{
String
encode
=
bCryptPasswordEncoder
.
encode
(
"qwer1234"
);
user
.
setPassword
(
encode
);
List
<
Role
>
roles
=
user
.
getRoles
();
List
<
Role
>
roles
=
user
.
getRoles
();
List
<
UserRole
>
userRoles
=
new
ArrayList
<>();
List
<
UserRole
>
userRoles
=
new
ArrayList
<>();
List
<
User
>
users
=
pasUserDao
.
findAll
();
List
<
User
>
users
=
pasUserDao
.
findAll
();
...
...
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/entity/vo/UserVo.java
浏览文件 @
6920d067
...
@@ -47,15 +47,12 @@ public class UserVo {
...
@@ -47,15 +47,12 @@ public class UserVo {
@ApiModelProperty
(
value
=
"联系方式"
,
example
=
"113665465465"
)
@ApiModelProperty
(
value
=
"联系方式"
,
example
=
"113665465465"
)
private
String
phone2
;
private
String
phone2
;
@NotEmpty
(
message
=
"部门1不可为空"
)
@ApiModelProperty
(
value
=
"部门1"
,
example
=
"研发部"
)
@ApiModelProperty
(
value
=
"部门1"
,
example
=
"研发部"
)
private
String
department1
;
private
String
department1
;
@NotEmpty
(
message
=
"部门2不可为空"
)
@ApiModelProperty
(
value
=
"部门2"
,
example
=
"技术中心"
)
@ApiModelProperty
(
value
=
"部门2"
,
example
=
"技术中心"
)
private
String
department2
;
private
String
department2
;
@NotEmpty
(
message
=
"部门3不可为空"
)
@ApiModelProperty
(
value
=
"部门3"
,
example
=
"工作簿项目组"
)
@ApiModelProperty
(
value
=
"部门3"
,
example
=
"工作簿项目组"
)
private
String
department3
;
private
String
department3
;
...
@@ -66,7 +63,7 @@ public class UserVo {
...
@@ -66,7 +63,7 @@ public class UserVo {
@NotNull
(
message
=
"入职时间不可为空"
)
@NotNull
(
message
=
"入职时间不可为空"
)
@ApiModelProperty
(
value
=
"入职时间"
,
example
=
"2019-01-45 12:12:12"
)
@ApiModelProperty
(
value
=
"入职时间"
,
example
=
"2019-01-45 12:12:12"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Integer
entryTime
;
private
String
entryTime
;
@NotEmpty
(
message
=
"邮箱不可为空"
)
@NotEmpty
(
message
=
"邮箱不可为空"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"123456789@qq.com"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"123456789@qq.com"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论