main
chenglifeng 6 months ago
parent 5536ecb224
commit a1a49c0776
  1. 16
      app/src/main/java/com/project/survey/logic/viewmodel/ProjectViewModel.kt
  2. 4
      app/src/main/java/com/project/survey/network/Api.kt

@ -68,16 +68,13 @@ class ProjectViewModel : BaseViewModel() {
/** /**
* 获取测量工作测量计划(BD_CLJH)与工程计量(BD_CLGZ_GCJL) * 获取测量工作测量计划(BD_CLJH)与工程计量(BD_CLGZ_GCJL)
*/ */
fun fetchMeasureDataList(type: String, page: Int, keyword: String? = null) { fun fetchMeasureDataList(type: String, page: Int, keyword: String) {
launch { launch {
val query = if (keyword.isNullOrBlank()) val query = if (type == Constants.TYPE_BD_CLJH)
null
else {
if (type == Constants.TYPE_BD_CLJH)
"[{\"code\":\"SY_CURRENTTASK\",\"type\":\"=\",\"value\":\"施工单位APP上开展测量工作\"},{\"type\":\"and\",\"value\":[{\"code\":\"CLJH_LCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"CLJH_BDLSH\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DWGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FBGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FXGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DYGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"}]}]" "[{\"code\":\"SY_CURRENTTASK\",\"type\":\"=\",\"value\":\"施工单位APP上开展测量工作\"},{\"type\":\"and\",\"value\":[{\"code\":\"CLJH_LCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"CLJH_BDLSH\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DWGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FBGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FXGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DYGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"}]}]"
else else
"[{\"code\":\"SY_CURRENTTASK\",\"type\":\"=\",\"value\":\"施工单位APP上开展测量工作\"},{\"type\":\"and\",\"value\":[{\"code\":\"GCJL_LCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"GCJL_BDLSH\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DWGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FBGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FXGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DYGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"}]}]" "[{\"code\":\"SY_CURRENTTASK\",\"type\":\"=\",\"value\":\"施工单位APP上开展测量工作\"},{\"type\":\"and\",\"value\":[{\"code\":\"GCJL_LCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"GCJL_BDLSH\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DWGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FBGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_FXGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"BD_FBFXPZ_DYGCMC\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"}]}]"
}
val res = api.fetchMeasureDataList( val res = api.fetchMeasureDataList(
tableCode = type, tableCode = type,
@ -191,12 +188,9 @@ class ProjectViewModel : BaseViewModel() {
/** /**
* 获取放样任务列表 * 获取放样任务列表
*/ */
fun fetchLoftingList(keyword: String? = null) { fun fetchLoftingList(keyword: String) {
launch { launch {
val query = if (keyword.isNullOrBlank()) val query = "[{\"code\":\"ZYLB_ZYLBZT_NAME\",\"type\":\"=\",\"value\":\"执行中\"},{\"type\":\"and\",\"value\":[{\"code\":\"ZYLB_ZY_NAME\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"ZYLB_CLY\",\"type\":\"like\",\"value\":\"${keyword}\"}]}]"
""
else
"[{\"code\":\"ZYLB_ZYLBZT_NAME\",\"type\":\"=\",\"value\":\"执行中\"},{\"type\":\"and\",\"value\":[{\"code\":\"ZYLB_ZY_NAME\",\"type\":\"like\",\"value\":\"${keyword}\",\"cn\":\"or\"},{\"code\":\"ZYLB_CLY\",\"type\":\"like\",\"value\":\"${keyword}\"}]}]"
val res = api.fetchLoftingList(j_qurey = query) val res = api.fetchLoftingList(j_qurey = query)
if (res.success) { if (res.success) {
_loftingBeanListResponse.postValue(res.data) _loftingBeanListResponse.postValue(res.data)

@ -182,7 +182,7 @@ interface Api {
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID), @Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Field("tableCode") tableCode: String, @Field("tableCode") tableCode: String,
@Field("funcCode") funcCode: String, @Field("funcCode") funcCode: String,
@Field("j_query") j_query: String?, @Field("j_query") j_query: String,
@Field("page") page: Int, @Field("page") page: Int,
@Field("limit") limit: Int = 1000, @Field("limit") limit: Int = 1000,
@Field("start") start: Int = 0 @Field("start") start: Int = 0
@ -229,7 +229,7 @@ interface Api {
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID), @Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Field("tableCode") tableCode: String = "BD_ZYLB", @Field("tableCode") tableCode: String = "BD_ZYLB",
@Field("funcCode") funcCode: String = "BD_ZYLB", @Field("funcCode") funcCode: String = "BD_ZYLB",
@Field("j_qurey") j_qurey: String = "" @Field("j_qurey") j_qurey: String
): HttpResult<ListResult<LoftingBean>> ): HttpResult<ListResult<LoftingBean>>
/** /**

Loading…
Cancel
Save