Commit 04f6991e authored by 王晓倩's avatar 王晓倩

泽宏云设备信息推送接口调整

parent 28fd5aa1
...@@ -9,6 +9,7 @@ import java.util.List; ...@@ -9,6 +9,7 @@ import java.util.List;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.BeanUtil;
import com.zehong.common.enums.ResultEnum; import com.zehong.common.enums.ResultEnum;
import com.zehong.common.exception.IOCException; import com.zehong.common.exception.IOCException;
import com.zehong.system.domain.TDetectorReportData; import com.zehong.system.domain.TDetectorReportData;
...@@ -21,6 +22,7 @@ import com.zehong.system.service.ITDetectorReportDataService; ...@@ -21,6 +22,7 @@ import com.zehong.system.service.ITDetectorReportDataService;
import com.zehong.system.service.ITDetectorUserService; import com.zehong.system.service.ITDetectorUserService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -181,7 +183,7 @@ public class TDetectorInfoController extends BaseController ...@@ -181,7 +183,7 @@ public class TDetectorInfoController extends BaseController
} }
TDetectorInfo tDetectorInfo = new TDetectorInfo(); TDetectorInfo tDetectorInfo = new TDetectorInfo();
tDetectorInfo.setUserId(tDetectorUser.getUserId()); tDetectorInfo.setUserId(tDetectorUserList.get(0).getUserId());
tDetectorInfo.setDetectorName(deviceName); tDetectorInfo.setDetectorName(deviceName);
tDetectorInfo.setDetectorCode(deviceNo); tDetectorInfo.setDetectorCode(deviceNo);
tDetectorInfo.setDetectorType(deviceType); tDetectorInfo.setDetectorType(deviceType);
...@@ -214,6 +216,7 @@ public class TDetectorInfoController extends BaseController ...@@ -214,6 +216,7 @@ public class TDetectorInfoController extends BaseController
detector.setIsDel("0"); detector.setIsDel("0");
List<TDetectorInfo> detectorList = tDetectorInfoService.selectTDetectorInfoList(detector); List<TDetectorInfo> detectorList = tDetectorInfoService.selectTDetectorInfoList(detector);
if(detectorList.size() > 0){ if(detectorList.size() > 0){
tDetectorInfo.setDetectorId(detectorList.get(0).getDetectorId());
tDetectorInfoService.updateTDetectorInfo(tDetectorInfo); tDetectorInfoService.updateTDetectorInfo(tDetectorInfo);
continue; continue;
} }
...@@ -233,6 +236,7 @@ public class TDetectorInfoController extends BaseController ...@@ -233,6 +236,7 @@ public class TDetectorInfoController extends BaseController
deviceName = obj.getString("deviceName"); deviceName = obj.getString("deviceName");
deviceNo = obj.getString("deviceNo"); deviceNo = obj.getString("deviceNo");
deviceType = obj.getString("deviceType"); deviceType = obj.getString("deviceType");
medium = obj.getString("medium");
address = obj.getString("address"); address = obj.getString("address");
longitude = obj.getString("longitude"); longitude = obj.getString("longitude");
latitude = obj.getString("latitude"); latitude = obj.getString("latitude");
...@@ -268,6 +272,9 @@ public class TDetectorInfoController extends BaseController ...@@ -268,6 +272,9 @@ public class TDetectorInfoController extends BaseController
if(!"".equals(deviceName)) { if(!"".equals(deviceName)) {
tDetectorInfo.setDetectorName(deviceName); tDetectorInfo.setDetectorName(deviceName);
} }
if(!"".equals(medium)) {
tDetectorInfo.setMedium(medium);
}
if(!"".equals(address)) { if(!"".equals(address)) {
tDetectorInfo.setDetectorAddr(address); tDetectorInfo.setDetectorAddr(address);
} }
......
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