Commit 5a141baa by 杨林龙

优化设备调频显示信息

1 parent c278b06c
......@@ -1462,10 +1462,8 @@ public class VehicleService {
}
}
df.setStatus(1);
df.setCreatedDate(new Date());
df.setUpdatedDate(new Date());
df.setCreatedBy(ShieldContextHolder.getUserId());
df.setUpdatedBy(ShieldContextHolder.getUserId());
df.setCreatedDate(new Date());
//设置操作渠道 4 新E盾系统
df.setChannel(4);
deviceFreqMapper.insert(df);
......@@ -1566,6 +1564,16 @@ public class VehicleService {
log.info("同步设备给试驾围栏===" + vehicleDevice.getVehicleId());
Vehicle vehicle = vehicleMapper.selectById(vehicleDevice.getVehicleId());
fenceService.syncUsersFencesSns(Lists.newArrayList(vehicle.getCreatedBy()));
// 同步删掉设备调频信息
DeviceFreq deviceFreq = new DeviceFreq();
deviceFreq.setSn(vehicleDevice.getSn());
List<DeviceFreq> deviceFreqList = deviceFreqMapper.select(deviceFreq);
for (DeviceFreq freq : deviceFreqList) {
// 将设备调频信息设置为已经删除
freq.setDelFlag(-1);
deviceFreqMapper.updateByPrimaryKey(freq);
}
}
public List<Vehicle> getAllvehicle() {
......
......@@ -40,10 +40,13 @@
tv.owner_name AS `name`,
tdf.`status` AS freqStatus
FROM t_device_freq tdf
LEFT JOIN t_vehicle tv ON tdf.vehicle_id = tv.id
LEFT JOIN t_user tu ON tu.id = tv.created_by
LEFT JOIN t_vehicle tv ON tv.id = tdf.vehicle_id
LEFT JOIN t_user tu ON tu.id = tdf.created_by
WHERE tdf.sn = #{sn,jdbcType=VARCHAR}
AND tdf.status = 2
AND tdf.del_flag = 0
AND tv.del_flag = 0
AND tu.del_flag = 0
ORDER BY tdf.created_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -2123,7 +2123,7 @@ public class VehicleServiceTest {
@Test
public void test12() {
R<DeviceStatusModel> deviceStatusBySn = deviceFeignService.getDeviceStatusBySn("8700922797", 0L);
R<DeviceStatusModel> deviceStatusBySn = deviceFeignService.getDeviceStatusBySn("1510112899", 0L);
System.out.println("deviceStatusBySn = " + deviceStatusBySn);
if (deviceStatusBySn != null) {
// 状态(0 行驶中 1 静止 2离线 3 在线)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!