| | |
| | | * @param fragment |
| | | * @return |
| | | */ |
| | | public static String getInspectionId(MapFragment fragment) { |
| | | public static void getInspectionId(MapFragment fragment) { |
| | | DaoSingleton.getAsynchInstance(fragment.getContext()).inspectionDao().getMostRecentInspectionWithNoStopTime() |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.io()).subscribe(inspectionBean -> { |
| | | |
| | | }); |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 继续显示异常关闭之前的巡检坐标 |
| | | * |
| | | * @param fragment |
| | | */ |
| | | public static void aginShowLocation(MapFragment fragment) { |
| | | //查询当前未关闭的巡检记录 |
| | | DaoSingleton.getAsynchInstance(fragment.getContext()).inspectionDao().getMostRecentInspectionWithNoStopTime() |
| | |
| | | .subscribe(strings -> { |
| | | //循环查询所有id |
| | | for (String data : strings) { |
| | | DaoSingleton.getAsynchInstance(context).inspectionDao().findBymInspectId(data) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.io()) |
| | | .subscribe(inspectionBeans -> { |
| | | DaoSingleton.getAsynchInstance(context).inspectionLocationDao().findByNoPostAndInspectId(data) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.io()) |
| | | .subscribe(inspectionLocationBeans -> { |
| | | if (inspectionLocationBeans != null && inspectionLocationBeans.size() > 0) { |
| | | postInspectionData(context, inspectionBeans, inspectionLocationBeans); |
| | | } |
| | | }); |
| | | }); |
| | | if (!TextUtils.isEmpty(data)) { |
| | | DaoSingleton.getAsynchInstance(context).inspectionDao().findBymInspectId(data) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.io()) |
| | | .subscribe(inspectionBeans -> { |
| | | DaoSingleton.getAsynchInstance(context).inspectionLocationDao().findByNoPostAndInspectId(data) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.io()) |
| | | .subscribe(inspectionLocationBeans -> { |
| | | if (inspectionLocationBeans != null && inspectionLocationBeans.size() > 0) { |
| | | postInspectionData(context, inspectionBeans, inspectionLocationBeans); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | }); |