Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
dea261c6
Commit
dea261c6
authored
Nov 04, 2024
by
zhouleilei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
9f8e1dd6
c5485f21
Changes
58
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
624 additions
and
61 deletions
+624
-61
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+42
-0
Result.java
...ce/src/main/java/net/wanji/opt/synthesis/pojo/Result.java
+19
-0
StrategyControlDataReq.java
.../net/wanji/opt/synthesis/pojo/StrategyControlDataReq.java
+54
-0
StrategyControlDataVO.java
...a/net/wanji/opt/synthesis/pojo/StrategyControlDataVO.java
+45
-0
StrategyControlReq.java
...java/net/wanji/opt/synthesis/pojo/StrategyControlReq.java
+15
-0
StrategyControlVO.java
.../java/net/wanji/opt/synthesis/pojo/StrategyControlVO.java
+17
-0
PushStrategyControlService.java
...nji/opt/synthesis/service/PushStrategyControlService.java
+15
-0
StrategyControlService.java
...t/wanji/opt/synthesis/service/StrategyControlService.java
+12
-0
PushStrategyControlServiceImpl.java
...ynthesis/service/impl/PushStrategyControlServiceImpl.java
+59
-0
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+139
-0
CommandResultSignEnum.java
...wanji/utc/hisense/common/enums/CommandResultSignEnum.java
+2
-1
TcpClient.java
.../src/main/java/net/wanji/utc/hisense/netty/TcpClient.java
+11
-13
CommandResultSign.java
...anji/utc/hisense/netty/commandsign/CommandResultSign.java
+1
-0
TcpClientHandler.java
...net/wanji/utc/hisense/netty/handler/TcpClientHandler.java
+2
-4
UdpClientHandler.java
...net/wanji/utc/hisense/netty/handler/UdpClientHandler.java
+1
-1
CommandPojo.java
...in/java/net/wanji/utc/hisense/netty/pojo/CommandPojo.java
+1
-1
CommandRequestFactory.java
...anji/utc/hisense/netty/request/CommandRequestFactory.java
+12
-0
CommandResponseFactory.java
...ji/utc/hisense/netty/response/CommandResponseFactory.java
+1
-0
HeartBeatService.java
...nji/utc/hisense/netty/response/impl/HeartBeatService.java
+1
-1
GetAlarmInfoService.java
.../hisense/netty/response/impl/get/GetAlarmInfoService.java
+1
-1
GetBaseInfoService.java
...c/hisense/netty/response/impl/get/GetBaseInfoService.java
+1
-1
GetDailyPlanInfoService.java
...ense/netty/response/impl/get/GetDailyPlanInfoService.java
+1
-1
GetDetectorInfoService.java
...sense/netty/response/impl/get/GetDetectorInfoService.java
+1
-1
GetDeviceInfoService.java
...hisense/netty/response/impl/get/GetDeviceInfoService.java
+1
-1
GetFaultInfoService.java
.../hisense/netty/response/impl/get/GetFaultInfoService.java
+1
-1
GetLightsGroupInfoService.java
...se/netty/response/impl/get/GetLightsGroupInfoService.java
+1
-1
GetLightsStatusInfoService.java
...e/netty/response/impl/get/GetLightsStatusInfoService.java
+1
-1
GetPhaseInfoService.java
.../hisense/netty/response/impl/get/GetPhaseInfoService.java
+1
-1
GetPhaseSecurityInfoService.java
.../netty/response/impl/get/GetPhaseSecurityInfoService.java
+1
-1
GetRunningStateInfoService.java
...e/netty/response/impl/get/GetRunningStateInfoService.java
+1
-1
GetSchedulesInfoService.java
...ense/netty/response/impl/get/GetSchedulesInfoService.java
+1
-1
GetSchemeInfoService.java
...hisense/netty/response/impl/get/GetSchemeInfoService.java
+1
-1
GetSchemeNoService.java
...c/hisense/netty/response/impl/get/GetSchemeNoService.java
+39
-0
GetStageInfoService.java
.../hisense/netty/response/impl/get/GetStageInfoService.java
+1
-1
GetStageStatusService.java
...isense/netty/response/impl/get/GetStageStatusService.java
+1
-1
GetTrafficDataInfoService.java
...se/netty/response/impl/get/GetTrafficDataInfoService.java
+1
-1
SetAlarmInfoService.java
.../hisense/netty/response/impl/set/SetAlarmInfoService.java
+1
-1
SetBaseInfoService.java
...c/hisense/netty/response/impl/set/SetBaseInfoService.java
+1
-1
SetControlInfoService.java
...isense/netty/response/impl/set/SetControlInfoService.java
+1
-1
SetDailyPlanInfoService.java
...ense/netty/response/impl/set/SetDailyPlanInfoService.java
+1
-1
SetDetectorInfoService.java
...sense/netty/response/impl/set/SetDetectorInfoService.java
+1
-1
SetDeviceInfoService.java
...hisense/netty/response/impl/set/SetDeviceInfoService.java
+1
-1
SetFaultInfoService.java
.../hisense/netty/response/impl/set/SetFaultInfoService.java
+1
-1
SetLightsGroupInfoService.java
...se/netty/response/impl/set/SetLightsGroupInfoService.java
+1
-1
SetPhaseInfoService.java
.../hisense/netty/response/impl/set/SetPhaseInfoService.java
+1
-1
SetPhaseSecurityInfoService.java
.../netty/response/impl/set/SetPhaseSecurityInfoService.java
+1
-1
SetSchedulesInfoService.java
...ense/netty/response/impl/set/SetSchedulesInfoService.java
+1
-1
SetSchemeInfoService.java
...hisense/netty/response/impl/set/SetSchemeInfoService.java
+1
-1
SetStageInfoService.java
.../hisense/netty/response/impl/set/SetStageInfoService.java
+1
-1
SetTrafficDataInfoService.java
...se/netty/response/impl/set/SetTrafficDataInfoService.java
+1
-1
SystemScriptionRequest.java
...nji/utc/hisense/pojo/xml/pojo/SystemScriptionRequest.java
+1
-0
LogOnRequest.java
...tc/hisense/pojo/xml/pojo/messagecontent/LogOnRequest.java
+2
-2
StepControlMultiPhaseRequest.java
...xml/pojo/messagecontent/StepControlMultiPhaseRequest.java
+34
-0
StepControlRequest.java
...ense/pojo/xml/pojo/messagecontent/StepControlRequest.java
+29
-0
GetSchemeNoRequest.java
.../pojo/xml/pojo/messagecontent/get/GetSchemeNoRequest.java
+32
-0
XMLUtils.java
...ce/src/main/java/net/wanji/utc/hisense/util/XMLUtils.java
+1
-1
application-police.yaml
...isense-service/src/main/resources/application-police.yaml
+1
-1
bootstrap-docker.yaml
...-hisense-service/src/main/resources/bootstrap-docker.yaml
+6
-6
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
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
javax.annotation.Resource
;
import
javax.ws.rs.core.MediaType
;
/**
* @author duanruiming
* @date 2024/11/03 12:42
* @description 神思电子获取1.1策略计划基础信息
*/
@Api
(
value
=
"StrategyControlController"
,
description
=
"策略控制"
)
@RequestMapping
(
"/strategyControl"
)
@RestController
public
class
StrategyControlController
{
@Resource
private
StrategyControlService
strategyControlService
;
@ApiOperation
(
value
=
"策略控制信息操作"
,
notes
=
"策略控制信息操作"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/strategyInfoOperation"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
StrategyControlVO
.
class
),
})
public
JsonViewObject
strategyInfoOperation
(
@RequestBody
StrategyControlVO
strategyControlVO
)
throws
Exception
{
return
strategyControlService
.
strategyInfoOperation
(
strategyControlVO
);
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/Result.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author duanruiming
* @date 2024/11/03 14:09
* @description 神思电子返回实体
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
Result
{
private
String
code
;
private
String
msg
;
private
Object
data
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataReq.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/11/03 18:13
*/
@Data
public
class
StrategyControlDataReq
{
/**
* 路口干线Id
*/
private
String
biz_id
;
/**
* 类型 0-路口 1-干线
*/
private
Integer
biz_type
;
/**
* 策略类型 0-绿波带 1-失衡 2-溢出 3-空放
*/
private
Integer
strategy
;
private
String
schedule_start
;
private
String
schedule_end
;
private
List
<
Time_table
>
time
;
/**
* 调控频率(秒),策略下发的频率(只针对失衡和绿波带有效)
*/
private
Integer
freq
;
/**
* 状态(1=开启,0=停止)
*/
private
Integer
status
;
/**
* 操作(insert=新增,update=更新,delete=删除)
*/
private
String
action
;
@Data
@NoArgsConstructor
public
static
class
Time_table
{
/**
* 星期周日至周六 0-6 7为每天不限时
*/
private
Integer
week
;
/**
* 时间段,格式为“开始时间-结束时间”,时间格式为hh:mm:ss,范围00:00:00到23:59:59
*/
private
String
[]
time_list
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataVO.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/11/03 18:18
*/
@Data
@ApiModel
(
value
=
"StrategyControlDataVO"
,
description
=
"策略控制操作数据实体"
)
public
class
StrategyControlDataVO
{
@ApiModelProperty
(
value
=
"路口干线Id"
)
private
String
bizId
;
@ApiModelProperty
(
value
=
"类型 0-路口 1-干线"
)
private
Integer
bizType
;
@ApiModelProperty
(
value
=
"策略类型 0-绿波带 1-失衡 2-溢出 3-空放"
)
private
Integer
strategy
;
@ApiModelProperty
(
value
=
"开始时间日期"
)
private
Date
scheduleStart
;
@ApiModelProperty
(
value
=
"结束时间日期"
)
private
Date
scheduleEnd
;
@ApiModelProperty
(
value
=
"日计划表"
)
private
List
<
StrategyControlDataVO
.
TimeTable
>
time
;
@ApiModelProperty
(
value
=
"调控频率(秒),策略下发的频率(只针对失衡和绿波带有效)"
)
private
Integer
freq
;
@ApiModelProperty
(
value
=
"状态(1=开启,0=停止)"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"操作(insert=新增,update=更新,delete=删除)"
)
private
String
action
;
@Data
@NoArgsConstructor
public
static
class
TimeTable
{
@ApiModelProperty
(
value
=
"星期周日至周六 0-6 7为每天不限时"
)
private
Integer
week
;
@ApiModelProperty
(
value
=
"时间段,格式为“开始时间-结束时间”,时间格式为hh:mm:ss,范围00:00:00到23:59:59"
)
private
String
[]
timeList
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlReq.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/11/03 14:12
* @description 策略基础信息推送请求
*/
@Data
public
class
StrategyControlReq
{
private
List
<
StrategyControlDataReq
>
data
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlVO.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/11/03 17:31
*/
@Data
@ApiModel
(
value
=
"StrategyControlVO"
,
description
=
"策略控制操作实体"
)
public
class
StrategyControlVO
{
private
List
<
StrategyControlDataVO
>
dataList
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/PushStrategyControlService.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
service
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
/**
* @author duanruiming
* @date 2024/11/03 14:06
*/
public
interface
PushStrategyControlService
{
void
insert
();
void
update
();
void
delete
();
Result
push
(
StrategyControlReq
req
)
throws
Exception
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/StrategyControlService.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
service
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.synthesis.pojo.StrategyControlVO
;
/**
* @author duanruiming
* @date 2024/11/03 17:36
*/
public
interface
StrategyControlService
{
JsonViewObject
strategyInfoOperation
(
StrategyControlVO
strategyControlVO
)
throws
Exception
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/PushStrategyControlServiceImpl.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
service
.
impl
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.tool.resttool.RestTemplateTool
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.opt.synthesis.pojo.Result
;
import
net.wanji.opt.synthesis.pojo.StrategyControlReq
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Objects
;
/**
* @author duanruiming
* @date 2024/11/03 16:25
*/
@Service
@Slf4j
public
class
PushStrategyControlServiceImpl
implements
PushStrategyControlService
{
@Override
public
void
insert
()
{
}
@Override
public
void
update
()
{
}
@Override
public
void
delete
()
{
}
@Override
public
Result
push
(
StrategyControlReq
req
)
throws
Exception
{
String
url
=
""
;
try
{
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
String
resultStr
=
RestTemplateTool
.
post
(
url
,
mapper
.
writeValueAsString
(
req
));
Result
result
=
mapper
.
readValue
(
resultStr
,
Result
.
class
);
if
(
Objects
.
nonNull
(
result
))
{
if
(
StringUtils
.
endsWithIgnoreCase
(
"200"
,
result
.
getCode
()))
{
return
result
;
}
return
result
;
}
else
{
log
.
error
(
"策略推送url:{}失败:返回数据异常"
,
url
);
return
new
Result
(
"500"
,
"服务调用失败"
,
null
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"策略控制推送url:{},失败:{}"
,
url
,
e
);
throw
new
Exception
(
e
);
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
opt
.
synthesis
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.druid.util.StringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.enums.DateStyle
;
import
net.wanji.common.framework.Constants
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.opt.synthesis.pojo.*
;
import
net.wanji.opt.synthesis.service.PushStrategyControlService
;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
/**
* @author duanruiming
* @date 2024/11/03 17:37
*/
@Slf4j
@Service
public
class
StrategyControlServiceImpl
implements
StrategyControlService
{
@Autowired
private
PushStrategyControlService
pushStrategyControlService
;
@Override
public
JsonViewObject
strategyInfoOperation
(
StrategyControlVO
strategyControlVO
)
throws
Exception
{
try
{
StrategyControlReq
req
=
convertReq
(
strategyControlVO
);
// 存库
// 调用推送
//StrategyControlDataReq detailData = new StrategyControlDataReq();
//detailData.setBiz_id("241940");
//detailData.setBiz_type(0);
//detailData.setStrategy(3);
//Date date = new Date();
//detailData.setSchedule_end(DateUtil.format(date, DateStyle.YYYY_MM_DD_HH_MM_SS.getValue()));
//detailData.setSchedule_end(DateUtil.format(date, DateStyle.YYYY_MM_DD_HH_MM_SS.getValue()));
//StrategyControlDataReq.Time_table timeTable = new StrategyControlDataReq.Time_table();
//timeTable.setWeek(1);
//timeTable.setTime_list(new String[]{"00:00-01:00", "01:00-02:00"});
//StrategyControlDataReq.Time_table timeTable1 = new StrategyControlDataReq.Time_table();
//timeTable1.setWeek(1);
//timeTable1.setTime_list(new String[]{"02:00-03:00", "03:00-04:00"});
//detailData.setTime(Arrays.asList(timeTable1, timeTable));
//detailData.setFreq(1000 * 60);
//detailData.setStrategy(1);
//detailData.setAction("insert");
// todo 测试数据
//req.setData(Arrays.asList(detailData));
Result
result
=
pushStrategyControlService
.
push
(
req
);
if
(
Objects
.
nonNull
(
result
))
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
jsonViewObject
.
setCode
(
Integer
.
valueOf
(
result
.
getCode
()));
jsonViewObject
.
setMessage
(
result
.
getMsg
());
jsonViewObject
.
setContent
(
result
.
getData
());
jsonViewObject
.
setStatus
(
StringUtils
.
equals
(
"200"
,
result
.
getCode
())
?
Constants
.
JsonView
.
STATUS_SUCCESS
:
Constants
.
JsonView
.
STATUS_FAIL
);
return
jsonViewObject
;
}
else
{
return
JsonViewObject
.
newInstance
().
fail
(
"推送神思策略控制失败!"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"策略操作失败:{}"
,
e
);
throw
new
Exception
(
e
);
}
}
private
StrategyControlReq
convertReq
(
StrategyControlVO
vo
)
throws
Exception
{
try
{
List
<
StrategyControlDataVO
>
dataList
=
vo
.
getDataList
();
StrategyControlReq
req
=
new
StrategyControlReq
();
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
List
<
StrategyControlDataReq
>
dataReqList
=
new
ArrayList
<>(
dataList
.
size
());
for
(
StrategyControlDataVO
dataVO
:
dataList
)
{
StrategyControlDataReq
detailData
=
new
StrategyControlDataReq
();
detailData
.
setBiz_id
(
dataVO
.
getBizId
());
detailData
.
setBiz_type
(
dataVO
.
getBizType
());
detailData
.
setStrategy
(
dataVO
.
getStrategy
());
detailData
.
setSchedule_start
(
DateUtil
.
format
(
dataVO
.
getScheduleStart
(),
DateStyle
.
YYYY_MM_DD_HH_MM_SS
.
getValue
()));
detailData
.
setSchedule_end
(
DateUtil
.
format
(
dataVO
.
getScheduleEnd
(),
DateStyle
.
YYYY_MM_DD_HH_MM_SS
.
getValue
()));
List
<
StrategyControlDataVO
.
TimeTable
>
timeTableList
=
dataVO
.
getTime
();
List
<
StrategyControlDataReq
.
Time_table
>
timeTables
=
new
ArrayList
<>(
timeTableList
.
size
());
timeTableList
.
forEach
(
item
->
{
StrategyControlDataReq
.
Time_table
timeTable
=
new
StrategyControlDataReq
.
Time_table
();
timeTable
.
setTime_list
(
item
.
getTimeList
());
timeTable
.
setWeek
(
item
.
getWeek
());
timeTables
.
add
(
timeTable
);
});
detailData
.
setTime
(
timeTables
);
detailData
.
setFreq
(
dataVO
.
getFreq
());
detailData
.
setStatus
(
dataVO
.
getStatus
());
detailData
.
setAction
(
dataVO
.
getAction
());
dataReqList
.
add
(
detailData
);
req
.
setData
(
dataReqList
);
}
}
return
req
;
}
catch
(
Exception
e
)
{
log
.
error
(
"策略控制操作数据转换异常:{}"
,
e
);
throw
new
Exception
(
e
);
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
StrategyControlDataReq
detailData
=
new
StrategyControlDataReq
();
detailData
.
setBiz_id
(
"241940"
);
detailData
.
setBiz_type
(
0
);
detailData
.
setStrategy
(
3
);
Date
date
=
new
Date
();
detailData
.
setSchedule_start
(
DateUtil
.
format
(
date
,
DateStyle
.
YYYY_MM_DD_HH_MM_SS
.
getValue
()));
detailData
.
setSchedule_end
(
DateUtil
.
format
(
date
,
DateStyle
.
YYYY_MM_DD_HH_MM_SS
.
getValue
()));
StrategyControlDataReq
.
Time_table
timeTable
=
new
StrategyControlDataReq
.
Time_table
();
timeTable
.
setWeek
(
1
);
timeTable
.
setTime_list
(
new
String
[]{
"00:00-01:00"
,
"01:00-02:00"
});
StrategyControlDataReq
.
Time_table
timeTable1
=
new
StrategyControlDataReq
.
Time_table
();
timeTable1
.
setWeek
(
2
);
timeTable1
.
setTime_list
(
new
String
[]{
"02:00-03:00"
,
"03:00-04:00"
});
detailData
.
setTime
(
Arrays
.
asList
(
timeTable1
,
timeTable
));
detailData
.
setFreq
(
1000
*
60
);
detailData
.
setStatus
(
1
);
detailData
.
setAction
(
"insert"
);
// todo 测试数据
StrategyControlReq
req
=
new
StrategyControlReq
();
req
.
setData
(
Arrays
.
asList
(
detailData
));
System
.
err
.
println
(
JacksonUtils
.
getInstance
().
writeValueAsString
(
req
));
System
.
err
.
println
(
new
Date
());
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/common/enums/CommandResultSignEnum.java
View file @
dea261c6
...
@@ -11,7 +11,8 @@ import java.util.Objects;
...
@@ -11,7 +11,8 @@ import java.util.Objects;
*/
*/
@Getter
@Getter
public
enum
CommandResultSignEnum
{
public
enum
CommandResultSignEnum
{
GET_RUNNING_STATE_INFO
(
RunningLightsStatusPojo
.
class
,
"getRunningStateInfoService"
);
GET_RUNNING_STATE_INFO
(
RunningLightsStatusPojo
.
class
,
"getRunningStateInfoService"
),
GET_RUNNING_SCHEME_NO
(
RunningLightsStatusPojo
.
class
,
"getSchemeNoService"
);
private
final
Object
resultPojo
;
private
final
Object
resultPojo
;
private
final
String
className
;
private
final
String
className
;
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/TcpClient.java
View file @
dea261c6
...
@@ -13,6 +13,7 @@ import net.wanji.utc.hisense.cache.netty.NettyMessageCache;
...
@@ -13,6 +13,7 @@ import net.wanji.utc.hisense.cache.netty.NettyMessageCache;
import
net.wanji.utc.hisense.netty.codec.MessageDecoder
;
import
net.wanji.utc.hisense.netty.codec.MessageDecoder
;
import
net.wanji.utc.hisense.netty.codec.MessageEnCoder
;
import
net.wanji.utc.hisense.netty.codec.MessageEnCoder
;
import
net.wanji.utc.hisense.netty.handler.TcpClientHandler
;
import
net.wanji.utc.hisense.netty.handler.TcpClientHandler
;
import
net.wanji.utc.hisense.util.XMLUtils
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -65,19 +66,16 @@ public class TcpClient {
...
@@ -65,19 +66,16 @@ public class TcpClient {
}
}
//public static void sendMessage(String ip, Integer port, String msg) {
public
static
void
sendMessage
(
Object
msg
)
{
// byte[] bytes = HexUtil.decodeHex(msg);
try
{
// try {
ChannelFuture
channelFuture
=
tcpChannelFuture
.
channel
().
writeAndFlush
(
XMLUtils
.
strToHex
(
XMLUtils
.
convertToXml
(
msg
)));
// if (channelFutureMap.isEmpty()) {
if
(
channelFuture
.
isSuccess
())
{
// return;
log
.
debug
(
"发送信号机命令消息成功:{}"
,
msg
);
// }
}
// tcpChannelFuture.channel()
}
catch
(
Exception
e
)
{
// .writeAndFlush(new DatagramPacket(Unpooled.copiedBuffer(bytes), new InetSocketAddress(ip, port))).sync();
log
.
error
(
"发送信号机命令消息失败"
,
e
);
// log.debug("发送信号机:{}/{}命令消息:{}", ip, port, msg);
}
// } catch (InterruptedException e) {
}
// log.error("sendMsg is error", e);
// }
//}
//public static MessageResultPojo sendMessage(String ip, Integer port, String msg, String command, int timeout) {
//public static MessageResultPojo sendMessage(String ip, Integer port, String msg, String command, int timeout) {
// try {
// try {
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/commandsign/CommandResultSign.java
View file @
dea261c6
...
@@ -11,6 +11,7 @@ public class CommandResultSign {
...
@@ -11,6 +11,7 @@ public class CommandResultSign {
public
static
Object
getHexSign
(
String
data
)
throws
Exception
{
public
static
Object
getHexSign
(
String
data
)
throws
Exception
{
//Object runningLightsStatusPojo = JSON.parseObject(data, RunningLightsStatusPojo.class);
//Object runningLightsStatusPojo = JSON.parseObject(data, RunningLightsStatusPojo.class);
return
XMLUtils
.
convertXmlStrToObject
(
RunningLightsStatusPojo
.
class
,
data
);
return
XMLUtils
.
convertXmlStrToObject
(
RunningLightsStatusPojo
.
class
,
data
);
}
}
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/handler/TcpClientHandler.java
View file @
dea261c6
...
@@ -107,7 +107,7 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
...
@@ -107,7 +107,7 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
commandPojo
.
setSignalId
(
crossInfo
.
getCode
());
commandPojo
.
setSignalId
(
crossInfo
.
getCode
());
commandPojo
.
setSignalIp
(
crossInfo
.
getIp
());
commandPojo
.
setSignalIp
(
crossInfo
.
getIp
());
commandPojo
.
setPort
(
crossInfo
.
getPort
());
commandPojo
.
setPort
(
crossInfo
.
getPort
());
commandPojo
.
set
Response
Msg
(
data
);
commandPojo
.
setMsg
(
data
);
return
commandPojo
;
return
commandPojo
;
}
}
...
@@ -120,7 +120,6 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
...
@@ -120,7 +120,6 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
super
.
userEventTriggered
(
ctx
,
evt
);
super
.
userEventTriggered
(
ctx
,
evt
);
if
(
evt
instanceof
IdleStateEvent
)
{
if
(
evt
instanceof
IdleStateEvent
)
{
IdleStateEvent
idleStateEvent
=
(
IdleStateEvent
)
evt
;
IdleStateEvent
idleStateEvent
=
(
IdleStateEvent
)
evt
;
log
.
info
(
"已经 10 秒没有发送信息,给服务端发送心跳!"
);
//向服务端发送消息
//向服务端发送消息
try
{
try
{
SocketAddress
socketAddress
=
ctx
.
channel
().
remoteAddress
();
SocketAddress
socketAddress
=
ctx
.
channel
().
remoteAddress
();
...
@@ -128,10 +127,9 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
...
@@ -128,10 +127,9 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
//向服务端发送心跳
//向服务端发送心跳
HeartBeatRequest
heartBeatRequest
=
new
HeartBeatRequest
();
HeartBeatRequest
heartBeatRequest
=
new
HeartBeatRequest
();
heartBeatRequest
.
setMessageType
(
MessageTypeEnum
.
HEARTBEAT_STATUS
.
getType
());
heartBeatRequest
.
setMessageType
(
MessageTypeEnum
.
HEARTBEAT_STATUS
.
getType
());
log
.
error
(
"心跳消息:{}"
,
XMLUtils
.
convertToXml
(
heartBeatRequest
));
ctx
.
channel
().
writeAndFlush
(
XMLUtils
.
strToHex
(
XMLUtils
.
convertToXml
(
heartBeatRequest
)));
ctx
.
channel
().
writeAndFlush
(
XMLUtils
.
strToHex
(
XMLUtils
.
convertToXml
(
heartBeatRequest
)));
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
());
log
.
error
(
"心跳消息发送失败:{}"
,
ex
.
getMessage
());
}
}
}
}
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/handler/UdpClientHandler.java
View file @
dea261c6
...
@@ -83,7 +83,7 @@ public class UdpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
...
@@ -83,7 +83,7 @@ public class UdpClientHandler extends SimpleChannelInboundHandler<DatagramPacket
commandPojo
.
setSignalId
(
crossInfo
.
getCode
());
commandPojo
.
setSignalId
(
crossInfo
.
getCode
());
commandPojo
.
setSignalIp
(
crossInfo
.
getIp
());
commandPojo
.
setSignalIp
(
crossInfo
.
getIp
());
commandPojo
.
setPort
(
crossInfo
.
getPort
());
commandPojo
.
setPort
(
crossInfo
.
getPort
());
commandPojo
.
set
Response
Msg
(
data
);
commandPojo
.
setMsg
(
data
);
return
commandPojo
;
return
commandPojo
;
}
}
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/pojo/CommandPojo.java
View file @
dea261c6
...
@@ -12,5 +12,5 @@ public class CommandPojo {
...
@@ -12,5 +12,5 @@ public class CommandPojo {
private
String
signalId
;
private
String
signalId
;
private
String
signalIp
;
private
String
signalIp
;
private
Integer
port
;
private
Integer
port
;
private
Object
responseM
sg
;
private
Object
m
sg
;
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/request/CommandRequestFactory.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
utc
.
hisense
.
netty
.
request
;
/**
* @author duanruiming
* @date 2024/11/02 20:15
*/
public
interface
CommandRequestFactory
{
/**
* 发送海信请求
*/
void
sendCommandRequest
(
Object
content
);
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/CommandResponseFactory.java
View file @
dea261c6
...
@@ -7,5 +7,6 @@ import net.wanji.utc.hisense.netty.pojo.CommandPojo;
...
@@ -7,5 +7,6 @@ import net.wanji.utc.hisense.netty.pojo.CommandPojo;
* @date 2023/05/10 10:07
* @date 2023/05/10 10:07
*/
*/
public
interface
CommandResponseFactory
{
public
interface
CommandResponseFactory
{
Object
getCommandResponse
(
CommandPojo
commandPojo
);
Object
getCommandResponse
(
CommandPojo
commandPojo
);
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/HeartBeatService.java
View file @
dea261c6
...
@@ -17,7 +17,7 @@ public class HeartBeatService implements CommandResponseFactory {
...
@@ -17,7 +17,7 @@ public class HeartBeatService implements CommandResponseFactory {
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetAlarmInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetAlarmInfoService
implements
CommandResponseFactory
{
public
class
GetAlarmInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetBaseInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetBaseInfoService
implements
CommandResponseFactory
{
public
class
GetBaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetDailyPlanInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetDailyPlanInfoService
implements
CommandResponseFactory
{
public
class
GetDailyPlanInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetDetectorInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetDetectorInfoService
implements
CommandResponseFactory
{
public
class
GetDetectorInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetDeviceInfoService.java
View file @
dea261c6
...
@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service;
...
@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service;
public
class
GetDeviceInfoService
implements
CommandResponseFactory
{
public
class
GetDeviceInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetFaultInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetFaultInfoService
implements
CommandResponseFactory
{
public
class
GetFaultInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetLightsGroupInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetLightsGroupInfoService
implements
CommandResponseFactory
{
public
class
GetLightsGroupInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetLightsStatusInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetLightsStatusInfoService
implements
CommandResponseFactory
{
public
class
GetLightsStatusInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetPhaseInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetPhaseInfoService
implements
CommandResponseFactory
{
public
class
GetPhaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetPhaseSecurityInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetPhaseSecurityInfoService
implements
CommandResponseFactory
{
public
class
GetPhaseSecurityInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetRunningStateInfoService.java
View file @
dea261c6
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
public
class
GetRunningStateInfoService
implements
CommandResponseFactory
{
public
class
GetRunningStateInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
SignalDataCache
.
runningStateInfoCacheUdp
.
put
(
commandPojo
.
getCrossId
(),
(
RunningLightsStatusPojo
)
commandPojo
.
get
Response
Msg
());
SignalDataCache
.
runningStateInfoCacheUdp
.
put
(
commandPojo
.
getCrossId
(),
(
RunningLightsStatusPojo
)
commandPojo
.
getMsg
());
return
commandPojo
;
return
commandPojo
;
}
}
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetSchedulesInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetSchedulesInfoService
implements
CommandResponseFactory
{
public
class
GetSchedulesInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetSchemeInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetSchemeInfoService
implements
CommandResponseFactory
{
public
class
GetSchemeInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetSchemeNoService.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
utc
.
hisense
.
netty
.
response
.
impl
.
get
;
import
net.wanji.utc.hisense.netty.TcpClient
;
import
net.wanji.utc.hisense.netty.pojo.CommandPojo
;
import
net.wanji.utc.hisense.netty.request.CommandRequestFactory
;
import
net.wanji.utc.hisense.netty.response.CommandResponseFactory
;
import
net.wanji.utc.hisense.pojo.xml.pojo.messagecontent.get.GetSchemeNoRequest
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
/**
* @author duanruiming
* @date 2024/11/02 19:51
* @description 获取海信当前运行方案号,对应【协调状态】
*/
@Service
public
class
GetSchemeNoService
implements
CommandResponseFactory
,
CommandRequestFactory
{
@Override
public
void
sendCommandRequest
(
Object
msg
)
{
GetSchemeNoRequest
request
=
new
GetSchemeNoRequest
();
GetSchemeNoRequest
.
Content
content
=
new
GetSchemeNoRequest
.
Content
();
content
.
setSpot
(
String
.
valueOf
(
msg
));
request
.
setMessageContent
(
content
);
TcpClient
.
sendMessage
(
request
);
}
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
System
.
err
.
println
(
"==============收到消息成功"
+
commandPojo
.
getMsg
());
return
commandPojo
.
getMsg
();
}
@Scheduled
(
initialDelay
=
30
*
1000
,
fixedRate
=
4000
)
public
void
test
(){
sendCommandRequest
(
1
);
System
.
err
.
println
(
"==============发送消息成功"
);
}
}
\ No newline at end of file
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetStageInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetStageInfoService
implements
CommandResponseFactory
{
public
class
GetStageInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetStageStatusService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetStageStatusService
implements
CommandResponseFactory
{
public
class
GetStageStatusService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/get/GetTrafficDataInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
GetTrafficDataInfoService
implements
CommandResponseFactory
{
public
class
GetTrafficDataInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetAlarmInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetAlarmInfoService
implements
CommandResponseFactory
{
public
class
SetAlarmInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetBaseInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetBaseInfoService
implements
CommandResponseFactory
{
public
class
SetBaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetControlInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetControlInfoService
implements
CommandResponseFactory
{
public
class
SetControlInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetDailyPlanInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDailyPlanInfoService
implements
CommandResponseFactory
{
public
class
SetDailyPlanInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetDetectorInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDetectorInfoService
implements
CommandResponseFactory
{
public
class
SetDetectorInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetDeviceInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDeviceInfoService
implements
CommandResponseFactory
{
public
class
SetDeviceInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetFaultInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetFaultInfoService
implements
CommandResponseFactory
{
public
class
SetFaultInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetLightsGroupInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetLightsGroupInfoService
implements
CommandResponseFactory
{
public
class
SetLightsGroupInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetPhaseInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetPhaseInfoService
implements
CommandResponseFactory
{
public
class
SetPhaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetPhaseSecurityInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetPhaseSecurityInfoService
implements
CommandResponseFactory
{
public
class
SetPhaseSecurityInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetSchedulesInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetSchedulesInfoService
implements
CommandResponseFactory
{
public
class
SetSchedulesInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetSchemeInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetSchemeInfoService
implements
CommandResponseFactory
{
public
class
SetSchemeInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetStageInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetStageInfoService
implements
CommandResponseFactory
{
public
class
SetStageInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/netty/response/impl/set/SetTrafficDataInfoService.java
View file @
dea261c6
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetTrafficDataInfoService
implements
CommandResponseFactory
{
public
class
SetTrafficDataInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
Object
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
commandPojo
.
get
Response
Msg
();
return
commandPojo
.
getMsg
();
}
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/xml/pojo/SystemScriptionRequest.java
View file @
dea261c6
...
@@ -12,6 +12,7 @@ import java.io.Serializable;
...
@@ -12,6 +12,7 @@ import java.io.Serializable;
* @author duanruiming
* @author duanruiming
* @date 2024/01/08 10:03
* @date 2024/01/08 10:03
*/
*/
@SuppressWarnings
(
"SpellCheckingInspection"
)
@Data
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"systemScription"
)
@XmlRootElement
(
name
=
"systemScription"
)
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/xml/pojo/messagecontent/LogOnRequest.java
View file @
dea261c6
...
@@ -16,11 +16,11 @@ import javax.xml.bind.annotation.XmlRootElement;
...
@@ -16,11 +16,11 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
(
name
=
"systemScription"
)
@XmlRootElement
(
name
=
"systemScription"
)
public
class
LogOnRequest
extends
SystemScriptionRequest
{
public
class
LogOnRequest
extends
SystemScriptionRequest
{
private
LogOn
Content
messageContent
;
private
Content
messageContent
;
@Data
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
static
class
LogOn
Content
{
public
static
class
Content
{
private
String
user
;
private
String
user
;
private
String
password
;
private
String
password
;
}
}
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/xml/pojo/messagecontent/StepControlMultiPhaseRequest.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
utc
.
hisense
.
pojo
.
xml
.
pojo
.
messagecontent
;
import
lombok.Data
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
* @author duanruiming
* @date 2024/10/29 17:22
*/
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"systemScription"
)
public
class
StepControlMultiPhaseRequest
{
private
Content
messageContent
;
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
static
class
Content
{
private
String
spot
;
/** 相位数量 */
private
int
count
;
/** 相位号 */
private
String
holdPhase
;
private
String
holdPhase1
;
private
String
holdPhase2
;
private
String
holdPhase3
;
private
String
holdPhase4
;
private
String
holdPhase5
;
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/xml/pojo/messagecontent/StepControlRequest.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
utc
.
hisense
.
pojo
.
xml
.
pojo
.
messagecontent
;
import
lombok.Data
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
* @author duanruiming
* @date 2024/10/29 16:56
*/
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"systemScription"
)
public
class
StepControlRequest
{
private
Content
messageContent
;
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
static
class
Content
{
private
String
spot
;
/** 1-开始步进 0-取消 */
private
String
command
;
/** 0 顺序步进,仅支持顺序 */
private
String
ctrlStep
;
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/xml/pojo/messagecontent/get/GetSchemeNoRequest.java
0 → 100644
View file @
dea261c6
package
net
.
wanji
.
utc
.
hisense
.
pojo
.
xml
.
pojo
.
messagecontent
.
get
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
net.wanji.utc.hisense.pojo.xml.pojo.SystemScriptionRequest
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
* @author duanruiming
* @date 2024/11/02 20:00
* @description 获取海信方案号请求实体,
*/
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"systemScription"
)
@AllArgsConstructor
@NoArgsConstructor
public
class
GetSchemeNoRequest
extends
SystemScriptionRequest
{
private
Content
messageContent
;
@Data
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@AllArgsConstructor
@NoArgsConstructor
public
static
class
Content
{
private
String
spot
;
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/util/XMLUtils.java
View file @
dea261c6
...
@@ -61,7 +61,7 @@ public class XMLUtils {
...
@@ -61,7 +61,7 @@ public class XMLUtils {
System
.
err
.
println
(
"================"
);
System
.
err
.
println
(
"================"
);
LogOnRequest
logOnMessageContent
=
new
LogOnRequest
();
LogOnRequest
logOnMessageContent
=
new
LogOnRequest
();
LogOnRequest
.
LogOnContent
body
=
new
LogOnRequest
.
LogOn
Content
();
LogOnRequest
.
Content
body
=
new
LogOnRequest
.
Content
();
body
.
setUser
(
"user"
);
body
.
setUser
(
"user"
);
body
.
setPassword
(
"123456"
);
body
.
setPassword
(
"123456"
);
logOnMessageContent
.
setMessageContent
(
body
);
logOnMessageContent
.
setMessageContent
(
body
);
...
...
signal-utc-hisense-service/src/main/resources/application-police.yaml
View file @
dea261c6
...
@@ -96,7 +96,7 @@ threadPoolConfig:
...
@@ -96,7 +96,7 @@ threadPoolConfig:
portParam
:
portParam
:
localPort
:
55051
localPort
:
55051
remotePort
:
10010
remotePort
:
10010
remoteIp
:
1
72.24.71.68
remoteIp
:
1
27.0.0.1
server
:
server
:
port
:
39003
port
:
39003
servlet
:
servlet
:
...
...
signal-utc-hisense-service/src/main/resources/bootstrap-docker.yaml
View file @
dea261c6
spring
:
spring
:
application
:
# dubbo启动需要程序名称
name
:
utc-hisense
main
:
allow-circular-references
:
true
cloud
:
cloud
:
nacos
:
nacos
:
config
:
config
:
...
@@ -12,4 +7,9 @@ spring:
...
@@ -12,4 +7,9 @@ spring:
group
:
signal
group
:
signal
namespace
:
signal
namespace
:
signal
username
:
nacos
username
:
nacos
password
:
nacos
password
:
nacos
\ No newline at end of file
application
:
# dubbo启动需要程序名称
name
:
utc-hisense
main
:
allow-circular-references
:
true
\ No newline at end of file
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