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
268d94f5
Commit
268d94f5
authored
Jan 13, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口更新参数
parent
79218d84
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
2 deletions
+129
-2
TopographyIotDataVO.java
...om/yeejoin/equipmanage/common/vo/TopographyIotDataVO.java
+2
-0
TopographyIotIndexTrendVo.java
...join/equipmanage/common/vo/TopographyIotIndexTrendVo.java
+34
-0
TopographyController.java
.../yeejoin/equipmanage/controller/TopographyController.java
+67
-2
EquipmentSpecificIndexMapper.java
...join/equipmanage/mapper/EquipmentSpecificIndexMapper.java
+2
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+24
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/TopographyIotDataVO.java
View file @
268d94f5
...
@@ -13,6 +13,8 @@ import lombok.Data;
...
@@ -13,6 +13,8 @@ import lombok.Data;
@Data
@Data
public
class
TopographyIotDataVO
{
public
class
TopographyIotDataVO
{
private
Long
id
;
private
String
name
;
private
String
name
;
private
Object
value
;
private
Object
value
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/TopographyIotIndexTrendVo.java
0 → 100644
View file @
268d94f5
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author keyong
* @title: TopographyAlarmVo
* <pre>
* @description: TODO
* </pre>
* @date 2022/01/12 18:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
TopographyIotIndexTrendVo
{
private
Long
id
;
private
String
name
;
private
String
nameKey
;
private
String
unit
;
private
IotDataVO
iotData
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/TopographyController.java
View file @
268d94f5
...
@@ -38,6 +38,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -38,6 +38,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
/**
/**
* <p>
* <p>
...
@@ -785,6 +786,7 @@ public class TopographyController extends AbstractBaseController {
...
@@ -785,6 +786,7 @@ public class TopographyController extends AbstractBaseController {
iotVo
.
setTime
(
x
.
getUpdateDate
());
iotVo
.
setTime
(
x
.
getUpdateDate
());
if
(
x
.
getNameKey
().
equals
(
iotDataVO
.
getKey
()))
{
if
(
x
.
getNameKey
().
equals
(
iotDataVO
.
getKey
()))
{
TopographyIotDataVO
dataVO
=
new
TopographyIotDataVO
();
TopographyIotDataVO
dataVO
=
new
TopographyIotDataVO
();
dataVO
.
setId
(
x
.
getId
());
dataVO
.
setName
(
x
.
getIndexName
());
dataVO
.
setName
(
x
.
getIndexName
());
dataVO
.
setValue
(
x
.
getValue
());
dataVO
.
setValue
(
x
.
getValue
());
dataVO
.
setUnit
(
x
.
getIndexUnitName
());
dataVO
.
setUnit
(
x
.
getIndexUnitName
());
...
@@ -826,8 +828,71 @@ public class TopographyController extends AbstractBaseController {
...
@@ -826,8 +828,71 @@ public class TopographyController extends AbstractBaseController {
eqpId
=
detailDTO
.
getEqpId
();
eqpId
=
detailDTO
.
getEqpId
();
}
}
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificService
.
getById
(
eqpId
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificService
.
getById
(
eqpId
);
String
iotCode
=
equipmentSpecific
.
getIotCode
();
String
prefix
=
null
;
String
suffix
=
null
;
if
(
iotCode
.
length
()
>
8
)
{
prefix
=
iotCode
.
substring
(
0
,
8
);
suffix
=
iotCode
.
substring
(
8
);
}
else
{
return
CommonResponseUtil
.
failure
(
"装备物联编码错误,请确认!"
);
}
LonAndLatEntityVo
lonAndLatEntityVo
=
new
LonAndLatEntityVo
();
String
url
=
iotServerName
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"product"
,
getProduct
());
headers
.
set
(
"token"
,
getToken
());
headers
.
set
(
"appKey"
,
getAppKey
());
HttpEntity
httpEntity
=
new
HttpEntity
<>(
lonAndLatEntityVo
,
headers
);
ResponseEntity
<
FeignClientResult
>
feignClientResult
=
null
;
try
{
feignClientResult
=
restTemplate
.
exchange
(
"http://"
+
url
+
"/iot/v1/livedata/list?timeStart="
+
beginDate
+
"&timeEnd="
+
endDate
+
"&productKey="
+
prefix
+
"&deviceName="
+
suffix
,
HttpMethod
.
GET
,
httpEntity
,
FeignClientResult
.
class
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
null
!=
feignClientResult
&&
feignClientResult
.
getBody
().
getStatus
()
==
200
)
{
if
(
null
!=
feignClientResult
.
getBody
().
getResult
())
{
String
json
=
JSON
.
toJSONString
(
feignClientResult
.
getBody
().
getResult
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
Iterator
it
=
jsonObject
.
entrySet
().
iterator
();
List
<
IotDataVO
>
iotDatalist
=
new
ArrayList
<
IotDataVO
>();
while
(
it
.
hasNext
())
{
IotDataVO
iotDataVO
=
new
IotDataVO
();
Map
.
Entry
<
String
,
Object
>
entry
=
(
Map
.
Entry
<
String
,
Object
>)
it
.
next
();
if
(!
"name"
.
equals
(
entry
.
getKey
())
||
!
"deviceName"
.
equals
(
entry
.
getKey
())
||
!
"time"
.
equals
(
entry
.
getKey
()))
{
iotDataVO
.
setKey
(
entry
.
getKey
());
iotDataVO
.
setValue
(
entry
.
getValue
());
}
iotDatalist
.
add
(
iotDataVO
);
}
List
<
EquipmentSpecificIndex
>
indexes
=
equipmentSpecificIndexMapper
.
getEquipmentSpeIndexByIotCodeAndTrend
(
iotCode
);
if
(
0
<
indexes
.
size
())
{
List
<
TopographyIotIndexTrendVo
>
list
=
new
ArrayList
<>();
indexes
.
forEach
(
x
->
{
iotDatalist
.
forEach
(
iotDataVO
->
{
if
(
x
.
getNameKey
().
equals
(
iotDataVO
.
getKey
()))
{
TopographyIotIndexTrendVo
vo
=
new
TopographyIotIndexTrendVo
();
vo
.
setId
(
x
.
getId
());
vo
.
setName
(
x
.
getIndexName
());
vo
.
setNameKey
(
x
.
getNameKey
());
vo
.
setUnit
(
x
.
getIndexUnitName
());
vo
.
setIotData
(
iotDataVO
);
list
.
add
(
vo
);
}
});
});
Map
<
Long
,
List
<
TopographyIotIndexTrendVo
>>
resMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getId
()));
return
CommonResponseUtil
.
success
(
resMap
);
}
}
}
else
{
logger
.
error
(
"注:iotCode为 ("
+
iotCode
+
") 的装备不存在于物联系统中!"
);
return
CommonResponseUtil
.
success
();
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificIndexMapper.java
View file @
268d94f5
...
@@ -46,6 +46,8 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
...
@@ -46,6 +46,8 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
*/
*/
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCode
(
String
iotCode
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCode
(
String
iotCode
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCodeAndTrend
(
String
iotCode
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexDataByIotCode
(
String
iotCode
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexDataByIotCode
(
String
iotCode
);
/**
/**
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
268d94f5
...
@@ -88,6 +88,30 @@
...
@@ -88,6 +88,30 @@
wes.iot_code = #{iotCode}
wes.iot_code = #{iotCode}
</select>
</select>
<select
id=
"getEquipmentSpeIndexByIotCodeAndTrend"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
SELECT
wei.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code,
wes.iot_code AS iotCode,
wes.org_code AS orgCode,
wei.type_code AS typeCode,
wei.name AS indexName,
wei.unit AS indexUnitName,
wesi.update_date AS updateDate
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
AND
wei.is_trend = 1
</select>
<select
id=
"getEquipmentSpeIndexDataByIotCode"
<select
id=
"getEquipmentSpeIndexDataByIotCode"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
SELECT
SELECT
...
...
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