Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c1afd393
提交
c1afd393
authored
7月 05, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(自查模块): 优化了发起自查业务时间
优化了发起自查业务时间
上级
4fa5e7e1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
95 行增加
和
8 行删除
+95
-8
HistoryDeviceBillRun.java
...ykj/dev/device/selfcheck/config/HistoryDeviceBillRun.java
+47
-0
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+27
-6
TaskSelectController.java
...ev/device/taskselect/controller/TaskSelectController.java
+21
-2
没有找到文件。
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/config/HistoryDeviceBillRun.java
0 → 100644
浏览文件 @
c1afd393
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
config
;
import
com.tykj.dev.device.selfcheck.repository.HistoryDeviceBillDao
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
javax.persistence.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author zsp
* @create 2022/5/23 14:37
*/
@Component
@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
HistoryDeviceBillRun
{
@Resource
private
HistoryDeviceBillDao
deviceBillDao
;
private
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map
=
new
HashMap
<>();
@PostConstruct
private
void
initHistoryDeviceBill
(){
log
.
info
(
"历史自查存储数据表开始同步...."
);
this
.
map
=
deviceBillDao
.
findAll
().
stream
().
collect
(
Collectors
.
groupingBy
(
HistoryDeviceBill:
:
getBillId
));
log
.
info
(
"历史自查存储数据表同步成功...."
);
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
c1afd393
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.SelfCheckVo
;
import
com.tykj.dev.device.library.subject.vo.SelfCheckVo
;
import
com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask
;
import
com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask
;
import
com.tykj.dev.device.selfcheck.config.HistoryDeviceBillRun
;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
...
@@ -131,7 +132,7 @@ public class SelfCheckController {
...
@@ -131,7 +132,7 @@ public class SelfCheckController {
private
HistoryDeviceBillService
historyDeviceBillService
;
private
HistoryDeviceBillService
historyDeviceBillService
;
@Resource
@Resource
private
JdbcTemplate
jdbcTemplate
;
private
HistoryDeviceBillRun
historyDeviceBillRun
;
/**
/**
* 月度
* 月度
...
@@ -413,6 +414,11 @@ public class SelfCheckController {
...
@@ -413,6 +414,11 @@ public class SelfCheckController {
//批量保存
//批量保存
batchSave
(
historyDeviceBillList
);
batchSave
(
historyDeviceBillList
);
// historyDeviceBillService.batchSave(historyDeviceBillList);
// historyDeviceBillService.batchSave(historyDeviceBillList);
//将数据转换成map放在缓存中
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map
=
historyDeviceBillList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
HistoryDeviceBill:
:
getBillId
));
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
listMap
=
historyDeviceBillRun
.
getMap
();
listMap
.
putAll
(
map
);
}
}
}
else
{
}
else
{
// 是0 和1
// 是0 和1
...
@@ -435,7 +441,11 @@ public class SelfCheckController {
...
@@ -435,7 +441,11 @@ public class SelfCheckController {
});
});
//保存
//保存
batchSave
(
historyDeviceBillList
);
batchSave
(
historyDeviceBillList
);
//将数据转换成map放在缓存中
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map
=
historyDeviceBillList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
HistoryDeviceBill:
:
getBillId
));
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
listMap
=
historyDeviceBillRun
.
getMap
();
listMap
.
putAll
(
map
);
// historyDeviceBillService.batchSave(historyDeviceBillList);
// historyDeviceBillService.batchSave(historyDeviceBillList);
// executor.execute(()->{
// executor.execute(()->{
// historyDeviceBillService.batchSave(historyDeviceBillList);
// historyDeviceBillService.batchSave(historyDeviceBillList);
...
@@ -460,7 +470,11 @@ public class SelfCheckController {
...
@@ -460,7 +470,11 @@ public class SelfCheckController {
});
});
//保存
//保存
batchSave
(
historyDeviceBillList
);
batchSave
(
historyDeviceBillList
);
//将数据转换成map放在缓存中
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map
=
historyDeviceBillList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
HistoryDeviceBill:
:
getBillId
));
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
listMap
=
historyDeviceBillRun
.
getMap
();
listMap
.
putAll
(
map
);
// historyDeviceBillService.batchSave(historyDeviceBillList);
// historyDeviceBillService.batchSave(historyDeviceBillList);
// executor.execute(()->{
// executor.execute(()->{
// historyDeviceBillService.batchSave(historyDeviceBillList);
// historyDeviceBillService.batchSave(historyDeviceBillList);
...
@@ -755,9 +769,16 @@ public class SelfCheckController {
...
@@ -755,9 +769,16 @@ public class SelfCheckController {
// 2.添加新增不在系统的装备
// 2.添加新增不在系统的装备
list
.
add
(
newDeviceList
);
list
.
add
(
newDeviceList
);
//根据业务id和业务类型查询
//根据业务id和业务类型查询
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
List
<
HistoryDeviceBill
>
historyDeviceBillList
;
historyDeviceBillService
.
selectByBillId
(
billId
);
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map1
=
historyDeviceBillRun
.
getMap
();
if
(
map1
.
containsKey
(
billId
)){
historyDeviceBillList
=
map1
.
get
(
billId
);
}
else
{
historyDeviceBillList
=
historyDeviceBillService
.
selectByBillId
(
billId
);
//将数据放在缓存中
map1
.
put
(
billId
,
historyDeviceBillList
);
}
//3.添加自查装备
//3.添加自查装备
// list.add(libraryEntities1);
// list.add(libraryEntities1);
list
.
add
(
historyDeviceBillList
);
list
.
add
(
historyDeviceBillList
);
...
...
dev-taskselect/src/main/java/com/tykj/dev/device/taskselect/controller/TaskSelectController.java
浏览文件 @
c1afd393
...
@@ -26,6 +26,7 @@ import com.tykj.dev.device.repair.service.RepairBackBillService;
...
@@ -26,6 +26,7 @@ import com.tykj.dev.device.repair.service.RepairBackBillService;
import
com.tykj.dev.device.repair.service.RepairBillService
;
import
com.tykj.dev.device.repair.service.RepairBillService
;
import
com.tykj.dev.device.repair.subject.domin.RepairBackBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairBackBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.selfcheck.config.HistoryDeviceBillRun
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
...
@@ -52,9 +53,11 @@ import com.tykj.dev.misc.utils.StringSplitUtil;
...
@@ -52,9 +53,11 @@ import com.tykj.dev.misc.utils.StringSplitUtil;
//import com.tykj.dev.readmachine.devreadmachine.service.ReadMachineLibraryService;
//import com.tykj.dev.readmachine.devreadmachine.service.ReadMachineLibraryService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.Area
;
import
org.checkerframework.checker.units.qual.Area
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.StopWatch
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -72,6 +75,7 @@ import static java.util.stream.Collectors.toMap;
...
@@ -72,6 +75,7 @@ import static java.util.stream.Collectors.toMap;
@Api
(
tags
=
"业务模块"
,
description
=
"业务模块"
)
@Api
(
tags
=
"业务模块"
,
description
=
"业务模块"
)
@AutoDocument
@AutoDocument
@RequestMapping
(
"/business"
)
@RequestMapping
(
"/business"
)
@Slf4j
public
class
TaskSelectController
{
public
class
TaskSelectController
{
@Autowired
@Autowired
...
@@ -135,6 +139,9 @@ public class TaskSelectController {
...
@@ -135,6 +139,9 @@ public class TaskSelectController {
@Resource
@Resource
private
UserCache
userCache
;
private
UserCache
userCache
;
@Resource
private
HistoryDeviceBillRun
historyDeviceBillRun
;
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@GetMapping
(
"/manage/detail/{id}"
)
@GetMapping
(
"/manage/detail/{id}"
)
public
ResponseEntity
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
public
ResponseEntity
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
...
@@ -357,10 +364,22 @@ public class TaskSelectController {
...
@@ -357,10 +364,22 @@ public class TaskSelectController {
// libraryEntities1.add(deviceLibraryEntity);
// libraryEntities1.add(deviceLibraryEntity);
// }
// }
// }
// }
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
historyDeviceBillService
.
selectByBillId
(
billId
);
List
<
HistoryDeviceBill
>
historyDeviceBillList
;
StopWatch
stopWatch
=
new
StopWatch
(
"查询历史表的时间"
);
stopWatch
.
start
();
//过滤出1的
//过滤出1的
Map
<
Integer
,
List
<
HistoryDeviceBill
>>
map1
=
historyDeviceBillRun
.
getMap
();
if
(
map1
.
containsKey
(
billId
)){
historyDeviceBillList
=
map1
.
get
(
billId
);
}
else
{
historyDeviceBillList
=
historyDeviceBillService
.
selectByBillId
(
billId
);
//将数据放在缓存中
map1
.
put
(
billId
,
historyDeviceBillList
);
}
stopWatch
.
stop
();
log
.
info
(
"查询历史表的时间:{}"
,
stopWatch
.
getTotalTimeMillis
()+
"ms"
);
List
<
HistoryDeviceBill
>
billList1
=
List
<
HistoryDeviceBill
>
billList1
=
historyDeviceBillList
.
stream
().
filter
(
historyDeviceBill
->
historyDeviceBill
.
getCheckResult
()
==
1
)
historyDeviceBillList
.
stream
().
filter
(
historyDeviceBill
->
historyDeviceBill
.
getCheckResult
()
==
1
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论