生成报验单、放样任务、获取放样点等接口

main
chenglifeng 6 months ago
parent 6d7b185b20
commit 0d37c3ce2c
  1. BIN
      app/libs/socket-client.jar
  2. BIN
      app/libs/socket-common-interface.jar
  3. BIN
      app/libs/socket-core.jar
  4. 4
      app/src/main/AndroidManifest.xml
  5. 3
      app/src/main/java/com/project/survey/constants/Constants.kt
  6. 145
      app/src/main/java/com/project/survey/logic/viewmodel/ProjectViewModel.kt
  7. 14
      app/src/main/java/com/project/survey/model/InspectionReportBean.kt
  8. 29
      app/src/main/java/com/project/survey/model/LoftingBean.kt
  9. 7
      app/src/main/java/com/project/survey/model/LoftingListBean.kt
  10. 46
      app/src/main/java/com/project/survey/model/LoftingPointBean.kt
  11. 42
      app/src/main/java/com/project/survey/model/LoftingPointRecordEntry.kt
  12. 48
      app/src/main/java/com/project/survey/model/MeasureBean.kt
  13. 88
      app/src/main/java/com/project/survey/network/Api.kt
  14. 2
      app/src/main/java/com/project/survey/ui/base/BaseBindingActivity.kt
  15. 5
      app/src/main/java/com/project/survey/ui/home/HomeFragment.kt
  16. 79
      app/src/main/java/com/project/survey/ui/instrument/setupstation/StakingNewJobActivity.java
  17. 33
      app/src/main/java/com/project/survey/ui/lofting/LoftingListActivity.kt
  18. 19
      app/src/main/java/com/project/survey/ui/lofting/adapter/LoftingListAdapter.kt
  19. 253
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/PointStakingActivity.java
  20. 2
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/PointStakingActivity1.java
  21. 83
      app/src/main/java/com/project/survey/ui/pointmeasure/PointMeasureListActivity.kt
  22. 10
      app/src/main/java/com/project/survey/ui/pointmeasure/adapter/PointMeasureListAdapter.kt
  23. 1
      app/src/main/res/layout/activity_point_staking.xml

Binary file not shown.

Binary file not shown.

@ -225,6 +225,10 @@
android:name=".ui.lofting.pointlofting.record.RecordsActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".ui.lofting.pointlofting.record.RecordDetailActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".ui.pointmeasure.measure.CodeLibraryActivity"
android:exported="false">

@ -2,6 +2,9 @@ package com.project.survey.constants
object Constants {
const val PAGE_SIZE = 30
const val TYPE_BD_CLJH = "BD_CLJH"//测量计划
const val TYPE_BD_CLGZ_GCJL = "BD_CLGZ_GCJL"//工程计量
}

