|
@@ -74,13 +74,13 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
}
|
|
|
List<Hookup> hookupList = this.list(queryWrapper);
|
|
|
List<HookupOneVo> hookupListlist = new ArrayList<>();
|
|
|
- if (hookupList.size()>0){
|
|
|
+ if (hookupList.size() > 0) {
|
|
|
for (int i = 0; i < hookupList.size(); i++) {
|
|
|
HookupOneVo hookupOne = new HookupOneVo();
|
|
|
hookupOne.setType(hookupList.get(i).getOuterType());
|
|
|
hookupOne.setTitle(hookupList.get(i).getTitle());
|
|
|
hookupOne.setTemplate(hookupList.get(i).getTemplate());
|
|
|
- if ("".equals(hookupList.get(i).getProps())||hookupList.get(i).getProps()==null) {
|
|
|
+ if ("".equals(hookupList.get(i).getProps()) || hookupList.get(i).getProps() == null) {
|
|
|
hookupOne.setProps("");
|
|
|
} else {
|
|
|
hookupOne.setProps(hookupList.get(i).getProps().split(","));
|
|
@@ -92,9 +92,9 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
hookupOne.setEchartsOption(hookupList.get(i).getEchartsOption());
|
|
|
hookupOne.setEchartsOption(hookupList.get(i).getEchartsOption());
|
|
|
hookupOne.setElementBool(hookupList.get(i).getElementBool());
|
|
|
- if ("".equals(hookupList.get(i).getSvgLineSelectval())||hookupList.get(i).getSvgLineSelectval()==null) {
|
|
|
+ if ("".equals(hookupList.get(i).getSvgLineSelectval()) || hookupList.get(i).getSvgLineSelectval() == null) {
|
|
|
hookupOne.setSvgLineSelectval("");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
hookupOne.setSvgLineSelectval(hookupList.get(i).getSvgLineSelectval());
|
|
|
}
|
|
|
|
|
@@ -108,25 +108,104 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
public List<HookupComponentCompleteVo> getHookupComponentComplete(Integer siteId) {
|
|
|
List<DeviceTypeVo> deviceTypeVo = baseMapper.getDevidetype(siteId);
|
|
|
List<RtAnalogDataOneVo> variable_vaue = null;
|
|
|
- if (deviceTypeVo.size()>0){
|
|
|
- if (deviceTypeVo.get(0).getDeviceType() == 3) {
|
|
|
- String table = "rt_analog_171_data";
|
|
|
- if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
- table = "rt_switch_171_data";
|
|
|
- }
|
|
|
- variable_vaue = baseMapper.getVariable171(siteId,table);
|
|
|
- } else if (deviceTypeVo.get(0).getDeviceType() == 4) {
|
|
|
- String table = "rt_analog_173_data";
|
|
|
- if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
- table = "rt_switch_173_data";
|
|
|
+ List<Integer> variable_173_analog = new ArrayList<>();
|
|
|
+ List<Integer> variable_171_analog = new ArrayList<>();
|
|
|
+ List<Integer> variable_183_analog = new ArrayList<>();
|
|
|
+ List<Integer> variable_173_switch = new ArrayList<>();
|
|
|
+ List<Integer> variable_171_switch = new ArrayList<>();
|
|
|
+ List<Integer> variable_183_switch = new ArrayList<>();
|
|
|
+ for (int i = 0; i < deviceTypeVo.size(); i++) {
|
|
|
+ if (deviceTypeVo.get(i).getDataArea() == 2) {
|
|
|
+ if (deviceTypeVo.get(i).getDeviceType() == 3) {
|
|
|
+ variable_171_switch.add(deviceTypeVo.get(i).getId());
|
|
|
+ } else if (deviceTypeVo.get(i).getDeviceType() == 4) {
|
|
|
+ variable_173_switch.add(deviceTypeVo.get(i).getId());
|
|
|
+ } else if (deviceTypeVo.get(i).getDeviceType() ==1){
|
|
|
+ variable_183_switch.add(deviceTypeVo.get(i).getId());
|
|
|
}
|
|
|
- variable_vaue = baseMapper.getVariable173(siteId,table);
|
|
|
} else {
|
|
|
- String table = "rt_analog_data";
|
|
|
- if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
- table = "rt_switch_data";
|
|
|
+ if (deviceTypeVo.get(i).getDeviceType() == 3) {
|
|
|
+ variable_171_analog.add(deviceTypeVo.get(i).getId());
|
|
|
+ } else if (deviceTypeVo.get(i).getDeviceType() == 4) {
|
|
|
+ variable_173_analog.add(deviceTypeVo.get(i).getId());
|
|
|
+ } else if (deviceTypeVo.get(i).getDeviceType() == 1){
|
|
|
+ variable_183_analog.add(deviceTypeVo.get(i).getId());
|
|
|
}
|
|
|
- variable_vaue = baseMapper.getVariable(siteId,table);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ContextualDataVo> variable_173_analog_data = new ArrayList<>();
|
|
|
+ List<ContextualDataVo> variable_171_analog_data = new ArrayList<>();
|
|
|
+ List<ContextualDataVo> variable_183_analog_data = new ArrayList<>();
|
|
|
+ List<RtSwitchDataVo> variable_173_switch_data = new ArrayList<>();
|
|
|
+ List<RtSwitchDataVo> variable_171_switch_data = new ArrayList<>();
|
|
|
+ List<RtSwitchDataVo> variable_183_switch_data = new ArrayList<>();
|
|
|
+
|
|
|
+ if (variable_173_analog.size() > 0) {
|
|
|
+ variable_173_analog_data = baseMapper.getRtAnalogData(variable_173_analog, "rt_analog_173_data");
|
|
|
+ }
|
|
|
+ if (variable_171_analog.size() > 0) {
|
|
|
+ variable_171_analog_data = baseMapper.getRtAnalogData(variable_171_analog, "rt_analog_171_data");
|
|
|
+ }
|
|
|
+ if (variable_183_analog.size() > 0) {
|
|
|
+ variable_183_analog_data = baseMapper.getRtAnalogData(variable_183_analog, "rt_analog_data");
|
|
|
+ }
|
|
|
+ if (variable_173_switch.size() > 0) {
|
|
|
+ variable_173_switch_data = baseMapper.getRtSwitchData(variable_173_switch, "rt_switch_173_data");
|
|
|
+ }
|
|
|
+ if (variable_171_switch.size() > 0) {
|
|
|
+ variable_171_switch_data = baseMapper.getRtSwitchData(variable_171_switch, "rt_switch_171_data");
|
|
|
+ }
|
|
|
+ if (variable_183_switch.size() > 0) {
|
|
|
+ variable_183_switch_data = baseMapper.getRtSwitchData(variable_183_switch, "rt_switch_data");
|
|
|
+ }
|
|
|
+ List<VariableVo> variableVoList = new ArrayList<>();
|
|
|
+ if(variable_173_analog_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_173_analog_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_173_analog_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation1(variable_173_analog_data.get(i),variable_173_analog_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(variable_171_analog_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_171_analog_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_171_analog_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation1(variable_171_analog_data.get(i),variable_171_analog_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(variable_183_analog_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_183_analog_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_183_analog_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation1(variable_183_analog_data.get(i),variable_183_analog_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(variable_173_switch_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_173_switch_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_173_switch_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation2(variable_173_switch_data.get(i),variable_173_switch_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(variable_171_switch_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_171_switch_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_171_switch_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation2(variable_171_switch_data.get(i),variable_171_switch_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(variable_183_switch_data.size()>0){
|
|
|
+ for (int i = 0; i < variable_183_switch_data.size(); i++) {
|
|
|
+ VariableVo vriableVo = new VariableVo();
|
|
|
+ vriableVo.setVariableCoding(variable_183_switch_data.get(i).getVariableCoding());
|
|
|
+ vriableVo.setVariableValue(FieldEscapeUtils.transformation2(variable_183_switch_data.get(i),variable_183_switch_data.get(i).getVariableCoding().split("_")[1]));
|
|
|
+ variableVoList.add(vriableVo);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -143,21 +222,21 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
hookupComponentCompleteVo.setCreateType(hookupComponentComplete.get(i).getCreateType());
|
|
|
hookupComponentCompleteVo.setSvgPositionX(hookupComponentComplete.get(i).getSvgPositionX());
|
|
|
hookupComponentCompleteVo.setSvgPositionY(hookupComponentComplete.get(i).getSvgPositionY());
|
|
|
- if ("".equals(hookupComponentComplete.get(i).getMPoint())||hookupComponentComplete.get(i).getMPoint()==null){
|
|
|
+ if ("".equals(hookupComponentComplete.get(i).getMPoint()) || hookupComponentComplete.get(i).getMPoint() == null) {
|
|
|
hookupComponentCompleteVo.setMPoint("");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
hookupComponentCompleteVo.setMPoint(JSONArray.parseObject(hookupComponentComplete.get(i).getMPoint()));
|
|
|
}
|
|
|
- if ("\"\"".equals(hookupComponentComplete.get(i).getEchartsOption())||"".equals(hookupComponentComplete.get(i).getEchartsOption())||
|
|
|
- hookupComponentComplete.get(i).getEchartsOption()==null){
|
|
|
+ if ("\"\"".equals(hookupComponentComplete.get(i).getEchartsOption()) || "".equals(hookupComponentComplete.get(i).getEchartsOption()) ||
|
|
|
+ hookupComponentComplete.get(i).getEchartsOption() == null) {
|
|
|
hookupComponentCompleteVo.setEchartsOption("");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
hookupComponentCompleteVo.setEchartsOption(JSONArray.parseObject(hookupComponentComplete.get(i).getEchartsOption()));
|
|
|
}
|
|
|
|
|
|
hookupComponentCompleteVo.setSize(hookupComponentComplete.get(i).getSize());
|
|
|
hookupComponentCompleteVo.setAngle(hookupComponentComplete.get(i).getAngle());
|
|
|
- if ("".equals(hookupComponentComplete.get(i).getElementBool())||hookupComponentComplete.get(i).getElementBool()==null) {
|
|
|
+ if ("".equals(hookupComponentComplete.get(i).getElementBool()) || hookupComponentComplete.get(i).getElementBool() == null) {
|
|
|
hookupComponentCompleteVo.setElementBool("");
|
|
|
} else {
|
|
|
hookupComponentCompleteVo.setElementBool(hookupComponentComplete.get(i).getElementBool().split(","));
|
|
@@ -166,10 +245,10 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
hookupComponentCompleteVo.setDeviceId(hookupComponentComplete.get(i).getDeviceId());
|
|
|
hookupComponentCompleteVo.setSiteId(hookupComponentComplete.get(i).getSiteId());
|
|
|
hookupComponentCompleteVo.setVariableId(hookupComponentComplete.get(i).getVariableId());
|
|
|
- if (variable_vaue.size() > 0) {
|
|
|
- for (int j = 0; j < variable_vaue.size(); j++) {
|
|
|
- if (hookupComponentComplete.get(i).getVariableCoding().equals(variable_vaue.get(j).getVariableCoding())) {
|
|
|
- String variableValue = FieldEscapeUtils.getVariableValue(variable_vaue.get(j));
|
|
|
+ if (variableVoList.size() > 0) {
|
|
|
+ for (int j = 0; j < variableVoList.size(); j++) {
|
|
|
+ if (hookupComponentComplete.get(i).getVariableCoding().equals(variableVoList.get(j).getVariableCoding())) {
|
|
|
+ String variableValue = ""+variableVoList.get(j).getVariableValue();
|
|
|
hookupComponentCompleteVo.setVariableValue(variableValue);
|
|
|
}
|
|
|
}
|
|
@@ -182,6 +261,82 @@ public class HookupServiceImpl extends AbstractCrudService<HookupMapper, Hookup>
|
|
|
return hookupComponentCompleteVoLsit;
|
|
|
}
|
|
|
|
|
|
+// public List<HookupComponentCompleteVo> getHookupComponentComplete(Integer siteId) {
|
|
|
+// List<DeviceTypeVo> deviceTypeVo = baseMapper.getDevidetype(siteId);
|
|
|
+// List<RtAnalogDataOneVo> variable_vaue = null;
|
|
|
+// if (deviceTypeVo.size()>0){
|
|
|
+// if (deviceTypeVo.get(0).getDeviceType() == 3) {
|
|
|
+// String table = "rt_analog_171_data";
|
|
|
+// if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
+// table = "rt_switch_171_data";
|
|
|
+// }
|
|
|
+// variable_vaue = baseMapper.getVariable171(siteId,table);
|
|
|
+// } else if (deviceTypeVo.get(0).getDeviceType() == 4) {
|
|
|
+// String table = "rt_analog_173_data";
|
|
|
+// if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
+// table = "rt_switch_173_data";
|
|
|
+// }
|
|
|
+// variable_vaue = baseMapper.getVariable173(siteId,table);
|
|
|
+// } else {
|
|
|
+// String table = "rt_analog_data";
|
|
|
+// if (deviceTypeVo.get(0).getDataArea()==2){
|
|
|
+// table = "rt_switch_data";
|
|
|
+// }
|
|
|
+// variable_vaue = baseMapper.getVariable(siteId,table);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<HookupComponentCompleteTowVo> hookupComponentComplete = baseMapper.getHookupComponentComplete(siteId);
|
|
|
+// List<HookupComponentCompleteVo> hookupComponentCompleteVoLsit = new ArrayList<HookupComponentCompleteVo>();
|
|
|
+// if (hookupComponentComplete.size() > 0) {
|
|
|
+// for (int i = 0; i < hookupComponentComplete.size(); i++) {
|
|
|
+// HookupComponentCompleteVo hookupComponentCompleteVo = new HookupComponentCompleteVo();
|
|
|
+// hookupComponentCompleteVo.setId(hookupComponentComplete.get(i).getId());
|
|
|
+// hookupComponentCompleteVo.setTitle(hookupComponentComplete.get(i).getTitle());
|
|
|
+// hookupComponentCompleteVo.setType(hookupComponentComplete.get(i).getInnerType());
|
|
|
+// hookupComponentCompleteVo.setTypeName(hookupComponentComplete.get(i).getTypeName());
|
|
|
+// hookupComponentCompleteVo.setSvgColor(hookupComponentComplete.get(i).getSvgColor());
|
|
|
+// hookupComponentCompleteVo.setCreateType(hookupComponentComplete.get(i).getCreateType());
|
|
|
+// hookupComponentCompleteVo.setSvgPositionX(hookupComponentComplete.get(i).getSvgPositionX());
|
|
|
+// hookupComponentCompleteVo.setSvgPositionY(hookupComponentComplete.get(i).getSvgPositionY());
|
|
|
+// if ("".equals(hookupComponentComplete.get(i).getMPoint())||hookupComponentComplete.get(i).getMPoint()==null){
|
|
|
+// hookupComponentCompleteVo.setMPoint("");
|
|
|
+// }else {
|
|
|
+// hookupComponentCompleteVo.setMPoint(JSONArray.parseObject(hookupComponentComplete.get(i).getMPoint()));
|
|
|
+// }
|
|
|
+// if ("\"\"".equals(hookupComponentComplete.get(i).getEchartsOption())||"".equals(hookupComponentComplete.get(i).getEchartsOption())||
|
|
|
+// hookupComponentComplete.get(i).getEchartsOption()==null){
|
|
|
+// hookupComponentCompleteVo.setEchartsOption("");
|
|
|
+// }else {
|
|
|
+// hookupComponentCompleteVo.setEchartsOption(JSONArray.parseObject(hookupComponentComplete.get(i).getEchartsOption()));
|
|
|
+// }
|
|
|
+//
|
|
|
+// hookupComponentCompleteVo.setSize(hookupComponentComplete.get(i).getSize());
|
|
|
+// hookupComponentCompleteVo.setAngle(hookupComponentComplete.get(i).getAngle());
|
|
|
+// if ("".equals(hookupComponentComplete.get(i).getElementBool())||hookupComponentComplete.get(i).getElementBool()==null) {
|
|
|
+// hookupComponentCompleteVo.setElementBool("");
|
|
|
+// } else {
|
|
|
+// hookupComponentCompleteVo.setElementBool(hookupComponentComplete.get(i).getElementBool().split(","));
|
|
|
+// }
|
|
|
+// hookupComponentCompleteVo.setSvgLineSelectval(hookupComponentComplete.get(i).getSvgLineSelectval());
|
|
|
+// hookupComponentCompleteVo.setDeviceId(hookupComponentComplete.get(i).getDeviceId());
|
|
|
+// hookupComponentCompleteVo.setSiteId(hookupComponentComplete.get(i).getSiteId());
|
|
|
+// hookupComponentCompleteVo.setVariableId(hookupComponentComplete.get(i).getVariableId());
|
|
|
+// if (variable_vaue.size() > 0) {
|
|
|
+// for (int j = 0; j < variable_vaue.size(); j++) {
|
|
|
+// if (hookupComponentComplete.get(i).getVariableCoding().equals(variable_vaue.get(j).getVariableCoding())) {
|
|
|
+// String variableValue = FieldEscapeUtils.getVariableValue(variable_vaue.get(j));
|
|
|
+// hookupComponentCompleteVo.setVariableValue(variableValue);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// hookupComponentCompleteVo.setVariableValue("");
|
|
|
+// }
|
|
|
+// hookupComponentCompleteVoLsit.add(hookupComponentCompleteVo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return hookupComponentCompleteVoLsit;
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|