Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
c1ad9392
Commit
c1ad9392
authored
Jul 27, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏API
parent
535ff6ab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
13 deletions
+133
-13
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+83
-9
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+18
-1
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+1
-1
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+2
-2
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+29
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
c1ad9392
package
com
.
yeejoin
.
equipmanage
.
controller
;
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.equipmanage.common.utils.*
;
import
com.yeejoin.equipmanage.common.utils.*
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
...
@@ -11,16 +14,16 @@ import io.swagger.annotations.ApiOperation;
...
@@ -11,16 +14,16 @@ import io.swagger.annotations.ApiOperation;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RestController
@Api
(
tags
=
"组态需求 -- API"
)
@Api
(
tags
=
"组态需求 -- API"
)
...
@@ -37,6 +40,9 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -37,6 +40,9 @@ public class ConfigureController extends AbstractBaseController {
@Autowired
@Autowired
private
IFireFightingSystemService
iFireFightingSystemService
;
private
IFireFightingSystemService
iFireFightingSystemService
;
@Autowired
private
IotFeign
iotFeign
;
@RequestMapping
(
value
=
"/alarmLogPage"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/alarmLogPage"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"列表分页查询"
)
...
@@ -161,23 +167,90 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -161,23 +167,90 @@ public class ConfigureController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
null
);
return
CommonResponseUtil
.
success
(
null
);
}
}
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getFireCarInfoByWL
(
page
,
"LSHLZ1bZAJU645Pgl7dMndrF"
));
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getFireCarInfoByWL
(
page
,
bizOrgCode
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"概览水源信息"
)
@ApiOperation
(
value
=
"概览水源信息"
)
@GetMapping
(
"/getWaterInfo"
)
@GetMapping
(
"/getWaterInfo"
)
public
ResponseModel
getWaterInfo
()
{
public
ResponseModel
getWaterInfo
(
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getWaterInfo
(
bizOrgCode
,
null
));
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getWaterInfo
(
page
,
bizOrgCode
,
null
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"概览稳压泵信息"
)
@GetMapping
(
"/getPressurePumpInfo"
)
public
ResponseModel
getPressurePumpInfo
(
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
return
CommonResponseUtil
.
success
(
null
);
}
Page
<
Map
<
String
,
Object
>>
pressurePumpInfo
=
fireFightingSystemMapper
.
getPressurePumpInfo
(
page
,
bizOrgCode
,
null
);
pressurePumpInfo
.
getRecords
().
stream
().
map
(
item
->
{
item
.
put
(
"startAndStopNum"
,
0
);
item
.
put
(
"update_time"
,
"未知"
);
item
.
put
(
"equipment_index_name"
,
"未知"
);
String
prefix
=
null
;
String
suffix
=
null
;
String
iotCode
=
item
.
get
(
"iot_code"
).
toString
();
if
(
iotCode
.
length
()
>
8
)
{
prefix
=
iotCode
.
substring
(
0
,
8
);
suffix
=
iotCode
.
substring
(
8
);
}
else
{
throw
new
BadRequest
(
"装备物联编码错误,请确认!"
);
}
String
nowStrLong
=
DateUtils
.
getNowStrLong
();
Date
startDate
=
DateUtils
.
dateAddMinutes
(
null
,
-
4
);
String
startDateStr
=
DateUtils
.
convertDateToString
(
startDate
,
DateUtils
.
DATE_TIME_PATTERN
);
ResponseModel
entity1
=
null
;
ResponseModel
entity2
=
null
;
try
{
entity1
=
iotFeign
.
selectList
(
getAppKey
(),
getProduct
(),
getToken
(),
startDateStr
,
nowStrLong
,
prefix
,
suffix
,
"FHS_PressurePump_Start"
);
entity2
=
iotFeign
.
selectList
(
getAppKey
(),
getProduct
(),
getToken
(),
startDateStr
,
nowStrLong
,
prefix
,
suffix
,
"FHS_PressurePump_Stop"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
200
==
entity1
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
entity1
.
getResult
())
&&
200
==
entity2
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
entity2
.
getResult
()))
{
String
json1
=
JSON
.
toJSONString
(
entity1
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
String
json2
=
JSON
.
toJSONString
(
entity1
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject2
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json2
);
int
num
=
listObject1
.
size
()
+
listObject2
.
size
();
item
.
put
(
"startAndStopNum"
,
num
);
}
item
.
put
(
"stateDesc"
,
(
Integer
)
item
.
get
(
"startAndStopNum"
)
<=
1
?
"正常"
:
"异常"
);
item
.
put
(
"normalNum"
,
(
Integer
)
item
.
get
(
"startAndStopNum"
)
<=
1
?
1
:
0
);
item
.
put
(
"unNormalNum"
,
(
Integer
)
item
.
get
(
"startAndStopNum"
)
<=
1
?
0
:
1
);
Map
<
String
,
String
>
stateMap
=
fireFightingSystemMapper
.
queryPressureNowStateBySpecificId
((
Long
)
item
.
get
(
"id"
));
if
(!
ObjectUtils
.
isEmpty
(
stateMap
)
&&
stateMap
.
containsKey
(
"update_date"
)
&&
stateMap
.
containsKey
(
"equipment_index_name"
))
{
item
.
put
(
"update_time"
,
stateMap
.
get
(
"update"
));
item
.
put
(
"equipment_index_name"
,
stateMap
.
get
(
"equipment_index_name"
));
}
return
item
;
}).
collect
(
Collectors
.
toList
());
return
CommonResponseUtil
.
success
(
pressurePumpInfo
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"3小水源信息"
)
@ApiOperation
(
value
=
"3小水源信息"
)
@GetMapping
(
"/getSmallWaterInfo"
)
@GetMapping
(
"/getSmallWaterInfo"
)
public
ResponseModel
getSmallWaterInfo
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
public
ResponseModel
getSmallWaterInfo
(
@RequestParam
(
required
=
false
)
String
systemCode
,
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
}
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
...
@@ -194,7 +267,8 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -194,7 +267,8 @@ public class ConfigureController extends AbstractBaseController {
hashMap
.
put
(
"systemCode"
,
systemCode
);
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSmallWaterInfo
(
hashMap
));
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSmallWaterInfo
(
page
,
hashMap
));
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
c1ad9392
...
@@ -292,7 +292,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -292,7 +292,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param bizOrgCode
* @param bizOrgCode
* @return
* @return
*/
*/
List
<
Map
<
String
,
Object
>>
getWaterInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemCode"
)
String
systemCode
);
Page
<
Map
<
String
,
Object
>>
getWaterInfo
(
Page
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemCode"
)
String
systemCode
);
/**
/**
* 获取系统名称及该系统工作状态
* 获取系统名称及该系统工作状态
...
@@ -325,4 +325,21 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -325,4 +325,21 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @return
* @return
*/
*/
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
page
,
String
id
);
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
page
,
String
id
);
/**
* 稳压泵信息
*
* @param page
* @param bizOrgCode
* @param systemCode
* @return
*/
Page
<
Map
<
String
,
Object
>>
getPressurePumpInfo
(
Page
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemCode"
)
String
systemCode
);
/**
* 根据装备ID查指标信息
* @param id
* @return
*/
Map
<
String
,
String
>
queryPressureNowStateBySpecificId
(
@Param
(
"id"
)
Long
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
c1ad9392
...
@@ -242,7 +242,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -242,7 +242,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map
<
String
,
Object
>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
);
Map
<
String
,
Object
>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
);
List
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
HashMap
<
String
,
Object
>
hashMap
);
Page
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
Page
page
,
HashMap
<
String
,
Object
>
hashMap
);
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
result
,
HashMap
<
String
,
Object
>
hashMap
);
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
result
,
HashMap
<
String
,
Object
>
hashMap
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
c1ad9392
...
@@ -1322,10 +1322,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1322,10 +1322,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
HashMap
<
String
,
Object
>
hashMap
)
{
public
Page
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
Page
page
,
HashMap
<
String
,
Object
>
hashMap
)
{
String
bizOrgCode
=
hashMap
.
get
(
"bizOrgCode"
).
toString
();
String
bizOrgCode
=
hashMap
.
get
(
"bizOrgCode"
).
toString
();
String
systemCode
=
hashMap
.
get
(
"systemCode"
).
toString
();
String
systemCode
=
hashMap
.
get
(
"systemCode"
).
toString
();
return
fireFightingSystemMapper
.
getWaterInfo
(
bizOrgCode
,
systemCode
);
return
fireFightingSystemMapper
.
getWaterInfo
(
page
,
bizOrgCode
,
systemCode
);
}
}
}
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
c1ad9392
...
@@ -2702,4 +2702,33 @@
...
@@ -2702,4 +2702,33 @@
a.equipmentId
a.equipmentId
) b
) b
</select>
</select>
<select
id=
"getPressurePumpInfo"
resultType=
"java.util.Map"
>
SELECT
ed.`name`,
ed.area,
es.iot_code,
es.id
FROM
wl_equipment_detail ed
LEFT JOIN wl_equipment_specific es ON es.equipment_detail_id = ed.id
WHERE
ed.`code` LIKE '92010800%'
AND biz_org_code = #{bizOrgCode}
</select>
<select
id=
"queryPressureNowStateBySpecificId"
resultType=
"java.util.Map"
>
SELECT
i.update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
i.equipment_index_key IN ( 'FHS_PressurePump_Start', 'FHS_PressurePump_Stop' )
AND i.equipment_specific_id = #{id,jdbcType=VARCHAR}
and i.`value` = 'true'
ORDER BY
i.update_date DESC
LIMIT 1
</select>
</mapper>
</mapper>
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