|
|
@ -63,20 +63,17 @@ public class ExtraResolveStrategyService { |
|
|
|
switch (funcRouteEnum) { |
|
|
|
switch (funcRouteEnum) { |
|
|
|
case DIAGNOSE: |
|
|
|
case DIAGNOSE: |
|
|
|
return this.resolveDiagnose(extra); |
|
|
|
return this.resolveDiagnose(extra); |
|
|
|
case CHOOSE_STATION: |
|
|
|
|
|
|
|
return this.resolveChooseStation(extra); |
|
|
|
|
|
|
|
case CHOOSE_VIDEO: |
|
|
|
case CHOOSE_VIDEO: |
|
|
|
return this.resolveChooseVideo(extra); |
|
|
|
|
|
|
|
case CHOOSE_CANVAS: |
|
|
|
case CHOOSE_CANVAS: |
|
|
|
return this.resolveChooseScada(extra); |
|
|
|
case CHOOSE_STATION: |
|
|
|
case CHOOSE_FAULT: |
|
|
|
case CHOOSE_FAULT: |
|
|
|
return this.resolveChooseFault(extra); |
|
|
|
case CHOOSE_YC: |
|
|
|
|
|
|
|
case CHOOSE_YK: |
|
|
|
|
|
|
|
return this.resolveChooseSelection(extra,funcRouteEnum); |
|
|
|
case CONFIRM_YK: |
|
|
|
case CONFIRM_YK: |
|
|
|
return this.resolveConfirmRemote(extra); |
|
|
|
return this.resolveConfirmRemote(extra); |
|
|
|
case SHOW_PARAM: |
|
|
|
case SHOW_PARAM: |
|
|
|
return this.resolveShowParam(extra); |
|
|
|
return this.resolveShowParam(extra); |
|
|
|
case CHOOSE_YC: |
|
|
|
|
|
|
|
return this.resolveChooseYc(extra); |
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -88,19 +85,31 @@ public class ExtraResolveStrategyService { |
|
|
|
return JSONObject.parseObject(JSON.toJSONString(extra),ExtraVO.class); |
|
|
|
return JSONObject.parseObject(JSON.toJSONString(extra),ExtraVO.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ExtraVO resolveChooseYc(JSONObject extra) { |
|
|
|
private ExtraVO resolveChooseSelection(JSONObject extra,FuncRouteEnum funcRouteEnum) { |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data"))); |
|
|
|
JSONArray selections = JSONArray.parseArray(JSON.toJSONString(extra.get("data"))); |
|
|
|
if(data.containsKey("ycs")) { |
|
|
|
result.setFuncCode(funcRouteEnum.getFuncCode()); |
|
|
|
List<AttrSelectionVO> attrs = JSONArray.parseArray(JSON.toJSONString(data.get("ycs")), AttrSelectionVO.class); |
|
|
|
|
|
|
|
result.setSelection(attrs); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
result.setFuncCode(FuncRouteEnum.CHOOSE_YC.getFuncCode()); |
|
|
|
|
|
|
|
result.setSpecial(true); |
|
|
|
result.setSpecial(true); |
|
|
|
result.setType(FuncRouteEnum.CHOOSE_YC.getType().getType()); |
|
|
|
result.setSelection(selections); |
|
|
|
|
|
|
|
result.setType(funcRouteEnum.getType().getType()); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private ExtraVO resolveChooseYc(JSONObject extra) {
|
|
|
|
|
|
|
|
// ExtraVO result = new ExtraVO();
|
|
|
|
|
|
|
|
// JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")));
|
|
|
|
|
|
|
|
// if(data.containsKey("yks")) {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// List<AttrSelectionVO> attrs = JSONArray.parseArray(JSON.toJSONString(data.get("yks")), AttrSelectionVO.class);
|
|
|
|
|
|
|
|
// result.setSelection(attrs);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// result.setFuncCode(FuncRouteEnum.CHOOSE_YC.getFuncCode());
|
|
|
|
|
|
|
|
// result.setSpecial(true);
|
|
|
|
|
|
|
|
// result.setType(FuncRouteEnum.CHOOSE_YC.getType().getType());
|
|
|
|
|
|
|
|
// return result;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private ExtraVO resolveShowParam(Map<String,Object> extra) { |
|
|
|
private ExtraVO resolveShowParam(Map<String,Object> extra) { |
|
|
|
DataVO data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")),DataVO.class); |
|
|
|
DataVO data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")),DataVO.class); |
|
|
|
if(Func.isNotEmpty(data)) { |
|
|
|
if(Func.isNotEmpty(data)) { |
|
|
@ -143,7 +152,7 @@ public class ExtraResolveStrategyService { |
|
|
|
result.setType(FuncRouteEnum.CONFIRM_YK.getType().getType()); |
|
|
|
result.setType(FuncRouteEnum.CONFIRM_YK.getType().getType()); |
|
|
|
R<DeviceInstanceFuncVO> funcVOR = deviceClient.getFuncById(remoteParam.getFuncId()); |
|
|
|
R<DeviceInstanceFuncVO> funcVOR = deviceClient.getFuncById(remoteParam.getFuncId()); |
|
|
|
if(funcVOR.isSuccess()) { |
|
|
|
if(funcVOR.isSuccess()) { |
|
|
|
Map<String,Object> param = new HashMap(1); |
|
|
|
Map<String,Object> param = new HashMap(); |
|
|
|
param.put("control",funcVOR.getData()); |
|
|
|
param.put("control",funcVOR.getData()); |
|
|
|
param.put("deviceName",remoteParam.getDeviceName()); |
|
|
|
param.put("deviceName",remoteParam.getDeviceName()); |
|
|
|
param.put("projectName",remoteParam.getProjectName()); |
|
|
|
param.put("projectName",remoteParam.getProjectName()); |
|
|
@ -154,18 +163,18 @@ public class ExtraResolveStrategyService { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ExtraVO resolveChooseFault(Map<String,Object> extra) { |
|
|
|
// private ExtraVO resolveChooseFault(Map<String,Object> extra) {
|
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
// ExtraVO result = new ExtraVO();
|
|
|
|
JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data"))); |
|
|
|
// JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")));
|
|
|
|
if(data.containsKey("faults")) { |
|
|
|
// if(data.containsKey("faults")) {
|
|
|
|
List<FaultSelectionVO> faults = JSONArray.parseArray(JSON.toJSONString(data.get("faults")), FaultSelectionVO.class); |
|
|
|
// List<FaultSelectionVO> faults = JSONArray.parseArray(JSON.toJSONString(data.get("faults")), FaultSelectionVO.class);
|
|
|
|
result.setSelection(faults); |
|
|
|
// result.setSelection(faults);
|
|
|
|
} |
|
|
|
// }
|
|
|
|
result.setFuncCode(FuncRouteEnum.CHOOSE_FAULT.getFuncCode()); |
|
|
|
// result.setFuncCode(FuncRouteEnum.CHOOSE_FAULT.getFuncCode());
|
|
|
|
result.setSpecial(true); |
|
|
|
// result.setSpecial(true);
|
|
|
|
result.setType(FunctionConstants.TypeEnum.CHOOSE.getType()); |
|
|
|
// result.setType(FunctionConstants.TypeEnum.CHOOSE.getType());
|
|
|
|
return result; |
|
|
|
// return result;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private ExtraVO resolveDiagnose(Map<String,Object> extra) { |
|
|
|
private ExtraVO resolveDiagnose(Map<String,Object> extra) { |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
@ -187,28 +196,28 @@ public class ExtraResolveStrategyService { |
|
|
|
* @param extra |
|
|
|
* @param extra |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private ExtraVO resolveChooseStation(Map<String,Object> extra) { |
|
|
|
// private ExtraVO resolveChooseStation(Map<String,Object> extra) {
|
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
// ExtraVO result = new ExtraVO();
|
|
|
|
JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data"))); |
|
|
|
// JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")));
|
|
|
|
if(data.containsKey("stations")) { |
|
|
|
// if(data.containsKey("stations")) {
|
|
|
|
List<String> stations = JSONArray.parseArray(JSON.toJSONString(data.get("stations")), String.class); |
|
|
|
// List<String> stations = JSONArray.parseArray(JSON.toJSONString(data.get("stations")), String.class);
|
|
|
|
List<StationSelectionVO> selectionList = stations.stream().map(stationId -> { |
|
|
|
// List<StationSelectionVO> selectionList = stations.stream().map(stationId -> {
|
|
|
|
StationSelectionVO selectionVO = new StationSelectionVO(); |
|
|
|
// StationSelectionVO selectionVO = new StationSelectionVO();
|
|
|
|
R<StationEntity> stationR = stationClient.getStationByCode(stationId); |
|
|
|
// R<StationEntity> stationR = stationClient.getStationByCode(stationId);
|
|
|
|
if (stationR.isSuccess() && Func.isNotEmpty(stationR.getData())) { |
|
|
|
// if (stationR.isSuccess() && Func.isNotEmpty(stationR.getData())) {
|
|
|
|
selectionVO.setId(stationId); |
|
|
|
// selectionVO.setId(stationId);
|
|
|
|
selectionVO.setName(stationR.getData().getName()); |
|
|
|
// selectionVO.setName(stationR.getData().getName());
|
|
|
|
} |
|
|
|
// }
|
|
|
|
return selectionVO; |
|
|
|
// return selectionVO;
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// }).collect(Collectors.toList());
|
|
|
|
result.setSelection(selectionList); |
|
|
|
// result.setSelection(selectionList);
|
|
|
|
result.setFuncCode(FuncRouteEnum.CHOOSE_STATION.getFuncCode()); |
|
|
|
// result.setFuncCode(FuncRouteEnum.CHOOSE_STATION.getFuncCode());
|
|
|
|
result.setSpecial(true); |
|
|
|
// result.setSpecial(true);
|
|
|
|
result.setType(FunctionConstants.TypeEnum.CHOOSE.getType()); |
|
|
|
// result.setType(FunctionConstants.TypeEnum.CHOOSE.getType());
|
|
|
|
} |
|
|
|
// }
|
|
|
|
result.setType(FunctionConstants.TypeEnum.CHOOSE.getType()); |
|
|
|
// result.setType(FunctionConstants.TypeEnum.CHOOSE.getType());
|
|
|
|
return result; |
|
|
|
// return result;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private ExtraVO resolveChooseVideo(Map<String,Object> extra) { |
|
|
|
private ExtraVO resolveChooseVideo(Map<String,Object> extra) { |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|
ExtraVO result = new ExtraVO(); |
|
|
|