|
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
|
|
|
import com.yunfeiyun.agmp.common.log.LogCore;
|
|
|
+import com.yunfeiyun.agmp.common.utils.DateUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.JSONUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.SecurityUtils;
|
|
|
import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
@@ -331,4 +332,43 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 要素编辑
|
|
|
+ *
|
|
|
+ * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
+ */
|
|
|
+ public int elementEdit(IotSfElementfactorEditReqVo reqVo) {
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ String sfBid = reqVo.getSfBid();
|
|
|
+ String sfDisplayname = reqVo.getSfDisplayname();
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(devBid)) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备标识不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(sfDisplayname)) {
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "要素名称不能为空");
|
|
|
+ }
|
|
|
+ IotDevice iotDevice = iotDeviceService.selectIotDeviceByDevBid(reqVo.getDevBid());
|
|
|
+ if (iotDevice == null) {
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备不存在");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(sfBid)) {
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "要素标识不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ IotSfElementfactor iotSfElementfactor = iotSfElementfactorService.selectIotSfElementfactorBySfBid(sfBid);
|
|
|
+ if (iotSfElementfactor == null) {
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "要素不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ iotSfElementfactor.setSfDisplayname(sfDisplayname);
|
|
|
+ iotSfElementfactor.setSfAddress(reqVo.getSfAddress());
|
|
|
+ iotSfElementfactor.setSfLat(reqVo.getSfLat());
|
|
|
+ iotSfElementfactor.setSfLng(reqVo.getSfLng());
|
|
|
+ iotSfElementfactor.setSfSequence(reqVo.getSfSequence());
|
|
|
+ iotSfElementfactor.setSfModifieddate(DateUtils.dateTimeNow());
|
|
|
+ iotSfElementfactor.setSfModifier(SecurityUtils.getUserId());
|
|
|
+ return iotSfElementfactorService.updateIotSfElementfactor(iotSfElementfactor);
|
|
|
+ }
|
|
|
+
|
|
|
}
|