|
|
@@ -690,11 +690,16 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
|
|
|
* @return 返回删除结果,返回值为0表示删除成功,非0表示删除失败
|
|
|
*/
|
|
|
@Override
|
|
|
- public int elementDelete(IotSfElementfactor reqVo) {
|
|
|
- String sfBid = reqVo.getSfBid();
|
|
|
- String sfType = reqVo.getSfType();
|
|
|
- String devBid = reqVo.getDevBid();
|
|
|
- String sfCode = reqVo.getSfCode();
|
|
|
+ public int elementDelete(String sfBid) {
|
|
|
+
|
|
|
+ IotSfElementfactor elementfactor = iotSfElementfactorService.selectIotSfElementfactorBySfBid(sfBid);
|
|
|
+ if(elementfactor == null){
|
|
|
+ throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "参数异常,设备不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ String sfType = elementfactor.getSfType();
|
|
|
+ String devBid = elementfactor.getDevBid();
|
|
|
+ String sfCode = elementfactor.getSfCode();
|
|
|
IotDevice findDevice = iotDeviceService.selectIotDeviceByDevBid(devBid);
|
|
|
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
@@ -704,7 +709,7 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
|
|
|
throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备未采集数据");
|
|
|
}
|
|
|
JSONObject sfdataContent = iotRunHaoSfdata.getSfdataContent();
|
|
|
- if(RunHaoSfElementUtil.isAutoRunning(sfdataContent)){
|
|
|
+ if(Boolean.TRUE.equals(RunHaoSfElementUtil.isAutoRunning(sfdataContent))){
|
|
|
throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "灌溉中,请先停止灌溉");
|
|
|
}
|
|
|
|