Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c732cbca
提交
c732cbca
authored
12月 14, 2020
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
t
上级
597e3176
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
283 行增加
和
90 行删除
+283
-90
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+60
-1
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+51
-42
TrainUserDao.java
...main/java/com/tykj/dev/device/train/dao/TrainUserDao.java
+4
-0
ByTrainingPeople.java
...com/tykj/dev/device/train/entity/vo/ByTrainingPeople.java
+5
-26
SignUpUsers.java
...java/com/tykj/dev/device/train/entity/vo/SignUpUsers.java
+33
-0
signUpReturn.java
...ava/com/tykj/dev/device/train/entity/vo/signUpReturn.java
+4
-5
TrainThemeServiceImpl.java
.../dev/device/train/service/impl/TrainThemeServiceImpl.java
+7
-14
UserDateScreen.java
...ava/com/tykj/dev/device/user/base/ret/UserDateScreen.java
+27
-0
SecurityConfig.java
.../java/com/tykj/dev/device/user/config/SecurityConfig.java
+1
-2
UnitsDao.java
...n/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
+2
-0
UserDao.java
...in/java/com/tykj/dev/device/user/subject/dao/UserDao.java
+1
-0
UserDataScreenService.java
...ev/device/user/subject/service/UserDataScreenService.java
+9
-0
UserDataScreenServiceImpl.java
.../user/subject/service/impl/UserDataScreenServiceImpl.java
+79
-0
没有找到文件。
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
c732cbca
...
@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.jpa.repository.query.JpaEntityGraph
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -114,6 +115,7 @@ public class FileController {
...
@@ -114,6 +115,7 @@ public class FileController {
// 第三步:打开文档。
// 第三步:打开文档。
document
.
open
();
document
.
open
();
for
(
MultipartFile
multipartFile
:
multipartFiles
)
{
for
(
MultipartFile
multipartFile
:
multipartFiles
)
{
fileUpload1
(
multipartFile
);
Image
img
=
Image
.
getInstance
(
multipartFile
.
getBytes
());
Image
img
=
Image
.
getInstance
(
multipartFile
.
getBytes
());
//转成
//转成
// Image.byte()
// Image.byte()
...
@@ -128,7 +130,6 @@ public class FileController {
...
@@ -128,7 +130,6 @@ public class FileController {
img
.
setAlignment
(
Image
.
MIDDLE
);
img
.
setAlignment
(
Image
.
MIDDLE
);
img
.
scalePercent
(
percent
);
img
.
scalePercent
(
percent
);
document
.
add
(
img
);
document
.
add
(
img
);
}
}
document
.
close
();
document
.
close
();
return
ResponseEntity
.
ok
(
new
FileRet
(
""
,
url
+
"print/"
+
fileName
+
fileName
,
preview
+
"print/"
+
fileName
));
return
ResponseEntity
.
ok
(
new
FileRet
(
""
,
url
+
"print/"
+
fileName
+
fileName
,
preview
+
"print/"
+
fileName
));
...
@@ -193,6 +194,64 @@ public class FileController {
...
@@ -193,6 +194,64 @@ public class FileController {
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
}
}
private
FileRet
fileUpload1
(
MultipartFile
file
)
{
String
originalFilename
=
file
.
getOriginalFilename
();
System
.
out
.
println
(
originalFilename
);
File
file1
=
new
File
(
url
);
if
(!
file1
.
exists
())
{
file1
.
mkdirs
();
}
FileOutputStream
fos
=
null
;
InputStream
inputStream
=
null
;
OutputStream
os
=
null
;
String
[]
split
=
originalFilename
.
split
(
"\\."
);
String
newName
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
)
+
".jpg"
;
byte
[]
typeByte
=
new
byte
[
1024
*
1024
*
10
];
try
{
inputStream
=
file
.
getInputStream
();
fos
=
new
FileOutputStream
(
url
+
newName
);
int
i
=
0
;
while
((
i
=
inputStream
.
read
(
typeByte
))
!=
-
1
)
{
fos
.
write
(
typeByte
,
0
,
i
);
}
fos
.
flush
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
if
(
inputStream
!=
null
)
{
try
{
inputStream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
inputStream
=
null
;
}
}
if
(
fos
!=
null
)
{
try
{
fos
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
fos
=
null
;
}
}
if
(
os
!=
null
)
{
try
{
os
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
os
=
null
;
}
}
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
}
/**
/**
* 等比压缩,获取压缩百分比
* 等比压缩,获取压缩百分比
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
c732cbca
...
@@ -134,21 +134,15 @@ public class TrainJobController {
...
@@ -134,21 +134,15 @@ public class TrainJobController {
TaskBto
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1000
.
id
,
trainTheme
.
getName
(),
null
,
null
,
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
TaskBto
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1000
.
id
,
trainTheme
.
getName
(),
null
,
null
,
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1000
.
id
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1000
.
id
);
needTrain
.
forEach
(
id
->
{
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
id
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1001
.
id
,
trainTheme
.
getName
(),
task
.
getId
(),
task
.
getId
().
toString
(),
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
list
));
}
trainThemeAddVo
.
getUnitsIds
().
forEach
(
);
unitId
->{
normal
.
forEach
(
id
->
{
List
<
Integer
>
list
=
new
ArrayList
<>();
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
id
);
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1002
.
id
,
trainTheme
.
getName
(),
task
.
getId
(),
task
.
getId
().
toString
(),
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
()
,
0
,
null
,
list
));
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1002
.
id
,
trainTheme
.
getName
(),
task
.
getId
(),
task
.
getId
().
toString
(),
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
unitId
,
0
,
null
,
list
));
}
}
);
);
myWebSocket
.
sendMessage1
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
}
}
...
@@ -166,24 +160,42 @@ public class TrainJobController {
...
@@ -166,24 +160,42 @@ public class TrainJobController {
public
ResponseEntity
signUp
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
signUpReturn
signUpReturn
)
{
public
ResponseEntity
signUp
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
signUpReturn
signUpReturn
)
{
TrainTheme
trainTheme
=
trainThemeService
.
findById
(
signUpReturn
.
getTrainThemeId
());
TrainTheme
trainTheme
=
trainThemeService
.
findById
(
signUpReturn
.
getTrainThemeId
());
TaskBto
taskBto
=
taskService
.
get
(
signUpReturn
.
getTaskId
());
TaskBto
taskBto
=
taskService
.
get
(
signUpReturn
.
getTaskId
());
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
trainTheme
.
getTrainId
());
Integer
taskId
=
taskBto
.
getId
();
if
(
signUpReturn
.
getReturns
()
==
0
)
{
List
<
SignUpUsers
>
signUpUsers
=
signUpReturn
.
getSignUpUsers
();
taskBto
=
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1003
,
-
1
);
signUpUsers
.
forEach
(
signUpUser
->
{
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
signUpUser
.
getUserId
(),
trainTheme
.
getTrainId
());
if
(
signUpUser
.
getReturns
()
==
0
)
{
trainUser
.
setIsSignUp
(
1
);
trainUser
.
setIsSignUp
(
1
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
()
,
"报名"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskId
,
"报名"
,
null
);
userLogService
.
save
(
new
UserLog
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
new
Date
(),
"报名参加培训"
));
userLogService
.
save
(
new
UserLog
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
new
Date
(),
"报名参加培训"
));
taskLogService
.
addLog
(
taskLogBto
);
taskLogService
.
addLog
(
taskLogBto
);
}
else
{
}
else
{
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setNote
(
signUpReturn
.
getNod
e
());
trainUser
.
setNote
(
signUpUser
.
getNot
e
());
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
()
,
"不报名"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskId
,
"不报名"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
taskLogService
.
addLog
(
taskLogBto
);
taskService
.
moveToEnd
(
taskBto
);
userLogService
.
save
(
new
UserLog
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
new
Date
(),
"不参加培训"
));
userLogService
.
save
(
new
UserLog
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
new
Date
(),
"不参加培训"
));
}
}
trainUser
.
setUnitsName
(
unitsDao
.
findById
(
trainUser
.
getUnitsId
()).
get
().
getName
());
trainUser
.
setUnitsName
(
unitsDao
.
findById
(
trainUser
.
getUnitsId
()).
get
().
getName
());
saveTrainUser
(
trainUser
);
});
// if (signUpReturn.getReturns() == 0) {
// taskBto = taskService.moveToSpecial(taskBto, StatusEnum.TRAIN1003, -1);
// trainUser.setIsSignUp(1);
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "报名", null);
// userLogService.save(new UserLog(securityUser.getCurrentUserInfo().getUserId(),new Date(),"报名参加培训"));
// taskLogService.addLog(taskLogBto);
// } else {
// trainUser.setIsSignUp(2);
// trainUser.setNote(signUpReturn.getNote());
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "不报名", null);
// taskLogService.addLog(taskLogBto);
// taskService.moveToEnd(taskBto);
// userLogService.save(new UserLog(securityUser.getCurrentUserInfo().getUserId(),new Date(),"不参加培训"));
// }
taskBto
=
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1003
,
-
1
);
myWebSocket
.
sendMessage1
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
saveTrainUser
(
trainUser
)
);
return
ResponseEntity
.
ok
(
taskBto
);
}
}
/**
/**
...
@@ -196,23 +208,19 @@ public class TrainJobController {
...
@@ -196,23 +208,19 @@ public class TrainJobController {
public
ResponseEntity
signUpEnd
(
@PathVariable
Integer
trainId
)
{
public
ResponseEntity
signUpEnd
(
@PathVariable
Integer
trainId
)
{
TrainTheme
trainTheme
=
trainThemeService
.
findById
(
trainId
);
TrainTheme
trainTheme
=
trainThemeService
.
findById
(
trainId
);
//查询所有必须报名而没有报名的task 状态直接转为待培训
//查询所有必须报名而没有报名的task 状态直接转为待培训
trainTaskService
.
selectBillidAndBillType
(
trainId
,
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN100
1
.
id
).
forEach
(
trainTaskService
.
selectBillidAndBillType
(
trainId
,
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN100
2
.
id
).
forEach
(
taskBto
->
{
taskBto
->
{
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1003
,
-
1
);
taskService
.
moveToEnd
(
taskBto
);
List
<
Integer
>
ids
=
taskBto
.
getInvolveUserIdList
();
// taskService.moveToSpecial(taskBto, StatusEnum.TRAIN1003, -1);
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
ids
.
get
(
ids
.
size
()-
1
),
trainTheme
.
getTrainId
());
// List<Integer> ids= taskBto.getInvolveUserIdList();
trainUser
.
setIsSignUp
(
1
);
// TrainUser trainUser= trainUserDao.findByUserIdAndTrainId(ids.get(ids.size()-1),trainTheme.getTrainId());
// trainUserDao.save(trainUser);
// trainUser.setIsSignUp(1);
saveTrainUser
(
trainUser
);
//// trainUserDao.save(trainUser);
userLogService
.
save
(
new
UserLog
(
trainUser
.
getUserId
(),
new
Date
(),
"报名参加培训"
));
// saveTrainUser(trainUser);
// userLogService.save(new UserLog(trainUser.getUserId(),new Date(),"报名参加培训"));
}
}
);
);
trainTaskService
.
selectBillidAndBillType
(
trainId
,
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN1002
.
id
).
forEach
(
taskBto
->
taskService
.
moveToEnd
(
taskBto
)
);
trainTaskService
.
selectBillidAndBillType
(
trainId
,
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN1000
.
id
).
forEach
(
taskBto
->
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1010
)
);
//查询主task
//查询主task
TaskBto
taskBto
=
trainTaskService
.
selectFatherIsNullAndBillidAndBillType
(
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
);
TaskBto
taskBto
=
trainTaskService
.
selectFatherIsNullAndBillidAndBillType
(
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
);
// //主task往下推待培训状态,0
// //主task往下推待培训状态,0
...
@@ -239,9 +247,6 @@ public class TrainJobController {
...
@@ -239,9 +247,6 @@ public class TrainJobController {
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
}
}
//市培训待审核
//市培训待审核
@ApiOperation
(
value
=
"3 录入成绩后调用的接口"
,
notes
=
"状态改为'市培训申请发证"
)
@ApiOperation
(
value
=
"3 录入成绩后调用的接口"
,
notes
=
"状态改为'市培训申请发证"
)
@PostMapping
(
"/gradesGrade"
)
@PostMapping
(
"/gradesGrade"
)
...
@@ -355,12 +360,7 @@ public class TrainJobController {
...
@@ -355,12 +360,7 @@ public class TrainJobController {
// TaskEntity taskEntity=taskService.findByParentAndBillIdAndBussType(0,trainTheme.getTrainId(),BusinessEnum.TRAIN.id);
// TaskEntity taskEntity=taskService.findByParentAndBillIdAndBussType(0,trainTheme.getTrainId(),BusinessEnum.TRAIN.id);
// //8 培训完成
// //8 培训完成
trainTaskService
.
selectBillidAndBillType
(
gradeEntryVo
.
getTrainThemeId
(),
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN1003
.
id
).
forEach
(
taskBto1
->
{
// taskBto1.setCurrentPoint(0);
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
TRAIN1009
,
taskBto1
.
getInvolveUserIdList
().
get
(
0
));
}
);
//9 成绩待确认
//9 成绩待确认
/**
/**
* 15
* 15
...
@@ -376,6 +376,13 @@ public class TrainJobController {
...
@@ -376,6 +376,13 @@ public class TrainJobController {
saveTrainUser
(
trainUser
);
saveTrainUser
(
trainUser
);
}
}
);
);
trainTaskService
.
selectBillidAndBillType
(
gradeEntryVo
.
getTrainThemeId
(),
BusinessEnum
.
TRAIN
.
id
,
StatusEnum
.
TRAIN1003
.
id
).
forEach
(
taskBto1
->
{
// taskBto1.setCurrentPoint(0);
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
TRAIN1009
,
0
);
}
);
trainThemeService
.
save
(
trainTheme
);
trainThemeService
.
save
(
trainTheme
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核通过"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核通过"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
taskLogService
.
addLog
(
taskLogBto
);
...
@@ -459,6 +466,8 @@ public class TrainJobController {
...
@@ -459,6 +466,8 @@ public class TrainJobController {
TrainUser
trainUser1
=
trainUserDao
.
save
(
trainUser
);
TrainUser
trainUser1
=
trainUserDao
.
save
(
trainUser
);
BcHash
bcHash
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
trainUser1
));
BcHash
bcHash
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
trainUser1
));
trainUser1
.
setRecordId
(
bcHash
.
getData
().
getRecordID
());
trainUser1
.
setRecordId
(
bcHash
.
getData
().
getRecordID
());
// log.info("id----{}",bcHash.getData().getRecordID());
// blockChainUtil.appendHash(JacksonUtil.toJSon(trainUser1),trainUser1.getRecordId());
trainUserDao
.
save
(
trainUser1
);
trainUserDao
.
save
(
trainUser1
);
return
trainUser1
;
return
trainUser1
;
}
}
...
...
dev-train/src/main/java/com/tykj/dev/device/train/dao/TrainUserDao.java
浏览文件 @
c732cbca
...
@@ -19,4 +19,8 @@ public interface TrainUserDao extends JpaRepository<TrainUser, Integer>, JpaSpec
...
@@ -19,4 +19,8 @@ public interface TrainUserDao extends JpaRepository<TrainUser, Integer>, JpaSpec
TrainUser
findByUserIdAndTrainId
(
Integer
userId
,
Integer
trainId
);
TrainUser
findByUserIdAndTrainId
(
Integer
userId
,
Integer
trainId
);
List
<
TrainUser
>
findAllByIsSignUpAndTrainId
(
Integer
IsSignUp
,
Integer
trainId
);
List
<
TrainUser
>
findAllByIsSignUpAndTrainId
(
Integer
IsSignUp
,
Integer
trainId
);
List
<
TrainUser
>
findAllByTrainId
(
Integer
trainId
);
List
<
TrainUser
>
findAllByUnitsIdAndTrainId
(
Integer
unitId
,
Integer
userId
);
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/ByTrainingPeople.java
浏览文件 @
c732cbca
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.tykj.dev.device.train.entity.TrainUser
;
import
com.tykj.dev.device.user.subject.entity.Mgrcert
;
import
com.tykj.dev.device.user.subject.entity.Mgrcert
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -11,6 +12,7 @@ import javax.persistence.GeneratedValue;
...
@@ -11,6 +12,7 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.GenerationType
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* @author zjm
* @author zjm
...
@@ -118,32 +120,9 @@ public class ByTrainingPeople {
...
@@ -118,32 +120,9 @@ public class ByTrainingPeople {
private
Integer
trainStatus
;
private
Integer
trainStatus
;
/**
/**
*
发证状态
*
本单位需要参加培训的人员
*/
*/
@ApiModelProperty
(
value
=
"发证状态"
,
name
=
"isCertificate"
)
@ApiModelProperty
(
value
=
"本单位需要参加培训的人员"
,
name
=
"trainUserList"
)
private
Integer
isCertificate
;
List
<
TrainUser
>
trainUserList
;
@ApiModelProperty
(
value
=
"分数"
,
name
=
"score"
)
private
String
score
;
@ApiModelProperty
(
value
=
"评价"
,
name
=
"evaluation"
)
private
String
evaluation
;
/**
* 证书
*/
@ApiModelProperty
(
value
=
"证书"
,
name
=
"mgrcert"
)
private
Mgrcert
mgrcert
;
/**
* 及格
*/
@ApiModelProperty
(
value
=
"发证状态"
)
private
Integer
pass
;
/**
* 优秀
*/
@ApiModelProperty
(
value
=
"发证状态"
)
private
Integer
good
;
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/SignUpUsers.java
0 → 100644
浏览文件 @
c732cbca
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName SignUpUsers.java
* @Description TODO
* @createTime 2020年12月11日 10:03:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"报名vo对象"
,
description
=
"培训中返回的对象"
)
public
class
SignUpUsers
{
/**
* 用户id
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
Integer
userId
;
@ApiModelProperty
(
value
=
"必须报名 不报名填写的备注"
,
name
=
"node"
)
private
String
note
;
@ApiModelProperty
(
value
=
"是否报名 0 报名 1否"
,
name
=
"returns"
)
private
Integer
returns
;
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/signUpReturn.java
浏览文件 @
c732cbca
...
@@ -7,6 +7,8 @@ import lombok.Data;
...
@@ -7,6 +7,8 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.checkerframework.checker.units.qual.A
;
import
org.checkerframework.checker.units.qual.A
;
import
java.util.List
;
/**
/**
* @author zjm
* @author zjm
* @version 1.0.0
* @version 1.0.0
...
@@ -21,11 +23,8 @@ import org.checkerframework.checker.units.qual.A;
...
@@ -21,11 +23,8 @@ import org.checkerframework.checker.units.qual.A;
@ApiModel
(
value
=
"报名对象vo"
,
description
=
"报名对象vo"
)
@ApiModel
(
value
=
"报名对象vo"
,
description
=
"报名对象vo"
)
public
class
signUpReturn
{
public
class
signUpReturn
{
@ApiModelProperty
(
value
=
"是否报名 0 报名 1否"
,
name
=
"returns"
)
@ApiModelProperty
(
value
=
"用户对象"
,
name
=
"returns"
)
private
Integer
returns
;
private
List
<
SignUpUsers
>
signUpUsers
;
@ApiModelProperty
(
value
=
"必须报名 不报名填写的备注"
,
name
=
"node"
)
private
String
node
;
@ApiModelProperty
(
value
=
"job——id"
,
name
=
"taskId"
)
@ApiModelProperty
(
value
=
"job——id"
,
name
=
"taskId"
)
private
Integer
taskId
;
private
Integer
taskId
;
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/TrainThemeServiceImpl.java
浏览文件 @
c732cbca
...
@@ -88,23 +88,16 @@ public class TrainThemeServiceImpl implements TrainThemeService {
...
@@ -88,23 +88,16 @@ public class TrainThemeServiceImpl implements TrainThemeService {
public
ByTrainingPeople
findByTrainingPeople
(
Integer
trainThemeId
,
Integer
userId
)
{
public
ByTrainingPeople
findByTrainingPeople
(
Integer
trainThemeId
,
Integer
userId
)
{
TrainTheme
trainTheme
=
trainThemeDao
.
findById
(
trainThemeId
).
get
();
TrainTheme
trainTheme
=
trainThemeDao
.
findById
(
trainThemeId
).
get
();
ByTrainingPeople
byTrainingPeople
=
trainTheme
.
toByTrainingPeople
();
ByTrainingPeople
byTrainingPeople
=
trainTheme
.
toByTrainingPeople
();
List
<
GradeEntry
>
gradeEntries
=
new
ArrayList
<>();
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
userId
,
trainThemeId
);
if
(
trainTheme
.
getTrainingResults
()
!=
null
)
{
List
<
TrainUser
>
trainUsers
=
trainUserDao
.
findAllByUnitsIdAndTrainId
(
trainUser
.
getUnitsId
(),
trainThemeId
);
gradeEntries
=
JacksonUtil
.
readValue
(
trainTheme
.
getTrainingResults
(),
new
TypeReference
<
List
<
GradeEntry
>>()
{
trainUsers
.
forEach
(
});
trainUser1
->
trainUser1
.
setMgrcert
(
mgrcertService
.
findByUserId
(
trainUser1
.
getUserId
()))
}
);
if
(
gradeEntries
!=
null
&&
gradeEntries
.
size
()
!=
0
)
{
byTrainingPeople
.
setTrainUserList
(
trainUsers
);
gradeEntries
.
forEach
(
gradeEntry
->
{
if
(
gradeEntry
.
getUserId
()
==
userId
)
{
byTrainingPeople
.
setScore
(
gradeEntry
.
getScore
());
byTrainingPeople
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
byTrainingPeople
.
setMgrcert
(
mgrcertService
.
findByUserId
(
userId
));
}
});
}
return
byTrainingPeople
;
return
byTrainingPeople
;
}
}
@Override
@Override
public
TrainRegistrationVo
findRegistrationVo
(
Integer
trainThemeId
)
{
public
TrainRegistrationVo
findRegistrationVo
(
Integer
trainThemeId
)
{
TrainTheme
trainTheme
=
trainThemeDao
.
findById
(
trainThemeId
).
get
();
TrainTheme
trainTheme
=
trainThemeDao
.
findById
(
trainThemeId
).
get
();
...
...
dev-user/src/main/java/com/tykj/dev/device/user/base/ret/UserDateScreen.java
0 → 100644
浏览文件 @
c732cbca
package
com
.
tykj
.
dev
.
device
.
user
.
base
.
ret
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName UserDateScreen.java
* @Description 数据大屏用户vo
* @createTime 2020年12月14日 09:39:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"数据大屏用户vo"
,
description
=
"数据大屏用户对象"
)
public
class
UserDateScreen
{
private
String
unitName
;
private
Integer
hadBeenTraining
;
private
Integer
noTraining
;
private
Integer
expired
;
}
dev-user/src/main/java/com/tykj/dev/device/user/config/SecurityConfig.java
浏览文件 @
c732cbca
...
@@ -108,7 +108,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -108,7 +108,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
cors
()
.
cors
()
.
and
()
.
and
()
.
authorizeRequests
()
.
authorizeRequests
()
.
antMatchers
(
"/** "
).
permitAll
()
.
antMatchers
(
HttpMethod
.
OPTIONS
,
"/** "
).
permitAll
()
.
antMatchers
(
HttpMethod
.
OPTIONS
,
"/** "
).
permitAll
()
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// @Override
// @Override
...
@@ -118,7 +117,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -118,7 +117,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// return o;
// return o;
// }
// }
// })
// })
//
.anyRequest().authenticated()
.
anyRequest
().
authenticated
()
.
and
()
.
and
()
.
formLogin
()
.
formLogin
()
.
loginProcessingUrl
(
"/userLogin"
)
.
loginProcessingUrl
(
"/userLogin"
)
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
浏览文件 @
c732cbca
...
@@ -36,4 +36,6 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
...
@@ -36,4 +36,6 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
Units
findByAreaIdEquals
(
Integer
areaId
);
Units
findByAreaIdEquals
(
Integer
areaId
);
List
<
Units
>
findAllByLevelIn
(
List
<
Integer
>
levels
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UserDao.java
浏览文件 @
c732cbca
...
@@ -17,4 +17,5 @@ public interface UserDao extends JpaRepository<User, Integer>, JpaSpecificationE
...
@@ -17,4 +17,5 @@ public interface UserDao extends JpaRepository<User, Integer>, JpaSpecificationE
List
<
User
>
findAllByUserIdIn
(
List
<
Integer
>
userIds
);
List
<
User
>
findAllByUserIdIn
(
List
<
Integer
>
userIds
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UserDataScreenService.java
0 → 100644
浏览文件 @
c732cbca
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
service
;
import
com.tykj.dev.device.user.base.ret.UserDateScreen
;
import
java.util.List
;
public
interface
UserDataScreenService
{
List
<
UserDateScreen
>
selectUserDataScreen
();
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UserDataScreenServiceImpl.java
0 → 100644
浏览文件 @
c732cbca
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
service
.
impl
;
import
com.tykj.dev.device.user.base.ret.UserDateScreen
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserDataScreenService
;
import
jdk.nashorn.internal.ir.IfNode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author zjm
* @version 1.0.0
* @ClassName UserDataScreenServiceImpl.java
* @Description TODO
* @createTime 2020年12月14日 09:50:00
*/
@Service
@Slf4j
public
class
UserDataScreenServiceImpl
implements
UserDataScreenService
{
@Autowired
UserDao
userDao
;
@Autowired
UnitsDao
unitsDao
;
@Override
public
List
<
UserDateScreen
>
selectUserDataScreen
()
{
List
<
UserDateScreen
>
list
=
new
ArrayList
<>();
Map
<
Integer
,
UserDateScreen
>
map
=
new
HashMap
<>();
List
<
Integer
>
levels
=
new
ArrayList
<>();
levels
.
add
(
1
);
levels
.
add
(
2
);
List
<
Integer
>
unitIds
=
unitsDao
.
findAllByLevelIn
(
levels
).
stream
().
map
(
Units:
:
getUnitId
).
collect
(
Collectors
.
toList
());
List
<
User
>
users
=
userDao
.
findAllByUnitsIdIn
(
unitIds
);
users
.
forEach
(
user
->
{
UserDateScreen
userDateScreen
=
new
UserDateScreen
();
if
(
map
.
containsKey
(
user
.
getUnitsId
())){
userDateScreen
=
map
.
get
(
user
.
getUnitsId
());
}
switch
(
user
.
getTrainStatus
()){
case
0
:
userDateScreen
.
setHadBeenTraining
(
userDateScreen
.
getHadBeenTraining
()+
1
);
break
;
case
1
:
userDateScreen
.
setExpired
(
userDateScreen
.
getExpired
()+
1
);
break
;
case
2
:
userDateScreen
.
setNoTraining
(
userDateScreen
.
getNoTraining
()+
1
);
break
;
case
3
:
userDateScreen
.
setHadBeenTraining
(
userDateScreen
.
getHadBeenTraining
()+
1
);
break
;
default
:
log
.
info
(
"[用户] 未找到对应的培训状态{}"
,
user
.
getTrainStatus
());
}
map
.
put
(
user
.
getUnitsId
(),
userDateScreen
);
}
);
for
(
Integer
unitId:
map
.
keySet
()){
Units
units
=
unitsDao
.
findById
(
unitId
).
get
();
UserDateScreen
userDateScreen
=
map
.
get
(
unitId
);
userDateScreen
.
setUnitName
(
units
.
getName
());
list
.
add
(
userDateScreen
);
}
return
list
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论