Commit 3e76a32b by levphon

工单标准接口-有效位置点验证

1 parent 490f0aad
......@@ -627,30 +627,27 @@ public class WorkOrderService {
devices.add(item);
});
//运营激活,不需要验证位置点
if (isApiCall) {
DeviceLocationRequest deviceLocationRequest = new DeviceLocationRequest();
deviceLocationRequest.setVerifyTimeFlag(true);
deviceLocationRequest.setBsBackfillGps(true);
deviceLocationRequest.setDevices(devices);
R<List<GpsBsData>> listR = gpsBsFeignService.locationCheck(deviceLocationRequest);
log.info("工单{}位置点验证结果:{}", verifyBO.getBizWorkOrderNo(), JSONUtil.toJsonStr(listR));
if (!listR.isSuccess()) {
throw new StdInterfaceException(String.valueOf(listR.getCode()), listR.getMessage());
} else {
List<GpsBsData> gpsBsDataList = listR.getDataList(new TypeToken<List<GpsBsData>>() {
}.getType());
gpsBsDataList.forEach(gdb -> {
if (!gdb.getGpsVerifyResult() && !gdb.getBsVerifyResult()) {
Map<String, String> errorMap = Maps.newHashMap();
errorMap.put(gdb.getSn(), "设备有效位置验证不通过");
throw new StdInterfaceException("2145415", String.format("设备%s有效位置验证不通过", gdb.getSn()), Lists.newArrayList(errorMap));
}
});
return gpsBsDataList;
}
//验证位置点
DeviceLocationRequest deviceLocationRequest = new DeviceLocationRequest();
deviceLocationRequest.setVerifyTimeFlag(true);
deviceLocationRequest.setBsBackfillGps(true);
deviceLocationRequest.setDevices(devices);
R<List<GpsBsData>> listR = gpsBsFeignService.locationCheck(deviceLocationRequest);
log.info("工单{}位置点验证结果:{}", verifyBO.getBizWorkOrderNo(), JSONUtil.toJsonStr(listR));
if (!listR.isSuccess()) {
throw new StdInterfaceException(String.valueOf(listR.getCode()), listR.getMessage());
} else {
List<GpsBsData> gpsBsDataList = listR.getDataList(new TypeToken<List<GpsBsData>>() {
}.getType());
gpsBsDataList.forEach(gdb -> {
if (!gdb.getGpsVerifyResult() && !gdb.getBsVerifyResult()) {
Map<String, String> errorMap = Maps.newHashMap();
errorMap.put(gdb.getSn(), "设备有效位置验证不通过");
throw new StdInterfaceException("2145415", String.format("设备%s有效位置验证不通过", gdb.getSn()), Lists.newArrayList(errorMap));
}
});
return gpsBsDataList;
}
return Lists.newArrayList();
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!