Commit 00e572fc by 向延琳

关闭调频

1 parent eb01df4d
...@@ -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)
@GetMapping(value = "/resetAdjFreq") @PostMapping(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();
......
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);
}
}
...@@ -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);
} }
/** /**
......
...@@ -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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!