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
d346379f
Commit
d346379f
authored
Jan 29, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信号控制-控制状态保存
parent
7f6e842e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
8 deletions
+81
-8
SignalCommandController.java
...ava/net/wanji/web/controller/SignalCommandController.java
+14
-6
TCrossControlHist.java
...src/main/java/net/wanji/web/entity/TCrossControlHist.java
+48
-0
ControlHistMapper.java
...src/main/java/net/wanji/web/mapper/ControlHistMapper.java
+2
-2
ControlHistMapper.xml
...l-service/src/main/resources/mapper/ControlHistMapper.xml
+17
-0
No files found.
signal-control-service/src/main/java/net/wanji/web/controller/SignalCommandController.java
View file @
d346379f
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import
net.wanji.feign.pojo.result.JsonViewObject
;
import
net.wanji.feign.pojo.result.JsonViewObject
;
import
net.wanji.feign.pojo.vo.*
;
import
net.wanji.feign.pojo.vo.*
;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.feign.service.UtcFeignClients
;
import
net.wanji.web.mapper.ControlHistMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -25,6 +26,9 @@ public class SignalCommandController {
...
@@ -25,6 +26,9 @@ public class SignalCommandController {
@Autowired
@Autowired
private
UtcFeignClients
utcFeignClients
;
private
UtcFeignClients
utcFeignClients
;
@Autowired
private
ControlHistMapper
controlHistMapper
;
@ApiOperation
(
value
=
"信号机方案下发-基础方案下发"
,
notes
=
"信号机方案下发-基础方案下发"
)
@ApiOperation
(
value
=
"信号机方案下发-基础方案下发"
,
notes
=
"信号机方案下发-基础方案下发"
)
@PostMapping
(
"/schemeSend"
)
@PostMapping
(
"/schemeSend"
)
public
JsonViewObject
schemeSend
(
@RequestBody
@Validated
SchemeSendVO
schemeSendVO
)
{
public
JsonViewObject
schemeSend
(
@RequestBody
@Validated
SchemeSendVO
schemeSendVO
)
{
...
@@ -37,7 +41,7 @@ public class SignalCommandController {
...
@@ -37,7 +41,7 @@ public class SignalCommandController {
@ApiOperation
(
value
=
"计划下发-计划信息、时段信息"
,
notes
=
"计划下发-计划信息、时段信息"
)
@ApiOperation
(
value
=
"计划下发-计划信息、时段信息"
,
notes
=
"计划下发-计划信息、时段信息"
)
@PostMapping
(
"/planSend"
)
@PostMapping
(
"/planSend"
)
public
JsonViewObject
planSend
(
@RequestBody
@Validated
PlanSendVO
planSendVO
)
throws
Exception
{
public
JsonViewObject
planSend
(
@RequestBody
@Validated
PlanSendVO
planSendVO
)
{
JsonViewObject
jsonViewObject
=
utcFeignClients
.
planSend
(
planSendVO
);
JsonViewObject
jsonViewObject
=
utcFeignClients
.
planSend
(
planSendVO
);
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"计划下发-计划信息、时段信息UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"计划下发-计划信息、时段信息UTC服务调用异常"
);
...
@@ -47,7 +51,7 @@ public class SignalCommandController {
...
@@ -47,7 +51,7 @@ public class SignalCommandController {
@ApiOperation
(
value
=
"时间表下发-时间表信息"
,
notes
=
"时间表下发-时间表信息"
)
@ApiOperation
(
value
=
"时间表下发-时间表信息"
,
notes
=
"时间表下发-时间表信息"
)
@PostMapping
(
"/scheduleSend"
)
@PostMapping
(
"/scheduleSend"
)
public
JsonViewObject
scheduleSend
(
@RequestBody
@Validated
ScheduleSendVO
scheduleSendVO
)
throws
Exception
{
public
JsonViewObject
scheduleSend
(
@RequestBody
@Validated
ScheduleSendVO
scheduleSendVO
)
{
JsonViewObject
jsonViewObject
=
utcFeignClients
.
scheduleSend
(
scheduleSendVO
);
JsonViewObject
jsonViewObject
=
utcFeignClients
.
scheduleSend
(
scheduleSendVO
);
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"时间表下发-时间表信息UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"时间表下发-时间表信息UTC服务调用异常"
);
...
@@ -57,7 +61,7 @@ public class SignalCommandController {
...
@@ -57,7 +61,7 @@ public class SignalCommandController {
@ApiOperation
(
value
=
"相位配时下发-(下发相位参数)"
,
notes
=
"相位配时下发-(下发相位参数)"
)
@ApiOperation
(
value
=
"相位配时下发-(下发相位参数)"
,
notes
=
"相位配时下发-(下发相位参数)"
)
@PostMapping
(
"/phaseTimingSend"
)
@PostMapping
(
"/phaseTimingSend"
)
public
JsonViewObject
phaseTimingSend
(
@RequestBody
@Validated
PhaseTimingSendVO
phaseTimingSendVO
)
throws
Exception
{
public
JsonViewObject
phaseTimingSend
(
@RequestBody
@Validated
PhaseTimingSendVO
phaseTimingSendVO
)
{
JsonViewObject
jsonViewObject
=
utcFeignClients
.
phaseTimingSend
(
phaseTimingSendVO
);
JsonViewObject
jsonViewObject
=
utcFeignClients
.
phaseTimingSend
(
phaseTimingSendVO
);
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"相位配时下发-(下发相位参数)UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"相位配时下发-(下发相位参数)UTC服务调用异常"
);
...
@@ -67,7 +71,7 @@ public class SignalCommandController {
...
@@ -67,7 +71,7 @@ public class SignalCommandController {
@ApiOperation
(
value
=
"灯态控制-路口全红/黄闪/关灯控制/恢复"
,
notes
=
"灯态控制-路口全红/黄闪/关灯控制/恢复"
)
@ApiOperation
(
value
=
"灯态控制-路口全红/黄闪/关灯控制/恢复"
,
notes
=
"灯态控制-路口全红/黄闪/关灯控制/恢复"
)
@PostMapping
(
"/lampStateControl"
)
@PostMapping
(
"/lampStateControl"
)
public
JsonViewObject
allRedControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
public
JsonViewObject
allRedControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
{
Integer
controlType
=
commandVO
.
getControlType
();
Integer
controlType
=
commandVO
.
getControlType
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
if
(
1
==
controlType
)
{
if
(
1
==
controlType
)
{
...
@@ -82,17 +86,19 @@ public class SignalCommandController {
...
@@ -82,17 +86,19 @@ public class SignalCommandController {
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"灯态控制UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"灯态控制UTC服务调用异常"
);
}
}
controlHistMapper
.
insertOne
(
commandVO
.
getCrossCode
(),
controlType
+
1
);
return
jsonViewObject
;
return
jsonViewObject
;
}
}
@ApiOperation
(
value
=
"步进控制-步进控制/恢复"
,
notes
=
"步进控制-步进控制/恢复"
)
@ApiOperation
(
value
=
"步进控制-步进控制/恢复"
,
notes
=
"步进控制-步进控制/恢复"
)
@PostMapping
(
"/stepControl"
)
@PostMapping
(
"/stepControl"
)
public
JsonViewObject
stepControl
(
@RequestBody
@Validated
StepControlVO
stepControlVO
)
throws
Exception
{
public
JsonViewObject
stepControl
(
@RequestBody
@Validated
StepControlVO
stepControlVO
)
{
JsonViewObject
jsonViewObject
=
utcFeignClients
.
stepControl
(
stepControlVO
.
getCode
(),
stepControlVO
.
getCommand
(),
stepControlVO
.
getStepNum
());
JsonViewObject
jsonViewObject
=
utcFeignClients
.
stepControl
(
stepControlVO
.
getCode
(),
stepControlVO
.
getCommand
(),
stepControlVO
.
getStepNum
());
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"步进控制-步进控制/恢复UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"步进控制-步进控制/恢复UTC服务调用异常"
);
}
}
controlHistMapper
.
insertOne
(
stepControlVO
.
getCode
(),
7
);
return
jsonViewObject
;
return
jsonViewObject
;
}
}
...
@@ -104,16 +110,18 @@ public class SignalCommandController {
...
@@ -104,16 +110,18 @@ public class SignalCommandController {
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"恢复时间表-恢复路口时间表执行UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"恢复时间表-恢复路口时间表执行UTC服务调用异常"
);
}
}
controlHistMapper
.
insertOne
(
code
,
1
);
return
jsonViewObject
;
return
jsonViewObject
;
}
}
@ApiOperation
(
value
=
"锁定控制-相位锁定/解锁"
,
notes
=
"锁定控制-相位锁定/解锁"
)
@ApiOperation
(
value
=
"锁定控制-相位锁定/解锁"
,
notes
=
"锁定控制-相位锁定/解锁"
)
@PostMapping
(
value
=
"/lockControl"
)
@PostMapping
(
value
=
"/lockControl"
)
public
JsonViewObject
lockControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
public
JsonViewObject
lockControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
{
JsonViewObject
jsonViewObject
=
utcFeignClients
.
lockControl
(
commandVO
);
JsonViewObject
jsonViewObject
=
utcFeignClients
.
lockControl
(
commandVO
);
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"锁定控制-相位锁定/解锁UTC服务调用异常"
);
return
jsonViewObject
.
fail
(
"锁定控制-相位锁定/解锁UTC服务调用异常"
);
}
}
controlHistMapper
.
insertOne
(
commandVO
.
getCrossCode
(),
4
);
return
jsonViewObject
;
return
jsonViewObject
;
}
}
...
...
signal-control-service/src/main/java/net/wanji/web/entity/TCrossControlHist.java
0 → 100644
View file @
d346379f
package
net
.
wanji
.
web
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @author duanruiming
* @date 2023/01/29 11:18
*/
@Data
@NoArgsConstructor
public
class
TCrossControlHist
{
/**
* id
*/
@ApiModelProperty
(
name
=
"id"
,
notes
=
""
)
private
int
id
;
/**
* 路口编号
*/
@ApiModelProperty
(
name
=
"路口编号"
,
notes
=
""
)
private
String
crossId
;
/**
* 控制类型
*/
@ApiModelProperty
(
name
=
"控制类型:1时间表;2全红;3黄闪;4锁定;5中心优化;6MEC优化;7现场手动"
,
notes
=
""
)
private
int
type
;
/**
* 开始时间
*/
@ApiModelProperty
(
name
=
"开始时间"
,
notes
=
""
)
private
Date
startTime
;
/**
* 创建时间
*/
@ApiModelProperty
(
name
=
"创建时间"
,
notes
=
""
)
private
Date
gmtCreate
;
/**
* 修改时间
*/
@ApiModelProperty
(
name
=
"修改时间"
,
notes
=
""
)
private
Date
gmtModified
;
}
signal-control-service/src/main/java/net/wanji/web/mapper/ControlHistMapper.java
View file @
d346379f
package
net
.
wanji
.
web
.
mapper
;
package
net
.
wanji
.
web
.
mapper
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
net.wanji.web.po.ControlHistPO
;
import
net.wanji.web.po.ControlHistPO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -14,7 +13,8 @@ import java.util.List;
...
@@ -14,7 +13,8 @@ import java.util.List;
* @date 2022/10/27 14:25
* @date 2022/10/27 14:25
*/
*/
@Repository
@Repository
@DS
(
"webService"
)
public
interface
ControlHistMapper
{
public
interface
ControlHistMapper
{
List
<
ControlHistPO
>
selectByCrossId
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"todayDate"
)
Date
todayDate
);
List
<
ControlHistPO
>
selectByCrossId
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"todayDate"
)
Date
todayDate
);
int
insertOne
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"type"
)
Integer
type
);
}
}
signal-control-service/src/main/resources/mapper/ControlHistMapper.xml
View file @
d346379f
...
@@ -9,6 +9,19 @@
...
@@ -9,6 +9,19 @@
<result
property=
"typeCount"
column=
"typeCount"
/>
<result
property=
"typeCount"
column=
"typeCount"
/>
</resultMap>
</resultMap>
<resultMap
id=
"tCrossControlHist"
type=
"net.wanji.web.entity.TCrossControlHist"
>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"crossId"
column=
"cross_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"type"
column=
"type"
jdbcType=
"TINYINT"
/>
<result
property=
"startTime"
column=
"start_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"gmtCreate"
column=
"gmt_create"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"gmtModified"
column=
"gmt_modified"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, crossId, type, startTime, gmt_create, gmt_modified
</sql>
<select
id=
"selectByCrossId"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByCrossId"
resultMap=
"BaseResultMap"
>
select concat(hour(start_time), ':', floor(minute(start_time)/30)*30) as controlTime,
select concat(hour(start_time), ':', floor(minute(start_time)/30)*30) as controlTime,
type as controlType,
type as controlType,
...
@@ -19,4 +32,8 @@
...
@@ -19,4 +32,8 @@
order by controlTime
order by controlTime
</select>
</select>
<insert
id=
"insertOne"
>
insert into t_cross_control_hist (cross_id, type, start_time, gmt_create, gmt_modified)
values (#{crossId}, #{type}, now(), now(), now())
</insert>
</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