Explorar el Código

1、地图点击创建违建点功能完成
2、移除违建点功能完成
3、移动违建点功能初步完成,但移入移除的匹配尚未完成

不会爬树的猴 hace 1 año
padre
commit
6eab9f5c24

+ 17 - 0
.idea/deploymentTargetDropDown.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetDropDown">
+    <runningDeviceTargetSelectedWithDropDown>
+      <Target>
+        <type value="RUNNING_DEVICE_TARGET" />
+        <deviceKey>
+          <Key>
+            <type value="SERIAL_NUMBER" />
+            <value value="10.88.88.128:5555" />
+          </Key>
+        </deviceKey>
+      </Target>
+    </runningDeviceTargetSelectedWithDropDown>
+    <timeTargetWasSelectedWithDropDown value="2023-06-13T03:38:25.482356Z" />
+  </component>
+</project>

+ 13 - 0
app/src/main/java/com/cr/common/CrUnitManager.kt

@@ -2,7 +2,10 @@ package com.cr.common
 
 import android.content.res.Resources
 import java.math.RoundingMode
+import java.text.DateFormat
 import java.text.DecimalFormat
+import java.text.SimpleDateFormat
+import java.util.*
 
 /**
  * 操作系统:MAC系统
@@ -87,6 +90,7 @@ class CrUnitManager {
             return count
         }
 
+
         /**
          * 检验经度数值是否符合要求
          * @param longitude String 经度值
@@ -107,5 +111,14 @@ class CrUnitManager {
             var regex = Regex("""^[\-\+]?([0-8]?\d{1}\.\d{1,5}|90\.0{1,5})${'$'}""")
             return regex.matches(latitude)
         }
+
+        /**
+         * 获取系统日期
+         * @return String 系统日期yyyyMMddHHmmss
+         */
+        fun toSystemDate():String{
+            var format = SimpleDateFormat("yyyyMMddHHmmss")
+            return format.format(Date())
+        }
     }
 }

+ 9 - 1
app/src/main/java/com/cr/cruav/AvMain.kt

@@ -94,6 +94,7 @@ class AvMain : CrActivity(), View.OnClickListener {
         tools_wx.setOnClickListener(this)
         tools_tools.setOnClickListener(this)
         tools_case_tools.setOnClickListener(this)
+        tools_append_point_from_map.setOnClickListener(this)
     }
 
     /**
@@ -267,7 +268,9 @@ class AvMain : CrActivity(), View.OnClickListener {
             R.id.tools_case_tools->{
                 showFragment(fragmentCaseTools!!)
             }
-
+            R.id.tools_append_point_from_map->{
+                CrApplication.getEventBus().post(EventMap(MapAction.MapTapAddWaypoint))
+            }
         }
     }
 
@@ -428,7 +431,12 @@ class AvMain : CrActivity(), View.OnClickListener {
 
         // todo: 2023/6/9 移动违建点
         override fun onMoveCasePoint() {
+            CrApplication.getEventBus().post(EventMap(MapAction.MapTapMoveWaypoing))
+        }
 
+        // todo: 2023/6/13 删除违建点
+        override fun onRemoveCasePoint() {
+            CrApplication.getEventBus().post(EventMap(MapAction.MapTapDeleteWaypoint))
         }
 
     }

+ 27 - 0
app/src/main/java/com/cr/map/CaseLocalPolygonModel.kt

@@ -0,0 +1,27 @@
+package com.cr.map
+
+import com.cr.pages.FragmentMap
+
+/**
+ * 操作系统:MAC系统
+ * 创建者:王成
+ * 创建日期:2023/6/12 16:37
+ * 描述:本地案件面模型
+ */
+class CaseLocalPolygonModel {
+    var name: String? = null // define: 2023/6/12 案件图斑的名称
+    var area: String? = null // define: 2023/6/12  案件图斑的面积
+    var coords: String? = null // define: 2023/6/12 案件图斑的坐标串
+    var type: String? = null // define: 2023/6/12 案件图斑是否已经匹配案件点
+
+    /**
+     * 默认初始化
+     * @constructor
+     */
+    constructor(){
+        this.name = ""
+        this.area = ""
+        this.coords = ""
+        this.type = FragmentMap.FIELD_CASE_POLYGON_BZ_VALUE_NO
+    }
+}

+ 174 - 0
app/src/main/java/com/cr/map/CaseModel.kt

