Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xt-danger
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangjianqian
xt-danger
Commits
09e9ff5a
Commit
09e9ff5a
authored
Nov 11, 2021
by
jianqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增
parent
25af9768
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
149 additions
and
3 deletions
+149
-3
AccidentStatisticsController.java
.../dcit/danger/controller/AccidentStatisticsController.java
+57
-0
AlarmInfoController.java
.../java/com/dcit/danger/controller/AlarmInfoController.java
+22
-0
DataStatisticsController.java
.../com/dcit/danger/controller/DataStatisticsController.java
+7
-1
AccidentStatisticsMapper.java
...in/java/com/dcit/danger/dao/AccidentStatisticsMapper.java
+2
-0
AlarmInfoMapper.java
...er/src/main/java/com/dcit/danger/dao/AlarmInfoMapper.java
+3
-0
AccidentQuery.java
...rc/main/java/com/dcit/danger/dto/query/AccidentQuery.java
+14
-0
AlarmInfoQuery.java
...c/main/java/com/dcit/danger/dto/query/AlarmInfoQuery.java
+2
-0
AccidentStatistics.java
...c/main/java/com/dcit/danger/model/AccidentStatistics.java
+4
-2
AlarmInfo.java
...danger/src/main/java/com/dcit/danger/model/AlarmInfo.java
+3
-0
AccidentStatisticsService.java
...va/com/dcit/danger/service/AccidentStatisticsService.java
+3
-0
AlarmInfoService.java
...c/main/java/com/dcit/danger/service/AlarmInfoService.java
+2
-0
AccidentStatisticsServiceImpl.java
...it/danger/service/impl/AccidentStatisticsServiceImpl.java
+6
-0
AlarmInfoServiceImpl.java
...va/com/dcit/danger/service/impl/AlarmInfoServiceImpl.java
+6
-0
AccidentStatisticsMapper.xml
...er/src/main/resources/mapper/AccidentStatisticsMapper.xml
+7
-0
AlarmInfoMapper.xml
.../ioc-danger/src/main/resources/mapper/AlarmInfoMapper.xml
+8
-0
EnterpriseBasicInfoMapper.xml
...r/src/main/resources/mapper/EnterpriseBasicInfoMapper.xml
+3
-0
No files found.
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/controller/AccidentStatisticsController.java
0 → 100644
View file @
09e9ff5a
package
com
.
dcit
.
danger
.
controller
;
import
com.dcit.common.enums.ResultEnum
;
import
com.dcit.common.utils.ResultVOUtil
;
import
com.dcit.common.vo.ResultVO
;
import
com.dcit.danger.dto.AlarmInfoDTO
;
import
com.dcit.danger.dto.query.AccidentQuery
;
import
com.dcit.danger.dto.query.AlarmInfoQuery
;
import
com.dcit.danger.exception.IOCException
;
import
com.dcit.danger.model.AccidentStatistics
;
import
com.dcit.danger.service.AccidentStatisticsService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
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.ui.ModelMap
;
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
;
import
java.util.Map
;
@Api
(
value
=
"事故信息API"
)
@RestController
@RequestMapping
(
"accidentInfo"
)
@Slf4j
public
class
AccidentStatisticsController
{
@Autowired
private
AccidentStatisticsService
accidentStatisticsService
;
@ApiOperation
(
value
=
"查询预警列表"
)
@PostMapping
(
"/getAccidentInfoList"
)
public
ResultVO
<
Object
>
selectListByEnterpriseId
(
@RequestBody
AccidentQuery
accidentQuery
)
{
ModelMap
modelMap
=
new
ModelMap
();
try
{
PageHelper
.
offsetPage
(
accidentQuery
.
getPage
(),
accidentQuery
.
getSize
());
List
<
AccidentStatistics
>
dtoList
=
accidentStatisticsService
.
selectListByEnterpriseId
(
accidentQuery
.
getEnterpriseId
(),
accidentQuery
.
getFromdate
());
PageInfo
<
AccidentStatistics
>
pageInfoList
=
new
PageInfo
<
AccidentStatistics
>(
dtoList
);
modelMap
.
addAttribute
(
"pageData"
,
pageInfoList
.
getList
());
modelMap
.
addAttribute
(
"total"
,
pageInfoList
.
getTotal
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"【查询报警列表】操作出错,error={}"
,
e
.
getMessage
());
throw
new
IOCException
(
ResultEnum
.
OPERATION_FAIL
);
}
return
ResultVOUtil
.
success
(
modelMap
);
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/controller/AlarmInfoController.java
View file @
09e9ff5a
...
@@ -124,4 +124,26 @@ public class AlarmInfoController {
...
@@ -124,4 +124,26 @@ public class AlarmInfoController {
return
ResultVOUtil
.
success
();
return
ResultVOUtil
.
success
();
}
}
@ApiOperation
(
value
=
"按年查询预警列表"
)
@PostMapping
(
"/selectInfoByEnterpriseId"
)
public
ResultVO
<
Object
>
selectInfoByEnterpriseId
(
@RequestBody
AlarmInfoQuery
alarmInfoQuery
){
ModelMap
modelMap
=
new
ModelMap
();
try
{
PageHelper
.
offsetPage
(
alarmInfoQuery
.
getPage
(),
alarmInfoQuery
.
getSize
());
List
<
AlarmInfo
>
dtoList
=
alarmInfoService
.
selectInfoByEnterpriseId
(
alarmInfoQuery
.
getEnterpriseId
(),
alarmInfoQuery
.
getFromdate
());
PageInfo
<
AlarmInfo
>
pageInfoList
=
new
PageInfo
<
AlarmInfo
>(
dtoList
);
modelMap
.
addAttribute
(
"pageData"
,
pageInfoList
.
getList
());
modelMap
.
addAttribute
(
"total"
,
pageInfoList
.
getTotal
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"【查询报警列表】操作出错,error={}"
,
e
.
getMessage
());
throw
new
IOCException
(
ResultEnum
.
OPERATION_FAIL
);
}
return
ResultVOUtil
.
success
(
modelMap
);
}
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/controller/DataStatisticsController.java
View file @
09e9ff5a
...
@@ -246,9 +246,14 @@ public class DataStatisticsController {
...
@@ -246,9 +246,14 @@ public class DataStatisticsController {
//监控
//监控
SafetyDeviceInfoExample
safetyDeviceInfoExample
=
new
SafetyDeviceInfoExample
();
SafetyDeviceInfoExample
safetyDeviceInfoExample
=
new
SafetyDeviceInfoExample
();
com
.
dcit
.
danger
.
model
.
SafetyDeviceInfoExample
.
Criteria
safetyDeviceCriteria
=
safetyDeviceInfoExample
.
createCriteria
();
com
.
dcit
.
danger
.
model
.
SafetyDeviceInfoExample
.
Criteria
safetyDeviceCriteria
=
safetyDeviceInfoExample
.
createCriteria
();
safetyDeviceCriteria
.
and
DataTypeEqualTo
(
"1"
).
and
IsDelEqualTo
(
"0"
);
safetyDeviceCriteria
.
andIsDelEqualTo
(
"0"
);
safetyDeviceCriteria
.
andEnterpriseIdIn
(
strlist
);
safetyDeviceCriteria
.
andEnterpriseIdIn
(
strlist
);
//所有设备
List
<
SafetyDeviceInfo
>
allList
=
safetyDeviceInfoService
.
selectByExample
(
safetyDeviceInfoExample
);
safetyDeviceCriteria
.
andDataTypeEqualTo
(
"1"
);
//监控设备
List
<
SafetyDeviceInfo
>
cameraList
=
safetyDeviceInfoService
.
selectByExample
(
safetyDeviceInfoExample
);
List
<
SafetyDeviceInfo
>
cameraList
=
safetyDeviceInfoService
.
selectByExample
(
safetyDeviceInfoExample
);
//隐患
//隐患
THiddenTroubleExample
tHiddenTroubleExample
=
new
THiddenTroubleExample
();
THiddenTroubleExample
tHiddenTroubleExample
=
new
THiddenTroubleExample
();
tHiddenTroubleExample
.
createCriteria
().
andEnterpriseIdIn
(
strlist
);
tHiddenTroubleExample
.
createCriteria
().
andEnterpriseIdIn
(
strlist
);
...
@@ -266,6 +271,7 @@ public class DataStatisticsController {
...
@@ -266,6 +271,7 @@ public class DataStatisticsController {
map
.
put
(
"troubleList"
,
troubleList
);
map
.
put
(
"troubleList"
,
troubleList
);
map
.
put
(
"goodsList"
,
goodsList
);
map
.
put
(
"goodsList"
,
goodsList
);
map
.
put
(
"harmPlace"
,
harmPlace
);
map
.
put
(
"harmPlace"
,
harmPlace
);
map
.
put
(
"allList"
,
allList
);
return
ResultVOUtil
.
success
(
map
);
return
ResultVOUtil
.
success
(
map
);
}
}
...
...
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/dao/AccidentStatisticsMapper.java
View file @
09e9ff5a
...
@@ -23,4 +23,6 @@ public interface AccidentStatisticsMapper {
...
@@ -23,4 +23,6 @@ public interface AccidentStatisticsMapper {
List
<
Map
<
String
,
Object
>>
selectByYear
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
List
<
Map
<
String
,
Object
>>
selectByYear
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"fromdate"
)
String
fromdate
);
@Param
(
"fromdate"
)
String
fromdate
);
List
<
AccidentStatistics
>
selectListByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"fromdate"
)
String
fromdate
);
}
}
\ No newline at end of file
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/dao/AlarmInfoMapper.java
View file @
09e9ff5a
...
@@ -35,4 +35,7 @@ public interface AlarmInfoMapper {
...
@@ -35,4 +35,7 @@ public interface AlarmInfoMapper {
List
<
Map
<
String
,
Object
>>
selectByYear
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
List
<
Map
<
String
,
Object
>>
selectByYear
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"fromdate"
)
String
fromdate
);
@Param
(
"fromdate"
)
String
fromdate
);
List
<
AlarmInfo
>
selectInfoByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"fromdate"
)
String
fromdate
);
}
}
\ No newline at end of file
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/dto/query/AccidentQuery.java
0 → 100644
View file @
09e9ff5a
package
com
.
dcit
.
danger
.
dto
.
query
;
import
com.dcit.common.page.PageBasic
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
AccidentQuery
extends
PageBasic
{
private
String
enterpriseId
;
private
String
fromdate
;
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/dto/query/AlarmInfoQuery.java
View file @
09e9ff5a
...
@@ -12,4 +12,6 @@ public class AlarmInfoQuery extends PageBasic{
...
@@ -12,4 +12,6 @@ public class AlarmInfoQuery extends PageBasic{
private
String
enterpriseId
;
private
String
enterpriseId
;
private
String
alarmStatus
;
private
String
alarmStatus
;
private
String
fromdate
;
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/model/AccidentStatistics.java
View file @
09e9ff5a
package
com
.
dcit
.
danger
.
model
;
package
com
.
dcit
.
danger
.
model
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.util.Date
;
import
java.util.Date
;
public
class
AccidentStatistics
{
public
class
AccidentStatistics
{
...
@@ -14,9 +16,9 @@ public class AccidentStatistics {
...
@@ -14,9 +16,9 @@ public class AccidentStatistics {
private
String
accidentReason
;
private
String
accidentReason
;
private
Integer
month
;
private
Integer
month
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
accidentTime
;
private
Date
accidentTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
private
Date
createTime
;
private
String
accidentText
;
private
String
accidentText
;
...
...
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/model/AlarmInfo.java
View file @
09e9ff5a
...
@@ -2,6 +2,8 @@ package com.dcit.danger.model;
...
@@ -2,6 +2,8 @@ package com.dcit.danger.model;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -47,6 +49,7 @@ public class AlarmInfo implements Serializable {
...
@@ -47,6 +49,7 @@ public class AlarmInfo implements Serializable {
/**
/**
* 报警时间
* 报警时间
*/
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
alarmTime
;
private
Date
alarmTime
;
/**
/**
...
...
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/service/AccidentStatisticsService.java
View file @
09e9ff5a
package
com
.
dcit
.
danger
.
service
;
package
com
.
dcit
.
danger
.
service
;
import
com.dcit.danger.model.AccidentStatistics
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -8,4 +9,6 @@ import java.util.Map;
...
@@ -8,4 +9,6 @@ import java.util.Map;
public
interface
AccidentStatisticsService
{
public
interface
AccidentStatisticsService
{
Map
<
String
,
Object
>
selectByYear
(
String
enterpriseId
,
String
fromdate
);
Map
<
String
,
Object
>
selectByYear
(
String
enterpriseId
,
String
fromdate
);
List
<
AccidentStatistics
>
selectListByEnterpriseId
(
String
enterpriseId
,
String
fromdate
);
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/service/AlarmInfoService.java
View file @
09e9ff5a
...
@@ -35,4 +35,6 @@ public interface AlarmInfoService {
...
@@ -35,4 +35,6 @@ public interface AlarmInfoService {
Map
<
String
,
Object
>
selectAlarmByYear
(
String
enterpriseId
,
String
fromdate
);
Map
<
String
,
Object
>
selectAlarmByYear
(
String
enterpriseId
,
String
fromdate
);
List
<
AlarmInfo
>
selectInfoByEnterpriseId
(
String
enterpriseId
,
String
fromdate
);
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/service/impl/AccidentStatisticsServiceImpl.java
View file @
09e9ff5a
package
com
.
dcit
.
danger
.
service
.
impl
;
package
com
.
dcit
.
danger
.
service
.
impl
;
import
com.dcit.danger.dao.AccidentStatisticsMapper
;
import
com.dcit.danger.dao.AccidentStatisticsMapper
;
import
com.dcit.danger.model.AccidentStatistics
;
import
com.dcit.danger.service.AccidentStatisticsService
;
import
com.dcit.danger.service.AccidentStatisticsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -29,4 +30,9 @@ public class AccidentStatisticsServiceImpl implements AccidentStatisticsService{
...
@@ -29,4 +30,9 @@ public class AccidentStatisticsServiceImpl implements AccidentStatisticsService{
map
.
put
(
"totalNum"
,
totalNum
);
map
.
put
(
"totalNum"
,
totalNum
);
return
map
;
return
map
;
}
}
@Override
public
List
<
AccidentStatistics
>
selectListByEnterpriseId
(
String
enterpriseId
,
String
fromdate
){
List
<
AccidentStatistics
>
list
=
accidentStatisticsMapper
.
selectListByEnterpriseId
(
enterpriseId
,
fromdate
);
return
list
;
}
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/java/com/dcit/danger/service/impl/AlarmInfoServiceImpl.java
View file @
09e9ff5a
...
@@ -108,4 +108,10 @@ public class AlarmInfoServiceImpl implements AlarmInfoService{
...
@@ -108,4 +108,10 @@ public class AlarmInfoServiceImpl implements AlarmInfoService{
map
.
put
(
"num"
,
num
);
map
.
put
(
"num"
,
num
);
return
map
;
return
map
;
}
}
@Override
public
List
<
AlarmInfo
>
selectInfoByEnterpriseId
(
String
enterpriseId
,
String
fromdate
){
return
alarmInfoMapper
.
selectInfoByEnterpriseId
(
enterpriseId
,
fromdate
);
}
}
}
zzz2017-ioc-ioc-master/ioc-danger/src/main/resources/mapper/AccidentStatisticsMapper.xml
View file @
09e9ff5a
...
@@ -164,4 +164,11 @@
...
@@ -164,4 +164,11 @@
GROUP BY `month`
GROUP BY `month`
ORDER BY `month`
ORDER BY `month`
</select>
</select>
<select
id=
"selectListByEnterpriseId"
resultType=
"com.dcit.danger.model.AccidentStatistics"
>
SELECT accident_text AS accidentText,accident_level AS accidentLevel ,accident_reason AS accidentReason,
IFNULL(accident_time,"") AS accidentTime,IFNULL(create_time,"") AS createTime FROM accident_statistics
WHERE enterprise_id =#{enterpriseId}
and accident_time like concat('%',#{fromdate},'%')
ORDER BY `create_time`
</select>
</mapper>
</mapper>
\ No newline at end of file
zzz2017-ioc-ioc-master/ioc-danger/src/main/resources/mapper/AlarmInfoMapper.xml
View file @
09e9ff5a
...
@@ -424,4 +424,12 @@
...
@@ -424,4 +424,12 @@
GROUP BY `alarm_month`
GROUP BY `alarm_month`
ORDER BY `alarm_month`
ORDER BY `alarm_month`
</select>
</select>
<select
id=
"selectInfoByEnterpriseId"
resultType=
"com.dcit.danger.model.AlarmInfo"
>
SELECT a.`alarm_info` AS alarmInfo,a.alarm_type AS alarmType,a.report_value as reportValue,
a.alarm_time as alarmTime, d.device_name as remarks FROM t_alarm_info a
LEFT JOIN safety_device_info d on d.id = a.device_id
WHERE a.enterprise_id =#{enterpriseId}
and a.alarm_time like concat('%',#{fromdate},'%')
ORDER BY a.`alarm_time`
</select>
</mapper>
</mapper>
\ No newline at end of file
zzz2017-ioc-ioc-master/ioc-danger/src/main/resources/mapper/EnterpriseBasicInfoMapper.xml
View file @
09e9ff5a
...
@@ -1564,6 +1564,9 @@
...
@@ -1564,6 +1564,9 @@
e.province_id provinceId,
e.province_id provinceId,
e.city_id cityId,
e.city_id cityId,
e.county_id countyId,
e.county_id countyId,
e.province_name provinceName,
e.city_name cityName,
e.county_name countyName,
e.authorize_file authorizeFile,
e.authorize_file authorizeFile,
e.authorize_file_original_name authorizeFileOriginalName,
e.authorize_file_original_name authorizeFileOriginalName,
e.regulation_big_type regulationBigType,
e.regulation_big_type regulationBigType,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment