Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
ab2d5952
提交
ab2d5952
authored
5月 11, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[核查模块] 修复BUG
上级
306311ac
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
79 行增加
和
31 行删除
+79
-31
UnitAreaBean.java
...com/tykj/dev/device/confirmcheck/common/UnitAreaBean.java
+1
-1
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+63
-24
CheckAreaStatVo.java
...kj/dev/device/confirmcheck/entity/vo/CheckAreaStatVo.java
+4
-2
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+7
-0
AreaCache.java
...c/main/java/com/tykj/dev/device/user/cache/AreaCache.java
+3
-3
AuServiceImpl.java
...j/dev/device/user/subject/service/impl/AuServiceImpl.java
+1
-1
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/UnitAreaBean.java
浏览文件 @
ab2d5952
...
...
@@ -35,7 +35,7 @@ public class UnitAreaBean {
.
map
(
unit
->
{
int
areaId
=
unitsDao
.
findAreaIdByName
(
unit
.
getName
());
Area
area
=
areaDao
.
findById
(
areaId
)
.
orElse
(
new
Area
(
0
,
"
无地区归
属"
,
9999
,
"9999"
,
0
,
""
));
.
orElse
(
new
Area
(
0
,
"
省直
属"
,
9999
,
"9999"
,
0
,
""
));
return
new
AreaUnit
(
area
,
unit
);
}).
collect
(
Collectors
.
toMap
(
AreaUnit:
:
getUnitName
,
Function
.
identity
()));
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
ab2d5952
...
...
@@ -53,7 +53,6 @@ import java.time.LocalDateTime;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
tykj
.
dev
.
misc
.
base
.
BusinessEnum
.
CONFIRM_CHECK_DETAIL
;
import
static
com
.
tykj
.
dev
.
misc
.
base
.
BusinessEnum
.
CONFIRM_CHECK_STAT
;
...
...
@@ -186,14 +185,14 @@ public class DeviceCheckController {
}
@GetMapping
(
"/title/{examJobId}"
)
public
ResponseEntity
getNames
(
@PathVariable
Integer
examJobId
){
public
ResponseEntity
getNames
(
@PathVariable
Integer
examJobId
)
{
// 根据检查的主键id 查询到prov city Stat的title
Integer
provId
=
taskService
.
get
(
examJobId
).
getParentTaskId
();
// 检查的job id 找到 father 进而找到 father的billid 进而找到title Id
Integer
statId
=
taskService
.
get
(
provId
).
getBillId
();
DeviceCheckStat
deviceCheckStat
=
statRepo
.
getOne
(
statId
);
String
title
=
deviceCheckStat
.
getTitle
();
return
ResponseEntity
.
ok
(
new
CheckTitleAndTimeVo
(
title
,
deviceCheckStat
.
getEndTime
()));
return
ResponseEntity
.
ok
(
new
CheckTitleAndTimeVo
(
title
,
deviceCheckStat
.
getEndTime
()));
}
@ApiOperation
(
value
=
"发起自动核查"
,
notes
=
"发起自动核查"
)
...
...
@@ -231,9 +230,34 @@ public class DeviceCheckController {
provStatTask
.
setCustomInfo
(
"check"
);
provStatTask
=
taskService
.
start
(
provStatTask
);
// 构建自查任务(levl = 0,1,2)
//构建市的检查任务(level=2)
List
<
Units
>
examCheckUnits
=
checkedUnits
.
stream
()
.
filter
(
units
->
Arrays
.
asList
(
2
).
contains
(
units
.
getLevel
()))
.
collect
(
toList
());
Map
<
Integer
,
Integer
>
cityExamIdMap
=
new
HashMap
<>();
for
(
Units
unit
:
examCheckUnits
)
{
//构建市的统计账单
String
cityTitle
=
unit
.
getName
()
+
"检查统计"
;
DeviceCheckStat
cityCheckStat
=
initStatData
(
cityTitle
,
ccVO
.
getRemark
(),
0
,
0
,
unit
.
getName
(),
Collections
.
emptyList
(),
ccVO
.
getEndTime
().
atStartOfDay
());
Integer
cityStatId
=
statRepo
.
save
(
cityCheckStat
).
getId
();
log
.
info
(
"[核查模块] {} 检查统计账单构建完毕,id 为 {}"
,
unit
.
getName
(),
cityStatId
);
// 构建市的统计任务
TaskBto
cityStatTask
=
new
TaskBto
(
CHECK_EXAM_STAT_0
.
id
,
unit
.
getName
()
+
"检查统计任务"
,
provStatTask
.
getId
(),
addNode
(
provStatTask
.
getNodeIdDetail
(),
provStatTask
.
getId
()),
CONFIRM_CHECK_STAT
.
id
,
cityStatId
,
unit
.
getUnitId
(),
0
);
cityStatTask
.
getInvolveUserIdList
().
add
(
0
);
cityStatTask
.
setCurrentPoint
(
1
);
cityStatTask
.
setCustomInfo
(
"exam"
);
cityStatTask
=
taskService
.
start
(
cityStatTask
);
//将市的检查id记录下,以便设置市的自查任务的父级节点
cityExamIdMap
.
put
(
unit
.
getUnitId
(),
cityStatTask
.
getId
());
}
// 构建自查任务(levl = 1,2) tpye = 2
List
<
Units
>
selfCheckUnits
=
checkedUnits
.
stream
()
.
filter
(
units
->
Arrays
.
asList
(
0
,
1
,
2
).
contains
(
units
.
getLevel
()))
.
filter
(
units
->
Arrays
.
asList
(
0
,
1
,
2
).
contains
(
units
.
getLevel
())
||
units
.
getType
()
==
2
)
.
collect
(
toList
());
// 获取所有在库装备与不在库装备
...
...
@@ -266,30 +290,27 @@ public class DeviceCheckController {
}
// 3-2 构建被查单位的 自查任务 (根据被查单位的级别来区分是县级状态是市级状态) 这里的父级任务应该是省统计
TaskBto
checkedTask
=
new
TaskBto
(
CHECK_EXAM_DETAIL_0
.
id
,
"自核查任务"
,
provStatTask
.
getId
(),
addNode
(
provStatTask
.
getNodeIdDetail
(),
provStatTask
.
getId
()),
CONFIRM_CHECK_DETAIL
.
id
,
detail
.
getId
(),
unit
.
getUnitId
(),
0
);
// 如果是市level=2 的话,father Id为市的检查id
Integer
fatherId
=
0
;
if
(
unit
.
getLevel
()
==
2
)
{
fatherId
=
cityExamIdMap
.
get
(
unit
.
getUnitId
());
}
else
{
fatherId
=
provStatTask
.
getId
();
}
Integer
ownUnitId
=
0
;
if
(
unit
.
getType
()
==
2
)
{
ownUnitId
=
1
;
}
else
{
ownUnitId
=
unit
.
getUnitId
();
}
TaskBto
checkedTask
=
new
TaskBto
(
CHECK_EXAM_DETAIL_0
.
id
,
unit
.
getName
()
+
"自核查任务"
,
fatherId
,
addNode
(
provStatTask
.
getNodeIdDetail
(),
provStatTask
.
getId
()),
CONFIRM_CHECK_DETAIL
.
id
,
detail
.
getId
(),
ownUnitId
,
0
);
checkedTask
.
setCustomInfo
(
"manual"
);
taskService
.
start
(
checkedTask
);
}
//构建市的检查任务(level=2)
List
<
Units
>
examCheckUnits
=
checkedUnits
.
stream
()
.
filter
(
units
->
Arrays
.
asList
(
2
).
contains
(
units
.
getLevel
()))
.
collect
(
toList
());
for
(
Units
unit
:
examCheckUnits
)
{
//构建市的统计账单
String
cityTitle
=
unit
.
getName
()
+
"检查统计"
;
DeviceCheckStat
cityCheckStat
=
initStatData
(
cityTitle
,
ccVO
.
getRemark
(),
0
,
0
,
unit
.
getName
(),
Collections
.
emptyList
(),
ccVO
.
getEndTime
().
atStartOfDay
());
Integer
cityStatId
=
statRepo
.
save
(
cityCheckStat
).
getId
();
log
.
info
(
"[核查模块] {} 检查统计账单构建完毕,id 为 {}"
,
unit
.
getName
(),
cityStatId
);
// 构建市的统计任务
TaskBto
cityStatTask
=
new
TaskBto
(
CHECK_EXAM_STAT_0
.
id
,
unit
.
getName
()
+
"检查统计任务"
,
provStatTask
.
getId
(),
addNode
(
provStatTask
.
getNodeIdDetail
(),
provStatTask
.
getId
()),
CONFIRM_CHECK_STAT
.
id
,
cityStatId
,
unit
.
getUnitId
(),
0
);
cityStatTask
.
getInvolveUserIdList
().
add
(
0
);
cityStatTask
.
setCurrentPoint
(
1
);
cityStatTask
.
setCustomInfo
(
"exam"
);
taskService
.
start
(
cityStatTask
);
}
return
ResponseEntity
.
ok
(
ImmutableMap
.
of
(
"msg"
,
"发起核查成功"
));
}
...
...
@@ -690,9 +711,24 @@ public class DeviceCheckController {
.
stream
()
.
map
(
v
->
v
.
stream
().
reduce
(
CheckDeviceStatVo:
:
reduce
).
get
())
.
collect
(
toList
());
//直接替换
cityStatVo
=
cityStatVo
.
cleanReduce
(
addVos
);
// 把cityStatVo里本地区的进度更改为2
String
unitName
=
currentDetail
.
getCheckUnit
();
Integer
areaId
=
unitsRepo
.
findByName
(
unitName
).
getAreaId
();
String
areaName
=
areaRepo
.
findById
(
areaId
).
orElse
(
new
Area
(
0
,
"省直属"
,
9999
,
"9999"
,
0
,
""
))
.
getName
();
for
(
CheckDeviceStatVo
v
:
cityStatVo
.
getDeviceStatVoList
())
{
for
(
CheckAreaStatVo
v1
:
v
.
getAreaStatList
())
{
if
(
v1
.
getAreaName
().
equals
(
areaName
))
{
v1
.
end
();
}
}
}
// 第一个区域替换,否则累加
// if (firstArea) {
// cityStatVo.setDeviceStatVoList(addVos);
...
...
@@ -707,6 +743,7 @@ public class DeviceCheckController {
// 如果汇总完毕则将父级的统计任务推进
if
(
over
)
{
log
.
info
(
"[核查模块] 父节点 = {} 的所有子任务均已经完结,推动父节点的任务"
,
fatherTaskId
);
TaskBto
fatherTask
=
taskService
.
get
(
fatherTaskId
);
//如果上一个id是-1 则证明是所有人的跟踪统计,即自动核查,那么下一步推进到所有人的跟踪,否则设置为-2,即维持跟踪者id
Integer
lastUserId
=
fatherTask
.
getLastUserId
()
==
-
1
?
-
1
:
-
2
;
...
...
@@ -761,6 +798,8 @@ public class DeviceCheckController {
areaStatVoList
.
add
(
checkAreaStatVo
);
statVoList
.
add
(
new
CheckDeviceStatVo
(
checkDevice
.
getModel
(),
checkDevice
.
getName
(),
1
,
areaStatVoList
));
//这里直接跳过非在库装备
break
;
}
return
statVoList
;
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/CheckAreaStatVo.java
浏览文件 @
ab2d5952
...
...
@@ -4,8 +4,6 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -75,6 +73,10 @@ public class CheckAreaStatVo implements Cloneable {
this
.
comProgress
=
1
;
}
public
void
end
()
{
this
.
comProgress
=
2
;
}
/**
* 将相同地区的统计数据合并
*
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
ab2d5952
...
...
@@ -217,6 +217,13 @@ public class ObjTransUtil {
return
detailDo
;
}
/**
*
* 这里不考虑不在库的装备
* @param inLibrary
* @param notInLibrary
* @return
*/
public
String
devLib2String
(
List
<
DeviceInLibVo
>
inLibrary
,
List
<
DeviceNotInLibVo
>
notInLibrary
)
{
String
inLibString
=
inLibrary
.
stream
()
...
...
dev-user/src/main/java/com/tykj/dev/device/user/cache/AreaCache.java
浏览文件 @
ab2d5952
...
...
@@ -32,14 +32,14 @@ public class AreaCache {
}
public
Area
findByName
(
String
name
)
{
return
nameMap
.
get
(
name
);
return
nameMap
.
get
(
name
)
==
null
?
new
Area
(
0
,
"省直属"
,
9999
,
"9999"
,
0
,
""
)
:
nameMap
.
get
(
name
)
;
}
public
Area
findById
(
Integer
id
)
{
return
idMap
.
get
(
id
);
return
idMap
.
get
(
id
)
==
null
?
new
Area
(
0
,
"省直属"
,
9999
,
"9999"
,
0
,
""
)
:
idMap
.
get
(
id
)
;
}
public
AreaCache
refresh
(
List
<
Area
>
areaList
){
public
AreaCache
refresh
(
List
<
Area
>
areaList
)
{
nameMap
=
areaList
.
stream
().
collect
(
Collectors
.
toMap
(
Area:
:
getName
,
Function
.
identity
()));
idMap
=
areaList
.
stream
().
collect
(
Collectors
.
toMap
(
Area:
:
getId
,
Function
.
identity
()));
return
this
;
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/AuServiceImpl.java
浏览文件 @
ab2d5952
...
...
@@ -78,7 +78,7 @@ public class AuServiceImpl implements AuService {
.
eq
(
Objects
.
nonNull
(
value
),
example
.
getFieldName
(),
value
)
.
build
();
Units
units
=
unitsRepo
.
findOne
(
pred
).
get
();
Area
area
=
areaRepo
.
findById
(
units
.
getAreaId
()).
orElse
(
new
Area
(
0
,
"
无地区归
属"
,
9999
,
"9999"
,
0
,
""
));
Area
area
=
areaRepo
.
findById
(
units
.
getAreaId
()).
orElse
(
new
Area
(
0
,
"
省直
属"
,
9999
,
"9999"
,
0
,
""
));
return
new
AreaUnit
(
area
,
units
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论