Commit 8ce43ef4 authored by zhuangzhuang's avatar zhuangzhuang

9.11-线路下载的时间问题,报警时间问题,线路折线图增加返回报警数据

parent 20241ea7
...@@ -183,6 +183,7 @@ public class WarehouseExcel { ...@@ -183,6 +183,7 @@ public class WarehouseExcel {
Long time=Long.valueOf(resultWarehouseNoAndTDLSNAndTimeVo.getDownloadWarehouseVos().get(i).getTime()); Long time=Long.valueOf(resultWarehouseNoAndTDLSNAndTimeVo.getDownloadWarehouseVos().get(i).getTime());
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date=new Date(time); Date date=new Date(time);
cell2 = row2.createCell(1); cell2 = row2.createCell(1);
cell2.setCellValue(date.getYear()); cell2.setCellValue(date.getYear());
cell2.setCellStyle(rowStyle); cell2.setCellStyle(rowStyle);
......
...@@ -4,10 +4,20 @@ import java.util.List; ...@@ -4,10 +4,20 @@ import java.util.List;
public class DeviceConfigVo { public class DeviceConfigVo {
private Integer Type;
private String config = "Config"; private String config = "Config";
private List<GConfigVo> configList; private List<GConfigVo> configList;
public Integer getType() {
return Type;
}
public void setType(Integer type) {
Type = type;
}
public String getConfig() { public String getConfig() {
return config; return config;
} }
...@@ -24,8 +34,16 @@ public class DeviceConfigVo { ...@@ -24,8 +34,16 @@ public class DeviceConfigVo {
this.configList = configList; this.configList = configList;
} }
@Override @Override
public String toString() { public String toString() {
return "{" + "\"" + config +"\"" + ":"+ configList + '}'; return "{" + "\"" +
"Type" +"\"" + ":"+ Type +
","+ "\"" + config +"\"" + ":"+ configList + '}';
} }
// @Override
// public String toString() {
// return "{" + "\"" + config +"\"" + ":"+ configList + '}';
// }
} }
...@@ -5,6 +5,8 @@ public class GatewaySNAndTypeVo { ...@@ -5,6 +5,8 @@ public class GatewaySNAndTypeVo {
private String type; private String type;
private Integer New;
public GatewaySNAndTypeVo() { public GatewaySNAndTypeVo() {
} }
...@@ -13,6 +15,21 @@ public class GatewaySNAndTypeVo { ...@@ -13,6 +15,21 @@ public class GatewaySNAndTypeVo {
this.type = type; this.type = type;
} }
public GatewaySNAndTypeVo(String SN, String type, Integer New) {
this.SN = SN;
this.type = type;
New = New;
}
public Integer getNew() {
return New;
}
public void setNew(Integer New) {
New = New;
}
public String getSN() { public String getSN() {
return SN; return SN;
} }
......
...@@ -11,6 +11,8 @@ public class HistoryDataVo { ...@@ -11,6 +11,8 @@ public class HistoryDataVo {
private List<HistoryData> dataList; private List<HistoryData> dataList;
private List<HistoryData> alarmList;
public String getTDLSN() { public String getTDLSN() {
return TDLSN; return TDLSN;
} }
...@@ -42,4 +44,12 @@ public class HistoryDataVo { ...@@ -42,4 +44,12 @@ public class HistoryDataVo {
public void setDataList(List<HistoryData> dataList) { public void setDataList(List<HistoryData> dataList) {
this.dataList = dataList; this.dataList = dataList;
} }
public List<HistoryData> getAlarmList() {
return alarmList;
}
public void setAlarmList(List<HistoryData> alarmList) {
this.alarmList = alarmList;
}
} }
...@@ -13,6 +13,8 @@ public class ResultGatewayVo { ...@@ -13,6 +13,8 @@ public class ResultGatewayVo {
private Integer useScene; private Integer useScene;
private Long createTime;
private String companyName; private String companyName;
public String getCompanyName() { public String getCompanyName() {
...@@ -70,4 +72,12 @@ public class ResultGatewayVo { ...@@ -70,4 +72,12 @@ public class ResultGatewayVo {
public void setUseScene(Integer useScene) { public void setUseScene(Integer useScene) {
this.useScene = useScene; this.useScene = useScene;
} }
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
} }
...@@ -34,4 +34,6 @@ public interface AlarmLogMapper { ...@@ -34,4 +34,6 @@ public interface AlarmLogMapper {
List<AlarmLogVo> getRealTimeAlarm(String companyNo); List<AlarmLogVo> getRealTimeAlarm(String companyNo);
Integer getAlarmCount(String companyNo); Integer getAlarmCount(String companyNo);
List<HistoryData> getValue(@Param("transportationNo")String transportationNo,@Param("TDLSN")String TDLSN ,@Param("classify")String classify);
} }
...@@ -60,4 +60,7 @@ public class AlarmLogService { ...@@ -60,4 +60,7 @@ public class AlarmLogService {
} }
public List<HistoryData> getValue(String transportationNo,String TDLSN ,String classify){
return alarmLogMapper.getValue(transportationNo,TDLSN,classify);
}
} }
package com.example.tdl.util; package com.example.tdl.util;
import com.example.tdl.domain.dto.CommFeedback; import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*; import com.example.tdl.domain.vo.*;
import com.example.tdl.service.AlarmLogService;
import com.example.tdl.service.CircuitService; import com.example.tdl.service.CircuitService;
//import com.example.tdl.service.InfluxDBService; //import com.example.tdl.service.InfluxDBService;
import com.example.tdl.service.TDLLogService; import com.example.tdl.service.TDLLogService;
import com.example.tdl.web.I18nController; import com.example.tdl.web.I18nController;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.apache.commons.lang3.StringUtils;
import org.influxdb.dto.Query; import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -28,9 +30,8 @@ public class DataUtil { ...@@ -28,9 +30,8 @@ public class DataUtil {
private static CommFeedback fb = new CommFeedback(); private static CommFeedback fb = new CommFeedback();
public static String getData(String transportationNo, HttpServletRequest request,I18nController i18n,String companyNo,CircuitService circuitService,TDLLogService tdlLogService,InfluxDBTemplate influxDBTemplate,String database,String field,String event ){ public static String getData(String transportationNo, HttpServletRequest request, I18nController i18n, String companyNo, CircuitService circuitService, TDLLogService tdlLogService, InfluxDBTemplate influxDBTemplate, String database, String field, String event, AlarmLogService alarmLogService,String classify){
Long t1 = System.currentTimeMillis(); Long t1 = System.currentTimeMillis();
logger.info(t1+"---------t1");
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo, companyNo); ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo, companyNo);
if (resultCircuitVo == null) { if (resultCircuitVo == null) {
fb.setCode(0); fb.setCode(0);
...@@ -63,6 +64,11 @@ public class DataUtil { ...@@ -63,6 +64,11 @@ public class DataUtil {
HistoryDataVo historyDataVo = new HistoryDataVo(); HistoryDataVo historyDataVo = new HistoryDataVo();
String TDLSN = devList.get(i).replace("TDL-", "").trim(); String TDLSN = devList.get(i).replace("TDL-", "").trim();
historyDataVo.setTDLSN(TDLSN); historyDataVo.setTDLSN(TDLSN);
List<HistoryData> alarmList =new ArrayList<>();
if(!StringUtils.isEmpty(classify)){
alarmList = alarmLogService.getValue(transportationNo,TDLSN,classify);
}
historyDataVo.setAlarmList(alarmList);
if("\"T\"".equals(field) || "\"h\"".equals(field)){ if("\"T\"".equals(field) || "\"h\"".equals(field)){
ResultAlarmVo resultAlarmVo = tdlLogService.getByTdl(transportationNo, TDLSN); ResultAlarmVo resultAlarmVo = tdlLogService.getByTdl(transportationNo, TDLSN);
//根据tdl货物报警信息 //根据tdl货物报警信息
...@@ -115,7 +121,6 @@ public class DataUtil { ...@@ -115,7 +121,6 @@ public class DataUtil {
historyDataVoList.add(historyDataVo); historyDataVoList.add(historyDataVo);
} }
} }
logger.info(System.currentTimeMillis()-t1+"_______");
return gson.toJson(historyDataVoList); return gson.toJson(historyDataVoList);
} }
...@@ -197,8 +202,6 @@ public class DataUtil { ...@@ -197,8 +202,6 @@ public class DataUtil {
public static List<HistoryData> getHistoryDatas(QueryResult queryResult, String alias) { public static List<HistoryData> getHistoryDatas(QueryResult queryResult, String alias) {
String dateResult = null; String dateResult = null;
List<List<Object>> value = new ArrayList<>(); List<List<Object>> value = new ArrayList<>();
Long t0 = System.currentTimeMillis();
logger.info(t0 +"-------t0");
for (QueryResult.Result result : queryResult.getResults()) { for (QueryResult.Result result : queryResult.getResults()) {
if (result.getSeries() != null) { if (result.getSeries() != null) {
for (QueryResult.Series series : result.getSeries()) { for (QueryResult.Series series : result.getSeries()) {
...@@ -212,8 +215,6 @@ public class DataUtil { ...@@ -212,8 +215,6 @@ public class DataUtil {
continue; continue;
} }
} }
Long tm = System.currentTimeMillis();
logger.info(System.currentTimeMillis()-t0 +"-------tm");
List<HistoryData> historyDataList = new ArrayList<>(); List<HistoryData> historyDataList = new ArrayList<>();
for (int i = 0; i < value.size(); i++) { for (int i = 0; i < value.size(); i++) {
HistoryData historyData = new HistoryData(); HistoryData historyData = new HistoryData();
...@@ -221,7 +222,6 @@ public class DataUtil { ...@@ -221,7 +222,6 @@ public class DataUtil {
historyData.setValue(value.get(i).get(1).toString()); historyData.setValue(value.get(i).get(1).toString());
historyDataList.add(historyData); historyDataList.add(historyData);
} }
logger.info(System.currentTimeMillis()-tm +"-------tn");
return historyDataList; return historyDataList;
} }
......
...@@ -208,7 +208,11 @@ public class AlarmLogController { ...@@ -208,7 +208,11 @@ public class AlarmLogController {
desp = "倾角" + map.get(addAlarmLogVo.getAlarm().get(i).getAlarmno()); desp = "倾角" + map.get(addAlarmLogVo.getAlarm().get(i).getAlarmno());
classify = "4"; classify = "4";
} }
AlarmLog alarmLog = new AlarmLog(transportationNo,resultCircuitVo.getStartCity(),resultCircuitVo.getEndCity(),addAlarmLogVo.getAlarm().get(i).getTdlsn().replace("TDL-","").trim(),desp,addAlarmLogVo.getAlarm().get(i).getValue(),addAlarmLogVo.getAlarm().get(i).getTs()*1000,classify,addAlarmLogVo.getAlarm().get(i).getDesp(),addAlarmLogVo.getAlarm().get(i).getAlarmno()); Long time = addAlarmLogVo.getAlarm().get(i).getTs();
if(time.toString().length() == 10){
time=time*1000;
}
AlarmLog alarmLog = new AlarmLog(transportationNo,resultCircuitVo.getStartCity(),resultCircuitVo.getEndCity(),addAlarmLogVo.getAlarm().get(i).getTdlsn().replace("TDL-","").trim(),desp,addAlarmLogVo.getAlarm().get(i).getValue(),time,classify,addAlarmLogVo.getAlarm().get(i).getDesp(),addAlarmLogVo.getAlarm().get(i).getAlarmno());
int a = alarmLogServcie.addAlarmLog(alarmLog); int a = alarmLogServcie.addAlarmLog(alarmLog);
if(a == 0){ if(a == 0){
fb.setCode(0); fb.setCode(0);
......
...@@ -80,6 +80,11 @@ public class DownloadController { ...@@ -80,6 +80,11 @@ public class DownloadController {
fb.setMessage(i18n.getMessage(request,"downloadEndTime")); fb.setMessage(i18n.getMessage(request,"downloadEndTime"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(downloadForWarehouseVo.getStopTime()<downloadForWarehouseVo.getStartTime()){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"downLoad"));
return gson.toJson(fb);
}
if (StringUtils.isEmpty(downloadForWarehouseVo.getWarehouseNo())){ if (StringUtils.isEmpty(downloadForWarehouseVo.getWarehouseNo())){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"warehouseNo")); fb.setMessage(i18n.getMessage(request,"warehouseNo"));
...@@ -93,15 +98,13 @@ public class DownloadController { ...@@ -93,15 +98,13 @@ public class DownloadController {
List<ResultWarehouseNoAndTDLSNAndTimeVo> resultWarehouseNoAndTDLSNAndTimeVos=tdlLogService.getByWarehouseNoAndTime(downloadForWarehouseVo); List<ResultWarehouseNoAndTDLSNAndTimeVo> resultWarehouseNoAndTDLSNAndTimeVos=tdlLogService.getByWarehouseNoAndTime(downloadForWarehouseVo);
if (resultWarehouseNoAndTDLSNAndTimeVos.size()==0){ if (resultWarehouseNoAndTDLSNAndTimeVos.size()==0){
fb.setCode(0); fb.setCode(0);
fb.setMessage("没有数据"); fb.setMessage(i18n.getMessage(request,"noData"));
return gson.toJson(fb); return gson.toJson(fb);
} }
File zipFile = new File("./export/" +downloadForWarehouseVo.getWarehouseNo()+"仓库温湿度观测记录.zip"); File zipFile = new File("./export/" +downloadForWarehouseVo.getWarehouseNo()+"仓库温湿度观测记录.zip");
File[] srcFiles = new File[resultWarehouseNoAndTDLSNAndTimeVos.size()]; File[] srcFiles = new File[resultWarehouseNoAndTDLSNAndTimeVos.size()];
for (int a=0;a<resultWarehouseNoAndTDLSNAndTimeVos.size();a++) { for (int a=0;a<resultWarehouseNoAndTDLSNAndTimeVos.size();a++) {
ResultWarehouseNoAndTDLSNAndTimeVo resultWarehouseNoAndTDLSNAndTimeVo=resultWarehouseNoAndTDLSNAndTimeVos.get(a); ResultWarehouseNoAndTDLSNAndTimeVo resultWarehouseNoAndTDLSNAndTimeVo=resultWarehouseNoAndTDLSNAndTimeVos.get(a);
String fileName =downloadForWarehouseVo.getWarehouseNo() + "仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN();
srcFiles[a] = new File("./export/"+fileName+".xls") ;
Long startTime = 0l; Long startTime = 0l;
Long stopTime = 0l; Long stopTime = 0l;
if(downloadForWarehouseVo.getStartTime() >=resultWarehouseNoAndTDLSNAndTimeVo.getCreateTime()){ if(downloadForWarehouseVo.getStartTime() >=resultWarehouseNoAndTDLSNAndTimeVo.getCreateTime()){
...@@ -110,9 +113,13 @@ public class DownloadController { ...@@ -110,9 +113,13 @@ public class DownloadController {
startTime = resultWarehouseNoAndTDLSNAndTimeVo.getCreateTime()*1000000l; startTime = resultWarehouseNoAndTDLSNAndTimeVo.getCreateTime()*1000000l;
} }
stopTime = downloadForWarehouseVo.getStopTime()*1000000l; stopTime = downloadForWarehouseVo.getStopTime()*1000000l;
String sqls = "SELECT \"b\", \"T\", \"h\" FROM \"tdl_policy\".\"" + resultWarehouseNoAndTDLSNAndTimeVo.getGatewayType() + "_" + resultWarehouseNoAndTDLSNAndTimeVo.getGatewaySN() + "\" WHERE (\"tdl\" = 'TDL-" + resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN() + "') and time >= " + startTime + " and time<= " + stopTime + " ORDER BY time "; String sqls = "SELECT \"b\", \"T\", \"h\" FROM \"tdl_policy\".\"" + resultWarehouseNoAndTDLSNAndTimeVo.getGatewayType() + "_" + resultWarehouseNoAndTDLSNAndTimeVo.getGatewaySN() + "\" WHERE (\"tdl\" = 'TDL-" + resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN() + "') and time >= " + startTime + " and time<= " + stopTime + " ORDER BY time ";
QueryResult queryResults = influxDBTemplate.query(new Query(sqls, database)); QueryResult queryResults = influxDBTemplate.query(new Query(sqls, database));
if(queryResults.getResults().get(0).getSeries()==null){
continue;
}
String fileName =downloadForWarehouseVo.getWarehouseNo() + "仓库温湿度观测记录表-"+resultWarehouseNoAndTDLSNAndTimeVo.getTDLSN();
srcFiles[a] = new File("./export/"+fileName+".xls") ;
List<DownloadWarehouseVo> downloadWarehouseVos = getWarehouseData(queryResults); List<DownloadWarehouseVo> downloadWarehouseVos = getWarehouseData(queryResults);
for (int i = 0; i < downloadWarehouseVos.size(); i++) { for (int i = 0; i < downloadWarehouseVos.size(); i++) {
if (downloadWarehouseVos.get(i).getTemperature() > resultWarehouseNoAndTDLSNAndTimeVos.get(a).getTemMax() || if (downloadWarehouseVos.get(i).getTemperature() > resultWarehouseNoAndTDLSNAndTimeVos.get(a).getTemMax() ||
...@@ -140,10 +147,15 @@ public class DownloadController { ...@@ -140,10 +147,15 @@ public class DownloadController {
e.printStackTrace(); e.printStackTrace();
logger.info(e.toString()); logger.info(e.toString());
fb.setCode(0); fb.setCode(0);
fb.setMessage("上传失败"); fb.setMessage(i18n.getMessage(request,"fileUpload"));
return gson.toJson(fb); return gson.toJson(fb);
} }
} }
if(srcFiles.length== 0){
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"noData"));
return gson.toJson(fb);
}
try { try {
ZipCompressUtil.zipFiles(srcFiles,zipFile); ZipCompressUtil.zipFiles(srcFiles,zipFile);
OSSClient ossClient = AliyunOSSClientUtil.getOSSClient(); OSSClient ossClient = AliyunOSSClientUtil.getOSSClient();
...@@ -158,13 +170,13 @@ public class DownloadController { ...@@ -158,13 +170,13 @@ public class DownloadController {
return gson.toJson(fb); return gson.toJson(fb);
} else { } else {
fb.setCode(0); fb.setCode(0);
fb.setMessage("上传失败"); fb.setMessage(i18n.getMessage(request,"fileUpload"));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.info(e.toString()); logger.info(e.toString());
fb.setCode(0); fb.setCode(0);
fb.setMessage("上传失败"); fb.setMessage(i18n.getMessage(request,"fileUpload"));
return gson.toJson(fb); return gson.toJson(fb);
} }
return gson.toJson(fb); return gson.toJson(fb);
......
...@@ -349,6 +349,15 @@ public class GatewayController { ...@@ -349,6 +349,15 @@ public class GatewayController {
return gson.toJson(fb); return gson.toJson(fb);
} }
DeviceConfigVo deviceConfig = new DeviceConfigVo(); DeviceConfigVo deviceConfig = new DeviceConfigVo();
//获取网关创建时间
ResultGatewayVo resultGatewayVo = gatewayService.getBySNAndType(device.getSN(),device.getType());
Integer New = 0;
if(resultGatewayVo.getCreateTime()>1535940000000l){
deviceConfig.setType(1);
New =1;
}else{
deviceConfig.setType(0);
}
List<GConfigVo> configList = new ArrayList<>(); List<GConfigVo> configList = new ArrayList<>();
for (ResultProbesVo devChannel : list) { for (ResultProbesVo devChannel : list) {
GConfigVo con = new GConfigVo(devChannel.getPort(), devChannel.getUnit(), devChannel.getDescription(), devChannel.getAlias()); GConfigVo con = new GConfigVo(devChannel.getPort(), devChannel.getUnit(), devChannel.getDescription(), devChannel.getAlias());
...@@ -391,7 +400,7 @@ public class GatewayController { ...@@ -391,7 +400,7 @@ public class GatewayController {
infoRedisService.hmSet("PubTopic", device.getType() + "_" + device.getSN(), pubList.toString()); infoRedisService.hmSet("PubTopic", device.getType() + "_" + device.getSN(), pubList.toString());
if (device.getState() == 0) { if (device.getState() == 0) {
//挂载 //挂载
String sr = HttpRequester.sendPost(addmount, gson.toJson(new GatewaySNAndTypeVo(device.getSN(), device.getType()))); String sr = HttpRequester.sendPost(addmount, gson.toJson(new GatewaySNAndTypeVo(device.getSN(), device.getType(),New)));
device.setState(1); device.setState(1);
} else if (device.getState() == 1) { } else if (device.getState() == 1) {
//卸载 //卸载
......
...@@ -81,34 +81,34 @@ public class PicUploadController { ...@@ -81,34 +81,34 @@ public class PicUploadController {
if("truck".equals(imageType)){ if("truck".equals(imageType)){
if(sourceImg.getWidth()>90){ if(sourceImg.getWidth()>90){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"truckPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>60){ if(sourceImg.getHeight()>60){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"truckPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
}else if("warehouse".equals(imageType)){ }else if("warehouse".equals(imageType)){
if(sourceImg.getWidth()>150){ if(sourceImg.getWidth()>150){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"warePictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>120){ if(sourceImg.getHeight()>120){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"warePictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
}else if("company".equals(imageType)){ }else if("company".equals(imageType)){
if(sourceImg.getWidth()>24){ if(sourceImg.getWidth()>150){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"comPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>24){ if(sourceImg.getHeight()>200){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"comPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
} }
...@@ -193,34 +193,34 @@ public class PicUploadController { ...@@ -193,34 +193,34 @@ public class PicUploadController {
if("truck".equals(imageType)){ if("truck".equals(imageType)){
if(sourceImg.getWidth()>90){ if(sourceImg.getWidth()>90){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"truckPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>60){ if(sourceImg.getHeight()>60){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"truckPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
}else if("warehouse".equals(imageType)){ }else if("warehouse".equals(imageType)){
if(sourceImg.getWidth()>150){ if(sourceImg.getWidth()>150){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"warePictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>120){ if(sourceImg.getHeight()>120){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"warePictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
}else if("company".equals(imageType)){ }else if("company".equals(imageType)){
if(sourceImg.getWidth()>24){ if(sourceImg.getWidth()>150){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"comPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if(sourceImg.getHeight()>24){ if(sourceImg.getHeight()>200){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"pictureDimension")); fb.setMessage(i18n.getMessage(request,"comPictureDimension"));
return gson.toJson(fb); return gson.toJson(fb);
} }
} }
......
...@@ -292,4 +292,7 @@ fontColors=Font color cannot be empty ...@@ -292,4 +292,7 @@ fontColors=Font color cannot be empty
postCode=Zip code cannot be empty postCode=Zip code cannot be empty
wrongFontColors=The format of the font color cannot be empty wrongFontColors=The format of the font color cannot be empty
wrongThemeColors=The format of the theme color is incorrect wrongThemeColors=The format of the theme color is incorrect
comPictureDimension=Width*Height150*200
warePictureDimension=Width*Height150*120
truckPictureDimension=Width*Height90*60
...@@ -262,13 +262,18 @@ adminInoperable=\u7BA1\u7406\u5458\u89D2\u8272\u4E0D\u80FD\u64CD\u4F5C ...@@ -262,13 +262,18 @@ adminInoperable=\u7BA1\u7406\u5458\u89D2\u8272\u4E0D\u80FD\u64CD\u4F5C
#\u4ED3\u5E93\u6570\u636E\u4E0B\u8F7D #\u4ED3\u5E93\u6570\u636E\u4E0B\u8F7D
downloadStartTime=\u67E5\u8BE2\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A downloadStartTime=\u67E5\u8BE2\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A
downloadEndTime=\u67E5\u8BE2\u7ED3\u675F\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A downloadEndTime=\u67E5\u8BE2\u7ED3\u675F\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A
downLoad=\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4
noData = \u8FD9\u6BB5\u65F6\u95F4\u6CA1\u6709\u6570\u636E
fileUpload = \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25
#\u4F20\u611F\u5668 #\u4F20\u611F\u5668
TDL =\u4F20\u611F\u5668\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A TDL =\u4F20\u611F\u5668\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A
#\u56FE\u7247 #\u56FE\u7247
nonePicture= \u56FE\u7247\u4E0D\u80FD\u4E3A\u7A7A nonePicture= \u56FE\u7247\u4E0D\u80FD\u4E3A\u7A7A
pictureSize = \u4E0A\u4F20\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7500K\uFF01 pictureSize = \u4E0A\u4F20\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7500K\uFF01
pictureFormat = \u4E0A\u4F20\u56FE\u7247\u683C\u5F0F\u4E0D\u6B63\u786E pictureFormat = \u4E0A\u4F20\u56FE\u7247\u683C\u5F0F\u4E0D\u6B63\u786E
pictureDimension = \u4E0A\u4F20\u56FE\u7247\u5C3A\u5BF8\u4E0D\u6B63\u786E comPictureDimension =\u56FE\u7247\u5BBD\u9AD8\u6700\u5927\u4E3A150*200
warePictureDimension = \u56FE\u7247\u5BBD\u9AD8\u6700\u5927\u4E3A150*120
truckPictureDimension =\u56FE\u7247\u5BBD\u9AD8\u6700\u5927\u4E3A90*60
uploadFailure = \u4E0A\u4F20\u5931\u8D25 uploadFailure = \u4E0A\u4F20\u5931\u8D25
#\u89D2\u8272\u540D\u79F0 #\u89D2\u8272\u540D\u79F0
systemManage=\u7CFB\u7EDF\u7BA1\u7406\u5458 systemManage=\u7CFB\u7EDF\u7BA1\u7406\u5458
......
...@@ -125,4 +125,12 @@ ...@@ -125,4 +125,12 @@
</select> </select>
<select id="getValue" parameterType="java.lang.String" resultType="com.example.tdl.domain.vo.HistoryData">
select data as value ,alarmTime time from alarm_log where transportationNo=#{transportationNo,jdbcType=VARCHAR}
and TDLSN = #{TDLSN,jdbcType=VARCHAR}
and classify = #{classify,jdbcType=VARCHAR}
order by time
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</delete> </delete>
<select id="getBySNAndType" parameterType="String" resultType="com.example.tdl.domain.vo.ResultGatewayVo"> <select id="getBySNAndType" parameterType="String" resultType="com.example.tdl.domain.vo.ResultGatewayVo">
SELECT SN,name,type,g.state,bConfig,useScene,companyName SELECT SN,name,type,g.state,bConfig,useScene,companyName,g.createTime
from gateway g INNER JOIN company c on g.company_id=c.id from gateway g INNER JOIN company c on g.company_id=c.id
WHERE SN=#{SN,jdbcType=VARCHAR} WHERE SN=#{SN,jdbcType=VARCHAR}
AND type=#{type,jdbcType=VARCHAR} AND type=#{type,jdbcType=VARCHAR}
......
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