Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
terminal-protocol-proxy-service
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fox-energy
backend
terminal-protocol-proxy-service
Commits
d39cc74f
Commit
d39cc74f
authored
Aug 31, 2023
by
xieshaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码,协议自定义
parent
a3ba6639
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
+21
-23
CentralAirProtocol.java
...rtyproxy/protocolimpls/centralAir/CentralAirProtocol.java
+18
-21
DataReportInfoDTO.java
...proxy/protocolimpls/centralAir/dto/DataReportInfoDTO.java
+2
-1
CentralAirController.java
src/main/java/vc/thinker/web/CentralAirController.java
+1
-1
No files found.
src/main/java/vc/thinker/thirdpartyproxy/protocolimpls/centralAir/CentralAirProtocol.java
View file @
d39cc74f
package
vc
.
thinker
.
thirdpartyproxy
.
protocolimpls
.
centralAir
;
package
vc
.
thinker
.
thirdpartyproxy
.
protocolimpls
.
centralAir
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
vc.thinker.absctacts.protocolproxy.enums.IProtocolType
;
import
vc.thinker.absctacts.protocolproxy.enums.IProtocolType
;
import
vc.thinker.absctacts.protocolproxy.protocol.AbstractThirdPartyProtocol
;
import
vc.thinker.absctacts.protocolproxy.protocol.AbstractThirdPartyProtocol
;
import
vc.thinker.config.device.DeviceInfoConfig
;
import
vc.thinker.config.device.DeviceInfoConfig
;
...
@@ -13,7 +11,6 @@ import vc.thinker.mqtt.forwardthinker.ThinkerProdProtocolClient;
...
@@ -13,7 +11,6 @@ import vc.thinker.mqtt.forwardthinker.ThinkerProdProtocolClient;
import
vc.thinker.mqtt.forwardthinker.dto.ThinkerReportDTO
;
import
vc.thinker.mqtt.forwardthinker.dto.ThinkerReportDTO
;
import
vc.thinker.thirdpartyproxy.ProtocolType
;
import
vc.thinker.thirdpartyproxy.ProtocolType
;
import
vc.thinker.thirdpartyproxy.protocolimpls.centralAir.dto.DataReportInfoDTO
;
import
vc.thinker.thirdpartyproxy.protocolimpls.centralAir.dto.DataReportInfoDTO
;
import
vc.thinker.thirdpartyproxy.protocolimpls.centralAir.dto.DataReportParamDTO
;
/**
/**
* 中央空调代理上报网关协议
* 中央空调代理上报网关协议
...
@@ -47,24 +44,24 @@ public class CentralAirProtocol extends AbstractThirdPartyProtocol implements Te
...
@@ -47,24 +44,24 @@ public class CentralAirProtocol extends AbstractThirdPartyProtocol implements Te
ThinkerReportDTO
dto
=
new
ThinkerReportDTO
();
ThinkerReportDTO
dto
=
new
ThinkerReportDTO
();
dto
.
setDeviceCode
(
deviceInfoConfig
.
getCode
());
dto
.
setDeviceCode
(
deviceInfoConfig
.
getCode
());
dto
.
setTimestamp
(
dataReportInfoDTO
.
getTimestamp
());
dto
.
setTimestamp
(
dataReportInfoDTO
.
getTimestamp
());
JSONObject
dataMap
=
new
JSONObject
();
//
JSONObject dataMap = new JSONObject();
DataReportParamDTO
paramDTO
=
dataReportInfoDTO
.
getData
();
//
DataReportParamDTO paramDTO = dataReportInfoDTO.getData();
if
(!
ObjectUtils
.
isEmpty
(
paramDTO
.
getElectricity
())){
//
if (!ObjectUtils.isEmpty(paramDTO.getElectricity())){
dataMap
.
put
(
CentralAirMeterAttrDefine
.
electricity
.
getCode
(),
dataReportInfoDTO
.
getData
().
getElectricity
());
//
dataMap.put(CentralAirMeterAttrDefine.electricity.getCode(), dataReportInfoDTO.getData().getElectricity());
}
//
}
if
(!
ObjectUtils
.
isEmpty
(
paramDTO
.
getColdCapacity
()))
{
//
if (!ObjectUtils.isEmpty(paramDTO.getColdCapacity())) {
dataMap
.
put
(
CentralAirMeterAttrDefine
.
coldCapacity
.
getCode
(),
dataReportInfoDTO
.
getData
().
getColdCapacity
());
//
dataMap.put(CentralAirMeterAttrDefine.coldCapacity.getCode(), dataReportInfoDTO.getData().getColdCapacity());
}
//
}
if
(!
ObjectUtils
.
isEmpty
(
paramDTO
.
getSystemCop
()))
{
//
if (!ObjectUtils.isEmpty(paramDTO.getSystemCop())) {
dataMap
.
put
(
CentralAirMeterAttrDefine
.
systemCop
.
getCode
(),
dataReportInfoDTO
.
getData
().
getSystemCop
());
//
dataMap.put(CentralAirMeterAttrDefine.systemCop.getCode(), dataReportInfoDTO.getData().getSystemCop());
}
//
}
if
(!
ObjectUtils
.
isEmpty
(
paramDTO
.
getSupplyWaterTemp
()))
{
//
if (!ObjectUtils.isEmpty(paramDTO.getSupplyWaterTemp())) {
dataMap
.
put
(
CentralAirMeterAttrDefine
.
supplyWaterTemp
.
getCode
(),
dataReportInfoDTO
.
getData
().
getSupplyWaterTemp
());
//
dataMap.put(CentralAirMeterAttrDefine.supplyWaterTemp.getCode(), dataReportInfoDTO.getData().getSupplyWaterTemp());
}
//
}
if
(!
ObjectUtils
.
isEmpty
(
paramDTO
.
getReturnWaterTemp
()))
{
//
if (!ObjectUtils.isEmpty(paramDTO.getReturnWaterTemp())) {
dataMap
.
put
(
CentralAirMeterAttrDefine
.
returnWaterTemp
.
getCode
(),
dataReportInfoDTO
.
getData
().
getReturnWaterTemp
());
//
dataMap.put(CentralAirMeterAttrDefine.returnWaterTemp.getCode(), dataReportInfoDTO.getData().getReturnWaterTemp());
}
//
}
dto
.
setDatas
(
data
Map
);
dto
.
setDatas
(
data
ReportInfoDTO
.
getData
()
);
thinkerProdProtocolClient
.
report
(
protocolType
().
getCode
(),
dto
);
thinkerProdProtocolClient
.
report
(
protocolType
().
getCode
(),
dto
);
}
}
}
}
src/main/java/vc/thinker/thirdpartyproxy/protocolimpls/centralAir/dto/DataReportInfoDTO.java
View file @
d39cc74f
package
vc
.
thinker
.
thirdpartyproxy
.
protocolimpls
.
centralAir
.
dto
;
package
vc
.
thinker
.
thirdpartyproxy
.
protocolimpls
.
centralAir
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -22,6 +23,6 @@ public class DataReportInfoDTO {
...
@@ -22,6 +23,6 @@ public class DataReportInfoDTO {
private
Long
timestamp
;
private
Long
timestamp
;
@ApiModelProperty
(
"协议数据"
)
@ApiModelProperty
(
"协议数据"
)
private
DataReportParamDTO
data
;
private
JSONObject
data
;
}
}
src/main/java/vc/thinker/web/CentralAirController.java
View file @
d39cc74f
...
@@ -54,7 +54,7 @@ public class CentralAirController {
...
@@ -54,7 +54,7 @@ public class CentralAirController {
.
protocolCode
(
reportVO
.
getProtocolCode
())
.
protocolCode
(
reportVO
.
getProtocolCode
())
//.deviceAddress(reportVO.getDeviceAddress())
//.deviceAddress(reportVO.getDeviceAddress())
.
timestamp
(
reportVO
.
getTimestamp
())
.
timestamp
(
reportVO
.
getTimestamp
())
.
data
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
reportVO
.
getData
()),
DataReportParamDTO
.
class
))
.
data
(
reportVO
.
getData
(
))
.
build
();
.
build
();
this
.
centralAirProtocol
.
dataReport
(
dto
);
this
.
centralAirProtocol
.
dataReport
(
dto
);
simpleResponse
.
setSuccess
(
true
);
simpleResponse
.
setSuccess
(
true
);
...
...
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