@@ -0,0 +1,174 @@
+package com.cr.map
+
+import com.cr.common.CrUnitManager
+import com.cr.pages.FragmentMap
+
+/**
+ * 操作系统:MAC系统
+ * 创建者:王成
+ * 创建日期:2023/6/12 16:46
+ * 描述:案件模型
+ */
+class CaseModel {
+    var name: String? = null  // define: 2023/6/12 案件名称
+    var longitude: Double? = 0.0 // define: 2023/6/12 案件经度
+    var latitude: Double? = 0.0 // define: 2023/6/12 案件纬度
+    var altitude: Double? = 0.0 // define: 2023/6/12 案件高度
+    var angle: Double? = 0.0 // define: 2023/6/12 案件角度
+    var imgName: String? = "" // define: 2023/6/12 案件照片字符串
+    var date: String? = "" // define: 2023/6/12 创建日期
+    var isDown: Boolean? = false  // define: 2023/6/12 是否已下载
+    var imgArray: List<String>? = null // define: 2023/6/12 照片数组
+    var caseType: CaseType? = CaseType.Non // define: 2023/6/12 案件点类型
+    var joinPolygon: CaseLocalPolygonModel? = null // define: 2023/6/12 关联的案件图斑
+    var isCheck: Boolean? = false // define: 2023/6/12 是否已选中
+    var joinNetCaseAJHArray: List<String>? = null // define: 2023/6/12 关联的网络案件号数组
+
+    /**
+     * 默认初始化
+     * @constructor
+     */
+    constructor(){
+        this.name = CrUnitManager.toSystemDate()
+        this.imgName = ""
+        this.longitude = 0.0
+        this.latitude = 0.0
+        this.altitude = 0.0
+        this.angle = 0.0
+        this.isDown = false
+        this.isCheck = false
+        this.caseType = CaseType.Non
+        this.joinPolygon = CaseLocalPolygonModel()
+        this.joinNetCaseAJHArray = ArrayList()
+        this.imgArray = ArrayList()
+    }
+
+    /**
+     * 通过参数初始化
+     * @param longitude Double 经度
+     * @param latitude Double 纬度
+     * @param altitude Double 高度
+     * @param angle Double 角度
+     * @param caseType CaseType 类型
+     * @constructor
+     */
+    constructor(longitude:Double,latitude:Double,altitude:Double,angle:Double,caseType:CaseType):this(){
+        this.longitude = longitude
+        this.latitude = latitude
+        this.altitude = altitude
+        this.angle = angle
+        this.caseType = caseType
+    }
+
+    /**
+     * 通过属性初始化
+     * @param attribute Map<String, String>
+     * @constructor
+     */
+    constructor(attribute:Map<String,String>):this(){
+        this.name = attribute[FragmentMap.FIELD_CASE_NAME]
+        this.imgName = attribute[FragmentMap.FIELD_CASE_IMAGES]
+        this.date = attribute[FragmentMap.FIELD_CASE_RQ]
+        this.isDown = attribute[FragmentMap.FIELD_CASE_ISDOWN].equals("1")
+        this.longitude = attribute[FragmentMap.FIELD_CASE_LNG]?.toDouble()
+        this.latitude = attribute[FragmentMap.FIELD_CASE_LAT]?.toDouble()
+        this.altitude = attribute[FragmentMap.FIELD_CASE_ALT]?.toDouble()
+        this.angle = attribute[FragmentMap.FIELD_CASE_ANG]?.toDouble()
+        var mediaType = attribute[FragmentMap.FIELD_CASE_TYPE]
+        mediaType?.let {
+            when (it) {
+                FragmentMap.MEDIA_TYPE_WJ_NO -> {
+                    this.caseType = CaseType.MediaTypeWjNo
+                }
+                FragmentMap.MEDIA_TYPE_WJ_YES -> {
+                    this.caseType = CaseType.MediaTypeWjYes
+                }
+                FragmentMap.MEDIA_TYPE_REPEAT_NO -> {
+                    this.caseType = CaseType.MediaTypeRepeatFlightNo
+                }
+                FragmentMap.MEDIA_TYPE_REPEAT_YES -> {
+                    this.caseType = CaseType.MediaTypeRepeatFlightYes
+                }
+                else -> {
+                    this.caseType = CaseType.Non
+                }
+            }
+        }
+    }
+
+    /**
+     * 赋值属性
+     * @param attributes MutableMap<String, Any>
+     */
+    fun setAttributes(attributes:MutableMap<String,Any>){
+        attributes!!.let {
+            it[FragmentMap.FIELD_CASE_NAME] = this.name!!
+            it[FragmentMap.FIELD_CASE_LNG] = this.longitude!!.toString()
+            it[FragmentMap.FIELD_CASE_LAT] = this.latitude!!.toString()
+            it[FragmentMap.FIELD_CASE_ALT] = this.altitude!!.toString()
+            it[FragmentMap.FIELD_CASE_ANG] = this.angle!!.toString()
+            it[FragmentMap.FIELD_CASE_ISDOWN] = if (this.isDown == true) "1" else "0"
+            it[FragmentMap.FIELD_CASE_RQ] = this.date!!
+            it[FragmentMap.FIELD_CASE_IMAGES] = this.imgName!!
+            when(this.caseType){
+                CaseType.MediaTypeWjNo->{
+                    it[FragmentMap.FIELD_CASE_ISUP] = FragmentMap.MEDIA_TYPE_WJ_NO
+                }
+                CaseType.MediaTypeWjYes->{
+                    it[FragmentMap.FIELD_CASE_ISUP] = FragmentMap.MEDIA_TYPE_WJ_YES
+                }
+                CaseType.MediaTypeRepeatFlightNo->{
+                    it[FragmentMap.FIELD_CASE_ISUP] = FragmentMap.MEDIA_TYPE_REPEAT_NO
+                }
+                CaseType.MediaTypeRepeatFlightYes->{
+                    it[FragmentMap.FIELD_CASE_ISUP] = FragmentMap.MEDIA_TYPE_REPEAT_YES
+                }
+            }
+        }
+    }
+
+    /**
+     * 获取案件点的字符串表示
+     * @return String
+     */
+    fun getMediaTypeString():String{
+        when(this.caseType){
+            CaseType.MediaTypeWjNo->{
+                return FragmentMap.MEDIA_TYPE_WJ_NO
+            }
+            CaseType.MediaTypeWjYes->{
+                return FragmentMap.MEDIA_TYPE_WJ_YES
+            }
+            CaseType.MediaTypeRepeatFlightNo->{
+                return FragmentMap.MEDIA_TYPE_REPEAT_NO
+            }
+            CaseType.MediaTypeRepeatFlightYes->{
+                return FragmentMap.MEDIA_TYPE_REPEAT_YES
+            }
+        }
+        return ""
+    }
+
+    /**
+     * 根据案件点类型的字符串表示获取枚举表示
+     * @param typeString String 类型字符串
+     * @return CaseType 类型
+     */
+    fun getMediaType(typeString:String):CaseType{
+        return when (typeString) {
+            FragmentMap.MEDIA_TYPE_WJ_NO -> {
+                CaseType.MediaTypeWjNo
+            }
+            FragmentMap.MEDIA_TYPE_WJ_YES -> {
+                CaseType.MediaTypeWjYes
+            }
+            FragmentMap.MEDIA_TYPE_REPEAT_NO -> {
+                CaseType.MediaTypeRepeatFlightNo
+            }
+            FragmentMap.MEDIA_TYPE_REPEAT_YES -> {
+                CaseType.MediaTypeRepeatFlightYes
+            }
+            else -> CaseType.Non
+        }
+    }
+}

+ 54 - 0
app/src/main/java/com/cr/map/CaseType.kt

@@ -0,0 +1,54 @@
+package com.cr.map
+
+/**
+ * 操作系统:MAC系统
+ * 创建者:王成
+ * 创建日期:2023/6/12 17:09
+ * 描述:案件点类型
+ */
+enum class CaseType {
+    /**
+     * 未上传的案件点
+     */
+    MediaTypeWjNo,
+    /**
+     * 已上传的案件点
+     */
+    MediaTypeWjYes,
+    /**
+     * 未上传的复飞点
+     */
+    MediaTypeRepeatFlightNo,
+    /**
+     * 已上传的复飞点
+     */
+    MediaTypeRepeatFlightYes,
+    /**
+     * 未知类型
+     */
+    Non;
+
+    /**
+     * 转换为字符串
+     * @return String
+     */
+    override fun toString(): String {
+        when(this){
+            MediaTypeWjNo->{
+                return "未上报的违建点"
+            }
+            MediaTypeWjYes->{
+                return "已上报的违建点"
+            }
+            MediaTypeRepeatFlightNo->{
+                return "未上报的复飞点"
+            }
+            MediaTypeRepeatFlightYes->{
+                return "已上报的复飞点"
+            }
+            Non->{
+                return "未知"
+            }
+        }
+    }
+}

+ 24 - 0
app/src/main/java/com/cr/map/IFeatureModel.kt

@@ -0,0 +1,24 @@
+package com.cr.map
+
+import com.esri.arcgisruntime.data.Feature
+
+/**
+ * 操作系统:MAC系统
+ * 创建者:王成
+ * 创建日期:2023/6/12 16:32
+ * 描述:地理要素相关模型接口
+ */
+interface iFeatureModel<T> {
+    /**
+     * 通过地理要素初始化
+     * @param feature Feature 地理要素
+     * @return T 初始化
+     */
+    fun init(feature: Feature):T
+
+    /**
+     * 设置属性
+     * @param attribute Map<String, String> 属性值
+     */
+    fun setAttribute(attribute:Map<String,String>)
+}

