|
@@ -544,9 +544,7 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
|
|
|
throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "名称不能为空");
|
|
throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "名称不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(!sfTypeSet.contains(sfType)){
|
|
|
|
|
- sfTypeSet.add(sfType);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ sfTypeSet.add(sfType);
|
|
|
|
|
|
|
|
IotSfElementfactor elementfactor = makeIotSfElementfactor(element, createDate);
|
|
IotSfElementfactor elementfactor = makeIotSfElementfactor(element, createDate);
|
|
|
|
|
|
|
@@ -713,4 +711,48 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
|
|
|
reqVo.setIotDevice(iotDevice);
|
|
reqVo.setIotDevice(iotDevice);
|
|
|
return sendConfigCmd(reqVo);
|
|
return sendConfigCmd(reqVo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取灌区参数
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
|
|
+ * @param reqVo
|
|
|
|
|
+ */
|
|
|
|
|
+ public JSONObject getGroupParamByGlobal (String devBid) {
|
|
|
|
|
+ JSONObject groupParamJson = new JSONObject();
|
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
|
+ params.put("devBid", devBid);
|
|
|
|
|
+ IotRunHaoSfdata iotRunHaoSfdata = (IotRunHaoSfdata) mongoService.findOne(IotRunHaoSfdata.class, params, "sfdataCreatedDate", "desc");
|
|
|
|
|
+ if(iotRunHaoSfdata == null || iotRunHaoSfdata.getSfdataContent() == null){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IotSfElementfactorListReqVo reqVo = new IotSfElementfactorListReqVo();
|
|
|
|
|
+ reqVo.setDevBid(devBid);
|
|
|
|
|
+ reqVo.setSfType(EnumSfElementType.SUCTION.getCode());
|
|
|
|
|
+ List<IotSfElementfactor> sfElementfactorList = iotSfElementfactorService.selectIotSfElementfactorList(reqVo);
|
|
|
|
|
+ Set<String> suctionSet = new HashSet<>();
|
|
|
|
|
+ if(sfElementfactorList != null && !sfElementfactorList.isEmpty()){
|
|
|
|
|
+ for(IotSfElementfactor vo : sfElementfactorList){
|
|
|
|
|
+ suctionSet.add(vo.getSfCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, String> groupParamMap = new HashMap<>();
|
|
|
|
|
+ groupParamMap.put("Num-ggsj", "0");
|
|
|
|
|
+ groupParamMap.put("Num-fqsj", "0");
|
|
|
|
|
+ for(String sfCode : suctionSet){
|
|
|
|
|
+ String key = sfCode.replace("Btn-fs", "");
|
|
|
|
|
+ groupParamMap.put("Btn-fxz" + key, "0");
|
|
|
|
|
+ groupParamMap.put("Num-fsj" + key, "0");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject sfdataContent = iotRunHaoSfdata.getSfdataContent();
|
|
|
|
|
+ for(String key: groupParamMap.keySet()){
|
|
|
|
|
+ String value = RunHaoSfElementUtil.getDataValue(key, sfdataContent);
|
|
|
|
|
+ groupParamJson.put(key, value);
|
|
|
|
|
+ }
|
|
|
|
|
+ return groupParamJson;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|