Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_java
This commit is contained in:
commit
b9d376aee8
|
@ -68,10 +68,11 @@ public class NuBaseInfoController extends JeecgController<NuBaseInfo, INuBaseInf
|
||||||
@GetMapping(value = "/qyList")
|
@GetMapping(value = "/qyList")
|
||||||
public Result<IPage<NuBaseInfo>> qyList(NuBaseInfo nuBaseInfo,
|
public Result<IPage<NuBaseInfo>> qyList(NuBaseInfo nuBaseInfo,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "15") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
QueryWrapper<NuBaseInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfo, req.getParameterMap(), customeRuleMap);
|
QueryWrapper<NuBaseInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfo, req.getParameterMap(), customeRuleMap);
|
||||||
|
queryWrapper.isNotNull("b.id");
|
||||||
Page<NuBaseInfo> page = new Page<NuBaseInfo>(pageNo, pageSize);
|
Page<NuBaseInfo> page = new Page<NuBaseInfo>(pageNo, pageSize);
|
||||||
IPage<NuBaseInfo> pageList = nuBaseInfoService.qyList(page, queryWrapper);
|
IPage<NuBaseInfo> pageList = nuBaseInfoService.qyList(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TPLINK摄像头能力集信息
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-11
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotCameraCapabilityMQDto{
|
||||||
|
/**ID*/
|
||||||
|
private Integer id;
|
||||||
|
/**设备序号*/
|
||||||
|
private String deviceIndex;
|
||||||
|
/**力集属性*/
|
||||||
|
private String motionDetection;
|
||||||
|
/**视频封面*/
|
||||||
|
private String videoCover;
|
||||||
|
/**云台*/
|
||||||
|
private String ptz;
|
||||||
|
private String motor;
|
||||||
|
/**变焦,0不可变焦 1可变焦*/
|
||||||
|
private String smartCode;
|
||||||
|
/**强制在H.264编码过程中生成IDR帧的函数*/
|
||||||
|
private String forceIdrFrame;
|
||||||
|
/**音频*/
|
||||||
|
private String audio;
|
||||||
|
/**本地存储*/
|
||||||
|
private String localStorage;
|
||||||
|
/**回放API本版*/
|
||||||
|
private String playbackApiVersionTwo;
|
||||||
|
/**多变性*/
|
||||||
|
private String multitrans;
|
||||||
|
/**客流*/
|
||||||
|
private String passengerFlow;
|
||||||
|
/**获取预览缩略图*/
|
||||||
|
private String getPreviewThumbnail;
|
||||||
|
/**JPG预览缩略图*/
|
||||||
|
private String previewThumbnailJpeg;
|
||||||
|
/**走廊*/
|
||||||
|
private String corridorMod;
|
||||||
|
/**背光共存*/
|
||||||
|
private String backlightCoexistence;
|
||||||
|
/**是否同步 0 未同步 1已同步*/
|
||||||
|
private String syncType;
|
||||||
|
/**日志ID*/
|
||||||
|
private String logId;
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TPLINK摄像头信息
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-11
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotCameraInfoMQDto{
|
||||||
|
/**ID*/
|
||||||
|
private Integer id;
|
||||||
|
/**sn*/
|
||||||
|
private String sn;
|
||||||
|
/**设备序号*/
|
||||||
|
private String deviceIndex;
|
||||||
|
/**设备名称*/
|
||||||
|
private String deviceName;
|
||||||
|
/**设备类型*/
|
||||||
|
private String deviceType;
|
||||||
|
/**设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中*/
|
||||||
|
private String deviceStatus;
|
||||||
|
/**设备型号*/
|
||||||
|
private String deviceModel;
|
||||||
|
/**IP地址*/
|
||||||
|
private String ip;
|
||||||
|
/**MAC地址*/
|
||||||
|
private String mac;
|
||||||
|
/**分组ID*/
|
||||||
|
private String regionId;
|
||||||
|
/**分组名称*/
|
||||||
|
private String regionName;
|
||||||
|
/**父设备ID*/
|
||||||
|
private String parentId;
|
||||||
|
/**父设备名称*/
|
||||||
|
private String parentDeviceName;
|
||||||
|
/**项目ID*/
|
||||||
|
private String projectId;
|
||||||
|
/**项目名称*/
|
||||||
|
private String projectName;
|
||||||
|
/**软件版本*/
|
||||||
|
private String firmwareVer;
|
||||||
|
/**硬件版本*/
|
||||||
|
private String hardwareVer;
|
||||||
|
/**用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有*/
|
||||||
|
private String managerAuthType;
|
||||||
|
/**告警消息权限 1 有权限 -1 无权限*/
|
||||||
|
private String msgAuthType;
|
||||||
|
/**国标编码*/
|
||||||
|
private String sipCode;
|
||||||
|
/**位置名称*/
|
||||||
|
private String locationName;
|
||||||
|
/**系统类型 public 通用*/
|
||||||
|
private String systemType;
|
||||||
|
/**协议类型*/
|
||||||
|
private String protocol;
|
||||||
|
/**录像计划ID**/
|
||||||
|
private String recordPlanId;
|
||||||
|
/**回放视频转FTP上传IP**/
|
||||||
|
private String ftpIp;
|
||||||
|
/**回放视频转FTP上传端口**/
|
||||||
|
private String ftpPort;
|
||||||
|
/**回放视频转FTP上传用户**/
|
||||||
|
private String ftpUsername;
|
||||||
|
/**回放视频转FTP上传密码**/
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 电水表采集器
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotEleWaterCollectorMQDto{
|
||||||
|
/**主键*/
|
||||||
|
private Integer id;
|
||||||
|
/**采集器*/
|
||||||
|
private String cid;
|
||||||
|
/**在线状态*/
|
||||||
|
private String online;
|
||||||
|
/**信号值*/
|
||||||
|
private String csq;
|
||||||
|
/**上次掉线时间*/
|
||||||
|
private String disconnectTime;
|
||||||
|
/**上次上线时间*/
|
||||||
|
private String connectTime;
|
||||||
|
/**描述*/
|
||||||
|
private String remark;
|
||||||
|
/**是否同步 0 未同步 1已同步*/
|
||||||
|
private String syncType;
|
||||||
|
/**日志ID*/
|
||||||
|
private String logId;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 水表
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotElectricityMeterMQDto{
|
||||||
|
/**主键*/
|
||||||
|
private Integer id;
|
||||||
|
/**采集器*/
|
||||||
|
private String cid;
|
||||||
|
/**表号*/
|
||||||
|
private String address;
|
||||||
|
/**电表值*/
|
||||||
|
private String eleValue;
|
||||||
|
/**阀门状态*/
|
||||||
|
private String relayState;
|
||||||
|
/**描述*/
|
||||||
|
private String remark;
|
||||||
|
/**区域编码*/
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 温湿度计
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotHumidDeviceMQDto{
|
||||||
|
/**主键*/
|
||||||
|
private Integer id;
|
||||||
|
/**设备SN号*/
|
||||||
|
private String sn;
|
||||||
|
/**设备名称*/
|
||||||
|
private String deviceName;
|
||||||
|
/**设备所在时区*/
|
||||||
|
private String timeCode;
|
||||||
|
/**设备类型*/
|
||||||
|
private String deviceTypes;
|
||||||
|
/**上报间隔*/
|
||||||
|
private String reportingInterval;
|
||||||
|
/**记录间隔*/
|
||||||
|
private String recordInterval;
|
||||||
|
/**历史数据上报时刻*/
|
||||||
|
private String historyReportTime;
|
||||||
|
/**历史数据上报间隔*/
|
||||||
|
private String historyInterval;
|
||||||
|
/**温度预警范围 上限值*/
|
||||||
|
private String temperatureHigh;
|
||||||
|
/**温度预警范围 下限值*/
|
||||||
|
private String temperatureLow;
|
||||||
|
/**温度缓冲值*/
|
||||||
|
private String temperatureBuffer;
|
||||||
|
/**湿度预警范围 上限值*/
|
||||||
|
private String humidityHigh;
|
||||||
|
/**湿度预警范围 下限值*/
|
||||||
|
private String humidityLow;
|
||||||
|
/**湿度缓冲值*/
|
||||||
|
private String humidityBuffer;
|
||||||
|
/**断电报警"*/
|
||||||
|
private String izOutages;
|
||||||
|
/**低电报警*/
|
||||||
|
private String izLowBattery;
|
||||||
|
/**上下线通知*/
|
||||||
|
private String izOnline;
|
||||||
|
/**温度*/
|
||||||
|
private String temperature;
|
||||||
|
/**湿度*/
|
||||||
|
private String humidity;
|
||||||
|
/**在线状态*/
|
||||||
|
private String status;
|
||||||
|
/**最新上报时间*/
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IotNuBaseInfoMQDto {
|
||||||
|
/**ID*/
|
||||||
|
private String id;
|
||||||
|
/**区域编码*/
|
||||||
|
private String nuId;
|
||||||
|
/**区域名称*/
|
||||||
|
private String nuName;
|
||||||
|
/**区域标签*/
|
||||||
|
private String areaFlag;
|
||||||
|
/**是否删除*/
|
||||||
|
private String delFlag;
|
||||||
|
/**所属机构*/
|
||||||
|
private String orgCode;
|
||||||
|
/**所属机构*/
|
||||||
|
private String orgName;
|
||||||
|
/**是否同步*/
|
||||||
|
private String izSync;
|
||||||
|
/**日志ID*/
|
||||||
|
private String logId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IotSyncBizMQDto {
|
||||||
|
private IotNuBaseInfoMQDto nuBaseInfo;
|
||||||
|
private List<IotCameraInfoMQDto> cameraInfoList;
|
||||||
|
private List<IotCameraCapabilityMQDto> capabilityList;
|
||||||
|
private List<IotElectricityMeterMQDto> electricityMeterList;
|
||||||
|
private List<IotWaterMeterMQDto> waterMeterList;
|
||||||
|
private List<IotEleWaterCollectorMQDto> collectorList;
|
||||||
|
private List<IotHumidDeviceMQDto> humidDeviceList;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 电表
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IotWaterMeterMQDto{
|
||||||
|
/**主键*/
|
||||||
|
private Integer id;
|
||||||
|
/**采集器*/
|
||||||
|
private String cid;
|
||||||
|
/**表号*/
|
||||||
|
private String address;
|
||||||
|
/**水表值*/
|
||||||
|
private String waterValue;
|
||||||
|
/**阀门状态*/
|
||||||
|
private String relayState;
|
||||||
|
/**水表电池状态*/
|
||||||
|
private String batteryState;
|
||||||
|
/**描述*/
|
||||||
|
private String remark;
|
||||||
|
/**区域编码*/
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatusListMQDto {
|
||||||
|
List<StatusMQDto> statusList;
|
||||||
|
}
|
|
@ -52,6 +52,12 @@
|
||||||
<version>2.0.0</version>
|
<version>2.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nursingunit.boot</groupId>
|
||||||
|
<artifactId>nu-admin-biz</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,13 @@ public class CameraInfoController extends JeecgController<CameraInfo, ICameraInf
|
||||||
service.edit(cameraInfo);
|
service.edit(cameraInfo);
|
||||||
return Result.OK("编辑成功!");
|
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("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改摄像头信息
|
* 修改摄像头信息
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.nu.modules.tplink.camera.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TPLINK摄像头能力集信息
|
||||||
|
* @Author: caolei
|
||||||
|
* @Date: 2025-08-11
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_iot_tplink_camera_capability")
|
||||||
|
public class CameraCapability implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
/**ID*/
|
||||||
|
private Integer id;
|
||||||
|
/**设备序号*/
|
||||||
|
private String deviceIndex;
|
||||||
|
/**力集属性*/
|
||||||
|
private String motionDetection;
|
||||||
|
/**视频封面*/
|
||||||
|
private String videoCover;
|
||||||
|
/**云台*/
|
||||||
|
private String ptz;
|
||||||
|
private String motor;
|
||||||
|
/**变焦,0不可变焦 1可变焦*/
|
||||||
|
private String smartCode;
|
||||||
|
/**强制在H.264编码过程中生成IDR帧的函数*/
|
||||||
|
private String forceIdrFrame;
|
||||||
|
/**音频*/
|
||||||
|
private String audio;
|
||||||
|
/**本地存储*/
|
||||||
|
private String localStorage;
|
||||||
|
/**回放API本版*/
|
||||||
|
private String playbackApiVersionTwo;
|
||||||
|
/**多变性*/
|
||||||
|
private String multitrans;
|
||||||
|
/**客流*/
|
||||||
|
private String passengerFlow;
|
||||||
|
/**获取预览缩略图*/
|
||||||
|
private String getPreviewThumbnail;
|
||||||
|
/**JPG预览缩略图*/
|
||||||
|
private String previewThumbnailJpeg;
|
||||||
|
/**走廊*/
|
||||||
|
private String corridorMod;
|
||||||
|
/**背光共存*/
|
||||||
|
private String backlightCoexistence;
|
||||||
|
}
|
|
@ -33,6 +33,10 @@ public class CameraInfo implements Serializable {
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
/**设备编码*/
|
||||||
|
@Excel(name = "设备编码", width = 15)
|
||||||
|
@ApiModelProperty(value = "设备编码")
|
||||||
|
private String sn;
|
||||||
/**设备序号*/
|
/**设备序号*/
|
||||||
@Excel(name = "设备序号", width = 15)
|
@Excel(name = "设备序号", width = 15)
|
||||||
@ApiModelProperty(value = "设备序号")
|
@ApiModelProperty(value = "设备序号")
|
||||||
|
@ -307,4 +311,6 @@ public class CameraInfo implements Serializable {
|
||||||
private String ftpUsername; //回放视频转FTP上传用户
|
private String ftpUsername; //回放视频转FTP上传用户
|
||||||
private String ftpPassword; //回放视频转FTP上传密码
|
private String ftpPassword; //回放视频转FTP上传密码
|
||||||
private String ftpUploadpath; //回放视频转FTP上传路径
|
private String ftpUploadpath; //回放视频转FTP上传路径
|
||||||
|
/**维修状态*/
|
||||||
|
private String maintainStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nu.modules.tplink.camera.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraCapability;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 护理单元-物联管理-摄像头能力集信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CameraCapabilityMapper extends BaseMapper<CameraCapability> {
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.tplink.camera.mapper.CameraCapabilityMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -28,7 +28,8 @@
|
||||||
record_plan_id as recordPlanId,
|
record_plan_id as recordPlanId,
|
||||||
a.nu_id as nuId,
|
a.nu_id as nuId,
|
||||||
b.nu_name as nuName,
|
b.nu_name as nuName,
|
||||||
ifnull(c.multitrans,0) as multitrans
|
ifnull(c.multitrans,0) as multitrans,
|
||||||
|
a.sn,a.maintain_status
|
||||||
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_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
|
left join nu_iot_tplink_camera_capability c on a.device_index = c.device_index
|
||||||
<where>
|
<where>
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.nu.modules.tplink.camera.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraCapability;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 护理单元-物联管理-摄像头能力集信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ICameraCapabilityService extends IService<CameraCapability> {
|
||||||
|
}
|
|
@ -61,4 +61,6 @@ public interface ICameraInfoService extends IService<CameraInfo> {
|
||||||
Result<String> stopUploadToServer(CameraInfo cameraInfo);
|
Result<String> stopUploadToServer(CameraInfo cameraInfo);
|
||||||
Result getUploadToServerProcess(CameraInfo cameraInfo);
|
Result getUploadToServerProcess(CameraInfo cameraInfo);
|
||||||
Result motionCtrl(CameraInfo cameraInfo);
|
Result motionCtrl(CameraInfo cameraInfo);
|
||||||
|
|
||||||
|
void baoxiu(CameraInfo cameraInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.nu.modules.tplink.camera.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraCapability;
|
||||||
|
import com.nu.modules.tplink.camera.mapper.CameraCapabilityMapper;
|
||||||
|
import com.nu.modules.tplink.camera.service.ICameraCapabilityService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 护理单元-物联管理-摄像头能力集信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class CameraCapabilityServiceImpl extends ServiceImpl<CameraCapabilityMapper, CameraCapability> implements ICameraCapabilityService {
|
||||||
|
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package com.nu.modules.tplink.camera.service.impl;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
@ -11,6 +12,7 @@ import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||||
import com.nu.modules.tplink.camera.model.CameraTreeModel;
|
import com.nu.modules.tplink.camera.model.CameraTreeModel;
|
||||||
import com.nu.modules.tplink.common.entity.TumsConfig;
|
import com.nu.modules.tplink.common.entity.TumsConfig;
|
||||||
import com.nu.modules.tplink.common.mapper.TumsConfigMapper;
|
import com.nu.modules.tplink.common.mapper.TumsConfigMapper;
|
||||||
|
import com.nu.modules.yiweilian.humid.service.impl.HumidDeviceServiceImpl;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
@ -24,6 +26,7 @@ import com.nu.modules.tplink.common.service.IErrorCodeService;
|
||||||
import com.nu.modules.tplink.utils.TumsApi;
|
import com.nu.modules.tplink.utils.TumsApi;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -49,6 +52,9 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
||||||
@Autowired
|
@Autowired
|
||||||
private TumsConfigMapper tumsConfigMapper;
|
private TumsConfigMapper tumsConfigMapper;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private CameraInfoServiceImpl syncImpl;
|
||||||
/**
|
/**
|
||||||
* 获取摄像头信息-分页
|
* 获取摄像头信息-分页
|
||||||
* @param page
|
* @param page
|
||||||
|
@ -2524,6 +2530,18 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void baoxiu(CameraInfo cameraInfo) {
|
||||||
|
cameraInfo.setMaintainStatus("1");
|
||||||
|
baseMapper.updateById(cameraInfo);
|
||||||
|
syncImpl.devopsBaoxiu(cameraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("devops")
|
||||||
|
public void devopsBaoxiu(CameraInfo cameraInfo){
|
||||||
|
baseMapper.updateById(cameraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CameraInfoDto> getCameraInfoList() {
|
public List<CameraInfoDto> getCameraInfoList() {
|
||||||
List<CameraInfo> list = baseMapper.findAllList();
|
List<CameraInfo> list = baseMapper.findAllList();
|
||||||
|
|
|
@ -84,4 +84,11 @@ public class ElectricityMeterController extends JeecgController<ElectricityMeter
|
||||||
return Result.OK("编辑成功!");
|
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("操作成功!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,5 +78,7 @@ public class ElectricityMeter implements Serializable {
|
||||||
private String syncType;//是否同步 0 未同步 1已同步
|
private String syncType;//是否同步 0 未同步 1已同步
|
||||||
private String oldDepartId;//原机构id
|
private String oldDepartId;//原机构id
|
||||||
private String oldDepartName;//原机构名称
|
private String oldDepartName;//原机构名称
|
||||||
|
/**维修状态*/
|
||||||
|
private String maintainStatus;
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,7 +11,6 @@ public interface ElectricityMeterMapper extends BaseMapper<ElectricityMeter> {
|
||||||
IPage<ElectricityMeter> findPage(Page<ElectricityMeter> page, @Param("params") ElectricityMeter electricityMeter);
|
IPage<ElectricityMeter> findPage(Page<ElectricityMeter> page, @Param("params") ElectricityMeter electricityMeter);
|
||||||
List<ElectricityMeter> findAllList();
|
List<ElectricityMeter> findAllList();
|
||||||
ElectricityMeter getElectricityMeter(ElectricityMeter electricityMeter);
|
ElectricityMeter getElectricityMeter(ElectricityMeter electricityMeter);
|
||||||
int insert(ElectricityMeter electricityMeter);
|
|
||||||
int update(ElectricityMeter electricityMeter);
|
int update(ElectricityMeter electricityMeter);
|
||||||
int updateValue(ElectricityMeter electricityMeter);
|
int updateValue(ElectricityMeter electricityMeter);
|
||||||
int updateRelayState(ElectricityMeter electricityMeter);
|
int updateRelayState(ElectricityMeter electricityMeter);
|
||||||
|
|
|
@ -89,23 +89,6 @@
|
||||||
and address = #{address}
|
and address = #{address}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
|
||||||
insert into nu_iot_tq_water_meter(
|
|
||||||
cid,
|
|
||||||
address,
|
|
||||||
relay_state,
|
|
||||||
remark,
|
|
||||||
create_time
|
|
||||||
)
|
|
||||||
values(
|
|
||||||
#{cid},
|
|
||||||
#{address},
|
|
||||||
#{relayState},
|
|
||||||
#{remark},
|
|
||||||
now()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<update id="update" parameterType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||||
update nu_iot_tq_electricity_meter
|
update nu_iot_tq_electricity_meter
|
||||||
set
|
set
|
||||||
|
|
|
@ -21,4 +21,6 @@ public interface IElectricityMeterService extends IService<ElectricityMeter> {
|
||||||
|
|
||||||
|
|
||||||
void editHldy(ElectricityMeter electricityMeter);
|
void editHldy(ElectricityMeter electricityMeter);
|
||||||
|
|
||||||
|
void baoxiu(ElectricityMeter electricityMeter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.nu.modules.tq.common.service.ITqApiLogService;
|
||||||
import com.nu.modules.tq.utils.HttpTool;
|
import com.nu.modules.tq.utils.HttpTool;
|
||||||
import com.nu.modules.tq.utils.SignTool;
|
import com.nu.modules.tq.utils.SignTool;
|
||||||
import com.nu.modules.tq.utils.TqApi;
|
import com.nu.modules.tq.utils.TqApi;
|
||||||
|
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||||
import com.nu.modules.tq.electricity.mapper.ElectricityMeterMapper;
|
import com.nu.modules.tq.electricity.mapper.ElectricityMeterMapper;
|
||||||
|
@ -480,6 +481,18 @@ public class ElectricityMeterServiceImpl extends ServiceImpl<ElectricityMeterMap
|
||||||
baseMapper.updateById(electricityMeter);
|
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")
|
@DS("#dataSourceCode")
|
||||||
public boolean syncElectricityDel(String dataSourceCode,ElectricityMeter electricityMeter) {
|
public boolean syncElectricityDel(String dataSourceCode,ElectricityMeter electricityMeter) {
|
||||||
|
|
|
@ -3,18 +3,19 @@ package com.nu.modules.tq.water.controller;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||||
import com.nu.modules.tq.water.service.IWaterMeterService;
|
import com.nu.modules.tq.water.service.IWaterMeterService;
|
||||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
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 javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -75,4 +76,13 @@ public class WaterMeterController extends JeecgController<WaterMeter, IWaterMete
|
||||||
return service.waterRead(waterMeter);
|
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("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,6 @@ public class WaterMeter implements Serializable {
|
||||||
private String nuName;//护理单元
|
private String nuName;//护理单元
|
||||||
private String departId;//机构ID
|
private String departId;//机构ID
|
||||||
private String departName;//机构名称
|
private String departName;//机构名称
|
||||||
|
/**维修状态*/
|
||||||
|
private String maintainStatus;
|
||||||
}
|
}
|
|
@ -12,7 +12,6 @@ public interface WaterMeterMapper extends BaseMapper<WaterMeter> {
|
||||||
IPage<WaterMeter> findPage(Page<WaterMeter> page, @Param("params") WaterMeter waterMeter);
|
IPage<WaterMeter> findPage(Page<WaterMeter> page, @Param("params") WaterMeter waterMeter);
|
||||||
List<WaterMeter> findAllList();
|
List<WaterMeter> findAllList();
|
||||||
WaterMeter getWaterMeter(WaterMeter waterMeter);
|
WaterMeter getWaterMeter(WaterMeter waterMeter);
|
||||||
int insert(WaterMeter waterMeter);
|
|
||||||
int update(WaterMeter waterMeter);
|
int update(WaterMeter waterMeter);
|
||||||
int updateValue(WaterMeter waterMeter);
|
int updateValue(WaterMeter waterMeter);
|
||||||
int updateRelayState(WaterMeter waterMeter);
|
int updateRelayState(WaterMeter waterMeter);
|
||||||
|
|
|
@ -78,25 +78,6 @@
|
||||||
and address = #{address}
|
and address = #{address}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
|
||||||
insert into nu_iot_tq_water_meter(
|
|
||||||
cid,
|
|
||||||
address,
|
|
||||||
relay_state,
|
|
||||||
battery_state,
|
|
||||||
remark,
|
|
||||||
create_time
|
|
||||||
)
|
|
||||||
values(
|
|
||||||
#{cid},
|
|
||||||
#{address},
|
|
||||||
#{relayState},
|
|
||||||
#{batteryState},
|
|
||||||
#{remark},
|
|
||||||
now()
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
<update id="update" parameterType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||||
update nu_iot_tq_water_meter
|
update nu_iot_tq_water_meter
|
||||||
set
|
set
|
||||||
|
|
|
@ -18,4 +18,6 @@ public interface IWaterMeterService extends IService<WaterMeter> {
|
||||||
String waterResetNotify(String response_content, String timestamp, String sign);
|
String waterResetNotify(String response_content, String timestamp, String sign);
|
||||||
String waterControlNotify(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);
|
String waterReadNotify(String response_content, String timestamp, String sign);
|
||||||
|
|
||||||
|
void baoxiu(WaterMeter waterMeter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||||
import com.nu.modules.tq.common.entity.TqApiLog;
|
import com.nu.modules.tq.common.entity.TqApiLog;
|
||||||
import com.nu.modules.tq.common.service.ITqApiLogService;
|
import com.nu.modules.tq.common.service.ITqApiLogService;
|
||||||
import com.nu.modules.tq.utils.HttpTool;
|
import com.nu.modules.tq.utils.HttpTool;
|
||||||
|
@ -479,6 +480,19 @@ public class WaterMeterServiceImpl extends ServiceImpl<WaterMeterMapper, WaterMe
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void baoxiu(WaterMeter waterMeter) {
|
||||||
|
waterMeter.setMaintainStatus("1");
|
||||||
|
baseMapper.updateById(waterMeter);
|
||||||
|
syncImpl.devopsBaoxiu(waterMeter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("devops")
|
||||||
|
public void devopsBaoxiu(WaterMeter waterMeter){
|
||||||
|
baseMapper.updateById(waterMeter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//业务系统删除命令
|
//业务系统删除命令
|
||||||
@DS("#dataSourceCode")
|
@DS("#dataSourceCode")
|
||||||
|
|
|
@ -3,9 +3,11 @@ package com.nu.modules.yiweilian.humid.controller;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||||
import com.nu.modules.tq.water.entity.WaterMeter;
|
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||||
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
@ -135,4 +137,11 @@ public class HumidDeviceController extends JeecgController<HumidDevice, IHumidDe
|
||||||
return Result.OK("编辑成功!");
|
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("操作成功!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,5 +116,6 @@ public class HumidDevice implements Serializable {
|
||||||
private String syncType;//是否同步 0 未同步 1已同步
|
private String syncType;//是否同步 0 未同步 1已同步
|
||||||
private String oldDepartId;//原机构id
|
private String oldDepartId;//原机构id
|
||||||
private String oldDepartName;//原机构名称
|
private String oldDepartName;//原机构名称
|
||||||
|
/**维修状态*/
|
||||||
|
private String maintainStatus;
|
||||||
}
|
}
|
|
@ -17,4 +17,6 @@ public interface IHumidDeviceService extends IService<HumidDevice> {
|
||||||
IPage<HumidDevice> findLogPage(Page<HumidDevice> page, HumidDevice humidDevice);
|
IPage<HumidDevice> findLogPage(Page<HumidDevice> page, HumidDevice humidDevice);
|
||||||
|
|
||||||
void editHldy(HumidDevice humidDevice);
|
void editHldy(HumidDevice humidDevice);
|
||||||
|
|
||||||
|
void baoxiu(HumidDevice humidDevice);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||||
import com.nu.modules.yiweilian.humid.mapper.HumidDeviceMapper;
|
import com.nu.modules.yiweilian.humid.mapper.HumidDeviceMapper;
|
||||||
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
||||||
|
@ -443,6 +444,18 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
||||||
baseMapper.updateById(humidDevice);
|
baseMapper.updateById(humidDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void baoxiu(HumidDevice humidDevice) {
|
||||||
|
humidDevice.setMaintainStatus("1");
|
||||||
|
baseMapper.updateById(humidDevice);
|
||||||
|
syncImpl.devopsBaoxiu(humidDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("devops")
|
||||||
|
public void devopsBaoxiu(HumidDevice humidDevice){
|
||||||
|
baseMapper.updateById(humidDevice);
|
||||||
|
}
|
||||||
|
|
||||||
//业务系统删除命令
|
//业务系统删除命令
|
||||||
@DS("#dataSourceCode")
|
@DS("#dataSourceCode")
|
||||||
public boolean syncElectricityDel(String dataSourceCode, HumidDevice humidDevice) {
|
public boolean syncElectricityDel(String dataSourceCode, HumidDevice humidDevice) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component("iotAsyncDQNP")
|
@Component("iotConfigAsyncDQNP")
|
||||||
public class DynamicQueueNameProvider {
|
public class DynamicQueueNameProvider {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -29,9 +29,9 @@ public class TqConfigMQListener {
|
||||||
|
|
||||||
@RabbitListener(
|
@RabbitListener(
|
||||||
bindings = @QueueBinding(
|
bindings = @QueueBinding(
|
||||||
value = @Queue(name = "#{iotAsyncDQNP.getSyncTqQueueName()}"),
|
value = @Queue(name = "#{iotConfigAsyncDQNP.getSyncTqQueueName()}"),
|
||||||
exchange = @Exchange(name = "hldy.tqconfig", type = ExchangeTypes.DIRECT),
|
exchange = @Exchange(name = "hldy.tqconfig", type = ExchangeTypes.DIRECT),
|
||||||
key = "#{iotAsyncDQNP.getSyncTqKeyName()}"
|
key = "#{iotConfigAsyncDQNP.getSyncTqKeyName()}"
|
||||||
),
|
),
|
||||||
errorHandler = "iotConfigMQErrorHandler"
|
errorHandler = "iotConfigMQErrorHandler"
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,9 +27,9 @@ public class TumsConfigMQListener {
|
||||||
|
|
||||||
@RabbitListener(
|
@RabbitListener(
|
||||||
bindings = @QueueBinding(
|
bindings = @QueueBinding(
|
||||||
value = @Queue(name = "#{iotAsyncDQNP.getSyncTumsQueueName()}"),
|
value = @Queue(name = "#{iotConfigAsyncDQNP.getSyncTumsQueueName()}"),
|
||||||
exchange = @Exchange(name = "hldy.tumsconfig", type = ExchangeTypes.DIRECT),
|
exchange = @Exchange(name = "hldy.tumsconfig", type = ExchangeTypes.DIRECT),
|
||||||
key = "#{iotAsyncDQNP.getSyncTumsKeyName()}"
|
key = "#{iotConfigAsyncDQNP.getSyncTumsKeyName()}"
|
||||||
),
|
),
|
||||||
errorHandler = "iotConfigMQErrorHandler"
|
errorHandler = "iotConfigMQErrorHandler"
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,9 +27,9 @@ public class YiweilianConfigMQListener {
|
||||||
|
|
||||||
@RabbitListener(
|
@RabbitListener(
|
||||||
bindings = @QueueBinding(
|
bindings = @QueueBinding(
|
||||||
value = @Queue(name = "#{iotAsyncDQNP.getSyncYiweilianQueueName()}"),
|
value = @Queue(name = "#{iotConfigAsyncDQNP.getSyncYiweilianQueueName()}"),
|
||||||
exchange = @Exchange(name = "hldy.yiweilianconfig", type = ExchangeTypes.DIRECT),
|
exchange = @Exchange(name = "hldy.yiweilianconfig", type = ExchangeTypes.DIRECT),
|
||||||
key = "#{iotAsyncDQNP.getSyncTYiweilianKeyName()}"
|
key = "#{iotConfigAsyncDQNP.getSyncTYiweilianKeyName()}"
|
||||||
),
|
),
|
||||||
errorHandler = "iotConfigMQErrorHandler"
|
errorHandler = "iotConfigMQErrorHandler"
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.nu.mq.device.exceptionhandler;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
|
||||||
|
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component("iotDeviceMQErrorHandler")
|
||||||
|
public class IotDeviceMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object handleError(Message message, org.springframework.messaging.Message<?> message1, ListenerExecutionFailedException e) {
|
||||||
|
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
||||||
|
|
||||||
|
// 根据异常类型选择处理策略
|
||||||
|
// if (isRetryable(e)) {
|
||||||
|
// // 可重试异常:抛出异常触发重试
|
||||||
|
// throw e;
|
||||||
|
// } else {
|
||||||
|
// 不可恢复异常:拒绝消息且不重新入队
|
||||||
|
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.nu.mq.device.listener;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component("iotDeviceAsyncDQNP")
|
||||||
|
public class DynamicQueueNameProvider {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
|
public String getSyncDeviceQueueName() {
|
||||||
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
|
String orgCode = deptInfo.getString("code");
|
||||||
|
if (StringUtils.isNotBlank(orgCode)) {
|
||||||
|
return orgCode + ".iotsyncbiz.async";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSyncDeviceKeyName() {
|
||||||
|
return getSyncDeviceQueueName();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,328 @@
|
||||||
|
package com.nu.mq.device.listener;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.nu.dto.*;
|
||||||
|
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||||
|
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||||
|
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraCapability;
|
||||||
|
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||||
|
import com.nu.modules.tplink.camera.service.ICameraCapabilityService;
|
||||||
|
import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
||||||
|
import com.nu.modules.tq.common.entity.TqDeviceInfo;
|
||||||
|
import com.nu.modules.tq.common.service.ITqDeviceInfoService;
|
||||||
|
import com.nu.modules.tq.electricity.entity.ElectricityMeter;
|
||||||
|
import com.nu.modules.tq.electricity.service.IElectricityMeterService;
|
||||||
|
import com.nu.modules.tq.water.entity.WaterMeter;
|
||||||
|
import com.nu.modules.tq.water.service.IWaterMeterService;
|
||||||
|
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||||
|
import com.nu.modules.yiweilian.humid.service.IHumidDeviceService;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.core.ExchangeTypes;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class IotSyncBizMQListener {
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INuBaseInfoService nuBaseInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICameraInfoService cameraInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICameraCapabilityService cameraCapabilityService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IElectricityMeterService electricityMeterService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IWaterMeterService waterMeterService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITqDeviceInfoService collectorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IHumidDeviceService humidDeviceService;
|
||||||
|
|
||||||
|
@RabbitListener(
|
||||||
|
bindings = @QueueBinding(
|
||||||
|
value = @Queue(name = "#{iotDeviceAsyncDQNP.getSyncDeviceQueueName()}"),
|
||||||
|
exchange = @Exchange(name = "hldy.iotsyncbiz", type = ExchangeTypes.DIRECT),
|
||||||
|
key = "#{iotDeviceAsyncDQNP.getSyncDeviceKeyName()}"
|
||||||
|
),
|
||||||
|
errorHandler = "iotDeviceMQErrorHandler"
|
||||||
|
)
|
||||||
|
public void handleMessage_unify(IotSyncBizMQDto dto) {
|
||||||
|
saveSyncBizInfo(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveSyncBizInfo(IotSyncBizMQDto dto) {
|
||||||
|
List<StatusMQDto> statusList = new ArrayList<>();
|
||||||
|
IotNuBaseInfoMQDto iotNuBaseInfoMQDto = dto.getNuBaseInfo();
|
||||||
|
try {
|
||||||
|
QueryWrapper<NuBaseInfo> nuBaseInfoQw = new QueryWrapper<>();
|
||||||
|
nuBaseInfoQw.eq("nu_id",iotNuBaseInfoMQDto.getNuId());
|
||||||
|
NuBaseInfo entity = nuBaseInfoService.getOne(nuBaseInfoQw);
|
||||||
|
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());
|
||||||
|
nuBaseInfoService.updateById(entity);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
NuBaseInfo nuBaseInfo = new NuBaseInfo();
|
||||||
|
BeanUtils.copyProperties(iotNuBaseInfoMQDto, nuBaseInfo);
|
||||||
|
nuBaseInfoService.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){
|
||||||
|
for(int i=0;i<cameraList.size();i++){
|
||||||
|
IotCameraInfoMQDto iotCameraInfoMQDto = cameraList.get(i);
|
||||||
|
try {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotCameraInfoMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("成功");
|
||||||
|
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("摄像头");
|
||||||
|
QueryWrapper<CameraInfo> cameraQw = new QueryWrapper<>();
|
||||||
|
cameraQw.eq("device_index",iotCameraInfoMQDto.getDeviceIndex());
|
||||||
|
CameraInfo entity = cameraInfoService.getOne(cameraQw);
|
||||||
|
if(entity!=null){
|
||||||
|
if(iotCameraInfoMQDto.getMaintainStatus().equals(entity.getMaintainStatus())){
|
||||||
|
statusMQDto.setMessage("忽略");
|
||||||
|
}else{
|
||||||
|
entity.setMaintainStatus(iotCameraInfoMQDto.getMaintainStatus());
|
||||||
|
cameraInfoService.updateById(entity);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
CameraInfo cameraInfo = new CameraInfo();
|
||||||
|
BeanUtils.copyProperties(iotCameraInfoMQDto, cameraInfo);
|
||||||
|
cameraInfoService.save(cameraInfo);
|
||||||
|
}
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotCameraInfoMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("失败");
|
||||||
|
statusMQDto.setPrimaryKey(iotCameraInfoMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("摄像头");
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IotCameraCapabilityMQDto> capabilityList = dto.getCapabilityList();
|
||||||
|
if(capabilityList!=null&&capabilityList.size()>0){
|
||||||
|
for(int i=0;i<capabilityList.size();i++){
|
||||||
|
IotCameraCapabilityMQDto iotCameraCapabilityMQDto = capabilityList.get(i);
|
||||||
|
try {
|
||||||
|
QueryWrapper<CameraCapability> capabilityQw = new QueryWrapper<>();
|
||||||
|
capabilityQw.eq("device_index",iotCameraCapabilityMQDto.getDeviceIndex());
|
||||||
|
CameraCapability entity = cameraCapabilityService.getOne(capabilityQw);
|
||||||
|
cameraCapabilityService.removeById(entity);
|
||||||
|
CameraCapability cameraCapability = new CameraCapability();
|
||||||
|
BeanUtils.copyProperties(iotCameraCapabilityMQDto, cameraCapability);
|
||||||
|
cameraCapabilityService.save(cameraCapability);
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotCameraCapabilityMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("成功");
|
||||||
|
statusMQDto.setPrimaryKey(iotCameraCapabilityMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("摄像头能力集");
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotCameraCapabilityMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("失败");
|
||||||
|
statusMQDto.setPrimaryKey(iotCameraCapabilityMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("摄像头能力集");
|
||||||
|
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.getId().toString());
|
||||||
|
statusMQDto.setMessage("成功");
|
||||||
|
statusMQDto.setPrimaryKey(iotElectricityMeterMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("电表");
|
||||||
|
QueryWrapper<ElectricityMeter> electricityQw = new QueryWrapper<>();
|
||||||
|
electricityQw.eq("cid",iotElectricityMeterMQDto.getCid());
|
||||||
|
ElectricityMeter entity = electricityMeterService.getOne(electricityQw);
|
||||||
|
if(entity!=null){
|
||||||
|
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);
|
||||||
|
electricityMeterService.save(electricityMeter);
|
||||||
|
}
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotElectricityMeterMQDto.getId().toString());
|
||||||
|
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.getId().toString());
|
||||||
|
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){
|
||||||
|
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);
|
||||||
|
waterMeterService.save(waterMeter);
|
||||||
|
}
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotWaterMeterMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("失败");
|
||||||
|
statusMQDto.setPrimaryKey(iotWaterMeterMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("水表");
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IotEleWaterCollectorMQDto> collectorList = dto.getCollectorList();
|
||||||
|
if(collectorList!=null&&collectorList.size()>0){
|
||||||
|
for(int i=0;i<collectorList.size();i++){
|
||||||
|
IotEleWaterCollectorMQDto iotEleWaterCollectorMQDto = collectorList.get(i);
|
||||||
|
try {
|
||||||
|
QueryWrapper<TqDeviceInfo> collectorQw = new QueryWrapper<>();
|
||||||
|
collectorQw.eq("cid",iotEleWaterCollectorMQDto.getCid());
|
||||||
|
TqDeviceInfo entity = collectorService.getOne(collectorQw);
|
||||||
|
collectorService.removeById(entity);
|
||||||
|
TqDeviceInfo tqDeviceInfo = new TqDeviceInfo();
|
||||||
|
BeanUtils.copyProperties(iotEleWaterCollectorMQDto, tqDeviceInfo);
|
||||||
|
collectorService.save(tqDeviceInfo);
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotEleWaterCollectorMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("成功");
|
||||||
|
statusMQDto.setPrimaryKey(iotEleWaterCollectorMQDto.getLogId());
|
||||||
|
statusMQDto.setNote("电水表采集器");
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotEleWaterCollectorMQDto.getId().toString());
|
||||||
|
statusMQDto.setMessage("失败");
|
||||||
|
statusMQDto.setPrimaryKey(iotEleWaterCollectorMQDto.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.getId().toString());
|
||||||
|
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){
|
||||||
|
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);
|
||||||
|
humidDeviceService.save(humidDevice);
|
||||||
|
}
|
||||||
|
statusList.add(statusMQDto);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setAsyncId(iotHumidDeviceMQDto.getId().toString());
|
||||||
|
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.async.result", statusListMQDto);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue