Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
b2e1807d
提交
b2e1807d
authored
11月 17, 2021
作者:
ljj234
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 修改核查模块,市自动转发个区
上级
5018fdc4
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
52 行增加
和
36 行删除
+52
-36
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+3
-2
DeviceCheckControllerBak.java
...ice/confirmcheck/controller/DeviceCheckControllerBak.java
+0
-0
ExamController.java
...kj/dev/device/confirmcheck/controller/ExamController.java
+35
-24
CheckUnitService.java
...ykj/dev/device/confirmcheck/service/CheckUnitService.java
+2
-2
CheckUnitServiceImpl.java
...evice/confirmcheck/service/impl/CheckUnitServiceImpl.java
+12
-8
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
b2e1807d
...
...
@@ -469,6 +469,7 @@ public class DeviceCheckController {
for
(
Task
child
:
childTask
)
{
// 将子节点任务中的 统计数据确认任务 给过滤掉
// todo
if
(
child
.
getTitle
().
contains
(
"统计数据确认任务"
))
{
continue
;
}
...
...
@@ -583,7 +584,6 @@ public class DeviceCheckController {
// 这里只显示detail任务
if
(
child
.
getBusinessType
()
==
CONFIRM_CHECK_STAT
.
id
)
{
// todo
lcdList
.
add
(
LinkCheckDetail
.
builder
()
.
checkResult
(
"无误"
)
.
checkUnit
(
unitsRepo
.
findById
(
child
.
getOwnUnit
()).
get
().
getName
())
...
...
@@ -591,7 +591,7 @@ public class DeviceCheckController {
.
id
(
child
.
getBillId
())
.
remark
(
1
)
.
build
());
break
;
continue
;
}
LinkExamDetail
led
=
getLed
(
endTime
,
updateTime
,
child
);
...
...
@@ -625,6 +625,7 @@ public class DeviceCheckController {
*/
@GetMapping
(
"/title/{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
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckControllerBak.java
浏览文件 @
b2e1807d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/ExamController.java
浏览文件 @
b2e1807d
...
...
@@ -60,6 +60,7 @@ import static java.util.stream.Collectors.*;
* @author Ozoz.L cnljj1995@gmail.com
* on 11/10/21
*/
@SuppressWarnings
(
"Duplicates"
)
@RestController
@RequestMapping
(
value
=
"/check"
)
@AutoDocument
...
...
@@ -129,16 +130,16 @@ public class ExamController {
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
escrowService
.
findAllEscrowUnit
(
filter
)));
}
@ApiOperation
(
value
=
"检查地区是否可以发起核查"
,
notes
=
"检查地区是否可以发起核查"
)
@ApiOperation
(
value
=
"检查地区是否可以发起核查
,并返回没有装备的单位id
"
,
notes
=
"检查地区是否可以发起核查"
)
@PostMapping
(
"/checkPossible"
)
public
ResponseEntity
checkPossible
(
@RequestBody
UnitIds
unitIds
)
{
return
ResponseEntity
.
ok
(
escrowService
.
checkPossible
(
));
return
ResponseEntity
.
ok
(
new
UnitIds
(
checkUnitService
.
findUnExistDevice
(
unitIds
.
getIds
())
));
}
@GetMapping
(
"/confirm/unit"
)
@ApiOperation
(
value
=
"查询默认的可以被核查单位的清单(省本直,省直属,市局),同时过滤掉那些已经被代管的单位"
)
public
ResponseEntity
findDefaultUnits
(
@RequestParam
(
defaultValue
=
"false"
)
boolean
province
)
{
Map
<
Integer
,
List
<
Units
>>
checkUnit
=
checkUnitService
.
findCheckUnit
(
province
);
public
ResponseEntity
findDefaultUnits
(
@RequestParam
(
defaultValue
=
"false"
)
boolean
isExam
)
{
Map
<
Integer
,
List
<
Units
>>
checkUnit
=
checkUnitService
.
findCheckUnit
(
isExam
);
// 需要去除掉被托管的单位
ArrayList
<
Units
>
units
=
new
ArrayList
<>();
units
.
addAll
(
checkUnit
.
get
(
1
));
...
...
@@ -165,6 +166,7 @@ public class ExamController {
return
ResponseEntity
.
ok
(
"发起核查成功"
);
}
/**
* 发起检查
* <li>1. 添加发起核查bill记录</>
...
...
@@ -207,7 +209,8 @@ public class ExamController {
// 2-1 构建发起单位的 统计账单
DeviceCheckStat
provinceCheckStat
;
//根据examStatId来判断是update还是create 此时初始化的为指定检查区域的数据
DeviceCheckStat
initCheckStat
=
initStatData
(
checkedUnitNames
,
provinceCheckStat
=
initStatData
(
checkedUnitNames
,
ceVo
.
getTitle
(),
groupUserString
,
0
,
...
...
@@ -216,8 +219,6 @@ public class ExamController {
checkedUnits
,
ceVo
.
getEndTime
().
atStartOfDay
());
provinceCheckStat
=
initCheckStat
;
log
.
info
(
"[核查模块]发起手动检查,发起单位为{},被查单位为{}"
,
startUnit
.
getName
(),
checkedUnitNames
);
provinceCheckStat
.
setCheckType
(
isExam
?
CheckType
.
CT_EXAM
:
CheckType
.
CT_CHECK
);
...
...
@@ -254,6 +255,7 @@ public class ExamController {
// 3 如果是省级账户发起的检查,需要构建省局、省直属、市级的统计任务
// 3-1 创建省局单位的账单及详情
if
(
checkTypeNum
(
ceVo
.
getDetail
().
get
(
0
).
getUnitIds
(),
1
))
{
// 3-1-1 创建省局单位的统计账单
DeviceCheckStat
proStat
=
new
DeviceCheckStat
(
ceVo
.
getTitle
(),
""
,
LocalDateTime
.
now
(),
ceVo
.
getEndTime
().
atStartOfDay
(),
"[]"
,
0
,
0
,
ceVo
.
getDetail
().
get
(
0
).
getRemark
());
...
...
@@ -261,8 +263,9 @@ public class ExamController {
DeviceCheckStat
proStatSave
=
statRepo
.
save
(
proStat
);
// 3-1-2 构建省局单位的任务
TaskBto
taskBtoPro
=
new
Task
(
CHECK_EXAM_STAT_0
.
id
,
getUnitDateString
(
startUnit
,
ceVo
.
getTitle
()),
TaskBto
taskBtoPro
=
new
Task
(
CHECK_EXAM_STAT_1
.
id
,
// getUnitDateString(startUnit, ceVo.getTitle()),
getUnitDateString
(
startUnit
,
"省局单位检查任务"
),
cityStatTask
.
getId
(),
".0."
,
CONFIRM_CHECK_STAT
.
id
,
proStatSave
.
getId
(),
startUnitId
)
.
parse2Bto
();
taskBtoPro
.
setCustomInfo
(
isExam
?
"exam"
:
"check"
);
...
...
@@ -275,11 +278,13 @@ public class ExamController {
// 3-1-3 构建省级单位的自查账单及任务
List
<
Units
>
unitsPro
=
checkedUnits
.
stream
().
filter
(
o
->
o
.
getLevel
()
==
1
&&
o
.
getType
()
==
2
).
collect
(
toList
());
log
.
info
(
"[核查] 生成省局统计及详情:{}"
,
unitsPro
.
toString
());
for
(
Units
unit
:
unitsPro
)
{
DeviceCheckDetail
unitDetailDoc
=
DeviceCheckDetail
.
EmptyWithChecker
(
ceVo
.
getDetail
().
get
(
0
).
getRemark
(),
ceVo
.
getTitle
()
+
"%^&"
+
"省局单位检查"
,
ceVo
.
getTitle
()
+
"%^&"
+
"省局单位检查
任务
"
,
0
,
0
,
0
,
0
,
unit
.
getName
(),
unitsRepo
.
findByName
(
unit
.
getName
()).
getUnitId
(),
...
...
@@ -316,8 +321,8 @@ public class ExamController {
DeviceCheckStat
esStatSave
=
statRepo
.
save
(
esStat
);
// 3-1-2 构建省直单位的任务
TaskBto
taskBtoEs
=
new
Task
(
CHECK_EXAM_STAT_
0
.
id
,
getUnitDateString
(
startUnit
,
ceVo
.
getTitle
())
,
TaskBto
taskBtoEs
=
new
Task
(
CHECK_EXAM_STAT_
1
.
id
,
"[省直属单位]"
+
"省直单位检查任务"
,
cityStatTask
.
getId
(),
".0."
,
CONFIRM_CHECK_STAT
.
id
,
esStatSave
.
getId
(),
// 省直单位的检查任务应该给省里
unitsRepo
.
findAllByTypeAndLevel
(
1
,
1
).
get
(
0
).
getUnitId
()).
parse2Bto
();
...
...
@@ -328,14 +333,16 @@ public class ExamController {
taskBtoEs
.
setCurrentPoint
(
1
);
taskBtoEs
=
taskService
.
start
(
taskBtoEs
);
// 3-1-3 构建省
级
单位的自查账单及任务
// 3-1-3 构建省
直
单位的自查账单及任务
List
<
Units
>
unitsEs
=
checkedUnits
.
stream
().
filter
(
o
->
o
.
getEscrow
()
==
1
).
collect
(
toList
());
log
.
info
(
"[核查] 生成省直属统计及详情:{}"
,
unitsEs
.
toString
());
for
(
Units
unit
:
unitsEs
)
{
DeviceCheckDetail
unitDetailDoc
=
DeviceCheckDetail
.
EmptyWithChecker
(
ceVo
.
getDetail
().
get
(
0
).
getRemark
(),
ceVo
.
getTitle
()
+
"%^&"
+
"省直单位检查"
,
ceVo
.
getTitle
()
+
"%^&"
+
"省直单位检查
任务
"
,
0
,
0
,
0
,
0
,
unit
.
getName
(),
unitsRepo
.
findByName
(
unit
.
getName
()).
getUnitId
(),
...
...
@@ -373,8 +380,8 @@ public class ExamController {
DeviceCheckStat
cityStatSave
=
statRepo
.
save
(
ciyStat
);
// 3-1-2 构建市单位的任务
TaskBto
taskBtoCity
=
new
Task
(
CHECK_EXAM_STAT_
0
.
id
,
getUnitDateString
(
startUnit
,
ceVo
.
getTitle
()
),
TaskBto
taskBtoCity
=
new
Task
(
CHECK_EXAM_STAT_
1
.
id
,
getUnitDateString
(
startUnit
,
"各市单位检查任务"
),
cityStatTask
.
getId
(),
".0."
,
CONFIRM_CHECK_STAT
.
id
,
cityStatSave
.
getId
(),
unitsRepo
.
findAllByTypeAndLevel
(
1
,
1
).
get
(
0
).
getUnitId
()).
parse2Bto
();
taskBtoCity
.
setCustomInfo
(
"exam"
);
...
...
@@ -387,6 +394,9 @@ public class ExamController {
// 3-1-3 构建市单位的自查账单及任务
List
<
Units
>
unitsEs
=
checkedUnits
.
stream
().
filter
(
o
->
o
.
getLevel
()
==
2
).
collect
(
toList
());
log
.
info
(
"[核查] 检查,生成市统计及详情:{}"
,
unitsEs
.
toString
());
for
(
Units
unit
:
unitsEs
)
{
DeviceCheckDetail
unitDetailDoc
=
DeviceCheckDetail
.
EmptyWithChecker
(
...
...
@@ -398,13 +408,13 @@ public class ExamController {
devInLib
.
getOrDefault
(
unit
.
getName
(),
new
ArrayList
<>()),
devNotInLib
.
getOrDefault
(
unit
.
getName
(),
new
ArrayList
<>()));
unitDetailDoc
.
setVar2
(
String
.
valueOf
(
CHECK_DETAIL_
REGION
_0
.
id
));
unitDetailDoc
.
setVar2
(
String
.
valueOf
(
CHECK_DETAIL_
CITY
_0
.
id
));
DeviceCheckDetail
detail
=
detailRepo
.
save
(
unitDetailDoc
);
detailIds
.
add
(
detail
.
getId
());
// 3-2 构建被查单位的 自查任务 (根据被查单位的级别来区分是县级状态是市级状态)
TaskBto
checkedTask
=
new
TaskBto
(
CHECK_DETAIL_
REGION
_0
.
id
,
CHECK_DETAIL_
CITY
_0
.
id
,
getUnitDateString
(
unit
,
ceVo
.
getTitle
()),
taskBtoCity
.
getId
(),
addNode
(
taskBtoCity
.
getNodeIdDetail
(),
taskBtoCity
.
getId
()),
...
...
@@ -423,6 +433,9 @@ public class ExamController {
// 找到市相关的单位,包括市不本级以及下级单位
List
<
Units
>
units
=
checkedUnits
.
stream
().
filter
(
o
->
o
.
getLevel
()
==
2
).
collect
(
toList
());
log
.
info
(
"[核查] 核查,生成市的统计及详情:{}"
,
units
.
toString
());
for
(
Units
unit
:
units
)
{
List
<
Integer
>
findCity
=
unitsService
.
findBySubordinateAll
(
unit
.
getUnitId
()).
stream
().
map
(
Units:
:
getUnitId
).
collect
(
toList
());
// 过滤无装备的单位
...
...
@@ -433,14 +446,14 @@ public class ExamController {
}
// 1.创建市的统计账单及任务
// 3-1-1 创建市里的的统计账单
// 3-1-1 创建市里的的统计账单
DeviceCheckStat
ciyStat
=
new
DeviceCheckStat
(
ceVo
.
getTitle
(),
""
,
LocalDateTime
.
now
(),
ceVo
.
getEndTime
().
atStartOfDay
(),
"[]"
,
0
,
0
,
ceVo
.
getDetail
().
get
(
0
).
getRemark
());
ciyStat
.
setCheckType
(
CheckType
.
CT_CHECK
);
DeviceCheckStat
cityStatSave
=
statRepo
.
save
(
ciyStat
);
// 3-1-2 构建市单位的任务
TaskBto
taskBtoCity
=
new
Task
(
CHECK_EXAM_STAT_
0
.
id
,
TaskBto
taskBtoCity
=
new
Task
(
CHECK_EXAM_STAT_
1
.
id
,
getUnitDateString
(
startUnit
,
ceVo
.
getTitle
()),
cityStatTask
.
getId
(),
".0."
,
CONFIRM_CHECK_STAT
.
id
,
cityStatSave
.
getId
(),
unit
.
getUnitId
()).
parse2Bto
();
...
...
@@ -486,10 +499,6 @@ public class ExamController {
}
}
}
...
...
@@ -498,6 +507,8 @@ public class ExamController {
// a 构建区单位的自查账单及任务
List
<
Units
>
unitsEs
=
checkedUnits
.
stream
().
filter
(
o
->
o
.
getLevel
()
==
3
).
collect
(
toList
());
log
.
info
(
"[核查] 检查,生成区的统计及详情:{}"
,
unitsEs
.
toString
());
for
(
Units
unit
:
unitsEs
)
{
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/CheckUnitService.java
浏览文件 @
b2e1807d
...
...
@@ -16,10 +16,10 @@ public interface CheckUnitService {
/**
* 查询核查/检查的单位
* 包括省级、省本级、市
* @param is
Check
true_过滤掉省(检查用),false_不过滤省(核查用)
* @param is
Exam
true_过滤掉省(检查用),false_不过滤省(核查用)
* @return map
*/
Map
<
Integer
,
List
<
Units
>>
findCheckUnit
(
boolean
is
Check
);
Map
<
Integer
,
List
<
Units
>>
findCheckUnit
(
boolean
is
Exam
);
List
<
Units
>
checkPossible
(
List
<
Integer
>
ids
,
boolean
isCheck
);
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/impl/CheckUnitServiceImpl.java
浏览文件 @
b2e1807d
...
...
@@ -41,15 +41,14 @@ public class CheckUnitServiceImpl implements CheckUnitService {
private
AreaExhibitionDao
AreaExRepo
;
@Override
public
Map
<
Integer
,
List
<
Units
>>
findCheckUnit
(
boolean
filter
)
{
public
Map
<
Integer
,
List
<
Units
>>
findCheckUnit
(
boolean
isExam
)
{
// 1 构建省级单位集合
List
<
Units
>
provinceUnits
=
new
ArrayList
<>(
unitsRepo
.
findAllByTypeInAndLevelIn
(
new
ArrayList
<>(
2
),
new
ArrayList
<>(
1
))
.
orElse
(
Collections
.
emptyList
()));
List
<
Units
>
provinceUnits
=
unitsRepo
.
findAllByTypeAndLevel
(
2
,
1
);
// 过滤省局,逻辑为:如果不过滤,就加上省局
if
(!
filter
)
{
if
(!
isExam
)
{
List
<
Units
>
pro
=
unitsRepo
.
findAllByTypeAndLevel
(
1
,
1
);
provinceUnits
.
add
(
pro
.
get
(
0
));
...
...
@@ -61,14 +60,19 @@ public class CheckUnitServiceImpl implements CheckUnitService {
// 3 构建市
List
<
Units
>
cityUnits
=
unitsRepo
.
findAllByLevel
(
2
);
List
<
Units
>
checkCityUnits
=
new
ArrayList
<>();
if
(
filter
)
{
if
(
!
isExam
)
{
cityUnits
.
forEach
(
units
->
units
.
setName
(
areaRepo
.
findNameById
(
units
.
getAreaId
()))
units
->
{
units
.
setName
(
areaRepo
.
findNameById
(
units
.
getAreaId
()));
checkCityUnits
.
add
(
units
);
}
);
}
return
ImmutableMap
.
of
(
1
,
provinceUnits
,
2
,
esAUnits
,
3
,
cityUnits
);
log
.
info
(
"[核查] 查询市单位:{}"
,
checkCityUnits
);
return
ImmutableMap
.
of
(
1
,
provinceUnits
,
2
,
esAUnits
,
3
,
isExam
?
cityUnits
:
checkCityUnits
);
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论