Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
627ef7ab
提交
627ef7ab
authored
12月 30, 2020
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1111
上级
fc1de5b9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
96 行增加
和
11 行删除
+96
-11
SendBackServiceImpl.java
...dev/device/sendback/service/impl/SendBackServiceImpl.java
+73
-8
TaskDao.java
...ain/java/com/tykj/dev/device/task/repository/TaskDao.java
+1
-1
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+22
-2
没有找到文件。
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/SendBackServiceImpl.java
浏览文件 @
627ef7ab
...
...
@@ -288,7 +288,7 @@ public class SendBackServiceImpl implements SendBackService {
HashMap
<
String
,
List
<
Integer
>>
locationUnitList
=
new
HashMap
<>();
HashMap
<
String
,
List
<
AbnormalDescribe
>>
desList
=
new
HashMap
<>();
StringBuffer
xDevId
=
new
StringBuffer
();
for
(
DeviceLibrary
deviceLibraryEntity
:
deviceLibraryEntitiesByIdIn
)
{
String
locationUnit
=
deviceLibraryEntity
.
getLocationUnit
();
...
...
@@ -305,14 +305,24 @@ public class SendBackServiceImpl implements SendBackService {
}
unDeviceDesVos
.
add
(
map
.
get
(
deviceLibraryEntity
.
getId
()));
desList
.
put
(
locationUnit
,
unDeviceDesVos
);
xDevId
.
append
(
"x"
).
append
(
deviceLibraryEntity
.
getId
());
}
TaskBto
parentTask
=
taskService
.
get
(
parentTaskId
);
SendBackBill
parentBillEntity
=
sendBackBillEntityDao
.
findById
(
parentTask
.
getBillId
()).
get
();
parentBillEntity
.
setExceptionDes
(
JSON
.
toJSONString
(
unDeviceDes
));
saveSendBackBill
(
parentBillEntity
);
TaskBto
exceptionParentTask
=
taskService
.
get
(
parentTask
.
getParentTaskId
());
SendBackBill
exceptionParentBillEntity
=
sendBackBillEntityDao
.
findById
(
exceptionParentTask
.
getBillId
()).
get
();
if
(
exceptionParentBillEntity
.
getInvoleDevice
().
equals
(
xDevId
.
toString
())){
taskService
.
moveToEnd
(
exceptionParentTask
);
}
// if (xDevId.equals(parentBillEntity.getInvoleDevice())) {
// taskService.moveToEnd(parentTask);
// }
Set
<
String
>
locationKey
=
locationUnitList
.
keySet
();
for
(
String
location:
locationKey
)
{
...
...
@@ -404,9 +414,11 @@ public class SendBackServiceImpl implements SendBackService {
if
(
parentTaskBill
.
getInvoleDevice
().
equals
(
""
)){
taskService
.
moveToEnd
(
parentTask
);
s
(
parentTask
,
parentTaskBill
,
idList
);
Units
units1
=
unitsDao
.
findById
(
Integer
.
valueOf
(
parentTask
.
getCustomInfo
())).
get
();
s1
(
parentTask
,
units1
,
idList
);
}
}
// sendBackBillEntityDao.save(parentTaskBill);
saveSendBackBill
(
parentTaskBill
);
...
...
@@ -470,7 +482,7 @@ public class SendBackServiceImpl implements SendBackService {
}
sendBackOutVo
.
setDeviceLibraryEntities
(
deviceLibraries
);
if
(
flag
)
{
Task
exlTask
=
taskDao
.
findByParentTaskIdAndAndTitle
(
taskId
,
"异常装备描述"
);
Task
exlTask
=
taskDao
.
findByParentTaskIdAndAndTitle
(
taskId
,
"异常装备
待
描述"
);
sendBackOutVo
.
setExcTask
(
exlTask
.
getId
());
}
return
ResponseEntity
.
ok
(
sendBackOutVo
);
...
...
@@ -677,6 +689,59 @@ public class SendBackServiceImpl implements SendBackService {
}
}
/**
* 判断是否全部提交
* 全部提交把跟踪业务改为代办
*/
private
void
s1
(
TaskBto
taskEntity
,
Units
units
,
List
<
Integer
>
idList
){
//父类task
TaskBto
fatherTaskBto
=
taskService
.
get
(
taskEntity
.
getParentTaskId
());;
SendBackBill
fatherBill
=
sendBackBillEntityDao
.
findById
(
fatherTaskBto
.
getBillId
()).
get
();
String
send
=
fatherBill
.
getSendBackStatistical
();
SendBackVo
sendBackVo
=
JSONObject
.
parseObject
(
send
,
SendBackVo
.
class
);
/*
将入库结果反馈给下级,由于两个task使用的是同一个账单,所以数据已反馈
*/
Area
area
=
areaDao
.
findById
(
units
.
getAreaId
()).
get
();
updateStatistical
(
idList
,
area
.
getName
(),
sendBackVo
);
//查询当前task上级task
//查询当前task上级task所有子task
List
<
Task
>
taskList
=
taskDao
.
findAllByParentTaskId
(
fatherTaskBto
.
getId
());
//判断对应的bill是否完成
List
<
Integer
>
integers
=
taskList
.
stream
().
map
(
Task:
:
getBillId
).
collect
(
Collectors
.
toList
());
boolean
flag
=
sendBackBillEntityDao
.
findAllById
(
integers
).
stream
().
allMatch
(
e
->
e
.
getIsComplete
()==
1
);
if
(
flag
){
if
(
fatherTaskBto
.
getParentTaskId
()!=
null
)
{
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1203
,
0
);
List
<
Integer
>
list
=
new
ArrayList
<>();
findInvoleDevice
(
fatherBill
.
getInvoleDevice
()).
forEach
(
deviceLibrary
->
{
if
(!
deviceLibrary
.
getLocationUnit
().
equals
(
deviceLibrary
.
getOwnUnit
())){
list
.
add
(
deviceLibrary
.
getId
());
}
}
);
if
(
list
.
size
()
!=
0
)
{
addExceptionTask
(
fatherTaskBto
.
getId
(),
list
,
fatherTaskBto
.
getOwnUnit
(),
0
,
fatherBill
.
getDeadLine
());
}
}
else
{
sendBackVo
.
setStatus
(
0
);
fatherBill
.
setSendBackStatistical
(
JSON
.
toJSONString
(
sendBackVo
));
// sendBackBillEntityDao.save(fatherBill);
saveSendBackBill
(
fatherBill
);
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1201
,
fatherTaskBto
.
getCreateUserId
());
}
}
}
private
List
<
DeviceLibrary
>
findInvoleDevice
(
String
involeDevice
){
List
<
String
>
idStringList
=
Arrays
.
asList
(
involeDevice
.
split
(
"x"
));
...
...
@@ -1638,18 +1703,18 @@ public class SendBackServiceImpl implements SendBackService {
/*
省级的业务详情
*/
kidTask
=
taskDao
.
findTaskEntitiesByParentTaskId
(
taskBto
.
getId
()
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
kidTask
=
taskDao
.
findTaskEntitiesByParentTaskId
AndAndBusinessType
(
taskBto
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
kidTask
.
forEach
(
taskBto1
->
{
qkidTask
.
addAll
(
taskDao
.
findTaskEntitiesByParentTaskId
(
taskBto
.
getId
()
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
()));
qkidTask
.
addAll
(
taskDao
.
findTaskEntitiesByParentTaskId
AndAndBusinessType
(
taskBto
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
()));
}
);
}
else
if
(
unit
.
getLevel
()
==
2
){
/*
市级的业务详情
*/
kidTask
=
taskDao
.
findTaskEntitiesByParentTaskId
(
taskBto
.
getId
()
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
kidTask
=
taskDao
.
findTaskEntitiesByParentTaskId
AndAndBusinessType
(
taskBto
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
}
/*
区域名和任务id的映射,方便进入下一级
...
...
dev-task/src/main/java/com/tykj/dev/device/task/repository/TaskDao.java
浏览文件 @
627ef7ab
...
...
@@ -58,7 +58,7 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
@Query
(
"select o.billId from Task o where o.parentTaskId = ?1 and o. businessType = ?2"
)
Integer
findBillIdByParentId
(
int
parentTaskId
,
int
businessType
);
List
<
Task
>
findTaskEntitiesByParentTaskId
(
Integer
parentTaskId
);
List
<
Task
>
findTaskEntitiesByParentTaskId
AndAndBusinessType
(
Integer
parentTaskId
,
Integer
businessType
);
Task
findByBusinessTypeAndOwnUnitAndBillStatus
(
Integer
type
,
Integer
ownUnit
,
Integer
billStatus
);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
627ef7ab
...
...
@@ -14,6 +14,8 @@ import com.tykj.dev.device.train.entity.TrainUser;
import
com.tykj.dev.device.train.entity.vo.*
;
import
com.tykj.dev.device.train.service.TrainTaskService
;
import
com.tykj.dev.device.train.service.TrainThemeService
;
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.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
...
...
@@ -40,6 +42,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -80,6 +83,10 @@ public class TrainJobController {
@Autowired
BlockChainUtil
blockChainUtil
;
@Autowired
MessageService
messageService
;
// 发起培训给选中人员都发一个代办任务报名,此任务在发起人跟踪里
...
...
@@ -113,7 +120,6 @@ public class TrainJobController {
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsNotJoinUserId
(
1
);
trainUser
.
setTrainId
(
trainTheme
.
getTrainId
());
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
);
...
...
@@ -142,7 +148,16 @@ public class TrainJobController {
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1002
.
id
,
trainTheme
.
getName
(),
task
.
getId
(),
task
.
getId
().
toString
(),
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
unitId
,
0
,
null
,
list
));
}
);
if
(
securityUser
.
getCurrentUserInfo
().
getUnits
().
getLevel
()==
1
){
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
));
}
else
{
List
<
Integer
>
userIds
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
userIds
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
userIds
.
addAll
(
userService
.
findAllByUnite
(
1
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
()));
messageService
.
add
(
new
MessageBto
(
task
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"发起培训"
,
userIds
));
}
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
trainThemeService
.
save
(
trainTheme
));
}
...
...
@@ -194,6 +209,11 @@ public class TrainJobController {
// userLogService.save(new UserLog(securityUser.getCurrentUserInfo().getUserId(),new Date(),"不参加培训"));
// }
taskBto
=
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
TRAIN1003
,
-
1
);
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
.
remove
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
messageService
.
add
(
new
MessageBto
(
taskBto
.
getId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getUsername
()+
"提交了培训名单"
,
userIds
));
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
taskBto
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论