Commit f0d1c0c1 by 杨林龙

调试

1 parent d1ab6296
......@@ -32,7 +32,17 @@ public class OfflineSearch extends Page {
private String activeEndTime;
/**
* 1有源 0无源
* 设备类型 GPS/有线 GPS/无线 OBD/OBD (该字段由t_device中的deviceType和source用 - 拼接而成)
*/
private String deviceTypeAndSource;
/**
* 设备型号 GPS OBD
*/
private Integer deviceType;
/**
* 设备类型 有线 无线
*/
private Integer source;
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.admin.modules.remote;
import cn.com.glsx.alarm.api.AlarmFeignClient;
import cn.com.glsx.alarm.services.model.PowerOffBo;
import cn.com.glsx.alarm.services.model.TearDownBo;
import cn.hutool.core.collection.CollectionUtil;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,12 +24,17 @@ public class RemoteAlarmService {
private AlarmFeignClient alarmFeignClient;
public Integer getPowerOffAlertCount(List<String> sns, String startTime, String endTime) {
Integer powerOffAlertCount = 0;
if (CollectionUtil.isEmpty(sns)) {
return powerOffAlertCount;
}
PowerOffBo powerOffBo = new PowerOffBo();
powerOffBo.setSns(sns);
powerOffBo.setStartTime(startTime);
powerOffBo.setEndTime(endTime);
R<Integer> powerOffAlertCountR = alarmFeignClient.getPowerOffAlertCount(powerOffBo);
Integer powerOffAlertCount = powerOffAlertCountR.getData(Integer.class);
powerOffAlertCount = powerOffAlertCountR.getData(Integer.class);
if (powerOffAlertCount == null) {
powerOffAlertCount = 0;
}
......@@ -36,12 +42,17 @@ public class RemoteAlarmService {
}
public Integer getTearDownAlarmCount(List<String> sns, String startTime, String endTime) {
Integer tearDownAlarmCount = 0;
if (CollectionUtil.isEmpty(sns)) {
return tearDownAlarmCount;
}
TearDownBo tearDownBo = new TearDownBo();
tearDownBo.setSns(sns);
tearDownBo.setStartTime(startTime);
tearDownBo.setEndTime(endTime);
R<Integer> tearDownAlarmCountR = alarmFeignClient.getTearDownAlarmCount(tearDownBo);
Integer tearDownAlarmCount = tearDownAlarmCountR.getData(Integer.class);
tearDownAlarmCount = tearDownAlarmCountR.getData(Integer.class);
if (tearDownAlarmCount == null) {
tearDownAlarmCount = 0;
}
......
......@@ -28,10 +28,14 @@ public class RemoteStuJudgeAlarmService {
private StuJudgeAlarmFeignClient stuJudgeAlarmFeignClient;
public Integer getStuJudgeAlarmCount(List<String> sns) {
Integer judgeAlarmCount = 0;
if (CollectionUtils.isEmpty(sns)) {
return judgeAlarmCount;
}
StuJudgeAlarmBo stuJudgeAlarmBo = new StuJudgeAlarmBo();
stuJudgeAlarmBo.setSns(sns);
R<Integer> stuJudgeAlarmCountR = stuJudgeAlarmFeignClient.getStuJudgeAlarmCount(stuJudgeAlarmBo);
Integer judgeAlarmCount = stuJudgeAlarmCountR.getData(Integer.class);
judgeAlarmCount = stuJudgeAlarmCountR.getData(Integer.class);
if (judgeAlarmCount == null) {
judgeAlarmCount = 0;
}
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import cn.com.glsx.admin.modules.model.export.OfflineExport;
import cn.com.glsx.admin.modules.model.param.OfflineSearch;
import com.glsx.plat.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -29,6 +30,11 @@ public class OfflineService {
* @return
*/
public List<OfflineExport> findOfflineList(OfflineSearch offlineSearch) {
String deviceTypeAndSource = offlineSearch.getDeviceTypeAndSource();
if (StringUtils.isNotEmpty(deviceTypeAndSource)) {
offlineSearch.setDeviceType(Integer.parseInt(deviceTypeAndSource.split("-")[0]));
offlineSearch.setSource(Integer.parseInt(deviceTypeAndSource.split("-")[1]));
}
return vehicleMapper.findOfflineList(offlineSearch);
}
}
......@@ -483,6 +483,7 @@
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
left join t_device_location tdl on tdl.sn = tvd.sn
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="isOnLine != null">
<choose>
......@@ -526,6 +527,7 @@
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
left join t_device_location tdl on tdl.sn = td.sn
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="activeDateStart != null and activeDateStart != '' and activeDateEnd != null and activeDateEnd != ''">
and tvd.created_date between #{activeDateStart} and #{activeDateEnd}
......@@ -567,6 +569,7 @@
left join t_workorder tw on tw.id = tv.workorder_id and tw.del_flag = 0
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="orgId != null ">
and tu.id = #{orgId}
......@@ -591,6 +594,7 @@
left join t_workorder tw on tw.id = tv.workorder_id and tw.del_flag = 0
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="orgId != null ">
and tu.id = #{orgId}
......@@ -622,6 +626,7 @@
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
left join t_device_location tdl on tdl.sn = td.sn
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="offlineStartTime != null and offlineStartTime != ''">
and ((tdl.last_gps_time &lt; #{offlineStartTime} and tdl.last_bs_time &lt; #{offlineStartTime}
......@@ -634,6 +639,9 @@
<if test="orgId != null ">
and tu.id = #{orgId}
</if>
<if test="deviceType != null ">
and td.device_type = #{deviceType}
</if>
<if test="source != null ">
and td.source = #{source}
</if>
......@@ -659,6 +667,7 @@
left join t_workorder tw on tw.id = tv.workorder_id and tw.del_flag = 0
left join t_user tu on tu.id = tv.created_by and tu.del_flag = 0
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="orgId != null ">
and tu.id = #{orgId}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!