物联设备-删除无用代码
This commit is contained in:
parent
d4f460223d
commit
b7e597e21f
|
|
@ -1,277 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo;
|
||||
import com.nu.modules.iot.tplink.camerainfo.service.IAppCameraInfoService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: API-摄像头信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-01-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/iot/tplink/cameraInfo")
|
||||
@Slf4j
|
||||
public class AppCameraInfoController extends JeecgController<AppCameraInfo, IAppCameraInfoService> {
|
||||
@Autowired
|
||||
private IAppCameraInfoService service;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param CameraInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AppCameraInfo>> queryPageList(AppCameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<AppCameraInfo> page = new Page<AppCameraInfo>(pageNo, pageSize);
|
||||
IPage<AppCameraInfo> pageList = service.findPage(page, CameraInfo);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/nuList")
|
||||
public Result<IPage<AppCameraInfo>> queryNuPageList(AppCameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<AppCameraInfo> page = new Page<AppCameraInfo>(pageNo, pageSize);
|
||||
IPage<AppCameraInfo> pageList = service.findNuPage(page, CameraInfo);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getByNuId")
|
||||
public Result<AppCameraInfo> getByNuId(AppCameraInfo CameraInfo) {
|
||||
AppCameraInfo entity = service.getByNuId(CameraInfo);
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改摄像头信息
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/rebootDevice", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> rebootDevice(@RequestBody AppCameraInfo cameraInfo) {
|
||||
service.rebootDevice(cameraInfo);
|
||||
return Result.OK("重启成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画面基本信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getImageCommon")
|
||||
public Result<JSONObject> getImageCommon(@RequestBody Map<String,Object> map) {
|
||||
return service.getImageCommon(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置画面基本信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setImageCommon")
|
||||
public Result setImageCommon(@RequestBody Map<String,Object> map) {
|
||||
return service.setImageCommon(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSD参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getOsd")
|
||||
public Result<JSONObject> getOsd(@RequestBody Map<String,Object> map) {
|
||||
return service.getOsd(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置OSD参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setOsd")
|
||||
public Result<String> setOsd(@RequestBody Map<String,Object> map) {
|
||||
return service.setOsd(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取码率参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getVideoParams")
|
||||
public Result<JSONObject> getVideoParams(@RequestBody Map<String,Object> map) {
|
||||
return service.getVideoParams(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置码率参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setVideoParams")
|
||||
public Result setVideoParams(@RequestBody Map<String,Object> map) {
|
||||
return service.setVideoParams(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复画面默认值
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/configRecovery")
|
||||
public Result configRecovery(@RequestBody Map<String,Object> map) {
|
||||
return service.configRecovery(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头实时播放地址
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getPreviewUrl")
|
||||
public Result<Map<String,String>> getPreviewUrl(AppCameraInfo cameraInfo) {
|
||||
return service.getPreviewUrl(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报警声音试听
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/testAudio")
|
||||
public Result testAudio(@RequestBody Map<String,Object> map) {
|
||||
return service.testAudio(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索某天的录像数据
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/searchVideo")
|
||||
public Result<IPage<AppCameraInfo>> searchVideo(AppCameraInfo cameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
return service.searchVideo(pageNo, pageSize, cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头录像回放地址
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getPlaybackUrlList")
|
||||
public Result<Map<String,Object>> getPlaybackUrlList(AppCameraInfo cameraInfo) {
|
||||
return service.getPlaybackUrlList(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回放通道
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/deletePlaybackChn")
|
||||
public Result<String> deletePlaybackChn(AppCameraInfo cameraInfo) {
|
||||
return service.deletePlaybackChn(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头录像回放地址
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getMultitransUrl")
|
||||
public Result<Map<String,Object>> getMultitransUrl(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.getMultitransUrl(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回放视频转mp4上传
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/uploadToServer")
|
||||
public Result uploadToServer(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.uploadToServer(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止转存MP4上传任务
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/stopUploadToServer")
|
||||
public Result<String> stopUploadToServer(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.stopUploadToServer(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转存MP4上传任务进度
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getUploadToServerProcess")
|
||||
public Result getUploadToServerProcess(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.getUploadToServerProcess(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/motionCtrl")
|
||||
public Result motionCtrl(AppCameraInfo cameraInfo) throws Exception{
|
||||
return service.motionCtrl(cameraInfo);
|
||||
}
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody AppCameraInfo cameraInfo) {
|
||||
service.baoxiu(cameraInfo);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,303 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK摄像头信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-01-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tplink_camera")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tplink_camera对象", description="护理单元-物联管理-TPLINK摄像头信息")
|
||||
public class AppCameraInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
/**设备编码*/
|
||||
@Excel(name = "设备编码", width = 15)
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String sn;
|
||||
/**设备序号*/
|
||||
@Excel(name = "设备序号", width = 15)
|
||||
@ApiModelProperty(value = "设备序号")
|
||||
private String deviceIndex;
|
||||
/**设备名称*/
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
/**设备类型*/
|
||||
@Excel(name = "设备类型", width = 15)
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private String deviceType;
|
||||
/**设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中*/
|
||||
@Excel(name = "设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中", width = 15, dicCode = "tplink_status")
|
||||
@Dict(dicCode = "tplink_status")
|
||||
@ApiModelProperty(value = "设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中")
|
||||
private String deviceStatus;
|
||||
/**设备型号*/
|
||||
@Excel(name = "设备型号", width = 15)
|
||||
@ApiModelProperty(value = "设备型号")
|
||||
private String deviceModel;
|
||||
/**IP地址*/
|
||||
@Excel(name = "IP地址", width = 15)
|
||||
@ApiModelProperty(value = "IP地址")
|
||||
private String ip;
|
||||
/**MAC地址*/
|
||||
@Excel(name = "MAC地址", width = 15)
|
||||
@ApiModelProperty(value = "MAC地址")
|
||||
private String mac;
|
||||
/**分组ID*/
|
||||
@Excel(name = "分组ID", width = 15)
|
||||
@ApiModelProperty(value = "分组ID")
|
||||
private String regionId;
|
||||
/**分组名称*/
|
||||
@Excel(name = "分组名称", width = 15)
|
||||
@ApiModelProperty(value = "分组名称")
|
||||
private String regionName;
|
||||
/**父设备ID*/
|
||||
@Excel(name = "父设备ID", width = 15)
|
||||
@ApiModelProperty(value = "父设备ID")
|
||||
private String parentId;
|
||||
/**父设备名称*/
|
||||
@Excel(name = "父设备名称", width = 15)
|
||||
@ApiModelProperty(value = "父设备名称")
|
||||
private String parentDeviceName;
|
||||
/**项目ID*/
|
||||
@Excel(name = "项目ID", width = 15)
|
||||
@ApiModelProperty(value = "项目ID")
|
||||
private String projectId;
|
||||
/**项目名称*/
|
||||
@Excel(name = "项目名称", width = 15)
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
/**软件版本*/
|
||||
@Excel(name = "软件版本", width = 15)
|
||||
@ApiModelProperty(value = "软件版本")
|
||||
private String firmwareVer;
|
||||
/**硬件版本*/
|
||||
@Excel(name = "硬件版本", width = 15)
|
||||
@ApiModelProperty(value = "硬件版本")
|
||||
private String hardwareVer;
|
||||
/**用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有*/
|
||||
@Excel(name = "用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有", width = 15, dicCode = "tplink_manager_auth_type")
|
||||
@Dict(dicCode = "tplink_manager_auth_type")
|
||||
@ApiModelProperty(value = "用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有")
|
||||
private String managerAuthType;
|
||||
/**告警消息权限 1 有权限 -1 无权限*/
|
||||
@Excel(name = "告警消息权限 1 有权限 -1 无权限", width = 15, dicCode = "tplink_msg_auth_type")
|
||||
@Dict(dicCode = "tplink_msg_auth_type")
|
||||
@ApiModelProperty(value = "告警消息权限 1 有权限 -1 无权限")
|
||||
private String msgAuthType;
|
||||
/**扩展信息*/
|
||||
@Excel(name = "扩展信息", width = 15)
|
||||
@ApiModelProperty(value = "扩展信息")
|
||||
@TableField(exist = false)
|
||||
private JSONObject extend;
|
||||
/**国标编码*/
|
||||
@Excel(name = "国标编码", width = 15)
|
||||
@ApiModelProperty(value = "国标编码")
|
||||
private String sipCode;
|
||||
/**位置名称*/
|
||||
@Excel(name = "位置名称", width = 15)
|
||||
@ApiModelProperty(value = "位置名称")
|
||||
private String locationName;
|
||||
/**系统类型 public 通用 vms 监控 nms 网络 evcs 新能源充电桩 rms 客控 nbs 音箱 bas 楼控 ams 门禁 smart_agriculture 智慧农业 vps 停车管理 aaa 认证计费*/
|
||||
@Excel(name = "系统类型 public 通用 vms 监控 nms 网络 evcs 新能源充电桩 rms 客控 nbs 音箱 bas 楼控 ams 门禁 smart_agriculture 智慧农业 vps 停车管理 aaa 认证计费", width = 15, dicCode = "tplink_system_type")
|
||||
@Dict(dicCode = "tplink_system_type")
|
||||
@ApiModelProperty(value = "系统类型 public 通用 vms 监控 nms 网络 evcs 新能源充电桩 rms 客控 nbs 音箱 bas 楼控 ams 门禁 smart_agriculture 智慧农业 vps 停车管理 aaa 认证计费")
|
||||
private String systemType;
|
||||
/**协议类型*/
|
||||
@Excel(name = "协议类型", width = 15)
|
||||
@ApiModelProperty(value = "协议类型")
|
||||
private String protocol;
|
||||
/**置顶的时间*/
|
||||
@Excel(name = "用户设置置顶的时间,毫秒级时间戳", width = 15)
|
||||
@ApiModelProperty(value = "用户设置置顶的时间,毫秒级时间戳")
|
||||
@TableField(exist = false)
|
||||
private String topTime;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元ID")
|
||||
@Dict(dictTable ="nu_base_info",dicText = "nu_name",dicCode = "code")
|
||||
private String nuId;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
@TableField(exist = false)
|
||||
private String nuName;
|
||||
@ApiModelProperty(value = "码流类型 0 代表主码流,1 代码子码流")
|
||||
@TableField(exist = false)
|
||||
private int streamType;
|
||||
|
||||
/**
|
||||
* 能力集属性 ==>
|
||||
*/
|
||||
@ApiModelProperty(value = "运动检测")
|
||||
@TableField(exist = false)
|
||||
private String motionDetection;
|
||||
@ApiModelProperty(value = "视频封面")
|
||||
@TableField(exist = false)
|
||||
private String videoCover;
|
||||
@ApiModelProperty(value = "云台")
|
||||
@TableField(exist = false)
|
||||
private String ptz;
|
||||
@ApiModelProperty(value = "motor")
|
||||
@TableField(exist = false)
|
||||
private String motor;
|
||||
@ApiModelProperty(value = "smartCode")
|
||||
@TableField(exist = false)
|
||||
private String smartCode;
|
||||
@ApiModelProperty(value = "强制在H.264编码过程中生成IDR帧的函数")
|
||||
@TableField(exist = false)
|
||||
private String forceIdrFrame;
|
||||
@ApiModelProperty(value = "音频")
|
||||
@TableField(exist = false)
|
||||
private String audio;
|
||||
@ApiModelProperty(value = "本地存储")
|
||||
@TableField(exist = false)
|
||||
private String localStorage;
|
||||
@ApiModelProperty(value = "回放API本版")
|
||||
@TableField(exist = false)
|
||||
private String playbackApiVersionTwo;
|
||||
@ApiModelProperty(value = "多变性")
|
||||
@TableField(exist = false)
|
||||
private String multitrans;
|
||||
@ApiModelProperty(value = "客流")
|
||||
@TableField(exist = false)
|
||||
private String passengerFlow;
|
||||
@ApiModelProperty(value = "获取预览缩略图")
|
||||
@TableField(exist = false)
|
||||
private String getPreviewThumbnail;
|
||||
@ApiModelProperty(value = "JPG预览缩略图")
|
||||
@TableField(exist = false)
|
||||
private String previewThumbnailJpeg;
|
||||
@ApiModelProperty(value = "走廊")
|
||||
@TableField(exist = false)
|
||||
private String corridorMod;
|
||||
@ApiModelProperty(value = "背光共存")
|
||||
@TableField(exist = false)
|
||||
private String backlightCoexistence;
|
||||
/**
|
||||
* <== 能力集属性
|
||||
*/
|
||||
@ApiModelProperty(value = "查询日期")
|
||||
@TableField(exist = false)
|
||||
private String dataDate;
|
||||
@ApiModelProperty(value = "设备索引")
|
||||
@TableField(exist = false)
|
||||
private String videoDevId;
|
||||
@ApiModelProperty(value = "存储设备ID")
|
||||
@TableField(exist = false)
|
||||
private String storageDevId;
|
||||
@ApiModelProperty(value = "存储设备名称")
|
||||
@TableField(exist = false)
|
||||
private String storageDevName;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID,双摄IPC的全景摄像头,其值为0.双摄IPC的特写摄像头,其值为1")
|
||||
@TableField(exist = false)
|
||||
private String channelId;
|
||||
@ApiModelProperty(value = "当录像存在存储池中, 录像所属的nvs的ID")
|
||||
@TableField(exist = false)
|
||||
private String nvsIdInPoolList;
|
||||
@ApiModelProperty(value = "录像开始时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
@ApiModelProperty(value = "录像结束时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
@ApiModelProperty(value = "录像开始时间,YYYY-MM-DD HH:MI:SS")
|
||||
@TableField(exist = false)
|
||||
private String startTimeFt;
|
||||
@ApiModelProperty(value = "录像结束时间,YYYY-MM-DD HH:MI:SS")
|
||||
@TableField(exist = false)
|
||||
private String endTimeFt;
|
||||
@ApiModelProperty(value = "录像时长,HH:MI:SS")
|
||||
@TableField(exist = false)
|
||||
private String duration;
|
||||
@ApiModelProperty(value = "回放录像类型。1: 定时录像; 2: 移动侦测等")
|
||||
@TableField(exist = false)
|
||||
private String videoType;
|
||||
@ApiModelProperty(value = "录像片段大小,单位字节")
|
||||
@TableField(exist = false)
|
||||
private String size;
|
||||
@ApiModelProperty(value = "错误码")
|
||||
@TableField(exist = false)
|
||||
private String errorCode;
|
||||
@ApiModelProperty(value = "错误描述")
|
||||
@TableField(exist = false)
|
||||
private String errorMsg;
|
||||
@ApiModelProperty(value = "录像存储设备类型 -1:未找到,0:ipc,1:nvr,2:nvs:3:server,4:vcs,5:storagePool")
|
||||
@TableField(exist = false)
|
||||
private String storageType;
|
||||
@ApiModelProperty(value = "预览/回放url")
|
||||
@TableField(exist = false)
|
||||
private String url;
|
||||
@ApiModelProperty(value = "预览/回放备用url")
|
||||
@TableField(exist = false)
|
||||
private String backupUrl;
|
||||
@ApiModelProperty(value = "ws连接传输视频地址")
|
||||
@TableField(exist = false)
|
||||
private String wsUrl;
|
||||
@ApiModelProperty(value = "wss接传输视频地址")
|
||||
@TableField(exist = false)
|
||||
private String wssUrl;
|
||||
@ApiModelProperty(value = "预览/回放通道对应的sessionId")
|
||||
@TableField(exist = false)
|
||||
private String sessionId;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID")
|
||||
@TableField(exist = false)
|
||||
private String videoChannelId;
|
||||
@ApiModelProperty(value = "回放速率")
|
||||
@TableField(exist = false)
|
||||
private String scale;
|
||||
@ApiModelProperty(value = "回放api访问前缀")
|
||||
@TableField(exist = false)
|
||||
private String queryAddress;
|
||||
@ApiModelProperty(value = "录像开关;枚举:[0:表示关,1:表示开]")
|
||||
@TableField(exist = false)
|
||||
private String recordSwitch;
|
||||
@ApiModelProperty(value = "任务taskId")
|
||||
@TableField(exist = false)
|
||||
private String taskId;
|
||||
@ApiModelProperty(value = "上传mp4文件名称")
|
||||
@TableField(exist = false)
|
||||
private String fileName;
|
||||
@ApiModelProperty(value = "上传进度")
|
||||
@TableField(exist = false)
|
||||
private String process;
|
||||
@ApiModelProperty(value = "移动方向;枚举:[0:左上,1:上,2:右上,3:左,4:持续水平转动,5:右,6:左下,7:下,8:右下,9:缩小画面,10:放大画面,11:聚焦近处,12:聚焦远处]")
|
||||
@TableField(exist = false)
|
||||
private String direction;
|
||||
@ApiModelProperty(value = "开始或停止移动;枚举:[0:停止,1:开始]")
|
||||
@TableField(exist = false)
|
||||
private String startOrNot;
|
||||
@ApiModelProperty(value = "球机移动速度")
|
||||
@TableField(exist = false)
|
||||
private String speed;
|
||||
|
||||
private String ftpIp; //回放视频转FTP上传IP
|
||||
private String ftpPort; //回放视频转FTP上传端口
|
||||
private String ftpUsername; //回放视频转FTP上传用户
|
||||
private String ftpPassword; //回放视频转FTP上传密码
|
||||
private String ftpUploadpath; //回放视频转FTP上传路径
|
||||
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK错误码
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tplink_error_code")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tplink_error_code对象", description="护理单元-物联管理-TPLINK错误码")
|
||||
public class AppErrorCode implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**错误码*/
|
||||
@Excel(name = "错误码", width = 15)
|
||||
@ApiModelProperty(value = "错误码")
|
||||
private String errorCode;
|
||||
/**错误描述*/
|
||||
@Excel(name = "错误描述", width = 15)
|
||||
@ApiModelProperty(value = "错误描述")
|
||||
private String errorMsg;
|
||||
|
||||
}
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK项目信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tplink_project")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tplink_project对象", description="护理单元-物联管理-TPLINK项目信息")
|
||||
public class AppProjectInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
/**项目ID*/
|
||||
@Excel(name = "项目ID", width = 15)
|
||||
@ApiModelProperty(value = "项目ID")
|
||||
private String projectId;
|
||||
/**项目名称*/
|
||||
@Excel(name = "项目名称", width = 15)
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
/**机构ID*/
|
||||
@Excel(name = "机构ID", width = 15)
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
@Dict(dicCode = "id" , dictTable = "sys_depart" , dicText = "depart_name")
|
||||
private String institutionId;
|
||||
/**创建时间戳,单位秒*/
|
||||
@ApiModelProperty(value = "创建时间戳,单位秒")
|
||||
private String createTime;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "创建时间,年月日时分秒")
|
||||
private String createTimeStr;
|
||||
/**设备数量*/
|
||||
@Excel(name = "设备数量", width = 15)
|
||||
@ApiModelProperty(value = "设备数量")
|
||||
private Integer deviceNum;
|
||||
/**消息数量*/
|
||||
@Excel(name = "消息数量", width = 15)
|
||||
@ApiModelProperty(value = "消息数量")
|
||||
private Integer messageNum;
|
||||
/**项目次序*/
|
||||
@Excel(name = "项目次序", width = 15)
|
||||
@ApiModelProperty(value = "项目次序")
|
||||
private Integer sort;
|
||||
/**项目次序,接口对应字段,在数据库中是关键字,数据库中用sort代替order*/
|
||||
@ApiModelProperty(value = "项目次序")
|
||||
@TableField(exist = false)
|
||||
private String order;
|
||||
/** 离线设备数*/
|
||||
@Excel(name = "离线设备数", width = 15)
|
||||
@ApiModelProperty(value = "离线设备数")
|
||||
private Integer offlineNum;
|
||||
/**异常设备数*/
|
||||
@Excel(name = "异常设备数", width = 15)
|
||||
@ApiModelProperty(value = "异常设备数")
|
||||
private Integer abnormalNum;
|
||||
/**未读消息数*/
|
||||
@Excel(name = "未读消息数", width = 15)
|
||||
@ApiModelProperty(value = "未读消息数")
|
||||
private Integer unreadMessageNum;
|
||||
/**nms设备总数*/
|
||||
@Excel(name = "nms设备总数", width = 15)
|
||||
@ApiModelProperty(value = "nms设备总数")
|
||||
private Integer totalNmsDevNum;
|
||||
/**vms设备总数*/
|
||||
@Excel(name = "vms设备总数", width = 15)
|
||||
@ApiModelProperty(value = "vms设备总数")
|
||||
private Integer totalVmsDevNum;
|
||||
/**nbs设备总数*/
|
||||
@Excel(name = "nbs设备总数", width = 15)
|
||||
@ApiModelProperty(value = "nbs设备总数")
|
||||
private Integer totalNbsDevNum;
|
||||
/**离线nms设备总数*/
|
||||
@Excel(name = "离线nms设备总数", width = 15)
|
||||
@ApiModelProperty(value = "离线nms设备总数")
|
||||
private Integer offlineNmsDevNum;
|
||||
/**离线vms设备总数*/
|
||||
@Excel(name = "离线vms设备总数", width = 15)
|
||||
@ApiModelProperty(value = "离线vms设备总数")
|
||||
private Integer offlineVmsDevNum;
|
||||
/**离线nbs设备总数*/
|
||||
@Excel(name = "离线nbs设备总数", width = 15)
|
||||
@ApiModelProperty(value = "离线nbs设备总数")
|
||||
private Integer offlineNbsDevNum;
|
||||
/**运行时间,单位s*/
|
||||
@Excel(name = "运行时间,单位s", width = 15)
|
||||
@ApiModelProperty(value = "运行时间,单位s")
|
||||
private Integer runningTime;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "运行天数")
|
||||
private String runningTimeStr;
|
||||
/**状态1正常 2冻结*/
|
||||
@Excel(name = "状态1正常 2冻结", width = 15)
|
||||
@ApiModelProperty(value = "状态1正常 2冻结")
|
||||
private Integer status;
|
||||
/**是否有叶子节点: 1是0否*/
|
||||
@Excel(name = "是否有叶子节点: 1是0否", width = 15)
|
||||
@ApiModelProperty(value = "是否有叶子节点: 1是0否")
|
||||
private Integer izLeaf;
|
||||
}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK分组信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-20
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tplink_region")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tplink_region对象", description="护理单元-物联管理-TPLINK分组信息")
|
||||
public class AppRegionInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
/**分组ID*/
|
||||
@Excel(name = "分组ID", width = 15)
|
||||
@ApiModelProperty(value = "分组ID")
|
||||
private String regionId;
|
||||
/**分组名称*/
|
||||
@Excel(name = "分组名称", width = 15)
|
||||
@ApiModelProperty(value = "分组名称")
|
||||
private String regionName;
|
||||
/**机构ID*/
|
||||
@Excel(name = "区域ID", width = 15)
|
||||
@ApiModelProperty(value = "区域ID")
|
||||
@Dict(dicCode = "id" , dictTable = "sys_depart" , dicText = "depart_name")
|
||||
private String areaId;
|
||||
@Excel(name = "机构ID", width = 15)
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
@Dict(dicCode = "id" , dictTable = "sys_depart" , dicText = "depart_name")
|
||||
private String institutionId;
|
||||
/**分组层级*/
|
||||
@Excel(name = "分组层级", width = 15)
|
||||
@ApiModelProperty(value = "分组层级")
|
||||
private String regionLevel;
|
||||
/**分组次序,接口对应字段,在数据库中是关键字,数据库中用sort代替order*/
|
||||
@ApiModelProperty(value = "项目次序")
|
||||
@TableField(exist = false)
|
||||
private String order;
|
||||
/**项目次序*/
|
||||
@Excel(name = "项目次序", width = 15)
|
||||
@ApiModelProperty(value = "项目次序")
|
||||
private Integer sort;
|
||||
/**父分组ID*/
|
||||
@Excel(name = "父分组ID", width = 15)
|
||||
@ApiModelProperty(value = "父分组ID")
|
||||
private String parentId;
|
||||
/**父分组ID*/
|
||||
@Excel(name = "父分组", width = 15)
|
||||
@ApiModelProperty(value = "父分组")
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
/**项目ID*/
|
||||
@Excel(name = "项目ID", width = 15)
|
||||
@ApiModelProperty(value = "项目ID")
|
||||
private String projectId;
|
||||
/**项目名称*/
|
||||
@Excel(name = "项目名称", width = 15)
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
/**系统类型*/
|
||||
@Excel(name = "系统类型", width = 15)
|
||||
@ApiModelProperty(value = "系统类型")
|
||||
private String sysType;
|
||||
/**流道*/
|
||||
@Excel(name = "流道", width = 15)
|
||||
@ApiModelProperty(value = "流道")
|
||||
private String streamWay;
|
||||
/**是否有子分组*/
|
||||
@Excel(name = "是否有子分组", width = 15)
|
||||
@ApiModelProperty(value = "是否有子分组 0无 1有")
|
||||
private String hasChildren;
|
||||
/**分组类型*/
|
||||
@Excel(name = "分组类型", width = 15)
|
||||
@ApiModelProperty(value = "分组类型")
|
||||
private String regionType;
|
||||
/**更新时间*/
|
||||
@Excel(name = "更新时间", width = 15)
|
||||
@ApiModelProperty(value = "更新时间,年月日时分秒")
|
||||
private String updateTime;
|
||||
/**流媒体服务器ID*/
|
||||
@Excel(name = "流媒体服务器ID", width = 15)
|
||||
@ApiModelProperty(value = "流媒体服务器ID")
|
||||
private String mediaServerId;
|
||||
/**备用流媒体服务器ID*/
|
||||
@Excel(name = "备用流媒体服务器ID", width = 15)
|
||||
@ApiModelProperty(value = "备用流媒体服务器ID")
|
||||
private String backupMediaServerId;
|
||||
/**绑定类型*/
|
||||
@Excel(name = "绑定类型", width = 15)
|
||||
@ApiModelProperty(value = "绑定类型 0:设备直接取流/流媒体转发模式,1: 自动模式")
|
||||
private String bindType;
|
||||
/**是否有叶子节点: 1是0否*/
|
||||
@Excel(name = "是否有叶子节点: 1是0否", width = 15)
|
||||
@ApiModelProperty(value = "是否有叶子节点: 1是0否")
|
||||
private Integer izLeaf;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK图门系统配置信息
|
||||
* @Author: caolei
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tplink_tums_base")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tplink_tums_base", description="护理单元-物联管理-TPLINK图门系统配置信息")
|
||||
public class AppTumsConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
private String tumsUrl; //获取图门系统地址
|
||||
// private String tumsProjectId; //图门系统登录项目ID
|
||||
// @TableField(exist = false)
|
||||
// private String tumsProjectName; //图门系统登录项目ID
|
||||
// private String tumsUserId; // 图门系统登录用户ID
|
||||
private String tumsUsername; // 获取图门系统用户
|
||||
private String tumsPassword; //获取图门系统密码
|
||||
// private String tumsRoleId; //图门系统角色ID
|
||||
private String ftpIp; //回放视频转FTP上传IP
|
||||
private String ftpPort; //回放视频转FTP上传端口
|
||||
private String ftpUsername; //回放视频转FTP上传用户
|
||||
private String ftpPassword; //回放视频转FTP上传密码
|
||||
private String ftpUploadpath; //回放视频转FTP上传路径
|
||||
private String updateDate; //更新时间
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 接口枚举类
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum AppApiEnum {
|
||||
//前缀对应相应设备的API,无前缀则是公用API
|
||||
//IPC 视频
|
||||
//NVS 存储服务器
|
||||
//AUDIO 音箱
|
||||
//ROUTER 路由器
|
||||
//SWITCH 交换机
|
||||
//AP 无线路由器
|
||||
//AC ⽆线控制器
|
||||
|
||||
GET_ENCRYPT_KEY_FOR_LOGIN("/tums/account/v1/getEncryptKeyForLogin","获取登录公钥"),
|
||||
LOGIN("/tums/account/v2/login","登录"),
|
||||
LOGOUT("/tums/account/v1/logout","注销"),
|
||||
SET_CURRENT_PROJECT("/tums/resource/v2/setCurrentProject","设置当前项目"),
|
||||
REBOOT_DEVICE_LIST("/tums/deviceManager/v2/rebootDeviceList","重启设备"),
|
||||
IPC_PASSTHROUGH("/tums/devConfig/v1/passthrough","设备配置信息"),
|
||||
IPC_ADD_PREVIEW_CHN("/tums/preview/v1/addPreviewChn","添加预览通道"),
|
||||
IPC_GET_PREVIEW_URL("/tums/preview/v1/getPreviewUrl","获取预览通道的url"),
|
||||
IPC_GET_PLAYBACK_URL("/tums/playback/v1/getPlaybackUrl","获取回放通道的url"),
|
||||
IPC_SUSPEND_PLAYBACK("/tums/playback/v1/suspendPlayback","暂停通道回放"),
|
||||
IPC_DELETE_PLAYBACK_CHN("/tums/playback/v1/deletePlaybackChn","删除回放通道"),
|
||||
IPC_GET_STORAGES_BY_ID("/tums/playback/v1/getStoragesById","获取指定监控点的存储设备列表"),
|
||||
IPC_SEARCH_VIDEO("/tums/playback/v3/searchVideo","搜索当天的录像数据V3"),
|
||||
IPC_ADD_PLAYBACK_CHN("/tums/playback/v2/addPlaybackChn","添加回放通道V2"),
|
||||
IPC_GET_MULTITRANS_URL("/tums/playback/v1/getMultitransUrl","获取nvmp设备双向通信URL"),
|
||||
IPC_UPLOAD_TO_SERVER("/tums/playback/v1/uploadToServer","回放视频转mp4上传"),
|
||||
IPC_STOP_UPLOAD_TO_SERVER("/tums/preview/v1/stopUploadToServer","停止转存MP4上传任务"),
|
||||
IPC_GET_UPLOAD_TO_SERVER_PROCESS("/tums/preview/v1/getUploadToServerProcess","获取转存MP4上传任务进度"),
|
||||
IPC_MOTION_CTRL("/tums/ptz/v1/motionCtrl","高速球机移动方向控制");
|
||||
|
||||
private final String value;//自定义属性,枚举值,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getValue();
|
||||
private final String remark;//自定义属性,枚举描述,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getRemark();
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-摄像头信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-01-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface AppCameraInfoMapper extends BaseMapper<AppCameraInfo> {
|
||||
IPage<AppCameraInfo> findPage(Page<AppCameraInfo> page, @Param("params") AppCameraInfo cameraInfo);
|
||||
List<AppCameraInfo> findAllList();
|
||||
IPage<AppCameraInfo> findNuPage(Page<AppCameraInfo> page, @Param("params") AppCameraInfo cameraInfo);
|
||||
AppCameraInfo getByDeviceId(AppCameraInfo cameraInfo);
|
||||
AppCameraInfo getByNuId(AppCameraInfo cameraInfo);
|
||||
AppCameraInfo getCapabilityByDeviceId(AppCameraInfo cameraInfo);
|
||||
void insertCapability(AppCameraInfo cameraInfo);
|
||||
void updateCapabilityById(AppCameraInfo cameraInfo);
|
||||
void updateDeviceStatusByDevId(AppCameraInfo cameraInfo);
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppErrorCode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-错误码
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface AppErrorCodeMapper extends BaseMapper<AppErrorCode> {
|
||||
AppErrorCode getByCode(String errorCode);
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppProjectInfo;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK项目信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AppProjectInfoMapper extends BaseMapper<AppProjectInfo> {
|
||||
void addProjectInfo(AppProjectInfo projectInfo);
|
||||
void deleteProjectInfo();
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppRegionInfo;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-TPLINK分组信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-20
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AppRegionInfoMapper extends BaseMapper<AppRegionInfo> {
|
||||
void addRegionInfo(AppRegionInfo regionInfo);
|
||||
void deleteRegionInfo();
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppTumsConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-配置信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface AppTumsConfigMapper extends BaseMapper<AppTumsConfig> {
|
||||
AppTumsConfig getByCode();
|
||||
void addConfig(AppTumsConfig appTumsConfig);
|
||||
void deleteConfig();
|
||||
}
|
||||
|
|
@ -1,256 +0,0 @@
|
|||
<?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.nu.modules.iot.tplink.camerainfo.mapper.AppCameraInfoMapper">
|
||||
|
||||
<select id="findPage" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select a.id,
|
||||
a.sn,
|
||||
a.device_index as deviceIndex,
|
||||
device_name as deviceName,
|
||||
device_type as deviceType,
|
||||
device_status as deviceStatus,
|
||||
device_model as deviceModel,
|
||||
ip as ip,
|
||||
mac as mac,
|
||||
region_id as regionId,
|
||||
region_name as regionName,
|
||||
parent_id as parentId,
|
||||
parent_device_name as parentDeviceName,
|
||||
project_id as projectId,
|
||||
project_name as projectName,
|
||||
firmware_ver as firmwareVer,
|
||||
hardware_ver as hardwareVer,
|
||||
manager_auth_type as managerAuthType,
|
||||
msg_auth_type as msgAuthType,
|
||||
sip_code as sipCode,
|
||||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
ifnull(c.multitrans,0) as multitrans
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
left join nu_iot_tplink_camera_capability c on a.device_index = c.device_index
|
||||
<where>
|
||||
<if test="params.deviceIndex != null and params.deviceIndex != ''">
|
||||
AND a.device_index = #{params.deviceIndex}
|
||||
</if>
|
||||
<if test="params.deviceStatus != null and params.deviceStatus != ''">
|
||||
AND a.device_status = #{params.deviceStatus}
|
||||
</if>
|
||||
<if test="params.deviceName != null and params.deviceName != ''">
|
||||
AND a.device_name = #{params.deviceName}
|
||||
</if>
|
||||
<if test="params.projectName != null and params.projectName != ''">
|
||||
AND a.project_name LIKE concat('%',#{params.projectName},'%')
|
||||
</if>
|
||||
<if test="params.regionName != null and params.regionName != ''">
|
||||
AND a.region_name LIKE concat('%',#{params.regionName},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
<if test="params.projectId != null and params.projectId != ''">
|
||||
AND a.project_id = #{params.projectId}
|
||||
</if>
|
||||
<if test="params.regionId != null and params.regionId != ''">
|
||||
AND a.region_id = #{params.regionId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findAllList" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select a.id,
|
||||
device_index as deviceIndex,
|
||||
device_name as deviceName,
|
||||
device_type as deviceType,
|
||||
device_status as deviceStatus,
|
||||
device_model as deviceModel,
|
||||
ip as ip,
|
||||
mac as mac,
|
||||
region_id as regionId,
|
||||
region_name as regionName,
|
||||
parent_id as parentId,
|
||||
parent_device_name as parentDeviceName,
|
||||
project_id as projectId,
|
||||
project_name as projectName,
|
||||
firmware_ver as firmwareVer,
|
||||
hardware_ver as hardwareVer,
|
||||
manager_auth_type as managerAuthType,
|
||||
msg_auth_type as msgAuthType,
|
||||
sip_code as sipCode,
|
||||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
nu_id as nuId
|
||||
from nu_iot_tplink_camera a
|
||||
</select>
|
||||
|
||||
<select id="findNuPage" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select
|
||||
nu_id as nuId,
|
||||
nu_name as nuName
|
||||
from nu_base_info b
|
||||
<where>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND b.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByDeviceId" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select a.id,
|
||||
device_index as deviceIndex,
|
||||
device_name as deviceName,
|
||||
device_type as deviceType,
|
||||
device_status as deviceStatus,
|
||||
device_model as deviceModel,
|
||||
ip as ip,
|
||||
mac as mac,
|
||||
region_id as regionId,
|
||||
region_name as regionName,
|
||||
parent_id as parentId,
|
||||
parent_device_name as parentDeviceName,
|
||||
project_id as projectId,
|
||||
project_name as projectName,
|
||||
firmware_ver as firmwareVer,
|
||||
hardware_ver as hardwareVer,
|
||||
manager_auth_type as managerAuthType,
|
||||
msg_auth_type as msgAuthType,
|
||||
sip_code as sipCode,
|
||||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
<select id="getByNuId" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select a.id,
|
||||
device_index as deviceIndex,
|
||||
device_name as deviceName,
|
||||
device_type as deviceType,
|
||||
device_status as deviceStatus,
|
||||
device_model as deviceModel,
|
||||
ip as ip,
|
||||
mac as mac,
|
||||
region_id as regionId,
|
||||
region_name as regionName,
|
||||
parent_id as parentId,
|
||||
parent_device_name as parentDeviceName,
|
||||
project_id as projectId,
|
||||
project_name as projectName,
|
||||
firmware_ver as firmwareVer,
|
||||
hardware_ver as hardwareVer,
|
||||
manager_auth_type as managerAuthType,
|
||||
msg_auth_type as msgAuthType,
|
||||
sip_code as sipCode,
|
||||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
where a.nu_id = #{nuId}
|
||||
</select>
|
||||
|
||||
<select id="getCapabilityByDeviceId" parameterType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo">
|
||||
select a.id,
|
||||
device_index as deviceIndex,
|
||||
motion_detection as motionDetection,
|
||||
video_cover as videoCover,
|
||||
ptz,
|
||||
motor,
|
||||
smart_code as smartCode,
|
||||
force_idr_frame as forceIdrFrame,
|
||||
audio,
|
||||
local_storage as localStorage,
|
||||
playback_api_version_two as playbackApiVersionTwo,
|
||||
multitrans,
|
||||
passenger_flow as passengerFlow,
|
||||
get_preview_thumbnail as getPreviewThumbnail,
|
||||
preview_thumbnail_jpeg as previewThumbnailJpeg,
|
||||
corridor_mod as corridorMod,
|
||||
backlight_coexistence as backlightCoexistence
|
||||
from nu_iot_tplink_camera_capability a
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
<insert id="insertCapability">
|
||||
insert into nu_iot_tplink_camera_capability (
|
||||
id,
|
||||
device_index,
|
||||
motion_detection,
|
||||
video_cover,
|
||||
ptz,
|
||||
motor,
|
||||
smart_code,
|
||||
force_idr_frame,
|
||||
audio,
|
||||
local_storage,
|
||||
playback_api_version_two,
|
||||
multitrans,
|
||||
passenger_flow,
|
||||
get_preview_thumbnail,
|
||||
preview_thumbnail_jpeg,
|
||||
corridor_mod,
|
||||
backlight_coexistence
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{deviceIndex},
|
||||
#{motionDetection},
|
||||
#{videoCover},
|
||||
#{ptz},
|
||||
#{motor},
|
||||
#{smartCode},
|
||||
#{forceIdrFrame},
|
||||
#{audio},
|
||||
#{localStorage},
|
||||
#{playbackApiVersionTwo},
|
||||
#{multitrans},
|
||||
#{passengerFlow},
|
||||
#{getPreviewThumbnail},
|
||||
#{previewThumbnailJpeg},
|
||||
#{corridorMod},
|
||||
#{backlightCoexistence}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateCapabilityById">
|
||||
UPDATE nu_iot_tplink_camera_capability
|
||||
SET
|
||||
device_index = #{deviceIndex},
|
||||
motion_detection = #{motionDetection},
|
||||
video_cover = #{videoCover},
|
||||
ptz = #{ptz},
|
||||
motor = #{motor},
|
||||
smart_code = #{smartCode},
|
||||
force_idr_frame = #{forceIdrFrame},
|
||||
audio = #{audio},
|
||||
local_storage = #{localStorage},
|
||||
playback_api_version_two = #{playbackApiVersionTwo},
|
||||
multitrans = #{multitrans},
|
||||
passenger_flow = #{passengerFlow},
|
||||
get_preview_thumbnail = #{getPreviewThumbnail},
|
||||
preview_thumbnail_jpeg = #{previewThumbnailJpeg},
|
||||
corridor_mod = #{corridorMod},
|
||||
backlight_coexistence = #{backlightCoexistence}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateDeviceStatusByDevId">
|
||||
UPDATE nu_iot_tplink_camera
|
||||
SET device_status = #{deviceStatus}
|
||||
where device_index = #{deviceIndex}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?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.nu.modules.iot.tplink.camerainfo.mapper.AppErrorCodeMapper">
|
||||
|
||||
<select id="getByCode" parameterType="String" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppErrorCode">
|
||||
select
|
||||
error_code as errorCode,
|
||||
error_msg as errorMsg
|
||||
from nu_iot_tplink_error_code
|
||||
where error_code = #{errorCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?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.nu.modules.iot.tplink.camerainfo.mapper.AppProjectInfoMapper">
|
||||
|
||||
<insert id="addProjectInfo">
|
||||
insert into nu_iot_tplink_project(
|
||||
id,
|
||||
project_id,
|
||||
project_name
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{projectId},
|
||||
#{projectName}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteProjectInfo">
|
||||
delete from nu_iot_tplink_project
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<?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.nu.modules.iot.tplink.camerainfo.mapper.AppRegionInfoMapper">
|
||||
|
||||
<insert id="addRegionInfo">
|
||||
insert into nu_iot_tplink_region(
|
||||
id,
|
||||
region_id,
|
||||
region_name,
|
||||
project_id,
|
||||
region_type
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{regionId},
|
||||
#{regionName},
|
||||
#{projectId},
|
||||
#{regionType}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteRegionInfo">
|
||||
delete from nu_iot_tplink_region
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?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.nu.modules.iot.tplink.camerainfo.mapper.AppTumsConfigMapper">
|
||||
|
||||
<select id="getByCode" parameterType="String" resultType="com.nu.modules.iot.tplink.camerainfo.entity.AppTumsConfig">
|
||||
select
|
||||
id,
|
||||
tums_url as tumsUrl,
|
||||
tums_username as tumsUsername,
|
||||
tums_password as tumsPassword,
|
||||
ftp_ip as ftpIp,
|
||||
ftp_port as ftpPort,
|
||||
ftp_username as ftpUsername,
|
||||
ftp_password as ftpPassword,
|
||||
ftp_uploadpath as ftpUploadpath,
|
||||
update_date as updateDate
|
||||
from nu_iot_tplink_tums_base
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addConfig">
|
||||
insert into nu_iot_tplink_tums_base(
|
||||
id,
|
||||
tums_url,
|
||||
tums_username,
|
||||
tums_password,
|
||||
ftp_ip,
|
||||
ftp_port,
|
||||
ftp_username,
|
||||
ftp_password,
|
||||
ftp_uploadpath,
|
||||
update_date
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{tumsUrl},
|
||||
#{tumsUsername},
|
||||
#{tumsPassword},
|
||||
#{ftpIp},
|
||||
#{ftpPort},
|
||||
#{ftpUsername},
|
||||
#{ftpPassword},
|
||||
#{ftpUploadpath},
|
||||
#{updateDate}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="deleteConfig">
|
||||
delete from nu_iot_tplink_tums_base
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-摄像头信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-01-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAppCameraInfoService extends IService<AppCameraInfo> {
|
||||
IPage<AppCameraInfo> findPage(Page<AppCameraInfo> page, AppCameraInfo cameraInfo);
|
||||
IPage<AppCameraInfo> findNuPage(Page<AppCameraInfo> page, AppCameraInfo cameraInfo);
|
||||
AppCameraInfo getByNuId(AppCameraInfo cameraInfo);
|
||||
void rebootDevice(AppCameraInfo cameraInfo);
|
||||
Result<JSONObject> getImageCommon(Map<String,Object> map);
|
||||
Result setImageCommon(Map<String,Object> map);
|
||||
Result<JSONObject> getOsdCapability(Map<String,Object> map);
|
||||
Result<JSONObject> getOsd(Map<String,Object> map);
|
||||
Result<String> setOsd(Map<String,Object> map);
|
||||
Result<JSONObject> getVideoParams(Map<String,Object> map);
|
||||
Result setVideoParams(Map<String,Object> map);
|
||||
Result configRecovery(Map<String,Object> map);
|
||||
Result<Map<String,String>> getPreviewUrl(AppCameraInfo cameraInfo);
|
||||
Result<JSONObject> getTamperDet(Map<String,Object> map);
|
||||
Result<String> setTamperDet(Map<String,Object> map);
|
||||
Result<JSONObject> getTamperNotif(Map<String,Object> map);
|
||||
Result setTamperNotif(Map<String,Object> map);
|
||||
Result testAudio(Map<String,Object> map);
|
||||
Result<JSONObject> getAlarmInfo(Map<String,Object> map);
|
||||
Result<String> setAlarmInfo(Map<String,Object> map);
|
||||
Result<JSONObject> getAlarmPlan(Map<String,Object> map);
|
||||
Result setAlarmPlan(Map<String,Object> map);
|
||||
Result<IPage<AppCameraInfo>> searchVideo(Integer pageNo, Integer pageSize, AppCameraInfo cameraInfo);
|
||||
Result<Map<String,Object>> getPlaybackUrlList(AppCameraInfo cameraInfo);
|
||||
Result<String> deletePlaybackChn(AppCameraInfo cameraInfo);
|
||||
Result<Map<String,Object>> getMultitransUrl(AppCameraInfo cameraInfo) throws Exception;
|
||||
Result uploadToServer(AppCameraInfo cameraInfo);
|
||||
Result<String> stopUploadToServer(AppCameraInfo cameraInfo);
|
||||
Result getUploadToServerProcess(AppCameraInfo cameraInfo);
|
||||
Result motionCtrl(AppCameraInfo cameraInfo);
|
||||
|
||||
void baoxiu(AppCameraInfo cameraInfo);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppErrorCode;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-错误码
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAppErrorCodeService extends IService<AppErrorCode> {
|
||||
AppErrorCode getByCode(String errorCode);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppTumsConfig;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-图门系统配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: caolei
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAppTumsConfigService extends IService<AppTumsConfig> {
|
||||
AppTumsConfig getByCode();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,24 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppErrorCode;
|
||||
import com.nu.modules.iot.tplink.camerainfo.mapper.AppErrorCodeMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.service.IAppErrorCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-错误码
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AppErrorCodeServiceImpl extends ServiceImpl<AppErrorCodeMapper, AppErrorCode> implements IAppErrorCodeService {
|
||||
|
||||
@Override
|
||||
public AppErrorCode getByCode(String errorCode){
|
||||
return baseMapper.getByCode(errorCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppTumsConfig;
|
||||
import com.nu.modules.iot.tplink.camerainfo.mapper.AppTumsConfigMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.service.IAppTumsConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-图门系统配置
|
||||
* @Author: caolei
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AppTumsConfigServiceImpl extends ServiceImpl<AppTumsConfigMapper, AppTumsConfig> implements IAppTumsConfigService {
|
||||
|
||||
@Override
|
||||
public AppTumsConfig getByCode(){
|
||||
return baseMapper.getByCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,360 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.camerainfo.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppProjectInfo;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppRegionInfo;
|
||||
import com.nu.modules.iot.tplink.camerainfo.enums.AppApiEnum;
|
||||
import com.nu.modules.iot.tplink.camerainfo.mapper.AppProjectInfoMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.mapper.AppRegionInfoMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.mapper.AppTumsConfigMapper;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppTumsConfig;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.HttpRequestUtil;
|
||||
import com.tplink.ignite.libs.developersdk.api.TumsClient;
|
||||
import com.tplink.ignite.libs.developersdk.vo.ResultVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AppTumsApi {
|
||||
|
||||
TumsClient tumsClient;
|
||||
|
||||
AppTumsConfig tumsConfig;
|
||||
|
||||
@Autowired
|
||||
private AppTumsConfigMapper tumsConfigMapper;
|
||||
@Autowired
|
||||
private AppProjectInfoMapper projectInfoMapper;
|
||||
@Autowired
|
||||
private AppRegionInfoMapper regionInfoMapper;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
/**
|
||||
* 创建tumsClient
|
||||
* @return
|
||||
*/
|
||||
public TumsClient createTumsClient(){
|
||||
if(this.tumsClient==null){
|
||||
login();
|
||||
}
|
||||
return this.tumsClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁tumsClient
|
||||
*/
|
||||
public void destroyTumsClient(){
|
||||
if(this.tumsClient!=null){
|
||||
logout();
|
||||
}
|
||||
}
|
||||
|
||||
private void initTumsConfig(){
|
||||
if(tumsConfig==null){
|
||||
tumsConfig = tumsConfigMapper.getByCode();
|
||||
if(tumsConfig==null){
|
||||
//调用接口从运维平台获取配置信息
|
||||
getConfigByApi();
|
||||
getProjectByApi();
|
||||
getRegionByApi();
|
||||
tumsConfig = tumsConfigMapper.getByCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getConfigByApi(){
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "devops_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String bizApiAddress = opeApiAddress + "/api/iot/tplink/config/getConfig";
|
||||
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
JSONObject result = jsonResponse.getJSONObject("result");
|
||||
tumsConfigMapper.deleteConfig();
|
||||
AppTumsConfig tumsConfig = JSON.parseObject(result.toJSONString(), AppTumsConfig.class);
|
||||
tumsConfigMapper.addConfig(tumsConfig);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
private void getProjectByApi(){
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "devops_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String bizApiAddress = opeApiAddress + "/api/iot/tplink/config/getProject";
|
||||
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
JSONObject result = jsonResponse.getJSONObject("result");
|
||||
projectInfoMapper.deleteProjectInfo();
|
||||
AppProjectInfo projectInfo = JSON.parseObject(result.toJSONString(), AppProjectInfo.class);
|
||||
projectInfoMapper.addProjectInfo(projectInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
private void getRegionByApi(){
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "devops_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String bizApiAddress = opeApiAddress + "/api/iot/tplink/config/getRegion";
|
||||
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
JSONObject result = jsonResponse.getJSONObject("result");
|
||||
regionInfoMapper.deleteRegionInfo();
|
||||
AppRegionInfo regionInfo = JSON.parseObject(result.toJSONString(), AppRegionInfo.class);
|
||||
regionInfoMapper.addRegionInfo(regionInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @return
|
||||
*/
|
||||
public void login(){
|
||||
initTumsConfig();
|
||||
TumsClient tc = new TumsClient(tumsConfig.getTumsUsername(), tumsConfig.getTumsPassword(), tumsConfig.getTumsUrl());
|
||||
ResultVO loginResult = tc.login();
|
||||
// 判断是否登录成功
|
||||
if (loginResult.getErrorCode() != 0) {
|
||||
log.error("login fail, fail message:[{}]", loginResult.getMsg());
|
||||
tumsClient = null;
|
||||
} else {
|
||||
log.info("login success");
|
||||
String cookie = tc.getCookie();
|
||||
String rsaKey = tc.getRsaKey();
|
||||
log.info("cookie",cookie);
|
||||
log.info("rsaKey",rsaKey);
|
||||
tumsClient = tc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public void logout(){
|
||||
ResultVO logoutResult = tumsClient.logout();
|
||||
if (logoutResult.getErrorCode() != 0) {
|
||||
log.error("logout fail, errorCode:{}", logoutResult.getErrorCode());
|
||||
} else {
|
||||
log.info("logout success");
|
||||
tumsClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前项目
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String setCurrentProject(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("setCurrentProject:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.SET_CURRENT_PROJECT.getValue());
|
||||
log.info("setCurrentProject:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重启设备
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String rebootDeviceList(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("rebootDeviceList:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.REBOOT_DEVICE_LIST.getValue());
|
||||
log.info("rebootDeviceList:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备配置信息
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String passthrough(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("passthrough:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_PASSTHROUGH.getValue());
|
||||
log.info("passthrough:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加预览通道
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String addPreviewChn(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("addPreviewChn:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_ADD_PREVIEW_CHN.getValue());
|
||||
log.info("addPreviewChn:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预览通道的url
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String getPreviewUrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("getPreviewUrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_GET_PREVIEW_URL.getValue());
|
||||
log.info("getPreviewUrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索当天的录像数据
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String searchVideo(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("searchVideo:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_SEARCH_VIDEO.getValue());
|
||||
log.info("searchVideo:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定监控点的存储设备列表
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String getStoragesById(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("getStoragesById:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_GET_STORAGES_BY_ID.getValue());
|
||||
log.info("getStoragesById:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加回放通道V2
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String addPlaybackChn(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("addPlaybackChn:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_ADD_PLAYBACK_CHN.getValue());
|
||||
log.info("addPlaybackChn:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取回放通道的url
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String getPlaybackUrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("getPlaybackUrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_GET_PLAYBACK_URL.getValue());
|
||||
log.info("getPlaybackUrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回放通道
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String deletePlaybackChn(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("deletePlaybackChn:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_DELETE_PLAYBACK_CHN.getValue());
|
||||
log.info("deletePlaybackChn:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取nvmp设备双向通信URL
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String getMultitransUrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("getMultitransUrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_GET_MULTITRANS_URL.getValue());
|
||||
log.info("getMultitransUrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回放视频转mp4上传
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String uploadToServer(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("uploadToServer:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_UPLOAD_TO_SERVER.getValue());
|
||||
log.info("uploadToServer:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止转存MP4上传任务
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String stopUploadToServer(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("stopUploadToServer:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_STOP_UPLOAD_TO_SERVER.getValue());
|
||||
log.info("stopUploadToServer:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转存MP4上传任务进度
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String getUploadToServerProcess(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("getUploadToServerProcess:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_GET_UPLOAD_TO_SERVER_PROCESS.getValue());
|
||||
log.info("getUploadToServerProcess:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
* @param jsonRequest
|
||||
* @return
|
||||
*/
|
||||
public String motionCtrl(String jsonRequest){
|
||||
this.createTumsClient();
|
||||
log.info("motionCtrl:request:{}",jsonRequest);
|
||||
String jsonResponse = tumsClient.request(jsonRequest, AppApiEnum.IPC_MOTION_CTRL.getValue());
|
||||
log.info("motionCtrl:response:{}",jsonResponse);
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.nu.modules.iot.tplink.storage.api;
|
||||
|
||||
import com.nu.modules.camerainfo.api.TplinkVideoStorageApi;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/tplink/videoStorage")
|
||||
public class TplinkVideoStoApi {
|
||||
|
||||
@Autowired
|
||||
private TplinkVideoStorageApi storageApi;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* tplink缓存视频存储
|
||||
*
|
||||
* @param pic 封面图片
|
||||
* @param video 视频缓存
|
||||
* @param url 存储路径
|
||||
*/
|
||||
@PostMapping("/tplinkVideoStorage")
|
||||
public Result<?> tplinkVideoStorage(@RequestPart("pic") MultipartFile pic, @RequestPart("video") MultipartFile video, @RequestParam("url") String url) {
|
||||
storageApi.tplinkVideoStorage(pic, video, url);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.nu.modules.iot.tq.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-电水表-配置信息
|
||||
* @Author: caolei
|
||||
* @Date: 2025-06-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_tq_config")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_tq_config", description="护理单元-物联管理-电水表-配置信息")
|
||||
public class AppTqConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
private String requestUrl; //后台系统地址
|
||||
private String authCode; //授权码
|
||||
private String randomCode; //随机字符串,签名时需要
|
||||
private String notifyUrl; //通知地址
|
||||
private String updateDate; //更新时间
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.nu.modules.iot.tq.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 接口枚举类
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum AppTqApiEnum {
|
||||
|
||||
METER_INFO("/Api/Meter","查询设备列表和当前状态"),
|
||||
COLLECTOR_INFO("/Api/Collector","查询采集器列表和当前状态"),
|
||||
ELE_RESET("/Api_v2/ele_security/reset","电表清零"),
|
||||
WATER_RESET("/Api_v2/water_security/reset","水表清零"),
|
||||
ELE_CONTROL("/Api_v2/ele_control","电表开关闸"),
|
||||
WATER_CONTROL("/Api_v2/water_control","水表开关闸"),
|
||||
ELE_READ("/Api_v2/ele_read","电表抄表"),
|
||||
WATER_READ("/Api_v2/water_read","水表抄表");
|
||||
|
||||
private final String value;//自定义属性,枚举值,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getValue();
|
||||
private final String remark;//自定义属性,枚举描述,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getRemark();
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.iot.tq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.tq.entity.AppTqConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-电水表配置信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface AppTqConfigMapper extends BaseMapper<AppTqConfig> {
|
||||
AppTqConfig getConfig();
|
||||
void addConfig(AppTqConfig tqConfig);
|
||||
void deleteConfig();
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?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.nu.modules.iot.tq.mapper.AppTqConfigMapper">
|
||||
|
||||
<select id="getConfig" parameterType="String" resultType="com.nu.modules.iot.tq.entity.AppTqConfig">
|
||||
select
|
||||
id,
|
||||
request_url as requestUrl,
|
||||
auth_code as authCode,
|
||||
random_code as randomCode,
|
||||
notify_url as notifyUrl,
|
||||
update_date as updateDate
|
||||
from nu_iot_tq_config
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addConfig">
|
||||
insert into nu_iot_tq_config(
|
||||
id,
|
||||
request_url,
|
||||
auth_code,
|
||||
random_code,
|
||||
notify_url,
|
||||
update_date
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{requestUrl},
|
||||
#{authCode},
|
||||
#{randomCode},
|
||||
#{notifyUrl},
|
||||
#{updateDate}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="deleteConfig">
|
||||
delete from nu_iot_tq_config
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
package com.nu.modules.iot.tq.utils;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AppHttpTool {
|
||||
|
||||
public static String generateOperateId() {
|
||||
return UUID.randomUUID().toString().replaceAll("-", "");
|
||||
}
|
||||
|
||||
public static String getUrlParams(Map<String, Object> map) {
|
||||
if (map == null || map.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
List<String> list = new ArrayList<>();
|
||||
map.forEach((key, value)->{
|
||||
try {
|
||||
list.add(key + "=" + URLEncoder.encode(value.toString(), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
return String.join("&", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送http GET请求
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public static String httpClientGet(String url) {
|
||||
try {
|
||||
CloseableHttpClient client = HttpClients.createDefault();
|
||||
HttpGet httpGet = new HttpGet(url);
|
||||
CloseableHttpResponse Response = client.execute(httpGet);
|
||||
HttpEntity entity = Response.getEntity();
|
||||
String resp = EntityUtils.toString(entity, "UTF-8");
|
||||
Response.close();
|
||||
return resp;
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送http POST请求
|
||||
* @param url
|
||||
* @param bodyMap
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String httpClientPost(String url, Map<String, String> bodyMap) throws Exception {
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("发送参数:" + bodyMap.toString());
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpPost postRequest = new HttpPost(url);
|
||||
|
||||
List<NameValuePair> nvps = new ArrayList<>();
|
||||
|
||||
for(String key : bodyMap.keySet()) {
|
||||
nvps.add(new BasicNameValuePair(key,bodyMap.get(key)));
|
||||
}
|
||||
postRequest.setEntity(new UrlEncodedFormEntity(nvps,"utf-8"));
|
||||
|
||||
|
||||
int retry = 3;
|
||||
HttpResponse execute = null;
|
||||
while(retry-- > 0) {
|
||||
try {
|
||||
execute = client.execute(postRequest);
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
}
|
||||
if(execute == null) {
|
||||
throw new Exception("接口请求失败");
|
||||
}
|
||||
String resp = EntityUtils.toString(execute.getEntity(), "UTF-8");
|
||||
System.out.println("接口返回:" + resp);
|
||||
return resp;
|
||||
}
|
||||
|
||||
// public static String postUrl(String url, Map<String,Object> map){
|
||||
// String errorMsg = "";
|
||||
// Gson gson = new Gson();
|
||||
// String map2 = gson.toJson(map);
|
||||
// System.out.println(map2);
|
||||
// try {
|
||||
// URL obj = new URL(url);
|
||||
// HttpURLConnection con = (HttpURLConnection) obj.openConnection();
|
||||
// // 设置请求方法为 POST
|
||||
// con.setRequestMethod("POST");
|
||||
// // 设置请求头
|
||||
// con.setRequestProperty("Content-Type", "application/json"); // 声明发送 JSON
|
||||
// con.setRequestProperty("Accept", "application/json"); // 声明期望接收 JSON
|
||||
// con.setDoOutput(true); // 允许写入请求体
|
||||
// // 写入 JSON 请求体
|
||||
// try (OutputStream os = con.getOutputStream()) {
|
||||
// byte[] input = map2.getBytes("utf-8");
|
||||
// os.write(input, 0, input.length);
|
||||
// }
|
||||
// // 获取响应码
|
||||
// int responseCode = con.getResponseCode();
|
||||
// System.out.println("Response Code: " + responseCode);
|
||||
// // 读取响应(成功时)
|
||||
// if (responseCode == HttpURLConnection.HTTP_OK) { // 200
|
||||
// try (BufferedReader br = new BufferedReader(
|
||||
// new InputStreamReader(con.getInputStream(), "UTF-8"))) {
|
||||
// StringBuilder response = new StringBuilder();
|
||||
// String responseLine;
|
||||
// while ((responseLine = br.readLine()) != null) {
|
||||
// response.append(responseLine.trim());
|
||||
// }
|
||||
// System.out.println("Response: " + response.toString());
|
||||
// JSONObject result = new JSONObject(response.toString());
|
||||
// String status = result.getStr("status");
|
||||
// if(status.equals("SUCCESS")){
|
||||
// errorMsg = "";
|
||||
// }else{
|
||||
// errorMsg = result.getStr("error_msg");
|
||||
// }
|
||||
// }
|
||||
// } else { // 错误时读取错误流
|
||||
// try (BufferedReader br = new BufferedReader(
|
||||
// new InputStreamReader(con.getErrorStream(), "UTF-8"))) {
|
||||
// StringBuilder errorResponse = new StringBuilder();
|
||||
// String errorLine;
|
||||
// while ((errorLine = br.readLine()) != null) {
|
||||
// errorResponse.append(errorLine.trim());
|
||||
// }
|
||||
// errorMsg = errorResponse.toString();
|
||||
// System.out.println("Error Response: " + errorResponse.toString());
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return errorMsg;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package com.nu.modules.iot.tq.utils;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class AppSignTool {
|
||||
|
||||
// 生成签名字符串
|
||||
public static String getSign(String nonce,Map<String, String> data)
|
||||
{
|
||||
// 获取关键字列表
|
||||
List<String> keys = new ArrayList<>(data.keySet());
|
||||
// 关键字列表排序
|
||||
keys.sort(Comparator.naturalOrder());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String key : keys)
|
||||
{
|
||||
// 取各个字段内容拼接字符串
|
||||
sb.append(data.get(key));
|
||||
}
|
||||
// 加上双方约定随机字符串
|
||||
String txt = sb.toString() + nonce;
|
||||
|
||||
// 计算哈希值
|
||||
return getMD5(txt);
|
||||
}
|
||||
|
||||
public static boolean checkSign(String response_content, String timestamp, String sign,String nonce) {
|
||||
String buf = response_content + timestamp + nonce;
|
||||
String encode = getMD5(buf);
|
||||
return encode.equals(sign);
|
||||
}
|
||||
|
||||
// md5加密
|
||||
public static String getMD5(String password) {
|
||||
MessageDigest md5 = null;
|
||||
try {
|
||||
md5 = MessageDigest.getInstance("MD5");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
byte[] byteArray = password.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
byte[] md5Bytes = md5.digest(byteArray);
|
||||
StringBuilder hexValue = new StringBuilder();
|
||||
for (byte md5Byte : md5Bytes) {
|
||||
int val = ((int) md5Byte) & 0xff;
|
||||
if (val < 16) {
|
||||
hexValue.append("0");
|
||||
}
|
||||
|
||||
hexValue.append(Integer.toHexString(val));
|
||||
}
|
||||
return hexValue.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
package com.nu.modules.iot.tq.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.modules.iot.tq.entity.AppTqConfig;
|
||||
import com.nu.modules.iot.tq.enums.AppTqApiEnum;
|
||||
import com.nu.modules.iot.tq.mapper.AppTqConfigMapper;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.HttpRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AppTqApi {
|
||||
|
||||
AppTqConfig tqConfig;
|
||||
|
||||
@Autowired
|
||||
AppTqConfigMapper tqConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
private void initTqConfig(){
|
||||
if(tqConfig==null){
|
||||
tqConfig = tqConfigMapper.getConfig();
|
||||
if(tqConfig==null){
|
||||
getConfigByApi();
|
||||
tqConfig = tqConfigMapper.getConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getConfigByApi(){
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "devops_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String bizApiAddress = opeApiAddress + "/api/iot/tq/config/getConfig";
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
JSONObject result = jsonResponse.getJSONObject("result");
|
||||
tqConfigMapper.deleteConfig();
|
||||
AppTqConfig tqConfig = JSON.parseObject(result.toJSONString(), AppTqConfig.class);
|
||||
tqConfigMapper.addConfig(tqConfig);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public AppTqConfig getTqConfig(){
|
||||
this.initTqConfig();
|
||||
return tqConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表和当前状态
|
||||
*/
|
||||
public String getMeters(){
|
||||
this.initTqConfig();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("auth", tqConfig.getAuthCode());
|
||||
String urlParams = AppHttpTool.getUrlParams(params);
|
||||
log.info("getMeters:request:{}",urlParams);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.METER_INFO.getValue()+"?"+urlParams;
|
||||
String responseStr = AppHttpTool.httpClientGet(url);
|
||||
log.info("getMeters:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采集器列表和当前状态
|
||||
*/
|
||||
public String getCollectors(){
|
||||
this.initTqConfig();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("auth", tqConfig.getAuthCode());
|
||||
String urlParams = AppHttpTool.getUrlParams(params);
|
||||
log.info("getCollectors:request:{}",urlParams);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.COLLECTOR_INFO.getValue()+"?"+urlParams;
|
||||
String responseStr = AppHttpTool.httpClientGet(url);
|
||||
log.info("getCollectors:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电表清零
|
||||
*/
|
||||
public String eleReset(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("eleReset:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.ELE_RESET.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/electricityMeter/eleResetNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("eleReset:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电表开关闸
|
||||
*/
|
||||
public String eleControl(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("eleControl:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.ELE_CONTROL.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/electricityMeter/eleControlNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("eleControl:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电表抄表
|
||||
*/
|
||||
public String eleRead(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("eleRead:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.ELE_READ.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/electricityMeter/eleReadNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("eleRead:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 水表清零
|
||||
*/
|
||||
public String waterReset(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("waterReset:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.WATER_RESET.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/waterMeter/waterResetNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("waterReset:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 水表开关闸
|
||||
*/
|
||||
public String waterControl(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("waterControl:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+AppTqApiEnum.WATER_CONTROL.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/waterMeter/waterControlNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("waterControl:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 水表抄表
|
||||
*/
|
||||
public String waterRead(List<Map<String, Object>> req){
|
||||
this.initTqConfig();
|
||||
String request_content = JSON.toJSONString(req);
|
||||
log.info("waterRead:request:{}",request_content);
|
||||
String url = tqConfig.getRequestUrl()+ AppTqApiEnum.WATER_READ.getValue();
|
||||
String notifyUrl = tqConfig.getNotifyUrl()+"/waterMeter/waterReadNotify";
|
||||
String responseStr = requestAsync(url,request_content,notifyUrl);
|
||||
log.info("waterRead:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
private String requestAsync(String url, String request_content,String notifyUrl){
|
||||
// 时间戳
|
||||
String timestamp = String.valueOf(new Date().getTime()/1000);
|
||||
// 用于签名的内容
|
||||
Map<String, String> data = new HashMap<>();
|
||||
data.put("timestamp", timestamp);
|
||||
data.put("auth_code", tqConfig.getAuthCode());
|
||||
data.put("request_content", request_content);
|
||||
data.put("notify_url", notifyUrl);
|
||||
// 获取签名
|
||||
String sign = AppSignTool.getSign(tqConfig.getRandomCode(),data);
|
||||
data.put("sign", sign);
|
||||
try {
|
||||
return AppHttpTool.httpClientPost(url, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.nu.modules.iot.yiweilian.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-易维联-配置信息
|
||||
* @Author: caolei
|
||||
* @Date: 2025-06-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_iot_yiweilian_config")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_iot_yiweilian_config", description="护理单元-物联管理-易维联-配置信息")
|
||||
public class AppYiweilianConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**ID*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
private String requestUrl; //云平台系统地址
|
||||
private String clientId; //识别用户的唯一标识
|
||||
private String updateDate; //更新时间
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package com.nu.modules.iot.yiweilian.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 接口枚举类
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum AppYiweilianApiEnum {
|
||||
|
||||
ADD_DEVICE("/mtInterface/device/addDevice","添加设备"),
|
||||
UPDATE_DEVICE_CONFIG("/mtInterface/device/updateDeviceConfig","修改设备配置"),
|
||||
DELETE_DEVICE("/mtInterface/device/deleteDevice","删除设备"),
|
||||
// GET_DEVICES("/mtInterface/device/getDevices","查询设备列表(分页)"),
|
||||
GET_DEVICE_CONFIGS("/mtInterface/device/getDeciveConfigs","查询设备列表含配置信息(分页)"),
|
||||
GET_REAL_TIME("/mtInterface/realTime/getRealTime","查询设备实时数据(分页)"),
|
||||
GET_WARNING_DATA("/mtInterface/warning/getWarningData","查询告警记录(分页)");
|
||||
|
||||
private final String value;//自定义属性,枚举值,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getValue();
|
||||
private final String remark;//自定义属性,枚举描述,获取:如ApiEnum.GET_ENCRYPT_KEY_FOR_LOGIN.getRemark();
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.iot.yiweilian.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.iot.yiweilian.entity.AppYiweilianConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-物联管理-易维联-配置信息
|
||||
* @Author: caolei
|
||||
* @Date: 2025-08-08
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface AppYiweilianConfigMapper extends BaseMapper<AppYiweilianConfig> {
|
||||
AppYiweilianConfig getConfig();
|
||||
void addConfig(AppYiweilianConfig yiweilianConfig);
|
||||
void deleteConfig();
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?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.nu.modules.iot.yiweilian.mapper.AppYiweilianConfigMapper">
|
||||
|
||||
<select id="getConfig" parameterType="String" resultType="com.nu.modules.iot.yiweilian.entity.AppYiweilianConfig">
|
||||
select
|
||||
id,
|
||||
request_url as requestUrl,
|
||||
client_id as clientId,
|
||||
update_date as updateDate
|
||||
from nu_iot_yiweilian_config
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addConfig">
|
||||
insert into nu_iot_yiweilian_config(
|
||||
id,
|
||||
request_url,
|
||||
client_id,
|
||||
update_date
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{requestUrl},
|
||||
#{clientId},
|
||||
#{updateDate}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="deleteConfig">
|
||||
delete from nu_iot_yiweilian_config
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
package com.nu.modules.iot.yiweilian.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
|
||||
public class AppHttpTool {
|
||||
|
||||
/**
|
||||
* 发送http POST请求
|
||||
* @param url
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String httpClientPost(String url, Map<String,Object> map){
|
||||
String errorMsg = "";
|
||||
Gson gson = new Gson();
|
||||
String map2 = gson.toJson(map);
|
||||
System.out.println(map2);
|
||||
try {
|
||||
URL obj = new URL(url);
|
||||
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
|
||||
// 设置请求方法为 POST
|
||||
con.setRequestMethod("POST");
|
||||
// 设置请求头
|
||||
con.setRequestProperty("Content-Type", "application/json"); // 声明发送 JSON
|
||||
con.setRequestProperty("Accept", "application/json"); // 声明期望接收 JSON
|
||||
con.setDoOutput(true); // 允许写入请求体
|
||||
// 写入 JSON 请求体
|
||||
try (OutputStream os = con.getOutputStream()) {
|
||||
byte[] input = map2.getBytes("utf-8");
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
// 获取响应码
|
||||
int responseCode = con.getResponseCode();
|
||||
System.out.println("Response Code: " + responseCode);
|
||||
// 读取响应(成功时)
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) { // 200
|
||||
try (BufferedReader br = new BufferedReader(
|
||||
new InputStreamReader(con.getInputStream(), "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String responseLine;
|
||||
while ((responseLine = br.readLine()) != null) {
|
||||
response.append(responseLine.trim());
|
||||
}
|
||||
System.out.println("Response: " + response.toString());
|
||||
errorMsg = response.toString();
|
||||
}
|
||||
} else { // 错误时读取错误流
|
||||
try (BufferedReader br = new BufferedReader(
|
||||
new InputStreamReader(con.getErrorStream(), "UTF-8"))) {
|
||||
StringBuilder errorResponse = new StringBuilder();
|
||||
String errorLine;
|
||||
while ((errorLine = br.readLine()) != null) {
|
||||
errorResponse.append(errorLine.trim());
|
||||
}
|
||||
System.out.println("Error Response: " + errorResponse.toString());
|
||||
errorMsg = "{\"code\":"+responseCode+",\"msg\":\""+errorResponse.toString()+"\" }";
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
package com.nu.modules.iot.yiweilian.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.modules.iot.yiweilian.entity.AppYiweilianConfig;
|
||||
import com.nu.modules.iot.yiweilian.enums.AppYiweilianApiEnum;
|
||||
import com.nu.modules.iot.yiweilian.mapper.AppYiweilianConfigMapper;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.HttpRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AppYiweilianApi {
|
||||
|
||||
AppYiweilianConfig yiweilianConfig;
|
||||
|
||||
@Autowired
|
||||
AppYiweilianConfigMapper yiweilianConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
private void initYiweilianConfig(){
|
||||
if(yiweilianConfig==null){
|
||||
yiweilianConfig = yiweilianConfigMapper.getConfig();
|
||||
if(yiweilianConfig==null){
|
||||
getConfigByApi();
|
||||
yiweilianConfig = yiweilianConfigMapper.getConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getConfigByApi(){
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "devops_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String bizApiAddress = opeApiAddress + "/api/iot/yiweilian/config/getConfig";
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
JSONObject result = jsonResponse.getJSONObject("result");
|
||||
yiweilianConfigMapper.deleteConfig();
|
||||
AppYiweilianConfig yiweilianConfig = JSON.parseObject(result.toJSONString(), AppYiweilianConfig.class);
|
||||
yiweilianConfigMapper.addConfig(yiweilianConfig);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public AppYiweilianConfig getYiweilianConfig(){
|
||||
this.initYiweilianConfig();
|
||||
return yiweilianConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
public String addDevice(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("addDevice:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+ AppYiweilianApiEnum.ADD_DEVICE.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("addDevice:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改设备配置
|
||||
*/
|
||||
public String updateDeviceConfig(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("updateDeviceConfig:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+AppYiweilianApiEnum.UPDATE_DEVICE_CONFIG.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("updateDeviceConfig:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
public String deleteDevice(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("deleteDevice:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+AppYiweilianApiEnum.DELETE_DEVICE.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("deleteDevice:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表(分页)
|
||||
*/
|
||||
// public String getDevices(Map<String, Object> params){
|
||||
// this.initYiweilianConfig();
|
||||
// params.put("clientId", yiweilianConfig.getClientId());
|
||||
// log.info("getDevices:request:{}",params);
|
||||
// String url = yiweilianConfig.getRequestUrl()+AppYiweilianApiEnum.GET_DEVICES.getValue();
|
||||
// String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
// log.info("getDevices:response:{}",responseStr);
|
||||
// return responseStr;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询设备列表含配置信息(分页)
|
||||
*/
|
||||
public String getDeviceConfigs(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("getDeviceConfigs:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+AppYiweilianApiEnum.GET_DEVICE_CONFIGS.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("getDeviceConfigs:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备实时数据(分页)
|
||||
*/
|
||||
public String getRealTime(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("getRealTime:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+ AppYiweilianApiEnum.GET_REAL_TIME.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("getRealTime:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询告警记录(分页)
|
||||
*/
|
||||
public String getWarningData(Map<String, Object> params){
|
||||
this.initYiweilianConfig();
|
||||
params.put("clientId", yiweilianConfig.getClientId());
|
||||
log.info("getWarningData:request:{}",params);
|
||||
String url = yiweilianConfig.getRequestUrl()+AppYiweilianApiEnum.GET_WARNING_DATA.getValue();
|
||||
String responseStr = AppHttpTool.httpClientPost(url, params);
|
||||
log.info("getWarningData:response:{}",responseStr);
|
||||
return responseStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,8 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.nu.entity.*;
|
||||
import com.nu.modules.electricitymeter.api.IElectricityMeterApi;
|
||||
import com.nu.modules.humiddevice.api.IHumidDeviceApi;
|
||||
import com.nu.modules.iot.tplink.camerainfo.entity.AppCameraInfo;
|
||||
import com.nu.modules.iot.tplink.camerainfo.service.IAppCameraInfoService;
|
||||
import com.nu.modules.camerainfo.api.ICameraInfoApi;
|
||||
import com.nu.modules.water.api.IWaterApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
|
@ -16,8 +15,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
|
|
@ -25,7 +22,7 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class IotCommonApi {
|
||||
@Autowired
|
||||
private IAppCameraInfoService cameraInfoService;
|
||||
private ICameraInfoApi cameraInfoService;
|
||||
@Autowired
|
||||
private IElectricityMeterApi electricityMeterApi;
|
||||
@Autowired
|
||||
|
|
@ -46,13 +43,11 @@ public class IotCommonApi {
|
|||
|
||||
//摄像头
|
||||
{
|
||||
Page<AppCameraInfo> page = new Page<AppCameraInfo>(1, -1);
|
||||
AppCameraInfo cameraInfo = new AppCameraInfo();
|
||||
CameraInfoEntity cameraInfo = new CameraInfoEntity();
|
||||
cameraInfo.setNuId(nuId);
|
||||
IPage<AppCameraInfo> pageList = cameraInfoService.findPage(page, cameraInfo);
|
||||
List<AppCameraInfo> records = pageList.getRecords();
|
||||
if (records != null && records.size() > 0) {
|
||||
result.setCameraInfoEntityList(BeanUtil.copyToList(records, CameraInfoEntity.class));
|
||||
List<CameraInfoEntity> cameraList = cameraInfoService.getCameraInfoList(cameraInfo);
|
||||
if (cameraList != null && cameraList.size() > 0) {
|
||||
result.setCameraInfoEntityList(cameraList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +58,8 @@ public class IotCommonApi {
|
|||
IPage<ElectricityMeterEntity> pageList = electricityMeterApi.list(electricityMeterEntity, 1, -1, null);
|
||||
List<ElectricityMeterEntity> records = pageList.getRecords();
|
||||
if (records != null && records.size() > 0) {
|
||||
result.setElectricityMeterEntityList(BeanUtil.copyToList(records, ElectricityMeterEntity.class));
|
||||
// result.setElectricityMeterEntityList(BeanUtil.copyToList(records, ElectricityMeterEntity.class));
|
||||
result.setElectricityMeterEntityList(records);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +70,8 @@ public class IotCommonApi {
|
|||
IPage<WaterMeterEntity> pageList = waterApi.list(waterMeterEntity, 1, -1, null);
|
||||
List<WaterMeterEntity> records = pageList.getRecords();
|
||||
if (records != null && records.size() > 0) {
|
||||
result.setWaterMeterEntityList(BeanUtil.copyToList(records, WaterMeterEntity.class));
|
||||
// result.setWaterMeterEntityList(BeanUtil.copyToList(records, WaterMeterEntity.class));
|
||||
result.setWaterMeterEntityList(records);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +82,8 @@ public class IotCommonApi {
|
|||
IPage<HumidDeviceEntity> pageList = humidDeviceApi.list(humidDeviceEntity, 1, -1, null);
|
||||
List<HumidDeviceEntity> records = pageList.getRecords();
|
||||
if (records != null && records.size() > 0) {
|
||||
result.setHumidDeviceEntityList(BeanUtil.copyToList(records, HumidDeviceEntity.class));
|
||||
// result.setHumidDeviceEntityList(BeanUtil.copyToList(records, HumidDeviceEntity.class));
|
||||
result.setHumidDeviceEntityList(records);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,11 +70,4 @@ public class ElectricityMeterApi {
|
|||
return electricityMeterApi.eleReset(electricityMeterEntity);
|
||||
}
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody ElectricityMeterEntity electricityMeterEntity) {
|
||||
electricityMeterApi.baoxiu(electricityMeterEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,17 +59,6 @@ public class HumidDeviceApi {
|
|||
return Result.OK("抄表成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 报修
|
||||
*/
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value = "设备报修", notes = "设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody HumidDeviceEntity humidDeviceEntity) {
|
||||
humidDeviceApi.baoxiu(humidDeviceEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 抄表日志
|
||||
*
|
||||
|
|
|
|||
|
|
@ -69,12 +69,4 @@ public class WaterApi {
|
|||
return waterApi.waterRead(waterMeterEntity);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody WaterMeterEntity waterMeterEntity) {
|
||||
waterApi.baoxiu(waterMeterEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ public class IotCameraCapabilityMQDto{
|
|||
private String corridorMod;
|
||||
/**背光共存*/
|
||||
private String backlightCoexistence;
|
||||
/**是否同步 0 未同步 1已同步*/
|
||||
private String syncType;
|
||||
/**日志ID*/
|
||||
private String logId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ public class IotCameraInfoMQDto{
|
|||
private String systemType;
|
||||
/**协议类型*/
|
||||
private String protocol;
|
||||
/**录像计划ID**/
|
||||
private String recordPlanId;
|
||||
/**回放视频转FTP上传IP**/
|
||||
private String ftpIp;
|
||||
/**回放视频转FTP上传端口**/
|
||||
|
|
@ -68,22 +66,7 @@ public class IotCameraInfoMQDto{
|
|||
private String ftpPassword;
|
||||
/**回放视频转FTP上传路径**/
|
||||
private String ftpUploadpath;
|
||||
/**区域编码*/
|
||||
private String nuId;
|
||||
/**区域编码*/
|
||||
private String nuName;
|
||||
/**机构ID*/
|
||||
private String departId;
|
||||
/**机构名称*/
|
||||
private String departName;
|
||||
/**机构服务地址*/
|
||||
private String departServerUrl;
|
||||
/**是否同步 0 未同步 1已同步*/
|
||||
private String syncType;
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
/**日志ID*/
|
||||
private String logId;
|
||||
private String dimension;//设备维度
|
||||
private String channel;//通道号
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ public class IotEleWaterCollectorMQDto{
|
|||
private String connectTime;
|
||||
/**描述*/
|
||||
private String remark;
|
||||
/**是否同步 0 未同步 1已同步*/
|
||||
private String syncType;
|
||||
/**日志ID*/
|
||||
private String logId;
|
||||
}
|
||||
|
|
@ -23,21 +23,6 @@ public class IotElectricityMeterMQDto{
|
|||
/**描述*/
|
||||
private String remark;
|
||||
private String sim;
|
||||
/**区域编码*/
|
||||
private String nuId;
|
||||
/**区域名称*/
|
||||
private String nuName;
|
||||
/**机构ID*/
|
||||
private String departId;
|
||||
/**机构名称*/
|
||||
private String departName;
|
||||
/**机构服务地址*/
|
||||
private String departServerUrl;
|
||||
/**是否同步*/
|
||||
private String syncType;
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
/**日志ID*/
|
||||
private String logId;
|
||||
private String dimension;//设备维度
|
||||
}
|
||||
|
|
@ -56,21 +56,6 @@ public class IotHumidDeviceMQDto{
|
|||
private String reportingTime;
|
||||
/**电量*/
|
||||
private String electricity;
|
||||
/**区域编码*/
|
||||
private String nuId;
|
||||
/**区域名称*/
|
||||
private String nuName;
|
||||
/**机构ID*/
|
||||
private String departId;
|
||||
/**机构名称*/
|
||||
private String departName;
|
||||
/**机构服务地址*/
|
||||
private String departServerUrl;
|
||||
/**是否同步 0 未同步 1已同步*/
|
||||
private String syncType;
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
/**日志ID*/
|
||||
private String logId;
|
||||
private String dimension;//设备维度
|
||||
}
|
||||
|
|
@ -12,10 +12,6 @@ public class CameraInfoEntity {
|
|||
/**ID*/
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
/**设备编码*/
|
||||
@Excel(name = "设备编码", width = 15)
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String sn;
|
||||
/**设备序号*/
|
||||
@ApiModelProperty(value = "设备序号")
|
||||
private String deviceIndex;
|
||||
|
|
@ -88,108 +84,5 @@ public class CameraInfoEntity {
|
|||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元ID")
|
||||
private String nuId;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
private String nuName;
|
||||
@ApiModelProperty(value = "码流类型 0 代表主码流,1 代码子码流")
|
||||
private int streamType;
|
||||
|
||||
/**
|
||||
* 能力集属性 ==>
|
||||
*/
|
||||
@ApiModelProperty(value = "运动检测")
|
||||
private String motionDetection;
|
||||
@ApiModelProperty(value = "视频封面")
|
||||
private String videoCover;
|
||||
@ApiModelProperty(value = "云台")
|
||||
private String ptz;
|
||||
@ApiModelProperty(value = "motor")
|
||||
private String motor;
|
||||
@ApiModelProperty(value = "smartCode")
|
||||
private String smartCode;
|
||||
@ApiModelProperty(value = "强制在H.264编码过程中生成IDR帧的函数")
|
||||
private String forceIdrFrame;
|
||||
@ApiModelProperty(value = "音频")
|
||||
private String audio;
|
||||
@ApiModelProperty(value = "本地存储")
|
||||
private String localStorage;
|
||||
@ApiModelProperty(value = "回放API本版")
|
||||
private String playbackApiVersionTwo;
|
||||
@ApiModelProperty(value = "多变性")
|
||||
private String multitrans;
|
||||
@ApiModelProperty(value = "客流")
|
||||
private String passengerFlow;
|
||||
@ApiModelProperty(value = "获取预览缩略图")
|
||||
private String getPreviewThumbnail;
|
||||
@ApiModelProperty(value = "JPG预览缩略图")
|
||||
private String previewThumbnailJpeg;
|
||||
@ApiModelProperty(value = "走廊")
|
||||
private String corridorMod;
|
||||
@ApiModelProperty(value = "背光共存")
|
||||
private String backlightCoexistence;
|
||||
/**
|
||||
* <== 能力集属性
|
||||
*/
|
||||
@ApiModelProperty(value = "查询日期")
|
||||
private String dataDate;
|
||||
@ApiModelProperty(value = "设备索引")
|
||||
private String videoDevId;
|
||||
@ApiModelProperty(value = "存储设备ID")
|
||||
private String storageDevId;
|
||||
@ApiModelProperty(value = "存储设备名称")
|
||||
private String storageDevName;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID,双摄IPC的全景摄像头,其值为0.双摄IPC的特写摄像头,其值为1")
|
||||
private String channelId;
|
||||
@ApiModelProperty(value = "当录像存在存储池中, 录像所属的nvs的ID")
|
||||
private String nvsIdInPoolList;
|
||||
@ApiModelProperty(value = "录像开始时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
private String startTime;
|
||||
@ApiModelProperty(value = "录像结束时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
private String endTime;
|
||||
@ApiModelProperty(value = "录像开始时间,YYYY-MM-DD HH:MI:SS")
|
||||
private String startTimeFt;
|
||||
@ApiModelProperty(value = "录像结束时间,YYYY-MM-DD HH:MI:SS")
|
||||
private String endTimeFt;
|
||||
@ApiModelProperty(value = "录像时长,HH:MI:SS")
|
||||
private String duration;
|
||||
@ApiModelProperty(value = "回放录像类型。1: 定时录像; 2: 移动侦测等")
|
||||
private String videoType;
|
||||
@ApiModelProperty(value = "录像片段大小,单位字节")
|
||||
private String size;
|
||||
@ApiModelProperty(value = "错误码")
|
||||
private String errorCode;
|
||||
@ApiModelProperty(value = "错误描述")
|
||||
private String errorMsg;
|
||||
@ApiModelProperty(value = "录像存储设备类型 -1:未找到,0:ipc,1:nvr,2:nvs:3:server,4:vcs,5:storagePool")
|
||||
private String storageType;
|
||||
@ApiModelProperty(value = "预览/回放url")
|
||||
private String url;
|
||||
@ApiModelProperty(value = "预览/回放备用url")
|
||||
private String backupUrl;
|
||||
@ApiModelProperty(value = "ws连接传输视频地址")
|
||||
private String wsUrl;
|
||||
@ApiModelProperty(value = "wss接传输视频地址")
|
||||
private String wssUrl;
|
||||
@ApiModelProperty(value = "预览/回放通道对应的sessionId")
|
||||
private String sessionId;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID")
|
||||
private String videoChannelId;
|
||||
@ApiModelProperty(value = "回放速率")
|
||||
private String scale;
|
||||
@ApiModelProperty(value = "回放api访问前缀")
|
||||
private String queryAddress;
|
||||
@ApiModelProperty(value = "录像开关;枚举:[0:表示关,1:表示开]")
|
||||
private String recordSwitch;
|
||||
@ApiModelProperty(value = "任务taskId")
|
||||
private String taskId;
|
||||
@ApiModelProperty(value = "上传mp4文件名称")
|
||||
private String fileName;
|
||||
@ApiModelProperty(value = "上传进度")
|
||||
private String process;
|
||||
@ApiModelProperty(value = "移动方向;枚举:[0:左上,1:上,2:右上,3:左,4:持续水平转动,5:右,6:左下,7:下,8:右下,9:缩小画面,10:放大画面,11:聚焦近处,12:聚焦远处]")
|
||||
private String direction;
|
||||
@ApiModelProperty(value = "开始或停止移动;枚举:[0:停止,1:开始]")
|
||||
private String startOrNot;
|
||||
@ApiModelProperty(value = "球机移动速度")
|
||||
private String speed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,14 +21,5 @@ public class ElectricityMeterEntity implements Serializable {
|
|||
private String readTime; //电表-上次查表时间
|
||||
private String remark;
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String oldServerUrl;//原机构服务地址
|
||||
private String syncType;//是否同步 0 未同步 1已同步
|
||||
private String oldDepartId;//原机构id
|
||||
private String oldDepartName;//原机构名称
|
||||
private String maintainStatus;//维修状态
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,22 +45,6 @@ public class HumidDeviceEntity implements Serializable {
|
|||
private String status; //在线状态,0在线 1离线
|
||||
private String reportingTime; //最新上报时间
|
||||
private String electricity; //电量 0~4
|
||||
|
||||
private String optType; //操作类型
|
||||
private String optTime; //操作时间
|
||||
private String optBy; //操作人
|
||||
|
||||
private Integer alarmCn; //告警数量
|
||||
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String oldServerUrl;//原机构服务地址
|
||||
private String syncType;//是否同步 0 未同步 1已同步
|
||||
private String oldDepartId;//原机构id
|
||||
private String oldDepartName;//原机构名称
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,4 @@ public class WaterMeterEntity implements Serializable {
|
|||
private String readTime; //电表-上次查表时间
|
||||
private String remark;
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String maintainStatus;//维修状态
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
package com.nu.modules.camerainfo.api;
|
||||
|
||||
|
||||
import com.nu.entity.CameraInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CameraInfoApi {
|
||||
|
||||
public List<CameraInfoEntity> getCameraInfoList();
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.nu.modules.camerainfo.api;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.CameraInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICameraInfoApi {
|
||||
public List<CameraInfoEntity> getCameraInfoList(CameraInfoEntity cameraInfoEntity);
|
||||
}
|
||||
|
|
@ -15,6 +15,4 @@ public interface IElectricityMeterApi {
|
|||
IPage<ElectricityMeterEntity> list(ElectricityMeterEntity electricityMeterEntity, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
Result<String> eleReset(ElectricityMeterEntity electricityMeterEntity);
|
||||
|
||||
void baoxiu(ElectricityMeterEntity electricityMeterEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ public interface IHumidDeviceApi {
|
|||
|
||||
String updateDeviceRealTime(HumidDeviceEntity humidDeviceEntity);
|
||||
|
||||
void baoxiu(HumidDeviceEntity humidDeviceEntity);
|
||||
|
||||
IPage<HumidDeviceEntity> queryLogPageList(HumidDeviceEntity humidDeviceEntity, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
List<HumidDeviceEntity> listAll();
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
public interface IWaterApi {
|
||||
IPage<WaterMeterEntity> list(WaterMeterEntity waterMeterEntity, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
Result<String> waterReset(WaterMeterEntity waterMeterEntity);
|
||||
Result<String> waterControl(WaterMeterEntity waterMeterEntity);
|
||||
Result<String> waterRead(WaterMeterEntity waterMeterEntity);
|
||||
void baoxiu(WaterMeterEntity waterMeterEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,72 +82,6 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value="护理单元分页列表查询", notes="护理单元分页列表查询")
|
||||
@GetMapping(value = "/nuList")
|
||||
public Result<IPage<CameraInfo>> queryNuPageList(CameraInfo CameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<CameraInfo> page = new Page<CameraInfo>(pageNo, pageSize);
|
||||
IPage<CameraInfo> pageList = service.findNuPage(page, CameraInfo);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-物联管理-摄像头信息-编辑")
|
||||
@ApiOperation(value="护理单元-物联管理-摄像头信息-编辑", notes="护理单元-物联管理-摄像头信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody CameraInfo cameraInfo) {
|
||||
service.edit(cameraInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody CameraInfo cameraInfo) {
|
||||
service.baoxiu(cameraInfo);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改摄像头信息
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/rebootDevice", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> rebootDevice(@RequestBody CameraInfo cameraInfo) {
|
||||
service.rebootDevice(cameraInfo);
|
||||
return Result.OK("重启成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取IPC设备能力集
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getIpcCapability")
|
||||
public Result<JSONObject> getIpcCapability(CameraInfo cameraInfo) {
|
||||
return service.getIpcCapability(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步此项目下的IPC设备
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/syncProjectIpcDevice")
|
||||
public Result<String> syncProjectIpcDevice(CameraInfo cameraInfo) {
|
||||
return service.syncProjectIpcDevice(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详情信息
|
||||
*
|
||||
|
|
@ -159,116 +93,6 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.getDeviceDetails(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画面基本信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getImageCommon")
|
||||
public Result<JSONObject> getImageCommon(@RequestBody Map<String,Object> map) {
|
||||
return service.getImageCommon(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置画面基本信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setImageCommon")
|
||||
public Result setImageCommon(@RequestBody Map<String,Object> map) {
|
||||
return service.setImageCommon(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画面操作信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getImageSwitch")
|
||||
public Result<JSONObject> getImageSwitch(@RequestBody Map<String,Object> map) {
|
||||
return service.getImageSwitch(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置画面操作信息
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setImageSwitch")
|
||||
public Result setImageSwitch(@RequestBody Map<String,Object> map) {
|
||||
return service.setImageSwitch(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSD能力集
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getOsdCapability")
|
||||
public Result<JSONObject> getOsdCapability(@RequestBody Map<String,Object> map) {
|
||||
return service.getOsdCapability(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSD参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getOsd")
|
||||
public Result<JSONObject> getOsd(@RequestBody Map<String,Object> map) {
|
||||
return service.getOsd(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置OSD参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setOsd")
|
||||
public Result<String> setOsd(@RequestBody Map<String,Object> map) {
|
||||
return service.setOsd(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取码率参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getVideoParams")
|
||||
public Result<JSONObject> getVideoParams(@RequestBody Map<String,Object> map) {
|
||||
return service.getVideoParams(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置码率参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setVideoParams")
|
||||
public Result setVideoParams(@RequestBody Map<String,Object> map) {
|
||||
return service.setVideoParams(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复画面默认值
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/configRecovery")
|
||||
public Result configRecovery(@RequestBody Map<String,Object> map) {
|
||||
return service.configRecovery(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头实时播放地址
|
||||
*
|
||||
|
|
@ -280,130 +104,6 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.getPreviewUrl(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取存储设备列表
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getStorageDevice")
|
||||
public Result getStorageDevice(CameraInfo cameraInfo) throws Exception{
|
||||
return service.getStorageDevice(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有录像计划列表
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getAllRecordPlans")
|
||||
public Result getAllRecordPlans(CameraInfo cameraInfo) throws Exception{
|
||||
return service.getAllRecordPlans(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加录像计划
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addRecordCfgs")
|
||||
public Result addRecordCfgs(@RequestBody CameraInfo cameraInfo) throws Exception{
|
||||
return service.addRecordCfgs(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置录像计划
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setRecordCfgs")
|
||||
public Result setRecordCfgs(@RequestBody CameraInfo cameraInfo) throws Exception{
|
||||
return service.setRecordCfgs(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除录像计划
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/delRecordCfgs")
|
||||
public Result delRecordCfgs(CameraInfo cameraInfo) throws Exception{
|
||||
return service.delRecordCfgs(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取录像配置
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getRecordCfgs")
|
||||
public Result<IPage<CameraInfo>> getRecordCfgs(CameraInfo cameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) throws Exception{
|
||||
IPage<CameraInfo> pageList = service.getRecordCfgs(cameraInfo,pageNo,pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取批量操作录像计划进度
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getBatchProgress")
|
||||
public Result getBatchProgress(CameraInfo cameraInfo) throws Exception{
|
||||
return service.getBatchProgress(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取镜头遮挡参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getTamperDet")
|
||||
public Result<JSONObject> getTamperDet(@RequestBody Map<String,Object> map) {
|
||||
return service.getTamperDet(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置镜头遮挡参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setTamperDet")
|
||||
public Result<String> setTamperDet(@RequestBody Map<String,Object> map) {
|
||||
return service.setTamperDet(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取镜头遮挡处理方式
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getTamperNotif")
|
||||
public Result<JSONObject> getTamperNotif(@RequestBody Map<String,Object> map) {
|
||||
return service.getTamperNotif(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置镜头遮挡处理方式
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setTamperNotif")
|
||||
public Result setTamperNotif(@RequestBody Map<String,Object> map) {
|
||||
return service.setTamperNotif(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报警声音试听
|
||||
*
|
||||
|
|
@ -415,86 +115,6 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.testAudio(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取白光/声音告警参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getAlarmInfo")
|
||||
public Result<JSONObject> getAlarmInfo(@RequestBody Map<String,Object> map) {
|
||||
return service.getAlarmInfo(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白光/声音告警参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setAlarmInfo")
|
||||
public Result<String> setAlarmInfo(@RequestBody Map<String,Object> map) {
|
||||
return service.setAlarmInfo(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取白光/声音告警布防时间
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getAlarmPlan")
|
||||
public Result<JSONObject> getAlarmPlan(@RequestBody Map<String,Object> map) {
|
||||
return service.getAlarmPlan(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置白光/声音告警布防时间
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/setAlarmPlan")
|
||||
public Result setAlarmPlan(@RequestBody Map<String,Object> map) {
|
||||
return service.setAlarmPlan(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索某天的录像数据
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/searchVideo")
|
||||
public Result<IPage<CameraInfo>> searchVideo(CameraInfo cameraInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
return service.searchVideo(pageNo, pageSize, cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头录像回放地址
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getPlaybackUrlList")
|
||||
public Result<Map<String,Object>> getPlaybackUrlList(CameraInfo cameraInfo) {
|
||||
return service.getPlaybackUrlList(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回放通道
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/deletePlaybackChn")
|
||||
public Result<String> deletePlaybackChn(CameraInfo cameraInfo) {
|
||||
return service.deletePlaybackChn(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取摄像头录像回放地址
|
||||
*
|
||||
|
|
@ -506,39 +126,6 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
|||
return service.getMultitransUrl(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回放视频转mp4上传
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/uploadToServer")
|
||||
public Result uploadToServer(CameraInfo cameraInfo) throws Exception{
|
||||
return service.uploadToServer(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止转存MP4上传任务
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/stopUploadToServer")
|
||||
public Result<String> stopUploadToServer(CameraInfo cameraInfo) throws Exception{
|
||||
return service.stopUploadToServer(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转存MP4上传任务进度
|
||||
*
|
||||
* @param cameraInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getUploadToServerProcess")
|
||||
public Result getUploadToServerProcess(CameraInfo cameraInfo) throws Exception{
|
||||
return service.getUploadToServerProcess(cameraInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速球机移动方向控制
|
||||
*
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class CameraInfo implements Serializable {
|
|||
/**设备编码*/
|
||||
@Excel(name = "设备编码", width = 15)
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
@TableField(exist = false)
|
||||
private String sn;
|
||||
/**设备序号*/
|
||||
@Excel(name = "设备序号", width = 15)
|
||||
|
|
@ -141,101 +142,21 @@ public class CameraInfo implements Serializable {
|
|||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元编码")
|
||||
@Dict(dictTable ="nu_base_info",dicText = "nu_name",dicCode = "nu_id")
|
||||
@TableField(exist = false)
|
||||
private String nuId;
|
||||
|
||||
/**设备维度*/
|
||||
@Excel(name = "设备维度", width = 15)
|
||||
@ApiModelProperty(value = "设备维度")
|
||||
@Dict(dicCode = "dimension")
|
||||
private String dimension;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
private String nuName;
|
||||
/**区域属性*/
|
||||
@TableField(exist = false)
|
||||
@Dict(dicCode = "nu_type")
|
||||
private java.lang.String areaFlag;
|
||||
private String nuName;
|
||||
|
||||
@ApiModelProperty(value = "码流类型 0 代表主码流,1 代码子码流")
|
||||
@TableField(exist = false)
|
||||
private int streamType;
|
||||
|
||||
@ApiModelProperty(value = "录像计划ID")
|
||||
private String recordPlanId;
|
||||
@ApiModelProperty(value = "录像计划名称")
|
||||
@TableField(exist = false)
|
||||
private String planName;
|
||||
@ApiModelProperty(value = "批量处理类型 1:表示查询添加进度,2:表示查询设置进度,3:表示查询删除进度")
|
||||
@TableField(exist = false)
|
||||
private int batchType;
|
||||
/**
|
||||
* 能力集属性 ==>
|
||||
*/
|
||||
@ApiModelProperty(value = "运动检测")
|
||||
@TableField(exist = false)
|
||||
private String motionDetection;
|
||||
@ApiModelProperty(value = "视频封面")
|
||||
@TableField(exist = false)
|
||||
private String videoCover;
|
||||
@ApiModelProperty(value = "云台")
|
||||
@TableField(exist = false)
|
||||
private String ptz;
|
||||
@ApiModelProperty(value = "motor")
|
||||
@TableField(exist = false)
|
||||
private String motor;
|
||||
@ApiModelProperty(value = "smartCode")
|
||||
@TableField(exist = false)
|
||||
private String smartCode;
|
||||
@ApiModelProperty(value = "强制在H.264编码过程中生成IDR帧的函数")
|
||||
@TableField(exist = false)
|
||||
private String forceIdrFrame;
|
||||
@ApiModelProperty(value = "音频")
|
||||
@TableField(exist = false)
|
||||
private String audio;
|
||||
@ApiModelProperty(value = "本地存储")
|
||||
@TableField(exist = false)
|
||||
private String localStorage;
|
||||
@ApiModelProperty(value = "回放API本版")
|
||||
@TableField(exist = false)
|
||||
private String playbackApiVersionTwo;
|
||||
@ApiModelProperty(value = "多变性")
|
||||
@TableField(exist = false)
|
||||
private String multitrans;
|
||||
@ApiModelProperty(value = "客流")
|
||||
@TableField(exist = false)
|
||||
private String passengerFlow;
|
||||
@ApiModelProperty(value = "获取预览缩略图")
|
||||
@TableField(exist = false)
|
||||
private String getPreviewThumbnail;
|
||||
@ApiModelProperty(value = "JPG预览缩略图")
|
||||
@TableField(exist = false)
|
||||
private String previewThumbnailJpeg;
|
||||
@ApiModelProperty(value = "走廊")
|
||||
@TableField(exist = false)
|
||||
private String corridorMod;
|
||||
@ApiModelProperty(value = "背光共存")
|
||||
@TableField(exist = false)
|
||||
private String backlightCoexistence;
|
||||
/**
|
||||
* <== 能力集属性
|
||||
*/
|
||||
@ApiModelProperty(value = "查询日期")
|
||||
@TableField(exist = false)
|
||||
private String dataDate;
|
||||
@ApiModelProperty(value = "设备索引")
|
||||
@TableField(exist = false)
|
||||
private String videoDevId;
|
||||
@ApiModelProperty(value = "存储设备ID")
|
||||
@TableField(exist = false)
|
||||
private String storageDevId;
|
||||
@ApiModelProperty(value = "存储设备名称")
|
||||
@TableField(exist = false)
|
||||
private String storageDevName;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID,双摄IPC的全景摄像头,其值为0.双摄IPC的特写摄像头,其值为1")
|
||||
@TableField(exist = false)
|
||||
private String channelId;
|
||||
@ApiModelProperty(value = "当录像存在存储池中, 录像所属的nvs的ID")
|
||||
@TableField(exist = false)
|
||||
private String nvsIdInPoolList;
|
||||
|
||||
@ApiModelProperty(value = "录像开始时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
|
|
@ -323,8 +244,6 @@ public class CameraInfo implements Serializable {
|
|||
private String ftpUsername; //回放视频转FTP上传用户
|
||||
private String ftpPassword; //回放视频转FTP上传密码
|
||||
private String ftpUploadpath; //回放视频转FTP上传路径
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
private String remarks;//备注
|
||||
private String channel;//通道号
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
package com.nu.modules.tplink.camera.job;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||
import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
||||
import com.nu.modules.tplink.utils.TumsApi;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 摄像头能力集同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class CameraCapabilitySyncJob implements Job {
|
||||
|
||||
@Autowired
|
||||
ICameraInfoService service;
|
||||
|
||||
@Autowired
|
||||
private TumsApi tumsApi;
|
||||
|
||||
//摄像头能力集同步,每10分钟
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
List<CameraInfo> list = service.findAllList();
|
||||
if(list!=null&&list.size()>0){
|
||||
for(int i=0;i< list.size();i++){
|
||||
CameraInfo cameraInfo = list.get(i);
|
||||
String id = cameraInfo.getDeviceIndex();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("{");
|
||||
sb.append("\"devId\"").append(":").append("\"").append(id).append("\"");
|
||||
sb.append("}");
|
||||
String jsonResponse = tumsApi.getIpcCapability(sb.toString());
|
||||
JSONObject jsonObject = new JSONObject(jsonResponse);
|
||||
String errorCode = jsonObject.getStr("error_code");
|
||||
if(errorCode.equals("0")){
|
||||
service.syncCapability(id,jsonResponse);
|
||||
}else{
|
||||
log.error("CameraCapabilitySyncJob:{}-{}", DateUtils.now(),"devId:"+id+","+jsonObject.getStr("msg"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.nu.modules.tplink.camera.job;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 摄像头设备信息同步
|
||||
*/
|
||||
@Slf4j
|
||||
public class CameraDeviceSyncJob implements Job {
|
||||
|
||||
@Autowired
|
||||
ICameraInfoService service;
|
||||
|
||||
//每10分钟获取设备在线状态
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
List<CameraInfo> list = service.findAllList();
|
||||
if(list!=null&&list.size()>0){
|
||||
for(int i=0;i< list.size();i++){
|
||||
CameraInfo cameraInfo = list.get(i);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("deviceIndex",cameraInfo.getDeviceIndex());
|
||||
map.put("type","switch");
|
||||
try{
|
||||
Result<JSONObject> result = service.getImageCommon(map);
|
||||
log.error("CameraDeviceSyncJob:{}-{}", DateUtils.now(),result.getResult());
|
||||
|
||||
}catch (Exception e){
|
||||
log.info(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,16 +20,8 @@ import java.util.List;
|
|||
public interface CameraInfoMapper extends BaseMapper<CameraInfo> {
|
||||
IPage<CameraInfo> findPage(Page<CameraInfo> page, @Param("params") CameraInfo cameraInfo);
|
||||
List<CameraInfo> findList(CameraInfo cameraInfo);
|
||||
List<CameraInfo> findAllList();
|
||||
IPage<CameraInfo> findNuPage(Page<CameraInfo> page, @Param("params") CameraInfo cameraInfo);
|
||||
List<CameraInfo> findAllList(CameraInfo cameraInfo);
|
||||
CameraInfo getByDeviceId(CameraInfo cameraInfo);
|
||||
CameraInfo getCapabilityByDeviceId(CameraInfo cameraInfo);
|
||||
void insertCapability(CameraInfo cameraInfo);
|
||||
void updateCapabilityById(CameraInfo cameraInfo);
|
||||
void updateDeviceStatusByDevId(CameraInfo cameraInfo);
|
||||
void updatePlanByDevId(CameraInfo cameraInfo);
|
||||
|
||||
IPage<CameraInfo> previewList(Page<CameraInfo> page, @Param("params") CameraInfo cameraInfo);
|
||||
void release(CameraInfo cameraInfo);
|
||||
void updateBind(CameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,9 @@
|
|||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
record_plan_id as recordPlanId,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
ifnull(c.multitrans,0) as multitrans,
|
||||
a.sn,
|
||||
a.maintain_status,
|
||||
a.channel
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
from nu_iot_tplink_camera a
|
||||
left join nu_iot_tplink_camera_capability c on a.device_index = c.device_index
|
||||
<where>
|
||||
<if test="params.deviceIndex != null and params.deviceIndex != ''">
|
||||
|
|
@ -50,12 +45,6 @@
|
|||
<if test="params.regionName != null and params.regionName != ''">
|
||||
AND a.region_name LIKE concat('%',#{params.regionName},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
<if test="params.projectId != null and params.projectId != ''">
|
||||
AND a.project_id = #{params.projectId}
|
||||
</if>
|
||||
|
|
@ -88,11 +77,8 @@
|
|||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
record_plan_id as recordPlanId,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
a.channel
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
from nu_iot_tplink_camera a
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
AND a.project_id = #{projectId}
|
||||
|
|
@ -100,63 +86,40 @@
|
|||
<if test="regionId != null and regionId != ''">
|
||||
AND a.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="recordPlanId != null and recordPlanId != ''">
|
||||
AND ifnull(a.record_plan_id,'-1') = #{recordPlanId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findAllList" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
-- select a.id,
|
||||
-- device_index as deviceIndex,
|
||||
-- device_name as deviceName,
|
||||
-- device_type as deviceType,
|
||||
-- device_status as deviceStatus,
|
||||
-- device_model as deviceModel,
|
||||
-- ip as ip,
|
||||
-- mac as mac,
|
||||
-- region_id as regionId,
|
||||
-- region_name as regionName,
|
||||
-- parent_id as parentId,
|
||||
-- parent_device_name as parentDeviceName,
|
||||
-- project_id as projectId,
|
||||
-- project_name as projectName,
|
||||
-- firmware_ver as firmwareVer,
|
||||
-- hardware_ver as hardwareVer,
|
||||
-- manager_auth_type as managerAuthType,
|
||||
-- msg_auth_type as msgAuthType,
|
||||
-- sip_code as sipCode,
|
||||
-- location_name as locationName,
|
||||
-- system_type as systemType,
|
||||
-- protocol as protocol,
|
||||
-- record_plan_id as recordPlanId,
|
||||
-- nu_id as nuId,
|
||||
-- a.channel
|
||||
-- from nu_iot_tplink_camera a
|
||||
select a.*,
|
||||
select a.id,
|
||||
a.device_index as deviceIndex,
|
||||
b.device_name as deviceName,
|
||||
b.device_type as deviceType,
|
||||
a.device_status as deviceStatus,
|
||||
b.device_model as deviceModel,
|
||||
b.nu_id as nuId
|
||||
a.ip as ip,
|
||||
a.mac as mac,
|
||||
a.region_id as regionId,
|
||||
a.region_name as regionName,
|
||||
a.parent_id as parentId,
|
||||
a.parent_device_name as parentDeviceName,
|
||||
a.project_id as projectId,
|
||||
a.project_name as projectName,
|
||||
a.firmware_ver as firmwareVer,
|
||||
a.hardware_ver as hardwareVer,
|
||||
a.manager_auth_type as managerAuthType,
|
||||
a.msg_auth_type as msgAuthType,
|
||||
a.sip_code as sipCode,
|
||||
a.location_name as locationName,
|
||||
a.system_type as systemType,
|
||||
a.protocol as protocol,
|
||||
b.nu_id as nuId,
|
||||
a.channel
|
||||
from nu_iot_tplink_camera a
|
||||
inner join nu_iot_device_preview b on a.mac = b.sn
|
||||
where b.device_status != '损坏'
|
||||
</select>
|
||||
|
||||
<select id="findNuPage" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select
|
||||
nu_id as nuId,
|
||||
nu_name as nuName
|
||||
from nu_base_info b
|
||||
<where>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND b.nu_id = #{params.nuId}
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND b.nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND b.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByDeviceId" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
|
|
@ -182,98 +145,11 @@
|
|||
location_name as locationName,
|
||||
system_type as systemType,
|
||||
protocol as protocol,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
a.channel
|
||||
from nu_iot_tplink_camera a left join nu_base_info b on a.nu_id = b.nu_id
|
||||
from nu_iot_tplink_camera a
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
<select id="getCapabilityByDeviceId" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select a.id,
|
||||
device_index as deviceIndex,
|
||||
motion_detection as motionDetection,
|
||||
video_cover as videoCover,
|
||||
ptz,
|
||||
motor,
|
||||
smart_code as smartCode,
|
||||
force_idr_frame as forceIdrFrame,
|
||||
audio,
|
||||
local_storage as localStorage,
|
||||
playback_api_version_two as playbackApiVersionTwo,
|
||||
multitrans,
|
||||
passenger_flow as passengerFlow,
|
||||
get_preview_thumbnail as getPreviewThumbnail,
|
||||
preview_thumbnail_jpeg as previewThumbnailJpeg,
|
||||
corridor_mod as corridorMod,
|
||||
backlight_coexistence as backlightCoexistence
|
||||
from nu_iot_tplink_camera_capability a
|
||||
where device_index = #{deviceIndex}
|
||||
</select>
|
||||
|
||||
<insert id="insertCapability">
|
||||
insert into nu_iot_tplink_camera_capability (
|
||||
id,
|
||||
device_index,
|
||||
motion_detection,
|
||||
video_cover,
|
||||
ptz,
|
||||
motor,
|
||||
smart_code,
|
||||
force_idr_frame,
|
||||
audio,
|
||||
local_storage,
|
||||
playback_api_version_two,
|
||||
multitrans,
|
||||
passenger_flow,
|
||||
get_preview_thumbnail,
|
||||
preview_thumbnail_jpeg,
|
||||
corridor_mod,
|
||||
backlight_coexistence
|
||||
)
|
||||
values (
|
||||
#{id},
|
||||
#{deviceIndex},
|
||||
#{motionDetection},
|
||||
#{videoCover},
|
||||
#{ptz},
|
||||
#{motor},
|
||||
#{smartCode},
|
||||
#{forceIdrFrame},
|
||||
#{audio},
|
||||
#{localStorage},
|
||||
#{playbackApiVersionTwo},
|
||||
#{multitrans},
|
||||
#{passengerFlow},
|
||||
#{getPreviewThumbnail},
|
||||
#{previewThumbnailJpeg},
|
||||
#{corridorMod},
|
||||
#{backlightCoexistence}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateCapabilityById">
|
||||
UPDATE nu_iot_tplink_camera_capability
|
||||
SET
|
||||
device_index = #{deviceIndex},
|
||||
motion_detection = #{motionDetection},
|
||||
video_cover = #{videoCover},
|
||||
ptz = #{ptz},
|
||||
motor = #{motor},
|
||||
smart_code = #{smartCode},
|
||||
force_idr_frame = #{forceIdrFrame},
|
||||
audio = #{audio},
|
||||
local_storage = #{localStorage},
|
||||
playback_api_version_two = #{playbackApiVersionTwo},
|
||||
multitrans = #{multitrans},
|
||||
passenger_flow = #{passengerFlow},
|
||||
get_preview_thumbnail = #{getPreviewThumbnail},
|
||||
preview_thumbnail_jpeg = #{previewThumbnailJpeg},
|
||||
corridor_mod = #{corridorMod},
|
||||
backlight_coexistence = #{backlightCoexistence}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateDeviceStatusByDevId">
|
||||
UPDATE nu_iot_tplink_camera
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -283,12 +159,6 @@
|
|||
where device_index = #{deviceIndex}
|
||||
</update>
|
||||
|
||||
<update id="updatePlanByDevId">
|
||||
UPDATE nu_iot_tplink_camera
|
||||
SET record_plan_id = #{recordPlanId}
|
||||
where device_index = #{deviceIndex}
|
||||
</update>
|
||||
|
||||
<select id="previewList" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||
select
|
||||
a.id,
|
||||
|
|
@ -335,9 +205,6 @@
|
|||
<if test="params.nuName != null and params.nuName != ''">
|
||||
AND c.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||
</if>
|
||||
<if test="params.dimension != null and params.dimension != ''">
|
||||
AND a.dimension = #{params.dimension}
|
||||
</if>
|
||||
<if test="params.deviceType != null and params.deviceType != ''">
|
||||
AND a.device_type = #{params.deviceType}
|
||||
</if>
|
||||
|
|
@ -347,21 +214,5 @@
|
|||
order by a.device_type,a.device_model,a.sn
|
||||
</select>
|
||||
|
||||
<update id="release">
|
||||
update nu_iot_tplink_camera
|
||||
set
|
||||
nu_id = null,
|
||||
nu_name = null,
|
||||
dimension = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateBind">
|
||||
update nu_iot_tplink_camera
|
||||
set
|
||||
nu_id = #{nuId},
|
||||
dimension = #{dimension}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -22,78 +22,11 @@ public interface ICameraInfoService extends IService<CameraInfo> {
|
|||
IPage<CameraInfo> findPage(Page<CameraInfo> page, CameraInfo cameraInfo);
|
||||
List<CameraTreeModel> findModelList(CameraInfo cameraInfo);
|
||||
List<CameraInfo> findAllList();
|
||||
IPage<CameraInfo> findNuPage(Page<CameraInfo> page, CameraInfo cameraInfo);
|
||||
void edit(CameraInfo cameraInfo);
|
||||
void rebootDevice(CameraInfo cameraInfo);
|
||||
void sync(String jsonResponse);
|
||||
void syncCapability(String deviceIndex,String jsonResponse);
|
||||
Result<String> syncProjectIpcDevice(CameraInfo cameraInfo);
|
||||
Result<JSONObject> getIpcCapability(CameraInfo cameraInfo);
|
||||
Result<JSONObject> getDeviceDetails(CameraInfo cameraInfo);
|
||||
Result<JSONObject> getImageCommon(Map<String,Object> map);
|
||||
Result setImageCommon(Map<String,Object> map);
|
||||
Result<JSONObject> getImageSwitch(Map<String,Object> map);
|
||||
Result setImageSwitch(Map<String,Object> map);
|
||||
Result<JSONObject> getOsdCapability(Map<String,Object> map);
|
||||
Result<JSONObject> getOsd(Map<String,Object> map);
|
||||
Result<String> setOsd(Map<String,Object> map);
|
||||
Result<JSONObject> getVideoParams(Map<String,Object> map);
|
||||
Result setVideoParams(Map<String,Object> map);
|
||||
Result configRecovery(Map<String,Object> map);
|
||||
Result<Map<String,String>> getPreviewUrl(CameraInfo cameraInfo);
|
||||
Result getStorageDevice(CameraInfo cameraInfo) throws Exception;
|
||||
Result getAllRecordPlans(CameraInfo cameraInfo) throws Exception;
|
||||
Result addRecordCfgs(CameraInfo cameraInfo) throws Exception;
|
||||
Result setRecordCfgs(CameraInfo cameraInfo) throws Exception;
|
||||
Result delRecordCfgs(CameraInfo cameraInfo) throws Exception;
|
||||
IPage<CameraInfo> getRecordCfgs(CameraInfo cameraInfo,Integer pageNo,Integer pageSize) throws Exception;
|
||||
Result getBatchProgress(CameraInfo cameraInfo) throws Exception;
|
||||
Result<JSONObject> getTamperDet(Map<String,Object> map);
|
||||
Result<String> setTamperDet(Map<String,Object> map);
|
||||
Result<JSONObject> getTamperNotif(Map<String,Object> map);
|
||||
Result setTamperNotif(Map<String,Object> map);
|
||||
Result testAudio(Map<String,Object> map);
|
||||
Result<JSONObject> getAlarmInfo(Map<String,Object> map);
|
||||
Result<String> setAlarmInfo(Map<String,Object> map);
|
||||
Result<JSONObject> getAlarmPlan(Map<String,Object> map);
|
||||
Result setAlarmPlan(Map<String,Object> map);
|
||||
Result<IPage<CameraInfo>> searchVideo(Integer pageNo, Integer pageSize, CameraInfo cameraInfo);
|
||||
Result<Map<String,Object>> getPlaybackUrlList(CameraInfo cameraInfo);
|
||||
Result<String> deletePlaybackChn(CameraInfo cameraInfo);
|
||||
Result<Map<String,Object>> getMultitransUrl(CameraInfo cameraInfo) throws Exception;
|
||||
|
||||
/**
|
||||
* 功能:tplink下载服务视频
|
||||
*
|
||||
* @param cameraInfo 参数如下<br/>
|
||||
* deviceIndex设备序号<br/>
|
||||
* parentId父设备id<br/>
|
||||
* fileName文件名称<br/>
|
||||
* videoType回放录像类型。1代表定时录像,2代表移动侦测录像,3代表全选<br/>
|
||||
* ftpUploadpath视频上传位置<br/>
|
||||
* startTime开始时间<br/>
|
||||
* endTime结束时间<br/>
|
||||
* @return
|
||||
*/
|
||||
Result uploadToServer(CameraInfo cameraInfo);
|
||||
Result<String> stopUploadToServer(CameraInfo cameraInfo);
|
||||
Result getUploadToServerProcess(CameraInfo cameraInfo);
|
||||
Result motionCtrl(CameraInfo cameraInfo);
|
||||
|
||||
void baoxiu(CameraInfo cameraInfo);
|
||||
|
||||
/**
|
||||
* 下载tplink自定义录像
|
||||
* @param nuId 护理单元id
|
||||
* @param startTime 下载开始时间
|
||||
* @param endTime 下载结束时间
|
||||
* @return
|
||||
*/
|
||||
String zdyTplinkVideo(String nuId, String startTime, String endTime);
|
||||
|
||||
IPage<CameraInfo> previewList(Page<CameraInfo> page, CameraInfo cameraInfo);
|
||||
|
||||
//释放设备
|
||||
void release(CameraInfo cameraInfo);
|
||||
void updateBind(CameraInfo cameraInfo);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -76,7 +76,6 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
|||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "修改机构及护理单元信息")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ElectricityMeter electricityMeter) {
|
||||
|
|
@ -84,11 +83,4 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
|||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody ElectricityMeter electricityMeter) {
|
||||
service.baoxiu(electricityMeter);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,23 +68,8 @@ public class ElectricityMeter implements Serializable {
|
|||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
private String sim;
|
||||
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
@TableField(exist = false)
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String oldServerUrl;//原机构服务地址
|
||||
private String syncType;//是否同步 0 未同步 1已同步
|
||||
private String oldDepartId;//原机构id
|
||||
private String oldDepartName;//原机构名称
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
private String dimension;//设备维度
|
||||
@TableField(exist = false)
|
||||
private String deviceStatus;//设备状态
|
||||
@TableField(exist = false)
|
||||
private String deviceModel;
|
||||
|
||||
}
|
||||
|
|
@ -14,6 +14,4 @@ public interface ElectricityMeterMapper extends BaseMapper<ElectricityMeter> {
|
|||
int update(ElectricityMeter electricityMeter);
|
||||
int updateValue(ElectricityMeter electricityMeter);
|
||||
int updateRelayState(ElectricityMeter electricityMeter);
|
||||
void release(ElectricityMeter electricityMeter);
|
||||
void updateBind(ElectricityMeter electricityMeter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,26 +12,16 @@
|
|||
a.read_time as readTime,
|
||||
a.remark,
|
||||
( case when timestampdiff(minute, str_to_date(read_time, '%y-%m-%d %h:%i:%s'), now()) > 120 then 'false' else 'true' end ) as online,
|
||||
a.nu_id as nuId,
|
||||
c.nu_name as nuName,
|
||||
a.depart_id as departId,
|
||||
a.depart_name as departName,
|
||||
a.depart_server_url as departServerUrl,
|
||||
a.old_server_url ,
|
||||
a.sync_type,
|
||||
a.maintain_status,
|
||||
b.nu_id as nuId,
|
||||
a.sim
|
||||
from nu_iot_ds_electricity_meter a
|
||||
left join nu_base_info c on a.nu_id = c.nu_id
|
||||
<where>
|
||||
inner join nu_iot_device_preview b on a.sn = b.sn
|
||||
where b.device_status != '损坏'
|
||||
<if test="params.sn != null and params.sn != ''">
|
||||
AND a.sn like concat('%',#{params.sn},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.departId != null and params.departId != ''">
|
||||
AND a.depart_id = #{params.departId}
|
||||
AND b.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.relayState != null and params.relayState != ''">
|
||||
AND a.relay_state = #{params.relayState}
|
||||
|
|
@ -39,7 +29,6 @@
|
|||
<if test="params.online != null and params.online != ''">
|
||||
AND ( case when timestampdiff(minute, str_to_date(read_time, '%y-%m-%d %h:%i:%s'), now()) > 120 then 'false' else 'true' end ) = #{params.online}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findAllList" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||
|
|
@ -52,16 +41,14 @@
|
|||
a.read_time as readTime,
|
||||
a.remark,
|
||||
( case when timestampdiff(minute, str_to_date(read_time, '%y-%m-%d %h:%i:%s'), now()) > 120 then 'false' else 'true' end ) as online,
|
||||
a.nu_id as nuId,
|
||||
a.nu_name as nuName,
|
||||
a.depart_id as departId,
|
||||
a.depart_name as departName,
|
||||
a.depart_server_url as departServerUrl,
|
||||
a.old_server_url ,
|
||||
a.sync_type,
|
||||
a.maintain_status,
|
||||
a.sim
|
||||
a.sim,
|
||||
b.nu_id
|
||||
from nu_iot_ds_electricity_meter a
|
||||
inner join nu_iot_device_preview b on a.sn = b.sn
|
||||
where b.device_status != '损坏'
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND b.nu_id = #{nuId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getElectricityMeter" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||
|
|
@ -74,12 +61,7 @@
|
|||
read_time as readTime,
|
||||
( case when timestampdiff(minute, str_to_date(read_time, '%y-%m-%d %h:%i:%s'), now()) > 120 then 'false' else 'true' end ) as online,
|
||||
remark,
|
||||
sim,
|
||||
nu_id as nuId,
|
||||
nu_name as nuName,
|
||||
depart_id as departId,
|
||||
depart_name as departName,
|
||||
depart_server_url as departServerUrl
|
||||
sim
|
||||
from nu_iot_ds_electricity_meter
|
||||
where sn = #{sn}
|
||||
</select>
|
||||
|
|
@ -111,21 +93,4 @@
|
|||
where sn = #{sn}
|
||||
</update>
|
||||
|
||||
<update id="release">
|
||||
update nu_iot_ds_electricity_meter
|
||||
set
|
||||
nu_id = null,
|
||||
nu_name = null,
|
||||
dimension = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateBind">
|
||||
update nu_iot_ds_electricity_meter
|
||||
set
|
||||
nu_id = #{nuId},
|
||||
dimension = #{dimension}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -16,12 +16,5 @@ public interface IElectricityMeterService extends IService<ElectricityMeter> {
|
|||
Result<String> eleReset(ElectricityMeter electricityMeter);
|
||||
Result<String> eleControl(ElectricityMeter electricityMeter);
|
||||
Result<String> eleRead(ElectricityMeter electricityMeter);
|
||||
|
||||
void editHldy(ElectricityMeter electricityMeter);
|
||||
|
||||
void baoxiu(ElectricityMeter electricityMeter);
|
||||
|
||||
void processReceivedMessage(String payload);
|
||||
void release(ElectricityMeter electricityMeter);
|
||||
void updateBind(ElectricityMeter electricityMeter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,24 @@
|
|||
package com.nu.modules.tq.electricity.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.dto.IotElectricityMeterMQDto;
|
||||
import com.nu.entity.ElectricityMeterEntity;
|
||||
import com.nu.modules.electricitymeter.api.IElectricityMeterApi;
|
||||
import com.nu.modules.syncLog.entity.SyncBizLog;
|
||||
import com.nu.modules.syncLog.service.ISyncBizLogService;
|
||||
import com.nu.modules.tq.common.entity.TqApiLog;
|
||||
import com.nu.modules.tq.common.service.ITqApiLogService;
|
||||
import com.nu.modules.tq.utils.*;
|
||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||
import com.nu.modules.tq.electricity.mapper.ElectricityMeterMapper;
|
||||
import com.nu.modules.tq.electricity.service.IElectricityMeterService;
|
||||
import me.zhyd.oauth.utils.UuidUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -41,18 +27,9 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMapper, ElectricityMeter> implements IElectricityMeterService, IElectricityMeterApi {
|
||||
|
||||
@Autowired
|
||||
private TqApi tqApi;
|
||||
|
||||
@Autowired
|
||||
private ITqApiLogService logService;
|
||||
|
||||
@Autowired
|
||||
private ISyncBizLogService bizLogService;
|
||||
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ElectricityMeterServiceImpl syncImpl;
|
||||
|
|
@ -117,13 +94,6 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
return syncImpl.eleReset(electricityMeter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(ElectricityMeterEntity electricityMeterEntity) {
|
||||
ElectricityMeter electricityMeter = new ElectricityMeter();
|
||||
BeanUtils.copyProperties(electricityMeterEntity,electricityMeter);
|
||||
syncImpl.baoxiu(electricityMeter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉合闸
|
||||
*/
|
||||
|
|
@ -235,112 +205,6 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
return syncImpl.eleRead(electricityMeter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 开关闸同步到业务系统
|
||||
*
|
||||
* @param electricityMeter
|
||||
*/
|
||||
private void syncControlMq(ElectricityMeter electricityMeter) {
|
||||
ElectricityMeter entity = baseMapper.getElectricityMeter(electricityMeter);
|
||||
if (entity != null) {
|
||||
IotElectricityMeterMQDto iem = new IotElectricityMeterMQDto();
|
||||
BeanUtils.copyProperties(entity, iem);
|
||||
String json = JSON.toJSONString(entity);
|
||||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
log.setServerType("电表");
|
||||
bizLogService.addLog(log);
|
||||
iem.setLogId(logId);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotDeviceValues", "hldy.iotElectricity.eleControl.async", iem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 抄表同步到业务系统
|
||||
*
|
||||
* @param electricityMeter
|
||||
*/
|
||||
private void syncValueMq(ElectricityMeter electricityMeter) {
|
||||
ElectricityMeter entity = baseMapper.getElectricityMeter(electricityMeter);
|
||||
if (entity != null) {
|
||||
IotElectricityMeterMQDto iem = new IotElectricityMeterMQDto();
|
||||
BeanUtils.copyProperties(entity, iem);
|
||||
String json = JSON.toJSONString(entity);
|
||||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
log.setServerType("电表");
|
||||
bizLogService.addLog(log);
|
||||
iem.setLogId(logId);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotDeviceValues", "hldy.iotElectricity.eleValue.async", iem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void editHldy(ElectricityMeter electricityMeter) {
|
||||
|
||||
ElectricityMeter oldParam = baseMapper.selectById(electricityMeter.getId());
|
||||
electricityMeter.setOldDepartId(oldParam.getDepartId());
|
||||
electricityMeter.setOldDepartName(oldParam.getDepartName());
|
||||
electricityMeter.setOldServerUrl(oldParam.getDepartServerUrl());
|
||||
baseMapper.updateById(electricityMeter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(ElectricityMeter electricityMeter) {
|
||||
electricityMeter.setMaintainStatus("1");
|
||||
baseMapper.updateById(electricityMeter);
|
||||
syncImpl.devopsBaoxiu(electricityMeter);
|
||||
}
|
||||
|
||||
@DS("devops")
|
||||
public void devopsBaoxiu(ElectricityMeter electricityMeter) {
|
||||
baseMapper.updateById(electricityMeter);
|
||||
}
|
||||
|
||||
//业务系统删除命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricityDel(String dataSourceCode, ElectricityMeter electricityMeter) {
|
||||
try {
|
||||
baseMapper.deleteById(electricityMeter.getId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//业务系统保存或者修改命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricitySaveOrUpdate(String dataSourceCode, ElectricityMeter electricityMeter) {
|
||||
try {
|
||||
QueryWrapper<ElectricityMeter> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("sn", electricityMeter.getSn());
|
||||
ElectricityMeter oldParam = baseMapper.selectOne(queryWrapper);//查询数据库中该表号数据原始数据
|
||||
if (oldParam == null) {
|
||||
baseMapper.insert(electricityMeter);
|
||||
} else {
|
||||
baseMapper.updateById(electricityMeter);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* mqtt收到消息,并处理
|
||||
*/
|
||||
|
|
@ -469,13 +333,5 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(ElectricityMeter electricityMeter){
|
||||
baseMapper.release(electricityMeter);
|
||||
}
|
||||
@Override
|
||||
public void updateBind(ElectricityMeter electricityMeter){
|
||||
baseMapper.updateBind(electricityMeter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,13 +75,4 @@ public class WaterMeterController extends JeecgController<WaterMeter, IWaterMete
|
|||
return service.waterRead(waterMeter);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value="设备报修", notes="设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody WaterMeter waterMeter) {
|
||||
service.baoxiu(waterMeter);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,18 +70,7 @@ public class WaterMeter implements Serializable {
|
|||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
@TableField(exist = false)
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
private String dimension;//设备维度
|
||||
@TableField(exist = false)
|
||||
private String sn;
|
||||
@TableField(exist = false)
|
||||
private String deviceModel;
|
||||
}
|
||||
|
|
@ -15,6 +15,4 @@ public interface WaterMeterMapper extends BaseMapper<WaterMeter> {
|
|||
int update(WaterMeter waterMeter);
|
||||
int updateValue(WaterMeter waterMeter);
|
||||
int updateRelayState(WaterMeter waterMeter);
|
||||
void release(WaterMeter waterMeter);
|
||||
void updateBind(WaterMeter waterMeter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,23 +16,16 @@
|
|||
b.csq,
|
||||
b.disconnect_time as disconnectTime,
|
||||
b.connect_time as connectTime,
|
||||
a.nu_id as nuId,
|
||||
c .nu_name as nuName,
|
||||
a.depart_id as departId,
|
||||
a.depart_name as departName,
|
||||
a.maintain_status
|
||||
c.nu_id as nuId
|
||||
from nu_iot_tq_water_meter a
|
||||
left join nu_iot_tq_collector b on a.cid = b.cid
|
||||
left join nu_base_info c on a.nu_id = c.nu_id
|
||||
inner join nu_iot_device_preview c on a.cid = c.sn
|
||||
<where>
|
||||
<if test="params.address != null and params.address != ''">
|
||||
AND a.address like concat('%',#{params.address},'%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.departId != null and params.departId != ''">
|
||||
AND a.depart_id = #{params.departId}
|
||||
AND c.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.relayState != null and params.relayState != ''">
|
||||
AND a.relay_state = #{params.relayState}
|
||||
|
|
@ -54,15 +47,21 @@
|
|||
|
||||
<select id="findAllList" parameterType="com.nu.modules.tq.water.entity.WaterMeter" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||
select
|
||||
id,
|
||||
cid,
|
||||
address,
|
||||
water_value as waterValue,
|
||||
relay_state as relayState,
|
||||
battery_state as batteryState,
|
||||
read_time as readTime,
|
||||
remark
|
||||
from nu_iot_tq_water_meter
|
||||
a.id,
|
||||
a.cid,
|
||||
a.address,
|
||||
a.water_value as waterValue,
|
||||
a.relay_state as relayState,
|
||||
a.battery_state as batteryState,
|
||||
a.read_time as readTime,
|
||||
a.remark,
|
||||
b.nu_id
|
||||
from nu_iot_tq_water_meter a
|
||||
inner join nu_iot_device_preview b on a.cid = b.sn
|
||||
where b.device_status != '损坏'
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND b.nu_id = #{nuId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getWaterMeter" parameterType="com.nu.modules.tq.water.entity.WaterMeter" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||
|
|
@ -74,12 +73,7 @@
|
|||
relay_state as relayState,
|
||||
battery_state as batteryState,
|
||||
read_time as readTime,
|
||||
remark,
|
||||
nu_id as nuId,
|
||||
nu_name as nuName,
|
||||
depart_id as departId,
|
||||
depart_name as departName,
|
||||
depart_server_url as departServerUrl
|
||||
remark
|
||||
from nu_iot_tq_water_meter
|
||||
where cid = #{cid}
|
||||
and address = #{address}
|
||||
|
|
@ -115,21 +109,4 @@
|
|||
and address = #{address}
|
||||
</update>
|
||||
|
||||
<update id="release">
|
||||
update nu_iot_tq_water_meter
|
||||
set
|
||||
nu_id = null,
|
||||
nu_name = null,
|
||||
dimension = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateBind">
|
||||
update nu_iot_tq_water_meter
|
||||
set
|
||||
nu_id = #{nuId},
|
||||
dimension = #{dimension}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -16,12 +16,7 @@ public interface IWaterMeterService extends IService<WaterMeter> {
|
|||
Result<String> waterReset(WaterMeter waterMeter);
|
||||
Result<String> waterControl(WaterMeter waterMeter);
|
||||
Result<String> waterRead(WaterMeter waterMeter);
|
||||
|
||||
String waterResetNotify(String response_content, String timestamp, String sign);
|
||||
String waterControlNotify(String response_content, String timestamp, String sign);
|
||||
String waterReadNotify(String response_content, String timestamp, String sign);
|
||||
|
||||
void baoxiu(WaterMeter waterMeter);
|
||||
void release(WaterMeter waterMeter);
|
||||
void updateBind(WaterMeter waterMeter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
|
|
@ -473,8 +471,6 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
|
|
@ -576,8 +572,6 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
|
|
@ -588,58 +582,6 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(WaterMeter waterMeter) {
|
||||
waterMeter.setMaintainStatus("1");
|
||||
baseMapper.updateById(waterMeter);
|
||||
syncImpl.devopsBaoxiu(waterMeter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(WaterMeter waterMeter) {
|
||||
baseMapper.release(waterMeter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBind(WaterMeter waterMeter) {
|
||||
baseMapper.updateBind(waterMeter);
|
||||
}
|
||||
|
||||
@DS("devops")
|
||||
public void devopsBaoxiu(WaterMeter waterMeter) {
|
||||
baseMapper.updateById(waterMeter);
|
||||
}
|
||||
|
||||
|
||||
//业务系统删除命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricityDel(String dataSourceCode, WaterMeter waterMeter) {
|
||||
try {
|
||||
baseMapper.deleteById(waterMeter.getId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//业务系统保存或者修改命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricitySaveOrUpdate(String dataSourceCode, WaterMeter waterMeter) {
|
||||
try {
|
||||
QueryWrapper<WaterMeter> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("cid", waterMeter.getCid());
|
||||
WaterMeter oldParam = baseMapper.selectOne(queryWrapper);//查询数据库中该表号数据原始数据
|
||||
if (oldParam == null) {
|
||||
baseMapper.insert(waterMeter);
|
||||
} else {
|
||||
baseMapper.updateById(waterMeter);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WaterMeterEntity> list(WaterMeterEntity waterMeterEntity, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
WaterMeter waterMeter = new WaterMeter();
|
||||
|
|
@ -682,10 +624,4 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
|||
return syncImpl.waterRead(waterMeter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(WaterMeterEntity waterMeterEntity) {
|
||||
WaterMeter waterMeter = new WaterMeter();
|
||||
BeanUtils.copyProperties(waterMeterEntity, waterMeter);
|
||||
syncImpl.waterRead(waterMeter);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,20 +130,4 @@ public class HumidDeviceController extends JeecgController<HumidDevice, IHumidDe
|
|||
service.updateById(humidDevice);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "修改温湿度表的机构及护理单元信息")
|
||||
@RequestMapping(value = "/editHldy", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> editHldy(@RequestBody HumidDevice humidDevice) {
|
||||
service.editHldy(humidDevice);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "设备报修")
|
||||
@ApiOperation(value = "设备报修", notes = "设备报修")
|
||||
@RequestMapping(value = "/baoxiu", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> baoxiu(@RequestBody HumidDevice humidDevice) {
|
||||
service.baoxiu(humidDevice);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,20 +107,6 @@ public class HumidDevice implements Serializable {
|
|||
private Integer alarmCn; //告警数量
|
||||
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
@TableField(exist = false)
|
||||
private String nuId;//护理单元ID
|
||||
private String nuName;//护理单元
|
||||
private String departId;//机构ID
|
||||
private String departName;//机构名称
|
||||
private String departServerUrl;//机构服务地址
|
||||
private String oldServerUrl;//原机构服务地址
|
||||
private String syncType;//是否同步 0 未同步 1已同步
|
||||
private String oldDepartId;//原机构id
|
||||
private String oldDepartName;//原机构名称
|
||||
/**维修状态*/
|
||||
private String maintainStatus;
|
||||
private String dimension;//设备维度
|
||||
@TableField(exist = false)
|
||||
private String deviceStatus;//设备状态
|
||||
@TableField(exist = false)
|
||||
private String deviceModel;
|
||||
}
|
||||
|
|
@ -19,6 +19,4 @@ public interface HumidDeviceMapper extends BaseMapper<HumidDevice> {
|
|||
int insertLog(HumidDevice humidDevice);
|
||||
IPage<HumidDevice> findLogPage(Page<HumidDevice> page, @Param("params") HumidDevice humidDevice);
|
||||
HumidDevice getHumidInfo(HumidDevice humidDevice);
|
||||
void release(HumidDevice humidDevice);
|
||||
void updateBind(HumidDevice humidDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,26 +27,15 @@
|
|||
a.status,
|
||||
a.reporting_time as reportingTime,
|
||||
a.electricity,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
a.depart_id as departId,
|
||||
a.depart_name as departName,
|
||||
a.depart_server_url as departServerUrl,
|
||||
a.old_server_url ,
|
||||
a.sync_type,
|
||||
(select count(*) from nu_iot_yiweilian_humid_alarm b where a.sn = b.sn and b.status = '0') as alarmCn,
|
||||
a.maintain_status
|
||||
b.nu_id as nuId
|
||||
from nu_iot_yiweilian_humid_device a
|
||||
left join nu_base_info b on a.nu_id = b.nu_id
|
||||
inner join nu_iot_device_preview b on a.sn = b.sn
|
||||
<where>
|
||||
<if test="params.sn != null and params.sn != ''">
|
||||
AND a.sn LIKE CONCAT('%', #{params.sn}, '%')
|
||||
</if>
|
||||
<if test="params.nuId != null and params.nuId != ''">
|
||||
AND a.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.departId != null and params.departId != ''">
|
||||
AND a.depart_id = #{params.departId}
|
||||
AND b.nu_id = #{params.nuId}
|
||||
</if>
|
||||
<if test="params.status != null and params.status != ''">
|
||||
AND a.status = #{params.status}
|
||||
|
|
@ -109,23 +98,13 @@
|
|||
humidity,
|
||||
status,
|
||||
reporting_time as reportingTime,
|
||||
electricity,
|
||||
nu_id as nuId,
|
||||
nu_name as nuName,
|
||||
depart_id as departId,
|
||||
depart_name as departName,
|
||||
depart_server_url as departServerUrl,
|
||||
old_server_url ,
|
||||
sync_type,
|
||||
electricity
|
||||
(select count(*) from nu_iot_yiweilian_humid_alarm b where a.sn = b.sn and b.status = '0') as alarmCn
|
||||
from nu_iot_yiweilian_humid_device
|
||||
<where>
|
||||
<if test="sn != null and sn != ''">
|
||||
AND sn = #{sn}
|
||||
</if>
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -394,36 +373,9 @@
|
|||
humidity,
|
||||
status,
|
||||
reporting_time as reportingTime,
|
||||
electricity,
|
||||
nu_id as nuId,
|
||||
nu_name as nuName,
|
||||
depart_id as departId,
|
||||
depart_name as departName,
|
||||
depart_server_url as departServerUrl,
|
||||
old_depart_id as oldDepartId,
|
||||
old_depart_name as oldDepartName,
|
||||
old_server_url as oldServerUrl,
|
||||
sync_type,
|
||||
del_flag as delFlag
|
||||
electricity
|
||||
from nu_iot_yiweilian_humid_device a
|
||||
where sn = #{sn}
|
||||
</select>
|
||||
|
||||
<update id="release">
|
||||
update nu_iot_yiweilian_humid_device
|
||||
set
|
||||
nu_id = null,
|
||||
nu_name = null,
|
||||
dimension = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateBind">
|
||||
update nu_iot_yiweilian_humid_device
|
||||
set
|
||||
nu_id = #{nuId},
|
||||
dimension = #{dimension}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -17,10 +17,4 @@ public interface IHumidDeviceService extends IService<HumidDevice> {
|
|||
Result<String> deleteDevice(HumidDevice humidDevice);
|
||||
Result getDeviceParameters(HumidDevice humidDevice);
|
||||
IPage<HumidDevice> findLogPage(Page<HumidDevice> page, HumidDevice humidDevice);
|
||||
|
||||
void editHldy(HumidDevice humidDevice);
|
||||
|
||||
void baoxiu(HumidDevice humidDevice);
|
||||
void release(HumidDevice humidDevice);
|
||||
void updateBind(HumidDevice humidDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -322,8 +322,6 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
String logId = UuidUtils.getUUID();
|
||||
SyncBizLog log = new SyncBizLog();
|
||||
log.setLogId(logId);
|
||||
log.setOrgCode(entity.getDepartServerUrl());
|
||||
log.setOrgName(entity.getDepartName());
|
||||
log.setContent(json);
|
||||
log.setSyncType("更新");
|
||||
log.setStatus("同步中");
|
||||
|
|
@ -495,67 +493,6 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
return baseMapper.findLogPage(page, humidDevice);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void editHldy(HumidDevice humidDevice) {
|
||||
HumidDevice oldParam = baseMapper.selectById(humidDevice.getId());
|
||||
humidDevice.setOldDepartId(oldParam.getDepartId());
|
||||
humidDevice.setOldDepartName(oldParam.getDepartName());
|
||||
humidDevice.setOldServerUrl(oldParam.getDepartServerUrl());
|
||||
baseMapper.updateById(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(HumidDevice humidDevice) {
|
||||
humidDevice.setMaintainStatus("1");
|
||||
baseMapper.updateById(humidDevice);
|
||||
syncImpl.devopsBaoxiu(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(HumidDevice humidDevice) {
|
||||
baseMapper.release(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBind(HumidDevice humidDevice) {
|
||||
baseMapper.updateBind(humidDevice);
|
||||
}
|
||||
|
||||
@DS("devops")
|
||||
public void devopsBaoxiu(HumidDevice humidDevice) {
|
||||
baseMapper.updateById(humidDevice);
|
||||
}
|
||||
|
||||
//业务系统删除命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricityDel(String dataSourceCode, HumidDevice humidDevice) {
|
||||
try {
|
||||
baseMapper.deleteById(humidDevice.getId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//业务系统保存或者修改命令
|
||||
@DS("#dataSourceCode")
|
||||
public boolean syncElectricitySaveOrUpdate(String dataSourceCode, HumidDevice humidDevice) {
|
||||
try {
|
||||
QueryWrapper<HumidDevice> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("sn", humidDevice.getSn());
|
||||
HumidDevice oldParam = baseMapper.selectOne(queryWrapper);//查询数据库中该表号数据原始数据
|
||||
if (oldParam == null) {
|
||||
baseMapper.insert(humidDevice);
|
||||
} else {
|
||||
baseMapper.updateById(humidDevice);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<HumidDeviceEntity> list(HumidDeviceEntity humidDeviceEntity, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
HumidDevice humidDevice = new HumidDevice();
|
||||
|
|
@ -585,13 +522,6 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
return syncImpl.updateDeviceRealTime(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void baoxiu(HumidDeviceEntity humidDeviceEntity) {
|
||||
HumidDevice humidDevice = new HumidDevice();
|
||||
BeanUtils.copyProperties(humidDeviceEntity, humidDevice);
|
||||
syncImpl.baoxiu(humidDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<HumidDeviceEntity> queryLogPageList(HumidDeviceEntity humidDeviceEntity, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
HumidDevice humidDevice = new HumidDevice();
|
||||
|
|
|
|||
|
|
@ -58,9 +58,6 @@ public class IotSyncBizMQListener {
|
|||
@Autowired
|
||||
private IHumidDeviceService humidDeviceService;
|
||||
|
||||
@Autowired
|
||||
private INuBaseInfoApi nuBaseInfoApi;
|
||||
|
||||
@Autowired
|
||||
private MqttMessageHandler mqttMessageHandler;
|
||||
|
||||
|
|
@ -81,41 +78,6 @@ public class IotSyncBizMQListener {
|
|||
|
||||
private void saveSyncBizInfo(IotSyncBizMQDto dto) {
|
||||
List<StatusMQDto> statusList = new ArrayList<>();
|
||||
// IotNuBaseInfoMQDto iotNuBaseInfoMQDto = dto.getNuBaseInfo();
|
||||
// try {
|
||||
// NuBaseInfoEntity entity = nuBaseInfoApi.getOneByNuId(iotNuBaseInfoMQDto.getNuId());
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setAsyncId(iotNuBaseInfoMQDto.getId());
|
||||
// statusMQDto.setMessage("成功");
|
||||
// statusMQDto.setPrimaryKey(iotNuBaseInfoMQDto.getLogId());
|
||||
// statusMQDto.setNote("区域");
|
||||
// if(entity!=null){
|
||||
// if(iotNuBaseInfoMQDto.getDelFlag().equals(entity.getDelFlag())){
|
||||
// statusMQDto.setMessage("忽略");
|
||||
// }else{
|
||||
// entity.setDelFlag(iotNuBaseInfoMQDto.getDelFlag());
|
||||
// NuBaseInfoEntity nuBaseInfo = new NuBaseInfoEntity();
|
||||
// BeanUtils.copyProperties(entity, nuBaseInfo);
|
||||
// nuBaseInfo.setSysOrgCode(iotNuBaseInfoMQDto.getOrgCode());
|
||||
// nuBaseInfoApi.updateById(nuBaseInfo);
|
||||
// }
|
||||
// }else{
|
||||
// NuBaseInfoEntity nuBaseInfo = new NuBaseInfoEntity();
|
||||
// BeanUtils.copyProperties(iotNuBaseInfoMQDto, nuBaseInfo);
|
||||
// nuBaseInfo.setSysOrgCode(iotNuBaseInfoMQDto.getOrgCode());
|
||||
// nuBaseInfo.setStatus("0");
|
||||
// nuBaseInfoApi.save(nuBaseInfo);
|
||||
// }
|
||||
// statusList.add(statusMQDto);
|
||||
// } catch (Exception e) {
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setAsyncId(iotNuBaseInfoMQDto.getId());
|
||||
// statusMQDto.setMessage("失败");
|
||||
// statusMQDto.setPrimaryKey(iotNuBaseInfoMQDto.getLogId());
|
||||
// statusMQDto.setNote("区域");
|
||||
// statusList.add(statusMQDto);
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
List<IotCameraInfoMQDto> cameraList = dto.getCameraInfoList();
|
||||
if(cameraList!=null&&cameraList.size()>0){
|
||||
|
|
@ -131,17 +93,6 @@ 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{
|
||||
// entity.setMaintainStatus(iotCameraInfoMQDto.getMaintainStatus());
|
||||
// cameraInfoService.updateById(entity);
|
||||
// }
|
||||
CameraInfo cameraInfo = new CameraInfo();
|
||||
BeanUtils.copyProperties(iotCameraInfoMQDto, cameraInfo);
|
||||
cameraInfo.setId(entity.getId());
|
||||
|
|
@ -233,16 +184,7 @@ 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{
|
||||
// entity.setMaintainStatus(iotElectricityMeterMQDto.getMaintainStatus());
|
||||
// electricityMeterService.updateById(entity);
|
||||
// }
|
||||
}else{
|
||||
ElectricityMeter electricityMeter = new ElectricityMeter();
|
||||
BeanUtils.copyProperties(iotElectricityMeterMQDto, electricityMeter);
|
||||
|
|
@ -281,16 +223,7 @@ 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{
|
||||
// entity.setMaintainStatus(iotWaterMeterMQDto.getMaintainStatus());
|
||||
// waterMeterService.updateById(entity);
|
||||
// }
|
||||
}else{
|
||||
WaterMeter waterMeter = new WaterMeter();
|
||||
BeanUtils.copyProperties(iotWaterMeterMQDto, waterMeter);
|
||||
|
|
@ -359,16 +292,7 @@ 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{
|
||||
// entity.setMaintainStatus(iotHumidDeviceMQDto.getMaintainStatus());
|
||||
// humidDeviceService.updateById(entity);
|
||||
// }
|
||||
}else{
|
||||
HumidDevice humidDevice = new HumidDevice();
|
||||
BeanUtils.copyProperties(iotHumidDeviceMQDto, humidDevice);
|
||||
|
|
@ -396,462 +320,4 @@ public class IotSyncBizMQListener {
|
|||
rabbitMQUtil.sendToExchange("hldy.iotsyncbiz", "iotsyncbiz.async.result", statusListMQDto);
|
||||
}
|
||||
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{iotDeviceAsyncDQNP.getReleaseDeviceQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.iotsyncbiz", type = ExchangeTypes.DIRECT),
|
||||
key = "#{iotDeviceAsyncDQNP.getReleaseDeviceKeyName()}"
|
||||
),
|
||||
errorHandler = "iotDeviceMQErrorHandler"
|
||||
)
|
||||
public void handleRelease_unify(IotSyncBizMQDto dto) {
|
||||
syncReleaseIot(dto);
|
||||
}
|
||||
|
||||
private void syncReleaseIot(IotSyncBizMQDto dto) {
|
||||
List<StatusMQDto> statusList = new ArrayList<>();
|
||||
|
||||
List<IotCameraInfoMQDto> cameraList = dto.getCameraInfoList();
|
||||
if(cameraList!=null&&cameraList.size()>0){
|
||||
for(int i=0;i<cameraList.size();i++){
|
||||
IotCameraInfoMQDto iotCameraInfoMQDto = cameraList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
QueryWrapper<CameraInfo> cameraQw = new QueryWrapper<>();
|
||||
cameraQw.eq("mac",iotCameraInfoMQDto.getMac());
|
||||
CameraInfo entity = cameraInfoService.getOne(cameraQw);
|
||||
if(entity!=null){
|
||||
cameraInfoService.release(entity);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotElectricityMeterMQDto> electricityList = dto.getElectricityMeterList();
|
||||
if(electricityList!=null&&electricityList.size()>0){
|
||||
for(int i=0;i<electricityList.size();i++){
|
||||
IotElectricityMeterMQDto iotElectricityMeterMQDto = electricityList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
QueryWrapper<ElectricityMeter> electricityQw = new QueryWrapper<>();
|
||||
electricityQw.eq("sn",iotElectricityMeterMQDto.getSn());
|
||||
ElectricityMeter entity = electricityMeterService.getOne(electricityQw);
|
||||
if(entity!=null){
|
||||
electricityMeterService.release(entity);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotWaterMeterMQDto> waterMeterList = dto.getWaterMeterList();
|
||||
if(waterMeterList!=null&&waterMeterList.size()>0){
|
||||
for(int i=0;i<waterMeterList.size();i++){
|
||||
IotWaterMeterMQDto iotWaterMeterMQDto = waterMeterList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
QueryWrapper<WaterMeter> waterQw = new QueryWrapper<>();
|
||||
waterQw.eq("cid",iotWaterMeterMQDto.getCid());
|
||||
WaterMeter entity = waterMeterService.getOne(waterQw);
|
||||
if(entity!=null){
|
||||
waterMeterService.release(entity);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotHumidDeviceMQDto> humidDeviceList = dto.getHumidDeviceList();
|
||||
if(humidDeviceList!=null&&humidDeviceList.size()>0){
|
||||
for(int i=0;i<humidDeviceList.size();i++){
|
||||
IotHumidDeviceMQDto iotHumidDeviceMQDto = humidDeviceList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
QueryWrapper<HumidDevice> humidQw = new QueryWrapper<>();
|
||||
humidQw.eq("sn",iotHumidDeviceMQDto.getSn());
|
||||
HumidDevice entity = humidDeviceService.getOne(humidQw);
|
||||
if(entity!=null){
|
||||
humidDeviceService.release(entity);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusListMQDto statusListMQDto = new StatusListMQDto();
|
||||
statusListMQDto.setStatusList(statusList);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotsyncbiz", "iotsyncbiz.release.result", statusListMQDto);
|
||||
}
|
||||
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{iotDeviceAsyncDQNP.getUnbindDeviceQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.iotsyncbiz", type = ExchangeTypes.DIRECT),
|
||||
key = "#{iotDeviceAsyncDQNP.getUnbindDeviceKeyName()}"
|
||||
),
|
||||
errorHandler = "iotDeviceMQErrorHandler"
|
||||
)
|
||||
public void handleUnbind_unify(IotSyncBizMQDto dto) {
|
||||
syncUnbindIot(dto);
|
||||
}
|
||||
|
||||
private void syncUnbindIot(IotSyncBizMQDto dto) {
|
||||
List<StatusMQDto> statusList = new ArrayList<>();
|
||||
|
||||
List<IotCameraInfoMQDto> cameraList = dto.getCameraInfoList();
|
||||
if(cameraList!=null&&cameraList.size()>0){
|
||||
for(int i=0;i<cameraList.size();i++){
|
||||
IotCameraInfoMQDto iotCameraInfoMQDto = cameraList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
QueryWrapper<CameraInfo> cameraQw = new QueryWrapper<>();
|
||||
cameraQw.eq("mac",iotCameraInfoMQDto.getMac());
|
||||
CameraInfo entity = cameraInfoService.getOne(cameraQw);
|
||||
if(entity!=null){
|
||||
cameraInfoService.removeById(entity.getId());
|
||||
QueryWrapper<CameraCapability> capabilityQw = new QueryWrapper<>();
|
||||
capabilityQw.eq("device_index",entity.getDeviceIndex());
|
||||
CameraCapability capability = cameraCapabilityService.getOne(capabilityQw);
|
||||
if(capability!=null){
|
||||
cameraCapabilityService.removeById(capability.getId());
|
||||
}
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotElectricityMeterMQDto> electricityList = dto.getElectricityMeterList();
|
||||
if(electricityList!=null&&electricityList.size()>0){
|
||||
for(int i=0;i<electricityList.size();i++){
|
||||
IotElectricityMeterMQDto iotElectricityMeterMQDto = electricityList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
QueryWrapper<ElectricityMeter> electricityQw = new QueryWrapper<>();
|
||||
electricityQw.eq("sn",iotElectricityMeterMQDto.getSn());
|
||||
ElectricityMeter entity = electricityMeterService.getOne(electricityQw);
|
||||
if(entity!=null){
|
||||
electricityMeterService.removeById(entity.getId());
|
||||
mqttMessageHandler.unsubscribeUplinkMessage(iotElectricityMeterMQDto.getSn());
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotWaterMeterMQDto> waterMeterList = dto.getWaterMeterList();
|
||||
if(waterMeterList!=null&&waterMeterList.size()>0){
|
||||
for(int i=0;i<waterMeterList.size();i++){
|
||||
IotWaterMeterMQDto iotWaterMeterMQDto = waterMeterList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
QueryWrapper<WaterMeter> waterQw = new QueryWrapper<>();
|
||||
waterQw.eq("cid",iotWaterMeterMQDto.getCid());
|
||||
WaterMeter entity = waterMeterService.getOne(waterQw);
|
||||
if(entity!=null){
|
||||
waterMeterService.removeById(entity.getId());
|
||||
QueryWrapper<TqDeviceInfo> collectorQw = new QueryWrapper<>();
|
||||
collectorQw.eq("cid",entity.getCid());
|
||||
TqDeviceInfo collector = collectorService.getOne(collectorQw);
|
||||
if(collector!=null) {
|
||||
collectorService.removeById(collector.getId());
|
||||
}
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotHumidDeviceMQDto> humidDeviceList = dto.getHumidDeviceList();
|
||||
if(humidDeviceList!=null&&humidDeviceList.size()>0){
|
||||
for(int i=0;i<humidDeviceList.size();i++){
|
||||
IotHumidDeviceMQDto iotHumidDeviceMQDto = humidDeviceList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
QueryWrapper<HumidDevice> humidQw = new QueryWrapper<>();
|
||||
humidQw.eq("sn",iotHumidDeviceMQDto.getSn());
|
||||
HumidDevice entity = humidDeviceService.getOne(humidQw);
|
||||
if(entity!=null){
|
||||
humidDeviceService.removeById(entity.getId());
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusListMQDto statusListMQDto = new StatusListMQDto();
|
||||
statusListMQDto.setStatusList(statusList);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotsyncbiz", "iotsyncbiz.unbind.result", statusListMQDto);
|
||||
}
|
||||
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{iotDeviceAsyncDQNP.getUpdateBindDeviceQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.iotsyncbiz", type = ExchangeTypes.DIRECT),
|
||||
key = "#{iotDeviceAsyncDQNP.getUpdateBindDeviceKeyName()}"
|
||||
),
|
||||
errorHandler = "iotDeviceMQErrorHandler"
|
||||
)
|
||||
public void handleUpdateBind_unify(IotSyncBizMQDto dto) {
|
||||
syncUpdateBindIot(dto);
|
||||
}
|
||||
|
||||
private void syncUpdateBindIot(IotSyncBizMQDto dto) {
|
||||
List<StatusMQDto> statusList = new ArrayList<>();
|
||||
|
||||
List<IotCameraInfoMQDto> cameraList = dto.getCameraInfoList();
|
||||
if(cameraList!=null&&cameraList.size()>0){
|
||||
for(int i=0;i<cameraList.size();i++){
|
||||
IotCameraInfoMQDto iotCameraInfoMQDto = cameraList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
QueryWrapper<CameraInfo> cameraQw = new QueryWrapper<>();
|
||||
cameraQw.eq("mac",iotCameraInfoMQDto.getMac());
|
||||
CameraInfo entity = cameraInfoService.getOne(cameraQw);
|
||||
if(entity!=null){
|
||||
CameraInfo ci = new CameraInfo();
|
||||
ci.setId(entity.getId());
|
||||
ci.setDimension(iotCameraInfoMQDto.getDimension());
|
||||
ci.setNuId(null);
|
||||
if(iotCameraInfoMQDto.getDimension().equals("区域维度")){
|
||||
ci.setNuId(iotCameraInfoMQDto.getNuId());
|
||||
}
|
||||
cameraInfoService.updateBind(ci);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotCameraInfoMQDto.getMac());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||
statusMQDto.setNote("TPLINK");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotElectricityMeterMQDto> electricityList = dto.getElectricityMeterList();
|
||||
if(electricityList!=null&&electricityList.size()>0){
|
||||
for(int i=0;i<electricityList.size();i++){
|
||||
IotElectricityMeterMQDto iotElectricityMeterMQDto = electricityList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
QueryWrapper<ElectricityMeter> electricityQw = new QueryWrapper<>();
|
||||
electricityQw.eq("sn",iotElectricityMeterMQDto.getSn());
|
||||
ElectricityMeter entity = electricityMeterService.getOne(electricityQw);
|
||||
if(entity!=null){
|
||||
ElectricityMeter em = new ElectricityMeter();
|
||||
em.setId(entity.getId());
|
||||
em.setDimension(iotElectricityMeterMQDto.getDimension());
|
||||
em.setNuId(null);
|
||||
if(iotElectricityMeterMQDto.getDimension().equals("区域维度")){
|
||||
em.setNuId(iotElectricityMeterMQDto.getNuId());
|
||||
}
|
||||
electricityMeterService.updateBind(em);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("电表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotWaterMeterMQDto> waterMeterList = dto.getWaterMeterList();
|
||||
if(waterMeterList!=null&&waterMeterList.size()>0){
|
||||
for(int i=0;i<waterMeterList.size();i++){
|
||||
IotWaterMeterMQDto iotWaterMeterMQDto = waterMeterList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
QueryWrapper<WaterMeter> waterQw = new QueryWrapper<>();
|
||||
waterQw.eq("cid",iotWaterMeterMQDto.getCid());
|
||||
WaterMeter entity = waterMeterService.getOne(waterQw);
|
||||
if(entity!=null){
|
||||
WaterMeter wm = new WaterMeter();
|
||||
wm.setId(entity.getId());
|
||||
wm.setDimension(iotWaterMeterMQDto.getDimension());
|
||||
wm.setNuId(null);
|
||||
if(iotWaterMeterMQDto.getDimension().equals("区域维度")){
|
||||
wm.setNuId(iotWaterMeterMQDto.getNuId());
|
||||
}
|
||||
waterMeterService.updateBind(wm);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotWaterMeterMQDto.getCid());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||
statusMQDto.setNote("水表");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<IotHumidDeviceMQDto> humidDeviceList = dto.getHumidDeviceList();
|
||||
if(humidDeviceList!=null&&humidDeviceList.size()>0){
|
||||
for(int i=0;i<humidDeviceList.size();i++){
|
||||
IotHumidDeviceMQDto iotHumidDeviceMQDto = humidDeviceList.get(i);
|
||||
try {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("成功");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
QueryWrapper<HumidDevice> humidQw = new QueryWrapper<>();
|
||||
humidQw.eq("sn",iotHumidDeviceMQDto.getSn());
|
||||
HumidDevice entity = humidDeviceService.getOne(humidQw);
|
||||
if(entity!=null){
|
||||
HumidDevice hd = new HumidDevice();
|
||||
hd.setId(entity.getId());
|
||||
hd.setDimension(iotHumidDeviceMQDto.getDimension());
|
||||
hd.setNuId(null);
|
||||
if(iotHumidDeviceMQDto.getDimension().equals("区域维度")){
|
||||
hd.setNuId(iotHumidDeviceMQDto.getNuId());
|
||||
}
|
||||
humidDeviceService.updateBind(hd);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
}
|
||||
catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getSn());
|
||||
statusMQDto.setMessage("失败");
|
||||
statusMQDto.setPrimaryKey(iotHumidDeviceMQDto.getLogId());
|
||||
statusMQDto.setNote("温湿度计");
|
||||
statusList.add(statusMQDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusListMQDto statusListMQDto = new StatusListMQDto();
|
||||
statusListMQDto.setStatusList(statusList);
|
||||
rabbitMQUtil.sendToExchange("hldy.iotsyncbiz", "iotsyncbiz.updatebind.result", statusListMQDto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@
|
|||
cameraInfo.device_index AS deviceIndex
|
||||
FROM
|
||||
nu_base_info nuInfo
|
||||
left join nu_iot_tplink_camera cameraInfo on nuInfo.nu_id = cameraInfo.nu_id
|
||||
LEFT JOIN nu_iot_tplink_camera_capability c ON cameraInfo.device_index = c.device_index
|
||||
left join nu_iot_device_preview c on nuInfo.nu_id = c.nu_id
|
||||
left join nu_iot_tplink_camera cameraInfo on cameraInfo.mac = c.sn
|
||||
left join nu_biz_elder_info elderInfo on nuInfo.elder_id = elderInfo.id
|
||||
LEFT JOIN sys_dict dict ON dict.dict_code = 'nu_type'
|
||||
LEFT JOIN sys_dict_item mainStatus
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.dto.IotNuBaseInfoMQDto;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.appConfig.entity.NuAppPermission;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.api.ICameraInfoApi;
|
||||
import com.nu.modules.elder.api.IElderInfoApi;
|
||||
import com.nu.modules.humiddevice.api.IHumidAlarmApi;
|
||||
import com.nu.modules.humiddevice.api.IHumidDeviceApi;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nubaseinfo.mapper.NuBaseInfoMapper;
|
||||
|
|
@ -52,7 +50,7 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Autowired
|
||||
private CameraInfoApi cameraInfoApiService;
|
||||
private ICameraInfoApi cameraInfoApiService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
|
|
@ -210,7 +208,7 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
//查询护理单元信息
|
||||
IPage<NuBaseInfo> list = baseMapper.queryPadPageList(page, queryWrapper);
|
||||
//查询相应的摄像头信息
|
||||
List<CameraInfoEntity> cameraList = cameraInfoApiService.getCameraInfoList();
|
||||
List<CameraInfoEntity> cameraList = cameraInfoApiService.getCameraInfoList(null);
|
||||
|
||||
//查询未退住的老人
|
||||
List<ElderInfoEntity> elderList = elderInfoApi.selectCurrentState3();
|
||||
|
|
|
|||
Loading…
Reference in New Issue