Commit f0d1c0c1 by 杨林龙

调试

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