Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
0609c28b
提交
0609c28b
authored
11月 10, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[统计分析]添加统计分析缓存和缓存刷新定时任务
上级
27eaf547
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
320 行增加
和
67 行删除
+320
-67
BlockchaApplication.java
.../main/java/com/tykj/dev/blockcha/BlockchaApplication.java
+1
-1
BlockChainUtilImpl.java
...dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
+1
-1
AreaCache.java
.../tykj/dev/device/confirmcheck/entity/cache/AreaCache.java
+2
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+0
-24
RepairStatusChangeVo.java
...kj/dev/device/repair/subject/vo/RepairStatusChangeVo.java
+0
-2
DeviceRetiredController.java
...ev/device/retired/controller/DeviceRetiredController.java
+0
-4
AccessController.java
...n/java/com/tykj/dev/rfid/controller/AccessController.java
+47
-21
CacheConfig.java
...main/java/com/tykj/dev/statistical/cache/CacheConfig.java
+24
-0
CacheRefreshTask.java
...java/com/tykj/dev/statistical/cache/CacheRefreshTask.java
+111
-0
StatisticalCache.java
...java/com/tykj/dev/statistical/cache/StatisticalCache.java
+80
-0
StatisticalController.java
...ykj/dev/statistical/controller/StatisticalController.java
+38
-10
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+0
-4
pom.xml
dev-union/pom.xml
+12
-0
UnitsCache.java
.../main/java/com/tykj/dev/device/user/cache/UnitsCache.java
+2
-0
UserCache.java
...c/main/java/com/tykj/dev/device/user/cache/UserCache.java
+2
-0
没有找到文件。
dev-blockcha/src/main/java/com/tykj/dev/blockcha/BlockchaApplication.java
浏览文件 @
0609c28b
...
...
@@ -3,7 +3,7 @@ package com.tykj.dev.blockcha;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
@SpringBootApplication
(
scanBasePackages
=
"com.tykj.dev.*"
)
public
class
BlockchaApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
dev-blockcha/src/main/java/com/tykj/dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
浏览文件 @
0609c28b
...
...
@@ -29,7 +29,7 @@ public class BlockChainUtilImpl implements BlockChainUtil {
private
final
static
String
SECRET_KEY
=
"aLTEmMyIfAWzVCIy8EKI0uGFThrR20dR12C62ENZ16RAX5TNTLUC4CCP"
;
private
final
static
String
SECRET_ID
=
"tLNj025SOWTWv56ORlRdGA"
;
private
final
static
String
BLOCK_CHAIN_URL
=
"http://1
20.55.94.123
"
;
private
final
static
String
BLOCK_CHAIN_URL
=
"http://1
92.168.3.2
"
;
@Override
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/cache/AreaCache.java
浏览文件 @
0609c28b
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
cache
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -13,6 +14,7 @@ import java.util.stream.Collectors;
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/22 at 5:33 下午
*/
@Data
public
class
AreaCache
{
private
Map
<
String
,
Area
>
nameMap
;
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
0609c28b
...
...
@@ -141,8 +141,6 @@ public class RepairController {
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBillSaveVo
.
getFileName
(),
repairBillSaveVo
.
getFileUrl
()));
// TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"向"+repairBillSaveVo.getReceiveUnit()+"发起装备维修",fileVoList);
// taskLogService.addLog(taskLogBto);
deviceRepairSendBillEntity
.
setRepairStatus
(
0
);
deviceRepairSendBillEntity
.
setSendTime
(
new
Date
());
StringBuffer
stringBuffer
=
new
StringBuffer
();
...
...
@@ -226,9 +224,6 @@ public class RepairController {
if
(
level
==
1
)
{
taskService
.
update
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
COUNTRY_REPAIRING
,
repairSendBill
.
getStartUseraId
()));
}
//存业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null);
// taskLogService.addLog(taskLogBto);
//如果当前为省,改变装备的所在为中办
if
(
level
==
1
)
{
//获取当前业务维修详情
...
...
@@ -326,8 +321,6 @@ public class RepairController {
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
repairSendBill
.
getBillFileName
(),
repairSendBill
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
repairSendBill
.
getReceiveFileName
(),
repairSendBill
.
getReceiveFileUrl
()));
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"接收并发起入库",fileVoList);
// taskLogService.addLog(taskLogBto);
//更新维修单和送修单
repairBill
.
setRepairStatus
(
6
);
repairBill
.
setRepairUserB
(
userPublicService
.
getOne
(
repairReceiveVo
.
getReceiveUserbId
()).
getName
());
...
...
@@ -412,9 +405,6 @@ public class RepairController {
if
(
repairConfirmVo
.
getStatus
()
==
0
)
{
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairSendBill
.
getRepairUseraId
()));
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并入库维修",null);
// taskLogService.addLog(taskLogBto);
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
4
);
repairSendBill
.
setRepairStatus
(
5
);
...
...
@@ -445,9 +435,6 @@ public class RepairController {
if
(
repairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修装备入库审核失败",null);
// taskLogService.addLog(taskLogBto);
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
3
);
repairSendBill
.
setRepairStatus
(
4
);
...
...
@@ -549,8 +536,6 @@ public class RepairController {
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBackBillSaveVo
.
getFileName
(),
repairBackBillSaveVo
.
getFileUrl
()));
// TaskLogBto taskLogBto = new TaskLogBto(task.getId(),"向" + repairBackBillSaveVo.getReceiveUnit() + "发起配发",fileVoList);
// taskLogService.addLog(taskLogBto);
//添加装备日志
for
(
DeviceDetailVo
d
:
repairBackBillSaveVo
.
getDeviceList
())
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBackBillSaveVo
.
getReceiveUnit
()
+
"退还维修装备"
,
fileVoList
);
...
...
@@ -617,9 +602,6 @@ public class RepairController {
}
else
{
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
));
}
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修退回审核成功并出库",null);
// taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核成功"
);
}
...
...
@@ -701,9 +683,6 @@ public class RepairController {
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
}
//添加业务日志
// TaskLogBto taskLogBto3 = new TaskLogBto(taskBto.getId(),"维修退回装备接收并发起入库",fileVoList);
// taskLogService.addLog(taskLogBto3);
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存放正常接收的装备id
List
<
Integer
>
idList
=
new
ArrayList
<>();
...
...
@@ -804,9 +783,6 @@ public class RepairController {
if
(
repairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//存业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修退回装备入库审核失败",null);
// taskLogService.addLog(taskLogBto);
//更新退回单状态
repairBackBill
.
setBackStatus
(
4
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RepairStatusChangeVo.java
浏览文件 @
0609c28b
...
...
@@ -30,11 +30,9 @@ public class RepairStatusChangeVo {
@ApiModelProperty
(
name
=
"新的维修状态"
,
value
=
"1"
)
private
Integer
newStatus
;
@NotNull
(
message
=
"fileName不能为空"
)
@ApiModelProperty
(
name
=
"报废单文件名"
)
private
String
fileName
;
@NotNull
(
message
=
"fileUrl不能为空"
)
@ApiModelProperty
(
name
=
"报废单URL"
)
private
String
fileUrl
;
}
dev-retired/src/main/java/com/tykj/dev/device/retired/controller/DeviceRetiredController.java
浏览文件 @
0609c28b
...
...
@@ -113,8 +113,6 @@ public class DeviceRetiredController {
retiredBill
=
deviceRetiredBillService
.
addEntity
(
retiredBill
);
//生成Task
TaskBto
task
=
taskService
.
start
(
initTaskBto
(
retiredBill
));
//生成任务日志
// taskLogService.addLog(new TaskLogBto(task.getId(), "发起退装", null));
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"退装申请成功"
);
}
...
...
@@ -169,8 +167,6 @@ public class DeviceRetiredController {
changeDeviceToRetired
(
packingLibraryServiceOne
.
getId
());
}
}
//生成日志
// taskLogService.addLog(new TaskLogBto(task.getId(),deviceRetiredConfirmVo.getResult()==1?"退装审核失败":"退装审核成功",null));
myWebSocket
.
sendMessage1
();
return
selectDestoryDetail
(
deviceRetiredBillEntity
.
getId
());
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/AccessController.java
浏览文件 @
0609c28b
...
...
@@ -11,6 +11,7 @@ import com.tykj.dev.rfid.entity.domin.InputOutputDevice;
import
com.tykj.dev.rfid.entity.domin.LibraryWarningLog
;
import
com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail
;
import
com.tykj.dev.rfid.entity.vo.*
;
import
com.tykj.dev.rfid.repository.LibraryWarningLogDetailDao
;
import
com.tykj.dev.rfid.service.AccessControlNameService
;
import
com.tykj.dev.rfid.service.InputOutputDeviceService
;
import
com.tykj.dev.rfid.service.LibraryWarningLogDetailService
;
...
...
@@ -61,6 +62,9 @@ public class AccessController {
@Autowired
private
LibraryWarningLogDetailService
libraryWarningLogDetailService
;
@Autowired
private
LibraryWarningLogDetailDao
libraryWarningLogDetailDao
;
@PostMapping
(
"/send"
)
public
String
sendMessage
(
HttpServletRequest
httpServletRequest
,
HttpServletResponse
httpServletResponse
)
throws
IOException
{
//获取门禁传入json
...
...
@@ -72,7 +76,7 @@ public class AccessController {
sp
.
append
(
line
);
}
String
json
=
sp
.
toString
();
//
System.out.println(json);
System
.
out
.
println
(
json
);
//数据提交
if
(
json
.
contains
(
"20001"
)){
//Json转对象
...
...
@@ -116,26 +120,37 @@ public class AccessController {
outPutCardIds
.
removeAll
(
canOutputCardIds
);
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
outPutCardIds
.
forEach
(
s
->
deviceLibraries
.
addAll
(
deviceLibraryDao
.
getAllByRfidCardId
(
s
)));
//对交集外的装备进行告警
LibraryWarningLog
libraryWarningLog
=
new
LibraryWarningLog
();
libraryWarningLog
.
setUnit
(
userPublicService
.
findByUnitsToname
(
unitId
));
libraryWarningLog
.
setInventoryResults
(
"异常出库"
+
deviceLibraries
.
size
()
+
"台"
);
libraryWarningLog
.
setStatus
(
"1"
);
libraryWarningLog
.
setWarningHandle
(
0
);
libraryWarningLog
.
setWarningType
(
1
);
LibraryWarningLog
libraryWarningLog1
=
libraryWarningLogService
.
addEntity
(
libraryWarningLog
);
//添加详情
deviceLibraries
.
forEach
(
deviceLibrary
->
{
LibraryWarningLogDetail
libraryWarningLogDetail
=
new
LibraryWarningLogDetail
();
libraryWarningLogDetail
.
setDeviceId
(
deviceLibrary
.
getId
());
libraryWarningLogDetail
.
setInventoryResults
(
"异常出库"
);
libraryWarningLogDetail
.
setLibraryWarningLogId
(
libraryWarningLog1
.
getId
());
libraryWarningLogDetail
.
setStatus
(
1
);
libraryWarningLogDetail
.
setWarningHandle
(
0
);
libraryWarningLogDetailService
.
addEntity
(
libraryWarningLogDetail
);
});
//出库异常报警
return
DataResult
.
failed
();
//获取最近1分钟报警的Id
List
<
Integer
>
ids
=
getLatestWarningDeviceIds
();
List
<
Integer
>
idList
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
ids
.
retainAll
(
idList
);
idList
.
removeAll
(
ids
);
if
(
idList
.
size
()>
0
)
{
//对交集外的装备进行告警
LibraryWarningLog
libraryWarningLog
=
new
LibraryWarningLog
();
libraryWarningLog
.
setUnit
(
userPublicService
.
findByUnitsToname
(
unitId
));
libraryWarningLog
.
setInventoryResults
(
"异常出库"
+
idList
.
size
()
+
"台"
);
libraryWarningLog
.
setStatus
(
"1"
);
libraryWarningLog
.
setWarningHandle
(
0
);
libraryWarningLog
.
setWarningType
(
1
);
LibraryWarningLog
libraryWarningLog1
=
libraryWarningLogService
.
addEntity
(
libraryWarningLog
);
//添加详情
idList
.
forEach
(
integer
->
{
LibraryWarningLogDetail
libraryWarningLogDetail
=
new
LibraryWarningLogDetail
();
libraryWarningLogDetail
.
setDeviceId
(
integer
);
libraryWarningLogDetail
.
setInventoryResults
(
"异常出库"
);
libraryWarningLogDetail
.
setLibraryWarningLogId
(
libraryWarningLog1
.
getId
());
libraryWarningLogDetail
.
setStatus
(
1
);
libraryWarningLogDetail
.
setWarningHandle
(
0
);
libraryWarningLogDetailService
.
addEntity
(
libraryWarningLogDetail
);
});
//出库异常报警
return
DataResult
.
failed
();
}
//不在系统的rfid不报警
else
{
return
DataResult
.
success
();
}
}
}
else
{
...
...
@@ -162,4 +177,15 @@ public class AccessController {
throw
new
ApiException
(
"未找到匹配的cmd"
);
}
}
/**
* 获取最近1分钟内出库异常的装备Id
*/
private
List
<
Integer
>
getLatestWarningDeviceIds
(){
return
libraryWarningLogDetailDao
.
findAll
().
stream
().
filter
(
libraryWarningLogDetail
->
{
Boolean
isOutPut
=
"异常出库"
.
equals
(
libraryWarningLogDetail
.
getInventoryResults
());
Boolean
isLatest
=
System
.
currentTimeMillis
()
-
libraryWarningLogDetail
.
getUpdateTime
().
getTime
()<
60_000
;
return
isOutPut
&&
isLatest
;
}).
map
(
LibraryWarningLogDetail:
:
getDeviceId
).
collect
(
Collectors
.
toList
());
}
}
dev-statistical/src/main/java/com/tykj/dev/statistical/cache/CacheConfig.java
0 → 100644
浏览文件 @
0609c28b
package
com
.
tykj
.
dev
.
statistical
.
cache
;
import
com.tykj.dev.statistical.service.StatisticalService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.text.ParseException
;
/**
* @author dengdiyi
* 统计分析缓存配置类
*/
@Configuration
public
class
CacheConfig
{
@Autowired
private
StatisticalService
statisticalService
;
@Bean
public
StatisticalCache
initStatisticalCache
()
throws
ParseException
{
return
new
StatisticalCache
(
statisticalService
.
getDeviceNum
(),
statisticalService
.
getLifeStatus
(
1
),
statisticalService
.
getLifeStatus
(
2
),
statisticalService
.
getSelfCheck
(),
statisticalService
.
getYearSelfCheck
(),
statisticalService
.
getRfidWarning
(),
statisticalService
.
getRfidWarningDetail
(
1
),
statisticalService
.
getRfidWarningDetail
(
2
),
statisticalService
.
getCheckNum
(),
statisticalService
.
getConfirmCheck
(
1
),
statisticalService
.
getConfirmCheck
(
2
),
statisticalService
.
getUserGeneralSituation
());
}
}
dev-statistical/src/main/java/com/tykj/dev/statistical/cache/CacheRefreshTask.java
0 → 100644
浏览文件 @
0609c28b
package
com
.
tykj
.
dev
.
statistical
.
cache
;
import
com.tykj.dev.config.TaskBeanConfig
;
import
com.tykj.dev.device.confirmcheck.entity.cache.AreaCache
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
import
com.tykj.dev.device.user.cache.UserCache
;
import
com.tykj.dev.device.user.subject.dao.AreaDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.rfid.entity.domin.InputOutputDevice
;
import
com.tykj.dev.rfid.repository.InputOutputDeviceDao
;
import
com.tykj.dev.rfid.timeTask.AccessSchedulerTask
;
import
com.tykj.dev.statistical.service.StatisticalService
;
import
lombok.Data
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.concurrent.ScheduledFuture
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @author dengdiyi
* 缓存更新定时任务
*/
@Slf4j
@Component
@EnableAsync
@Data
public
class
CacheRefreshTask
{
/**
* 每十分钟
*/
private
String
cron
=
"0 0/10 * * * ?"
;
private
ScheduledFuture
scheduledFuture
;
final
StatisticalService
statisticalService
;
final
AreaDao
areaDao
;
final
UserDao
userDao
;
final
UnitsDao
unitsDao
;
final
StatisticalCache
statisticalCache
;
final
AreaCache
areaCache
;
final
UserCache
userCache
;
final
UnitsCache
unitsCache
;
public
CacheRefreshTask
(
StatisticalService
statisticalService
,
AreaDao
areaDao
,
UserDao
userDao
,
UnitsDao
unitsDao
,
StatisticalCache
statisticalCache
,
AreaCache
areaCache
,
UserCache
userCache
,
UnitsCache
unitsCache
){
this
.
statisticalService
=
statisticalService
;
this
.
areaDao
=
areaDao
;
this
.
userDao
=
userDao
;
this
.
unitsDao
=
unitsDao
;
this
.
areaCache
=
areaCache
;
this
.
userCache
=
userCache
;
this
.
unitsCache
=
unitsCache
;
this
.
statisticalCache
=
statisticalCache
;
scheduledFuture
=
TaskBeanConfig
.
getThreadPoolTaskScheduler
().
schedule
(
new
RefreshTask
(),
triggerContext
->
new
CronTrigger
(
cron
).
nextExecutionTime
(
triggerContext
));
log
.
info
(
"[统计分析模块]:定时更新缓存任务开启"
);
}
public
class
RefreshTask
implements
Runnable
{
@SneakyThrows
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
run
()
{
if
(
areaCache
!=
null
&&
areaDao
!=
null
){
areaCache
.
setIdMap
(
areaDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
Area:
:
getId
,
Function
.
identity
())));
areaCache
.
setNameMap
(
areaDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
Area:
:
getName
,
Function
.
identity
())));
log
.
info
(
"[统计分析模块]:更新区域缓存"
);
}
if
(
userCache
!=
null
&&
userDao
!=
null
){
userCache
.
setIdMap
(
userDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
User:
:
getUserId
,
Function
.
identity
())));
log
.
info
(
"[统计分析模块]:更新用户缓存"
);
}
if
(
unitsCache
!=
null
&&
unitsDao
!=
null
){
unitsCache
.
setIdMap
(
unitsDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
Units:
:
getUnitId
,
Function
.
identity
())));
log
.
info
(
"[统计分析模块]:更新单位缓存"
);
}
if
(
statisticalService
!=
null
&&
statisticalCache
!=
null
){
statisticalCache
.
setAlarmSituation
(
statisticalService
.
getRfidWarning
());
statisticalCache
.
setChecks
(
statisticalService
.
getCheckNum
());
statisticalCache
.
setCityDevLifeSectors
(
statisticalService
.
getLifeStatus
(
2
));
statisticalCache
.
setProvinceDevLifeSectors
(
statisticalService
.
getLifeStatus
(
1
));
statisticalCache
.
setDevNums
(
statisticalService
.
getDeviceNum
());
statisticalCache
.
setQuarterAlarmSituations
(
statisticalService
.
getRfidWarningDetail
(
1
));
statisticalCache
.
setYearAlarmSituations
(
statisticalService
.
getRfidWarningDetail
(
2
));
statisticalCache
.
setSelfInspections
(
statisticalService
.
getSelfCheck
());
statisticalCache
.
setUserGeneralSituation
(
statisticalService
.
getUserGeneralSituation
());
statisticalCache
.
setFirstYearVerifications
(
statisticalService
.
getConfirmCheck
(
1
));
statisticalCache
.
setLastYearVerifications
(
statisticalService
.
getConfirmCheck
(
2
));
statisticalCache
.
setYearSelfInspections
(
statisticalService
.
getYearSelfCheck
());
log
.
info
(
"[统计分析模块]:更新统计分析缓存"
);
}
}
}
}
dev-statistical/src/main/java/com/tykj/dev/statistical/cache/StatisticalCache.java
0 → 100644
浏览文件 @
0609c28b
package
com
.
tykj
.
dev
.
statistical
.
cache
;
import
com.tykj.dev.statistical.vo.*
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author dengdiyi
* 统计分析缓存
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
StatisticalCache
{
/**
* 装备统计信息
*/
private
List
<
DevNum
>
devNums
;
/**
* 省装备生命状态统计信息
*/
private
List
<
DevLifeSector
>
provinceDevLifeSectors
;
/**
* 各市装备生命状态统计信息
*/
private
List
<
DevLifeSector
>
cityDevLifeSectors
;
/**
* 季度自查统计信息
*/
private
List
<
SelfInspection
>
selfInspections
;
/**
* 年度自查统计信息
*/
private
List
<
YearSelfInspection
>
yearSelfInspections
;
/**
* 年度告警统计信息
*/
private
AlarmSituation
alarmSituation
;
/**
* 本季度各市告警统计信息
*/
private
List
<
AlarmSituation
>
quarterAlarmSituations
;
/**
* 本年各市告警统计信息
*/
private
List
<
AlarmSituation
>
yearAlarmSituations
;
/**
* 各市最近一次自查和核查装备数量
*/
private
List
<
Check
>
checks
;
/**
* 上半年核查统计信息
*/
private
List
<
Verification
>
firstYearVerifications
;
/**
* 下半年核查统计信息
*/
private
List
<
Verification
>
lastYearVerifications
;
/**
* 专管员概要信息统计
*/
private
UserGeneralSituation
userGeneralSituation
;
}
dev-statistical/src/main/java/com/tykj/dev/statistical/controller/StatisticalController.java
浏览文件 @
0609c28b
...
...
@@ -15,6 +15,8 @@ import com.tykj.dev.device.user.subject.dao.AreaDao;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.statistical.cache.StatisticalCache
;
import
com.tykj.dev.statistical.service.StatisticalService
;
import
com.tykj.dev.statistical.vo.*
;
import
io.swagger.annotations.Api
;
...
...
@@ -42,6 +44,9 @@ public class StatisticalController {
@Autowired
private
StatisticalService
statisticalService
;
@Autowired
private
StatisticalCache
statisticalCache
;
/**
* 查询各市的装备数量
* @return 各市装备对象集合
...
...
@@ -49,7 +54,7 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询各市的装备数量"
)
@GetMapping
(
"/devNum"
)
public
ResponseEntity
selectDevNum
(){
return
ResponseEntity
.
ok
(
statistical
Service
.
getDeviceNum
());
return
ResponseEntity
.
ok
(
statistical
Cache
.
getDevNums
());
}
/**
...
...
@@ -59,7 +64,15 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询全省或各市装备生命状态数量(type:1全省,2全市)"
)
@GetMapping
(
"/StateofLife/{type}"
)
public
ResponseEntity
selectStateofLife
(
@PathVariable
Integer
type
){
return
ResponseEntity
.
ok
(
statisticalService
.
getLifeStatus
(
type
));
if
(
type
==
1
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getProvinceDevLifeSectors
());
}
else
if
(
type
==
2
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getCityDevLifeSectors
());
}
else
{
throw
new
ApiException
(
"type只能为1或2"
);
}
}
/**
...
...
@@ -69,7 +82,7 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询当前季度各市自查情况"
)
@GetMapping
(
"/selfInspection"
)
public
ResponseEntity
selectSelfInspection
(){
return
ResponseEntity
.
ok
(
statistical
Service
.
getSelfCheck
());
return
ResponseEntity
.
ok
(
statistical
Cache
.
getSelfInspections
());
}
/**
...
...
@@ -79,7 +92,7 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询年度各季度各市自查情况"
)
@GetMapping
(
"/selfInspection/year"
)
public
ResponseEntity
selectYearSelfInspection
(){
return
ResponseEntity
.
ok
(
statistical
Service
.
getYearSelfCheck
());
return
ResponseEntity
.
ok
(
statistical
Cache
.
getYearSelfInspections
());
}
/**
...
...
@@ -89,7 +102,15 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询各市核查情况数量"
)
@GetMapping
(
"/confirmInspection/{type}"
)
public
ResponseEntity
selectVerification
(
@PathVariable
Integer
type
)
throws
ParseException
{
return
ResponseEntity
.
ok
(
statisticalService
.
getConfirmCheck
(
type
));
if
(
type
==
1
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getFirstYearVerifications
());
}
else
if
(
type
==
2
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getLastYearVerifications
());
}
else
{
throw
new
ApiException
(
"type只能为1或2"
);
}
}
/**
...
...
@@ -99,8 +120,7 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询专管员概述"
)
@GetMapping
(
"/generalSituation"
)
public
ResponseEntity
selectGeneralSituation
(){
return
ResponseEntity
.
ok
(
statisticalService
.
getUserGeneralSituation
());
return
ResponseEntity
.
ok
(
statisticalCache
.
getUserGeneralSituation
());
}
/**
...
...
@@ -110,7 +130,7 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询告警情况"
)
@GetMapping
(
"/alarmSituation"
)
public
ResponseEntity
selectAlarmSituation
(){
return
ResponseEntity
.
ok
(
statistical
Service
.
getRfidWarning
());
return
ResponseEntity
.
ok
(
statistical
Cache
.
getAlarmSituation
());
}
/**
...
...
@@ -120,7 +140,15 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询各市告警情况"
)
@GetMapping
(
"/alarmSituation/detail/{type}"
)
public
ResponseEntity
selectAlarmSituationDetail
(
@PathVariable
(
"type"
)
int
type
){
return
ResponseEntity
.
ok
(
statisticalService
.
getRfidWarningDetail
(
type
));
if
(
type
==
1
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getQuarterAlarmSituations
());
}
else
if
(
type
==
2
){
return
ResponseEntity
.
ok
(
statisticalCache
.
getYearAlarmSituations
());
}
else
{
throw
new
ApiException
(
"type只能为1或2"
);
}
}
/**
...
...
@@ -140,6 +168,6 @@ public class StatisticalController {
@ApiOperation
(
value
=
"查询各市最近一次自查核查数量"
)
@GetMapping
(
"/checkNum"
)
public
ResponseEntity
selectCheckNum
(){
return
ResponseEntity
.
ok
(
statistical
Service
.
getCheckNum
());
return
ResponseEntity
.
ok
(
statistical
Cache
.
getChecks
());
}
}
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
0609c28b
...
...
@@ -186,8 +186,6 @@ public class StorageBillController {
//1.审核成功,入库任务结束,发起新的确认任务,改变装备状态
if
(
storageBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "入库审核成功", null);
// taskLogService.addLog(taskLogBto);
StorageBill
storageBillEntity
=
storageBillService
.
getOne
(
taskBto
.
getBillId
());
storageBillEntity
.
setStorageStatus
(
2
);
storageBillService
.
update
(
storageBillEntity
);
...
...
@@ -205,8 +203,6 @@ public class StorageBillController {
//2.审核失败
if
(
storageBillConfirmVo
.
getStatus
()
==
1
)
{
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"入库审核失败",null);
// taskLogService.addLog(taskLogBto);
StorageBill
storageBillEntity
=
storageBillService
.
getOne
(
taskBto
.
getBillId
());
storageBillEntity
.
setStorageStatus
(
1
);
storageBillService
.
update
(
storageBillEntity
);
...
...
dev-union/pom.xml
浏览文件 @
0609c28b
...
...
@@ -90,6 +90,18 @@
</exclusions>
</dependency>
<dependency>
<groupId>
com.tykj.dev
</groupId>
<artifactId>
blockcha
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
com.tykj.dev
</groupId>
<artifactId>
union
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.tykj
</groupId>
...
...
dev-user/src/main/java/com/tykj/dev/device/user/cache/UnitsCache.java
浏览文件 @
0609c28b
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.user.cache;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -9,6 +10,7 @@ import java.util.Map;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Data
public
class
UnitsCache
{
private
Map
<
Integer
,
Units
>
idMap
;
...
...
dev-user/src/main/java/com/tykj/dev/device/user/cache/UserCache.java
浏览文件 @
0609c28b
package
com
.
tykj
.
dev
.
device
.
user
.
cache
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -8,6 +9,7 @@ import java.util.Map;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Data
public
class
UserCache
{
private
Map
<
Integer
,
User
>
idMap
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论