Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
a776d710
提交
a776d710
authored
4月 25, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[培训列表查询] bug修改
上级
c294fa6d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
7 行删除
+48
-7
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+3
-3
TrainTheme.java
...ain/java/com/tykj/dev/device/train/entity/TrainTheme.java
+2
-0
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+31
-2
TrainTask.java
...c/main/java/com/tykj/dev/device/train/task/TrainTask.java
+2
-2
MessageBto.java
...com/tykj/dev/device/user/read/subject/bto/MessageBto.java
+10
-0
没有找到文件。
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
a776d710
...
@@ -145,12 +145,12 @@ public class TrainJobController {
...
@@ -145,12 +145,12 @@ public class TrainJobController {
if
(
securityUser
.
getCurrentUserInfo
().
getUnits
().
getLevel
()==
1
){
if
(
securityUser
.
getCurrentUserInfo
().
getUnits
().
getLevel
()==
1
){
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
));
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
,
trainTheme
.
getTrainId
().
toString
()
));
}
else
{
}
else
{
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
userIds
.
addAll
(
userService
.
findAllByUnite
(
1
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
()));
userIds
.
addAll
(
userService
.
findAllByUnite
(
1
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
()));
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
));
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
,
trainTheme
.
getTrainId
().
toString
()
));
}
}
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
}
}
...
@@ -208,7 +208,7 @@ public class TrainJobController {
...
@@ -208,7 +208,7 @@ public class TrainJobController {
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
userIds
.
addAll
(
userService
.
findAllByUnite
(
trainTheme
.
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
()));
userIds
.
addAll
(
userService
.
findAllByUnite
(
trainTheme
.
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
()));
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
messageService
.
add
(
new
MessageBto
(
taskBto
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"提交了培训名单"
,
userIds
));
messageService
.
add
(
new
MessageBto
(
taskBto
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"提交了培训名单"
,
userIds
,
trainTheme
.
getTrainId
().
toString
()
));
return
ResponseEntity
.
ok
(
taskBto
);
return
ResponseEntity
.
ok
(
taskBto
);
}
}
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/TrainTheme.java
浏览文件 @
a776d710
...
@@ -15,6 +15,7 @@ import org.springframework.data.annotation.CreatedBy;
...
@@ -15,6 +15,7 @@ import org.springframework.data.annotation.CreatedBy;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -32,6 +33,7 @@ import java.util.List;
...
@@ -32,6 +33,7 @@ import java.util.List;
@ApiModel
(
"新增培训对象"
)
@ApiModel
(
"新增培训对象"
)
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@EntityListeners
(
AuditingEntityListener
.
class
)
@Data
@Data
@Entity
@Entity
public
class
TrainTheme
{
public
class
TrainTheme
{
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
a776d710
...
@@ -16,6 +16,8 @@ import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo;
...
@@ -16,6 +16,8 @@ import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverVo
;
import
com.tykj.dev.device.train.service.TrainTaskService
;
import
com.tykj.dev.device.train.service.TrainTaskService
;
import
com.tykj.dev.device.train.service.WorkHandoverService
;
import
com.tykj.dev.device.train.service.WorkHandoverService
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
...
@@ -25,6 +27,7 @@ import com.tykj.dev.misc.base.StatusEnum;
...
@@ -25,6 +27,7 @@ import com.tykj.dev.misc.base.StatusEnum;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
io.swagger.annotations.ApiModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -57,6 +60,9 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
...
@@ -57,6 +60,9 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
@Autowired
@Autowired
UserService
userService
;
UserService
userService
;
@Autowired
MessageService
messageService
;
@Autowired
@Autowired
UnitsService
unitsService
;
UnitsService
unitsService
;
...
@@ -88,8 +94,8 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
...
@@ -88,8 +94,8 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
workHandoverDevDao
.
saveAll
(
workHandoverDevs
);
workHandoverDevDao
.
saveAll
(
workHandoverDevs
);
List
<
Integer
>
integers
=
new
ArrayList
<>();
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
TaskBto
taskBto
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起工作交接业务"
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
()),
workHandover
.
getWorkHandoverId
().
toString
()));
return
workHandover
;
return
workHandover
;
}
}
...
@@ -165,4 +171,27 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
...
@@ -165,4 +171,27 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
return
userService
.
findAllUserIdInUser
(
userIds
);
return
userService
.
findAllUserIdInUser
(
userIds
);
}
}
private
void
addMessage
(
MessageBto
messageBto
){
messageService
.
add
(
messageBto
);
}
/**
* 根据单位id查询用户 去除用户id
* @param userId
* @param unitId
* @return
*/
private
List
<
Integer
>
gainThisUser
(
Integer
userId
,
Integer
unitId
){
return
userService
.
findAllByUnite
(
unitId
).
stream
().
filter
(
user
->
user
.
getUnitsId
()!=
userId
).
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
/**
* 根据单位id查询用户id集合
* @param unitId
* @return
*/
private
List
<
Integer
>
findUnitId
(
Integer
unitId
){
return
userService
.
findAllByUnite
(
unitId
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
}
}
dev-train/src/main/java/com/tykj/dev/device/train/task/TrainTask.java
浏览文件 @
a776d710
...
@@ -53,10 +53,10 @@ public class TrainTask {
...
@@ -53,10 +53,10 @@ public class TrainTask {
private
void
signUpDeadline
()
{
private
void
signUpDeadline
()
{
trainThemeService
.
findAllStatus
(
StatusEnum
.
TRAIN1000
.
id
).
forEach
(
trainThemeService
.
findAllStatus
(
StatusEnum
.
TRAIN1000
.
id
).
forEach
(
trainTheme
->
{
trainTheme
->
{
log
.
info
(
"[培训] 检查报名时间是否结束"
);
//
log.info("[培训] 检查报名时间是否结束");
long
time
=
new
Date
().
getTime
();
long
time
=
new
Date
().
getTime
();
if
(
trainTheme
.
getTrainTime
().
getTime
()
<=
time
)
{
if
(
trainTheme
.
getTrainTime
().
getTime
()
<=
time
)
{
log
.
info
(
"[培训] 检查报名时间{}"
,
trainTheme
.
getTrainId
());
//
log.info("[培训] 检查报名时间{}",trainTheme.getTrainId());
signUpEnd
(
trainTheme
.
getTrainId
());
signUpEnd
(
trainTheme
.
getTrainId
());
}
}
}
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/subject/bto/MessageBto.java
浏览文件 @
a776d710
...
@@ -114,6 +114,14 @@ public class MessageBto {
...
@@ -114,6 +114,14 @@ public class MessageBto {
this
.
involveUserIdList
=
involveUserIdList
;
this
.
involveUserIdList
=
involveUserIdList
;
}
}
public
MessageBto
(
Integer
taskId
,
Integer
businessType
,
String
content
,
List
<
Integer
>
involveUserIdList
,
String
record
)
{
this
.
taskId
=
taskId
;
this
.
businessType
=
businessType
;
this
.
content
=
content
;
this
.
involveUserIdList
=
involveUserIdList
;
this
.
record
=
record
;
}
public
MessageBto
(
Integer
taskId
,
Integer
businessType
,
String
content
,
List
<
Integer
>
involveUserIdList
,
Integer
isHighLight
)
{
public
MessageBto
(
Integer
taskId
,
Integer
businessType
,
String
content
,
List
<
Integer
>
involveUserIdList
,
Integer
isHighLight
)
{
this
.
taskId
=
taskId
;
this
.
taskId
=
taskId
;
this
.
businessType
=
businessType
;
this
.
businessType
=
businessType
;
...
@@ -121,4 +129,6 @@ public class MessageBto {
...
@@ -121,4 +129,6 @@ public class MessageBto {
this
.
involveUserIdList
=
involveUserIdList
;
this
.
involveUserIdList
=
involveUserIdList
;
this
.
isHighLight
=
isHighLight
;
this
.
isHighLight
=
isHighLight
;
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论