Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f0458619
提交
f0458619
authored
11月 24, 2022
作者:
ozoz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(screen): add new feat
上级
e8673b7a
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
208 行增加
和
20 行删除
+208
-20
CheckUnitInfoList.java
...ain/java/com/tykj/dev/config/domin/CheckUnitInfoList.java
+0
-1
MapCheckVO.java
...g/src/main/java/com/tykj/dev/config/domin/MapCheckVO.java
+12
-2
CheckScreenServiceImpl.java
...ice/confirmcheck/service/impl/CheckScreenServiceImpl.java
+3
-3
ScreenApp.java
...n/src/main/java/com/tykj/dev/device/screen/ScreenApp.java
+8
-0
ScreenController.java
...ev/device/screen/subject/controller/ScreenController.java
+44
-0
CheckArg.java
...a/com/tykj/dev/device/screen/subject/entity/CheckArg.java
+21
-0
CheckMapTask.java
.../tykj/dev/device/screen/subject/service/CheckMapTask.java
+109
-13
SelfCheckBillServiceImpl.java
...vice/selfcheck/service/impl/SelfCheckBillServiceImpl.java
+1
-0
pom.xml
dev-union/pom.xml
+7
-0
application-dev.properties
dev-union/src/main/resources/application-dev.properties
+3
-1
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/domin/CheckUnitInfoList.java
浏览文件 @
f0458619
...
@@ -26,7 +26,6 @@ public class CheckUnitInfoList {
...
@@ -26,7 +26,6 @@ public class CheckUnitInfoList {
@ApiModelProperty
(
value
=
"单位名称"
)
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
private
String
unitName
;
@ApiModelProperty
(
value
=
"检查情况集合"
)
@ApiModelProperty
(
value
=
"检查情况集合"
)
private
List
<
CheckUnitInfo
>
checkUnitInfos
;
private
List
<
CheckUnitInfo
>
checkUnitInfos
;
...
...
dev-config/src/main/java/com/tykj/dev/config/domin/MapCheckVO.java
浏览文件 @
f0458619
...
@@ -6,6 +6,7 @@ import lombok.Builder;
...
@@ -6,6 +6,7 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -26,8 +27,17 @@ public class MapCheckVO {
...
@@ -26,8 +27,17 @@ public class MapCheckVO {
@ApiModelProperty
(
value
=
"区域名称"
)
@ApiModelProperty
(
value
=
"区域名称"
)
private
String
areaName
;
private
String
areaName
;
@ApiModelProperty
(
value
=
"预警信息"
)
@ApiModelProperty
(
value
=
"单位名称"
)
private
List
<
CheckUnitInfoList
>
data
;
private
String
unitName
;
@ApiModelProperty
(
value
=
"单位id"
)
private
Integer
unitId
;
@ApiModelProperty
(
value
=
"本级信息"
)
private
List
<
CheckUnitInfo
>
data
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"下级预警信息"
)
private
List
<
MapCheckVO
>
children
=
new
ArrayList
<>();
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/impl/CheckScreenServiceImpl.java
浏览文件 @
f0458619
...
@@ -42,13 +42,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
...
@@ -42,13 +42,13 @@ public class CheckScreenServiceImpl implements CheckScreenService {
PredicateBuilder
<
DeviceCheckStat
>
and
=
Specifications
.
and
();
PredicateBuilder
<
DeviceCheckStat
>
and
=
Specifications
.
and
();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
and
.
ge
(
"endTime"
,
now
);
and
.
ge
(
"endTime"
,
now
);
and
.
le
(
"endT
I
me"
,
now
.
plusDays
(
2
));
and
.
le
(
"endT
i
me"
,
now
.
plusDays
(
2
));
// 查询到所有快过期到统计任务
// 查询到所有快过期到统计任务
List
<
DeviceCheckStat
>
statList
=
statDao
.
findAll
(
and
.
build
());
List
<
DeviceCheckStat
>
statList
=
statDao
.
findAll
(
and
.
build
());
// 查询task,所有的顶级任务
// 查询task,所有的顶级任务
List
<
Task
>
tasks
=
taskDao
.
findAllBy
Id
(
statList
.
parallelStream
().
map
(
DeviceCheckStat:
:
getId
).
collect
(
Collectors
.
toList
())
)
List
<
Task
>
tasks
=
taskDao
.
findAllBy
BillIdInAndBusinessType
(
statList
.
parallelStream
().
map
(
DeviceCheckStat:
:
getId
).
collect
(
Collectors
.
toList
()),
7
)
.
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
<>();
...
...
dev-screen/src/main/java/com/tykj/dev/device/screen/ScreenApp.java
浏览文件 @
f0458619
package
com
.
tykj
.
dev
.
device
.
screen
;
package
com
.
tykj
.
dev
.
device
.
screen
;
import
com.tykj.dev.device.screen.subject.service.CheckMapTask
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
/**
/**
* @author ozoz
* @author ozoz
...
@@ -9,8 +13,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -9,8 +13,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
(
scanBasePackages
=
{
@SpringBootApplication
(
scanBasePackages
=
{
"com.tykj.dev.device.*"
"com.tykj.dev.device.*"
})
})
@EnableScheduling
public
class
ScreenApp
{
public
class
ScreenApp
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
}
}
}
}
dev-screen/src/main/java/com/tykj/dev/device/screen/subject/controller/ScreenController.java
0 → 100644
浏览文件 @
f0458619
package
com
.
tykj
.
dev
.
device
.
screen
.
subject
.
controller
;
import
com.tykj.dev.config.domin.MapCheckVO
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.config.vo.ConfigVo
;
import
com.tykj.dev.device.screen.subject.entity.CheckArg
;
import
com.tykj.dev.device.screen.subject.service.CheckMapTask
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
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.List
;
/**
* @author ozoz
* @date 2022/11/24
**/
@RestController
@RequestMapping
(
value
=
"/screen"
)
@AutoDocument
@Api
(
tags
=
"装备大屏接口"
)
@Slf4j
public
class
ScreenController
{
@Autowired
private
CheckMapTask
checkMapTask
;
@ApiOperation
(
value
=
"自核查接口"
,
notes
=
"添加系统配置变量值"
)
@PostMapping
(
value
=
"/check"
)
public
ResponseEntity
<
HashMap
<
String
,
List
<
MapCheckVO
>>>
add
()
{
return
ResponseEntity
.
ok
(
checkMapTask
.
getData
());
}
}
dev-screen/src/main/java/com/tykj/dev/device/screen/subject/entity/CheckArg.java
0 → 100644
浏览文件 @
f0458619
package
com
.
tykj
.
dev
.
device
.
screen
.
subject
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author ozoz
* @date 2022/11/24
**/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CheckArg
{
private
String
areaName
;
}
dev-screen/src/main/java/com/tykj/dev/device/screen/subject/service/CheckMapTask.java
浏览文件 @
f0458619
package
com
.
tykj
.
dev
.
device
.
screen
.
subject
.
service
;
package
com
.
tykj
.
dev
.
device
.
screen
.
subject
.
service
;
import
com.tykj.dev.config.domin.CheckUnitInfo
;
import
com.tykj.dev.config.domin.CheckUnitInfo
;
import
com.tykj.dev.config.domin.MapCheckVO
;
import
com.tykj.dev.device.confirmcheck.service.CheckScreenService
;
import
com.tykj.dev.device.confirmcheck.service.CheckScreenService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.user.subject.dao.RegionDataDao
;
import
com.tykj.dev.device.user.subject.dao.RegionDataDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.RegionData
;
import
com.tykj.dev.device.user.subject.entity.RegionData
;
import
com.tykj.dev.device.user.subject.entity.Units
;
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.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -21,45 +22,140 @@ import java.util.stream.Collectors;
...
@@ -21,45 +22,140 @@ import java.util.stream.Collectors;
**/
**/
@Component
@Component
@Slf4j
@Slf4j
public
class
CheckMapTask
{
public
class
CheckMapTask
implements
CommandLineRunner
{
private
final
static
String
ZJ_ID
=
"8017d86d-cf3c-1fe3-90ea-f8a8333a2254"
;
private
final
static
String
ZJ_ID
=
"8017d86d-cf3c-1fe3-90ea-f8a8333a2254"
;
Map
<
Integer
,
List
<
CheckUnitInfo
>>
collect
=
new
HashMap
<>();
Map
<
Integer
,
List
<
CheckUnitInfo
>>
collect
=
new
HashMap
<>();
List
<
RegionData
>
shis
=
new
ArrayList
<>();
HashMap
<
String
,
List
<
MapCheckVO
>>
rs
=
new
HashMap
<>();
@Autowired
@Autowired
private
UnitsDao
unitsDao
;
private
UnitsDao
unitsDao
;
@Autowired
@Autowired
private
RegionDataDao
regionDataDao
;
private
RegionDataDao
regionDataDao
;
@Autowired
@Autowired
private
CheckScreenService
checkScreenService
;
private
CheckScreenService
checkScreenService
;
@Autowired
@Autowired
private
SelfCheckBillService
selfCheckBillService
;
private
SelfCheckBillService
selfCheckBillService
;
public
HashMap
<
String
,
List
<
MapCheckVO
>>
getData
()
{
return
rs
;
}
/**
* 根据地区查询单位
* @return 单位集合
*/
public
List
<
Units
>
findUnitByArea
(
String
areaName
)
{
switch
(
areaName
)
{
case
"浙江省"
:
return
unitsDao
.
findAllByTypeAndLevel
(
1
,
1
);
case
"省直属"
:
return
unitsDao
.
findAllByEscrow
(
1
).
orElse
(
new
ArrayList
<>());
case
"省局"
:
return
unitsDao
.
findAllByTypeAndLevel
(
2
,
1
);
default
:
}
return
unitsDao
.
findAllByNameLike
(
"%"
+
areaName
+
"%"
);
}
public
void
initArea
()
{
public
void
initArea
()
{
// 查到了所有市的信息
List
<
RegionData
>
shis
=
regionDataDao
.
findAllByParentId
(
ZJ_ID
);
shis
.
forEach
(
o
->
o
.
setRegionDatas
(
regionDataDao
.
findAllByParentId
(
o
.
getRegionId
())));
List
<
String
>
strUnit
=
Arrays
.
asList
(
"浙江省"
,
"省直属"
,
"省局"
);
for
(
String
s
:
strUnit
)
{
List
<
Units
>
units
=
findUnitByArea
(
s
);
List
<
MapCheckVO
>
objects
=
new
ArrayList
<>();
units
.
forEach
(
o
->
{
MapCheckVO
build
=
MapCheckVO
.
builder
()
.
unitName
(
o
.
getName
())
.
unitId
(
o
.
getUnitId
())
.
data
(
collect
.
get
(
o
.
getUnitId
()))
.
build
();
objects
.
add
(
build
);
});
rs
.
put
(
s
,
objects
);
}
// 查到了所有市的信息
for
(
RegionData
shi
:
shis
)
{
List
<
MapCheckVO
>
shiUnitsInfo
=
new
ArrayList
<>();
List
<
Units
>
unitByArea
=
findUnitByArea
(
shi
.
getName
());
if
(
unitByArea
.
size
()
==
0
)
{
continue
;
}
Units
units
=
(
Units
)
unitByArea
.
get
(
0
);
List
<
MapCheckVO
>
childrenData
=
new
ArrayList
<>();
for
(
RegionData
regionData
:
shi
.
getRegionDatas
())
{
List
<
Units
>
unitByArea1
=
findUnitByArea
(
regionData
.
getName
());
if
(
unitByArea1
.
size
()
==
0
)
{
continue
;
}
Units
qu
=
(
Units
)
unitByArea1
.
get
(
0
);
MapCheckVO
build
=
MapCheckVO
.
builder
()
.
areaName
(
regionData
.
getName
())
.
code
(
regionData
.
getCode
())
.
unitId
(
qu
.
getUnitId
())
.
unitName
(
qu
.
getName
())
.
data
(
collect
.
get
(
units
.
getUnitId
()))
.
build
();
childrenData
.
add
(
build
);
}
MapCheckVO
build
=
MapCheckVO
.
builder
()
.
areaName
(
shi
.
getName
())
.
code
(
shi
.
getCode
())
.
unitId
(
units
.
getUnitId
())
.
unitName
(
units
.
getName
())
.
data
(
collect
.
get
(
units
.
getUnitId
()))
.
children
(
childrenData
)
.
build
();
shiUnitsInfo
.
add
(
build
);
rs
.
put
(
shi
.
getName
(),
shiUnitsInfo
);
}
}
}
/**
* 根据单位id获取,获取告警信息。将次信息存储至内存中
* @return Map
*/
public
Map
<
Integer
,
List
<
CheckUnitInfo
>>
init
()
{
public
Map
<
Integer
,
List
<
CheckUnitInfo
>>
init
()
{
List
<
CheckUnitInfo
>
checkUnitInfos
=
checkScreenService
.
statMapData
();
List
<
CheckUnitInfo
>
checkUnitInfos
=
checkScreenService
.
statMapData
();
List
<
CheckUnitInfo
>
selfExamination
=
selfCheckBillService
.
selectNoFinSh2Weeks
();
List
<
CheckUnitInfo
>
selfExamination
=
selfCheckBillService
.
selectNoFinSh2Weeks
();
checkUnitInfos
.
addAll
(
selfExamination
);
checkUnitInfos
.
addAll
(
selfExamination
);
collect
=
checkUnitInfos
.
stream
().
collect
(
Collectors
.
groupingBy
(
CheckUnitInfo:
:
getUnitId
));
Map
<
Integer
,
List
<
CheckUnitInfo
>>
collect
=
checkUnitInfos
.
stream
().
collect
(
Collectors
.
groupingBy
(
CheckUnitInfo:
:
getUnitId
));
return
collect
;
return
collect
;
}
public
void
initShi
()
{
log
.
info
(
"初始化大屏所需的地区信息"
);
long
startTime
=
System
.
currentTimeMillis
();
List
<
RegionData
>
shi
=
regionDataDao
.
findAllByParentId
(
"330000"
);
for
(
RegionData
regionData
:
shi
)
{
regionData
.
setRegionDatas
(
regionDataDao
.
findAllByParentId
(
regionData
.
getCode
()));
}
shis
=
shi
;
log
.
info
(
"初始化大屏所需的地区信息完成,用时:{}ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"市的信息:{}"
,
shis
);
}
}
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
initShi
();
init
();
long
startTime
=
System
.
currentTimeMillis
();
log
.
info
(
"开始计算数据"
,
System
.
currentTimeMillis
()
-
startTime
);
initArea
();
log
.
info
(
"计算数据,用时:{}ms"
,
System
.
currentTimeMillis
()
-
startTime
);
log
.
info
(
"打印{}"
,
rs
.
toString
());
}
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/SelfCheckBillServiceImpl.java
浏览文件 @
f0458619
...
@@ -272,6 +272,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
...
@@ -272,6 +272,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
List
<
Integer
>
statusList
=
new
ArrayList
<>(
Arrays
.
asList
(
0
,
3
));
List
<
Integer
>
statusList
=
new
ArrayList
<>(
Arrays
.
asList
(
0
,
3
));
List
<
SelfCheckBill
>
checkBillList
=
selfExaminationBillDao
.
findAll
().
stream
()
List
<
SelfCheckBill
>
checkBillList
=
selfExaminationBillDao
.
findAll
().
stream
()
.
filter
(
selfCheckBill
->
statusList
.
contains
(
selfCheckBill
.
getCheckStatus
()))
.
filter
(
selfCheckBill
->
statusList
.
contains
(
selfCheckBill
.
getCheckStatus
()))
.
filter
(
o
->
o
.
getCheckTime
()
!=
null
)
.
filter
(
selfCheckBill
->
LocalDateTime
.
now
().
isEqual
(
DateUtil
.
getLocalDateTime
(
selfCheckBill
.
getCheckTime
()).
plusWeeks
(
2
)))
.
filter
(
selfCheckBill
->
LocalDateTime
.
now
().
isEqual
(
DateUtil
.
getLocalDateTime
(
selfCheckBill
.
getCheckTime
()).
plusWeeks
(
2
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
CheckUnitInfo
>
checkUnitInfoList
=
new
ArrayList
<>();
List
<
CheckUnitInfo
>
checkUnitInfoList
=
new
ArrayList
<>();
...
...
dev-union/pom.xml
浏览文件 @
f0458619
...
@@ -75,6 +75,13 @@
...
@@ -75,6 +75,13 @@
</profiles>
</profiles>
<dependencies>
<dependencies>
<dependency>
<groupId>
com.tykj
</groupId>
<artifactId>
dev-screen
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
...
...
dev-union/src/main/resources/application-dev.properties
浏览文件 @
f0458619
server.port
=
8088
spring.application.name
=
device-dev
spring.application.name
=
device-dev
spring.datasource.url
=
jdbc:mysql://192.168.0.232:3307/device_master?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.url
=
jdbc:mysql://192.168.0.232:3307/device_master?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
...
@@ -11,7 +13,7 @@ spring.jpa.hibernate.ddl-auto=update
...
@@ -11,7 +13,7 @@ spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/
#file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin
# spring boot admin
file.path
=
/Users/
zhoushaopan/file
/
file.path
=
/Users/
ozoz/data
/
preview.path
=
http://192.168.102.169:8087/file/
preview.path
=
http://192.168.102.169:8087/file/
spring.boot.admin.client.url
=
http://localhost:8769
spring.boot.admin.client.url
=
http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl
=
http://localhost:8087
spring.boot.admin.client.instance.serviceBaseUrl
=
http://localhost:8087
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论