+ 7 - 2
app/src/main/java/com/cr/map/MapAction.kt

@@ -48,6 +48,11 @@ enum class MapAction {
     MapTapSelectWaypoint,
 
     /**
+     * 删除违建点
+     */
+    MapTapDeleteWaypoint,
+
+    /**
      * 长度测量动作
      */
     EventSurveyLength,
@@ -63,9 +68,9 @@ enum class MapAction {
     EventSurveyClear,
 
     /**
-     * 删除违建点动作
+     * 删除全部案件点动作
      */
-    MapTapDeleteWaypoing,
+    MapTapDeleteAllWaypoing,
 
     /**
      * 移动违建点动作

+ 39 - 0
app/src/main/java/com/cr/map/MapTouch.kt

@@ -34,6 +34,18 @@ class MapTouch constructor(context: Context, mapView: MapView) :
 
         // todo: 2023/6/7 查询位置返回
         fun onQueryLocation(location:Point,longitude:String,latitude:String)
+
+        // todo: 2023/6/12 添加案件点回调
+        fun onAppendWaypoint(location:Point,longitude: String,latitude: String)
+
+        // todo: 2023/6/14 删除案件点
+        fun onRemoveWaypoint(location:Point)
+
+        // todo: 2023/6/14 移动案件点
+        fun onMoveWaypointBySelect(location: Point)
+
+        // todo: 2023/6/14 移动结束
+        fun onMoveWaypointToEnd(location: Point)
     }
 
 
@@ -87,6 +99,33 @@ class MapTouch constructor(context: Context, mapView: MapView) :
                 var format:DecimalFormat = DecimalFormat("#.######")
                 if(listener != null) listener?.onQueryLocation(mapPoint!!,format.format(queryPoint.x),format.format(queryPoint.y))
             }
+            // todo: 2023/6/12 添加案件点
+            MapAction.MapTapAddWaypoint->{
+                var mapPoint = mapView?.screenToLocation(android.graphics.Point(e!!.x.toInt(),e.y.toInt()))
+                var queryPoint = GeometryEngine.project(mapPoint, SpatialReference.create(4326)) as Point
+                var format:DecimalFormat = DecimalFormat("#.######")
+                if(listener != null) listener?.onAppendWaypoint(mapPoint!!,format.format(queryPoint.x),format.format(queryPoint.y))
+                this.action = MapAction.MapTapNon
+            }
+            // todo: 2023/6/14 删除案件点
+            MapAction.MapTapDeleteWaypoint->{
+                var mapPoint = mapView?.screenToLocation(android.graphics.Point(e!!.x.toInt(),e.y.toInt()))
+                if(listener != null) listener?.onRemoveWaypoint(mapPoint!!)
+                this.action = MapAction.MapTapNon
+            }
+            // todo: 2023/6/14 移动案件点
+            MapAction.MapTapMoveWaypoing->{
+                var mapPoint = mapView?.screenToLocation(android.graphics.Point(e!!.x.toInt(),e.y.toInt()))
+                if(listener != null) listener?.onMoveWaypointBySelect(mapPoint!!)
+            }
+            // todo: 2023/6/14 移动案件点结束
+            MapAction.MapTapMovingWaypoint->{
+                var mapPoint = mapView?.screenToLocation(android.graphics.Point(e!!.x.toInt(),e.y.toInt()))
+                if(listener != null) listener?.onMoveWaypointToEnd(mapPoint!!)
+                this.action = MapAction.MapTapNon
+            }
+
+
         }
         return true
     }

+ 31 - 0
app/src/main/java/com/cr/models/ResultModel.kt

@@ -0,0 +1,31 @@
+package com.cr.models
+
+/**
+ * 操作系统:MAC系统
+ * 创建者:王成
+ * 创建日期:2023/6/13 16:19
+ * 描述:返回结果
+ */
+class ResultModel {
+    var isSuccess:Boolean?=false  // define: 2023/6/13 是否成功
+    var message:String?="" // define: 2023/6/13 消息内容
+
+    /**
+     * 初始化
+     * @param isSuccess Boolean
+     * @param message String
+     * @constructor
+     */
+    constructor(isSuccess:Boolean,message:String){
+        this.isSuccess = isSuccess
+        this.message = message
+    }
+}
+
+/**
+ * 完成接口调用
+ */
+interface iCompletion{
+    // todo: 2023/6/13 完成回调
+    fun onCompletion(result:ResultModel)
+}

+ 12 - 0
app/src/main/java/com/cr/pages/FragmentCaseTools.kt

@@ -46,6 +46,9 @@ class FragmentCaseTools : CrNavigationFragment(), CrButton.OnClickListener,
 
         // todo: 2023/6/9 移动案件点
         fun onMoveCasePoint()
+
+        // todo: 2023/6/13 删除违建点
+        fun onRemoveCasePoint()
     }
 
     private var btnSave: CrButton? = null  // define: 2023/6/9 保存
@@ -54,6 +57,7 @@ class FragmentCaseTools : CrNavigationFragment(), CrButton.OnClickListener,
     private var btnReset: CrButton? = null  // define: 2023/6/9 重新绘制
     private var btnMovePoint: CrButton? = null // define: 2023/6/9 移动案件点
     private var switchDraw: Switch? = null // define: 2023/6/9 开启绘制
+    private var btnRemoveCasePoint:CrButton?=null  // define: 2023/6/13 删除违建点
 
     // todo: 2023/6/9 操作监听
     private var listener: OnOperationListener? = null
@@ -94,12 +98,14 @@ class FragmentCaseTools : CrNavigationFragment(), CrButton.OnClickListener,
         btnUndo = mainView?.findViewById(R.id.case_undo)
         btnReset = mainView?.findViewById(R.id.case_reset)
         btnMovePoint = mainView?.findViewById(R.id.case_move_point)
+        btnRemoveCasePoint = mainView?.findViewById(R.id.case_remove_point)
         // todo: 2023/6/9 设置监听
         btnSave?.setListener(this)
         btnDelete?.setListener(this)
         btnUndo?.setListener(this)
         btnReset?.setListener(this)
         btnMovePoint?.setListener(this)
+        btnRemoveCasePoint?.setListener(this)
         switchDraw?.setOnCheckedChangeListener(this)
     }
 
@@ -118,6 +124,7 @@ class FragmentCaseTools : CrNavigationFragment(), CrButton.OnClickListener,
         when (view?.id) {
             R.id.case_save -> {
                 if (listener != null) listener?.onSave()
+                switchDraw?.isChecked = false
             }
             R.id.cases_delete -> {
                 if (listener != null) listener?.onRemove()
@@ -130,6 +137,11 @@ class FragmentCaseTools : CrNavigationFragment(), CrButton.OnClickListener,
             }
             R.id.case_move_point->{
                 if(listener != null) listener?.onMoveCasePoint()
+                switchDraw?.isChecked = false
+            }
+            R.id.case_remove_point->{
+                if(listener != null) listener?.onRemoveCasePoint()
+                switchDraw?.isChecked = false
             }
         }
     }

