|
|
|
@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.constants.FuncRouteEnum; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.vo.ScadaSelectionVO; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.vo.StationSelectionVO; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.vo.VideoSelectionVO; |
|
|
|
|
import com.hnac.hzims.bigmodel.interactive.vo.*; |
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity; |
|
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
@ -50,22 +47,39 @@ public class ExtraResolveStrategyService {
|
|
|
|
|
if(StringUtil.isNotBlank(functionCode)) { |
|
|
|
|
XxlJobLogger.log("函数编号为:" + functionCode); |
|
|
|
|
FuncRouteEnum funcRouteEnum = FuncRouteEnum.getEnumByFuncCode(functionCode); |
|
|
|
|
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); |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
if(Func.isNotEmpty(funcRouteEnum)) { |
|
|
|
|
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_FAULT: |
|
|
|
|
return this.resolveChooseFault(extra); |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return JSONObject.parseObject(JSON.toJSONString(extra),ExtraVO.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
JSONObject data = JSONObject.parseObject(JSON.toJSONString(extra.get("data"))); |
|
|
|
|