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