+ 455 - 81
app/src/main/java/com/cr/pages/FragmentMap.kt

@@ -15,6 +15,8 @@ import com.cr.data.CrUtil
 import com.cr.dialog.DialogInput
 import com.cr.dialog.DialogNormal
 import com.cr.map.*
+import com.cr.models.ResultModel
+import com.cr.models.iCompletion
 import com.esri.arcgisruntime.arcgisservices.LabelDefinition
 import com.esri.arcgisruntime.data.Feature
 import com.esri.arcgisruntime.data.FeatureTable
@@ -87,23 +89,29 @@ class FragmentMap : CrAnimationFragment() {
     val MEDIA_TYPE_REPEAT_YES = "5";   //  define: 2023/4/13 已上传的复飞案件
 
     // todo: 2023/4/14 字段相关常量
-    val FIELD_NET_CASE_POLYGON_AJH = "AJH";   //  define: 2023/4/13 网络案件的案件编号
-    val FIELD_CASE_POLYGON_ANJID = "ANJID";   //  define: 2023/4/13 案件ID
-    val FIELD_CASE_POLYGON_MJ = "MJ";   //  define: 2023/4/13 面积
-    val FIELD_CASE_POLYGON_BZ = "BZ";   //  define: 2023/4/13 违建面的类型 0--代表未匹配 1--代表已匹配
-    val FIELD_CASE_POLYGON_BZ_VALUE_NO = "0";   //  define: 2023/4/13 未匹配
-    val FIELD_CASE_POLYGON_BZ_VALUE_YES = "1";   //  define: 2023/4/13 已匹配
-    val FIELD_CASE_NAME = "NAME";   //  define: 2023/4/13 名称字段
-    val FIELD_CASE_IMAGES = "IMAGES";   //  define: 2023/4/13 图片集合字段
-    val FIELD_CASE_RQ = "RQ";   //  define: 2023/4/13 日期字段
-    val FIELD_CASE_LAT = "LAT";   //  define: 2023/4/13 纬度字段
-    val FIELD_CASE_LNG = "LNG";   //  define: 2023/4/13 经度字段
-    val FIELD_CASE_ISUP = "ISUP";   //  define: 2023/4/13 是否上传
-    val FIELD_CASE_ALT = "ALT";   //  define: 2023/4/13 高度字段
-    val FIELD_CASE_ANG = "ANG";   //  define: 2023/4/13 角度字段
-    val FIELD_CASE_TYPE = "TYPE";   //  define: 2023/4/13 类型字段
-    val FIELD_CASE_ISDOWN = "ISDOWN";   //  define: 2023/4/13 是否下载
-
+    companion object{
+        val FIELD_NET_CASE_POLYGON_AJH = "AJH";   //  define: 2023/4/13 网络案件的案件编号
+        val FIELD_CASE_POLYGON_ANJID = "ANJID";   //  define: 2023/4/13 案件ID
+        val FIELD_CASE_POLYGON_MJ = "MJ";   //  define: 2023/4/13 面积
+        val FIELD_CASE_POLYGON_BZ = "BZ";   //  define: 2023/4/13 违建面的类型 0--代表未匹配 1--代表已匹配
+        val FIELD_CASE_POLYGON_BZ_VALUE_NO = "0";   //  define: 2023/4/13 未匹配
+        val FIELD_CASE_POLYGON_BZ_VALUE_YES = "1";   //  define: 2023/4/13 已匹配
+        val FIELD_CASE_NAME = "NAME";   //  define: 2023/4/13 名称字段
+        val FIELD_CASE_IMAGES = "IMAGES";   //  define: 2023/4/13 图片集合字段
+        val FIELD_CASE_RQ = "RQ";   //  define: 2023/4/13 日期字段
+        val FIELD_CASE_LAT = "LAT";   //  define: 2023/4/13 纬度字段
+        val FIELD_CASE_LNG = "LNG";   //  define: 2023/4/13 经度字段
+        val FIELD_CASE_ISUP = "ISUP";   //  define: 2023/4/13 是否上传
+        val FIELD_CASE_ALT = "ALT";   //  define: 2023/4/13 高度字段
+        val FIELD_CASE_ANG = "ANG";   //  define: 2023/4/13 角度字段
+        val FIELD_CASE_TYPE = "TYPE";   //  define: 2023/4/13 类型字段
+        val FIELD_CASE_ISDOWN = "ISDOWN";   //  define: 2023/4/13 是否下载
+
+        val MEDIA_TYPE_WJ_NO = "0"  // define: 2023/6/12 未上传的案件点
+        val MEDIA_TYPE_WJ_YES = "1"; // define: 2023/6/12 已上传的案件点
+        val MEDIA_TYPE_REPEAT_NO = "4" // define: 2023/6/12 未上传的复飞点
+        val MEDIA_TYPE_REPEAT_YES = "5" // define: 2023/6/12 已上传的复飞点
+    }
 
     // todo: 2023/4/13 标志相关
     private var markChange: EventMarkChange? = null
@@ -115,7 +123,7 @@ class FragmentMap : CrAnimationFragment() {
     private var gLayerAirplaneHomeLocation: GraphicsOverlay? = null // define: 2023/4/13 飞行器返航点位置图层
     private var gLayerAirplaneLine: GraphicsOverlay? = null // define: 2023/4/13 飞行航线图层
     private var gLayerHistoryAirplaneLine: GraphicsOverlay? = null // define: 2023/4/13 历史航线图层
-    private var gLayerTemp:GraphicsOverlay?=null  // define: 2023/6/5 临时展示内容图层
+    private var gLayerTemp: GraphicsOverlay? = null  // define: 2023/6/5 临时展示内容图层
 
     // todo: 2023/4/13 样式相关
     private var symbolAirplaneLine: SimpleLineSymbol? = null // define: 2023/4/13 飞行航线样式
@@ -213,34 +221,37 @@ class FragmentMap : CrAnimationFragment() {
      */
     private var sketchGeometryChangeListener =
         SketchGeometryChangedListener { p0 ->
-            if(p0!!.geometry.geometryType == GeometryType.POLYLINE){
+            if (p0!!.geometry.geometryType == GeometryType.POLYLINE) {
                 // todo: 2023/6/5 清除已展示内容
                 gLayerTemp?.graphics?.clear()
                 var polyline = p0.geometry as Polyline
                 var pointCollection = PointCollection(SpatialReference.create(3857))
-                if(polyline.parts.size >0) {
-                    for(point in polyline.parts[0].points){
+                if (polyline.parts.size > 0) {
+                    for (point in polyline.parts[0].points) {
                         pointCollection.add(point)
-                        if(pointCollection.size >=2){
+                        if (pointCollection.size >= 2) {
                             var polyline = Polyline(pointCollection)
                             // todo: 2023/6/5 计算长度
                             var lineLength = GeometryEngine.length(polyline)
                             // todo: 2023/6/5 添加标签
-                            appendMeasureLabel(point,CrUnitManager.formatLength(lineLength))
+                            appendMeasureLabel(point, CrUnitManager.formatLength(lineLength))
                         }
                     }
                 }
-            }else if(p0!!.geometry.geometryType == GeometryType.POLYGON){
+            } else if (p0!!.geometry.geometryType == GeometryType.POLYGON) {
                 // todo: 2023/6/6 清除临时标签
                 gLayerTemp?.graphics?.clear()
                 var polygon = p0.geometry as Polygon
-                if(polygon.parts.size > 0){
-                    if(CrUnitManager.querySizeByIterable(polygon.parts[0].points) >=3){
+                if (polygon.parts.size > 0) {
+                    if (CrUnitManager.querySizeByIterable(polygon.parts[0].points) >= 3) {
                         // todo: 2023/6/6 计算面积
                         var area = GeometryEngine.area(polygon)
                         area = abs(area)
                         // todo: 2023/6/6 添加标签
-                        appendMeasureLabel(polygon.parts[0].startPoint,CrUnitManager.formatArea(area))
+                        appendMeasureLabel(
+                            polygon.parts[0].startPoint,
+                            CrUnitManager.formatArea(area)
+                        )
                     }
                 }
             }
@@ -251,26 +262,26 @@ class FragmentMap : CrAnimationFragment() {
      * @param location Point 位置
      * @param label String 标签内容
      */
-    private fun appendMeasureLabel(location:Point,label:String){
+    private fun appendMeasureLabel(location: Point, label: String) {
         var tSymbol = TextSymbol();
-        tSymbol.color = Color.rgb(17,46,114)
+        tSymbol.color = Color.rgb(17, 46, 114)
         tSymbol.text = label
         tSymbol.size = 10f
         tSymbol.haloColor = Color.WHITE
         tSymbol.haloWidth = 2f
         tSymbol.fontWeight = TextSymbol.FontWeight.BOLD
         tSymbol.offsetY = 20f
-        tSymbol.backgroundColor = Color.argb(200,13,49,130)
-        var graphic = Graphic(location,tSymbol)
+        tSymbol.backgroundColor = Color.argb(200, 13, 49, 130)
+        var graphic = Graphic(location, tSymbol)
         gLayerTemp?.graphics?.add(graphic)
     }
 
     /**
      * 设置草图编辑器
      */
-    private fun setSketchEditor(){
+    private fun setSketchEditor() {
         // todo: 2023/4/21 获取样式
-        var sketchStyle:SketchStyle = sketchEditor!!.sketchStyle
+        var sketchStyle: SketchStyle = sketchEditor!!.sketchStyle
         // todo: 2023/4/21 设置点符号样式
         var markerSymbol = SimpleMarkerSymbol()
         markerSymbol.size = 10f
@@ -306,9 +317,28 @@ class FragmentMap : CrAnimationFragment() {
         }
 
         // todo: 2023/6/7 查询地理位置回调
-        override fun onQueryLocation(location:Point,longitude: String, latitude: String) {
-//            showInformation(String.format("经度:%s 纬度:%s",longitude,latitude))
-            appendLocation(location,longitude,latitude)
+        override fun onQueryLocation(location: Point, longitude: String, latitude: String) {
+            appendLocation(location, longitude, latitude)
+        }
+
+        // todo: 2023/6/12 添加案件点
+        override fun onAppendWaypoint(location: Point, longitude: String, latitude: String) {
+            caseAppendWaypointToMap(location,longitude,latitude)
+        }
+
+        // todo: 2023/6/14 删除案件点
+        override fun onRemoveWaypoint(location: Point) {
+            caseRemoveCaseWaypoing(location)
+        }
+
+        // todo: 2023/6/14 选择移动的案件点
+        override fun onMoveWaypointBySelect(location: Point) {
+            caseMoveWaypointBySelect(location)
+        }
+
+        // todo: 2023/6/14 移动完成
+        override fun onMoveWaypointToEnd(location: Point) {
+            caseMoveWaypointToEnd(location)
         }
     }
 
@@ -876,18 +906,19 @@ class FragmentMap : CrAnimationFragment() {
      * @param longitude String 经度
      * @param latitude String 纬度
      */
-    private fun appendLocation(location:Point,longitude:String,latitude:String){
+    private fun appendLocation(location: Point, longitude: String, latitude: String) {
         // todo: 2023/6/7 点符号样式
-        var markSymbol:SimpleMarkerSymbol = SimpleMarkerSymbol()
-        markSymbol.color = Color.argb(255,0,0,255)
+        var markSymbol: SimpleMarkerSymbol = SimpleMarkerSymbol()
+        markSymbol.color = Color.argb(255, 0, 0, 255)
         markSymbol.size = 14.0f
         markSymbol.style = SimpleMarkerSymbol.Style.CIRCLE
-        markSymbol.outline = SimpleLineSymbol(SimpleLineSymbol.Style.SOLID,Color.argb(255,255,255,255),1.0f)
+        markSymbol.outline =
+            SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.argb(255, 255, 255, 255), 1.0f)
         // todo: 2023/6/7 创建点符号
-        var graphic = Graphic(location,markSymbol)
+        var graphic = Graphic(location, markSymbol)
         gLayerTemp?.graphics?.add(graphic)
         // todo: 2023/6/7 添加标注
-        appendMeasureLabel(location,String.format("经度:%s   纬度:%s",longitude,latitude))
+        appendMeasureLabel(location, String.format("经度:%s   纬度:%s", longitude, latitude))
     }
 
     /**
@@ -895,20 +926,19 @@ class FragmentMap : CrAnimationFragment() {
      * @param longitude String 经度值
      * @param latitude String 纬度值
      */
-    private fun appendWGS84PointToMap(longitude:String,latitude:String){
+    private fun appendWGS84PointToMap(longitude: String, latitude: String) {
         var lng = longitude.toDouble()
         var lat = latitude.toDouble()
-        var wgs84Point = Point(lng,lat, SpatialReference.create(4326))
-        var location = GeometryEngine.project(wgs84Point,mMap?.spatialReference) as Point
-        appendLocation(location,longitude,latitude)
+        var wgs84Point = Point(lng, lat, SpatialReference.create(4326))
+        var location = GeometryEngine.project(wgs84Point, mMap?.spatialReference) as Point
+        appendLocation(location, longitude, latitude)
     }
 
 
-
     /**
      * 测量长度
      */
-    private fun measureLength(){
+    private fun measureLength() {
         CrUtil.showMessage("地图上点击开始测量!")
         sketchEditor?.let {
             it.stop()
@@ -918,7 +948,7 @@ class FragmentMap : CrAnimationFragment() {
             model.isAllowPartSelection = false
             model.isContextMenuEnabled = false
             model.isRequireSelectionBeforeDrag = true
-            it.start(SketchCreationMode.POLYLINE,model)
+            it.start(SketchCreationMode.POLYLINE, model)
             it.opacity = 1.0f
             // todo: 2023/4/21 设置监听
             it.addGeometryChangedListener(sketchGeometryChangeListener)
@@ -928,7 +958,7 @@ class FragmentMap : CrAnimationFragment() {
     /**
      * 面积测量
      */
-    private fun measureArea(){
+    private fun measureArea() {
         CrUtil.showMessage("地图上点击开始测量!")
         sketchEditor?.let {
             it.stop()
@@ -938,7 +968,7 @@ class FragmentMap : CrAnimationFragment() {
             model.isAllowPartSelection = false
             model.isContextMenuEnabled = false
             model.isRequireSelectionBeforeDrag = true
-            it.start(SketchCreationMode.POLYGON,model)
+            it.start(SketchCreationMode.POLYGON, model)
             it.opacity = 1.0f
             // todo: 2023/6/6 设置监听
             it.addGeometryChangedListener(sketchGeometryChangeListener)
@@ -948,29 +978,30 @@ class FragmentMap : CrAnimationFragment() {
     /**
      * 输入坐标定位监听
      */
-    private var inputLocationToMapListener:DialogInput.DialogInputListener = object:DialogInput.DialogInputListener{
-        // todo: 2023/6/7 点击完成按钮回调
-        override fun completion(valueOne: String, valueTwo: String, self: DialogInput) {
-            if(!CrUnitManager.checkLongitude(valueOne)){
-                CrUtil.showMessage("输入的经度值不符合要求!")
-            }else if (!CrUnitManager.checkLatitude(valueTwo)){
-                CrUtil.showMessage("输入的纬度值不符合要求!")
-            }else{
-                self.dismiss()
-                // todo: 2023/6/8 添加到地图中
-                appendWGS84PointToMap(valueOne,valueTwo)
+    private var inputLocationToMapListener: DialogInput.DialogInputListener =
+        object : DialogInput.DialogInputListener {
+            // todo: 2023/6/7 点击完成按钮回调
+            override fun completion(valueOne: String, valueTwo: String, self: DialogInput) {
+                if (!CrUnitManager.checkLongitude(valueOne)) {
+                    CrUtil.showMessage("输入的经度值不符合要求!")
+                } else if (!CrUnitManager.checkLatitude(valueTwo)) {
+                    CrUtil.showMessage("输入的纬度值不符合要求!")
+                } else {
+                    self.dismiss()
+                    // todo: 2023/6/8 添加到地图中
+                    appendWGS84PointToMap(valueOne, valueTwo)
+                }
             }
-        }
 
-        // todo: 2023/6/7 点击取消按钮回调
-        override fun close() {
+            // todo: 2023/6/7 点击取消按钮回调
+            override fun close() {
+            }
         }
-    }
 
     /**
      * 开始绘制案件图斑
      */
-    private fun caseStartDraw(){
+    private fun caseStartDraw() {
         CrUtil.showMessage("地图上点击开始绘制!")
         sketchEditor?.let {
             it.stop()
@@ -980,12 +1011,330 @@ class FragmentMap : CrAnimationFragment() {
             model.isAllowPartSelection = true
             model.isContextMenuEnabled = false
             model.isRequireSelectionBeforeDrag = true
-            it.start(SketchCreationMode.POLYGON,model)
+            it.start(SketchCreationMode.POLYGON, model)
             it.opacity = 1.0f
         }
     }
 
     /**
+     * 保存编辑的案件图斑
+     */
+    private fun caseSave() {
+        var geo = sketchEditor?.geometry
+        if (geo != null && geo.geometryType == GeometryType.POLYGON) {
+            var polygon = geo as Polygon
+            if (CrUnitManager.querySizeByIterable(polygon.parts[0].points) < 4) {
+                showWarning("提交保存的要素少于4个点,无法提交!")
+            } else {
+                // todo: 2023/6/12 查询关联的案件点
+                var queryParams = QueryParameters()
+                queryParams.geometry = polygon
+                queryParams.spatialRelationship = QueryParameters.SpatialRelationship.CONTAINS
+                queryParams.whereClause = String.format("%s='%s' or %s='%s'",FIELD_CASE_ISUP,MEDIA_TYPE_WJ_NO,FIELD_CASE_ISUP,MEDIA_TYPE_WJ_YES)
+                var queryAsync = fTableMedia?.queryFeaturesAsync(queryParams)
+                queryAsync?.addDoneListener(Runnable {
+                    if(queryAsync.isDone){
+                        // todo: 2023/6/12 获取查询结果
+                        var featureResult = queryAsync.get().iterator()
+                        var features = ArrayList<Feature>()
+                        while (featureResult.hasNext()){
+                            features.add(featureResult.next())
+                        }
+                        // todo: 2023/6/12 如果存在违建点 则赋值 否则为 空
+                        var caseId = ""
+                        if(features.size > 0){
+                            caseId = features[0].attributes[FIELD_CASE_NAME].toString()
+                        }
+                        // todo: 2023/6/12 计算面积 并添加要素到图层
+                        var area = abs(GeometryEngine.area(polygon))*0.0015
+                        var wjFeature = fTableCasePolygon?.createFeature()
+                        wjFeature!!.let {
+                            it.attributes[FIELD_CASE_POLYGON_ANJID] = caseId
+                            it.attributes[FIELD_CASE_POLYGON_MJ]= area
+                            if(caseId == ""){
+                                it.attributes[FIELD_CASE_POLYGON_BZ] = FIELD_CASE_POLYGON_BZ_VALUE_NO
+                            }else{
+                                it.attributes[FIELD_CASE_POLYGON_BZ] = FIELD_CASE_POLYGON_BZ_VALUE_YES
+                            }
+                            it.geometry = polygon
+                            var appendAsync = fTableCasePolygon?.addFeatureAsync(it)
+                            appendAsync?.addDoneListener(Runnable{
+                                try{
+                                    if(appendAsync.isDone){
+                                        showInformation("案件保存成功!")
+                                        sketchEditor?.stop()
+                                    }
+                                }catch (ex:java.lang.IllegalArgumentException){
+                                    showError("案件保存失败!")
+                                }
+                            })
+                        }
+                    }
+                })
+            }
+        } else {
+            showWarning("提交保存的要素不符合要求!")
+        }
+    }
+
+    /**
+     * 删除保存的案件图斑
+     */
+    private fun caseDelete(){
+        var queryParameters = QueryParameters()
+        queryParameters.whereClause = "1=1"
+        var queryAsync = fTableCasePolygon?.queryFeaturesAsync(queryParameters)
+        queryAsync?.addDoneListener(Runnable {
+            try{
+                if(queryAsync.isDone){
+                    var deleteAsync = fTableCasePolygon?.deleteFeaturesAsync(queryAsync.get())
+                    deleteAsync?.addDoneListener(Runnable{
+                        try {
+                            if(deleteAsync.isDone){
+                                showInformation("删除成功!")
+                            }
+                        }catch (ex:java.lang.IllegalArgumentException){
+                            showError("删除失败!")
+                        }
+                    })
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                showError("删除失败!")
+            }
+        })
+    }
+
+    /**
+     * 添加案件点到地图
+     * @param location Point 点位置
+     * @param longitude String 经度
+     * @param latitude String 纬度
+     */
+    private fun caseAppendWaypointToMap(location: Point,longitude: String,latitude: String){
+        // todo: 2023/6/13 创建案件点模型
+        var caseModel = CaseModel(longitude.toDouble(),latitude.toDouble(),0.0,0.0,CaseType.MediaTypeWjNo)
+        // todo: 2023/6/13 创建案件点图元
+        var caseFeature = fTableMedia?.createFeature()
+        // todo: 2023/6/13 添加属性
+        caseModel.setAttributes(caseFeature!!.attributes)
+        // todo: 2023/6/13 设置要素空间图元
+        caseFeature.geometry = location
+        // todo: 2023/6/13 添加到地图中
+        var appendAsync = fTableMedia?.addFeatureAsync(caseFeature)
+        appendAsync?.addDoneListener(Runnable {
+            try{
+                if(appendAsync.isDone){
+                    fLayerMedia?.clearSelection()
+                    fLayerMedia?.selectFeature(caseFeature)
+                    caseUpdatePolygonByFeature(caseFeature,true,object:iCompletion{
+                        override fun onCompletion(result: ResultModel) {
+                            if (result.isSuccess == true){
+                                CrUtil.showMessage(String.format("案件点追加成功 %s",caseFeature.attributes[FIELD_CASE_NAME]))
+                            }else{
+                                showError(result.message!!)
+                            }
+                        }
+                    })
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                showError("案件点添加错误!")
+            }
+        })
+    }
+
+    /**
+     * 更新案件点对应的案件对象
+     * @param geom Feature 案件点
+     * @param isAppend Boolean ture表示为追加案件点 false表示删除案件点
+     * @param callback iCompletion 回调
+     */
+    private fun caseUpdatePolygonByFeature(geom:Feature,isAppend:Boolean,callback:iCompletion){
+        // todo: 2023/6/13 获取案件ID
+        val caseId = geom.attributes[FIELD_CASE_NAME]
+        // todo: 2023/6/13 先进行空间查询 查询案件点对应的案件面
+        var queryParameters = QueryParameters()
+        queryParameters.geometry = geom.geometry
+        queryParameters.spatialRelationship = QueryParameters.SpatialRelationship.INTERSECTS
+        queryParameters.whereClause = "1=1"
+        var queryAsync = fTableCasePolygon!!.queryFeaturesAsync(queryParameters)
+        queryAsync?.addDoneListener(Runnable{
+            try {
+                if(queryAsync.isDone){
+                    var features = queryAsync.get()
+                    for(fea in features){
+                        if(isAppend){
+                            fea.attributes[FIELD_CASE_POLYGON_ANJID] = caseId
+                            fea.attributes[FIELD_CASE_POLYGON_BZ] = FIELD_CASE_POLYGON_BZ_VALUE_YES
+                        }else{
+                            fea.attributes[FIELD_CASE_POLYGON_ANJID] = ""
+                            fea.attributes[FIELD_CASE_POLYGON_BZ] = FIELD_CASE_POLYGON_BZ_VALUE_NO
+                        }
+                    }
+                    // todo: 2023/6/13 更新
+                    var updateAsync = fTableCasePolygon!!.updateFeaturesAsync(features)
+                    updateAsync?.addDoneListener(Runnable {
+                        try {
+                            if(updateAsync.isDone){
+                                // todo: 2023/6/13 更新完成
+                                if(callback != null) callback.onCompletion(ResultModel(true,"成功!"))
+                            }
+                        }catch (ex:java.lang.IllegalArgumentException){
+                            if(callback != null) callback.onCompletion(ResultModel(false,"案件对象更新失败!"))
+                        }
+                    })
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                if(callback != null) callback.onCompletion(ResultModel(false,"案件对象查询失败!"))
+            }
+        })
+    }
+
+    /**
+     * 删除案件点
+     * @param queryPoint Point 查询产靠位置
+     */
+    private fun caseRemoveCaseWaypoing(queryPoint:Point){
+        // todo: 2023/6/14 创建缓冲区
+        var queryGeometry = GeometryEngine.buffer(queryPoint,10.0)
+        // todo: 2023/6/14 设置查询参数
+        var queryParameters = QueryParameters()
+        queryParameters.spatialRelationship = QueryParameters.SpatialRelationship.CONTAINS
+        queryParameters.geometry = queryGeometry
+        queryParameters.whereClause = "1=1"
+        // todo: 2023/6/14 开始查询
+        var identifyAsync = fTableMedia?.queryFeaturesAsync(queryParameters)
+        identifyAsync?.addDoneListener(Runnable{
+            try {
+                if (identifyAsync.isDone){
+                    var queryFeatures = identifyAsync.get()
+                    var features = mutableListOf<Feature>()
+                    for (fea in queryFeatures){
+                        features.add(fea)
+                    }
+                    if(features.size >0){
+                        var dig = DialogNormal(context!!)
+                        dig.setTitle("提示")
+                        dig.setMessage("删除后将无法恢复,确定删除吗?")
+                        dig.setButtonsText("删除","取消")
+                        dig.setListener(object :DialogNormal.DialogNormalListener{
+                            // todo: 2023/6/14 确认删除
+                            override fun completion() {
+                                var deleteAsync = fTableMedia?.deleteFeaturesAsync(features)
+                                deleteAsync?.addDoneListener(Runnable {
+                                    try {
+                                        if(deleteAsync.isDone){
+                                            showInformation("案件点删除成功!")
+                                        }
+                                    }catch (ex:java.lang.IllegalArgumentException){
+                                        showError("案件点删除失败!")
+                                    }
+                                })
+                            }
+
+                            // todo: 2023/6/14 关闭
+                            override fun close() {
+                            }
+
+                        })
+                        dig.show()
+                    }else{
+                        showWarning("未查询到任何案件点!")
+                    }
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                showError("查询错误,无法删除!")
+            }
+        })
+    }
+
+    /**
+     * 移动案件点
+     */
+    private fun caseMoveWaypoint(){
+        CrUtil.showMessage("选择需要移动的案件点!")
+        mapTouch?.setAction(MapAction.MapTapMoveWaypoing)
+    }
+
+    /**
+     * 选择移动的案件点
+     * @param location Point 点击位置
+     */
+    private fun caseMoveWaypointBySelect(location: Point){
+        // todo: 2023/6/14 设置查询区域
+        var queryGeometry = GeometryEngine.buffer(location,10.0)
+        // todo: 2023/6/14 设置查询条件
+        var queryParameters = QueryParameters()
+        queryParameters.geometry = queryGeometry
+        queryParameters.spatialRelationship = QueryParameters.SpatialRelationship.CONTAINS
+        queryParameters.whereClause = "1=1"
+        // todo: 2023/6/14 开始查询
+        var queryAsync = fTableMedia?.queryFeaturesAsync(queryParameters)
+        queryAsync?.addDoneListener(Runnable{
+            try {
+                if(queryAsync.isDone){
+                    var features = mutableListOf<Feature>()
+                    for(fea in queryAsync.get()){
+                        features.add(fea)
+                    }
+                    if(features.size == 0){
+                        CrUtil.showMessage("未查询到任何违建点!")
+                    }else{
+                        fLayerMedia?.clearSelection()
+                        fLayerMedia?.selectFeature(features[0])
+                        CrUtil.showMessage("地图点击确定移动位置!")
+                        mapTouch?.setAction(MapAction.MapTapMovingWaypoint)
+                    }
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                showError("案件点查询错误!")
+            }
+        })
+    }
+
+    /**
+     * 案件点移动结束
+     * @param location Point 移动后位置
+     */
+    private fun caseMoveWaypointToEnd(location: Point){
+        var asyncSelected = fLayerMedia?.selectedFeaturesAsync
+        asyncSelected?.addDoneListener(Runnable {
+            try {
+                if(asyncSelected.isDone){
+                    var features =  mutableListOf<Feature>()
+                    for(fea in asyncSelected.get()){
+                        features.add(fea)
+                    }
+                    if(features.size == 0){
+                        showError("未获取到可移动违建点,无法完成移动操作!")
+                    }else{
+                        features[0].geometry = location
+                        var asyncUpdate = fTableMedia?.updateFeatureAsync(features[0])
+                        asyncUpdate?.addDoneListener(Runnable{
+                            try {
+                                if (asyncUpdate.isDone){
+                                    caseUpdatePolygonByFeature(features[0],true,object:iCompletion{
+                                        override fun onCompletion(result: ResultModel) {
+                                            if(result.isSuccess == true){
+                                                CrUtil.showMessage("移动完成!")
+                                            }else{
+                                                showError(result.message!!)
+                                            }
+                                        }
+                                    })
+                                }
+                            }catch (ex:java.lang.IllegalArgumentException){
+                                showError("移动错误,无法完成移动操作!")
+                            }
+                        })
+                    }
+                }
+            }catch (ex:java.lang.IllegalArgumentException){
+                showError("获取可移动违建点错误,无法完成移动操作!")
+            }
+        })
+    }
+
+    /**
      * 显示警告信息
      * @param warning String 警告消息
      */
@@ -1080,19 +1429,19 @@ class FragmentMap : CrAnimationFragment() {
                 mapTouch?.setQueryLayer(fLayerMark!!, MapAction.MapTapSelectMark)
             }
             // todo: 2023/4/21 删除选择的标志
-            MapAction.EventMarkDelete->{
+            MapAction.EventMarkDelete -> {
                 doodleSelectFeature(fLayerMark!!)
             }
             // todo: 2023/4/21 长度测量
-            MapAction.EventSurveyLength->{
+            MapAction.EventSurveyLength -> {
                 measureLength()
             }
             // todo: 2023/6/6 面积测量
-            MapAction.EventSurveyArea->{
+            MapAction.EventSurveyArea -> {
                 measureArea()
             }
             // todo: 2023/6/7 初始化测量
-            MapAction.EventSurveyClear->{
+            MapAction.EventSurveyClear -> {
                 // todo: 2023/6/7 清理临时标注
                 gLayerTemp?.graphics?.clear()
                 // todo: 2023/6/7 结束编辑
@@ -1102,31 +1451,56 @@ class FragmentMap : CrAnimationFragment() {
                 }
             }
             // todo: 2023/6/7 获取地图位置
-            MapAction.MapTapGetLocation->{
+            MapAction.MapTapGetLocation -> {
                 CrUtil.showMessage("地图上点击查询地理位置")
                 mapTouch?.setAction(MapAction.MapTapGetLocation)
             }
             // todo: 2023/6/7 输入坐标定位
-            MapAction.EventInputLocationToMap->{
-                var dialogInput:DialogInput = DialogInput(context!!,"输入位置信息")
-                dialogInput.setButtonsText("确定","关闭")
-                dialogInput.setHints("输入经度,例118.70687","输入纬度,例35.218991")
-                dialogInput.setFonts(getString(R.string.ico_location),getString(R.string.ico_location))
+            MapAction.EventInputLocationToMap -> {
+                var dialogInput: DialogInput = DialogInput(context!!, "输入位置信息")
+                dialogInput.setButtonsText("确定", "关闭")
+                dialogInput.setHints("输入经度,例118.70687", "输入纬度,例35.218991")
+                dialogInput.setFonts(
+                    getString(R.string.ico_location),
+                    getString(R.string.ico_location)
+                )
                 dialogInput.setListener(inputLocationToMapListener)
                 dialogInput.show()
             }
             // todo: 2023/6/9 开始绘制案件图斑
-            MapAction.EventCaseDrawPolygon->{
+            MapAction.EventCaseDrawPolygon -> {
                 caseStartDraw()
             }
             // todo: 2023/6/9 重置绘制
-            MapAction.EventCaseDrawReset->{
+            MapAction.EventCaseDrawReset -> {
                 caseStartDraw()
             }
             // todo: 2023/6/9 回退
-            MapAction.EventCaseDrawUndo->{
+            MapAction.EventCaseDrawUndo -> {
                 sketchEditor?.undo()
             }
+            // todo: 2023/6/12 保存绘制的图斑
+            MapAction.EventCaseSavePolygon -> {
+                caseSave()
+            }
+            // todo: 2023/6/12 删除保存的图斑
+            MapAction.EventCaseRemovePolygon->{
+                caseDelete()
+            }
+            // todo: 2023/6/12 地图点击添加违建点
+            MapAction.MapTapAddWaypoint->{
+                CrUtil.showMessage("地图上点击添加案件点!")
+                mapTouch?.setAction(MapAction.MapTapAddWaypoint)
+            }
+            // todo: 2023/6/13 删除案件点
+            MapAction.MapTapDeleteWaypoint->{
+                CrUtil.showMessage("地图上选择需要删除的违建点后删除!")
+                mapTouch?.setAction(MapAction.MapTapDeleteWaypoint)
+            }
+            // todo: 2023/6/14 移动案件点
+            MapAction.MapTapMoveWaypoing->{
+                caseMoveWaypoint()
+            }
         }
     }
 

+ 5 - 0
app/src/main/res/layout/frag_case_tools.xml

@@ -52,6 +52,11 @@
     <View style="@style/view_split_h2"/>
     <com.cr.widget.CrButton
         style="@style/view_tools_line_row_button"
+        app:crTitle="@string/frag_case_title_remove_case"
+        app:crLeftResource = "@string/ico_delete"
+        android:id="@+id/case_remove_point"/>
+    <com.cr.widget.CrButton
+        style="@style/view_tools_line_row_button"
         app:crTitle="@string/frag_case_title_move_case"
         app:crLeftResource = "@string/ico_move"
         android:id="@+id/case_move_point"/>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -105,6 +105,7 @@
     <string name="frag_case_title_back">回退一步</string>
     <string name="frag_case_title_reset">重新绘制图斑</string>
     <string name="frag_case_title_move_case">移动绘制案件点</string>
+    <string name="frag_case_title_remove_case">删除案件点</string>
 
     <!--标志页面相关-->
     <string name="frag_mark_title_rotate">旋转角度</string>