app/src/main/java/cn/flightfeather/thirdappmodule/httpservice/DomainItemService.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ package cn.flightfeather.thirdappmodule.httpservice import cn.flightfeather.thirdappmodule.bean.entity.Domainitem import io.reactivex.Observable import retrofit2.Response import retrofit2.http.GET import retrofit2.http.Query /** * @author riku * Date: 2021/8/13 */ interface DomainItemService { @GET("domainitem/location") fun getLocation(@Query("sceneType") sceneType: Int): Observable<Response<ArrayList<Domainitem>>> } app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuEvidenceActivity.kt
@@ -57,9 +57,9 @@ initUI() initObserver() viewModel.getLocationList() subTask?.let { t -> scene?.let { s -> viewModel.getLocationList(s.typeid.toInt()) viewModel.getProblemType(t.typeno, t.citycode, t.districtcode, s.typeid) } } app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuEvidenceViewModel.kt
@@ -43,8 +43,8 @@ /** * è·ååºæ¯é®é¢å¯éä½ç½®ï¼ç®ååªæå·¥å°ï¼ä½ææåºæ¯é½ä½¿ç¨ï¼ */ fun getLocationList() { problemRepository.getLocationList(object : ResultCallBack<ArrayList<Domainitem>> { fun getLocationList(sceneType: Int) { problemRepository.getLocationList(sceneType, object : ResultCallBack<ArrayList<Domainitem>> { override fun onSuccess(result: ArrayList<Domainitem>?) { result?.let { locationList.value = it app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuProblemUpdateActivity.kt
@@ -97,7 +97,7 @@ } } //æ´æ¹å»ºè®®å¤æ³¨ if (getSuggestion) { if (getSuggestion && advice.length > 2) { var suggestionRemark = advice.removeRange(0, 1)//å é¤ç¬¬ä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â suggestionRemark = suggestionRemark.dropLast(1)//å 餿åä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â et_take_evidence_suggestion.setText(suggestionRemark) app/src/main/java/cn/flightfeather/thirdappmodule/repository/ProblemRepository.kt
@@ -6,6 +6,7 @@ import cn.flightfeather.thirdappmodule.bean.vo.ProblemDetailVo import cn.flightfeather.thirdappmodule.bean.vo.ProblemlistVo import cn.flightfeather.thirdappmodule.common.net.* import cn.flightfeather.thirdappmodule.httpservice.DomainItemService import cn.flightfeather.thirdappmodule.httpservice.InspectionService import cn.flightfeather.thirdappmodule.httpservice.MediaFileService import cn.flightfeather.thirdappmodule.httpservice.ProblemListService @@ -39,12 +40,11 @@ /** * è·ååºæ¯é®é¢å¯éä½ç½® */ fun getLocationList(resultCallBack: ResultCallBack<ArrayList<Domainitem>>) { val dbService = domainDao.getLocationList().map { Response.success(ArrayList<Domainitem>().apply { addAll(it) }) } fun getLocationList(sceneType: Int, resultCallBack: ResultCallBack<ArrayList<Domainitem>>) { RetrofitFactory.executeResult(dbService, object : ResultObserver<ArrayList<Domainitem>>() { val service = retrofit.create(DomainItemService::class.java).getLocation(sceneType) RetrofitFactory.executeResult(service, object : ResultObserver<ArrayList<Domainitem>>() { override fun onSuccess(result: ArrayList<Domainitem>?) { resultCallBack.onSuccess(result) } @@ -52,8 +52,22 @@ override fun onFailure(e: Throwable, isNetWorkError: Boolean) { resultCallBack.onFailure() } }) // val dbService = domainDao.getLocationList().map { // Response.success(ArrayList<Domainitem>().apply { addAll(it) }) // } // // RetrofitFactory.executeResult(dbService, object : ResultObserver<ArrayList<Domainitem>>() { // override fun onSuccess(result: ArrayList<Domainitem>?) { // resultCallBack.onSuccess(result) // } // // override fun onFailure(e: Throwable, isNetWorkError: Boolean) { // resultCallBack.onFailure() // } // // }) } /** @@ -78,6 +92,7 @@ * è·å对åºåºæ¯ä¸ææé®é¢ç±»å */ fun getProblemType(taskTypeId: Byte, cityCode: String, districtCode: String, sceneTypeId: Byte, resultCallBack: ResultCallBack<ArrayList<Problemtype>>) { val dbService = domainDao.getProblemType(taskTypeId, cityCode, districtCode, sceneTypeId).map { Response.success(ArrayList<Problemtype>().apply { addAll(it) }) } appsupervision/build.gradle
@@ -11,8 +11,8 @@ applicationId "cn.flightfeather.thirdapp" minSdkVersion 19 targetSdkVersion 28 versionCode 30 versionName "1.1.14.14" versionCode 31 versionName "1.1.14.15" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" renderscriptTargetApi 25