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
f10d050d
Commit
f10d050d
authored
Jan 04, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
260c1dd7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
4 deletions
+98
-4
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+91
-2
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+2
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+5
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
f10d050d
...
...
@@ -18,14 +18,17 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
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
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -483,10 +486,14 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
// 稳压泵信息
List
<
Map
<
String
,
Object
>>
pressurePumps
=
fireFightingSystemMapper
.
selectAllPressurePumpInfo
(
bizOrgCode
);
ArrayList
<
Map
<
String
,
Object
>>
names
=
new
ArrayList
<>();
// x轴数据
List
<
Map
<
String
,
Object
>>
data
=
fireFightingSystemMapper
.
selectAllDays
();
for
(
Map
<
String
,
Object
>
pressurePump
:
pressurePumps
)
{
HashMap
<
String
,
Object
>
bar
=
new
HashMap
<>();
bar
.
put
(
"name"
,
pressurePump
.
get
(
"name"
));
bar
.
put
(
"id"
,
pressurePump
.
get
(
"id"
));
names
.
add
(
bar
);
String
prefix
=
null
;
String
suffix
=
null
;
String
iotCode
=
pressurePump
.
get
(
"iot_code"
).
toString
();
...
...
@@ -510,6 +517,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
List
<
Map
<
String
,
String
>>
list
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
List
<
Map
<
String
,
String
>>
collect
=
list
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"time"
)
&&
t
.
get
(
"time"
).
substring
(
0
,
10
).
equals
(
item
.
get
(
"date"
)))).
collect
(
Collectors
.
toList
());
map
.
put
(
"value"
,
collect
.
size
());
map
.
put
(
"id"
,
pressurePump
.
get
(
"id"
));
if
(
item
.
containsKey
(
"yData"
))
{
List
<
Map
<
String
,
Object
>>
yData1
=
(
List
<
Map
<
String
,
Object
>>)
item
.
get
(
"yData"
);
yData1
.
add
(
map
);
...
...
@@ -521,7 +529,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
}
}
return
CommonResponseUtil
.
success
(
data
);
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"names"
,
names
);
result
.
put
(
"data"
,
data
);
return
CommonResponseUtil
.
success
(
result
);
}
@PersonIdentify
...
...
@@ -540,4 +551,82 @@ public class SupervisionConfigureController extends AbstractBaseController {
List
<
Map
<
String
,
Object
>>
pressurePumps
=
fireFightingSystemMapper
.
selectPressureDetails
(
bizOrgCode
);
return
CommonResponseUtil
.
success
(
pressurePumps
);
}
@PersonIdentify
@RequestMapping
(
value
=
"/selectPipePressureDetail"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管网压力详情"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"管网压力详情"
)
public
ResponseModel
selectPipePressureDetail
(
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
,
@RequestParam
(
value
=
"equipmentSpecificId"
)
String
equipmentSpecificId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
Map
<
String
,
Object
>
map
=
fireFightingSystemMapper
.
selectEquipmentSpecificById
(
equipmentSpecificId
);
if
(
ObjectUtils
.
isEmpty
(
map
)
||
ObjectUtils
.
isEmpty
(
map
.
get
(
"iot_code"
)))
{
return
CommonResponseUtil
.
success
(
null
);
}
String
iotCode
=
map
.
get
(
"iot_code"
).
toString
();
String
prefix
=
null
;
String
suffix
=
null
;
if
(
iotCode
.
length
()
>
8
)
{
prefix
=
iotCode
.
substring
(
0
,
8
);
suffix
=
iotCode
.
substring
(
8
);
}
else
{
throw
new
BadRequest
(
"装备物联编码错误,请确认!"
);
}
String
now
=
LocalDateTimeUtils
.
getNow
();
ResponseModel
mounthEntity
=
null
;
try
{
mounthEntity
=
iotFeign
.
selectList
(
getAppKey
(),
getProduct
(),
getToken
(),
now
.
substring
(
0
,
10
)
+
" 00:00:00"
,
now
.
substring
(
0
,
10
)
+
" 23:59:59"
,
prefix
,
suffix
,
"FHS_PipePressureDetector_PipePressure"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
if
(
200
==
mounthEntity
.
getStatus
())
{
String
json1
=
JSON
.
toJSONString
(
mounthEntity
.
getResult
());
List
<
Map
<
String
,
String
>>
list
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
Collections
.
reverse
(
list
);
if
(!
CollectionUtils
.
isEmpty
(
list
)
&&
list
.
size
()
>
30
)
{
for
(
int
i
=
0
;
i
<=
29
;
i
++)
{
result
.
add
(
list
.
get
(
i
));
}
}
else
{
result
.
addAll
(
list
);
}
}
result
.
stream
().
map
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"time"
)))
{
item
.
put
(
"time"
,
change
(
String
.
valueOf
(
item
.
get
(
"time"
))));
}
return
item
;
}).
collect
(
Collectors
.
toList
());
return
CommonResponseUtil
.
success
(
result
);
}
private
String
change
(
String
time
)
{
//进行转化时区
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
,
Locale
.
US
);
Date
myDate
=
null
;
try
{
myDate
=
dateFormat
.
parse
(
time
.
replace
(
"Z"
,
"+0000"
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
//转换为年月日时分秒
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
format
=
df
.
format
(
myDate
);
return
format
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
f10d050d
...
...
@@ -646,4 +646,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List
<
Map
<
String
,
Object
>>
selectPressureDetails
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Map
<
String
,
Object
>
selectEquipmentSpecificById
(
@Param
(
"id"
)
String
id
);
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
f10d050d
...
...
@@ -5630,7 +5630,7 @@ SELECT spe.id,
es.id,
(
SELECT
wesi.update_date
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
...
...
@@ -5642,7 +5642,7 @@ SELECT spe.id,
) AS stopTime,
(
SELECT
wesi.update_date
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
...
...
@@ -5664,5 +5664,8 @@ SELECT spe.id,
GROUP BY
es.id
</select>
<select
id=
"selectEquipmentSpecificById"
resultType=
"java.util.Map"
>
select * from wl_equipment_specific where id = #{id}
</select>
</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