物联设备页面和接口优化
This commit is contained in:
parent
b56ce2e7b9
commit
fa7b9ce15a
|
|
@ -282,13 +282,13 @@
|
|||
|
||||
<select id="previewList" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select a.*,b.nu_name from (
|
||||
select id,nu_id,device_index,device_model,device_type,device_status,dimension from nu_iot_tplink_camera
|
||||
select id,nu_id,device_index,mac as sn,device_model,device_type,device_status,dimension from nu_iot_tplink_camera
|
||||
union all
|
||||
select id,nu_id,cid as device_index,'' as device_model,'sb' as device_type,relay_state as device_status,'' as dimension from nu_iot_tq_water_meter
|
||||
select id,nu_id,cid as device_index,cid as sn,'' as device_model,'sb' as device_type,relay_state as device_status,dimension from nu_iot_tq_water_meter
|
||||
union all
|
||||
select id,nu_id,cid as device_index,'' as device_model,'db' as device_type,relay_state as device_status,'' as dimension from nu_iot_tq_electricity_meter
|
||||
select id,nu_id,sn as device_index,sn,'' as device_model,'db' as device_type,relay_state as device_status,dimension from nu_iot_ds_electricity_meter
|
||||
union all
|
||||
select id,nu_id,sn as device_index,'' as device_model,'wsdj' as device_type,status as device_status,'' as dimension from nu_iot_yiweilian_humid_device
|
||||
select id,nu_id,sn as device_index,sn,'' as device_model,'wsdj' as device_type,status as device_status,dimension from nu_iot_yiweilian_humid_device
|
||||
) a
|
||||
left join nu_base_info b on a.nu_id = b.nu_id
|
||||
<where>
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
if ("0".equals(errorCode)) {
|
||||
JSONObject image = (JSONObject) responseData.get("image");
|
||||
JSONObject data = (JSONObject) image.get(type);
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
return Result.OK(data);
|
||||
} else {
|
||||
String errorMsg = "";
|
||||
|
|
@ -481,7 +481,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getImageCommon:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getImageCommon:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -552,7 +552,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getImageCommon:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -564,7 +564,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setImageCommon:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -609,7 +609,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
if("0".equals(errorCode)){
|
||||
JSONObject image = (JSONObject)responseData.get("image");
|
||||
JSONObject data = (JSONObject)image.get(type);
|
||||
updateDeviceStatus(id,errorCode);
|
||||
// updateDeviceStatus(id,errorCode);
|
||||
return Result.OK(data);
|
||||
}else{
|
||||
String errorMsg = "";
|
||||
|
|
@ -619,7 +619,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}catch (Exception e){
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id,errorCode);
|
||||
// updateDeviceStatus(id,errorCode);
|
||||
log.info("getImageCommon:{}",errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -631,7 +631,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}catch (Exception e){
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id,errCode);
|
||||
// updateDeviceStatus(id,errCode);
|
||||
log.info("getImageCommon:{}",errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -698,7 +698,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}catch (Exception e){
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id,errorCode);
|
||||
// updateDeviceStatus(id,errorCode);
|
||||
log.info("setImageCommon:{}",errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -710,7 +710,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}catch (Exception e){
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id,errCode);
|
||||
// updateDeviceStatus(id,errCode);
|
||||
log.info("setImageCommon:{}",errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -755,7 +755,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getOsdCapability:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -767,7 +767,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getOsdCapability:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -812,7 +812,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getOsd:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -824,7 +824,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getOsd:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -883,7 +883,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("setOsd:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -895,7 +895,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setOsd:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1120,7 +1120,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getVideoParams:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1132,7 +1132,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getVideoParams:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1206,7 +1206,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("setVideoParams:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1218,7 +1218,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setVideoParams:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1263,7 +1263,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("configRecovery:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1275,7 +1275,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("configRecovery:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1346,6 +1346,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
map.put("backupUrl", backupUrl);
|
||||
map.put("wsUrl", wsUrl);
|
||||
map.put("wssUrl", wssUrl);
|
||||
updateDeviceStatus(id, errorCode);
|
||||
} else if (errorCode.equals("-80703")) {
|
||||
try {
|
||||
sleep(1000);
|
||||
|
|
@ -1361,9 +1362,10 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
log.info("getPreviewUrl:{}", errorMsg);
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -1721,7 +1723,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getTamperDet:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1733,7 +1735,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getTamperDet:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1783,7 +1785,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getTamperDet:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1795,7 +1797,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getTamperDet:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1839,7 +1841,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("setTamperDet:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1851,7 +1853,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setTamperDet:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1907,7 +1909,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getTamperNotif:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1919,7 +1921,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getTamperNotif:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -1967,7 +1969,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("setTamperNotif:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -1979,7 +1981,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setTamperNotif:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -2024,7 +2026,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("testAudio:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -2036,7 +2038,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("testAudio:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -2088,7 +2090,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getAlarmInfo:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -2100,7 +2102,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getAlarmInfo:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -2150,7 +2152,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("setAlarmInfo:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -2162,7 +2164,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("setAlarmInfo:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -2228,7 +2230,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(id, errorCode);
|
||||
// updateDeviceStatus(id, errorCode);
|
||||
log.info("getAlarmPlan:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -2240,7 +2242,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errCode;
|
||||
}
|
||||
updateDeviceStatus(id, errCode);
|
||||
// updateDeviceStatus(id, errCode);
|
||||
log.info("getAlarmPlan:{}", errMsg);
|
||||
return Result.error(errMsg);
|
||||
}
|
||||
|
|
@ -2413,7 +2415,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(deviceIndex, errorCode);
|
||||
// updateDeviceStatus(deviceIndex, errorCode);
|
||||
log.info("searchVideo:{}", errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -2480,7 +2482,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
// updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
map.put("error", errorCode);
|
||||
log.info("getStoragesById:{}", errorMsg);
|
||||
}
|
||||
|
|
@ -2540,7 +2542,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
// updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
map.put("error", errorCode);
|
||||
log.info("addPlaybackChn:{}", errorMsg);
|
||||
}
|
||||
|
|
@ -2639,7 +2641,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getVideoDevId(), errorCode);
|
||||
// updateDeviceStatus(cameraInfo.getVideoDevId(), errorCode);
|
||||
map.put("error", errorCode);
|
||||
log.info("getPlaybackUrl:{}", errorMsg);
|
||||
}
|
||||
|
|
@ -2735,7 +2737,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(videoDevId, errorCode);
|
||||
// updateDeviceStatus(videoDevId, errorCode);
|
||||
log.info("deletePlaybackChn:{}", errMsg);
|
||||
}
|
||||
}
|
||||
|
|
@ -2863,7 +2865,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getVideoDevId(), errorCode);
|
||||
// updateDeviceStatus(cameraInfo.getVideoDevId(), errorCode);
|
||||
map.put("error", errorCode);
|
||||
log.info("getMultitransUrl:{}", errorMsg);
|
||||
}
|
||||
|
|
@ -2894,7 +2896,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = multitransError;
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getVideoDevId(), multitransError);
|
||||
// updateDeviceStatus(cameraInfo.getVideoDevId(), multitransError);
|
||||
errorMsgs = errorMsgs + "<div>获取nvmp设备双向通信URL:" + errorMsg + "</div>";
|
||||
return Result.error(errorMsgs);
|
||||
}
|
||||
|
|
@ -2976,7 +2978,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
} catch (Exception e) {
|
||||
errorMsg = errorCode;
|
||||
}
|
||||
updateDeviceStatus(deviceIndex, errorCode);
|
||||
// updateDeviceStatus(deviceIndex, errorCode);
|
||||
log.info("uploadToServer:{}-{}", errorCode, errorMsg);
|
||||
return Result.error(errorMsg);
|
||||
}
|
||||
|
|
@ -3085,7 +3087,7 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
errMsg = errorCode;
|
||||
}
|
||||
}
|
||||
updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
// updateDeviceStatus(cameraInfo.getDeviceIndex(), errorCode);
|
||||
log.info("motionCtrl:{}-{}", errorCode, errMsg);
|
||||
return Result.OK("到达极限,无法继续移动");
|
||||
// return Result.error(errMsg);
|
||||
|
|
|
|||
|
|
@ -454,9 +454,10 @@ public class TumsApi {
|
|||
* @return
|
||||
*/
|
||||
public String getPreviewUrl(String jsonRequest){
|
||||
log.info("getPreviewUrl:request:{}",jsonRequest);
|
||||
this.createTumsClient();
|
||||
String jsonResponse = tumsClient.request(jsonRequest, ApiEnum.IPC_GET_PREVIEW_URL.getValue());
|
||||
// log.info("getPreviewUrl:{}",jsonResponse);
|
||||
log.info("getPreviewUrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,16 +18,22 @@
|
|||
resolve_status as resolveStatus,
|
||||
resolve_remark as resolveRemark
|
||||
from nu_iot_tq_api_request_log
|
||||
where opr_id = #{oprId}
|
||||
<if test="cid!=null and cid !=''">
|
||||
and cid = #{cid}
|
||||
</if>
|
||||
<if test="address!=null and address !=''">
|
||||
and address = #{address}
|
||||
</if>
|
||||
<if test="type!=null and type !=''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<where>
|
||||
<if test="oprId!=null and oprId !=''">
|
||||
opr_id = #{oprId}
|
||||
</if>
|
||||
<if test="cid!=null and cid !=''">
|
||||
and cid = #{cid}
|
||||
</if>
|
||||
<if test="address!=null and address !=''">
|
||||
and address = #{address}
|
||||
</if>
|
||||
<if test="type!=null and type !=''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nu.modules.tq.common.entity.TqApiLog">
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
set
|
||||
ele_value = #{eleValue},
|
||||
relay_state = #{relayState},
|
||||
remark = #{remark},
|
||||
read_time = #{readTime},
|
||||
update_time = now()
|
||||
where sn = #{sn}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -89,10 +89,18 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
*/
|
||||
@Override
|
||||
public Result<String> eleReset(ElectricityMeter electricityMeter) {
|
||||
ElectricityMeter entity = baseMapper.getElectricityMeter(electricityMeter);
|
||||
String deviceId = electricityMeter.getSn();
|
||||
MqttMessageHandler.DownlinkMessage message = mqttPublisherParams.getResetParams(deviceId);
|
||||
try {
|
||||
mqttMessageHandler.publishDownlinkMessage(deviceId,message);
|
||||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setCid(deviceId);
|
||||
tqApiLog.setType(9);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus("清零中");
|
||||
logService.insert(tqApiLog);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -124,17 +132,23 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
Integer type = electricityMeter.getType();
|
||||
ElectricityMeter entity = baseMapper.getElectricityMeter(electricityMeter);
|
||||
if (entity == null) {
|
||||
if (type.equals("10")) {
|
||||
if (type==10) {
|
||||
return Result.error("请先同步电表设备信息后再进行拉闸");
|
||||
} else {
|
||||
return Result.error("请先同步电表设备信息后再进行合闸");
|
||||
}
|
||||
}
|
||||
if (type.equals("10")) {
|
||||
if (type==10) {
|
||||
String deviceId = electricityMeter.getSn();
|
||||
MqttMessageHandler.DownlinkMessage message = mqttPublisherParams.getCutOffParams(deviceId);
|
||||
try {
|
||||
mqttMessageHandler.publishDownlinkMessage(deviceId,message);
|
||||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setCid(deviceId);
|
||||
tqApiLog.setType(type);
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus("拉闸中");
|
||||
logService.insert(tqApiLog);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -143,11 +157,17 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
MqttMessageHandler.DownlinkMessage message = mqttPublisherParams.getConnectedParams(deviceId);
|
||||
try {
|
||||
mqttMessageHandler.publishDownlinkMessage(deviceId,message);
|
||||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setCid(deviceId);
|
||||
tqApiLog.setType(type);
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus("合闸中");
|
||||
logService.insert(tqApiLog);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(type.equals("10")){
|
||||
if(type==10){
|
||||
return Result.OK("拉闸中,请1分钟后刷新页面");
|
||||
}else{
|
||||
return Result.OK("合闸中,请1分钟后刷新页面");
|
||||
|
|
@ -190,10 +210,18 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
*/
|
||||
@Override
|
||||
public Result<String> eleRead(ElectricityMeter electricityMeter) {
|
||||
ElectricityMeter entity = baseMapper.getElectricityMeter(electricityMeter);
|
||||
String deviceId = electricityMeter.getSn();
|
||||
MqttMessageHandler.DownlinkMessage message = mqttPublisherParams.getReadingParams(deviceId);
|
||||
try {
|
||||
mqttMessageHandler.publishDownlinkMessage(deviceId,message);
|
||||
TqApiLog tqApiLog = new TqApiLog();
|
||||
tqApiLog.setCid(deviceId);
|
||||
tqApiLog.setType(3);
|
||||
tqApiLog.setRequestValue(entity.getEleValue());
|
||||
tqApiLog.setRequestTime(DateUtil.now());
|
||||
tqApiLog.setRequestStatus("抄表中");
|
||||
logService.insert(tqApiLog);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -342,6 +370,19 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
entity901.setRelayState(relayState901);
|
||||
entity901.setReadTime(DateUtil.now());
|
||||
baseMapper.update(entity901);
|
||||
|
||||
TqApiLog tqApiLog901 = new TqApiLog();
|
||||
tqApiLog901.setCid(sn);
|
||||
tqApiLog901.setType(3);
|
||||
tqApiLog901.setResolveValue(eleValue901);
|
||||
tqApiLog901.setResolveTime(DateUtil.now());
|
||||
tqApiLog901.setResolveStatus("抄表成功");
|
||||
TqApiLog logEntity901 = logService.getApiLog(tqApiLog901);
|
||||
if (logEntity901 != null) {
|
||||
tqApiLog901.setId(logEntity901.getId());
|
||||
logService.update(tqApiLog901);
|
||||
}
|
||||
|
||||
break;
|
||||
case "902":
|
||||
// 拉闸合闸
|
||||
|
|
@ -353,12 +394,26 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
// eleRead(dme902);
|
||||
ElectricityMeter entity902 = baseMapper.getElectricityMeter(dme902);
|
||||
if(entity902!=null){
|
||||
TqApiLog tqApiLog902 = new TqApiLog();
|
||||
if(entity902.getRelayState().equals("0")){
|
||||
entity902.setRelayState("1");
|
||||
tqApiLog902.setType(11);
|
||||
tqApiLog902.setResolveStatus("合闸成功");
|
||||
}else{
|
||||
entity902.setRelayState("0");
|
||||
tqApiLog902.setType(10);
|
||||
tqApiLog902.setResolveStatus("拉闸成功");
|
||||
}
|
||||
baseMapper.updateRelayState(entity902);
|
||||
|
||||
tqApiLog902.setCid(sn);
|
||||
tqApiLog902.setResolveTime(DateUtil.now());
|
||||
TqApiLog logEntity902 = logService.getApiLog(tqApiLog902);
|
||||
if (logEntity902 != null) {
|
||||
tqApiLog902.setId(logEntity902.getId());
|
||||
logService.update(tqApiLog902);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -373,6 +428,19 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
entity904.setEleValue("0");
|
||||
entity904.setReadTime(DateUtil.now());
|
||||
baseMapper.updateValue(entity904);
|
||||
|
||||
TqApiLog tqApiLog208 = new TqApiLog();
|
||||
tqApiLog208.setCid(sn);
|
||||
tqApiLog208.setType(9);
|
||||
tqApiLog208.setResolveValue("0");
|
||||
tqApiLog208.setResolveTime(DateUtil.now());
|
||||
tqApiLog208.setResolveStatus("清零成功");
|
||||
TqApiLog logEntity208 = logService.getApiLog(tqApiLog208);
|
||||
if (logEntity208 != null) {
|
||||
tqApiLog208.setId(logEntity208.getId());
|
||||
logService.update(tqApiLog208);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -120,6 +120,10 @@ public class IotSyncBizMQListener {
|
|||
cameraQw.eq("device_index",iotCameraInfoMQDto.getDeviceIndex());
|
||||
CameraInfo entity = cameraInfoService.getOne(cameraQw);
|
||||
if(entity!=null){
|
||||
if(entity.getNuId()==null||entity.getNuId().equals("")){
|
||||
entity.setNuId(iotCameraInfoMQDto.getNuId());
|
||||
cameraInfoService.updateById(entity);
|
||||
}
|
||||
if(iotCameraInfoMQDto.getMaintainStatus().equals(entity.getMaintainStatus())){
|
||||
statusMQDto.setMessage("忽略");
|
||||
}else{
|
||||
|
|
@ -190,6 +194,10 @@ public class IotSyncBizMQListener {
|
|||
electricityQw.eq("sn",iotElectricityMeterMQDto.getSn());
|
||||
ElectricityMeter entity = electricityMeterService.getOne(electricityQw);
|
||||
if(entity!=null){
|
||||
if(entity.getNuId()==null||entity.getNuId().equals("")){
|
||||
entity.setNuId(iotElectricityMeterMQDto.getNuId());
|
||||
electricityMeterService.updateById(entity);
|
||||
}
|
||||
if(iotElectricityMeterMQDto.getMaintainStatus().equals(entity.getMaintainStatus())){
|
||||
statusMQDto.setMessage("忽略");
|
||||
}else{
|
||||
|
|
@ -229,6 +237,10 @@ public class IotSyncBizMQListener {
|
|||
waterQw.eq("cid",iotWaterMeterMQDto.getCid());
|
||||
WaterMeter entity = waterMeterService.getOne(waterQw);
|
||||
if(entity!=null){
|
||||
if(entity.getNuId()==null||entity.getNuId().equals("")){
|
||||
entity.setNuId(iotWaterMeterMQDto.getNuId());
|
||||
waterMeterService.updateById(entity);
|
||||
}
|
||||
if(iotWaterMeterMQDto.getMaintainStatus().equals(entity.getMaintainStatus())){
|
||||
statusMQDto.setMessage("忽略");
|
||||
}else{
|
||||
|
|
@ -299,6 +311,10 @@ public class IotSyncBizMQListener {
|
|||
humidQw.eq("sn",iotHumidDeviceMQDto.getSn());
|
||||
HumidDevice entity = humidDeviceService.getOne(humidQw);
|
||||
if(entity!=null){
|
||||
if(entity.getNuId()==null||entity.getNuId().equals("")){
|
||||
entity.setNuId(iotHumidDeviceMQDto.getNuId());
|
||||
humidDeviceService.updateById(entity);
|
||||
}
|
||||
if(iotHumidDeviceMQDto.getMaintainStatus().equals(entity.getMaintainStatus())){
|
||||
statusMQDto.setMessage("忽略");
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
where nu_id = #{nuId}
|
||||
</update>
|
||||
<update id="updateSbsfElectricity">
|
||||
update nu_iot_tq_electricity_meter
|
||||
update nu_iot_ds_electricity_meter
|
||||
set nu_id = null
|
||||
where nu_id = #{nuId}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue