Commit 85400688 authored by zhuangzhuang's avatar zhuangzhuang

3.23--修改数据查询的逻辑以及绑定tdl,解绑tdl

parent 497ef35e
...@@ -14,9 +14,9 @@ public class LocationMessageVo { ...@@ -14,9 +14,9 @@ public class LocationMessageVo {
private String endCity; private String endCity;
private String startTime; private Long startTime;
private String endTime; private Long endTime;
private Long alarmTime; private Long alarmTime;
...@@ -68,19 +68,19 @@ public class LocationMessageVo { ...@@ -68,19 +68,19 @@ public class LocationMessageVo {
this.endCity = endCity; this.endCity = endCity;
} }
public String getStartTime() { public Long getStartTime() {
return startTime; return startTime;
} }
public void setStartTime(String startTime) { public void setStartTime(Long startTime) {
this.startTime = startTime; this.startTime = startTime;
} }
public String getEndTime() { public Long getEndTime() {
return endTime; return endTime;
} }
public void setEndTime(String endTime) { public void setEndTime(Long endTime) {
this.endTime = endTime; this.endTime = endTime;
} }
......
package com.example.tdl.domain.vo;
public class ResultAlarmLog {
private String transportationNo;
private String routeName;
private String description;
private Float data;
private Long alarmTime;
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getRouteName() {
return routeName;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Float getData() {
return data;
}
public void setData(Float data) {
this.data = data;
}
public Long getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Long alarmTime) {
this.alarmTime = alarmTime;
}
}
...@@ -6,12 +6,12 @@ public class ResultCircuit { ...@@ -6,12 +6,12 @@ public class ResultCircuit {
private String startCity; private String startCity;
private String startTime; private Long startTime;
private String endCity; private String endCity;
private String endTime; private Long endTime;
private String gatewaySN; private String gatewaySN;
...@@ -19,7 +19,7 @@ public class ResultCircuit { ...@@ -19,7 +19,7 @@ public class ResultCircuit {
private String TDLSN; private String TDLSN;
private String BatteryVoltage; private String batteryVoltage;
private String lastTime; private String lastTime;
...@@ -43,11 +43,11 @@ public class ResultCircuit { ...@@ -43,11 +43,11 @@ public class ResultCircuit {
this.startCity = startCity; this.startCity = startCity;
} }
public String getStartTime() { public Long getStartTime() {
return startTime; return startTime;
} }
public void setStartTime(String startTime) { public void setStartTime(Long startTime) {
this.startTime = startTime; this.startTime = startTime;
} }
...@@ -59,11 +59,11 @@ public class ResultCircuit { ...@@ -59,11 +59,11 @@ public class ResultCircuit {
this.endCity = endCity; this.endCity = endCity;
} }
public String getEndTime() { public Long getEndTime() {
return endTime; return endTime;
} }
public void setEndTime(String endTime) { public void setEndTime(Long endTime) {
this.endTime = endTime; this.endTime = endTime;
} }
...@@ -92,11 +92,11 @@ public class ResultCircuit { ...@@ -92,11 +92,11 @@ public class ResultCircuit {
} }
public String getBatteryVoltage() { public String getBatteryVoltage() {
return BatteryVoltage; return batteryVoltage;
} }
public void setBatteryVoltage(String batteryVoltage) { public void setBatteryVoltage(String batteryVoltage) {
BatteryVoltage = batteryVoltage; this.batteryVoltage = batteryVoltage;
} }
public String getLastTime() { public String getLastTime() {
......
...@@ -15,7 +15,7 @@ public class ResultCircuitVo { ...@@ -15,7 +15,7 @@ public class ResultCircuitVo {
private String startAddress; private String startAddress;
private String startTime; private Long startTime;
private String endLongitude; private String endLongitude;
...@@ -25,7 +25,7 @@ public class ResultCircuitVo { ...@@ -25,7 +25,7 @@ public class ResultCircuitVo {
private String endAddress; private String endAddress;
private String endTime; private Long endTime;
private String transport; private String transport;
...@@ -43,34 +43,34 @@ public class ResultCircuitVo { ...@@ -43,34 +43,34 @@ public class ResultCircuitVo {
private String remark; private String remark;
private String createTime; private Long createTime;
private String evaluate; private String evaluate;
private String evaluateRemark; private String evaluateRemark;
public String getEvaluate() { public String getTransportationNo() {
return evaluate; return transportationNo;
} }
public void setEvaluate(String evaluate) { public void setTransportationNo(String transportationNo) {
this.evaluate = evaluate; this.transportationNo = transportationNo;
} }
public String getEvaluateRemark() { public String getRouteNumber() {
return evaluateRemark; return routeNumber;
} }
public void setEvaluateRemark(String evaluateRemark) { public void setRouteNumber(String routeNumber) {
this.evaluateRemark = evaluateRemark; this.routeNumber = routeNumber;
} }
public String getCreateTime() { public String getRouteName() {
return createTime; return routeName;
} }
public void setCreateTime(String createTime) { public void setRouteName(String routeName) {
this.createTime = createTime; this.routeName = routeName;
} }
public String getStartLongitude() { public String getStartLongitude() {
...@@ -89,6 +89,14 @@ public class ResultCircuitVo { ...@@ -89,6 +89,14 @@ public class ResultCircuitVo {
this.startLatitude = startLatitude; this.startLatitude = startLatitude;
} }
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getStartAddress() { public String getStartAddress() {
return startAddress; return startAddress;
} }
...@@ -97,6 +105,14 @@ public class ResultCircuitVo { ...@@ -97,6 +105,14 @@ public class ResultCircuitVo {
this.startAddress = startAddress; this.startAddress = startAddress;
} }
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public String getEndLongitude() { public String getEndLongitude() {
return endLongitude; return endLongitude;
} }
...@@ -113,6 +129,14 @@ public class ResultCircuitVo { ...@@ -113,6 +129,14 @@ public class ResultCircuitVo {
this.endLatitude = endLatitude; this.endLatitude = endLatitude;
} }
public String getEndCity() {
return endCity;
}
public void setEndCity(String endCity) {
this.endCity = endCity;
}
public String getEndAddress() { public String getEndAddress() {
return endAddress; return endAddress;
} }
...@@ -121,6 +145,14 @@ public class ResultCircuitVo { ...@@ -121,6 +145,14 @@ public class ResultCircuitVo {
this.endAddress = endAddress; this.endAddress = endAddress;
} }
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public String getTransport() { public String getTransport() {
return transport; return transport;
} }
...@@ -129,6 +161,14 @@ public class ResultCircuitVo { ...@@ -129,6 +161,14 @@ public class ResultCircuitVo {
this.transport = transport; this.transport = transport;
} }
public String getAlarmType() {
return alarmType;
}
public void setAlarmType(String alarmType) {
this.alarmType = alarmType;
}
public String getBoxNo() { public String getBoxNo() {
return boxNo; return boxNo;
} }
...@@ -161,83 +201,43 @@ public class ResultCircuitVo { ...@@ -161,83 +201,43 @@ public class ResultCircuitVo {
this.transportationType = transportationType; this.transportationType = transportationType;
} }
public String getRemark() { public int getCircuitState() {
return remark; return circuitState;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getRouteNumber() {
return routeNumber;
}
public void setRouteNumber(String routeNumber) {
this.routeNumber = routeNumber;
}
public String getRouteName() {
return routeName;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getStartCity() {
return startCity;
}
public void setStartCity(String startCity) {
this.startCity = startCity;
}
public String getStartTime() {
return startTime;
} }
public void setStartTime(String startTime) { public void setCircuitState(int circuitState) {
this.startTime = startTime; this.circuitState = circuitState;
} }
public String getEndCity() { public String getRemark() {
return endCity; return remark;
} }
public void setEndCity(String endCity) { public void setRemark(String remark) {
this.endCity = endCity; this.remark = remark;
} }
public String getEndTime() { public Long getCreateTime() {
return endTime; return createTime;
} }
public void setEndTime(String endTime) { public void setCreateTime(Long createTime) {
this.endTime = endTime; this.createTime = createTime;
} }
public String getAlarmType() { public String getEvaluate() {
return alarmType; return evaluate;
} }
public void setAlarmType(String alarmType) { public void setEvaluate(String evaluate) {
this.alarmType = alarmType; this.evaluate = evaluate;
} }
public int getCircuitState() { public String getEvaluateRemark() {
return circuitState; return evaluateRemark;
} }
public void setCircuitState(int circuitState) { public void setEvaluateRemark(String evaluateRemark) {
this.circuitState = circuitState; this.evaluateRemark = evaluateRemark;
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.example.tdl.mapper; ...@@ -2,6 +2,7 @@ package com.example.tdl.mapper;
import com.example.tdl.domain.vo.AddAlarmLogVo; import com.example.tdl.domain.vo.AddAlarmLogVo;
import com.example.tdl.domain.vo.AlarmLogVo; import com.example.tdl.domain.vo.AlarmLogVo;
import com.example.tdl.domain.vo.ResultAlarmLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -17,7 +18,7 @@ public interface AlarmLogMapper { ...@@ -17,7 +18,7 @@ public interface AlarmLogMapper {
//新增报警数据 //新增报警数据
int addAlarmLog(AddAlarmLogVo addAlarmLogVo); int addAlarmLog(AddAlarmLogVo addAlarmLogVo);
List<AlarmLogVo> getByTransportationNo(String transportationNo); List<ResultAlarmLog> getByTransportationNo(String transportationNo);
Integer getCount(); Integer getCount();
} }
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.ResultGatewayVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TDLLogMapper {
ResultGatewayVo getByNo(String transportationNo);
}
...@@ -11,6 +11,7 @@ import com.google.gson.Gson; ...@@ -11,6 +11,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException; import com.google.gson.JsonSyntaxException;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.*; import org.eclipse.paho.client.mqttv3.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.expression.spel.ast.NullLiteral; import org.springframework.expression.spel.ast.NullLiteral;
...@@ -179,7 +180,7 @@ public class MqttListener implements MqttCallback { ...@@ -179,7 +180,7 @@ public class MqttListener implements MqttCallback {
//checkIn数据解析,true即发送休眠信息;false发送config信息 //checkIn数据解析,true即发送休眠信息;false发送config信息
public Integer parseData(String message,String SN,String Type){ public Integer parseData(String message,String SN,String Type){
CheckInVo checkInVo = new Gson().fromJson(message,CheckInVo.class); CheckInVo checkInVo = new Gson().fromJson(message,CheckInVo.class);
if(checkInVo.getDevList().size() == 0){ if(StringUtils.isEmpty(checkInVo.getDevList()==null ? "" :checkInVo.getDevList().toString())){
return 1;//重发 return 1;//重发
} }
//有设备信息 //有设备信息
......
...@@ -2,6 +2,7 @@ package com.example.tdl.service; ...@@ -2,6 +2,7 @@ package com.example.tdl.service;
import com.example.tdl.domain.vo.AddAlarmLogVo; import com.example.tdl.domain.vo.AddAlarmLogVo;
import com.example.tdl.domain.vo.AlarmLogVo; import com.example.tdl.domain.vo.AlarmLogVo;
import com.example.tdl.domain.vo.ResultAlarmLog;
import com.example.tdl.mapper.AlarmLogMapper; import com.example.tdl.mapper.AlarmLogMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -26,7 +27,7 @@ public class AlarmLogService { ...@@ -26,7 +27,7 @@ public class AlarmLogService {
return alarmLogMapper.addAlarmLog(addAlarmLogVo); return alarmLogMapper.addAlarmLog(addAlarmLogVo);
} }
public List<AlarmLogVo> getByTransportationNo(String transportationNo){ public List<ResultAlarmLog> getByTransportationNo(String transportationNo){
return alarmLogMapper.getByTransportationNo(transportationNo); return alarmLogMapper.getByTransportationNo(transportationNo);
} }
......
package com.example.tdl.service;
import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.mapper.TDLLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class TDLLogService {
@Autowired
private TDLLogMapper tdlLogMapper;
public ResultGatewayVo getByNo(String transportationNo){
return tdlLogMapper.getByNo(transportationNo);
}
}
...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service; ...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
@Service @Service
public class InfoRedisService extends RedisService { public class InfoRedisService extends RedisService {
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings({ "unchecked", "rawtypes" })
@Autowired @Autowired
public InfoRedisService(RedisTemplate infoRedisTemplate) { public InfoRedisService(RedisTemplate infoRedisTemplate) {
......
...@@ -230,7 +230,7 @@ public class CircuitController { ...@@ -230,7 +230,7 @@ public class CircuitController {
} }
if (StringUtils.isEmpty(addCircuitVo.getContainerNo())){ if (StringUtils.isEmpty(addCircuitVo.getContainerNo())){
fb.setCode(0); fb.setCode(0);
fb.setMessage("集装箱号不能为空"); fb.setMessage("集装箱号/车牌号不能为空");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (StringUtils.isEmpty(addCircuitVo.getDeliveryAddress())){ if (StringUtils.isEmpty(addCircuitVo.getDeliveryAddress())){
...@@ -506,7 +506,7 @@ public class CircuitController { ...@@ -506,7 +506,7 @@ public class CircuitController {
} }
if (StringUtils.isEmpty(updateCircuitInfo.getContainerNo())){ if (StringUtils.isEmpty(updateCircuitInfo.getContainerNo())){
fb.setCode(0); fb.setCode(0);
fb.setMessage("集装箱号不能为空"); fb.setMessage("集装箱号/车牌号不能为空");
return gson.toJson(fb); return gson.toJson(fb);
} }
if (StringUtils.isEmpty(updateCircuitInfo.getDeliveryAddress())){ if (StringUtils.isEmpty(updateCircuitInfo.getDeliveryAddress())){
......
...@@ -106,9 +106,6 @@ public class EquipmentBindingController { ...@@ -106,9 +106,6 @@ public class EquipmentBindingController {
return gson.toJson(fb); return gson.toJson(fb);
} }
@ApiOperation(value = "重置tdl",notes = "重置tdl") @ApiOperation(value = "重置tdl",notes = "重置tdl")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
...@@ -137,6 +134,7 @@ public class EquipmentBindingController { ...@@ -137,6 +134,7 @@ public class EquipmentBindingController {
map.put("message",gson.toJson(configCMDVo)); map.put("message",gson.toJson(configCMDVo));
map.put("untie",untie); map.put("untie",untie);
map.put("TDLSN",TDLSN); map.put("TDLSN",TDLSN);
map.put("endTime",System.currentTimeMillis());
configService.updateConfig(map); configService.updateConfig(map);
Map<Object,Object> msg=new HashMap<>(); Map<Object,Object> msg=new HashMap<>();
msg.put("msg",map.get("msg")); msg.put("msg",map.get("msg"));
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
select routeName,description,data,alarmTime from alarm_log order by alarmTime desc limit 10; select routeName,description,data,alarmTime from alarm_log order by alarmTime desc limit 10;
</select> </select>
<select id="getByTransportationNo" resultType="com.example.tdl.domain.vo.ResultAlarmLog" parameterType="String">
select transportationNo,routeName,description,data,alarmTime from alarm_log where transportationNo=#{transportationNo,jdbcType=VARCHAR};
</select>
<!--根据条件获取报警数据--> <!--根据条件获取报警数据-->
<select id="getAlarmLog" resultType="com.example.tdl.domain.vo.AlarmLogVo"> <select id="getAlarmLog" resultType="com.example.tdl.domain.vo.AlarmLogVo">
select routeName,description,data,alarmTime select routeName,description,data,alarmTime
...@@ -26,7 +30,6 @@ ...@@ -26,7 +30,6 @@
) )
</insert> </insert>
<select id="getCount" resultType="java.lang.Integer"> <select id="getCount" resultType="java.lang.Integer">
select count(DISTINCT transportationNo) from alarm_log select count(DISTINCT transportationNo) from alarm_log
</select> </select>
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#{message,mode=IN,jdbcType=VARCHAR}, #{message,mode=IN,jdbcType=VARCHAR},
#{untie,mode=IN,jdbcType=INTEGER}, #{untie,mode=IN,jdbcType=INTEGER},
#{TDLSN,mode=IN,jdbcType=VARCHAR}, #{TDLSN,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR} #{msg,mode=OUT,jdbcType=VARCHAR}
) )
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.tdl.mapper.TDLLogMapper">
<select id="getByNo" parameterType="String" resultType="com.example.tdl.domain.vo.ResultGatewayVo">
select gatewaySN SN,gatewayType type from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
GROUP BY gatewaySN
</select>
</mapper>
\ No newline at end of file
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<mapper resource="mapper/TopicMapper.xml"/> <mapper resource="mapper/TopicMapper.xml"/>
<mapper resource="mapper/TopicConfigMapper.xml"/> <mapper resource="mapper/TopicConfigMapper.xml"/>
<mapper resource="mapper/CityConfigMapper.xml"/> <mapper resource="mapper/CityConfigMapper.xml"/>
<mapper resource="mapper/TDLLogMapper.xml"/>
<mapper resource="mapper/UserRouteMapper.xml"/> <mapper resource="mapper/UserRouteMapper.xml"/>
</mappers> </mappers>
</configuration> </configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment