Commit fe7adea4 authored by Carit Zhu's avatar Carit Zhu 🎱

Fix the gatewayName "null" error for getWarehouseData interface.

parent 2e4c3dd1
Pipeline #495 passed with stage
in 0 seconds
package com.example.tdl.web; package com.example.tdl.web;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.example.tdl.domain.dto.CommFeedback; import com.example.tdl.domain.dto.CommFeedback;
...@@ -12,7 +11,6 @@ import com.example.tdl.service.redis.InfoRedisService; ...@@ -12,7 +11,6 @@ import com.example.tdl.service.redis.InfoRedisService;
import com.example.tdl.service.redis.TokenRedisService; import com.example.tdl.service.redis.TokenRedisService;
import com.example.tdl.util.AlarmRule; import com.example.tdl.util.AlarmRule;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.sun.org.apache.regexp.internal.RE;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -26,10 +24,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -26,10 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import retrofit2.http.POST;
import javax.print.DocFlavor;
import javax.print.attribute.standard.RequestingUserName;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
......
...@@ -1006,7 +1006,7 @@ public class WarehouseController { ...@@ -1006,7 +1006,7 @@ public class WarehouseController {
} }
List<WarehouseGatewayDateVo> warehouseGatewayDateVoList=new ArrayList<>(); List<WarehouseGatewayDateVo> warehouseGatewayDateVoList=new ArrayList<>();
List<GatewayOnLineVo> gatewayOnLineVos=gatewayService.getByWarehouseNo(warehouseVo.getWarehouseNo()); List<GatewayOnLineVo> gatewayOnLineVos=gatewayService.getByWarehouseNo(warehouseVo.getWarehouseNo());
Long endTime = System.currentTimeMillis() +2*24*3600*1000l; Long endTime = System.currentTimeMillis() + 2 * 24 * 3600 * 1000L;
for (int a=0;a<gatewayOnLineVos.size();a++){ for (int a=0;a<gatewayOnLineVos.size();a++){
if(gatewayOnLineVos.get(a) == null){ if(gatewayOnLineVos.get(a) == null){
continue; continue;
...@@ -1038,7 +1038,7 @@ public class WarehouseController { ...@@ -1038,7 +1038,7 @@ public class WarehouseController {
}else{ }else{
warehouseGatewayDateVo.setState(6); warehouseGatewayDateVo.setState(6);
} }
//List<String> tdls=tdlDeviceService.getByGatewaySN(gatewayOnLineVos.get(a).getgSN(),gatewayOnLineVos.get(a).getType());
List<TDLDeviceVo> tdlDeviceVoList = tdlDeviceService.getTdlByGatewaySN( List<TDLDeviceVo> tdlDeviceVoList = tdlDeviceService.getTdlByGatewaySN(
gatewayOnLineVos.get(a).getgSN(),gatewayOnLineVos.get(a).getType()); gatewayOnLineVos.get(a).getgSN(),gatewayOnLineVos.get(a).getType());
List<WarehouseDataVo> warehouseDataVos=new ArrayList<>(); List<WarehouseDataVo> warehouseDataVos=new ArrayList<>();
......
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
<!--根据仓库编号查询网关信息--> <!--根据仓库编号查询网关信息-->
<select id="getByWarehouseNo" parameterType="String" resultType="com.example.tdl.domain.vo.GatewayOnLineVo"> <select id="getByWarehouseNo" parameterType="String" resultType="com.example.tdl.domain.vo.GatewayOnLineVo">
SELECT DISTINCT gatewaySN gSN, gatewayType type,createTime startTime SELECT DISTINCT tgl.gatewaySN gSN, tgl.gatewayType type, g.name, tgl.createTime startTime
from tdl_gateway_log from tdl_gateway_log tgl inner join gateway g on tgl.gatewaySN = g.SN and tgl.gatewayType = g.type
where warehouseNo=#{warehouseNo,jdbcType=VARCHAR} where warehouseNo=#{warehouseNo,jdbcType=VARCHAR}
and ISNULL(endTime) and ISNULL(endTime)
GROUP BY gSN GROUP BY gSN
......
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