Commit 85400688 authored by zhuangzhuang's avatar zhuangzhuang

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

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