Browse Source

上报模型文件字段匹配规范

master
lijiuwei 4 months ago
parent
commit
fcfb870e7f
2 changed files with 37 additions and 7 deletions
  1. +8
    -0
      inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/domain/vo/DevicePointModelItem.java
  2. +29
    -7
      inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/service/impl/BasedataPatrolPointServiceImpl.java

+ 8
- 0
inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/domain/vo/DevicePointModelItem.java View File

@ -112,5 +112,13 @@ public class DevicePointModelItem implements Serializable {
name = "video_pos" name = "video_pos"
) )
private String video_pos; private String video_pos;
@XmlAttribute(
name = "point_type"
)
private String point_type;
@XmlAttribute(
name = "label_attri"
)
private String label_attri;
} }

+ 29
- 7
inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/service/impl/BasedataPatrolPointServiceImpl.java View File

@ -253,25 +253,47 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi
BasedataPatrolPointPreset basedataPatrolpointPreset = new BasedataPatrolPointPreset(); BasedataPatrolPointPreset basedataPatrolpointPreset = new BasedataPatrolPointPreset();
basedataPatrolpointPreset.setPatrolPointId(patrolPoint.getPatrolPointId()); basedataPatrolpointPreset.setPatrolPointId(patrolPoint.getPatrolPointId());
JSONArray presetJsonArray = this.modelPatrolPointPresetHandle(basedataPatrolpointPreset); JSONArray presetJsonArray = this.modelPatrolPointPresetHandle(basedataPatrolpointPreset);
String video_pos = null;
if (!presetJsonArray.isEmpty()) { if (!presetJsonArray.isEmpty()) {
String presetJson = presetJsonArray.toJSONString();
modelItem.setVideo_pos(presetJson);
String presetData = presetJsonArray.getJSONObject(0).getString("device_code");
if(presetData == null || presetData.indexOf("#") == -1) {
video_pos = "";
} else {
video_pos = presetData.substring(0, presetData.indexOf("#"));
}
} else {
video_pos = "";
} }
modelItem.setStation_id(station_id);
modelItem.setStation_name(station_name); modelItem.setStation_name(station_name);
modelItem.setStation_code(station_id);
modelItem.setArea_id(areaId.toString());
modelItem.setArea_name(area_name);
modelItem.setBay_id("");
modelItem.setBay_name("");
modelItem.setMain_device_id(main_device_id); modelItem.setMain_device_id(main_device_id);
modelItem.setMain_device_name(main_device_name); modelItem.setMain_device_name(main_device_name);
modelItem.setComponent_id(component_id); modelItem.setComponent_id(component_id);
modelItem.setComponent_name(component_name); modelItem.setComponent_name(component_name);
modelItem.setDevice_id(device_id); modelItem.setDevice_id(device_id);
modelItem.setDevice_name(device_name); modelItem.setDevice_name(device_name);
modelItem.setDevice_info(device_info);
modelItem.setPhase(phase);
modelItem.setDevice_type(device_type); modelItem.setDevice_type(device_type);
modelItem.setArea_id(area_id);
modelItem.setArea_name(area_name);
modelItem.setMeter_type("");
modelItem.setAppearance_type("");
modelItem.setSave_type_list("");
modelItem.setRecognition_type_list(algSubtypeIds); modelItem.setRecognition_type_list(algSubtypeIds);
modelItem.setPhase(phase);
modelItem.setDevice_info(device_info);
modelItem.setData_type("");
modelItem.setLower_value("");
modelItem.setUpper_value("");
modelItem.setVideo_pos(video_pos);
modelItem.setPoint_type("");
modelItem.setLabel_attri("");
if(device_type == null || device_type.equals("10000")){
continue;
}
items.add(modelItem); items.add(modelItem);
} }


Loading…
Cancel
Save