Commit eefdcf54 by levphon

Merge remote-tracking branch 'origin/develop' into develop

2 parents da5b4498 165e6ea6
......@@ -6,7 +6,7 @@ package cn.com.glsx.admin.common.enums;
* @author Yanglinlong
* @date 2021/12/20 14:36
*/
public class TypeConverseEunm {
public class TypeConverseEnum {
/**
* 设备类型枚举类
......@@ -308,6 +308,46 @@ public class TypeConverseEunm {
}
/**
* 调频类型枚举类
*/
public enum FreqTypeEnum {
/**
* 设备调频模式 0 追车模式;1 闹钟模式;2 星期模式;3 初始化模式
*/
CAR_CHASE_MODE(0, "追车模式"),
ALARM_MODE(1, "闹钟模式"),
WEEK_MODE(2, "星期模式"),
INITIALIZATION_MODE(3, "初始化模式");
private final Integer freqType;
private final String freqTypeStr;
FreqTypeEnum(Integer freqType, String freqTypeStr) {
this.freqType = freqType;
this.freqTypeStr = freqTypeStr;
}
public static String getStrByFreqType(Integer freqType) {
for (FreqTypeEnum freqTypeEnum : FreqTypeEnum.values()) {
if (freqTypeEnum.getFreqType().equals(freqType)) {
return freqTypeEnum.getFreqTypeStr();
}
}
return null;
}
public Integer getFreqType() {
return freqType;
}
public String getFreqTypeStr() {
return freqTypeStr;
}
}
/**
* 用户类型枚举类
*/
public enum UserTypeEnum {
......
......@@ -14,5 +14,11 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
List<DeviceFreq> selectBySn(@Param("sn") String sn);
/**
* 根据设备号获取调频记录
*
* @param sn 设备号
* @return
*/
List<DeviceFreqModel> getAdjFreqInfo(@Param("sn") String sn);
}
\ No newline at end of file
......@@ -94,4 +94,14 @@ public class DeviceFreqModel {
* 设备上点总个数
*/
private Integer devicePointTotal;
/**
* 用户类型
*/
private Integer userType;
/**
* 创建人
*/
private Long createdBy;
}
......@@ -211,4 +211,16 @@ public class VehicleInfoExport extends BaseOrgDto {
@ExcelIgnore
private String weekTimer;
/**
* 调频用户类型 1 web 2 小程序
*/
@ExcelIgnore
private Integer userType;
/**
* 调频创建人
*/
@ExcelIgnore
private Long freqCreatedBy;
}
package cn.com.glsx.admin.modules.multithread;
import cn.com.glsx.admin.common.constants.Constants;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.model.export.*;
import cn.com.glsx.admin.modules.model.param.JourneyDetailSearch;
import cn.com.glsx.admin.modules.remote.RemoteGpsBsService;
......@@ -12,7 +12,6 @@ import cn.com.glsx.devicemonitor.api.dto.response.GpsLocation;
import cn.com.glsx.devicemonitor.api.dto.response.JourneyDetailDTO;
import cn.com.glsx.devicemonitor.api.enums.DeviceTypeRelationEnum;
import cn.hutool.core.util.ObjectUtil;
import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.common.utils.DateUtils;
import com.glsx.warehouse.biz.mileage.response.Mileage;
import lombok.extern.slf4j.Slf4j;
......@@ -256,8 +255,8 @@ public class AsyncTasks {
offlineExport.setBsAlarmLat(bsLocation.getLat());
offlineExport.setBsAlarmAddress(bsLocation.getAddress());
}
offlineExport.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(offlineExport.getSource()));
offlineExport.setDeviceTypeStr(TypeConverseEunm.DeviceTypeEnum.getStrByDeviceType(offlineExport.getDeviceType()));
offlineExport.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(offlineExport.getSource()));
offlineExport.setDeviceTypeStr(TypeConverseEnum.DeviceTypeEnum.getStrByDeviceType(offlineExport.getDeviceType()));
}
});
} catch (Exception e) {
......
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import cn.com.glsx.admin.modules.model.export.DeviceActiveExprot;
import cn.com.glsx.admin.modules.model.param.DeviceActiveSearch;
......@@ -60,9 +60,9 @@ public class DeviceActiveService {
organizationApiService.drawAllLevel(deviceActiveList);
// 数字类型转换为字符串类型
deviceActiveList.forEach(deviceActiveExprot -> {
deviceActiveExprot.setDeviceTypeStr(TypeConverseEunm.DeviceTypeEnum.getStrByDeviceType(deviceActiveExprot.getDeviceType()));
deviceActiveExprot.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(deviceActiveExprot.getSource()));
deviceActiveExprot.setIsOnLineStr(TypeConverseEunm.OnLineEnum.getStrByonLineType(deviceActiveExprot.getIsOnLine()));
deviceActiveExprot.setDeviceTypeStr(TypeConverseEnum.DeviceTypeEnum.getStrByDeviceType(deviceActiveExprot.getDeviceType()));
deviceActiveExprot.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(deviceActiveExprot.getSource()));
deviceActiveExprot.setIsOnLineStr(TypeConverseEnum.OnLineEnum.getStrByonLineType(deviceActiveExprot.getIsOnLine()));
if (!StringUtils.isEmpty(deviceActiveExprot.getLng()) && !StringUtils.isEmpty(deviceActiveExprot.getLat())) {
deviceActiveExprot.setLngAndLat(deviceActiveExprot.getLng() + "," + deviceActiveExprot.getLat());
}
......@@ -88,9 +88,9 @@ public class DeviceActiveService {
organizationApiService.drawAllLevel(deviceActiveList);
// 数字类型转换为字符串类型
deviceActiveList.forEach(deviceActiveExprot -> {
deviceActiveExprot.setDeviceTypeStr(TypeConverseEunm.DeviceTypeEnum.getStrByDeviceType(deviceActiveExprot.getDeviceType()));
deviceActiveExprot.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(deviceActiveExprot.getSource()));
deviceActiveExprot.setIsOnLineStr(TypeConverseEunm.OnLineEnum.getStrByonLineType(deviceActiveExprot.getIsOnLine()));
deviceActiveExprot.setDeviceTypeStr(TypeConverseEnum.DeviceTypeEnum.getStrByDeviceType(deviceActiveExprot.getDeviceType()));
deviceActiveExprot.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(deviceActiveExprot.getSource()));
deviceActiveExprot.setIsOnLineStr(TypeConverseEnum.OnLineEnum.getStrByonLineType(deviceActiveExprot.getIsOnLine()));
if (!StringUtils.isEmpty(deviceActiveExprot.getLng()) && !StringUtils.isEmpty(deviceActiveExprot.getLat())) {
deviceActiveExprot.setLngAndLat(deviceActiveExprot.getLng() + "," + deviceActiveExprot.getLat());
}
......
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.common.enums.FakeOfficeReasonEnum;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.entity.FakeOfflineVin;
import cn.com.glsx.admin.modules.entity.WhitelistSn;
import cn.com.glsx.admin.modules.mapper.FakeOfflineVinMapper;
......@@ -86,7 +86,7 @@ public class FakeOfflineService extends AbstractCommonService {
}
search.setVinStrs(builder.substring(0, builder.toString().length() - 1));
// 获取查询结果
List<FakeOfficeExport> fakeOfficeList = buildFakeOfficeResult(search, reasonMap, TypeConverseEunm.SearchTypeEnum.SEARCH.getType());
List<FakeOfficeExport> fakeOfficeList = buildFakeOfficeResult(search, reasonMap, TypeConverseEnum.SearchTypeEnum.SEARCH.getType());
return new PageInfo(fakeOfficeList, (int) page.getTotal());
}
......@@ -106,7 +106,7 @@ public class FakeOfflineService extends AbstractCommonService {
// 仅对查询数据 批量获取定位数据
Map<String, GpsBsData> lastGpsBsBatchMap = Maps.newHashMap();
if (TypeConverseEunm.SearchTypeEnum.SEARCH.getType().equals(flag)) {
if (TypeConverseEnum.SearchTypeEnum.SEARCH.getType().equals(flag)) {
List<String> snList = fakeOfficeList.stream().
flatMap(fakeOfficeExport -> {
List<String> snsList = Arrays.asList(fakeOfficeExport.getSns().split(","));
......@@ -126,7 +126,7 @@ public class FakeOfflineService extends AbstractCommonService {
buildPredictAddr(fakeOfficeExport, vin);
}
// 仅对查询数据 设置是否有定位标记位
if (TypeConverseEunm.SearchTypeEnum.SEARCH.getType().equals(flag)) {
if (TypeConverseEnum.SearchTypeEnum.SEARCH.getType().equals(flag)) {
buildVehicleFlag(fakeOfficeExport, lastGpsBsBatchMap);
}
}
......@@ -194,7 +194,7 @@ public class FakeOfflineService extends AbstractCommonService {
}
search.setVinStrs(builder.toString().substring(0, builder.toString().length() - 1));
return buildFakeOfficeResult(search, reasonMap, TypeConverseEunm.SearchTypeEnum.EXPORT.getType());
return buildFakeOfficeResult(search, reasonMap, TypeConverseEnum.SearchTypeEnum.EXPORT.getType());
}
/**
......
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import cn.com.glsx.admin.modules.model.export.FinalPositioningExport;
import cn.com.glsx.admin.modules.model.param.FinalPositioningSearch;
......@@ -51,8 +51,8 @@ public class FinalPositioningService {
List<FinalPositioningExport> finalPositioningList = vehicleMapper.findFinalPositioningList(search);
finalPositioningList.forEach(finalPositioningExport -> {
finalPositioningExport.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(finalPositioningExport.getSource()));
finalPositioningExport.setDeviceTypeStr(TypeConverseEunm.DeviceTypeEnum.getStrByDeviceType(finalPositioningExport.getDeviceType()));
finalPositioningExport.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(finalPositioningExport.getSource()));
finalPositioningExport.setDeviceTypeStr(TypeConverseEnum.DeviceTypeEnum.getStrByDeviceType(finalPositioningExport.getDeviceType()));
});
parseGpsAndBs(finalPositioningList);
return finalPositioningList;
......
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import cn.com.glsx.admin.modules.model.export.JudgmentExport;
import cn.com.glsx.admin.modules.model.param.JudgmentSearch;
......@@ -68,16 +68,16 @@ public class JudgmentService extends AbstractCommonService {
if (judgmentExportTemp != null) {
JudgmentExport judgmentExport = new JudgmentExport();
BeanUtils.copyProperties(judgmentExportTemp, judgmentExport);
judgmentExport.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(judgmentExport.getSource()));
judgmentExport.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(judgmentExport.getSource()));
judgmentExport.setAlarmType(stuJudgeAlarm.getAlarmType());
judgmentExport.setAlarmTypeStr(TypeConverseEunm.AlarmTypeEnum.getStrByAlarmType(stuJudgeAlarm.getAlarmType()));
judgmentExport.setAlarmTypeStr(TypeConverseEnum.AlarmTypeEnum.getStrByAlarmType(stuJudgeAlarm.getAlarmType()));
judgmentExport.setAlarmStatus(stuJudgeAlarm.getAlarmStatus());
judgmentExport.setAlarmStatusStr(TypeConverseEunm.AlarmStatusEnum.getStrByAlarmStatus(stuJudgeAlarm.getAlarmStatus()));
judgmentExport.setAlarmStatusStr(TypeConverseEnum.AlarmStatusEnum.getStrByAlarmStatus(stuJudgeAlarm.getAlarmStatus()));
judgmentExport.setGeoCode(stuJudgeAlarm.getGeoCode());
judgmentExport.setAlarmAddress(stuJudgeAlarm.getAlarmAddress());
judgmentExport.setAlarmBeginTime(stuJudgeAlarm.getAlarmBeginTime());
judgmentExport.setAlarmEndTime(stuJudgeAlarm.getAlarmEndTime());
if (TypeConverseEunm.AlarmStatusEnum.TAKE_EFFECT.getAlarmStatus().equals(stuJudgeAlarm.getAlarmStatus())) {
if (TypeConverseEnum.AlarmStatusEnum.TAKE_EFFECT.getAlarmStatus().equals(stuJudgeAlarm.getAlarmStatus())) {
// 如果警情为生效警情 则将失效时间设备为 --
judgmentExport.setAlarmEndTime("--");
}
......@@ -118,16 +118,16 @@ public class JudgmentService extends AbstractCommonService {
if (judgmentExportTemp != null) {
JudgmentExport judgmentExport = new JudgmentExport();
BeanUtils.copyProperties(judgmentExportTemp, judgmentExport);
judgmentExport.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(judgmentExport.getSource()));
judgmentExport.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(judgmentExport.getSource()));
judgmentExport.setAlarmType(stuJudgeAlarm.getAlarmType());
judgmentExport.setAlarmTypeStr(TypeConverseEunm.AlarmTypeEnum.getStrByAlarmType(stuJudgeAlarm.getAlarmType()));
judgmentExport.setAlarmTypeStr(TypeConverseEnum.AlarmTypeEnum.getStrByAlarmType(stuJudgeAlarm.getAlarmType()));
judgmentExport.setAlarmStatus(stuJudgeAlarm.getAlarmStatus());
judgmentExport.setAlarmStatusStr(TypeConverseEunm.AlarmStatusEnum.getStrByAlarmStatus(stuJudgeAlarm.getAlarmStatus()));
judgmentExport.setAlarmStatusStr(TypeConverseEnum.AlarmStatusEnum.getStrByAlarmStatus(stuJudgeAlarm.getAlarmStatus()));
judgmentExport.setGeoCode(stuJudgeAlarm.getGeoCode());
judgmentExport.setAlarmAddress(stuJudgeAlarm.getAlarmAddress());
judgmentExport.setAlarmBeginTime(stuJudgeAlarm.getAlarmBeginTime());
judgmentExport.setAlarmEndTime(stuJudgeAlarm.getAlarmEndTime());
if (TypeConverseEunm.AlarmStatusEnum.TAKE_EFFECT.getAlarmStatus().equals(stuJudgeAlarm.getAlarmStatus())) {
if (TypeConverseEnum.AlarmStatusEnum.TAKE_EFFECT.getAlarmStatus().equals(stuJudgeAlarm.getAlarmStatus())) {
// 如果警情为生效警情 则将失效时间设备为 --
judgmentExport.setAlarmEndTime("--");
}
......
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.common.enums.TypeConverseEunm;
import cn.com.glsx.admin.common.enums.TypeConverseEnum;
import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import cn.com.glsx.admin.modules.model.export.CommonTearDownModelExport;
import cn.com.glsx.admin.modules.model.export.TearDownModelExport;
......@@ -223,13 +223,13 @@ public class TearDownAlarmSevice {
if (ObjectUtil.isNotNull(commonTearDownExport)) {
CommonTearDownModelExport commonTearDownModelExport = new CommonTearDownModelExport();
BeanUtils.copyProperties(commonTearDownExport, commonTearDownModelExport);
commonTearDownModelExport.setSourceStr(TypeConverseEunm.SourceEnum.getStrBySourceType(commonTearDownModelExport.getSource()));
commonTearDownModelExport.setSourceStr(TypeConverseEnum.SourceEnum.getStrBySourceType(commonTearDownModelExport.getSource()));
commonTearDownModelExport.setAlarmType(commonAlarmDto.getAlarmType());
commonTearDownModelExport.setAlarmTypeStr(TypeConverseEunm.AlarmRecTypeEnum.getStrByAlarmType(commonAlarmDto.getAlarmType()));
commonTearDownModelExport.setAlarmTypeStr(TypeConverseEnum.AlarmRecTypeEnum.getStrByAlarmType(commonAlarmDto.getAlarmType()));
commonTearDownModelExport.setAlarmStatus(commonAlarmDto.getStatus());
commonTearDownModelExport.setAlarmStatusStr(TypeConverseEunm.AlarmRecStatusEnum.getStrByAlarmStatus(commonAlarmDto.getStatus()));
commonTearDownModelExport.setAlarmStatusStr(TypeConverseEnum.AlarmRecStatusEnum.getStrByAlarmStatus(commonAlarmDto.getStatus()));
commonTearDownModelExport.setAlarmEffectTime(commonAlarmDto.getBeginTime());
String alarmCancelTime = (commonAlarmDto.getStatus()!=null && commonAlarmDto.getStatus().equals(TypeConverseEunm.AlarmRecStatusEnum.LOSE_EFFECTIVENESS.getAlarmStatus()))?commonAlarmDto.getLastTime():"--";
String alarmCancelTime = (commonAlarmDto.getStatus()!=null && commonAlarmDto.getStatus().equals(TypeConverseEnum.AlarmRecStatusEnum.LOSE_EFFECTIVENESS.getAlarmStatus()))?commonAlarmDto.getLastTime():"--";
commonTearDownModelExport.setAlarmCancelTime(alarmCancelTime);
commonTearDownModelExport.setAlarmLng(commonAlarmDto.getLng());
commonTearDownModelExport.setAlarmLat(commonAlarmDto.getLat());
......
......@@ -43,27 +43,25 @@
</select>
<select id="getAdjFreqInfo" resultType="cn.com.glsx.admin.modules.model.DeviceFreqModel">
SELECT tdf.battery_level AS batteryLevel,
LEFT(tdf.created_date, 19) AS createTime,
tdf.freq_type AS freqType,
LEFT(tv.created_date,19) AS activeTime,
SELECT tdf.battery_level AS batteryLevel ,
LEFT(tdf.created_date, 19) AS createTime ,
tdf.freq_type AS freqType ,
LEFT(tv.created_date,19) AS activeTime ,
tdf.channel ,
IF(tdf.user_type = 1, tu.username, tcula.username) AS operation,
tdf.catching_timer AS catchingTimer,
tdf.user_type AS userType ,
tdf.created_by AS createdBy ,
tdf.catching_timer AS catchingTimer ,
tdf.timer ,
tdf.week ,
tdf.week_timer AS weekTimer,
TIMESTAMPDIFF(MINUTE, tdf.created_date, tdf.updated_date) AS diffMinuteTime,
TIMESTAMPDIFF(DAY, tdf.created_date, tdf.updated_date) AS diffDayTime,
tdf.sn,
tdf.week_timer AS weekTimer ,
TIMESTAMPDIFF(MINUTE, tdf.created_date, tdf.updated_date) AS diffMinuteTime ,
TIMESTAMPDIFF(DAY, tdf.created_date, tdf.updated_date) AS diffDayTime ,
tdf.sn ,
tv.vin ,
tv.owner_name AS `name`,
tdf.`status` AS freqStatus
FROM t_device_freq tdf
LEFT JOIN t_vehicle tv ON tv.id = tdf.vehicle_id
LEFT JOIN t_user tu ON tu.id = tdf.created_by
LEFT JOIN t_cust_user_auth_rel tcuar ON tcuar.user_id = tdf.created_by and tcuar.auth_type = 'local'
LEFT JOIN t_cust_user_local_account tcula ON tcula.auth_id = tcuar.auth_id
WHERE tdf.sn = #{sn,jdbcType=VARCHAR}
AND tdf.status = 2
AND tdf.del_flag = 0
......
......@@ -556,29 +556,27 @@
tv.vehicle_usages vehicleUsages,
tv.created_date activateTime,
tv.settle_flag settleFlag,
ddf.`status` AS freqStatus,
LEFT(ddf.created_date, 19) AS freqTime,
ddf.freq_type AS freqType,
TIMESTAMPDIFF(DAY, ddf.created_date, ddf.updated_date) AS diffDayTime,
TIMESTAMPDIFF(MINUTE, ddf.created_date, ddf.updated_date) AS diffMinuteTime,
tdf.`status` AS freqStatus,
LEFT(tdf.created_date, 19) AS freqTime,
tdf.freq_type AS freqType,
TIMESTAMPDIFF(DAY, tdf.created_date, tdf.updated_date) AS diffDayTime,
TIMESTAMPDIFF(MINUTE, tdf.created_date, tdf.updated_date) AS diffMinuteTime,
tdp.soc AS batteryLevel,
ddf.catching_timer AS catchingTimer,
ddf.timer AS timer,
ddf.`week` AS `week`,
ddf.week_timer AS weekTimer,
tdf.catching_timer AS catchingTimer,
tdf.timer AS timer,
tdf.`week` AS `week`,
tdf.week_timer AS weekTimer,
tv.created_by createdBy,
tu2.username,
IF(ddf.user_type = 1, tu.username, tcula.username) AS operation
tdf.user_type AS userType,
tdf.created_by AS freqCreatedBy
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_workorder tw on tw.id = tv.workorder_id
left join t_device td on td.sn = tvd.sn
left join t_device_location tdl on tdl.sn = tvd.sn
left join t_device_power tdp on tdp.sn = tvd.sn and tvd.id = tdp.vd_id
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf on ddf.vehicle_id = tv.id and ddf.sn = td.sn
left join t_user tu on tu.id = ddf.created_by
left join t_cust_user_auth_rel tcuar on tcuar.user_id = ddf.created_by and tcuar.auth_type = 'local'
left join t_cust_user_local_account tcula on tcula.auth_id = tcuar.auth_id
left join (select * from (select * from t_device_freq order by created_date desc) temp group by temp.sn) tdf on tdf.vehicle_id = tv.id and tdf.sn = td.sn
left join t_user tu2 on tu2.id = tv.updated_by
where tv.del_flag = 0
and tvd.bind_status = 1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!