|
|
|
@ -9,7 +9,9 @@ import com.inspect.metadata.alg.mapper.BasedataAlgSubtypeMapper; |
|
|
|
import com.inspect.metadata.area.domain.BaseDataArea; |
|
|
|
import com.inspect.metadata.area.mapper.BaseDataAreaMapper; |
|
|
|
import com.inspect.metadata.eqpbook.domain.BasedataEqpBook; |
|
|
|
import com.inspect.metadata.eqpbook.domain.BasedataEqpBookChannel; |
|
|
|
import com.inspect.metadata.eqpbook.domain.vo.PatrolTaskFtp; |
|
|
|
import com.inspect.metadata.eqpbook.mapper.BasedataEqpBookChannelMapper; |
|
|
|
import com.inspect.metadata.eqpbook.mapper.BasedataEqpBookMapper; |
|
|
|
import com.inspect.metadata.patrolpointmnt.domain.BasedataPatrolPoint; |
|
|
|
import com.inspect.metadata.patrolpointmnt.domain.BasedataPatrolPointPreset; |
|
|
|
@ -67,6 +69,8 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
|
@Resource |
|
|
|
BasedataEqpBookMapper basedataEqpbookMapper; |
|
|
|
@Resource |
|
|
|
BasedataEqpBookChannelMapper basedataEqpBookChannelMapper; |
|
|
|
@Resource |
|
|
|
BaseDataAreaMapper baseDataAreaMapper; |
|
|
|
@Resource |
|
|
|
SyncDataToUpstreamService syncDataToUpstreamService; |
|
|
|
@ -255,13 +259,13 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
|
JSONArray presetJsonArray = this.modelPatrolPointPresetHandle(basedataPatrolpointPreset); |
|
|
|
String video_pos = ""; |
|
|
|
if (!presetJsonArray.isEmpty()) { |
|
|
|
for (int j = 0; j < presetJsonArray.size(); ++j) { |
|
|
|
JSONObject presetJsonObject = presetJsonArray.getJSONObject(j); |
|
|
|
String deviceCode = presetJsonObject.getString("device_code"); |
|
|
|
if (null != deviceCode && deviceCode.indexOf("#") != -1) { |
|
|
|
presetJsonObject.put("device_code", deviceCode.substring(0, deviceCode.indexOf("#"))); |
|
|
|
} |
|
|
|
} |
|
|
|
// for (int j = 0; j < presetJsonArray.size(); ++j) { |
|
|
|
// JSONObject presetJsonObject = presetJsonArray.getJSONObject(j); |
|
|
|
// String deviceCode = presetJsonObject.getString("device_code"); |
|
|
|
// if (null != deviceCode && deviceCode.indexOf("#") != -1) { |
|
|
|
// presetJsonObject.put("device_code", deviceCode.substring(0, deviceCode.indexOf("#"))); |
|
|
|
// } |
|
|
|
// } |
|
|
|
video_pos = presetJsonArray.toJSONString(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -365,7 +369,7 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONArray modelPatrolPointPresetHandle(BasedataPatrolPointPreset basedataPatrolpointPreset) { |
|
|
|
private JSONArray modelPatrolPointPresetHandleOld(BasedataPatrolPointPreset basedataPatrolpointPreset) { |
|
|
|
JSONArray jsonArray = new JSONArray(); |
|
|
|
List<BasedataPatrolPointPreset> presets = this.basedataPatrolpointPresetMapper.selectBasedataPatrolPointPresetList(basedataPatrolpointPreset); |
|
|
|
if (null != presets && !presets.isEmpty()) { |
|
|
|
@ -431,6 +435,79 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JSONArray modelPatrolPointPresetHandle(BasedataPatrolPointPreset basedataPatrolpointPreset) { |
|
|
|
JSONArray jsonArray = new JSONArray(); |
|
|
|
List<BasedataPatrolPointPreset> presets = this.basedataPatrolpointPresetMapper.selectBasedataPatrolPointPresetList(basedataPatrolpointPreset); |
|
|
|
if (null != presets && !presets.isEmpty()) { |
|
|
|
Iterator<BasedataPatrolPointPreset> iterator = presets.iterator(); |
|
|
|
while (true) { |
|
|
|
BasedataPatrolPointPreset preset; |
|
|
|
BasedataEqpBook eqpbook; |
|
|
|
BasedataEqpBookChannel eqpbookChannel = null; |
|
|
|
String type; |
|
|
|
JSONObject jsonObject; |
|
|
|
String presetCode; |
|
|
|
do { |
|
|
|
do { |
|
|
|
if (!iterator.hasNext()) { |
|
|
|
return jsonArray; |
|
|
|
} |
|
|
|
|
|
|
|
preset = iterator.next(); |
|
|
|
Long eqpBookId = preset.getEqpBookId(); |
|
|
|
Long channelId = preset.getChannelId(); |
|
|
|
if (channelId == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
eqpbookChannel = this.basedataEqpBookChannelMapper.selectBasedataEqpBookChannelByChannelId(channelId); |
|
|
|
} while (null == eqpbookChannel); |
|
|
|
eqpbook = this.basedataEqpbookMapper.selectBasedataEqpBookByEqpBookId(eqpbookChannel.getEqpBookId()); |
|
|
|
|
|
|
|
type = eqpbook.getType(); |
|
|
|
if ("10".equals(type)) { |
|
|
|
jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("device_code", eqpbookChannel.getUpSystemDeviceCode()); |
|
|
|
presetCode = preset.getPresetCode(); |
|
|
|
if (null != presetCode && !presetCode.isEmpty()) { |
|
|
|
jsonObject.put("device_pos", presetCode); |
|
|
|
} else { |
|
|
|
jsonObject.put("device_pos", "1"); |
|
|
|
} |
|
|
|
|
|
|
|
jsonArray.add(jsonObject); |
|
|
|
} |
|
|
|
|
|
|
|
if ("1".equals(type) || "2".equals(type) || "3".equals(type)) { |
|
|
|
jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("robot_code", eqpbookChannel.getUpSystemDeviceCode()); |
|
|
|
presetCode = preset.getPresetCode(); |
|
|
|
if (null != presetCode && !presetCode.isEmpty()) { |
|
|
|
jsonObject.put("robot_pos", presetCode); |
|
|
|
} else { |
|
|
|
jsonObject.put("robot_pos", "1"); |
|
|
|
} |
|
|
|
|
|
|
|
jsonArray.add(jsonObject); |
|
|
|
} |
|
|
|
} while (!"13".equals(type)); |
|
|
|
|
|
|
|
jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("uav_code", eqpbookChannel.getUpSystemDeviceCode()); |
|
|
|
presetCode = preset.getPresetCode(); |
|
|
|
if (null != presetCode && !presetCode.isEmpty()) { |
|
|
|
jsonObject.put("uav_pos", presetCode); |
|
|
|
} else { |
|
|
|
jsonObject.put("uav_pos", "1"); |
|
|
|
} |
|
|
|
|
|
|
|
jsonArray.add(jsonObject); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return jsonArray; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private String handlePhase(String localPhase) { |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
if (null != localPhase && !"O".equals(localPhase) && !localPhase.isEmpty()) { |
|
|
|
|