diff --git a/app/build.gradle b/app/build.gradle index 8b7ec08..2247c0f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion '29.0.2' - ndkVersion '21.1.6352462' + //ndkVersion '23.0.7123448' defaultConfig { applicationId "com.navinfo.outdoor" diff --git a/app/src/main/java/com/navinfo/outdoor/api/Constant.java b/app/src/main/java/com/navinfo/outdoor/api/Constant.java index aca03a6..b8665a4 100644 --- a/app/src/main/java/com/navinfo/outdoor/api/Constant.java +++ b/app/src/main/java/com/navinfo/outdoor/api/Constant.java @@ -45,7 +45,8 @@ public class Constant { //message word 值 public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏 - public static final int TREASURE_WORD = 0;//poi 对地图页面marker 的一个展示 + public static final int TREASURE_WORD = 0;//poi 对地图页面marker 的一个展示 编辑 + public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定 public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数 public static final int POI_WORD = 2;//地图页面marker 的经纬都回传 public static final int FILTER_LIST = 4;//筛选列表所有数据地图显示 @@ -56,13 +57,16 @@ public class Constant { public static final int MAIN_HEADER = 9; // 控制主界面各个header public static final int MAIN_REMOVE = 10; // 控制主界面各个header移除 public static final int GATHER_GET_RETURN = 11;//参加领取的返回 - public static final int MAIN_CHARGING_STATION = 13;//充电站的Fragment 对地图页面marker 的一个展示 + public static final int MAIN_CHARGING_STATION = 13;//充电站的Fragment 对地图页面marker 的一个展示 编辑 + public static final int MAIN_CHARGING_CHECKED_STATION = 43;//充电站的Fragment 对地图页面marker 的一个展示 确定 public static final int CHARGING_STATION_WORD = 15;//地图页面marker 的经纬都回传 public static final int CHARGING_STATION = 16;//跳转到充电桩 - public static final int MAIN_CHARGING_PILE = 18;//充电桩的Fragment 对地图页面marker 的一个展示 + public static final int MAIN_CHARGING_PILE = 18;//充电桩的Fragment 对地图页面marker 的一个展示 编辑 + public static final int MAIN_CHARGING_CHECKED_PILE = 49;//充电桩的Fragment 对地图页面marker 的一个展示 确定 public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传 public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站 - public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示 + public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示 编辑 + public static final int MAIN_CHECKED_OTHER = 24;//其他的Fragment 对地图页面marker 的一个展示 确定 public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传 public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据 public static final int JOB_SEARCH_WORD = 28;//任务搜索的网络数据 @@ -85,7 +89,7 @@ public class Constant { public static LatLng markerLatlng; //marker 图标 - public static BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.poi_icons); + public static final BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg); public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg); public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg); public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg); diff --git a/app/src/main/java/com/navinfo/outdoor/bean/ChargingStationBean.java b/app/src/main/java/com/navinfo/outdoor/bean/ChargingStationBean.java new file mode 100644 index 0000000..11bf028 --- /dev/null +++ b/app/src/main/java/com/navinfo/outdoor/bean/ChargingStationBean.java @@ -0,0 +1,32 @@ +package com.navinfo.outdoor.bean; + +public class ChargingStationBean { + + private Integer code; + private String message; + private Integer body; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Integer getBody() { + return body; + } + + public void setBody(Integer body) { + this.body = body; + } +} diff --git a/app/src/main/java/com/navinfo/outdoor/bean/Info.java b/app/src/main/java/com/navinfo/outdoor/bean/Info.java index bf25fab..3c5ecf4 100644 --- a/app/src/main/java/com/navinfo/outdoor/bean/Info.java +++ b/app/src/main/java/com/navinfo/outdoor/bean/Info.java @@ -1,6 +1,8 @@ package com.navinfo.outdoor.bean; -public class Info { +import java.io.Serializable; + +public class Info implements Serializable { /** * photo : * x : diff --git a/app/src/main/java/com/navinfo/outdoor/bean/OtherUploadPicBean.java b/app/src/main/java/com/navinfo/outdoor/bean/OtherUploadPicBean.java new file mode 100644 index 0000000..7942da8 --- /dev/null +++ b/app/src/main/java/com/navinfo/outdoor/bean/OtherUploadPicBean.java @@ -0,0 +1,23 @@ +package com.navinfo.outdoor.bean; + +public class OtherUploadPicBean { + + private Integer code; + private String message; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/app/src/main/java/com/navinfo/outdoor/bean/PolygonTaskBean.java b/app/src/main/java/com/navinfo/outdoor/bean/PolygonTaskBean.java new file mode 100644 index 0000000..c829390 --- /dev/null +++ b/app/src/main/java/com/navinfo/outdoor/bean/PolygonTaskBean.java @@ -0,0 +1,96 @@ +package com.navinfo.outdoor.bean; + +/** + * 面状任务-任务领取 + */ +public class PolygonTaskBean { + /** + * code : 200 + * message : 成功 + * body : {"id":8602,"geo":"POLYGON((116.20818 39.87434,116.20842 39.87439,116.20857 39.87445,116.21227 39.87491,116.21214 39.87661,116.2108 39.87666,116.2108 39.87681,116.21064 39.87847,116.21302 39.87821,116.21424 39.87718,116.21823 39.87676,116.21898 39.88012,116.21958 39.88171,116.22301 39.8814,116.22329 39.8838,116.22786 39.88359,116.22754 39.88558,116.22757 39.8856,116.2277 39.8858,116.22774 39.88594,116.22775 39.88616,116.22773 39.88645,116.22769 39.88681,116.22766 39.88712,116.22765 39.88736,116.22764 39.88754,116.22767 39.88781,116.22771 39.88818,116.22773 39.88844,116.22776 39.88874,116.22779 39.88911,116.22791 39.8891,116.22796 39.8891,116.22801 39.88912,116.22804 39.88916,116.22807 39.88918,116.2281 39.88918,116.22813 39.88919,116.22834 39.88919,116.22934 39.88918,116.22952 39.88918,116.2296 39.88919,116.22966 39.88922,116.22989 39.88931,116.22998 39.88933,116.23005 39.88933,116.23057 39.88936,116.23077 39.88937,116.23093 39.88937,116.23129 39.88939,116.23158 39.8894,116.23166 39.8894,116.23174 39.8894,116.23183 39.8894,116.23227 39.89016,116.23237 39.89034,116.23248 39.89054,116.23261 39.89044,116.2328 39.89029,116.2331 39.89004,116.23342 39.8898,116.23348 39.88977,116.23352 39.88975,116.23355 39.88973,116.23366 39.88969,116.2338 39.88965,116.23414 39.88972,116.23418 39.88972,116.23413 39.88988,116.23413 39.8899,116.23412 39.88992,116.23405 39.88997,116.23386 39.89012,116.23424 39.89038,116.23369 39.89106,116.23368 39.89212,116.23763 39.89203,116.23758 39.89389,116.23916 39.89397,116.23951 39.89427,116.24088 39.89511,116.2425 39.89375,116.24387 39.89415,116.24395 39.89423,116.24403 39.89428,116.24419 39.89434,116.24438 39.89441,116.24455 39.89448,116.24475 39.89454,116.24485 39.89457,116.24506 39.89464,116.24519 39.89468,116.24527 39.89466,116.24812 39.89583,116.25 39.89583,116.25014 39.89583,116.25272 39.89586,116.25285 39.89586,116.25303 39.89587,116.25318 39.89587,116.25586 39.8959,116.25658 39.89594,116.25656 39.89553,116.25656 39.89528,116.25701 39.89509,116.25784 39.89502,116.25834 39.89508,116.25836 39.89548,116.25852 39.89588,116.25863 39.89615,116.25924 39.89637,116.25924 39.89663,116.25924 39.89674,116.25925 39.89689,116.25926 39.89706,116.25927 39.89717,116.25692 39.89716,116.25635 39.89715,116.25603 39.89715,116.25368 39.89717,116.25323 39.89718,116.25304 39.89718,116.25316 39.89726,116.2532 39.89729,116.2532 39.89737,116.25322 39.89811,116.25322 39.89849,116.25322 39.89934,116.25322 39.89975,116.25322 39.89983,116.25322 39.8999,116.25321 39.9002,116.25321 39.90028,116.25321 39.90074,116.25322 39.90149,116.25322 39.9028,116.25321 39.90387,116.2532 39.90429,116.25321 39.90516,116.25319 39.9062,116.25319 39.90633,116.25319 39.90643,116.2532 39.90727,116.2532 39.90734,116.25307 39.90733,116.25307 39.90741,116.25307 39.90749,116.25307 39.9078,116.25306 39.90798,116.25304 39.90829,116.25302 39.90888,116.25301 39.90935,116.25299 39.91034,116.25299 39.91091,116.25299 39.91105,116.25299 39.91193,116.25298 39.91285,116.25298 39.91301,116.25299 39.91364,116.25299 39.91496,116.25299 39.91511,116.25299 39.91541,116.25279 39.9154,116.25171 39.91539,116.25069 39.91538,116.2504 39.91538,116.25022 39.91538,116.25 39.91538,116.24993 39.91538,116.24968 39.91538,116.2496 39.91539,116.24956 39.91541,116.24949 39.9155,116.24945 39.91557,116.2494 39.91572,116.24934 39.9159,116.24931 39.91597,116.24928 39.916,116.24926 39.91602,116.24947 39.91639,116.24956 39.91667,116.24997 39.91796,116.25 39.91796,116.25258 39.91783,116.25286 39.91765,116.25286 39.91794,116.25272 39.91816,116.25267 39.91824,116.25171 39.91899,116.25132 39.91987,116.25274 39.91994,116.2529 39.91995,116.2529 39.92022,116.2529 39.92081,116.25289 39.92169,116.25289 39.92186,116.25279 39.92185,116.25268 39.92183,116.25241 39.92177,116.25225 39.92171,116.25216 39.92166,116.25165 39.92141,116.25154 39.92141,116.25149 39.92139,116.25104 39.92123,116.25058 39.92107,116.25 39.92086,116.24976 39.92079,116.24967 39.92077,116.24957 39.92075,116.24944 39.92073,116.24934 39.92072,116.24916 39.92071,116.2487 39.92073,116.24825 39.92075,116.24764 39.92081,116.24736 39.92082,116.24735 39.92075,116.24697 39.91904,116.24309 39.91897,116.2429 39.91873,116.24287 39.91867,116.24286 39.91862,116.24289 39.9183,116.23996 39.91842,116.23943 39.91848,116.2392 39.91847,116.23764 39.91847,116.23755 39.91816,116.2375 39.91809,116.23746 39.91805,116.23739 39.91803,116.23735 39.91802,116.23694 39.91794,116.23692 39.91789,116.23692 39.91786,116.23703 39.91722,116.23706 39.91688,116.23678 39.91688,116.23531 39.91694,116.23451 39.917,116.23441 39.91701,116.23428 39.91702,116.2338 39.91707,116.23363 39.91707,116.23342 39.91709,116.23326 39.91708,116.23302 39.91703,116.2327 39.91694,116.23257 39.91689,116.23242 39.91685,116.23228 39.9168,116.23218 39.91676,116.23206 39.91671,116.23196 39.91667,116.23191 39.91663,116.2319 39.91659,116.23189 39.91653,116.23189 39.91647,116.2319 39.91638,116.23191 39.91629,116.2317 39.91631,116.23169 39.91642,116.23168 39.91646,116.23167 39.9165,116.23164 39.91662,116.23163 39.91667,116.23162 39.91671,116.2316 39.91678,116.23158 39.9169,116.23154 39.91698,116.23152 39.91706,116.23149 39.9171,116.23146 39.91714,116.23143 39.91716,116.23138 39.91719,116.23134 39.91721,116.23129 39.91723,116.2311 39.91726,116.231 39.91726,116.23091 39.91725,116.23074 39.91721,116.23067 39.91719,116.23061 39.91718,116.23047 39.91717,116.2304 39.91717,116.23031 39.91717,116.23022 39.91718,116.23013 39.91722,116.23006 39.91729,116.23001 39.91737,116.22997 39.91744,116.22993 39.91751,116.22988 39.91757,116.22982 39.91763,116.22973 39.91769,116.22948 39.91776,116.22933 39.91779,116.22907 39.91783,116.22902 39.91784,116.22889 39.91786,116.22873 39.91788,116.22865 39.9179,116.22857 39.91791,116.2284 39.91792,116.22823 39.91793,116.22805 39.91793,116.22759 39.9179,116.22612 39.91785,116.22567 39.91783,116.22536 39.91781,116.22503 39.91781,116.22477 39.91781,116.22458 39.91782,116.22421 39.91783,116.22409 39.91783,116.22402 39.91784,116.22383 39.91785,116.22366 39.91786,116.22342 39.91787,116.22327 39.91788,116.2231 39.91788,116.22275 39.9179,116.22266 39.9179,116.22251 39.91791,116.22216 39.91792,116.22206 39.91792,116.22157 39.91792,116.22126 39.91791,116.22103 39.9179,116.22054 39.9179,116.22037 39.91789,116.2201 39.91788,116.2199 39.91788,116.21962 39.91786,116.21947 39.91783,116.21941 39.91782,116.21934 39.9178,116.21921 39.91776,116.21909 39.91771,116.21874 39.91756,116.21862 39.91751,116.21844 39.91743,116.21829 39.91737,116.21815 39.91732,116.21807 39.9173,116.21798 39.91727,116.21789 39.91724,116.21677 39.91793,116.21642 39.91805,116.21632 39.91811,116.21548 39.91791,116.21457 39.91768,116.21405 39.91751,116.21296 39.91705,116.21288 39.91702,116.21263 39.91692,116.21256 39.91689,116.21251 39.91688,116.21242 39.91687,116.21233 39.91685,116.21221 39.91685,116.21205 39.91684,116.21197 39.91684,116.21189 39.91684,116.2117 39.91702,116.21156 39.91705,116.21138 39.91708,116.2093 39.91743,116.20862 39.91808,116.2069 39.91809,116.20681 39.91809,116.20682 39.91872,116.20682 39.91878,116.20683 39.91937,116.20683 39.91954,116.20686 39.92123,116.20686 39.92132,116.20687 39.92202,116.20689 39.92268,116.20689 39.92296,116.20691 39.92441,116.20691 39.92449,116.20691 39.9246,116.20691 39.92475,116.20692 39.92495,116.20708 39.92475,116.20722 39.92475,116.20768 39.92475,116.20779 39.92476,116.20885 39.92477,116.20902 39.92497,116.20905 39.925,116.20913 39.92509,116.20937 39.92517,116.20951 39.92525,116.21021 39.92578,116.21078 39.92618,116.21088 39.92624,116.21099 39.92626,116.21106 39.92627,116.21127 39.92629,116.21152 39.92631,116.21213 39.92628,116.21234 39.92628,116.21261 39.92626,116.21328 39.92627,116.21334 39.92627,116.21352 39.92626,116.21357 39.92626,116.21495 39.92671,116.21567 39.92811,116.2157 39.92868,116.21313 39.92899,116.21335 39.92975,116.21424 39.93126,116.21648 39.93135,116.21648 39.93161,116.21619 39.93181,116.21562 39.93228,116.21381 39.93266,116.21381 39.93326,116.21381 39.93331,116.21381 39.93344,116.21381 39.93351,116.21381 39.93365,116.21381 39.93404,116.21466 39.93413,116.21461 39.93487,116.21411 39.93518,116.21462 39.93585,116.21469 39.93595,116.21605 39.93789,116.21854 39.94057,116.21894 39.94099,116.21896 39.94102,116.21899 39.9443,116.21644 39.94427,116.21652 39.94736,116.21596 39.94788,116.21535 39.94854,116.21498 39.9487,116.21481 39.94878,116.21464 39.94886,116.21433 39.94899,116.21291 39.95013,116.20777 39.95303,116.20512 39.95492,116.20334 39.95637,116.20284 39.95765,116.20223 39.95829,116.20248 39.96008,116.20148 39.96124,116.19889 39.96218,116.19696 39.96264,116.19535 39.96378,116.19181 39.96512,116.19091 39.96565,116.19142 39.96797,116.18825 39.96867,116.18626 39.97064,116.18576 39.972,116.18633 39.97313,116.18644 39.97677,116.1864 39.97699,116.18605 39.97858,116.18692 39.97961,116.18692 39.98134,116.18619 39.98204,116.18642 39.98245,116.18661 39.98369,116.18631 39.98424,116.18569 39.98501,116.18497 39.98595,116.18429 39.98621,116.18343 39.9865,116.18177 39.98703,116.18077 39.98738,116.18015 39.98772,116.17898 39.98835,116.17879 39.98648,116.17896 39.98556,116.17879 39.98443,116.17892 39.98324,116.17859 39.9823,116.17715 39.98186,116.17585 39.98046,116.17227 39.9777,116.17153 39.97691,116.16932 39.97735,116.16972 39.98029,116.16944 39.98322,116.16859 39.98366,116.16814 39.98733,116.16741 39.98777,116.16618 39.98744,116.16529 39.9871,116.16389 39.9859,116.16283 39.98569,116.16105 39.98428,116.15827 39.98386,116.15727 39.98484,116.15593 39.98548,116.15699 39.98689,116.15599 39.98838,116.15532 39.98949,116.15443 39.99038,116.15121 39.99367,116.15031 39.99307,116.14725 39.99183,116.14598 39.99079,116.1452 39.98964,116.14451 39.98944,116.14232 39.98984,116.1402 39.98954,116.13542 39.98804,116.13379 39.98843,116.13118 39.98851,116.13017 39.98848,116.12765 39.98733,116.125 39.98694,116.1203 39.98625,116.11938 39.98627,116.11624 39.98332,116.11385 39.98155,116.11567 39.97958,116.11515 39.97651,116.11625 39.97459,116.1169 39.97217,116.11878 39.97153,116.11982 39.97118,116.11992 39.97115,116.12049 39.97096,116.12101 39.96925,116.12323 39.96874,116.12342 39.96743,116.12211 39.96557,116.12194 39.96399,116.12122 39.96117,116.12029 39.96156,116.11981 39.96199,116.11812 39.96111,116.1177 39.95976,116.11759 39.95983,116.11753 39.95985,116.11715 39.95995,116.11689 39.96,116.11653 39.96008,116.11613 39.96016,116.11611 39.9601,116.11606 39.96001,116.11603 39.95995,116.11563 39.95913,116.11556 39.959,116.11535 39.95861,116.1152 39.95836,116.11517 39.95829,116.1151 39.95816,116.11495 39.95807,116.11488 39.95796,116.11486 39.95778,116.11525 39.95673,116.11531 39.95669,116.11551 39.95653,116.1158 39.95627,116.11589 39.95619,116.11599 39.95611,116.11693 39.9566,116.11905 39.95474,116.11716 39.95357,116.11713 39.95355,116.11816 39.95254,116.11899 39.95175,116.11973 39.95092,116.12004 39.95061,116.12012 39.95041,116.12012 39.95025,116.12014 39.95023,116.11963 39.95002,116.11959 39.95001,116.11912 39.94979,116.11856 39.94955,116.11815 39.94933,116.11807 39.94924,116.118 39.94918,116.1179 39.94911,116.11785 39.94907,116.11784 39.94905,116.11783 39.94903,116.11659 39.94894,116.11724 39.94834,116.11586 39.9481,116.11574 39.94808,116.11564 39.94822,116.11489 39.9493,116.11365 39.94834,116.11404 39.94734,116.11303 39.94489,116.1123 39.9432,116.11585 39.93869,116.11523 39.93818,116.11623 39.93694,116.11634 39.9368,116.11641 39.93666,116.11646 39.93654,116.11652 39.93638,116.11701 39.93538,116.11849 39.93525,116.11943 39.93316,116.12019 39.93244,116.12031 39.9325,116.12052 39.93262,116.12066 39.9327,116.12081 39.93278,116.12183 39.93344,116.12191 39.93345,116.12298 39.93397,116.12482 39.93499,116.125 39.93468,116.12712 39.93103,116.12795 39.92942,116.12879 39.92676,116.12911 39.92658,116.12955 39.92634,116.13026 39.92596,116.13058 39.92578,116.13072 39.9257,116.1313 39.92538,116.13356 39.92416,116.13361 39.92413,116.13479 39.92386,116.13568 39.92366,116.14086 39.92244,116.14296 39.91976,116.14348 39.91834,116.14409 39.91667,116.14481 39.91485,116.14535 39.91386,116.14629 39.91134,116.14897 39.90866,116.14966 39.90812,116.15151 39.90499,116.15155 39.90448,116.15123 39.90369,116.15113 39.90324,116.15158 39.90248,116.15225 39.90168,116.153 39.90088,116.1536 39.90039,116.15463 39.90005,116.15536 39.89957,116.15569 39.89892,116.15579 39.89838,116.15566 39.89788,116.15562 39.89763,116.15618 39.89723,116.15896 39.89682,116.16367 39.8926,116.16689 39.88965,116.16744 39.88921,116.16756 39.88912,116.16761 39.88908,116.1679 39.88883,116.16859 39.88829,116.16913 39.88786,116.17114 39.88725,116.17464 39.88546,116.17599 39.88501,116.17698 39.88469,116.17905 39.88401,116.17913 39.88398,116.18044 39.88355,116.1819 39.88309,116.18235 39.8827,116.18277 39.8821,116.1841 39.88065,116.1866 39.88037,116.18768 39.88026,116.18788 39.88031,116.19269 39.88165,116.19543 39.88342,116.19653 39.88338,116.19869 39.8833,116.19967 39.88327,116.19977 39.88321,116.20028 39.88289,116.20067 39.88265,116.20089 39.8825,116.20131 39.88224,116.20163 39.88203,116.20171 39.88198,116.2019 39.88187,116.20226 39.88164,116.20243 39.88154,116.20265 39.88137,116.2028 39.88125,116.20313 39.88096,116.20347 39.88072,116.20375 39.88054,116.20422 39.88024,116.20446 39.88009,116.20485 39.87981,116.20514 39.87959,116.20536 39.87937,116.20552 39.87919,116.20563 39.87908,116.20572 39.87898,116.20576 39.87894,116.20601 39.87867,116.20652 39.87815,116.20673 39.87795,116.20676 39.87792,116.20687 39.87782,116.20699 39.87766,116.20706 39.87756,116.20714 39.87744,116.20741 39.87694,116.20747 39.87685,116.20758 39.87662,116.2076 39.87656,116.20763 39.8765,116.2077 39.8763,116.20781 39.87589,116.20793 39.87539,116.20795 39.87533,116.20818 39.87434))","type":6,"name":"测试面状任务","isExclusive":0} + */ + + private int code; + private String message; + private BodyBean body; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BodyBean getBody() { + return body; + } + + public void setBody(BodyBean body) { + this.body = body; + } + + public static class BodyBean { + /** + * id : 8602 + * geo : POLYGON((116.20818 39.87434,116.20842 39.87439,116.20857 39.87445,116.21227 39.87491,116.21214 39.87661,116.2108 39.87666,116.2108 39.87681,116.21064 39.87847,116.21302 39.87821,116.21424 39.87718,116.21823 39.87676,116.21898 39.88012,116.21958 39.88171,116.22301 39.8814,116.22329 39.8838,116.22786 39.88359,116.22754 39.88558,116.22757 39.8856,116.2277 39.8858,116.22774 39.88594,116.22775 39.88616,116.22773 39.88645,116.22769 39.88681,116.22766 39.88712,116.22765 39.88736,116.22764 39.88754,116.22767 39.88781,116.22771 39.88818,116.22773 39.88844,116.22776 39.88874,116.22779 39.88911,116.22791 39.8891,116.22796 39.8891,116.22801 39.88912,116.22804 39.88916,116.22807 39.88918,116.2281 39.88918,116.22813 39.88919,116.22834 39.88919,116.22934 39.88918,116.22952 39.88918,116.2296 39.88919,116.22966 39.88922,116.22989 39.88931,116.22998 39.88933,116.23005 39.88933,116.23057 39.88936,116.23077 39.88937,116.23093 39.88937,116.23129 39.88939,116.23158 39.8894,116.23166 39.8894,116.23174 39.8894,116.23183 39.8894,116.23227 39.89016,116.23237 39.89034,116.23248 39.89054,116.23261 39.89044,116.2328 39.89029,116.2331 39.89004,116.23342 39.8898,116.23348 39.88977,116.23352 39.88975,116.23355 39.88973,116.23366 39.88969,116.2338 39.88965,116.23414 39.88972,116.23418 39.88972,116.23413 39.88988,116.23413 39.8899,116.23412 39.88992,116.23405 39.88997,116.23386 39.89012,116.23424 39.89038,116.23369 39.89106,116.23368 39.89212,116.23763 39.89203,116.23758 39.89389,116.23916 39.89397,116.23951 39.89427,116.24088 39.89511,116.2425 39.89375,116.24387 39.89415,116.24395 39.89423,116.24403 39.89428,116.24419 39.89434,116.24438 39.89441,116.24455 39.89448,116.24475 39.89454,116.24485 39.89457,116.24506 39.89464,116.24519 39.89468,116.24527 39.89466,116.24812 39.89583,116.25 39.89583,116.25014 39.89583,116.25272 39.89586,116.25285 39.89586,116.25303 39.89587,116.25318 39.89587,116.25586 39.8959,116.25658 39.89594,116.25656 39.89553,116.25656 39.89528,116.25701 39.89509,116.25784 39.89502,116.25834 39.89508,116.25836 39.89548,116.25852 39.89588,116.25863 39.89615,116.25924 39.89637,116.25924 39.89663,116.25924 39.89674,116.25925 39.89689,116.25926 39.89706,116.25927 39.89717,116.25692 39.89716,116.25635 39.89715,116.25603 39.89715,116.25368 39.89717,116.25323 39.89718,116.25304 39.89718,116.25316 39.89726,116.2532 39.89729,116.2532 39.89737,116.25322 39.89811,116.25322 39.89849,116.25322 39.89934,116.25322 39.89975,116.25322 39.89983,116.25322 39.8999,116.25321 39.9002,116.25321 39.90028,116.25321 39.90074,116.25322 39.90149,116.25322 39.9028,116.25321 39.90387,116.2532 39.90429,116.25321 39.90516,116.25319 39.9062,116.25319 39.90633,116.25319 39.90643,116.2532 39.90727,116.2532 39.90734,116.25307 39.90733,116.25307 39.90741,116.25307 39.90749,116.25307 39.9078,116.25306 39.90798,116.25304 39.90829,116.25302 39.90888,116.25301 39.90935,116.25299 39.91034,116.25299 39.91091,116.25299 39.91105,116.25299 39.91193,116.25298 39.91285,116.25298 39.91301,116.25299 39.91364,116.25299 39.91496,116.25299 39.91511,116.25299 39.91541,116.25279 39.9154,116.25171 39.91539,116.25069 39.91538,116.2504 39.91538,116.25022 39.91538,116.25 39.91538,116.24993 39.91538,116.24968 39.91538,116.2496 39.91539,116.24956 39.91541,116.24949 39.9155,116.24945 39.91557,116.2494 39.91572,116.24934 39.9159,116.24931 39.91597,116.24928 39.916,116.24926 39.91602,116.24947 39.91639,116.24956 39.91667,116.24997 39.91796,116.25 39.91796,116.25258 39.91783,116.25286 39.91765,116.25286 39.91794,116.25272 39.91816,116.25267 39.91824,116.25171 39.91899,116.25132 39.91987,116.25274 39.91994,116.2529 39.91995,116.2529 39.92022,116.2529 39.92081,116.25289 39.92169,116.25289 39.92186,116.25279 39.92185,116.25268 39.92183,116.25241 39.92177,116.25225 39.92171,116.25216 39.92166,116.25165 39.92141,116.25154 39.92141,116.25149 39.92139,116.25104 39.92123,116.25058 39.92107,116.25 39.92086,116.24976 39.92079,116.24967 39.92077,116.24957 39.92075,116.24944 39.92073,116.24934 39.92072,116.24916 39.92071,116.2487 39.92073,116.24825 39.92075,116.24764 39.92081,116.24736 39.92082,116.24735 39.92075,116.24697 39.91904,116.24309 39.91897,116.2429 39.91873,116.24287 39.91867,116.24286 39.91862,116.24289 39.9183,116.23996 39.91842,116.23943 39.91848,116.2392 39.91847,116.23764 39.91847,116.23755 39.91816,116.2375 39.91809,116.23746 39.91805,116.23739 39.91803,116.23735 39.91802,116.23694 39.91794,116.23692 39.91789,116.23692 39.91786,116.23703 39.91722,116.23706 39.91688,116.23678 39.91688,116.23531 39.91694,116.23451 39.917,116.23441 39.91701,116.23428 39.91702,116.2338 39.91707,116.23363 39.91707,116.23342 39.91709,116.23326 39.91708,116.23302 39.91703,116.2327 39.91694,116.23257 39.91689,116.23242 39.91685,116.23228 39.9168,116.23218 39.91676,116.23206 39.91671,116.23196 39.91667,116.23191 39.91663,116.2319 39.91659,116.23189 39.91653,116.23189 39.91647,116.2319 39.91638,116.23191 39.91629,116.2317 39.91631,116.23169 39.91642,116.23168 39.91646,116.23167 39.9165,116.23164 39.91662,116.23163 39.91667,116.23162 39.91671,116.2316 39.91678,116.23158 39.9169,116.23154 39.91698,116.23152 39.91706,116.23149 39.9171,116.23146 39.91714,116.23143 39.91716,116.23138 39.91719,116.23134 39.91721,116.23129 39.91723,116.2311 39.91726,116.231 39.91726,116.23091 39.91725,116.23074 39.91721,116.23067 39.91719,116.23061 39.91718,116.23047 39.91717,116.2304 39.91717,116.23031 39.91717,116.23022 39.91718,116.23013 39.91722,116.23006 39.91729,116.23001 39.91737,116.22997 39.91744,116.22993 39.91751,116.22988 39.91757,116.22982 39.91763,116.22973 39.91769,116.22948 39.91776,116.22933 39.91779,116.22907 39.91783,116.22902 39.91784,116.22889 39.91786,116.22873 39.91788,116.22865 39.9179,116.22857 39.91791,116.2284 39.91792,116.22823 39.91793,116.22805 39.91793,116.22759 39.9179,116.22612 39.91785,116.22567 39.91783,116.22536 39.91781,116.22503 39.91781,116.22477 39.91781,116.22458 39.91782,116.22421 39.91783,116.22409 39.91783,116.22402 39.91784,116.22383 39.91785,116.22366 39.91786,116.22342 39.91787,116.22327 39.91788,116.2231 39.91788,116.22275 39.9179,116.22266 39.9179,116.22251 39.91791,116.22216 39.91792,116.22206 39.91792,116.22157 39.91792,116.22126 39.91791,116.22103 39.9179,116.22054 39.9179,116.22037 39.91789,116.2201 39.91788,116.2199 39.91788,116.21962 39.91786,116.21947 39.91783,116.21941 39.91782,116.21934 39.9178,116.21921 39.91776,116.21909 39.91771,116.21874 39.91756,116.21862 39.91751,116.21844 39.91743,116.21829 39.91737,116.21815 39.91732,116.21807 39.9173,116.21798 39.91727,116.21789 39.91724,116.21677 39.91793,116.21642 39.91805,116.21632 39.91811,116.21548 39.91791,116.21457 39.91768,116.21405 39.91751,116.21296 39.91705,116.21288 39.91702,116.21263 39.91692,116.21256 39.91689,116.21251 39.91688,116.21242 39.91687,116.21233 39.91685,116.21221 39.91685,116.21205 39.91684,116.21197 39.91684,116.21189 39.91684,116.2117 39.91702,116.21156 39.91705,116.21138 39.91708,116.2093 39.91743,116.20862 39.91808,116.2069 39.91809,116.20681 39.91809,116.20682 39.91872,116.20682 39.91878,116.20683 39.91937,116.20683 39.91954,116.20686 39.92123,116.20686 39.92132,116.20687 39.92202,116.20689 39.92268,116.20689 39.92296,116.20691 39.92441,116.20691 39.92449,116.20691 39.9246,116.20691 39.92475,116.20692 39.92495,116.20708 39.92475,116.20722 39.92475,116.20768 39.92475,116.20779 39.92476,116.20885 39.92477,116.20902 39.92497,116.20905 39.925,116.20913 39.92509,116.20937 39.92517,116.20951 39.92525,116.21021 39.92578,116.21078 39.92618,116.21088 39.92624,116.21099 39.92626,116.21106 39.92627,116.21127 39.92629,116.21152 39.92631,116.21213 39.92628,116.21234 39.92628,116.21261 39.92626,116.21328 39.92627,116.21334 39.92627,116.21352 39.92626,116.21357 39.92626,116.21495 39.92671,116.21567 39.92811,116.2157 39.92868,116.21313 39.92899,116.21335 39.92975,116.21424 39.93126,116.21648 39.93135,116.21648 39.93161,116.21619 39.93181,116.21562 39.93228,116.21381 39.93266,116.21381 39.93326,116.21381 39.93331,116.21381 39.93344,116.21381 39.93351,116.21381 39.93365,116.21381 39.93404,116.21466 39.93413,116.21461 39.93487,116.21411 39.93518,116.21462 39.93585,116.21469 39.93595,116.21605 39.93789,116.21854 39.94057,116.21894 39.94099,116.21896 39.94102,116.21899 39.9443,116.21644 39.94427,116.21652 39.94736,116.21596 39.94788,116.21535 39.94854,116.21498 39.9487,116.21481 39.94878,116.21464 39.94886,116.21433 39.94899,116.21291 39.95013,116.20777 39.95303,116.20512 39.95492,116.20334 39.95637,116.20284 39.95765,116.20223 39.95829,116.20248 39.96008,116.20148 39.96124,116.19889 39.96218,116.19696 39.96264,116.19535 39.96378,116.19181 39.96512,116.19091 39.96565,116.19142 39.96797,116.18825 39.96867,116.18626 39.97064,116.18576 39.972,116.18633 39.97313,116.18644 39.97677,116.1864 39.97699,116.18605 39.97858,116.18692 39.97961,116.18692 39.98134,116.18619 39.98204,116.18642 39.98245,116.18661 39.98369,116.18631 39.98424,116.18569 39.98501,116.18497 39.98595,116.18429 39.98621,116.18343 39.9865,116.18177 39.98703,116.18077 39.98738,116.18015 39.98772,116.17898 39.98835,116.17879 39.98648,116.17896 39.98556,116.17879 39.98443,116.17892 39.98324,116.17859 39.9823,116.17715 39.98186,116.17585 39.98046,116.17227 39.9777,116.17153 39.97691,116.16932 39.97735,116.16972 39.98029,116.16944 39.98322,116.16859 39.98366,116.16814 39.98733,116.16741 39.98777,116.16618 39.98744,116.16529 39.9871,116.16389 39.9859,116.16283 39.98569,116.16105 39.98428,116.15827 39.98386,116.15727 39.98484,116.15593 39.98548,116.15699 39.98689,116.15599 39.98838,116.15532 39.98949,116.15443 39.99038,116.15121 39.99367,116.15031 39.99307,116.14725 39.99183,116.14598 39.99079,116.1452 39.98964,116.14451 39.98944,116.14232 39.98984,116.1402 39.98954,116.13542 39.98804,116.13379 39.98843,116.13118 39.98851,116.13017 39.98848,116.12765 39.98733,116.125 39.98694,116.1203 39.98625,116.11938 39.98627,116.11624 39.98332,116.11385 39.98155,116.11567 39.97958,116.11515 39.97651,116.11625 39.97459,116.1169 39.97217,116.11878 39.97153,116.11982 39.97118,116.11992 39.97115,116.12049 39.97096,116.12101 39.96925,116.12323 39.96874,116.12342 39.96743,116.12211 39.96557,116.12194 39.96399,116.12122 39.96117,116.12029 39.96156,116.11981 39.96199,116.11812 39.96111,116.1177 39.95976,116.11759 39.95983,116.11753 39.95985,116.11715 39.95995,116.11689 39.96,116.11653 39.96008,116.11613 39.96016,116.11611 39.9601,116.11606 39.96001,116.11603 39.95995,116.11563 39.95913,116.11556 39.959,116.11535 39.95861,116.1152 39.95836,116.11517 39.95829,116.1151 39.95816,116.11495 39.95807,116.11488 39.95796,116.11486 39.95778,116.11525 39.95673,116.11531 39.95669,116.11551 39.95653,116.1158 39.95627,116.11589 39.95619,116.11599 39.95611,116.11693 39.9566,116.11905 39.95474,116.11716 39.95357,116.11713 39.95355,116.11816 39.95254,116.11899 39.95175,116.11973 39.95092,116.12004 39.95061,116.12012 39.95041,116.12012 39.95025,116.12014 39.95023,116.11963 39.95002,116.11959 39.95001,116.11912 39.94979,116.11856 39.94955,116.11815 39.94933,116.11807 39.94924,116.118 39.94918,116.1179 39.94911,116.11785 39.94907,116.11784 39.94905,116.11783 39.94903,116.11659 39.94894,116.11724 39.94834,116.11586 39.9481,116.11574 39.94808,116.11564 39.94822,116.11489 39.9493,116.11365 39.94834,116.11404 39.94734,116.11303 39.94489,116.1123 39.9432,116.11585 39.93869,116.11523 39.93818,116.11623 39.93694,116.11634 39.9368,116.11641 39.93666,116.11646 39.93654,116.11652 39.93638,116.11701 39.93538,116.11849 39.93525,116.11943 39.93316,116.12019 39.93244,116.12031 39.9325,116.12052 39.93262,116.12066 39.9327,116.12081 39.93278,116.12183 39.93344,116.12191 39.93345,116.12298 39.93397,116.12482 39.93499,116.125 39.93468,116.12712 39.93103,116.12795 39.92942,116.12879 39.92676,116.12911 39.92658,116.12955 39.92634,116.13026 39.92596,116.13058 39.92578,116.13072 39.9257,116.1313 39.92538,116.13356 39.92416,116.13361 39.92413,116.13479 39.92386,116.13568 39.92366,116.14086 39.92244,116.14296 39.91976,116.14348 39.91834,116.14409 39.91667,116.14481 39.91485,116.14535 39.91386,116.14629 39.91134,116.14897 39.90866,116.14966 39.90812,116.15151 39.90499,116.15155 39.90448,116.15123 39.90369,116.15113 39.90324,116.15158 39.90248,116.15225 39.90168,116.153 39.90088,116.1536 39.90039,116.15463 39.90005,116.15536 39.89957,116.15569 39.89892,116.15579 39.89838,116.15566 39.89788,116.15562 39.89763,116.15618 39.89723,116.15896 39.89682,116.16367 39.8926,116.16689 39.88965,116.16744 39.88921,116.16756 39.88912,116.16761 39.88908,116.1679 39.88883,116.16859 39.88829,116.16913 39.88786,116.17114 39.88725,116.17464 39.88546,116.17599 39.88501,116.17698 39.88469,116.17905 39.88401,116.17913 39.88398,116.18044 39.88355,116.1819 39.88309,116.18235 39.8827,116.18277 39.8821,116.1841 39.88065,116.1866 39.88037,116.18768 39.88026,116.18788 39.88031,116.19269 39.88165,116.19543 39.88342,116.19653 39.88338,116.19869 39.8833,116.19967 39.88327,116.19977 39.88321,116.20028 39.88289,116.20067 39.88265,116.20089 39.8825,116.20131 39.88224,116.20163 39.88203,116.20171 39.88198,116.2019 39.88187,116.20226 39.88164,116.20243 39.88154,116.20265 39.88137,116.2028 39.88125,116.20313 39.88096,116.20347 39.88072,116.20375 39.88054,116.20422 39.88024,116.20446 39.88009,116.20485 39.87981,116.20514 39.87959,116.20536 39.87937,116.20552 39.87919,116.20563 39.87908,116.20572 39.87898,116.20576 39.87894,116.20601 39.87867,116.20652 39.87815,116.20673 39.87795,116.20676 39.87792,116.20687 39.87782,116.20699 39.87766,116.20706 39.87756,116.20714 39.87744,116.20741 39.87694,116.20747 39.87685,116.20758 39.87662,116.2076 39.87656,116.20763 39.8765,116.2077 39.8763,116.20781 39.87589,116.20793 39.87539,116.20795 39.87533,116.20818 39.87434)) + * type : 6 + * name : 测试面状任务 + * isExclusive : 0 + */ + + private int id; + private String geo; + private int type; + private String name; + private int isExclusive; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getGeo() { + return geo; + } + + public void setGeo(String geo) { + this.geo = geo; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getIsExclusive() { + return isExclusive; + } + + public void setIsExclusive(int isExclusive) { + this.isExclusive = isExclusive; + } + } +} diff --git a/app/src/main/java/com/navinfo/outdoor/bean/ReceivedBean.java b/app/src/main/java/com/navinfo/outdoor/bean/ReceivedBean.java new file mode 100644 index 0000000..9c50691 --- /dev/null +++ b/app/src/main/java/com/navinfo/outdoor/bean/ReceivedBean.java @@ -0,0 +1,157 @@ +package com.navinfo.outdoor.bean; + +import java.util.List; + +public class ReceivedBean { + + private Integer code; + private String message; + private BodyBean body; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public BodyBean getBody() { + return body; + } + + public void setBody(BodyBean body) { + this.body = body; + } + + public static class BodyBean { + private Integer sptype; + private List csTaskList; + private String address; + private String telephone; + private String geo; + private Double price; + private Integer type; + private String name; + private Integer isExclusive; + + public Integer getSptype() { + return sptype; + } + + public void setSptype(Integer sptype) { + this.sptype = sptype; + } + + public List getCsTaskList() { + return csTaskList; + } + + public void setCsTaskList(List csTaskList) { + this.csTaskList = csTaskList; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getGeo() { + return geo; + } + + public void setGeo(String geo) { + this.geo = geo; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getIsExclusive() { + return isExclusive; + } + + public void setIsExclusive(Integer isExclusive) { + this.isExclusive = isExclusive; + } + + public static class CsTaskListBean { + private String address; + private String geo; + private Double price; + private String name; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getGeo() { + return geo; + } + + public void setGeo(String geo) { + this.geo = geo; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + } +} diff --git a/app/src/main/java/com/navinfo/outdoor/bean/ReceivedPoiBean.java b/app/src/main/java/com/navinfo/outdoor/bean/ReceivedPoiBean.java index b00c2f2..4a28a1c 100644 --- a/app/src/main/java/com/navinfo/outdoor/bean/ReceivedPoiBean.java +++ b/app/src/main/java/com/navinfo/outdoor/bean/ReceivedPoiBean.java @@ -1,5 +1,8 @@ package com.navinfo.outdoor.bean; +/** + *普通任务 + */ public class ReceivedPoiBean { private Integer code; diff --git a/app/src/main/java/com/navinfo/outdoor/bean/UnPolygonTaskBean.java b/app/src/main/java/com/navinfo/outdoor/bean/UnPolygonTaskBean.java new file mode 100644 index 0000000..1e4823c --- /dev/null +++ b/app/src/main/java/com/navinfo/outdoor/bean/UnPolygonTaskBean.java @@ -0,0 +1,42 @@ +package com.navinfo.outdoor.bean; + +/** + * 面状任务-结束领取 + * 面妆任务-立即采集 + * 面妆任务-结束采集 + */ +public class UnPolygonTaskBean { + /** + * code : 200 + * message : 成功 + * body : 1 + */ + + private int code; + private String message; + private int body; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public int getBody() { + return body; + } + + public void setBody(int body) { + this.body = body; + } +} diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java index 6eba81e..cacd26e 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java @@ -51,6 +51,8 @@ import com.navinfo.outdoor.room.ChargingPileEntity; import com.navinfo.outdoor.room.PoiDao; import com.navinfo.outdoor.room.PoiDatabase; import com.navinfo.outdoor.room.PoiEntity; +import com.navinfo.outdoor.util.Geohash; +import com.navinfo.outdoor.util.GeometryTools; import com.navinfo.outdoor.util.PhotoPathUtil; import com.tencent.tencentmap.mapsdk.maps.model.LatLng; @@ -89,6 +91,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC private int pid; private String station; private LatLng latLng; + private LatLng poiLatLng; public static ChargingPileFragment newInstance(Bundle bundle) { ChargingPileFragment fragment = new ChargingPileFragment(); @@ -152,10 +155,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Message obtain = Message.obtain(); - obtain.what = Constant.MAIN_CHARGING_PILE; - obtain.obj = isChecked; - EventBus.getDefault().post(obtain); + if (isChecked){ + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_CHARGING_PILE; + obtain.obj = poiLatLng; + EventBus.getDefault().post(obtain); + }else { + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_CHARGING_CHECKED_PILE; + obtain.obj = true; + EventBus.getDefault().post(obtain); + } } }); checkBoxRight.setVisibility(View.GONE); @@ -361,7 +371,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC editDescribe = findViewById(R.id.edit_describe); btnSaveLocal = findViewById(R.id.btn_save_local); btnSaveLocal.setOnClickListener(this::onClick); - //展示数据 initShowPileSharePre(); @@ -372,6 +381,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC if (station!=null){ PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class); pid = poiEntity.getTaskId(); + String x = poiEntity.getX(); + String y = poiEntity.getY(); + if (x != null && y != null) { + poiLatLng = new LatLng(); + poiLatLng.setLatitude(Double.parseDouble(y)); + poiLatLng.setLongitude(Double.parseDouble(x)); + } + } // 添加信息: ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity"); @@ -382,10 +399,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC } String p = chargingPileEntity.getP(); if (p != null) { - String[] split = p.split(","); - latLng = new LatLng(); - latLng.setLatitude(Double.parseDouble(split[0])); - latLng.setLongitude(Double.parseDouble(split[1])); + latLng = GeometryTools.createLatLng(p); } String memo = chargingPileEntity.getMemo(); if (memo != null&&!memo.equals("")) { @@ -559,7 +573,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show(); return; } else { - chargingPileEntity.setP(latLng.latitude+","+latLng.longitude); + String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude); + chargingPileEntity.setP(encode); } String name = editNameContent.getText().toString().trim();//名称 if (name == null || name.equals("")) { diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java index 83ced87..eef5ab6 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java @@ -38,18 +38,25 @@ import com.kongzue.dialog.interfaces.OnDialogButtonClickListener; import com.kongzue.dialog.util.BaseDialog; import com.kongzue.dialog.util.DialogSettings; import com.kongzue.dialog.v3.MessageDialog; +import com.lzy.okgo.model.HttpParams; import com.navinfo.outdoor.R; import com.navinfo.outdoor.adapter.ChargingPileAdapter; import com.navinfo.outdoor.adapter.PoiRecycleAdapter; import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; +import com.navinfo.outdoor.bean.ChargingStationBean; import com.navinfo.outdoor.bean.Info; import com.navinfo.outdoor.bean.PoiBean; +import com.navinfo.outdoor.bean.PoiSaveBean; +import com.navinfo.outdoor.http.Callback; +import com.navinfo.outdoor.http.HttpInterface; +import com.navinfo.outdoor.http.OkGoBuilder; import com.navinfo.outdoor.room.ChargingPileDao; import com.navinfo.outdoor.room.ChargingPileEntity; import com.navinfo.outdoor.room.PoiDao; import com.navinfo.outdoor.room.PoiDatabase; import com.navinfo.outdoor.room.PoiEntity; +import com.navinfo.outdoor.util.Geohash; import com.navinfo.outdoor.util.PhotoPathUtil; import com.sothree.slidinguppanel.SlidingUpPanelLayout; import com.tencent.tencentmap.mapsdk.maps.model.LatLng; @@ -57,6 +64,7 @@ import com.tencent.tencentmap.mapsdk.maps.model.LatLng; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; +import java.io.File; import java.io.Serializable; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -89,8 +97,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. private CheckBox checkBoxRight; private String phone = null; private Spinner spinnerType; - String[] ctype = new String[]{"全部", "poi", "充电站", "POI录像", "道路录像"};//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", - String[] spinner = new String[]{"存在","不存在","无法验证"}; + String[] ctype = new String[]{ "充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 , + String[] spinner = new String[]{"存在", "不存在", "无法验证"}; private ArrayAdapter adapter; private LinearLayout linearChargingPile; private RecyclerView recyclerStation; @@ -200,10 +208,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Message obtain = Message.obtain(); - obtain.what = Constant.MAIN_CHARGING_STATION; - obtain.obj = isChecked; - EventBus.getDefault().post(obtain); + if (isChecked) { + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_CHARGING_STATION; + obtain.obj = latLng; + EventBus.getDefault().post(obtain); + } else { + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_CHARGING_CHECKED_STATION; + obtain.obj = true; + EventBus.getDefault().post(obtain); + } + } }); checkBoxRight.setVisibility(View.GONE); @@ -216,20 +232,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. public void onItemSelected(AdapterView parent, View view, int position, long id) { switch (position) { case 0: - station_type = 0; - break; - case 1: station_type = 1; break; - case 2: + case 1: station_type = 2; break; - case 3: + case 2: station_type = 3; break; - case 4: + case 3: station_type = 4; break; + } } @@ -332,84 +346,82 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. private void initShowPoi() { // 添加信息: showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity"); - if (showPoiEntity != null) { - String name = showPoiEntity.getName();//名称 - if (name != null &&!name.equals("")) { - editNameContent.setText(name + ""); - } - String address = showPoiEntity.getAddress();//地址 - if (address != null&&! address.equals("")) { - editSiteContent.setText(address); - } - String x = showPoiEntity.getX(); - String y = showPoiEntity.getY(); - if (x != null && y != null) { - latLng = new LatLng(); - latLng.setLatitude(Double.parseDouble(y)); - latLng.setLongitude(Double.parseDouble(x)); - } - String describe = showPoiEntity.getDescribe();//任务描述 - if (describe != null&&!describe.equals("")) { - editDescribe.setText(describe); - } - int station_type = showPoiEntity.getStation_type(); - spinnerType.setSelection(station_type,true); - String telPhone = showPoiEntity.getTelPhone(); - if (telPhone != null&&!telPhone.equals("")) { - phoneData.add(showPoiEntity.getTelPhone()); - poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); - poiRecycleAdapter.setList(poiBeans); - } - linearExist.setVisibility(View.VISIBLE); - if (showPoiEntity.getPhotoInfo() != null) { - for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { - String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); - String[] split = photo.split("/"); - if (split[split.length - 1].startsWith("a")) { - Glide.with(getActivity()).load(photo).into(ivPanorama); - ivPanorama.setTag(photo); - } else if (split[split.length - 1].startsWith("b")) { - Glide.with(getActivity()).load(photo).into(ivName); - ivName.setTag(photo); - } else if (split[split.length - 1].startsWith("c")) { - Glide.with(getActivity()).load(photo).into(ivInternal); - ivInternal.setTag(photo); - } else if (split[split.length - 1].startsWith("d")) { - Glide.with(getActivity()).load(photo).into(ivElse); - ivElse.setTag(photo); - } else if (split[split.length - 1].startsWith("e")) { - Glide.with(getActivity()).load(photo).into(ivScutcheon); - ivScutcheon.setTag(photo); - } - } - } - ArrayList chargingPileEntities = new ArrayList<>(); - - new Thread(new Runnable() { - @Override - public void run() { - List chargingPile = chargingPileDao.getChargingPile(); - for (int i = 0; i < chargingPile.size(); i++) { - ChargingPileEntity chargingPileEntity = chargingPile.get(i); - if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) { - chargingPileEntities.add(chargingPileEntity); - } - } - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - chargingPileAdapter.setChargingPileEntities(chargingPileEntities); - } - }); - - } - }).start(); - - } else { - poiBeans.add(new PoiBean("电话*", phone, R.drawable.icon_add_bg)); - poiRecycleAdapter.setList(poiBeans); + String name = showPoiEntity.getName();//名称 + if (name != null && !name.equals("")) { + editNameContent.setText(name + ""); + } + String address = showPoiEntity.getAddress();//地址 + if (address != null && !address.equals("")) { + editSiteContent.setText(address); + } + String x = showPoiEntity.getX(); + String y = showPoiEntity.getY(); + if (x != null && y != null) { + latLng = new LatLng(); + latLng.setLatitude(Double.parseDouble(y)); + latLng.setLongitude(Double.parseDouble(x)); + } + String describe = showPoiEntity.getDescribe();//任务描述 + if (describe != null && !describe.equals("")) { + editDescribe.setText(describe); + } + int station_type = showPoiEntity.getStation_type(); + spinnerType.setSelection(station_type, true); + String telPhone = showPoiEntity.getTelPhone(); + if (telPhone != null && !telPhone.equals("")) { + phoneData.add(showPoiEntity.getTelPhone()); + poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); + } else { + poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg)); + } + poiRecycleAdapter.setList(poiBeans); + linearExist.setVisibility(View.VISIBLE); + if (showPoiEntity.getPhotoInfo() != null) { + for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { + String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); + String[] split = photo.split("/"); + if (split[split.length - 1].startsWith("a")) { + Glide.with(getActivity()).load(photo).into(ivPanorama); + ivPanorama.setTag(photo); + } else if (split[split.length - 1].startsWith("b")) { + Glide.with(getActivity()).load(photo).into(ivName); + ivName.setTag(photo); + } else if (split[split.length - 1].startsWith("c")) { + Glide.with(getActivity()).load(photo).into(ivInternal); + ivInternal.setTag(photo); + } else if (split[split.length - 1].startsWith("d")) { + Glide.with(getActivity()).load(photo).into(ivElse); + ivElse.setTag(photo); + } else if (split[split.length - 1].startsWith("e")) { + Glide.with(getActivity()).load(photo).into(ivScutcheon); + ivScutcheon.setTag(photo); + } + } + } + ArrayList chargingPileEntities = new ArrayList<>(); + + new Thread(new Runnable() { + @Override + public void run() { + List chargingPile = chargingPileDao.getChargingPile(); + for (int i = 0; i < chargingPile.size(); i++) { + ChargingPileEntity chargingPileEntity = chargingPile.get(i); + if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) { + chargingPileEntities.add(chargingPileEntity); + } + } + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + chargingPileAdapter.setChargingPileEntities(chargingPileEntities); + } + }); + + } + }).start(); + if (showPoiEntity.getTaskId()!=0){ + initPile(); } - initPile(); } private void initPile() { @@ -497,7 +509,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. public void onGranted(List permissions, boolean all) { if (all) { //保存数据库: - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; List infoPhoto = new ArrayList<>(); String name = editNameContent.getText().toString().trim();//名称 if (name == null || name.equals("")) { @@ -517,6 +529,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show(); return; } else { + String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude); + poiEntity.setGeoWkt(encode); poiEntity.setX(String.valueOf(latLng.longitude)); poiEntity.setY(String.valueOf(latLng.latitude)); } @@ -578,11 +592,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. } else { aBoolean = false; } - if (showPoiEntity!=null){ - if (showPoiEntity.getTaskId()!=0){ - poiEntity.setTaskId(showPoiEntity.getTaskId()); - } - } DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); @@ -594,17 +603,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. new Thread(new Runnable() { @Override public void run() { - List allPoi = poiDao.getAllPoi(); - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - poiEntity.setTaskId(allPoi.size() + 1); - } - }); poiDao.insertPoiEntity(poiEntity); } }).start(); - onBackPressed(); + chargingStationSaveByWork(poiEntity); + // onBackPressed(); } else { Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show(); } @@ -626,6 +629,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. obtain.what = Constant.TREASURE_FRAGMENT; obtain.obj = false; EventBus.getDefault().post(obtain); + ArrayList chargingStationList = new ArrayList<>(); + break; case R.id.tv_examine: Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show(); @@ -660,8 +665,42 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. } } + private void chargingStationSaveByWork(PoiEntity poiEntity) { + showLoadingDialog(); + HttpParams httpParams = new HttpParams(); + httpParams.put("id",poiEntity.getTaskId()); + httpParams.put("sptype", poiEntity.getStation_type()); + httpParams.put("name", poiEntity.getName()); + httpParams.put("address", poiEntity.getAddress()); + httpParams.put("telephone", poiEntity.getTelPhone()); + httpParams.put("memo", poiEntity.getMemo()); + httpParams.put("geo",poiEntity.getGeoWkt()); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(HttpInterface.SUBMIT_CTASK) + .method(OkGoBuilder.GET) + .cls(ChargingStationBean.class) + .params(httpParams) + .callback(new Callback() { + @Override + public void onSuccess(ChargingStationBean chargingStationBean, int id) { + dismissLoadingDialog(); + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + // body = poiSaveBean.getBody(); + Log.d("TAG", " 其他其他其他其他"+chargingStationBean.getBody()); + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + } + private String initShowStation() { - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; List infoPhoto = new ArrayList<>(); String name = editNameContent.getText().toString().trim();//名称 if (name != null && !name.equals("")) { @@ -683,27 +722,27 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiEntity.setTelPhone(phoneData.get(0)); } String tagPanorama = (String) ivPanorama.getTag(); - if (tagPanorama != null&&!tagPanorama.equals("")) { + if (tagPanorama != null && !tagPanorama.equals("")) { infoPhoto.add(new Info(tagPanorama)); } String tagName = (String) ivName.getTag(); - if (tagName != null&&!tagName.equals("")) { + if (tagName != null && !tagName.equals("")) { infoPhoto.add(new Info(tagName)); } String tagInternal = (String) ivInternal.getTag(); - if (tagInternal != null&&!tagInternal.equals("")) { + if (tagInternal != null && !tagInternal.equals("")) { infoPhoto.add(new Info(tagInternal)); } String tagElse = (String) ivElse.getTag(); - if (tagElse != null&&!tagElse.equals("")) { + if (tagElse != null && !tagElse.equals("")) { infoPhoto.add(new Info(tagElse)); } String tagScutcheon = (String) ivScutcheon.getTag(); - if (tagScutcheon != null&&!tagScutcheon.equals("")) { + if (tagScutcheon != null && !tagScutcheon.equals("")) { infoPhoto.add(new Info(tagScutcheon)); } - if (showPoiEntity!=null){ - if (showPoiEntity.getTaskId()!=0){ + if (showPoiEntity != null) { + if (showPoiEntity.getTaskId() != 0) { poiEntity.setTaskId(showPoiEntity.getTaskId()); } } @@ -717,18 +756,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiEntity.setType(2); poiEntity.setTaskStatus(2); poiEntity.setIsLocalData(1); - /* new Thread(new Runnable() { - @Override - public void run() { - List allPoi = poiDao.getAllPoi(); - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - poiEntity.setTaskId(allPoi.size() + 1); - } - }); - } - }).start();*/ String newPoiEntity = new Gson().toJson(poiEntity); return newPoiEntity; } @@ -752,7 +779,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. SharedPreferences.Editor edit = poi.edit(); //根据要保存的数据的类型,调用对应的put方法, - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; List infoPhoto = new ArrayList<>(); String name = editNameContent.getText().toString().trim();//名称 if (name != null && !name.equals("")) { @@ -774,27 +801,27 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiEntity.setTelPhone(phoneData.get(0)); } String tagPanorama = (String) ivPanorama.getTag(); - if (tagPanorama != null&&!tagPanorama.equals("")) { + if (tagPanorama != null && !tagPanorama.equals("")) { infoPhoto.add(new Info(tagPanorama)); } String tagName = (String) ivName.getTag(); - if (tagName != null&&!tagName.equals("")) { + if (tagName != null && !tagName.equals("")) { infoPhoto.add(new Info(tagName)); } String tagInternal = (String) ivInternal.getTag(); - if (tagInternal != null&&!tagInternal.equals("")) { + if (tagInternal != null && !tagInternal.equals("")) { infoPhoto.add(new Info(tagInternal)); } String tagElse = (String) ivElse.getTag(); - if (tagElse != null&&!tagElse.equals("")) { + if (tagElse != null && !tagElse.equals("")) { infoPhoto.add(new Info(tagElse)); } String tagScutcheon = (String) ivScutcheon.getTag(); - if (tagScutcheon != null&&!tagScutcheon.equals("")) { + if (tagScutcheon != null && !tagScutcheon.equals("")) { infoPhoto.add(new Info(tagScutcheon)); } - if (showPoiEntity!=null){ - if (showPoiEntity.getTaskId()!=0){ + if (showPoiEntity != null) { + if (showPoiEntity.getTaskId() != 0) { poiEntity.setTaskId(showPoiEntity.getTaskId()); } } @@ -808,18 +835,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiEntity.setType(2); poiEntity.setTaskStatus(2); poiEntity.setIsLocalData(1); - /* new Thread(new Runnable() { - @Override - public void run() { - List allPoi = poiDao.getAllPoi(); - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - poiEntity.setTaskId(allPoi.size() + 1); - } - }); - } - }).start();*/ String newPoiEntity = new Gson().toJson(poiEntity); //以键值对的形式添加新值。 edit.putString("poiEntity", newPoiEntity); diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/FilterFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/FilterFragment.java index 612b7ed..3648b5e 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/FilterFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/FilterFragment.java @@ -176,10 +176,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi @Subscribe public void onEvent(Message data) { - if (data.what == Constant.JOB_SEARCH_WORD) { + if (data.what == Constant.JOB_SEARCH_POI_WORD) { + allPoi = (List) data.obj; + } else if (data.what == Constant.JOB_SEARCH_WORD) { poiEntities.clear(); JobSearchBean jobSearchBean = (JobSearchBean) data.obj; - if (jobSearchBean!=null){ + if (jobSearchBean != null) { List list = jobSearchBean.getBody().getList(); for (int i = 0; i < list.size(); i++) { PoiEntity poiEntity = new PoiEntity(); @@ -203,13 +205,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi poiEntities.add(poiEntity); } } - if (allPoi!=null){ + if (allPoi != null) { poiEntities.addAll(allPoi); } filterAdapter.setAllPoi(poiEntities); - } else if (data.what == Constant.JOB_SEARCH_POI_WORD) { - allPoi = (List) data.obj; } } @@ -222,23 +222,58 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi clNumber = findViewById(R.id.cl_number); clNumber.setOnClickListener(this::onClick); tvNumber = findViewById(R.id.tv_number); + tvNumber.setText(Constant.NUMBER+""); clPhotograph = findViewById(R.id.cl_photograph); clPhotograph.setOnClickListener(this::onClick); tvPhotograph = findViewById(R.id.tv_photograph); + if (Constant.LIMIT_TTPE == -1) {//"全部", "普通任务", "专属任务" + tvPhotograph.setText("全部"); + } else if (Constant.LIMIT_TTPE == 0) { + tvPhotograph.setText("普通任务"); + } else if (Constant.LIMIT_TTPE == 1) { + tvPhotograph.setText("专属任务"); + } clExclusive = findViewById(R.id.cl_exclusive); clExclusive.setOnClickListener(this::onClick); tvExclusive = findViewById(R.id.tv_exclusive); + if (Constant.TASK_TYPE == -1) {//"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务" + tvExclusive.setText("全部"); + } else if (Constant.TASK_TYPE == 1) { + tvExclusive.setText("poi"); + } else if (Constant.TASK_TYPE == 2) { + tvExclusive.setText("充电站"); + } else if (Constant.TASK_TYPE == 3) { + tvExclusive.setText("POI录像"); + } else if (Constant.TASK_TYPE == 4) { + tvExclusive.setText("道路录像"); + } else if (Constant.TASK_TYPE == 5) { + tvExclusive.setText("其他"); + } else if (Constant.TASK_TYPE == 6) { + tvExclusive.setText("面状任务"); + } clType = findViewById(R.id.cl_type); clType.setOnClickListener(this::onClick); tvType = findViewById(R.id.tv_type); + if (Constant.TASK_STASTUS == -1) { + tvType.setText("全部"); + } else if (Constant.TASK_STASTUS == 1) { + tvType.setText("已领取"); + } else if (Constant.TASK_STASTUS == 2) { + tvType.setText("待提交"); + } else if (Constant.TASK_STASTUS == 3) { + tvType.setText("未领取"); + } + btnFilter = findViewById(R.id.btn_filter); btnFilter.setOnClickListener(this::onClick); recyclerFilter = findViewById(R.id.recycler_filter); + //设置下划线 recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerFilter.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin); recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate); + //取消上啦加载下拉刷新 recyclerFilter.setPullRefreshEnabled(false); recyclerFilter.setLoadingMoreEnabled(false); @@ -249,30 +284,29 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public void onRefresh() { - } + } @Override public void onLoadMore() { + } }); filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() { @Override public void item(PoiEntity poiEntity, boolean aBoolean) { - if (aBoolean) { + if (aBoolean) {//本地 Message obtain = Message.obtain(); obtain.what = Constant.GATHER_GET; obtain.obj = poiEntity; EventBus.getDefault().post(obtain); - } else { + } else {//服务 Message obtain = Message.obtain(); obtain.what = Constant.FILTER_LIST_ITEM; obtain.obj = poiEntity; EventBus.getDefault().post(obtain); } - } }); - } @Override @@ -306,7 +340,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi obtain.what = Constant.JOB_WORD_MONITOR; obtain.obj = true; EventBus.getDefault().post(obtain); - } }); break; @@ -334,13 +367,15 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi } }); break; + + /** - * 1 "POI" - * 2 "充电站" - * 3 "POI录像" - * 4 "道路录像" - * 5 "其他" - * 6 "面状任务" + 1 "POI" + 2 "充电站" + 3 "POI录像" + 4 "道路录像" + 5 "其他" + 6 "面状任务" */ case R.id.cl_exclusive: BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() { diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java index 4d7720f..bcf72a2 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java @@ -7,14 +7,21 @@ import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.TextView; +import android.widget.Toast; +import com.lzy.okgo.model.HttpParams; import com.navinfo.outdoor.R; import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseFragment; +import com.navinfo.outdoor.bean.PolygonTaskBean; +import com.navinfo.outdoor.bean.ReceivedBean; import com.navinfo.outdoor.bean.ReceivedPoiBean; +import com.navinfo.outdoor.bean.UnPolygonTaskBean; import com.navinfo.outdoor.http.Callback; import com.navinfo.outdoor.http.HttpInterface; import com.navinfo.outdoor.http.OkGoBuilder; +import com.navinfo.outdoor.room.ChargingPileDao; +import com.navinfo.outdoor.room.ChargingPileEntity; import com.navinfo.outdoor.room.PoiDao; import com.navinfo.outdoor.room.PoiDatabase; import com.navinfo.outdoor.room.PoiEntity; @@ -24,6 +31,8 @@ import com.vividsolutions.jts.geom.Geometry; import org.greenrobot.eventbus.EventBus; +import java.util.List; + /** * 领取采集的fragment */ @@ -32,19 +41,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe; private PoiEntity poiEntity; private PoiDao poiDao; - private PoiEntity poiListEntity; - private int aSave; - + private ChargingPileDao chargingPileDao; public static GatherGetFragment newInstance(Bundle bundle) { GatherGetFragment fragment = new GatherGetFragment(); fragment.setArguments(bundle); return fragment; } + @Override public void onResume() { super.onResume(); getFocus(); } + //主界面获取焦点 private void getFocus() { getView().setFocusableInTouchMode(true); @@ -64,15 +73,18 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe } }); } + @Override protected int getLayout() { return R.layout.fragment_gather_get; } + @Override protected void initView() { super.initView(); PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext()); poiDao = poiDatabase.getPoiDao(); + chargingPileDao = poiDatabase.getChargingPileDao(); tvTitle = findViewById(R.id.tv_title); tvMoney = findViewById(R.id.tv_money); tvTime = findViewById(R.id.tv_time); @@ -87,194 +99,445 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe btnFinishGather = findViewById(R.id.btn_finish_gather);//结束采集 btnFinishGather.setOnClickListener(this::onClick); Bundle arguments = getArguments(); - if (arguments != null) { + if (arguments != null) {//poiEntity poiEntity = (PoiEntity) arguments.getSerializable("poiEntity"); - aSave = arguments.getInt("aSave", 0); - if (aSave == 1) {//普通任务 - if (poiEntity != null) { - tvTitle.setText(poiEntity.getName()); - if (poiEntity.getPrecision() == null) { - tvMoney.setText("¥" + 0); - } else { - tvMoney.setText("¥" + poiEntity.getPrecision()); - } - tvTime.setText("到期时间:" + poiEntity.getCreateTime()); - tvDescribe.setText("任务描述:" + poiEntity.getDescribe()); - if (poiEntity.getDist() != null) { - tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km"); - } + if (poiEntity != null) { + tvTitle.setText(poiEntity.getName()); + if (poiEntity.getPrecision() == null) { + tvMoney.setText("¥" + 0); + } else { + tvMoney.setText("¥" + poiEntity.getPrecision()); } - int taskStatus = poiEntity.getTaskStatus(); - switch (taskStatus) { - case 0://未领取 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.VISIBLE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.GONE); - break; - case 1://已领取 - btnCancelGet.setVisibility(View.VISIBLE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.GONE); - break; - case 2://已保存 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.VISIBLE); - break; - case 3://已提交 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.GONE); - btnFinishGather.setVisibility(View.GONE); - break; - } - } else if (aSave == 2) {//面妆任务 - if (poiEntity != null) { - tvTitle.setText(poiEntity.getName()); - if (poiEntity.getPrecision() == null) { - tvMoney.setText("¥" + 0); - } else { - tvMoney.setText("¥" + poiEntity.getPrecision()); - } - tvTime.setText("到期时间:" + poiEntity.getCreateTime()); - tvDescribe.setText("任务描述:" + poiEntity.getDescribe()); - if (poiEntity.getDist() != null) { - tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist())/1000) + "km"); - } - } - int taskStatus = poiEntity.getTaskStatus(); - switch (taskStatus) { - case 0://未领取 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.VISIBLE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.GONE); - break; - - case 1://已领取 - btnCancelGet.setVisibility(View.VISIBLE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.GONE); - break; - - case 2://已保存 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.VISIBLE); - btnFinishGather.setVisibility(View.VISIBLE); - break; - - case 3://已提交 - btnCancelGet.setVisibility(View.GONE); - btnGetTask.setVisibility(View.GONE); - btnGather.setVisibility(View.GONE); - btnFinishGather.setVisibility(View.GONE); - break; - + tvTime.setText("到期时间:" + poiEntity.getCreateTime()); + tvDescribe.setText("任务描述:" + poiEntity.getDescribe()); + if (poiEntity.getDist() != null) { + tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km"); } } + int taskStatus = poiEntity.getTaskStatus(); + switch (taskStatus) { + case 0://未领取 + btnCancelGet.setVisibility(View.GONE); + btnGetTask.setVisibility(View.VISIBLE); + btnGather.setVisibility(View.VISIBLE); + btnFinishGather.setVisibility(View.GONE); + break; + case 1://已领取 + btnCancelGet.setVisibility(View.VISIBLE); + btnGetTask.setVisibility(View.GONE); + btnGather.setVisibility(View.VISIBLE); + btnFinishGather.setVisibility(View.GONE); + break; + case 2://已保存 + btnCancelGet.setVisibility(View.GONE); + btnGetTask.setVisibility(View.GONE); + btnGather.setVisibility(View.VISIBLE); + btnFinishGather.setVisibility(View.VISIBLE); + break; + case 3://已提交 + btnCancelGet.setVisibility(View.GONE); + btnGetTask.setVisibility(View.GONE); + btnGather.setVisibility(View.GONE); + btnFinishGather.setVisibility(View.GONE); + break; + } } } + @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_cancel_get://结束领取 - poiEntity.setTaskStatus(0); - btnGetTask.setVisibility(View.VISIBLE); - btnCancelGet.setVisibility(View.GONE); - new Thread(new Runnable() { - @Override - public void run() { - if (poiListEntity!=null){ - poiDao.deletePoiEntity(poiListEntity); - }else { - poiDao.deletePoiEntity(poiEntity); - } - } - }).start(); - break; - case R.id.btn_get_task://领取任务 - poiEntity.setTaskStatus(1); - btnGetTask.setVisibility(View.GONE); - btnCancelGet.setVisibility(View.VISIBLE); - //网络请求: if (poiEntity != null) { - if (poiEntity.getType() == 1) {//poi的领取类型 - receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK+"/"+poiEntity.getTaskId() + "", false); - } else if (poiEntity.getType() == 5) { - receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK+"/"+poiEntity.getTaskId() + "", false); + int type = poiEntity.getType(); + if (type == 6) { + initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId()); + } else { + poiEntity.setTaskStatus(0); + new Thread(new Runnable() { + @Override + public void run() { + + } + }).start(); } } break; - case R.id.btn_gather://立即采集 - if (poiEntity != null) { + case R.id.btn_get_task://领取任务 + if (poiEntity != null) { + int type = poiEntity.getType(); + if (type == 6) { + initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false); + } else { + btnGetTask.setVisibility(View.GONE); + btnCancelGet.setVisibility(View.VISIBLE); + //网络请求: if (poiEntity.getType() == 1) {//poi的领取类型 - receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK+"/"+poiEntity.getTaskId() + "", true); - } else if (poiEntity.getType() == 5) { - receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK+"/"+poiEntity.getTaskId() + "", true); + receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), false); + } else if (poiEntity.getType() == 5) {//其他的领取类型 + receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK , poiEntity.getTaskId(), false); + } else if (poiEntity.getType() == 2) {//充电站的领取类型 + chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),false); } + } + } + + break; + case R.id.btn_gather://立即采集 + if (poiEntity != null) { + int type = poiEntity.getType(); + if (type == 6) { + int taskStatus = poiEntity.getTaskStatus(); + if (taskStatus != 1) { + initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true); + } else { + initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId()); + } + + }else { + if (poiEntity.getType() == 1) {//poi的领取类型 + receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), true); + } else if (poiEntity.getType() == 5) {//其他的领取类型 + receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true); + }else if (poiEntity.getType() == 2){//充电站的领取类型 + chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),true); + } + btnFinishGather.setVisibility(View.VISIBLE); + btnGather.setVisibility(View.GONE); + } } break; case R.id.btn_finish_gather://结束采集 - btnFinishGather.setVisibility(View.VISIBLE); - new Thread(new Runnable() { - @Override - public void run() { - if (poiListEntity!=null){ - poiDao.deletePoiEntity(poiListEntity); - }else { - poiDao.deletePoiEntity(poiEntity); - } + if (poiEntity != null) { + int type = poiEntity.getType(); + if (type == 6) { + initSubmitPolygonTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity.getTaskId()); + } else { + btnGather.setVisibility(View.VISIBLE); + btnFinishGather.setVisibility(View.GONE); + new Thread(new Runnable() { + @Override + public void run() { + + } + }).start(); } - }).start(); + } break; } } + /** - * @param url 不同任务类型对应的url + * @param url 筛选充电站领取任务 */ - private void receivedTaskByNet(String url, boolean isSaver) { + private void chargingTaskByWork(String url,int taskId, boolean isSaver) { + showLoadingDialog(); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(url+"/"+taskId) + .method(OkGoBuilder.GET) + .cls(ReceivedBean.class) + .callback(new Callback() { + @Override + public void onSuccess(ReceivedBean response, int id) { + dismissLoadingDialog(); + ReceivedBean.BodyBean listBean = response.getBody(); + PoiEntity chargingListEntity = new PoiEntity(); + chargingListEntity.setTaskId(taskId); + chargingListEntity.setStation_type(listBean.getSptype()); + chargingListEntity.setName(listBean.getName()); + chargingListEntity.setPrecision(listBean.getPrice() + ""); + chargingListEntity.setAddress(listBean.getAddress()); + chargingListEntity.setTelPhone(listBean.getTelephone() + ""); + chargingListEntity.setType(Integer.valueOf(listBean.getType())); + String geo = listBean.getGeo(); + chargingListEntity.setGeoWkt(geo); + Geometry geometry = GeometryTools.createGeometry(geo); + if (geometry.getGeometryType().equals("Point")) {//点 + LatLng latLng = GeometryTools.createLatLng(geo); + chargingListEntity.setX(latLng.longitude + ""); + chargingListEntity.setY(latLng.latitude + ""); + } else if (geometry.getGeometryType().equals("LineString")) {//线 + List latLineString = GeometryTools.getLatLngs(geo); + chargingListEntity.setX(latLineString.get(0).longitude + ""); + chargingListEntity.setY(latLineString.get(0).latitude + ""); + } else if (geometry.getGeometryType().equals("Polygon")) {//面 + List latPolygon = GeometryTools.getLatLngs(geo); + chargingListEntity.setX(latPolygon.get(0).longitude + ""); + chargingListEntity.setY(latPolygon.get(0).latitude + ""); + } + //充电桩 + List csTaskList = response.getBody().getCsTaskList(); + for (int i = 0; i < csTaskList.size(); i++) { + ChargingPileEntity chargingPileEntity = new ChargingPileEntity(); + chargingPileEntity.setFid(taskId); + chargingPileEntity.setName(csTaskList.get(i).getName()); + chargingPileEntity.setMemo(csTaskList.get(i).getAddress()); + chargingPileEntity.setP(csTaskList.get(i).getGeo()); + new Thread(new Runnable() { + @Override + public void run() { + chargingPileDao.insertChargingPileEntity(chargingPileEntity); + } + }).start(); + } + + new Thread(new Runnable() { + @Override + public void run() { + poiDao.insertPoiEntity(chargingListEntity); + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + btnFinishGather.setVisibility(View.VISIBLE); + if (isSaver) { + Message obtain = Message.obtain(); + obtain.what = Constant.GATHER_GET_MAP; + obtain.obj = chargingListEntity; + EventBus.getDefault().post(obtain); + } + } + }); + } + }).start(); + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + + } + + /** + * @param url 面妆任务领取任务 + */ + private void initPolygonTask(String url, int taskId, boolean aBoolean) { + if (taskId == 0) { + Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show(); + return; + } + showLoadingDialog(); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(url + "/" + taskId) + .method(OkGoBuilder.GET) + .cls(PolygonTaskBean.class) + .callback(new Callback() { + @Override + public void onSuccess(PolygonTaskBean response, int id) { + dismissLoadingDialog(); + if (response.getCode() == 200) { + PolygonTaskBean.BodyBean listBean = response.getBody(); + PoiEntity polygonEntity = new PoiEntity(); + polygonEntity.setTaskId(listBean.getId()); + polygonEntity.setName(listBean.getName()); + polygonEntity.setType(Integer.valueOf(listBean.getType())); + String geo = listBean.getGeo(); + polygonEntity.setGeoWkt(geo); + Geometry geometry = GeometryTools.createGeometry(geo); + if (geometry.getGeometryType().equals("Point")) {//点 + LatLng latLng = GeometryTools.createLatLng(geo); + polygonEntity.setX(latLng.longitude + ""); + polygonEntity.setY(latLng.latitude + ""); + } else if (geometry.getGeometryType().equals("LineString")) {//线 + List latLineString = GeometryTools.getLatLngs(geo); + polygonEntity.setX(latLineString.get(0).longitude + ""); + polygonEntity.setY(latLineString.get(0).latitude + ""); + } else if (geometry.getGeometryType().equals("Polygon")) {//面 + List latPolygon = GeometryTools.getLatLngs(geo); + polygonEntity.setX(latPolygon.get(0).longitude + ""); + polygonEntity.setY(latPolygon.get(0).latitude + ""); + } + polygonEntity.setTaskStatus(1); + new Thread(new Runnable() { + @Override + public void run() { + poiDao.insertPoiEntity(polygonEntity); + } + }).start(); + btnGetTask.setVisibility(View.GONE); + btnCancelGet.setVisibility(View.VISIBLE); + if (aBoolean) { + initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId()); + } + + } + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + } + + /** + * @param url 面妆任务结束领取 ,结束采集 + */ + private void initUnPolygonTask(String url, int taskId) { + if (taskId == 0) { + Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show(); + return; + } + showLoadingDialog(); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(url + "/" + taskId) + .method(OkGoBuilder.GET) + .cls(UnPolygonTaskBean.class) + .callback(new Callback() { + @Override + public void onSuccess(UnPolygonTaskBean response, int id) { + dismissLoadingDialog(); + if (response.getCode() == 200) { + new Thread(new Runnable() { + @Override + public void run() { + PoiEntity poiEntity = poiDao.getPoiEntity(taskId); + poiDao.deletePoiEntity(poiEntity); + } + }).start(); + btnGetTask.setVisibility(View.VISIBLE); + btnCancelGet.setVisibility(View.GONE); + } + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + } + + /** + * @param url 面妆任务立即采集 + */ + private void initCompleteTask(String url, int taskId) { + if (taskId == 0) { + Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show(); + return; + } + showLoadingDialog(); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(url + "/" + taskId) + .method(OkGoBuilder.GET) + .cls(UnPolygonTaskBean.class) + .callback(new Callback() { + @Override + public void onSuccess(UnPolygonTaskBean response, int id) { + dismissLoadingDialog(); + if (response.getCode() == 200) { + btnGather.setVisibility(View.GONE); + btnFinishGather.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + } + + /** + * @param url 面妆任务 结束采集 + */ + private void initSubmitPolygonTask(String url, int taskId) { + if (taskId == 0) { + Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show(); + return; + } showLoadingDialog(); OkGoBuilder.getInstance() .Builder(getActivity()) .url(url) .method(OkGoBuilder.GET) + .params(new HttpParams("id", String.valueOf(taskId))) + .cls(UnPolygonTaskBean.class) + .callback(new Callback() { + @Override + public void onSuccess(UnPolygonTaskBean response, int id) { + dismissLoadingDialog(); + if (response.getCode() == 200) { + new Thread(new Runnable() { + @Override + public void run() { + PoiEntity poiEntity = poiDao.getPoiEntity(taskId); + poiDao.deletePoiEntity(poiEntity); + } + }).start(); + btnGather.setVisibility(View.VISIBLE); + btnFinishGather.setVisibility(View.GONE); + } + } + + @Override + public void onError(Throwable e, int id) { + dismissLoadingDialog(); + Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + e.getMessage()); + } + }).build(); + } + + + /** + * @param url 不同任务类型对应的url + */ + private void receivedTaskByNet(String url,int taskId ,boolean isSaver) { + showLoadingDialog(); + OkGoBuilder.getInstance() + .Builder(getActivity()) + .url(url+"/"+taskId) + .method(OkGoBuilder.GET) .cls(ReceivedPoiBean.class) .callback(new Callback() { @Override public void onSuccess(ReceivedPoiBean response, int id) { dismissLoadingDialog(); ReceivedPoiBean.BodyBean listBean = response.getBody(); - poiListEntity = new PoiEntity(); + PoiEntity poiListEntity = new PoiEntity(); poiListEntity.setTaskId(listBean.getId()); poiListEntity.setName(listBean.getName()); poiListEntity.setAddress(listBean.getAddress()); poiListEntity.setTelPhone(listBean.getTelephone() + ""); poiListEntity.setType(Integer.valueOf(listBean.getType())); String geo = listBean.getGeo(); + poiListEntity.setGeoWkt(geo); Geometry geometry = GeometryTools.createGeometry(geo); if (geometry.getGeometryType().equals("Point")) {//点 LatLng latLng = GeometryTools.createLatLng(geo); poiListEntity.setX(latLng.longitude + ""); poiListEntity.setY(latLng.latitude + ""); } else if (geometry.getGeometryType().equals("LineString")) {//线 - } else if (geometry.getGeometryType().equals("Polygon")) {}//面 - + List latLineString = GeometryTools.getLatLngs(geo); + poiListEntity.setX(latLineString.get(0).longitude + ""); + poiListEntity.setY(latLineString.get(0).latitude + ""); + } else if (geometry.getGeometryType().equals("Polygon")) {//面 + List latPolygon = GeometryTools.getLatLngs(geo); + poiListEntity.setX(latPolygon.get(0).longitude + ""); + poiListEntity.setY(latPolygon.get(0).latitude + ""); + } new Thread(new Runnable() { @Override public void run() { poiDao.insertPoiEntity(poiListEntity); - getActivity().runOnUiThread(new Runnable() { @Override public void run() { btnFinishGather.setVisibility(View.VISIBLE); - if (isSaver&&aSave==1) { + if (isSaver) { Message obtain = Message.obtain(); obtain.what = Constant.GATHER_GET_MAP; obtain.obj = poiListEntity; @@ -284,8 +547,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe }); } }).start(); - } + @Override public void onError(Throwable e, int id) { dismissLoadingDialog(); @@ -293,6 +556,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe } }).build(); } + public static String format5(double value) { return String.format("%.2f", value).toString(); } diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java index 8f40c19..4473693 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java @@ -42,6 +42,7 @@ import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; import com.navinfo.outdoor.bean.Info; import com.navinfo.outdoor.bean.NameAuthenticationBean; +import com.navinfo.outdoor.bean.OtherUploadPicBean; import com.navinfo.outdoor.bean.PoiBean; import com.navinfo.outdoor.bean.PoiSaveBean; import com.navinfo.outdoor.http.Callback; @@ -91,9 +92,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis private RelativeLayout linearExist; private Spinner spinnerExist; - private ArrayList otheruploadList; + private String takePhotoPath; private String takePhotoPath2; + private int body; public static OtherFragment newInstance(Bundle bundle) { OtherFragment fragment = new OtherFragment(); @@ -182,10 +184,18 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Message obtain = Message.obtain(); - obtain.what = Constant.MAIN_OTHER; - obtain.obj = isChecked; - EventBus.getDefault().post(obtain); + if (isChecked){ + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_OTHER; + obtain.obj = latLng; + EventBus.getDefault().post(obtain); + }else { + Message obtain = Message.obtain(); + obtain.what = Constant.MAIN_CHECKED_OTHER; + obtain.obj = true; + EventBus.getDefault().post(obtain); + } + } }); editTaskName = findViewById(R.id.et_task_name); @@ -299,9 +309,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis public void onGranted(List permissions, boolean all) { if (all) { //保存数据库: - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; List infoList = new ArrayList<>(); - String name = editTaskName.getText().toString().trim();//名称 if (name == null || name.equals("")) { Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show(); @@ -314,6 +323,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show(); return; } else { + String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude); + poiEntity.setGeoWkt(encode); poiEntity.setX(String.valueOf(latLng.longitude)); poiEntity.setY(String.valueOf(latLng.latitude)); } @@ -338,11 +349,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis } else { infoList.add(new Info(tagPictures)); } - if (showPoiEntity != null) { - if (showPoiEntity.getTaskId() != 0) { - poiEntity.setTaskId(showPoiEntity.getTaskId()); - } - } poiEntity.setStation_type(station_type); poiEntity.setPhotoInfo(infoList); DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -361,7 +367,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis } }).start(); otherSaveByNetWork(poiEntity); - onBackPressed(); + // onBackPressed(); } else { Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show(); } @@ -379,43 +385,52 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis break; case R.id.btn_other_uploading: - otherUploadByNet(); + ArrayList otherUploadList = new ArrayList<>(); + String tagPicture = (String) ivPicture.getTag(); + if (tagPicture != null) { + otherUploadList.add(new File(tagPicture)); + } + String tagPictures = (String) ivPictures.getTag(); + if (tagPictures != null) { + otherUploadList.add(new File(tagPictures)); + } + if (body!=0){ + otherUploadByNet(body,otherUploadList); + }else { + Toast.makeText(getActivity(), "请保存本地", Toast.LENGTH_SHORT).show(); + } + break; } } - private void otherUploadByNet() { - showLoadingDialog(); - otheruploadList = new ArrayList<>(); - File otherUploadFile = new File(takePhotoPath); - File otherUploadFile2 = new File(takePhotoPath2); - if (!otherUploadFile.exists() || !otherUploadFile2.exists()) { - Toast.makeText(getContext(), "照片不能为空", Toast.LENGTH_SHORT).show(); + private void otherUploadByNet(int body, List otherUploadList) { + if (body == 0 ){ + Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show(); return; } - otheruploadList.add(otherUploadFile); - otheruploadList.add(otherUploadFile2); + showLoadingDialog(); OkGo // 请求方式和请求url - .post(HttpInterface.USER_AUTH_ADD) + .post(HttpInterface.OTHER_TASK_UPLOAD_PIC) // 请求的 tag, 主要用于取消对应的请求 - .params("userid", "1") - .addFileParams("file", otheruploadList) + .params("auditId", body) + .addFileParams("file", otherUploadList) .tag(this) - .execute(new DialogCallback(NameAuthenticationBean.class) { + .execute(new DialogCallback(OtherUploadPicBean.class) { @Override - public void onSuccess(Response response) { + public void onSuccess(Response response) { dismissLoadingDialog(); + Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show(); Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss"); - } @Override - public void onError(Response response) { + public void onError(Response response) { super.onError(response); dismissLoadingDialog(); - Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show(); - Log.d("TAG", "onError: " + response.message()); + Toast.makeText(getActivity(), response.code()+"", Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + response.code()); } }); @@ -427,9 +442,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis httpParams.put("type", poiEntity.getStation_type()); httpParams.put("taskId", poiEntity.getTaskId()); httpParams.put("name", poiEntity.getName()); - httpParams.put("existence", "1"); - String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX())); - httpParams.put("geo", encode); + httpParams.put("existence", poiEntity.getExistence()); + httpParams.put("geo", poiEntity.getGeoWkt()); httpParams.put("memo", poiEntity.getMemo()); OkGoBuilder.getInstance() @@ -443,6 +457,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis public void onSuccess(PoiSaveBean poiSaveBean, int id) { dismissLoadingDialog(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + body = poiSaveBean.getBody(); + Log.d("TAG", " 其他其他其他其他"+poiSaveBean.getBody()); } @Override @@ -466,7 +482,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis //获取Editor对象 SharedPreferences.Editor edit = poi.edit(); //根据要保存的数据的类型,调用对应的put方法, - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity =showPoiEntity; ArrayList arrayList = new ArrayList<>(); String name = editTaskName.getText().toString().trim();//名称 if (name != null && !name.equals("")) { diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java index 96f6b3f..711a1ab 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java @@ -49,6 +49,7 @@ import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; import com.navinfo.outdoor.bean.Info; import com.navinfo.outdoor.bean.NameAuthenticationBean; +import com.navinfo.outdoor.bean.OtherUploadPicBean; import com.navinfo.outdoor.bean.PoiBean; import com.navinfo.outdoor.bean.PoiSaveBean; import com.navinfo.outdoor.http.Callback; @@ -70,6 +71,7 @@ import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; import java.util.List; @@ -98,16 +100,17 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe private CheckBox checkBoxRight; private PoiEntity showPoiEntity; private LatLng latLng; - String[] spinner = new String[]{"存在","不存在","无法验证"}; + String[] spinner = new String[]{"存在", "不存在", "无法验证"}; private RelativeLayout linearExist; private Spinner spinnerExist; - private ArrayList poiUploadList; + //获取的拍照图片 private String takePhotoPath2; private String takePhotoPath5; private String takePhotoPath4; private String takePhotoPath3; private String takePhotoPath1; + private Integer body; public static PoiFragment newInstance(Bundle bundle) { PoiFragment fragment = new PoiFragment(); @@ -172,10 +175,18 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Message obtain = Message.obtain(); - obtain.what = Constant.TREASURE_WORD; - obtain.obj = isChecked; - EventBus.getDefault().post(obtain); + if (isChecked) { + Message obtain = Message.obtain(); + obtain.what = Constant.TREASURE_WORD; + obtain.obj = latLng; + EventBus.getDefault().post(obtain); + } else { + Message obtain = Message.obtain(); + obtain.what = Constant.TREASURE_CHECKED_WORD; + obtain.obj = true; + EventBus.getDefault().post(obtain); + } + } }); checkBoxRight.setVisibility(View.GONE); @@ -269,54 +280,54 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe private void initShowPoi() { // 添加信息: showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity"); - if (showPoiEntity != null) { - String name = showPoiEntity.getName();//名称 - if (name != null && !name.equals("")) { - editNameContent.setText(name + ""); - } - String address = showPoiEntity.getAddress();//地址 - if (address != null && !address.equals("")) { - editSiteContent.setText(address); - } - String x = showPoiEntity.getX(); - String y = showPoiEntity.getY(); - if (x != null && y != null) { - latLng = new LatLng(); - latLng.setLatitude(Double.parseDouble(y)); - latLng.setLongitude(Double.parseDouble(x)); - } - String describe = showPoiEntity.getDescribe();//任务描述 - if (describe != null && !describe.equals("")) { - editDescribe.setText(describe); - } - String telPhone = showPoiEntity.getTelPhone(); - if (telPhone != null && !telPhone.equals("")) { - phoneData.add(showPoiEntity.getTelPhone()); - poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); - poiRecycleAdapter.setList(poiBeans); + String name = showPoiEntity.getName();//名称 + if (name != null && !name.equals("")) { + editNameContent.setText(name + ""); + } + String address = showPoiEntity.getAddress();//地址 + if (address != null && !address.equals("")) { + editSiteContent.setText(address); + } + String x = showPoiEntity.getX(); + String y = showPoiEntity.getY(); + if (x != null && y != null) { + latLng = new LatLng(); + latLng.setLatitude(Double.parseDouble(y)); + latLng.setLongitude(Double.parseDouble(x)); + } + String describe = showPoiEntity.getDescribe();//任务描述 + if (describe != null && !describe.equals("")) { + editDescribe.setText(describe); + } + String telPhone = showPoiEntity.getTelPhone(); + if (telPhone != null && !telPhone.equals("")) { + phoneData.add(showPoiEntity.getTelPhone()); + poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); - } - linearExist.setVisibility(View.VISIBLE); - if (showPoiEntity.getPhotoInfo() != null) { - for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { - String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); - String[] split = photo.split("/"); - if (split[split.length - 1].startsWith("a")) { - Glide.with(getActivity()).load(photo).into(ivPanorama); - ivPanorama.setTag(photo); - } else if (split[split.length - 1].startsWith("b")) { - Glide.with(getActivity()).load(photo).into(ivName); - ivName.setTag(photo); - } else if (split[split.length - 1].startsWith("c")) { - Glide.with(getActivity()).load(photo).into(ivInternal); - ivInternal.setTag(photo); - } else if (split[split.length - 1].startsWith("d")) { - Glide.with(getActivity()).load(photo).into(ivCard); - ivCard.setTag(photo); - } else if (split[split.length - 1].startsWith("e")) { - Glide.with(getActivity()).load(photo).into(ivElse); - ivElse.setTag(photo); - } + } else { + poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg)); + } + poiRecycleAdapter.setList(poiBeans); + linearExist.setVisibility(View.VISIBLE); + if (showPoiEntity.getPhotoInfo() != null) { + for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { + String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); + String[] split = photo.split("/"); + if (split[split.length - 1].startsWith("a")) { + Glide.with(getActivity()).load(photo).into(ivPanorama); + ivPanorama.setTag(photo); + } else if (split[split.length - 1].startsWith("b")) { + Glide.with(getActivity()).load(photo).into(ivName); + ivName.setTag(photo); + } else if (split[split.length - 1].startsWith("c")) { + Glide.with(getActivity()).load(photo).into(ivInternal); + ivInternal.setTag(photo); + } else if (split[split.length - 1].startsWith("d")) { + Glide.with(getActivity()).load(photo).into(ivCard); + ivCard.setTag(photo); + } else if (split[split.length - 1].startsWith("e")) { + Glide.with(getActivity()).load(photo).into(ivElse); + ivElse.setTag(photo); } } } else { @@ -371,7 +382,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe public void onGranted(List permissions, boolean all) { if (all) { //保存数据库: - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; ArrayList infoPhoto = new ArrayList<>(); String name = editNameContent.getText().toString().trim();//名称 if (name == null || name.equals("")) { @@ -391,6 +402,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show(); return; } else { + String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude); + poiEntity.setGeoWkt(encode); poiEntity.setX(String.valueOf(latLng.longitude)); poiEntity.setY(String.valueOf(latLng.latitude)); } @@ -434,11 +447,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe if (tagCard != null) { infoPhoto.add(new Info(tagCard)); } - if (showPoiEntity!=null){ - if (showPoiEntity.getTaskId()!=0){ - poiEntity.setTaskId(showPoiEntity.getTaskId()); - } - } poiEntity.setPhotoInfo(infoPhoto); DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar calendar = Calendar.getInstance(); @@ -455,7 +463,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe } }).start(); poiSaveByNet(poiEntity); - onBackPressed(); + // onBackPressed(); } else { Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show(); } @@ -477,7 +485,29 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe obtain.what = Constant.TREASURE_FRAGMENT; obtain.obj = false; EventBus.getDefault().post(obtain); - poiUploadByNetWork(); + ArrayList poiPicList = new ArrayList<>(); + String tagPanorama = (String) ivPanorama.getTag(); + if (tagPanorama != null) { + poiPicList.add(new File(tagPanorama)); + } + String tagName = (String) ivName.getTag(); + if (tagName!= null) { + poiPicList.add(new File(tagName)); + } + + String tagInternal = (String) ivInternal.getTag(); + if (tagInternal != null) { + poiPicList.add(new File(tagInternal)); + } + String tagElse = (String) ivElse.getTag(); + if (tagElse != null) { + poiPicList.add(new File(tagElse)); + } + String tagCard = (String) ivCard.getTag(); + if (tagCard != null) { + poiPicList.add(new File(tagCard)); + } + poiUploadByNetWork(body,poiPicList); break; case R.id.tv_examine: Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show(); @@ -506,68 +536,47 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe } } - private void poiUploadByNetWork() { - poiUploadList = new ArrayList<>(); - File poiUploadFile1 = new File(takePhotoPath1); - File poiUploadFile2 = new File(takePhotoPath2); - File poiUploadFile3 = new File(takePhotoPath3); - File poiUploadFile4 = new File(takePhotoPath4); - File poiUploadFile5 = new File(takePhotoPath5); - if (!poiUploadFile1.exists()||!poiUploadFile2.exists()||!poiUploadFile3.exists()||!poiUploadFile4.exists()||!poiUploadFile5.exists()){ - Toast.makeText(getActivity(), "照片不能为空", Toast.LENGTH_SHORT).show(); - return; + private void poiUploadByNetWork(int body, ArrayList poiPicList) { + if (body==0){ + Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show(); + Log.e("TAG", "poiUploadByNetWork: "+body+poiPicList); + return; } - poiUploadList.add(poiUploadFile1); - poiUploadList.add(poiUploadFile2); - poiUploadList.add(poiUploadFile3); - poiUploadList.add(poiUploadFile4); - poiUploadList.add(poiUploadFile5); OkGo // 请求方式和请求url - .post(HttpInterface.USER_AUTH_ADD) + .post(HttpInterface.POI_TASK_UPLOAD_PIC) // 请求的 tag, 主要用于取消对应的请求 - .params("auditId", "1") - .addFileParams("file",poiUploadList) + .params("auditId", body) + .addFileParams("file",poiPicList) .tag(this) - .execute(new DialogCallback(NameAuthenticationBean.class) { + .execute(new DialogCallback(OtherUploadPicBean.class) { @Override - public void onSuccess(Response response) { + public void onSuccess(Response otherUploadPicBeanResponse) { dismissLoadingDialog(); - Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss"); + Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onSuccess: " + otherUploadPicBeanResponse.toString() + "sssssssssssss"); } @Override - public void onError(Response response) { + public void onError(Response response) { super.onError(response); dismissLoadingDialog(); - Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show(); - Log.d("TAG", "onError: " + response.message()); + Toast.makeText(getActivity(), response.code()+"", Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onError: " + response.code()+""); } }); } private void poiSaveByNet(PoiEntity poiEntity) { showLoadingDialog(); - HttpParams httpParams = new HttpParams(); - if (poiEntity.getTaskId() != 0) { + HttpParams httpParams = new HttpParams(); httpParams.put("taskId", poiEntity.getTaskId()); - } - if (poiEntity.getName() != null && !poiEntity.getName().equals("")) { httpParams.put("name", poiEntity.getName()); - } - if (poiEntity.getAddress() != null && !poiEntity.getAddress().equals("")) { httpParams.put("address", poiEntity.getAddress()); - } - httpParams.put("existence", "1"); - if (poiEntity.getY() != null && poiEntity.getX() != null) { - String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX())); - httpParams.put("geo", encode); - } - if (poiEntity.getMemo() != null) { + httpParams.put("existence", poiEntity.getExistence()); + httpParams.put("geo", poiEntity.getGeoWkt()); httpParams.put("memo", poiEntity.getMemo()); - } - OkGoBuilder.getInstance() .Builder(getActivity()) .url(HttpInterface.SUBMIT_POI_TASK) @@ -578,7 +587,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe @Override public void onSuccess(PoiSaveBean poiSaveBean, int id) { dismissLoadingDialog(); - Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + + body = poiSaveBean.getBody(); + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + Log.d("TAG", "onSuccess: "+poiSaveBean.getBody()); } @Override @@ -603,7 +615,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe SharedPreferences.Editor edit = poi.edit(); //根据要保存的数据的类型,调用对应的put方法, - PoiEntity poiEntity = new PoiEntity(); + PoiEntity poiEntity = showPoiEntity; ArrayList infoPhoto = new ArrayList<>(); String name = editNameContent.getText().toString().trim();//名称 if (name != null && !name.equals("")) { @@ -644,8 +656,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe if (tagCard != null && !tagCard.equals("")) { infoPhoto.add(new Info(tagCard)); } - if (showPoiEntity!=null){ - if (showPoiEntity.getTaskId()!=0){ + if (showPoiEntity != null) { + if (showPoiEntity.getTaskId() != 0) { poiEntity.setTaskId(showPoiEntity.getTaskId()); } } diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java index e4c82f9..0f98de4 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java @@ -60,6 +60,7 @@ import com.tencent.map.geolocation.TencentLocation; import com.tencent.tencentmap.mapsdk.maps.CameraUpdate; import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory; import com.tencent.tencentmap.mapsdk.maps.MapView; +import com.tencent.tencentmap.mapsdk.maps.Projection; import com.tencent.tencentmap.mapsdk.maps.TencentMap; import com.tencent.tencentmap.mapsdk.maps.UiSettings; import com.tencent.tencentmap.mapsdk.maps.interfaces.Removable; @@ -102,7 +103,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen private ImageView ivRefish; private SlidingUpPanelLayout sliding_layout; private FragmentTransaction fragmentTransaction; - private Marker marker; + private Marker markerPoi; private CheckBox cbFootType; private ImageView ivFilter; private Point screenPosition; //marker的屏幕坐标 @@ -233,6 +234,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag(); PoiEntity poiListEntity = new PoiEntity(); poiListEntity.setTaskId(listBean.getId()); + poiListEntity.setGeoWkt(listBean.getGeo()); poiListEntity.setName(listBean.getName()); poiListEntity.setAddress(listBean.getAddress()); poiListEntity.setTelPhone(listBean.getTelephone() + ""); @@ -253,6 +255,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag(); PoiEntity poiListEntity = new PoiEntity(); poiListEntity.setTaskId(listBean.getId()); + poiListEntity.setGeoWkt(listBean.getGeo()); poiListEntity.setName(listBean.getName()); poiListEntity.setAddress(listBean.getAddress()); poiListEntity.setTelPhone(listBean.getTelephone() + ""); @@ -278,8 +281,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen } private void initList(TencentLocation tencentLocation) { - int task_type=Constant.TASK_TYPE; - int limit_type=Constant.LIMIT_TTPE; + int task_type = Constant.TASK_TYPE; + int limit_type = Constant.LIMIT_TTPE; int taskStatus = Constant.TASK_STASTUS; if (taskStatus == 1 || taskStatus == 2) { Message obtain = Message.obtain(); @@ -305,8 +308,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen .params("date", date) .params("pageSize", Constant.NUMBER) .params("pageNum", "1") - .params("type",task_type) - .params("isExclusive",limit_type) + .params("type", task_type) + .params("isExclusive", limit_type) // .client(new OkHttpClient()) .execute(new DialogCallback(JobSearchBean.class) { @Override @@ -365,7 +368,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen } switch (Integer.valueOf(list.get(i).getType())) { case 1://poi - Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f) + BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg); + Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f) .flat(true) .clockwise(false)); poiMarker.setTag(listBean); @@ -373,7 +377,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen poiMarker.setClickable(true); break; case 2://充电站 - Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f) + BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg); + Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f) .flat(true) .clockwise(false)); stationMarker.setTag(listBean); @@ -381,9 +386,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen stationMarker.setClickable(true); break; case 3://poi录像 + BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg); + Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + poiVideoMarker.setTag(listBean); + removables.add(poiVideoMarker); + poiVideoMarker.setClickable(true); break; case 4://道路录像 - Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f) + BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg); + Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f) .flat(true) .clockwise(false)); roadMarker.setTag(listBean); @@ -391,9 +404,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen roadMarker.setClickable(true); break; case 5://其他 + BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg); + Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + otherMarker.setTag(listBean); + removables.add(otherMarker); + otherMarker.setClickable(true); break; case 6://面状任务 - Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f) + BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg); + Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f) .flat(true) .clockwise(false)); Log.d("面妆任务", "onSuccess: " + planarMarker); @@ -447,8 +468,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen EventBus.getDefault().post(obtain); return; } - - new Thread(new Runnable() { @Override public void run() { @@ -464,12 +483,70 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen showAllPoi.clear(); showAllPoi.addAll(allTaskStatus); for (int i = 0; i < allTaskStatus.size(); i++) { - LatLng position = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX())); - Marker marker = tencentMap.addMarker(new MarkerOptions(position)); - marker.setClickable(true); - marker.setTitle("本地");//1:本地 - marker.setTag(allTaskStatus.get(i)); - removablesLocality.add(marker); + PoiEntity poiEntity = allTaskStatus.get(i); + LatLng latLng = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX())); + switch (Integer.valueOf(poiEntity.getType())) { + case 1://poi + BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg); + Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + poiMarker.setClickable(true); + poiMarker.setTitle("本地");//1:本地 + poiMarker.setTag(poiEntity); + removablesLocality.add(poiMarker); + break; + case 2://充电站 + BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_have_bg); + Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + stationMarker.setClickable(true); + stationMarker.setTitle("本地");//1:本地 + stationMarker.setTag(poiEntity); + removablesLocality.add(stationMarker); + break; + case 3://poi录像 + BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg); + Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + poiVideoMarker.setClickable(true); + poiVideoMarker.setTitle("本地");//1:本地 + poiVideoMarker.setTag(poiEntity); + removablesLocality.add(poiVideoMarker); + break; + case 4://道路录像 + BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_have_bg); + Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + roadMarker.setClickable(true); + roadMarker.setTitle("本地");//1:本地 + roadMarker.setTag(poiEntity); + removablesLocality.add(roadMarker); + break; + case 5://其他 + BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg); + Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f) + .flat(true) + .clockwise(false)); + otherMarker.setClickable(true); + otherMarker.setTitle("本地");//1:本地 + otherMarker.setTag(poiEntity); + removablesLocality.add(otherMarker); + break; + case 6://面状任务 + BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg); + Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f) + .clockwise(false) + .flat(true)); + planarMarker.setClickable(true); + planarMarker.setTitle("本地");//1:本地 + planarMarker.setTag(poiEntity); + removablesLocality.add(planarMarker); + break; + } } Message obtain = Message.obtain(); obtain.what = Constant.JOB_SEARCH_POI_WORD; @@ -659,20 +736,36 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen List poiEntities = (List) data.obj; initFilterMarker(poiEntities); } else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置 - initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.POI_WORD); + initPoiMarker((LatLng) data.obj); + } else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置 + if((boolean)data.obj){ + initCheckedMarker(Constant.POI_WORD); + } } else if (data.what == Constant.MAIN_CHARGING_STATION) {//充电站采集-移动位置 - initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_STATION_WORD); + initPoiMarker((LatLng) data.obj); + } else if (data.what == Constant.MAIN_CHARGING_CHECKED_STATION) {//充电站采集 -确定位置 + if((boolean)data.obj){ + initCheckedMarker(Constant.CHARGING_STATION_WORD); + } } else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置 - initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_PILE_WORD); + initPileMarker((LatLng) data.obj); + } else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置 + if((boolean)data.obj){ + initCheckedMarker(Constant.CHARGING_PILE_WORD); + } } else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置 - initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.OTHER_WORD); + initPoiMarker((LatLng) data.obj); + } else if (data.what == Constant.MAIN_CHECKED_OTHER) {//其他采集-确定位置 + if((boolean)data.obj){ + initCheckedMarker(Constant.OTHER_WORD); + } } else if (data.what == Constant.TREASURE_FRAGMENT) { if ((boolean) data.obj == true) { frameLayout.setVisibility(View.GONE); sliding_layout.setPanelHeight(0); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); - if (marker != null) { - marker.remove(); + if (markerPoi != null) { + markerPoi.remove(); } } } else if (data.what == Constant.MAIN_BUTTON_VISIABLE) { @@ -726,6 +819,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen } } + /** * 控制主界面各个按钮的显示状态 */ @@ -750,24 +844,42 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen } - private void initPoiMarker(Boolean t, int aInt) { - if (t == true) { - //移动地图 - CameraUpdate cameraSigma = - CameraUpdateFactory.newCameraPosition(new CameraPosition( - Constant.markerLatlng, //中心点坐标,地图目标经纬度 - tencentMap.getCameraPosition().zoom, //目标缩放级别 - tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) - tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0) + private void initPoiMarker(LatLng latLng) { + CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition( + latLng, //中心点坐标,地图目标经纬度 + tencentMap.getCameraPosition().zoom, //目标缩放级别 + tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) + tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0) + tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() { + @Override + public void onFinish() { + screenPosition = tencentMap.getProjection().toScreenLocation(latLng); + sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); + //创建Marker对象之前,设置属性 + markerPoi.setFixingPoint(screenPosition.x, screenPosition.y); + } + + @Override + public void onCancel() { + + } + }); + + } + private void initPileMarker(LatLng latLng) { + CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition( + latLng, //中心点坐标,地图目标经纬度 + tencentMap.getCameraPosition().zoom, //目标缩放级别 + tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) + tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0) tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() { @Override public void onFinish() { - screenPosition = tencentMap.getProjection().toScreenLocation(Constant.markerLatlng); + screenPosition = tencentMap.getProjection().toScreenLocation(latLng); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); //创建Marker对象之前,设置属性 - LatLng position = Constant.markerLatlng; - marker = tencentMap.addMarker(new MarkerOptions(position)); - marker.setFixingPoint(screenPosition.x, screenPosition.y); + markerPoi = tencentMap.addMarker(new MarkerOptions(latLng)); + markerPoi.setFixingPoint(screenPosition.x, screenPosition.y); } @Override @@ -775,28 +887,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen } }); - } else { - if (screenPosition != null) { - sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); - LatLng latLng = tencentMap.getProjection().fromScreenLocation(screenPosition); - marker.setPosition(latLng); - marker.setFixingPointEnable(false); - Constant.markerLatlng = latLng; - Message obtain = Message.obtain(); - obtain.what = aInt; - obtain.obj = latLng; - EventBus.getDefault().post(obtain); - - } + } + private void initCheckedMarker(int poiWord) { + if (screenPosition != null) { + sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); + LatLng latLng = tencentMap.getProjection().fromScreenLocation(screenPosition); + markerPoi.setPosition(latLng); + markerPoi.setFixingPointEnable(false); + Constant.markerLatlng = latLng; + Message obtain = Message.obtain(); + obtain.what = poiWord; + obtain.obj = latLng; + EventBus.getDefault().post(obtain); } } /** + * * 设置定位图标样式 */ private void setLocMarkerStyle() { - locationStyle= new MyLocationStyle(); + locationStyle = new MyLocationStyle(); locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER); //创建图标 BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap(R.drawable.location)); @@ -871,6 +983,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen public void onDestroy() { super.onDestroy(); treasureMap.onDestroy(); + markerPoi.remove(); EventBus.getDefault().unregister(this); } @@ -913,12 +1026,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_road, "道路")); itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_chongdianzhuang, "充电站")); itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他")); + Bundle bundle = new Bundle(); + PoiEntity poiEntity = new PoiEntity(); + LatLng mapCenterPoint = getMapCenterPoint(); + poiEntity.setX(mapCenterPoint.longitude + ""); + poiEntity.setY(mapCenterPoint.latitude + ""); + bundle.putSerializable("poiEntity", poiEntity); ShareDialog.show((AppCompatActivity) getActivity(), itemList, new ShareDialog.OnItemClickListener() { @Override public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) { switch (index) { case 0: - PoiFragment poiFragment = PoiFragment.newInstance(new Bundle()); + markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint)); + PoiFragment poiFragment = PoiFragment.newInstance(bundle); showSlidingFragment(poiFragment); break; case 1: @@ -930,11 +1050,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen showSlidingFragment(roadFragment); break; case 3: - ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(new Bundle()); + markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint)); + ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle); showSlidingFragment(chargingStationFragment); break; case 4: - OtherFragment otherFragment = OtherFragment.newInstance(new Bundle()); + markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint)); + OtherFragment otherFragment = OtherFragment.newInstance(bundle); showSlidingFragment(otherFragment); break; } @@ -945,8 +1067,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen case R.id.iv_filter: initThread(); initList(Constant.currentLocation); - Bundle bundle = new Bundle(); - FilterFragment filterFragment = FilterFragment.newInstance(bundle); + FilterFragment filterFragment = FilterFragment.newInstance(new Bundle()); showSlidingFragment(filterFragment); break; case R.id.iv_message: @@ -1076,4 +1197,5 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen return tencentMap.getCameraPosition().target; } + } \ No newline at end of file diff --git a/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java b/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java index 07068e2..23393d6 100644 --- a/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java +++ b/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java @@ -58,16 +58,49 @@ public class HttpInterface { public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/"; //172.23.139.4:8003/poitask/1/receivedPoitask/1 - public static final String RECEIVED_POI_TASK = IPm7+"receivedPoitask/1";//poi-领取任务 + public static final String RECEIVED_POI_TASK = IPm7 + "receivedPoitask/1";//poi-领取任务 public static final String IPm8 = "http://172.23.139.4:8003/poitask/1/"; //172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注 - public static final String SUBMIT_POI_TASK = IPm8+"submitPoitask";//poi-保存本地 + public static final String SUBMIT_POI_TASK = IPm8 + "submitPoitask";//poi-保存本地 public static final String IPm9 = "http://172.23.139.4:8003/othertask/1/"; //172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注 - public static final String SUBMIT_OTHER_TASK = IPm9+"submitOthertask";//其他-保存本地 + public static final String SUBMIT_OTHER_TASK = IPm9 + "submitOthertask";//其他-保存本地 + + /*172.23.139.4:8003/polygonTask/1/receivedPolygontask/8602 + 172.23.139.4:8003/polygonTask/1/unReceivedPolygontask/8602 + 172.23.139.4:8003/polygonTask/1/complete/8602 + 172.23.139.4:8003/polygonTask/1/submitPolygontask?id=8602*/ + public static final String IPm10="http://172.23.139.4:8003/polygonTask/1/"; + + public static final String RECEIVED_POLYGON_TASK=IPm10+"receivedPolygontask"; //任务领取 + public static final String UNRECEIVED_POLYGON_TASK=IPm10+"unReceivedPolygontask";//结束领取 + public static final String COMPLETE=IPm10+"complete";//任务采集 + public static final String SUBMIT_POLYGON_TASK=IPm10+"submitPolygontask";//结束采集 + + + public static final String IPm11= "http://172.23.139.4:8003/othertask/1/"; + + //172.23.139.4:8003/othertask/1/uploadpic + public static final String OTHER_TASK_UPLOAD_PIC=IPm11+"uploadpic";//其他-上传 + + + public static final String IPm12= "http://172.23.139.4:8003/ctask/1/"; + + //172.23.139.4:8003/ctask/1/receivedCtask/8608 + public static final String RECEIVED_CTASK=IPm12+"receivedCtask/8608";//充电站-领取任务 + + + //172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1 + public static final String SUBMIT_CTASK=IPm12+"submitCtask";//充电站-保存本地 + + public static final String IPm13= "http://172.23.139.4:8003/poitask/1/"; + + //172.23.139.4:8003/poitask/1/uploadpic + public static final String POI_TASK_UPLOAD_PIC=IPm13+"uploadpic";//poi-上传 + } diff --git a/app/src/main/java/com/navinfo/outdoor/room/PoiDao.java b/app/src/main/java/com/navinfo/outdoor/room/PoiDao.java index e241333..2427334 100644 --- a/app/src/main/java/com/navinfo/outdoor/room/PoiDao.java +++ b/app/src/main/java/com/navinfo/outdoor/room/PoiDao.java @@ -25,10 +25,14 @@ public interface PoiDao { @Query("SELECT * FROM poi where type=:type") List getAllPoiType(int type); + @Query("SELECT * FROM poi WHERE (:taskStatus =-1 or taskStatus=:taskStatus1) and (:type=-1 or type=:type1) and (:isExclusive=-1 or isExclusive=:isExclusive1) ") // @Query("SELECT * FROM poi WHERE taskStatus=:taskStatus and type=:type and (:isExclusive=-1 or isExclusive=:isExclusive) ") List getAllTaskStatus(int taskStatus, int taskStatus1, int type, int type1, int isExclusive, int isExclusive1); + + @Query("SELECT * FROM poi where taskId=:taskId") + PoiEntity getPoiEntity(int taskId); /** * 添加 * @@ -70,6 +74,14 @@ public interface PoiDao { void deleteFormName(int taskStatus); + /** + * 根据条件删除 + * + * @param taskId + */ + @Query("DELETE FROM poi where taskId=:taskId") + void deleteFormTaskID(int taskId); + /** * 全部删除 */ diff --git a/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java b/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java index 96f6f79..b5eeb81 100644 --- a/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java +++ b/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java @@ -30,6 +30,15 @@ public class PoiEntity implements Serializable { private String photo;//照片信息 private String extend;//添加字段 private boolean checked; + private String geoWkt; // 数据的wkt + + public String getGeoWkt() { + return geoWkt; + } + + public void setGeoWkt(String geoWkt) { + this.geoWkt = geoWkt; + } public boolean isChecked() { return checked; diff --git a/app/src/main/res/drawable/ic_baseline_add_alert.xml b/app/src/main/res/drawable/ic_baseline_add_alert.xml new file mode 100644 index 0000000..6d5ddb1 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_add_alert.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/marker_charge_bg.png b/app/src/main/res/drawable/marker_charge_bg.png index 04db664..5e72703 100644 Binary files a/app/src/main/res/drawable/marker_charge_bg.png and b/app/src/main/res/drawable/marker_charge_bg.png differ diff --git a/app/src/main/res/drawable/marker_charge_centre_bg.png b/app/src/main/res/drawable/marker_charge_centre_bg.png new file mode 100644 index 0000000..9f69cb4 Binary files /dev/null and b/app/src/main/res/drawable/marker_charge_centre_bg.png differ diff --git a/app/src/main/res/drawable/marker_charge_have_bg.png b/app/src/main/res/drawable/marker_charge_have_bg.png new file mode 100644 index 0000000..07eb886 Binary files /dev/null and b/app/src/main/res/drawable/marker_charge_have_bg.png differ diff --git a/app/src/main/res/drawable/marker_other_bg.png b/app/src/main/res/drawable/marker_other_bg.png index 808c975..bd657b4 100644 Binary files a/app/src/main/res/drawable/marker_other_bg.png and b/app/src/main/res/drawable/marker_other_bg.png differ diff --git a/app/src/main/res/drawable/marker_other_have_bg.png b/app/src/main/res/drawable/marker_other_have_bg.png new file mode 100644 index 0000000..3f9d470 Binary files /dev/null and b/app/src/main/res/drawable/marker_other_have_bg.png differ diff --git a/app/src/main/res/drawable/marker_pile_bg.png b/app/src/main/res/drawable/marker_pile_bg.png new file mode 100644 index 0000000..abba110 Binary files /dev/null and b/app/src/main/res/drawable/marker_pile_bg.png differ diff --git a/app/src/main/res/drawable/marker_pile_centre_bg.png b/app/src/main/res/drawable/marker_pile_centre_bg.png new file mode 100644 index 0000000..043039e Binary files /dev/null and b/app/src/main/res/drawable/marker_pile_centre_bg.png differ diff --git a/app/src/main/res/drawable/marker_pile_have_bg.png b/app/src/main/res/drawable/marker_pile_have_bg.png new file mode 100644 index 0000000..f678b97 Binary files /dev/null and b/app/src/main/res/drawable/marker_pile_have_bg.png differ diff --git a/app/src/main/res/drawable/marker_poi_bg.png b/app/src/main/res/drawable/marker_poi_bg.png index 733e0e6..7502c02 100644 Binary files a/app/src/main/res/drawable/marker_poi_bg.png and b/app/src/main/res/drawable/marker_poi_bg.png differ diff --git a/app/src/main/res/drawable/marker_poi_have_bg.png b/app/src/main/res/drawable/marker_poi_have_bg.png new file mode 100644 index 0000000..cd90eb3 Binary files /dev/null and b/app/src/main/res/drawable/marker_poi_have_bg.png differ diff --git a/app/src/main/res/drawable/marker_road.png b/app/src/main/res/drawable/marker_road.png deleted file mode 100644 index 26e7ff1..0000000 Binary files a/app/src/main/res/drawable/marker_road.png and /dev/null differ diff --git a/app/src/main/res/drawable/marker_road_bg.png b/app/src/main/res/drawable/marker_road_bg.png index a0efacb..b6096ff 100644 Binary files a/app/src/main/res/drawable/marker_road_bg.png and b/app/src/main/res/drawable/marker_road_bg.png differ diff --git a/app/src/main/res/drawable/marker_road_have_bg.png b/app/src/main/res/drawable/marker_road_have_bg.png new file mode 100644 index 0000000..fe556d9 Binary files /dev/null and b/app/src/main/res/drawable/marker_road_have_bg.png differ diff --git a/app/src/main/res/drawable/menpai_square.png b/app/src/main/res/drawable/menpai_square.png deleted file mode 100644 index c2708ca..0000000 Binary files a/app/src/main/res/drawable/menpai_square.png and /dev/null differ diff --git a/app/src/main/res/drawable/poi_icons.png b/app/src/main/res/drawable/poi_icons.png deleted file mode 100644 index 5650df1..0000000 Binary files a/app/src/main/res/drawable/poi_icons.png and /dev/null differ diff --git a/app/src/main/res/drawable/poi_square.png b/app/src/main/res/drawable/poi_square.png index c3caa71..29c8249 100644 Binary files a/app/src/main/res/drawable/poi_square.png and b/app/src/main/res/drawable/poi_square.png differ diff --git a/app/src/main/res/drawable/poi_video_bg.png b/app/src/main/res/drawable/poi_video_bg.png new file mode 100644 index 0000000..905d1c1 Binary files /dev/null and b/app/src/main/res/drawable/poi_video_bg.png differ diff --git a/app/src/main/res/drawable/poi_video_have_bg.png b/app/src/main/res/drawable/poi_video_have_bg.png new file mode 100644 index 0000000..f7f88ab Binary files /dev/null and b/app/src/main/res/drawable/poi_video_have_bg.png differ diff --git a/app/src/main/res/drawable/push_road.png b/app/src/main/res/drawable/push_road.png index b7840ee..ab5cb1e 100644 Binary files a/app/src/main/res/drawable/push_road.png and b/app/src/main/res/drawable/push_road.png differ diff --git a/app/src/main/res/drawable/small_bell_text.xml b/app/src/main/res/drawable/small_bell_text.xml new file mode 100644 index 0000000..b7ae372 --- /dev/null +++ b/app/src/main/res/drawable/small_bell_text.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/start_bg.png b/app/src/main/res/drawable/start_bg.png new file mode 100644 index 0000000..4ee51c2 Binary files /dev/null and b/app/src/main/res/drawable/start_bg.png differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f7ac83a..84d1c29 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,14 +4,13 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/ic_launcher_background" + android:background="@drawable/start_bg" tools:context="activity.MainActivity"> - + + + + + + + + + + + app:layout_constraintStart_toStartOf="parent" + /> + app:layout_constraintTop_toTopOf="parent" + /> + app:layout_constraintTop_toBottomOf="@id/cb_map_type" + /> + app:layout_constraintTop_toTopOf="@id/iv_zoom_del" + /> + app:layout_constraintTop_toBottomOf="@id/iv_submit" + /> + app:layout_constraintTop_toBottomOf="@id/cb_foot_type" + /> + app:layout_constraintTop_toBottomOf="@id/iv_zoom_add" + /> + app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" + /> + app:layout_constraintTop_toBottomOf="@id/iv_refrish" + /> #95CAF6 #F44236 #87CDF6 + #ED1931 \ No newline at end of file