@ -2,9 +2,15 @@ package com.project.survey.logic.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.project.survey.constants.Constants
import com.project.survey.constants.SPConstants
import com.project.survey.logic.bean.ListResult
import com.project.survey.model.ApprovalBean
import com.project.survey.model.InspectionReportBean
import com.project.survey.model.LoftingBean
import com.project.survey.model.LoftingPointBean
import com.project.survey.model.LoftingPointListBean
import com.project.survey.model.LoftingPointRecordEntry
import com.project.survey.model.MeasureBean
import com.project.survey.model.PointEntry
import com.project.survey.model.ProjectBean
@ -56,23 +62,25 @@ class ProjectViewModel : BaseViewModel() {
private val _measureBeanListResponse = MutableLiveData<ListResult<MeasureBean>>()
/**
* 获取测量工作测量计划与工程计量
* 获取测量工作测量计划(BD_CLJH)与工程计量(BD_CLGZ_GCJL)
*/
private fun fetchMeasureDataList(
tableCode: String,
funcCode: String,
j_query: String,
page: Int = 1,
start: Int
) {
fun fetchMeasureDataList(type: String, page: Int, keyword: String? = null) {
launch {
val query = if (keyword.isNullOrBlank())
""
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\"}]}]"
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\"}]}]"
}
val res = api.fetchMeasureDataList(
SPUtils.getString(SPConstants.PROJECT_ID),
tableCode,
funcCode,
j_query,
page,
start = start
type,
if (type == Constants.TYPE_BD_CLJH) Constants.TYPE_BD_CLJH else "${Constants.TYPE_BD_CLGZ_GCJL}_ZB",
query,
page
)
if (res.success) {
_measureBeanListResponse.postValue(res.data)
@ -82,20 +90,6 @@ class ProjectViewModel : BaseViewModel() {
}
}
/**
* 获取 测量计划 列表
*/
fun fetchCLJH(page: Int = 1, start: Int = 0) {
fetchMeasureDataList("BD_CLJH", "BD_CLJH", "", page, start)
}
/**
* 获取 工程计量 列表
*/
fun fetchGCJL(page: Int = 1, start: Int = 0) {
fetchMeasureDataList("BD_CLGZ_GCJL", "BD_CLGZ_GCJL", "", page, start)
}
val updateMeasureWorkStatusResponse: LiveData<String>
get() = _updateMeasureWorkStatusResponse
private val _updateMeasureWorkStatusResponse = MutableLiveData<String>()
@ -119,20 +113,6 @@ class ProjectViewModel : BaseViewModel() {
}
}
/**
* 修改 测量计划 工作状态
*/
fun updateCLJHStatus(workId: String, status: String) {
updateMeasureWorkStatus(workId, "BD_CLJH", status)
}
/**
* 修改 工程计量 工作状态
*/
fun updateGCJLStatus(workId: String, status: String) {
updateMeasureWorkStatus(workId, "BD_CLGZ_GCJL", status)
}
val uploadPointEntryResponse: LiveData<String>
get() = _uploadPointEntryResponse
private val _uploadPointEntryResponse = MutableLiveData<String>()
@ -143,7 +123,10 @@ class ProjectViewModel : BaseViewModel() {
fun uploadPointEntry(pointEntry: PointEntry) {
launch {
val res =
api.uploadPointEntry(SPUtils.getString(SPConstants.PROJECT_ID), arrayListOf(pointEntry))
api.uploadPointEntry(
SPUtils.getString(SPConstants.PROJECT_ID),
arrayListOf(pointEntry)
)
if (res.success) {
_uploadPointEntryResponse.postValue(res.data)
} else {
@ -151,6 +134,7 @@ class ProjectViewModel : BaseViewModel() {
}
}
}
fun uploadPointEntry(pointEntryList: List<PointEntry>) {
launch {
val res =
@ -162,4 +146,81 @@ class ProjectViewModel : BaseViewModel() {
}
}
}
val createInspectionReportResponse: LiveData<InspectionReportBean>
get() = _createInspectionReportResponse
private val _createInspectionReportResponse = MutableLiveData<InspectionReportBean>()
/**
* 生成报验单
*/
fun createInspectionReport(workId: String) {
launch {
val res = api.createInspectionReport(SPUtils.getString(SPConstants.PROJECT_ID), workId)
if (res.success) {
_createInspectionReportResponse.postValue(res.data)
} else {
errorResponse.postValue(res.message)
}
}
}
val loftingBeanListResponse: LiveData<ListResult<LoftingBean>>
get() = _loftingBeanListResponse
private val _loftingBeanListResponse = MutableLiveData<ListResult<LoftingBean>>()
/**
* 获取放样任务列表
*/
fun fetchLoftingList(keyword: String? = null) {
launch {
val query = if (keyword.isNullOrBlank())
""
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)
if (res.success) {
_loftingBeanListResponse.postValue(res.data)
} else {
errorResponse.postValue(res.message)
}
}
}
val loftingPointListResponse: LiveData<List<LoftingPointBean>>
get() = _loftingPointListResponse
private val _loftingPointListResponse = MutableLiveData<List<LoftingPointBean>>()
/**
* 获取放样点
*/
fun fetchLoftingPointList(workId: String) {
launch {
val res = api.fetchLoftingPointList(workId = workId)
if (res.success) {
_loftingPointListResponse.postValue(res.data.map { it.values })
} else {
errorResponse.postValue(res.message)
}
}
}
val uploadLoftingPointRecordResponse: LiveData<String>
get() = _uploadLoftingPointRecordResponse
private val _uploadLoftingPointRecordResponse = MutableLiveData<String>()
/**
* 上传放样测点记录
*/
fun uploadLoftingPointRecord(record: LoftingPointRecordEntry) {
launch {
val res = api.uploadLoftingPointRecord(requestBody = arrayListOf(record))
if (res.success) {
_uploadLoftingPointRecordResponse.postValue(res.data)
} else {
errorResponse.postValue(res.message)
}
}
}
}

@ -0,0 +1,14 @@
package com.project.survey.model
/**
* {
* "__PK_VALUE": "331753351bc74ab483d928b839c8a783",
* "BD_CLJH_ID": "331753351bc74ab483d928b839c8a783",
* "CLJH_WORKSTATUS": "报验单已生成"
* }
*/
data class InspectionReportBean(
val __PK_VALUE: String,
val BD_CLJH_ID: String,
val CLJH_WORKSTATUS: String
)

@ -0,0 +1,29 @@
package com.project.survey.model
/**
* {
* "ZYLB_ZYLBZT_NAME": "执行中",
* "BD_ZYLB_ID": "9af7f594dfff4ab2b66a330873a17a19",
* "SY_CREATEUSERID": "HeRyydYjKz819ZLq9dw",
* "SY_GROUP_COMPANY_ID": "ROOT",
* "ZYLB_ZY_NAME": "放样2",
* "SY_COMPANY_ID": "V1R0gp2zJ3SvGFNvJdM",
* "ZYLB_FYSPJD": "2",
* "ZYLB_FYGCJD": "2",
* "SY_CREATEUSERNAME": "齐恒(施工1-1)",
* "SY_CREATETIME": "2024-11-01 10:45:08",
* "SY_ORG_ID": "systemdepartment",
* "ZYLB_CLY": "齐恒(施工单位1-2)",
* "ZYLB_ZYLBZT_CODE": "01",
* "ZYLB_ZYMS": "2",
* "BD_XMXX_ID": "xYgALS4VOJ0vDrEVUcQ",
* "ZYLB_CLY_ID": "2eab34c5248a4efe80ef12c370f2d5fa"
* }
*/
data class LoftingBean(
val ZYLB_ZY_NAME: String, //作业名称
val SY_CREATETIME: String, //创建时间
val BD_ZYLB_ID: String, //作业ID
val ZYLB_CLY: String, //测量员姓名
val ZYLB_ZYMS: String,
)

@ -1,7 +0,0 @@
package com.project.survey.model
import androidx.annotation.Keep
@Keep
class LoftingListBean {
}

@ -0,0 +1,46 @@
package com.project.survey.model
import androidx.annotation.Keep
@Keep
data class LoftingPointListBean(
val values: LoftingPointBean
)
/**
* {
* "ZBSJ_FYZB_X": 111,
* "ZBSJ_FYZB_Y": 111,
* "ZBSJ_FYZB_Z": 111,
* "SY_COMPANY_ID": "V1R0gp2zJ3SvGFNvJdM",
* "SY_CREATEUSERNAME": "齐恒(施工1-1)",
* "ZBSJ_D_NAME": "p1",
* "SY_ORDERINDEX": null,
* "BD_ZYLBMX_ID": "98c1f946603c421a834c9f5f2df5e51b",
* "SY_GROUP_COMPANY_NAME": "",
* "SY_COMPANY_NAME": "某某公司",
* "BD_XMXX_ID": "xYgALS4VOJ0vDrEVUcQ",
* "SY_CREATEORGID": "oOBheA6LJhZBgr3GKrP",
* "BD_ZYLB_ID": "9af7f594dfff4ab2b66a330873a17a19",
* "SY_STATUS": "1",
* "SY_CREATEUSERID": "HeRyydYjKz819ZLq9dw",
* "SY_GROUP_COMPANY_ID": "ROOT",
* "BD_ZYFF_ID": "f7f191e1ccb447b8821ed34029b0044e",
* "ZBSJ_FBFXMC": "第一排(重点)",
* "ZBSJ_FBFXID": "LcFrqZZe4qdmbIJKLlN",
* "ZBSJ_D_TYPE": "01",
* "ZBSJ_D_TYPE_NAME": "平面与高程",
* "BD_ZBSJ_ID": "7fd03e2e1e084d7980946b801184cc1e",
* "SY_CREATEORGNAME": "北斗",
* "SY_CREATETIME": "2024-11-01 10:45:08",
* "SY_ORG_ID": "systemdepartment"
* }
*/
@Keep
data class LoftingPointBean(
val ZBSJ_D_NAME: String, //点名称
val BD_ZYLBMX_ID: String, //放样点ID
val ZBSJ_FYZB_X: String,
val ZBSJ_FYZB_Y: String,
val ZBSJ_FYZB_Z: String
)

@ -0,0 +1,42 @@
package com.project.survey.model
import com.bingce.data.surveyor.surveydata.pointstake.PointStakeRecord
import com.bingce.device.Device
import com.bingce.device.enums.DeviceTypeEnum
data class LoftingPointRecordEntry(
val settingOutPointId: String, //放样点ID,对应 LoftingPointBean 里的 BD_ZYLBMX_ID
val antennaHight: String, //天线高 "11"
val remark: String, //备注 "点1"
val x: String, //"111"
val y: String, //"11"
val z: String, //"11"
val longitude: String, //经度
val latitude: String, //纬度
val hrms: String,
val vrms: String,
val pdop: String,
val delay: String, //延迟 "xx"
val jzt: String, //解状态 "xx"
val satellite: String, //结算卫星 "xx"
) {
/**
* 将放样记录对象 转为 上传需要的对象
*/
constructor(record: PointStakeRecord) : this(
record.jobId,
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.poleHeight}" else "${record.deviceInfoData.tsStatusData?.hr}",
record.remarks ?: "",
"${record.measuredX}",
"${record.measuredY}",
"${record.measuredZ}",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.longitude}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.latitude}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.hrms}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.vrms}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.pdop}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.diffAge}" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) record.deviceInfoData.rtkStatusData?.solutionState ?: "" else "",
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_RTK) "${record.deviceInfoData.rtkStatusData?.satSolutionNum}" else ""
)
}

