Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
cf22e642
提交
cf22e642
authored
11月 29, 2022
作者:
ljj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(screen): 新增自核查展示
上级
ba556686
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
33 行增加
和
18 行删除
+33
-18
CheckScreenServiceImpl.java
...ice/confirmcheck/service/impl/CheckScreenServiceImpl.java
+24
-11
ScreenController.java
...ev/device/screen/subject/controller/ScreenController.java
+2
-5
CheckMapTask.java
.../tykj/dev/device/screen/subject/service/CheckMapTask.java
+5
-2
TaskDao.java
...ain/java/com/tykj/dev/device/task/repository/TaskDao.java
+2
-0
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/impl/CheckScreenServiceImpl.java
浏览文件 @
cf22e642
...
@@ -14,10 +14,12 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,10 +14,12 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -36,6 +38,7 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -36,6 +38,7 @@ public class CheckScreenServiceImpl implements CheckScreenService {
@Autowired
@Autowired
private
DeviceCheckStatDao
statDao
;
private
DeviceCheckStatDao
statDao
;
@Override
public
List
<
CheckUnitInfo
>
statMapData
()
{
public
List
<
CheckUnitInfo
>
statMapData
()
{
...
@@ -46,8 +49,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -46,8 +49,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
// 查询到所有快过期到统计任务
// 查询到所有快过期到统计任务
List
<
DeviceCheckStat
>
statList
=
statDao
.
findAll
(
and
.
build
());
List
<
DeviceCheckStat
>
statList
=
statDao
.
findAll
(
and
.
build
());
// 查询task,所有的顶级任务
// 查询task,所有的顶级任务
List
<
Task
>
tasks
=
taskDao
.
findAllByBillIdInAndBusinessType
(
statList
.
parallelStream
().
map
(
DeviceCheckStat:
:
getId
).
collect
(
Collectors
.
toList
()),
7
)
List
<
Task
>
tasks
=
taskDao
.
findAllByBillIdInAndBusinessTypeAndBillStatusNotIn
(
statList
.
parallelStream
().
map
(
DeviceCheckStat:
:
getId
).
collect
(
Collectors
.
toList
()),
7
,
Arrays
.
asList
(
20001
,
9999
)
)
.
parallelStream
().
filter
(
o
->
o
.
getParentTaskId
()
==
0
).
collect
(
Collectors
.
toList
());
.
parallelStream
().
filter
(
o
->
o
.
getParentTaskId
()
==
0
).
collect
(
Collectors
.
toList
());
List
<
CheckUnitInfo
>
rs
=
new
ArrayList
<>();
List
<
CheckUnitInfo
>
rs
=
new
ArrayList
<>();
...
@@ -57,13 +65,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -57,13 +65,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
for
(
Task
secondTask
:
secondTasks
)
{
for
(
Task
secondTask
:
secondTasks
)
{
if
(
secondTask
.
getBusinessType
()
==
8
)
{
if
(
secondTask
.
getBusinessType
()
==
8
)
{
CheckUnitInfo
c
=
CheckFill
(
initCheckUnitInfo
(
task
),
secondTask
);
CheckUnitInfo
c
=
CheckFill
(
initCheckUnitInfo
(
task
,
task
.
getBillId
()),
secondTask
,
task
.
getBillId
()
);
rs
.
add
(
c
);
rs
.
add
(
c
);
}
else
{
}
else
{
List
<
Task
>
threeTasks
=
taskDao
.
findAllByParentTaskId
(
secondTask
.
getId
());
List
<
Task
>
threeTasks
=
taskDao
.
findAllByParentTaskId
(
secondTask
.
getId
());
for
(
Task
threeTask
:
threeTasks
)
{
for
(
Task
threeTask
:
threeTasks
)
{
if
(
threeTask
.
getBusinessType
()
==
8
)
{
if
(
threeTask
.
getBusinessType
()
==
8
)
{
CheckUnitInfo
c
=
CheckFill
(
initCheckUnitInfo
(
task
),
threeTask
);
CheckUnitInfo
c
=
CheckFill
(
initCheckUnitInfo
(
task
,
task
.
getBillId
()),
threeTask
,
task
.
getBillId
()
);
rs
.
add
(
c
);
rs
.
add
(
c
);
}
}
}
}
...
@@ -75,11 +83,12 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -75,11 +83,12 @@ public class CheckScreenServiceImpl implements CheckScreenService {
}
}
private
CheckUnitInfo
initCheckUnitInfo
(
Task
task
)
{
private
CheckUnitInfo
initCheckUnitInfo
(
Task
task
,
Integer
billId
)
{
DeviceCheckStat
stat
=
statDao
.
findById
(
billId
).
get
();
CheckUnitInfo
checkUnitInfo
=
new
CheckUnitInfo
();
CheckUnitInfo
checkUnitInfo
=
new
CheckUnitInfo
();
DeviceCheckStat
deviceCheckStat
=
statDao
.
findById
(
task
.
getId
()).
orElse
(
new
DeviceCheckStat
());
DeviceCheckStat
deviceCheckStat
=
statDao
.
findById
(
task
.
getId
()).
orElse
(
new
DeviceCheckStat
());
checkUnitInfo
.
setStartTime
(
deviceCheckS
tat
.
getStartTime
());
checkUnitInfo
.
setStartTime
(
s
tat
.
getStartTime
());
checkUnitInfo
.
setEndTime
(
deviceCheckS
tat
.
getEndTime
());
checkUnitInfo
.
setEndTime
(
s
tat
.
getEndTime
());
checkUnitInfo
.
setUnitId
(
task
.
getOwnUnit
());
checkUnitInfo
.
setUnitId
(
task
.
getOwnUnit
());
// 判断是检查还是核查
// 判断是检查还是核查
if
(
"check"
.
equals
(
task
.
getCustomInfo
()))
{
if
(
"check"
.
equals
(
task
.
getCustomInfo
()))
{
...
@@ -92,17 +101,21 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -92,17 +101,21 @@ public class CheckScreenServiceImpl implements CheckScreenService {
}
}
private
CheckUnitInfo
CheckFill
(
CheckUnitInfo
checkUnitInfo
,
Task
task
)
{
private
CheckUnitInfo
CheckFill
(
CheckUnitInfo
checkUnitInfo
,
Task
task
,
Integer
bigBillId
)
{
DeviceCheckDetail
detail
=
detailDao
.
findById
(
task
.
getBillId
()).
orElse
(
new
DeviceCheckDetail
());
DeviceCheckDetail
detail
=
detailDao
.
findById
(
task
.
getBillId
()).
orElse
(
new
DeviceCheckDetail
());
checkUnitInfo
.
setBillId
(
task
.
getBillId
());
checkUnitInfo
.
setBillId
(
bigBillId
);
if
(
detail
.
getUserAId
()
!=
null
)
{
checkUnitInfo
.
setUnitId
(
task
.
getOwnUnit
());
if
(
detail
.
getUserAId
()
!=
null
&&
detail
.
getUserAId
()
!=
0
)
{
checkUnitInfo
.
setCheckOneInfo
(
1
);
checkUnitInfo
.
setCheckOneInfo
(
1
);
}
}
if
(
detail
.
getUserBId
()
!=
null
)
{
if
(
detail
.
getUserBId
()
!=
null
&&
detail
.
getUserAId
()
!=
0
)
{
checkUnitInfo
.
setCheckTwoInfo
(
1
);
checkUnitInfo
.
setCheckTwoInfo
(
1
);
}
}
if
(
detail
.
getUserCId
()
!=
null
)
{
if
(
detail
.
getUserCId
()
!=
null
&&
detail
.
getUserAId
()
!=
0
)
{
checkUnitInfo
.
setCheckThreeInfo
(
1
);
checkUnitInfo
.
setCheckThreeInfo
(
1
);
}
else
{
checkUnitInfo
.
setCheckThreeInfo
(
0
);
}
}
return
checkUnitInfo
;
return
checkUnitInfo
;
}
}
...
...
dev-screen/src/main/java/com/tykj/dev/device/screen/subject/controller/ScreenController.java
浏览文件 @
cf22e642
...
@@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -35,7 +32,7 @@ public class ScreenController {
...
@@ -35,7 +32,7 @@ public class ScreenController {
private
CheckMapTask
checkMapTask
;
private
CheckMapTask
checkMapTask
;
@ApiOperation
(
value
=
"自核查接口"
,
notes
=
"添加系统配置变量值"
)
@ApiOperation
(
value
=
"自核查接口"
,
notes
=
"添加系统配置变量值"
)
@
Pos
tMapping
(
value
=
"/check"
)
@
Ge
tMapping
(
value
=
"/check"
)
public
ResponseEntity
<
HashMap
<
String
,
List
<
MapCheckVO
>>>
add
()
{
public
ResponseEntity
<
HashMap
<
String
,
List
<
MapCheckVO
>>>
add
()
{
return
ResponseEntity
.
ok
(
checkMapTask
.
getData
());
return
ResponseEntity
.
ok
(
checkMapTask
.
getData
());
}
}
...
...
dev-screen/src/main/java/com/tykj/dev/device/screen/subject/service/CheckMapTask.java
浏览文件 @
cf22e642
...
@@ -67,7 +67,7 @@ public class CheckMapTask implements CommandLineRunner {
...
@@ -67,7 +67,7 @@ public class CheckMapTask implements CommandLineRunner {
public
void
initArea
()
{
public
void
initArea
()
{
List
<
String
>
strUnit
=
Arrays
.
asList
(
"
浙江省"
,
"省直属"
,
"省局
"
);
List
<
String
>
strUnit
=
Arrays
.
asList
(
"
省机要局"
,
"省直属
"
);
for
(
String
s
:
strUnit
)
{
for
(
String
s
:
strUnit
)
{
List
<
Units
>
units
=
findUnitByArea
(
s
);
List
<
Units
>
units
=
findUnitByArea
(
s
);
List
<
MapCheckVO
>
objects
=
new
ArrayList
<>();
List
<
MapCheckVO
>
objects
=
new
ArrayList
<>();
...
@@ -150,13 +150,16 @@ public class CheckMapTask implements CommandLineRunner {
...
@@ -150,13 +150,16 @@ public class CheckMapTask implements CommandLineRunner {
@Override
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
public
void
run
(
String
...
args
)
throws
Exception
{
log
.
info
(
"加载地区信息"
);
initShi
();
initShi
();
initAll
();
}
}
public
void
initAll
()
{
public
void
initAll
()
{
initShi
();
init
();
init
();
long
startTime
=
System
.
currentTimeMillis
();
long
startTime
=
System
.
currentTimeMillis
();
log
.
info
(
"开始计算数据"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"开始计算数据"
);
initArea
();
initArea
();
log
.
info
(
"计算数据,用时:{}ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"计算数据,用时:{}ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"打印{}"
,
rs
.
toString
());
log
.
info
(
"打印{}"
,
rs
.
toString
());
...
...
dev-task/src/main/java/com/tykj/dev/device/task/repository/TaskDao.java
浏览文件 @
cf22e642
...
@@ -107,4 +107,6 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
...
@@ -107,4 +107,6 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
List
<
Task
>
findAllByBusinessTypeAndOwnUnitAndCustomInfo
(
Integer
businessType
,
Integer
ownUnit
,
String
customInfo
);
List
<
Task
>
findAllByBusinessTypeAndOwnUnitAndCustomInfo
(
Integer
businessType
,
Integer
ownUnit
,
String
customInfo
);
List
<
Task
>
findAllByIdIn
(
List
<
Integer
>
ids
);
List
<
Task
>
findAllByIdIn
(
List
<
Integer
>
ids
);
List
<
Task
>
findAllByBillIdInAndBusinessTypeAndBillStatusNotIn
(
List
<
Integer
>
ids
,
Integer
type
,
List
<
Integer
>
status
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论