|
|
@@ -107,12 +107,12 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 新增泵类要素
|
|
|
+ * 新增要素
|
|
|
* 该接口用于添加新的泵类要素,接收相关参数并调用通用设备功能服务进行处理。
|
|
|
*
|
|
|
* @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
*/
|
|
|
- public int pumpAdd(IotSfElementfactorAddReqVo reqVo) {
|
|
|
+ public int elementAdd(IotSfElementfactorAddReqVo reqVo) {
|
|
|
String devBid = reqVo.getDevBid();
|
|
|
if (StringUtils.isEmpty(devBid)) {
|
|
|
throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备标识不能为空");
|
|
|
@@ -141,7 +141,7 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
|
|
|
IotSfElementfactorListReqVo reqVo1 = new IotSfElementfactorListReqVo();
|
|
|
reqVo1.setDevBid(devBid);
|
|
|
- List<IotSfElementfactor> elementList = iotSfElementfactorService.selectIotSfElementfactorListByPump(reqVo1);
|
|
|
+ List<IotSfElementfactor> elementList = iotSfElementfactorService.selectIotSfElementfactorList(reqVo1);
|
|
|
Set<String> sfCodeSet = new HashSet<>();
|
|
|
for (IotSfElementfactor element : elementList) {
|
|
|
if(StringUtils.isNotEmpty(element.getSfCode())){
|
|
|
@@ -188,6 +188,38 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取灌区设备已存在的元素列表
|
|
|
+ *
|
|
|
+ * @param reqVo 请求对象,包含设备标识等信息
|
|
|
+ * @return TableDataInfo 包含响应码、消息、数据和总数
|
|
|
+ * @throws IotBizException 抛出业务异常,包含错误码和错误信息
|
|
|
+ */
|
|
|
+ public TableDataInfo getGroupAlreadyElementList(IotSfElementfactorListReqVo reqVo) {
|
|
|
+ TableDataInfo rspData = new TableDataInfo();
|
|
|
+ rspData.setCode(ErrorCode.SUCCESS.getCode());
|
|
|
+ rspData.setMsg(ErrorCode.SUCCESS.getMessage());
|
|
|
+ rspData.setData(new ArrayList<>());
|
|
|
+ rspData.setTotal(0);
|
|
|
+
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ if (StringUtils.isEmpty(devBid)) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备标识不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ IotDevice findDevice = iotDeviceService.selectIotDeviceByDevBid(reqVo.getDevBid());
|
|
|
+ if (findDevice == null) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<IotSfElementfactorAlreadyListResVo> resVoList = iotSfElementfactorService.getGroupAlreadyElementList(reqVo);
|
|
|
+ if (resVoList != null && !resVoList.isEmpty()){
|
|
|
+ rspData.setData(resVoList);
|
|
|
+ rspData.setTotal(resVoList.size());
|
|
|
+ }
|
|
|
+ return rspData;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取未配置的电磁阀元素列表
|
|
|
*
|
|
|
* @param reqVo 请求参数,包含设备标识(devBid)等筛选条件
|
|
|
@@ -207,4 +239,36 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取灌区设备已存在的元素列表
|
|
|
+ *
|
|
|
+ * @param reqVo 请求对象,包含设备标识等信息
|
|
|
+ * @return TableDataInfo 包含响应码、消息、数据和总数
|
|
|
+ * @throws IotBizException 抛出业务异常,包含错误码和错误信息
|
|
|
+ */
|
|
|
+ public TableDataInfo getValveAlreadyElementList(IotSfElementfactorListReqVo reqVo) {
|
|
|
+ TableDataInfo rspData = new TableDataInfo();
|
|
|
+ rspData.setCode(ErrorCode.SUCCESS.getCode());
|
|
|
+ rspData.setMsg(ErrorCode.SUCCESS.getMessage());
|
|
|
+ rspData.setData(new ArrayList<>());
|
|
|
+ rspData.setTotal(0);
|
|
|
+
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ if (StringUtils.isEmpty(devBid)) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备标识不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ IotDevice findDevice = iotDeviceService.selectIotDeviceByDevBid(reqVo.getDevBid());
|
|
|
+ if (findDevice == null) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<IotSfElementfactorAlreadyListResVo> resVoList = iotSfElementfactorService.getValveAlreadyElementList(reqVo);
|
|
|
+ if (resVoList != null && !resVoList.isEmpty()){
|
|
|
+ rspData.setData(resVoList);
|
|
|
+ rspData.setTotal(resVoList.size());
|
|
|
+ }
|
|
|
+ return rspData;
|
|
|
+ }
|
|
|
+
|
|
|
}
|