@ -1,7 +1,48 @@
package com.project.survey.model
/**
* CLJH_ 测量计划
* GCJL_ 工程计量
*
*
* 工程计量返回
* {
* "BD_CONTRACT_ID": "",
* "GCJL_JLNR": "",
* "GCJL_SFWZDBW_CODE": "0",
* "BD_FBFXPZ_DWGCMC": "1号楼",
* "SY_COMPANY_ID": "V1R0gp2zJ3SvGFNvJdM",
* "GCJL_LCMC": "123",
* "BD_FBFXPZ_FXGCMC": "就餐区",
* "SY_CREATEUSERNAME": "admin123",
* "GCJL_SBDW_ID": "",
* "GCJL_SFWLHCL_CODE": "1",
* "CONTRACT_CODE": "",
* "SY_PREAPPROVUSERNAMES": "",
* "SY_CURRENTTASK": "",
* "BD_XMXX_ID": "xYgALS4VOJ0vDrEVUcQ",
* "GCJL_FL": "",
* "SY_CREATEUSERID": "b641884e6add456b83264163a8486337",
* "SY_GROUP_COMPANY_ID": "ROOT",
* "BD_FBFXPZ_DYGCBH": "DWGCBH2024101601",
* "GCJL_BDLSH": "CLJH2024103018",
* "SY_AUDFLAG": "NOSTATUS",
* "BF_FBFXPZ_FBGCBH": "FXGCJCQ2024101601",
* "GCJL_SBDW": "",
* "CONTRACT_NAME": "",
* "GCJL_ZT_CODE": "01",
* "GCJL_ZT_NAME": "草稿",
* "GCJL_LHCLDW_ID": "bd9a78b1-c307-475f-9442-3a80a80591f0",
* "BD_QYXX_ID": "",
* "SY_CREATETIME": "2024-10-30 11:16:34",
* "SY_ORG_ID": "systemdepartment",
* "BD_FBFXPZ_FBGCMC": "B1食堂",
* "BD_FBFXPZ_DWGCBH": "FXGCJCQ-ROW3-2024101601",
* "BD_CLGZ_GCJL_ID": "0954b1500f644fffa1d36671eb8436bd",
* "BD_FBFXPZ_DYGCMC": "3排8人区",
* "GCJL_SFWZDBW_NAME": "",
* "BD_FBFXPZ_FXGCBH": "FBGCB1202401"
* }
*/
data class MeasureBean(
val BD_CONTRACT_ID: String,
@ -16,9 +57,12 @@ data class MeasureBean(
val BD_CLJH_ID: String, //测量计划ID,即测量工作ID
val CLJH_STARTTIME: String,
val CLJH_CONTENT: String, //测量内容
val CLJH_LCMC: String, //流程名称
val CLJH_LCMC: String?, //流程名称
val BD_FBFXPZ_FBGCMC: String, //分部工程名称
val BD_FBFXPZ_DYGCMC: String, //单元工程名称
val CLJH_BDLSH: String, //流程编号
val CLJH_BDLSH: String?, //流程编号
val CLJH_CLLX_NAME: String, //测量类型
val GCJL_LCMC: String?, //流程名称(工程计量)
val GCJL_BDLSH: String?, //流程编号
)

@ -1,15 +1,21 @@
package com.project.survey.network
import com.project.survey.constants.SPConstants
import com.project.survey.logic.bean.ListResult
import com.project.survey.model.ApprovalResponse
import com.project.survey.model.ControlNetworkBean
import com.project.survey.model.ControlNetCGBean
import com.project.survey.model.ControlNetworkInfoBean
import com.project.survey.model.InspectionReportBean
import com.project.survey.model.LoftingBean
import com.project.survey.model.LoftingPointListBean
import com.project.survey.model.LoftingPointRecordEntry
import com.project.survey.model.LoginBean
import com.project.survey.model.MeasureBean
import com.project.survey.model.PointEntry
import com.project.survey.model.ProjectBean
import com.project.survey.model.ProjectData
import com.project.survey.util.SPUtils
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Field
@ -22,15 +28,6 @@ import retrofit2.http.Query
interface Api {
// /**
// * 登录
// */
// @GET("je/personInfo/externalEntry")
// suspend fun login(
// @Query("account") account: String,
// @Query("password") password: String
// ): HttpResult<LoginBean>
/**
* 内部登录获取验证码
*/
@ -78,23 +75,6 @@ interface Api {
@Query("personId") personId: String
): HttpResult<List<ProjectData>>
// /**
// * 发送验证码
// */
// @GET("/Api/Mas/sendSms")
// suspend fun sendSMS(
// @Query("mobile") mobile: String
// ): HttpResult<Any>
//
// /**
// * 验证验证码
// */
// @GET("/Api/Mas/CheckVerifycode")
// suspend fun checkVerifyCode(
// @Query("mobile") mobile: String,
// @Query("verifycode") verifycode: String
// ): HttpResult<Any>
/**
* 获取流程审批列表
*/
@ -161,8 +141,8 @@ interface Api {
/**
* 获取测量工作测量计划与工程计量
* @param tableCode 测量计划传BD_CLJH工程计量传BD_CLGZ_GCJL
* @param funcCode 测量计划传BD_CLJH工程计量传BD_CLGZ_GCJL
* @param j_qurey 固定参数 [{"code":"SY_CURRENTTASK","type":"=","value":"施工单位APP上开展测量工作"}]
* @param funcCode 测量计划传BD_CLJH工程计量传BD_CLGZ_GCJL_ZB(*******)
* @param j_qurey 固定参数
*/
@FormUrlEncoded
@POST("je/cloud/beiDou/load")
@ -178,14 +158,17 @@ interface Api {
/**
* 修改测量工作状态
* @param workId 测量工作ID
* @param workType 测量计划传BD_CLJH工程计量传BD_CLGZ_GCJL
* @param status 执行中已结束对应按钮进入测量结束测量
*/
@GET("je/measureWork/modifyWorkStatus")
suspend fun updateMeasureWorkStatus(
@Header("projectId") projectId: String,
@Query("workId") workId: String, //测量工作ID
@Query("workType") workType: String, //测量计划传BD_CLJH,工程计量传:BD_CLGZ_GCJL
@Query("status") status: String //执行中、已结束(对应按钮:进入测量、结束测量)
) : HttpResult<String>
@Query("workId") workId: String,
@Query("workType") workType: String,
@Query("status") status: String
): HttpResult<String>
/**
* 测点记录录入
@ -194,5 +177,44 @@ interface Api {
suspend fun uploadPointEntry(
@Header("projectId") projectId: String,
@Body requestBody: List<PointEntry>
) : HttpResult<String>
): HttpResult<String>
/**
* 生成报验单
*/
@GET("je/measureWork/createInspectionReport")
suspend fun createInspectionReport(
@Header("projectId") projectId: String,
@Query("workId") workId: String
): HttpResult<InspectionReportBean>
/**
* 放样任务查询
*/
@FormUrlEncoded
@POST("je/cloud/beiDou/load")
suspend fun fetchLoftingList(
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Field("tableCode") tableCode: String = "BD_ZYLB",
@Field("funcCode") funcCode: String = "BD_ZYLB",
@Field("j_qurey") j_qurey: String = ""
): HttpResult<ListResult<LoftingBean>>
/**
* 根据放样作业ID获取放样点
*/
@GET("je/measureWork/qureySettingOutPointsByWorkId")
suspend fun fetchLoftingPointList(
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Query("workId") workId: String
): HttpResult<List<LoftingPointListBean>>
/**
* 上传放样测点记录
*/
@POST("je/measureWork/pointsEntryForSettingOutPoint")
suspend fun uploadLoftingPointRecord(
@Header("projectId") projectId: String = SPUtils.getString(SPConstants.PROJECT_ID),
@Body requestBody: List<LoftingPointRecordEntry>
): HttpResult<String>
}

@ -181,8 +181,8 @@ abstract class BaseBindingActivity<VB : ViewBinding> : AppCompatActivity() {
// initToolBar()
initView()
initListener()
initData()
initListener()
}
private fun initTheme() {

@ -3,6 +3,7 @@ package com.project.survey.ui.home
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import com.project.survey.constants.Constants
import com.project.survey.constants.EventConstants
import com.project.survey.constants.SPConstants
import com.project.survey.databinding.FragmentHomeBinding
@ -50,11 +51,11 @@ class HomeFragment : BaseBindingFragment<FragmentHomeBinding>() {
override fun initListener() {
// 测量计划
mBinding.itemSurveyPlan.setOnClickNoRepeatListener {
PointMeasureListActivity.start(PointMeasureListActivity.TYPE_SURVEY_PLAN)
PointMeasureListActivity.start(Constants.TYPE_BD_CLJH)
}
// 工程计量
mBinding.itemEngineeringMetrology.setOnClickNoRepeatListener {
PointMeasureListActivity.start(PointMeasureListActivity.TYPE_PROJECT_MEASURE)
PointMeasureListActivity.start(Constants.TYPE_BD_CLGZ_GCJL)
}
// //点测量
// mBinding.itemPointMeasure.setOnClickNoRepeatListener {

@ -27,7 +27,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.afollestad.materialdialogs.internal.MDButton;
import com.bingce.data.cache.CachedCurrentJob;
import com.bingce.data.cache.CachedProject;
import com.bingce.data.database.PointDb;
import com.bingce.data.surveyor.surveydata.pointsurvey.PointConstants;
@ -36,6 +35,7 @@ import com.bingce.surveyor.agentweb.AgentWebActivity;
import com.bingce.surveyor.util.dialog.CustomDialog;
import com.bingce.ui.BcDialogExt;
import com.bingce.utils.ActivityUtils;
import com.bingce.utils.IntentUtil;
import com.bingce.utils.PointLibraryUtil;
import com.bingce.utils.SimpleTextWatcher;
import com.bingce.utils.StringUtil;
@ -45,12 +45,14 @@ import com.bingce.viewmodel.AbstractCoordinatePointsLibraryViewModelKt;
import com.kongzue.dialogx.interfaces.OnBindView;
import com.project.survey.App;
import com.project.survey.R;
import com.project.survey.constants.SPConstants;
import com.project.survey.databinding.ActivityStakingNewJob2Binding;
import com.project.survey.dialog.BubblePopWindow;
import com.project.survey.ui.base.BaseSurveyNewActivity;
import com.project.survey.ui.instrument.setupstation.adapter.StakingPointLibraryAdapter;
import com.project.survey.ui.instrument.setupstation.util.StakingPointsLibraryActivitySQLiteUtils;
import com.project.survey.util.CommonUtils;
import com.project.survey.util.SPUtils;
import com.rengwuxian.materialedittext.MaterialEditText;
import java.io.File;
@ -59,7 +61,6 @@ import java.util.List;
import blankj.utilcode.util.ConvertUtils;
import blankj.utilcode.util.ToastUtils;
import blankj.utilcode.util.Utils;
import ru.bartwell.exfilepicker.ExFilePicker;
import ru.bartwell.exfilepicker.data.ExFilePickerResult;
@ -106,8 +107,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
@Override
public void fireByKey(String key) {
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
jobId = CachedCurrentJob.currentJobId(projectId);
// String projectId = CachedProject.currentProjectId();
// jobId = CachedCurrentJob.currentJobId(projectId);
ThreadPoolUtil.executeInMain(() -> {
pagingDataLiveData.removeObservers(StakingNewJobActivity.this);
pagingDataLiveData = PagingLiveData.cachedIn(PagingLiveData.getLiveData(pager), getLifecycle());
@ -137,7 +138,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
private final static String RESULT_X = "x";
private final static String RESULT_Y = "y";
private final static String RESULT_Z = "z";
private String jobId;
// private String jobId;
private String workId;
private LiveData<PagingData<PointRecord>> pagingDataLiveData;
public View getContentView() {
@ -149,6 +151,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
protected void initView() {
setTitle(getString(R.string.staking_point_library));
workId = IntentUtil.stringExtra(this, KEY_WORK_ID);
if (App.instance.isThemeDark()) {
binding.topLayout.setBackgroundColor(getColor(R.color.theme_dark_black));
binding.tvNumber.setTextColor(getColor(R.color.white));
@ -170,8 +174,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
}));
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
jobId = CachedCurrentJob.currentJobId(projectId);
// String projectId = CachedProject.currentProjectId();
// jobId = CachedCurrentJob.currentJobId(projectId);
ThreadPoolUtil.executeInMain(() -> {
pagingDataLiveData = PagingLiveData.cachedIn(PagingLiveData.getLiveData(pager), getLifecycle());
pagingDataLiveData
@ -233,8 +237,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
filterParameter.setCodeKey(codeKey);
filterParameter.setRemarkKey(remarksKey);
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
jobId = CachedCurrentJob.currentJobId(projectId);
// String projectId = CachedProject.currentProjectId();
// jobId = CachedCurrentJob.currentJobId(projectId);
ThreadPoolUtil.executeInMain(() -> {
pagingDataLiveData.removeObservers(this);
pagingDataLiveData =
@ -247,6 +251,7 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
});
});
// 新建
binding.pointsLibraryBtnNewCreate.setOnClickListener(v -> {
showPointDialog(null, getString(R.string.new_point));
});
@ -324,14 +329,14 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
private PagingSource<Integer, PointRecord> dataSourse() {
return PointDb.getInstance().rawQueryPagingSource(StakingPointsLibraryActivitySQLiteUtils.searchSQLit(
jobId,
workId,
filterParameter, true, binding.etEnterNameCode.getText().toString().trim()
));
}
private List<PointRecord> getAllPoint() {
return PointDb.getInstance().rawQueryListData(StakingPointsLibraryActivitySQLiteUtils.searchSQLit(
jobId,
workId,
filterParameter, true, binding.etEnterNameCode.getText().toString().trim()
));
}
@ -355,8 +360,8 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
record.remarks = met_remarks.getText().toString().trim();
} else {
String projectId = CachedProject.currentProjectId();
jobId = CachedCurrentJob.currentJobId(projectId);
record = new PointRecord(projectId, jobId, "",
// jobId = CachedCurrentJob.currentJobId(projectId);
record = new PointRecord(projectId, workId, "",
PointConstants.POINT_TYPE_KNOWN_POINT,
met_name.getText().toString().trim(),
met_code.getText().toString().trim(),
@ -550,20 +555,20 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
ExFilePickerResult object = ExFilePickerResult.getFromIntent(data);
if (object != null && object.getCount() > 0) {
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
jobId = CachedCurrentJob.currentJobId(projectId);
String projectId = SPUtils.INSTANCE.getString(SPConstants.PROJECT_ID, "");
// jobId = CachedCurrentJob.currentJobId(projectId);
try {
String path = object.getPath() + object.getNames().get(0);
String result = null;
switch (requestCode) {
case EX_FILE_PICKER_RESULT_SURVEYOR_EXCEL:
PointLibraryUtil.importStakingJobPointExcel(new File(path), projectId, jobId, isOverrideImport, (status, msg) -> ToastUtils.showShort(msg));
PointLibraryUtil.importStakingJobPointExcel(new File(path), projectId, workId, isOverrideImport, (status, msg) -> ToastUtils.showShort(msg));
break;
case EX_FILE_PICKER_RESULT_SURVEYOR_TXT:
PointLibraryUtil.importStakingJobPointTxt(new File(path), projectId, jobId, isOverrideImport, (status, msg) -> ToastUtils.showShort(msg));
PointLibraryUtil.importStakingJobPointTxt(new File(path), projectId, workId, isOverrideImport, (status, msg) -> ToastUtils.showShort(msg));
break;
case EX_FILE_PICKER_RESULT_CASS_DAT:
PointLibraryUtil.importStakingJobPointCassDat(new File(path), projectId, jobId, isOverrideImport, cassXY, (status, msg) -> ToastUtils.showShort(msg));
PointLibraryUtil.importStakingJobPointCassDat(new File(path), projectId, workId, isOverrideImport, cassXY, (status, msg) -> ToastUtils.showShort(msg));
break;
}
} catch (Exception e) {
@ -621,11 +626,6 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
}
}
public static void start(Context context) {
Intent intent = new Intent(context, StakingNewJobActivity.class);
intent.putExtra(KEY_IS_SELECT, false);
context.startActivity(intent);
}
@Override
public BubblePopWindow newBubblePopWindow(Context context) {
@ -644,9 +644,27 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
})));
}
@Override
public boolean isHideHelpDoc() {
return true;
private static final String KEY_WORK_ID = "keyWorkId";
public static void start(Context context, String workId) {
Intent intent = new Intent(context, StakingNewJobActivity.class);
intent.putExtra(KEY_IS_SELECT, false);
intent.putExtra(KEY_WORK_ID, workId);
context.startActivity(intent);
}
public static void start(FragmentActivity context, String workId, OnSelectedPointListener listener) {
Intent intent = new Intent(context, StakingNewJobActivity.class);
intent.putExtra(KEY_IS_SELECT, true);
intent.putExtra(KEY_WORK_ID, workId);
ActivityUtils.startActivityForResults(context, intent, result -> {
if (result.getResultCode() == RESULT_OK && result.getData() != null) {
String pointId = result.getData().getStringExtra(RESULT_POINT_ID);
if (listener != null) {
listener.onSelected(pointId);
}
}
});
}
public static void pickPoint(FragmentActivity context, ICallback callback) {
@ -679,6 +697,10 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
void onPicked(String pointId, int index, String name, double x, double y, double z);
}
public interface OnSelectedPointListener {
void onSelected(String pointId);
}
@Override
protected void onDestroy() {
try {
@ -691,4 +713,9 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
}
super.onDestroy();
}
@Override
public boolean isHideHelpDoc() {
return true;
}
}

@ -1,8 +1,10 @@
package com.project.survey.ui.lofting
import androidx.activity.viewModels
import com.project.survey.R
import com.project.survey.databinding.ActivityLoftingListBinding
import com.project.survey.model.LoftingListBean
import com.project.survey.extend.toast
import com.project.survey.logic.viewmodel.ProjectViewModel
import com.project.survey.ui.base.BaseBindingActivity
import com.project.survey.ui.lofting.adapter.LoftingListAdapter
import com.project.survey.ui.lofting.pointlofting.PointStakingActivity
@ -10,7 +12,6 @@ import com.project.survey.util.ActivityNavUtil
class LoftingListActivity : BaseBindingActivity<ActivityLoftingListBinding>() {
private val adapter by lazy { LoftingListAdapter() }
companion object {
fun start() {
@ -18,6 +19,11 @@ class LoftingListActivity : BaseBindingActivity<ActivityLoftingListBinding>() {
}
}
private val viewModel: ProjectViewModel by viewModels()
private val adapter by lazy { LoftingListAdapter() }
private var searchContent = "" // 搜索框里的内容
override fun getBinding(): ActivityLoftingListBinding =
ActivityLoftingListBinding.inflate(layoutInflater)
@ -30,23 +36,36 @@ class LoftingListActivity : BaseBindingActivity<ActivityLoftingListBinding>() {
}
override fun initData() {
val dataList = mutableListOf<LoftingListBean>()
for (i in 0 until 3) {
dataList.add(LoftingListBean())
viewModel.errorResponse.observe(this) {
toast(it)
dismissLoadingDialog()
}
adapter.submitList(dataList)
viewModel.loftingBeanListResponse.observe(this) {
dismissLoadingDialog()
adapter.submitList(it.rows)
}
fetchData()
}
override fun initListener() {
// 搜索
mBinding.searchWidget.setOnEditorSearchListener {
searchContent = it
showLoadingDialog()
fetchData()
}
// 放样
adapter.addOnItemChildClickListener(R.id.tvLofting) { _, _, position ->
adapter.getItem(position)?.let { bean ->
PointStakingActivity.start(this)
PointStakingActivity.start(this, bean.BD_ZYLB_ID)
// viewModel.fetchLoftingPointList(bean.BD_ZYLB_ID)
}
}
}
private fun fetchData() {
viewModel.fetchLoftingList(searchContent)
}
}

@ -5,17 +5,18 @@ import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.project.survey.R
import com.project.survey.model.LoftingBean
class LoftingListAdapter : BaseQuickAdapter<Any, QuickViewHolder>() {
class LoftingListAdapter : BaseQuickAdapter<LoftingBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: Any?) {
item?.let { bean ->
holder.setText(R.id.tvWorkName, "作业名称")
.setText(R.id.tvWorkDesc, "作业内容内容内容")
.setText(R.id.tvCreateTime, "2022-05-17 10:58:48")
.setText(R.id.tvProjectName, "单位-分部-分项 3个名称合并显示")
.setText(R.id.tvSurveyor, "丁汉臻")
}
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: LoftingBean?) {
if (item == null)
return
holder.setText(R.id.tvWorkName, item.ZYLB_ZY_NAME)
.setText(R.id.tvWorkDesc, item.ZYLB_ZYMS)
.setText(R.id.tvCreateTime, item.SY_CREATETIME)
.setText(R.id.tvProjectName, "")
.setText(R.id.tvSurveyor, item.ZYLB_CLY)
}
override fun onCreateViewHolder(

@ -1,9 +1,6 @@
package com.project.survey.ui.lofting.pointlofting;
import static com.bingce.surveyor.util.ConstUtils.intentConst.KEY_JOB_ID;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -11,6 +8,8 @@ import android.graphics.DashPathEffect;
import android.text.TextUtils;
import android.view.View;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.sqlite.db.SimpleSQLiteQuery;
@ -23,7 +22,6 @@ import com.bingce.coordlib.util.CoordUtil;
import com.bingce.data.DeviceInfoData;
import com.bingce.data.cache.CachedCurrentJob;
import com.bingce.data.cache.CachedCurrentRoad;
import com.bingce.data.cache.CachedCurrentRoadKt;
import com.bingce.data.cache.CachedProject;
import com.bingce.data.database.DBQueryConstant;
import com.bingce.data.database.PointDb;
@ -59,19 +57,23 @@ import com.bingce.utils.ThreadPoolUtil;
import com.bingce.utils.Util;
import com.project.survey.App;
import com.project.survey.R;
import com.project.survey.constants.SPConstants;
import com.project.survey.databinding.ActivityPointStakingBinding;
import com.project.survey.dialog.CustomInputListDialog;
import com.project.survey.dialog.CustomLineChartDialog;
import com.project.survey.logic.viewmodel.ProjectViewModel;
import com.project.survey.model.ControlRecord;
import com.project.survey.model.LoftingPointBean;
import com.project.survey.model.LoftingPointListBean;
import com.project.survey.model.LoftingPointRecordEntry;
import com.project.survey.ui.base.BaseSurveyNewActivity;
import com.project.survey.ui.instrument.setupstation.ControlPointsNewActivity;
import com.project.survey.ui.instrument.setupstation.CoordinatePointsLibraryActivity;
import com.project.survey.ui.instrument.setupstation.StakingNewJobActivity;
import com.project.survey.ui.lofting.pointlofting.record.RecordsActivity;
import com.project.survey.ui.lofting.pointlofting.record.util.RecordTypeConstants;
import com.project.survey.ui.pointmeasure.measure.util.SurveyToolBarClickListenerUtils;
import com.project.survey.util.CommonUtils;
import com.project.survey.util.DeviceConnectUtil;
import com.project.survey.util.SPUtils;
import com.project.survey.util.SurveyUIUtils;
import java.util.ArrayList;
@ -96,6 +98,7 @@ import lecho.hellocharts.renderer.LineChartRenderer;
*/
public class PointStakingActivity extends BaseSurveyNewActivity {
private ProjectViewModel viewModel;
private Context mContext;
private ActivityPointStakingBinding binding;
private final Line currentPointLine = new Line(); //实测点
@ -105,12 +108,12 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
private final Line effectGuideLine = new Line(); //放样引导线
private final Line effectHorLine = new Line(); //放样提示横向虚线
private final Line effectVerLine = new Line(); //放样提示纵向虚线
private final List<PointRecord> stakingLibraryPointList = new ArrayList<>();
private final List<PointRecord> stakingLibraryPointList = new ArrayList<>(); //放样点列表
private List<PointStakeRecord> recordStakingBasePointList;
private PointRecord targetStakePointRecord;
private Coordinate currentCoordinate;
private Coordinate currentSmoothCoordinate;
// protected final CachedCurrentRoadKt cachedRoadKt = new CachedCurrentRoadKt(this);
// protected final CachedCurrentRoadKt cachedRoadKt = new CachedCurrentRoadKt(this);
private final SurveyRemarksUtils surveyRemarksUtils = new SurveyRemarksUtils();
private IText distance, moveWestEast, moveSouthNorth, moveDigFill, moveLeftRight, moveBeforeAfter;
private MoveValue<MoveK> moveK;
@ -126,6 +129,8 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
private boolean isFirstUpdateChartView;
private boolean mStakingPointIsInMemory = false;
private String workId = ""; //作业ID
@Override
public View getContentView() {
binding = ActivityPointStakingBinding.inflate(getLayoutInflater());
@ -135,7 +140,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
@Override
protected void initView() {
mContext = this;
workId = IntentUtil.stringExtra(this, KEY_WORK_ID);
viewModel = new ViewModelProvider(this).get(ProjectViewModel.class);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
// 指南针角度
targetCompassHelper.register(angle -> {
binding.dirCompass.setAngle(angle);
});
@ -149,13 +157,13 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
baseSurveyActivityUtils.activityBaseSurveyBinding,
binding.baseSurveyStakingSetting, new SurveyToolBarClickListenerUtils.IToolBarClickListener() {
@Override
public void onSettingClickListener() {
public void onSettingClickListener() { //设置
stopSoundPool();
PointStakingSettingActivity.start(mContext);
}
@Override
public void onPositionCenterClickListener() {
public void onPositionCenterClickListener() { //居中
if (currentCoordinate == null) {
ToastUtils.showShort(getString(R.string.please_observe_measure_first));
return;
@ -165,7 +173,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
}
@Override
public void onFullScreenClickListener() {
public void onFullScreenClickListener() { // 全图
ChartViewUtils.centerInScreen(binding.lineChartView);
}
@ -193,8 +201,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
//点库选点
binding.pointLibrary.setOnClickListener(v -> {
if (mStakingPointIsInMemory) return;
StakingNewJobActivity.pickPoint(this, (pointId, pointsListIndex, name, x, y, z) ->
onPickedPoint(true, pointId, name, x, y, z));
StakingNewJobActivity.start(this, workId, pointId -> {
targetStakePointRecord = stakingLibraryPointList.stream().filter(p -> p.id.equals(pointId)).findFirst().get();
updateUI();
});
});
//移动方法
showTopMoveMethod();
@ -339,7 +349,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
}
String content = getString(R.string.whether_staking_selected_point) + getString(R.string.colon) + stakingLibraryPointList.get(pointIndex).name + "\n"
+ "X" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).x, 6) + " "
+ "Y" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).y, 6)+ "\n"
+ "Y" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).y, 6) + "\n"
+ "Z" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).h, 6);
builder.setContent(content).setButtonConfirm(v -> {
targetStakePointRecord = stakingLibraryPointList.get(pointIndex);
@ -357,29 +367,58 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
@Override
protected void initData() {
String targetPointList = IntentUtil.stringExtra(this, KEY_POINT_LIST);
if (StringUtil.isEmpty(targetPointList)) {
PointDb.getInstance().rawQueryListLiveData(PointConstants.findKnownPointByJob(jobId())).observe(this, pointRecords -> {
onPointRecordsUpdate(pointRecords);
});
} else {
mStakingPointIsInMemory = true;
Gson gson = new Gson();
List<StakingPoint> points = gson.fromJson(targetPointList, new TypeToken<List<StakingPoint>>() {
}.getType());
List<PointRecord> pointRecords = new ArrayList<>();
for (StakingPoint point : points) {
pointRecords.add(new PointRecord(
"", "", "",
point.getCategory(),
point.getName(),
viewModel.getErrorResponse().observe(this, ToastUtils::showShort);
// 上传测点记录成功
viewModel.getUploadLoftingPointRecordResponse().observe(this, ToastUtils::showShort);
// 放样点列表
viewModel.getLoftingPointListResponse().observe(this, loftingPointListBeans -> {
List<PointRecord> pointRecordList = new ArrayList<>();
for (LoftingPointBean point : loftingPointListBeans) {
PointRecord pointRecord = new PointRecord(
SPUtils.INSTANCE.getString(SPConstants.PROJECT_ID, ""), workId, "",
3,
point.getZBSJ_D_NAME(),
"",
"",
point.getX(), point.getY(), point.getZ(),
0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData()));
Double.parseDouble(point.getZBSJ_FYZB_X()), Double.parseDouble(point.getZBSJ_FYZB_Y()), Double.parseDouble(point.getZBSJ_FYZB_Z()),
0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData());
pointRecord.id = point.getBD_ZYLBMX_ID();
pointRecordList.add(pointRecord);
}
onPointRecordsUpdate(pointRecords);
}
onPointRecordsUpdate(pointRecordList);
// 保存到数据库
ThreadPoolUtil.execute(() -> {
PointDb.getInstance().save(pointRecordList);
});
});
// 获取放样点
viewModel.fetchLoftingPointList(workId);
// String targetPointList = IntentUtil.stringExtra(this, KEY_POINT_LIST);
// String targetPointList = "";
// if (StringUtil.isEmpty(targetPointList)) {
// PointDb.getInstance().rawQueryListLiveData(PointConstants.findKnownPointByJob(jobId())).observe(this, pointRecords -> {
// onPointRecordsUpdate(pointRecords);
// });
// } else {
// mStakingPointIsInMemory = true;
// Gson gson = new Gson();
// List<StakingPoint> points = gson.fromJson(targetPointList, new TypeToken<List<StakingPoint>>() {
// }.getType());
// List<PointRecord> pointRecords = new ArrayList<>();
// for (StakingPoint point : points) {
// pointRecords.add(new PointRecord(
// "", "", "",
// point.getCategory(),
// point.getName(),
// "",
// "",
// point.getX(), point.getY(), point.getZ(),
// 0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData()));
// }
// onPointRecordsUpdate(pointRecords);
// }
}
private void onPointRecordsUpdate(List<PointRecord> pointRecords) {
@ -391,9 +430,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
stakingLibraryPointList.addAll(pointRecords);
for (int i = 0; i < stakingLibraryPointList.size(); i++) {
PointRecord pointRecord = stakingLibraryPointList.get(i);
// 待放样点
surveyBasePointLine.getValues().add(new PointValue(pointRecord.y, pointRecord.x).setLabel(pointRecord.name));
}
if (stakingLibraryPointList.size() > 0) {
if (!stakingLibraryPointList.isEmpty()) { //待放样点列表不为空
targetStakePointRecord = stakingLibraryPointList.get(0);
stakingPointLine.getValues().add(new PointValue(targetStakePointRecord.y, targetStakePointRecord.x).setLabel(targetStakePointRecord.name));
updateBottomInfo(targetStakePointRecord.name, targetStakePointRecord.x, targetStakePointRecord.y, targetStakePointRecord.h);
@ -434,13 +474,16 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
private CustomLineChartDialog customDialog;
private boolean isControlSurvey;
/**
* 观测并记录
*/
private void watchSurveyRecord() {
if (DeviceConnectUtil.isDeviceConnectSelectDialog(this, baseSurveyActivityUtils.activityBaseSurveyBinding)) {
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_TS) {
isTsWatchRecord = true;
if (currentCoordinate != null) {
if (targetStakePointRecord == null) {
ToastUtils.showShort(getString(R.string.add_points_staking_point_first));
ToastUtils.showShort(R.string.add_points_staking_point_first);
return;
}
SurveyLimitCheckUtils.checkStakingLimit(this, currentCoordinate, new Coordinate(targetStakePointRecord.x, targetStakePointRecord.y), (currentCoordinate, targetCoordinate) -> recordPoint());
@ -449,15 +492,15 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
}
} else {
if (targetStakePointRecord == null) {
ToastUtils.showShort(getString(R.string.add_points_staking_point_first));
ToastUtils.showShort(R.string.add_points_staking_point_first);
return;
}
// 平滑点数
boolean isSmoothStaking = PreferencesUtil.getPreferenceInt(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, 1) != 1;
if (isSmoothStaking) {
lineChartViewBuilder = new CustomLineChartDialog.Builder(this).setTitle(getString(R.string.staking_points_being_collected));
lineChartViewBuilder.setButtonConfirmTextColor(R.color.color_E2E1DD);
lineChartViewBuilder.setButtonConfirm(v -> {
SurveyLimitCheckUtils.checkStakingLimit(this, currentSmoothCoordinate, new Coordinate(targetStakePointRecord.x, targetStakePointRecord.y), (currentCoordinate, targetCoordinate) -> recordPoint());
});
// lineChartViewBuilder.setButtonConfirm(v -> checkRtkStringLimit());
@ -498,11 +541,11 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
private void onRecentlyPoint() {
if (currentCoordinate == null) {
ToastUtils.showShort(getString(R.string.return_coordinate_empty_check_device));
ToastUtils.showShort(R.string.return_coordinate_empty_check_device);
return;
}
if (targetStakePointRecord == null) {
ToastUtils.showShort(getString(R.string.add_points_staking_point_first));
ToastUtils.showShort(R.string.add_points_staking_point_first);
return;
}
if (stakingLibraryPointList.size() > 0) {
@ -521,7 +564,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
}
}
private void onLastOrNextPoint(boolean nextOrLast) {
/**
* @param isLast true上一个false下一个
*/
private void onLastOrNextPoint(boolean isLast) {
if (targetStakePointRecord == null) {
ToastUtils.showShort(getString(R.string.add_points_staking_point_first));
return;
@ -538,51 +584,42 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
return;
}
currentIndex += stakingLibraryPointList.size();
int targetIndex = (nextOrLast ? currentIndex + 1 : currentIndex - 1) % stakingLibraryPointList.size();
int targetIndex = (isLast ? currentIndex + 1 : currentIndex - 1) % stakingLibraryPointList.size();
targetStakePointRecord = stakingLibraryPointList.get(targetIndex);
updateUI();
return;
}
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
String jobId = CachedCurrentJob.currentJobId(projectId);
PointRecord pointRecord = PointDb.getInstance().rawQueryData(PointConstants.findLastNextKnownPointByJobAndDate(jobId, targetStakePointRecord.createDate, nextOrLast));
runOnUiThread(() -> {
if (pointRecord == null) {
ToastUtils.showShort(nextOrLast ? getString(R.string.the_first_staking_point_list) : getString(R.string.the_last_staking_point_list));
return;
}
targetStakePointRecord = pointRecord;
// 当前点所在列表位置
int currentPosition = stakingLibraryPointList.indexOf(targetStakePointRecord);
if (isLast) { //上一个
if (currentPosition > 0) { //有上一个
targetStakePointRecord = stakingLibraryPointList.get(currentPosition - 1);
updateUI();
});
});
}
/**
* 点库返回选择的点
*/
private void onPickedPoint(boolean isStakingLibPoint, String pointId, String name, double x, double y, double z) {
if (!isStakingLibPoint) {
DeviceInfoData deviceInfoData = DeviceUtils.collectDeviceInfo();
PointRecord tempStakePointRecord = new PointRecord(pointId, "", "",
PointConstants.POINT_TYPE_SURVEY_CONTROL_POINT, name, "", "",
x, y, z, 0, 0, 0, PointConstants.POINT_FORMAT_XYZ, deviceInfoData);
stakingLibraryPointList.add(tempStakePointRecord);
targetStakePointRecord = tempStakePointRecord;
surveyBasePointLine.getValues().add(new PointValue(tempStakePointRecord.y, tempStakePointRecord.x).setLabel(tempStakePointRecord.name));
updateUI();
} else {
ThreadPoolUtil.execute(() -> {
PointRecord knowPointRecord = PointDb.getInstance().rawQueryData(PointConstants.findKnownPointById(pointId));
runOnUiThread(() -> {
targetStakePointRecord = knowPointRecord;
updateUI();
});
});
} else {
ToastUtils.showShort(R.string.the_first_staking_point_list);
}
} else { //下一个
if (currentPosition < stakingLibraryPointList.size() - 1) { //有下一个
targetStakePointRecord = stakingLibraryPointList.get(currentPosition + 1);
updateUI();
} else {
ToastUtils.showShort(R.string.the_last_staking_point_list);
}
}
}
// private void navigate2PointLibrary(){
// StakingNewJobActivity.start(this, workId, (pointId, pointsListIndex, name, x, y, z) ->
// ThreadPoolUtil.execute(() -> {
// PointRecord knowPointRecord = PointDb.getInstance().rawQueryData(PointConstants.findKnownPointById(pointId));
// runOnUiThread(() -> {
// targetStakePointRecord = knowPointRecord;
// updateUI();
// });
// })
// );
// }
private void updateUI() {
if (targetStakePointRecord == null) {
return;
@ -618,6 +655,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
/**
* 接收 RTK 返回的数据
*
* @param antennaHeight
* @param blh
* @param originalBlh
@ -777,7 +815,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
if (targetStakePointRecord == null) {
if (isTirpsAddSP) {
builder.setContent(getString(R.string.add_points_staking_point_first)).setButtonConfirm(v -> {
StakingNewJobActivity.start(this);
StakingNewJobActivity.start(this, workId);
}).create().show();
isTirpsAddSP = false;
}
@ -1037,15 +1075,13 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
String jobId = CachedCurrentJob.currentJobId(projectId);
String roadId = CachedCurrentRoad.currentRoadId(projectId);
DeviceUtils.StationData stationData = DeviceUtils.stationData(
new BasePoint(targetStakePointRecord.x, targetStakePointRecord.y, targetStakePointRecord.h),
((App) Utils.getApp()).angleNotNumber(),
6);
DeviceInfoData deviceInfoData = DeviceUtils.collectDeviceInfo();
PointStakeRecord pointStakeRecord = new PointStakeRecord(projectId, jobId, roadId,
PointStakeRecord pointStakeRecord = new PointStakeRecord(projectId, workId, "",
targetStakePointRecord.id, moveBeforeAfter != null ? moveBeforeAfter.getString() : "", moveLeftRight != null ? moveLeftRight.getString() : "", moveWestEast != null ? moveWestEast.getString() : "", moveSouthNorth != null ? moveSouthNorth.getString() : "",
""
, targetStakePointRecord.name
@ -1065,6 +1101,9 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
, deviceInfoData);
PointStakeDb.getInstance().save(pointStakeRecord);
// 上传测点
LoftingPointRecordEntry entry = new LoftingPointRecordEntry(pointStakeRecord);
viewModel.uploadLoftingPointRecord(entry);
runOnUiThread(() -> {
recordPointLine.getValues().add(new PointValue(pointStakeRecord.measuredY, pointStakeRecord.measuredX).setLabel(""));
@ -1108,8 +1147,8 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
// binding.tvTopFour.setText(getString(R.string.d));
// break;
// case 1:
binding.tvTopThree.setText(getString(R.string.to_north));
binding.tvTopFour.setText(getString(R.string.to_east));
binding.tvTopThree.setText(getString(R.string.to_north));
binding.tvTopFour.setText(getString(R.string.to_east));
// break;
// }
binding.topFiveSixLayout.setVisibility(View.GONE);
@ -1118,40 +1157,11 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
binding.tvTopSix.setText(getString(R.string.station_angle_diff));
}
@Override
protected void onHelpClicked() {
HelpWebActivity.navigation2KnownPointStakingHelp(this);
}
@Override
public boolean isShowTopBarHrPoleLayout() {
return false;
}
private String jobId() {
return IntentUtil.stringExtra(getIntent(), KEY_JOB_ID);
}
public static void start(Activity activity) {
ThreadPoolUtil.execute(() -> {
String projectId = CachedProject.currentProjectId();
String roadId = CachedCurrentRoad.currentRoadId(projectId);
String jobId = CachedCurrentJob.currentJobId(projectId);
Intent intent = new Intent(activity, PointStakingActivity.class);
intent.putExtra(KEY_JOB_ID, jobId);
// intent.putExtra(KEY_PROJECT_ID, projectId);
// intent.putExtra(KEY_ROAD_ID, roadId);
activity.startActivity(intent);
});
}
private static final String KEY_POINT_LIST = "key_point_list";
private static final String KEY_WORK_ID = "keyWorkId";
public static void start(Context context, List<StakingPoint> stakingPointList) {
Gson gson = new Gson();
public static void start(Context context, String workId) {
Intent intent = new Intent(context, PointStakingActivity.class);
intent.putExtra(KEY_POINT_LIST, gson.toJson(stakingPointList));
intent.putExtra(KEY_WORK_ID, workId);
context.startActivity(intent);
}
@ -1177,6 +1187,17 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
}
}
@Override
public boolean isHideHelpDoc() {
return true;
}
@Override
public boolean isShowTopBarHrPoleLayout() {
return false;
}
// @Override
// public boolean isUseSystemStyleNavigationBar() {
// return true;

@ -810,7 +810,7 @@ public class PointStakingActivity1 extends BaseSurveyNewActivity {
if (targetStakePointRecord == null) {
if (isTirpsAddSP) {
builder.setContent(getString(R.string.add_points_staking_point_first)).setButtonConfirm(v -> {
StakingNewJobActivity.start(mContext);
StakingNewJobActivity.start(mContext, "");
}).create().show();
isTirpsAddSP = false;
}

@ -2,10 +2,10 @@ package com.project.survey.ui.pointmeasure
import androidx.activity.viewModels
import com.project.survey.R
import com.project.survey.constants.Constants
import com.project.survey.databinding.ActivityPointMeasureListBinding
import com.project.survey.extend.smartDismiss
import com.project.survey.extend.toast
import com.project.survey.logic.viewmodel.ControlNetViewModel
import com.project.survey.logic.viewmodel.ProjectViewModel
import com.project.survey.ui.base.BaseBindingActivity
import com.project.survey.ui.pointmeasure.adapter.PointMeasureListAdapter
@ -22,8 +22,6 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
companion object {
const val KEY_TYPE = "KEY_TYPE"
const val TYPE_SURVEY_PLAN = "BD_CLJH"//测量计划
const val TYPE_PROJECT_MEASURE = "BD_CLGZ_GCJL"//工程计量
fun start(type: String) {
ActivityNavUtil.startActivity<PointMeasureListActivity> {
@ -37,7 +35,9 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
private val adapter by lazy { PointMeasureListAdapter(type) }
private var type = ""
private var currentPage = 1
private var start = 0
// private var start = 0
private var searchContent = "" // 搜索框里的内容
override fun getBinding(): ActivityPointMeasureListBinding =
ActivityPointMeasureListBinding.inflate(layoutInflater)
@ -46,8 +46,8 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
type = intent.getStringExtra(KEY_TYPE) ?: ""
immersionToolbar(
mBinding.toolbar, when (type) {
TYPE_SURVEY_PLAN -> getString(R.string.survey_plan)
TYPE_PROJECT_MEASURE -> getString(R.string.engineering_metrology)
Constants.TYPE_BD_CLJH -> getString(R.string.survey_plan)
Constants.TYPE_BD_CLGZ_GCJL -> getString(R.string.engineering_metrology)
else -> ""
}
)
@ -56,34 +56,15 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
adapter.isStateViewEnable = true
}
override fun initListener() {
// 搜索
mBinding.searchWidget.setOnEditorSearchListener {
}
// 结束测量
adapter.addOnItemChildClickListener(R.id.tvStopMeasure) { adapter, _, position ->
adapter.getItem(position)?.let { bean ->
// viewModel.updateMeasureWorkStatus(bean.BD_CLJH_ID, if (type == TYPE_SURVEY_PLAN) "BD_CLJH" else "BD_CLGZ_GCJL", "已结束")
}
}
// 进入测量
adapter.addOnItemChildClickListener(R.id.tvEnterMeasure) { adapter, _, position ->
adapter.getItem(position)?.let { bean ->
PointSurveyNewActivity.start(type, bean.BD_CLJH_ID)
// viewModel.updateMeasureWorkStatus(bean.BD_CLJH_ID, if (type == TYPE_SURVEY_PLAN) "BD_CLJH" else "BD_CLGZ_GCJL", "执行中")
}
}
}
override fun initData() {
viewModel.errorResponse.observe(this) {
toast(it)
dismissLoadingDialog()
mBinding.smartRefreshLayout.smartDismiss()
}
// 列表
viewModel.measureBeanListResponse.observe(this) {
dismissLoadingDialog()
mBinding.smartRefreshLayout.smartDismiss()
if (currentPage == 1) {
adapter.submitList(it.rows)
@ -92,7 +73,7 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
adapter.setStateViewLayout(this, R.layout.layout_no_data)
} else {
currentPage++
start += it.totalCount
// start += it.totalCount
}
} else {
if (it.rows.isEmpty()) {
@ -100,19 +81,51 @@ class PointMeasureListActivity : BaseBindingActivity<ActivityPointMeasureListBin
} else {
adapter.addAll(it.rows)
currentPage++
start += it.totalCount
// start += it.totalCount
}
}
}
// 生成报验单
viewModel.createInspectionReportResponse.observe(this) {
toast(it.CLJH_WORKSTATUS)
}
// 获取列表数据
fetchData()
}
private fun fetchData() {
if (type == TYPE_SURVEY_PLAN) {
viewModel.fetchCLJH(currentPage, start)
} else {
viewModel.fetchGCJL(currentPage, start)
override fun initListener() {
// 搜索
mBinding.searchWidget.setOnEditorSearchListener {
searchContent = it
currentPage = 1
showLoadingDialog()
fetchData()
}
// 生成报验单
adapter.addOnItemChildClickListener(R.id.tvGenerateForm) { adapter, _, position ->
adapter.getItem(position)?.let { bean ->
viewModel.createInspectionReport(bean.BD_CLJH_ID)
}
}
// 结束测量
adapter.addOnItemChildClickListener(R.id.tvStopMeasure) { adapter, _, position ->
adapter.getItem(position)?.let { bean ->
viewModel.updateMeasureWorkStatus(bean.BD_CLJH_ID, type, "已结束")
}
}
// 进入测量
adapter.addOnItemChildClickListener(R.id.tvEnterMeasure) { adapter, _, position ->
adapter.getItem(position)?.let { bean ->
PointSurveyNewActivity.start(type, bean.BD_CLJH_ID)
viewModel.updateMeasureWorkStatus(bean.BD_CLJH_ID, type, "执行中")
}
}
}
private fun fetchData() {
viewModel.fetchMeasureDataList(type, currentPage, searchContent)
}
override fun onRefresh(refreshLayout: RefreshLayout) {

@ -5,21 +5,23 @@ import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.project.survey.R
import com.project.survey.constants.Constants
import com.project.survey.model.MeasureBean
import com.project.survey.ui.pointmeasure.PointMeasureListActivity
class PointMeasureListAdapter(val type: String) : BaseQuickAdapter<MeasureBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: MeasureBean?) {
if (item == null) return
holder.setText(R.id.tvName, item.CLJH_LCMC)
.setText(R.id.tvNO, item.CLJH_BDLSH)
// true测量计划,false工程计量
val isCLJH = type == Constants.TYPE_BD_CLJH
holder.setText(R.id.tvName, if (isCLJH) item.CLJH_LCMC else item.GCJL_LCMC)
.setText(R.id.tvNO, if (isCLJH) item.CLJH_BDLSH else item.GCJL_BDLSH)
.setText(R.id.tvType, item.CLJH_CLLX_NAME)
.setText(R.id.tvProjectName, item.BD_FBFXPZ_FXGCMC)
.setText(R.id.tvMeasureContent, item.CLJH_CONTENT)
.setText(R.id.tvApplyUser, "")
.setVisible(R.id.tvGenerateForm, type == PointMeasureListActivity.TYPE_SURVEY_PLAN)
.setVisible(R.id.tvGenerateForm, isCLJH)
}
override fun onCreateViewHolder(

@ -190,6 +190,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:orientation="horizontal"
tools:visibility="visible"
android:visibility="gone">
<com.bingce.device.ui.widget.BingCeTextView

Loading…
Cancel
Save