Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 00e572fc
authored
Sep 09, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
关闭调频
1 parent
eb01df4d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
34 deletions
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
src/main/java/cn/com/glsx/admin/modules/remote/RemoteDeviceFreqService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/resources/config/generatorConfig.xml
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
View file @
00e572f
...
@@ -468,7 +468,7 @@ public class VehicleController {
...
@@ -468,7 +468,7 @@ public class VehicleController {
@ApiOperation
(
value
=
"关闭调频"
)
@ApiOperation
(
value
=
"关闭调频"
)
@SysLog
(
module
=
"关闭调频"
,
value
=
"关闭调频"
,
action
=
OperateType
.
EDIT
)
@SysLog
(
module
=
"关闭调频"
,
value
=
"关闭调频"
,
action
=
OperateType
.
EDIT
)
@
Ge
tMapping
(
value
=
"/resetAdjFreq"
)
@
Pos
tMapping
(
value
=
"/resetAdjFreq"
)
public
R
<
Void
>
resetAdjFreq
(
@RequestParam
String
sn
)
{
public
R
<
Void
>
resetAdjFreq
(
@RequestParam
String
sn
)
{
vehicleService
.
resetAdjFreq
(
sn
);
vehicleService
.
resetAdjFreq
(
sn
);
return
R
.
ok
();
return
R
.
ok
();
...
...
src/main/java/cn/com/glsx/admin/modules/remote/RemoteDeviceFreqService.java
0 → 100644
View file @
00e572f
package
cn
.
com
.
glsx
.
admin
.
modules
.
remote
;
import
cn.com.glsx.stdinterface.api.DeviceFreqClient
;
import
cn.com.glsx.stdinterface.dto.ResetAdjFreqBO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author xiangyanlin
* @date 2022/9/9
*/
@Slf4j
@Service
public
class
RemoteDeviceFreqService
{
@Autowired
private
DeviceFreqClient
deviceFreqClient
;
public
void
resetAdjFreq
(
ResetAdjFreqBO
resetAdjFreqBO
){
deviceFreqClient
.
resetAdjFreq
(
resetAdjFreqBO
);
}
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
00e572f
...
@@ -37,6 +37,7 @@ import cn.com.glsx.publiccenter.api.dto.response.SysDictDataResponse;
...
@@ -37,6 +37,7 @@ import cn.com.glsx.publiccenter.api.dto.response.SysDictDataResponse;
import
cn.com.glsx.stdinterface.api.VehicleServiceClient
;
import
cn.com.glsx.stdinterface.api.VehicleServiceClient
;
import
cn.com.glsx.stdinterface.dto.DevicePowerDTO
;
import
cn.com.glsx.stdinterface.dto.DevicePowerDTO
;
import
cn.com.glsx.stdinterface.dto.DevicesComposeVerifyBO
;
import
cn.com.glsx.stdinterface.dto.DevicesComposeVerifyBO
;
import
cn.com.glsx.stdinterface.dto.ResetAdjFreqBO
;
import
cn.com.glsx.stdinterface.dto.SimpleDeviceItem
;
import
cn.com.glsx.stdinterface.dto.SimpleDeviceItem
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
...
@@ -177,6 +178,9 @@ public class VehicleService extends AbstractCommonService {
...
@@ -177,6 +178,9 @@ public class VehicleService extends AbstractCommonService {
@Autowired
@Autowired
private
RemoteCUserService
remoteCUserService
;
private
RemoteCUserService
remoteCUserService
;
@Autowired
private
RemoteDeviceFreqService
remoteDeviceFreqService
;
private
static
CarInfoSelected
applyCarBrandConvert
(
TenantVehicleType
tvt
)
{
private
static
CarInfoSelected
applyCarBrandConvert
(
TenantVehicleType
tvt
)
{
CarInfoSelected
selected
=
new
CarInfoSelected
();
CarInfoSelected
selected
=
new
CarInfoSelected
();
selected
.
setId
(
Math
.
toIntExact
(
tvt
.
getBrandId
()));
selected
.
setId
(
Math
.
toIntExact
(
tvt
.
getBrandId
()));
...
@@ -1814,38 +1818,7 @@ public class VehicleService extends AbstractCommonService {
...
@@ -1814,38 +1818,7 @@ public class VehicleService extends AbstractCommonService {
* 关闭调频调频
* 关闭调频调频
*/
*/
public
void
resetAdjFreq
(
String
sn
)
{
public
void
resetAdjFreq
(
String
sn
)
{
// 更新上个设备调频记录
remoteDeviceFreqService
.
resetAdjFreq
(
new
ResetAdjFreqBO
(
sn
,
ShieldContextHolder
.
getUserId
()));
updateDeviceFreqRecord
(
sn
);
DeviceFreq
deviceFreq
=
new
DeviceFreq
();
//初始化模式 (默认模式 一天一个点 特殊的闹钟模式)
deviceFreq
.
setFreqType
(
TypeConverseEnum
.
FreqTypeEnum
.
INITIALIZATION_MODE
.
getFreqType
());
deviceFreq
.
setTimer
(
"15:30"
);
String
transTimer
=
"15:30"
.
replace
(
":"
,
""
);
String
value
=
"R:"
+
transTimer
;
//调频记录
VehicleDevice
vehicleDevice
=
vehicleDeviceMapper
.
selectBindDeviceBySn
(
sn
);
deviceFreq
.
setVehicleId
(
vehicleDevice
.
getVehicleId
());
deviceFreq
.
setSn
(
sn
);
// 设置设备电量
DevicePowerDTO
devicePower
=
remoteBatteryService
.
getDevicePowerBySn
(
sn
);
if
(
Objects
.
nonNull
(
devicePower
))
{
deviceFreq
.
setBatteryLevel
(
devicePower
.
getSoc
()
+
""
);
}
deviceFreq
.
setStatus
(
TypeConverseEnum
.
FreqStatusEnum
.
TAKE_EFFECT
.
getFreqStatus
());
// WEB类型
deviceFreq
.
setUserType
(
TypeConverseEnum
.
UserTypeEnum
.
WEB
.
getUserType
());
deviceFreq
.
setCreatedBy
(
ShieldContextHolder
.
getUserId
());
deviceFreq
.
setCreatedDate
(
new
Date
());
deviceFreq
.
setUpdatedDate
(
new
Date
());
//设置操作渠道 4 新E盾系统 5 小程序
deviceFreq
.
setChannel
(
4
);
deviceFreqMapper
.
insert
(
deviceFreq
);
// 向大数据侧发送调频请求
sendRequest
(
sn
,
value
);
}
}
/**
/**
...
...
src/main/resources/config/generatorConfig.xml
View file @
00e572f
...
@@ -69,6 +69,6 @@
...
@@ -69,6 +69,6 @@
<!-- table可以有多个,每个数据库中的表都可以写一个table,tableName表示要匹配的数据库表,也可以在tableName属性中通过使用%通配符来匹配所有数据库表,只有匹配的表才会自动生成文件 enableSelectByPrimaryKey相应的配置表示是否生成相应的接口 -->
<!-- table可以有多个,每个数据库中的表都可以写一个table,tableName表示要匹配的数据库表,也可以在tableName属性中通过使用%通配符来匹配所有数据库表,只有匹配的表才会自动生成文件 enableSelectByPrimaryKey相应的配置表示是否生成相应的接口 -->
<!-- <table tableName="t_vehicle" domainObjectName="Vehicle" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!-- <table tableName="t_vehicle" domainObjectName="Vehicle" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<table
tableName=
"t_
vehicle_device"
domainObjectName=
"VehicleDevice
"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
/>
<table
tableName=
"t_
device_freq"
domainObjectName=
"DeviceFreqDO
"
enableCountByExample=
"false"
enableUpdateByExample=
"false"
enableDeleteByExample=
"false"
enableSelectByExample=
"false"
selectByExampleQueryId=
"false"
/>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment