修改bug

This commit is contained in:
wangdongsheng 2021-10-26 18:33:20 +08:00
parent 480478f08e
commit b753c8217e
25 changed files with 983 additions and 738 deletions

View File

@ -68,7 +68,9 @@
android:name=".activity.PhotographActivity" android:name=".activity.PhotographActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<meta-data
android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true" />
<meta-data <meta-data
android:name="TencentMapSDK" android:name="TencentMapSDK"
android:value="EWWBZ-2PB62-6JXUL-CEX7G-N7UE6-XRB4V" /> <!-- 今日头屏幕适配 --> android:value="EWWBZ-2PB62-6JXUL-CEX7G-N7UE6-XRB4V" /> <!-- 今日头屏幕适配 -->

View File

@ -209,8 +209,7 @@ public class MainActivity extends BaseActivity {
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (Environment.getExternalStorageState().equals( if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
Environment.MEDIA_MOUNTED)) {
downFile(bodyBean.getApkUrl());//点击确定将apk下载 downFile(bodyBean.getApkUrl());//点击确定将apk下载
} else { } else {
Toast.makeText(MainActivity.this, "SD卡不可用请插入SD卡", Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this, "SD卡不可用请插入SD卡", Toast.LENGTH_SHORT).show();
@ -254,7 +253,6 @@ public class MainActivity extends BaseActivity {
public void onTick(long l) {} public void onTick(long l) {}
@Override @Override
public void onFinish() { public void onFinish() {
} }
}.start(); }.start();
*/ */
@ -326,6 +324,7 @@ public class MainActivity extends BaseActivity {
} }
}); });
} }
private void initLogIn() { private void initLogIn() {
try { try {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();

View File

@ -222,22 +222,25 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势. uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE); setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
initLine(); initLine();
if (poiEntity.getId() != null) { if (poiEntity!=null){
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId()); if (poiEntity.getId() != null) {
if (fileListByUUID != null) { List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList(fileListByUUID); if (fileListByUUID != null) {
for (int i = 0; i < lineStringByFileList.size(); i++) { List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList(fileListByUUID);
LatLng latLng = lineStringByFileList.get(i); for (int i = 0; i < lineStringByFileList.size(); i++) {
if (latLng != null) { LatLng latLng = lineStringByFileList.get(i);
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_baseline); if (latLng != null) {
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f) BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_baseline);
.flat(true) Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
.clockwise(false)); .flat(true)
removables.add(marker); .clockwise(false));
removables.add(marker);
}
} }
} }
} }
} }
camera.addCameraListener(new CameraListener() { camera.addCameraListener(new CameraListener() {
@Override @Override
public void onPictureTaken(@NonNull PictureResult result) { public void onPictureTaken(@NonNull PictureResult result) {

View File

@ -36,7 +36,7 @@ public class Constant {
public static String MESSAGE_TYPE = "messageType"; public static String MESSAGE_TYPE = "messageType";
public static String DATA_FILE = "dataFile"; public static String DATA_FILE = "dataFile";
//下载文件 //下载文件
public static final String NABISCO_APk = ROOT_FOLDER + "/apk/"; public static final String NABISCO_APk = ROOT_FOLDER + "/apk";
public static int TelLength = 0; public static int TelLength = 0;
public static void initRootFolder(String userId) { public static void initRootFolder(String userId) {
BASE_FOLDER = ROOT_FOLDER + "/" + userId; BASE_FOLDER = ROOT_FOLDER + "/" + userId;
@ -176,7 +176,7 @@ public class Constant {
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置 public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重 public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
public static TencentMap.OnMarkerClickListener markerClickListener = null; public static TencentMap.OnMarkerClickListener markerClickListener = null;
public static final String NAVIN_FO = "10.22";//版本日期 public static final String NAVIN_FO = "10.26";//版本日期
/* /*
*联系我们的QQ群名称和QQ群号 *联系我们的QQ群名称和QQ群号
*/ */

View File

@ -133,9 +133,9 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
private void initNewWork(boolean aNet) { private void initNewWork(boolean aNet) {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("fid", "4"); httpParams.put("fid", 4);
httpParams.put("pageNum", capacityPage); httpParams.put("pageNum", capacityPage);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.MSG_LISt) .url(HttpInterface.MSG_LISt)

View File

@ -306,7 +306,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
break; break;
} }
} }
@Override @Override
public void onNothingSelected(AdapterView<?> parent) { public void onNothingSelected(AdapterView<?> parent) {
} }
@ -355,8 +354,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
@Override @Override
public void onNothingSelected(AdapterView<?> parent) { public void onNothingSelected(AdapterView<?> parent) {}
}
}); });
spinnerScutcheon = findViewById(R.id.spinner_scutcheon); spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
ArrayAdapter<String> adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon); ArrayAdapter<String> adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
@ -426,7 +424,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
slidingPaneLayout.setScrollableView(nestedScrollView); slidingPaneLayout.setScrollableView(nestedScrollView);
} }
tvText = findViewById(R.id.text); tvText = findViewById(R.id.text);
llCharging = findViewById(R.id.ll_charging); llCharging = findViewById(R.id.ll_charging);
linearType = findViewById(R.id.linear_type); linearType = findViewById(R.id.linear_type);
linearScutcheon = findViewById(R.id.linear_scutcheon); linearScutcheon = findViewById(R.id.linear_scutcheon);
@ -489,7 +486,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivAvailable.setImageDrawable(null); ivAvailable.setImageDrawable(null);
ivAvailable.setTag(null); if (tvAvailable.getTag()!=null){
File file = new File((String) tvAvailable.getTag());
file.delete();
tvAvailable.setTag(null);
}
return false; return false;
} }
}); });
@ -504,7 +505,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivUsable.setImageDrawable(null); ivUsable.setImageDrawable(null);
ivUsable.setTag(null); if (tvUsable.getTag()!=null){
File file = new File((String) tvUsable.getTag());
file.delete();
tvUsable.setTag(null);
}
return false; return false;
} }
}); });
@ -519,7 +524,12 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivScutcheon.setImageDrawable(null); ivScutcheon.setImageDrawable(null);
ivScutcheon.setTag(null); if (tvScutcheon.getTag()!=null){
File file = new File((String) tvScutcheon.getTag());
file.delete();
tvScutcheon.setTag(null);
}
return false; return false;
} }
}); });
@ -534,7 +544,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivParking.setImageDrawable(null); ivParking.setImageDrawable(null);
ivParking.setTag(null); if (tvParking.getTag()!=null){
File file = new File((String) tvParking.getTag());
file.delete();
tvParking.setTag(null);
}
return false; return false;
} }
}); });
@ -549,7 +563,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivPanorama.setImageDrawable(null); ivPanorama.setImageDrawable(null);
ivPanorama.setTag(null); if (tvPanorama.getTag()!=null){
File file = new File((String) tvPanorama.getTag());
file.delete();
tvPanorama.setTag(null);
}
return false; return false;
} }
}); });
@ -564,7 +582,12 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivNumber.setImageDrawable(null); ivNumber.setImageDrawable(null);
ivNumber.setTag(null); if (tvNumber.getTag()!=null){
File file = new File((String) tvNumber.getTag());
file.delete();
tvNumber.setTag(null);
}
return false; return false;
} }
}); });
@ -579,7 +602,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivFacility.setImageDrawable(null); ivFacility.setImageDrawable(null);
ivFacility.setTag(null); if (tvFacility.getTag()!=null){
File file = new File((String) tvFacility.getTag());
file.delete();
tvFacility.setTag(null);
}
return false; return false;
} }
}); });
@ -594,7 +621,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivEquipment.setImageDrawable(null); ivEquipment.setImageDrawable(null);
ivEquipment.setTag(null); if (tvEquipment.getTag()!=null){
File file = new File((String) tvEquipment.getTag());
file.delete();
tvEquipment.setTag(null);
}
return false; return false;
} }
}); });
@ -609,7 +640,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivDevice.setImageDrawable(null); ivDevice.setImageDrawable(null);
ivDevice.setTag(null); if (tvDevice.getTag()!=null){
File file = new File((String) tvDevice.getTag());
file.delete();
tvDevice.setTag(null);
}
return false; return false;
} }
}); });
@ -624,7 +659,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivCoding.setImageDrawable(null); ivCoding.setImageDrawable(null);
ivCoding.setTag(null); if (tvCoding.getTag()!=null){
File file = new File((String) tvCoding.getTag());
file.delete();
tvCoding.setTag(null);
}
return false; return false;
} }
}); });
@ -810,6 +849,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
}*/ }*/
public void setCList(ArrayList<String> list) { public void setCList(ArrayList<String> list) {
switch (list.size()) { switch (list.size()) {
case 1: case 1:
@ -873,7 +913,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
} }
//禁用所有可操作性控件 //禁用所有可操作性控件
private void disables() { private void disables() {
checkBoxLife.setEnabled(false); checkBoxLife.setEnabled(false);
@ -926,6 +965,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
} }
@Override @Override
protected void initData() { protected void initData() {
super.initData(); super.initData();
@ -963,6 +1003,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
} }
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
@ -1201,6 +1242,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPanorama.getTag()!=null){
File filePanorama = new File((String) tvPanorama.getTag());
filePanorama.delete();
tvPanorama.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath); tvPanorama.setTag(andGetPath);
} }
@ -1210,6 +1256,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvCoding.getTag()!=null){
File fileCoding = new File((String) tvCoding.getTag());
fileCoding.delete();
tvCoding.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCoding); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCoding);
tvCoding.setTag(andGetPath); tvCoding.setTag(andGetPath);
} }
@ -1219,6 +1270,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvEquipment.getTag()!=null){
File fileEquipment = new File((String) tvEquipment.getTag());
fileEquipment.delete();
tvEquipment.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivEquipment); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivEquipment);
tvEquipment.setTag(andGetPath); tvEquipment.setTag(andGetPath);
} }
@ -1228,6 +1284,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvFacility.getTag()!=null){
File fileFacility = new File((String) tvFacility.getTag());
fileFacility.delete();
tvFacility.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivFacility); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivFacility);
tvFacility.setTag(andGetPath); tvFacility.setTag(andGetPath);
} }
@ -1237,6 +1298,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvScutcheon.getTag()!=null){
File fileScutcheon= new File((String) tvScutcheon.getTag());
fileScutcheon.delete();
tvScutcheon.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon);
tvScutcheon.setTag(andGetPath); tvScutcheon.setTag(andGetPath);
} }
@ -1246,6 +1312,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvDevice.getTag()!=null){
File fileDevice= new File((String) tvDevice.getTag());
fileDevice.delete();
tvDevice.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivDevice); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivDevice);
tvDevice.setTag(andGetPath); tvDevice.setTag(andGetPath);
} }
@ -1255,6 +1326,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvUsable.getTag()!=null){
File fileUsable= new File((String) tvUsable.getTag());
fileUsable.delete();
tvUsable.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivUsable); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivUsable);
tvUsable.setTag(andGetPath); tvUsable.setTag(andGetPath);
} }
@ -1264,6 +1340,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvAvailable.getTag()!=null){
File fileAvailable= new File((String) tvAvailable.getTag());
fileAvailable.delete();
tvAvailable.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAvailable); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAvailable);
tvAvailable.setTag(andGetPath); tvAvailable.setTag(andGetPath);
} }
@ -1273,6 +1354,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvParking.getTag()!=null){
File fileParking= new File((String) tvParking.getTag());
fileParking.delete();
tvParking.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivParking); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivParking);
tvParking.setTag(andGetPath); tvParking.setTag(andGetPath);
} }
@ -1282,6 +1368,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvNumber.getTag()!=null){
File fileNumber=new File((String) tvNumber.getTag());
fileNumber.delete();
tvNumber.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivNumber); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivNumber);
tvNumber.setTag(andGetPath); tvNumber.setTag(andGetPath);
} }
@ -1309,7 +1400,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
if (markerPile != null) { if (markerPile != null) {
markerPile.remove(); markerPile.remove();
} }
chargingPileBuilder.append("onDestroy ,"); chargingPileBuilder.append("onDestroy");
chargingPileBuilder.append("\r\n"); chargingPileBuilder.append("\r\n");
FileUtils.writeFile(logFile.getAbsolutePath(), chargingPileBuilder.toString(), true); FileUtils.writeFile(logFile.getAbsolutePath(), chargingPileBuilder.toString(), true);
} }

View File

@ -390,7 +390,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivElse.setImageDrawable(null); ivElse.setImageDrawable(null);
ivElse.setTag(null); if (tvElse.getTag()!=null){
File file = new File((String) tvElse.getTag());
file.delete();
tvElse.setTag(null);
}
return false; return false;
} }
}); });
@ -405,7 +409,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivScutcheon.setImageDrawable(null); ivScutcheon.setImageDrawable(null);
ivScutcheon.setTag(null); if (tvScutcheon.getTag()!=null){
File file = new File((String) tvScutcheon.getTag());
file.delete();
tvScutcheon.setTag(null);
}
return false; return false;
} }
}); });
@ -420,7 +428,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivPanorama.setImageDrawable(null); ivPanorama.setImageDrawable(null);
ivPanorama.setTag(null); if (tvPanorama.getTag()!=null){
File file = new File((String) tvPanorama.getTag());
file.delete();
tvPanorama.setTag(null);
}
return false; return false;
} }
}); });
@ -435,7 +447,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivName.setImageDrawable(null); ivName.setImageDrawable(null);
ivName.setTag(null); if (tvNamePic.getTag()!=null){
File file = new File((String) tvNamePic.getTag());
file.delete();
tvNamePic.setTag(null);
}
return false; return false;
} }
}); });
@ -450,7 +466,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivInternal.setImageDrawable(null); ivInternal.setImageDrawable(null);
ivInternal.setTag(null); if (tvInternal.getTag()!=null){
File file = new File((String) tvInternal.getTag());
file.delete();
tvInternal.setTag(null);
}
return false; return false;
} }
}); });
@ -463,17 +484,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
// 添加信息 // 添加信息
assert getArguments() != null; assert getArguments() != null;
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity"); showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
assert showPoiEntity != null; if (showPoiEntity!=null){
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 5) { if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 5) {
tvExamine.setVisibility(View.GONE); tvExamine.setVisibility(View.GONE);
} else { } else {
tvExamine.setVisibility(View.VISIBLE); tvExamine.setVisibility(View.VISIBLE);
} }
String name = showPoiEntity.getName();//名称 String name = showPoiEntity.getName();//名称
if (name != null && !name.equals("")) { if (name != null && !name.equals("")) {
editNameContent.setText(name); editNameContent.setText(name);
} }
if (editNameContent.getText().toString() != null || editNameContent != null) {
editNameContent.setOnFocusChangeListener(new View.OnFocusChangeListener() { editNameContent.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override @Override
public void onFocusChange(View v, boolean hasFocus) { public void onFocusChange(View v, boolean hasFocus) {
@ -482,152 +502,150 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
}); });
} else { String address = showPoiEntity.getAddress();//地址
Toast.makeText(getActivity(), "请输入名称", Toast.LENGTH_SHORT).show(); if (address != null && !address.equals("")) {
} editSiteContent.setText(address);
String address = showPoiEntity.getAddress();//地址
if (address != null && !address.equals("")) {
editSiteContent.setText(address);
}
bodyId = showPoiEntity.getBodyId(); // 获取当前数据的bodyId
String geoWkt = showPoiEntity.getGeoWkt();
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
case "Point": //
latLng = GeometryTools.createLatLng(geo);
break;
case "LineString": //线
case "Polygon": //
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
assert latLineString != null;
latLng = latLineString.get(0);
break;
} }
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show); bodyId = showPoiEntity.getBodyId(); // 获取当前数据的bodyId
markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f)); String geoWkt = showPoiEntity.getGeoWkt();
markerStation.setZIndex(4); if (geoWkt != null) {
moveLatlng(latLng, null); String geo = Geohash.getInstance().decode(geoWkt);
} else { Geometry geometry = GeometryTools.createGeometry(geo);
String x = showPoiEntity.getX(); switch (geometry.getGeometryType()) {
String y = showPoiEntity.getY(); case "Point": //
if (x != null && y != null) { latLng = GeometryTools.createLatLng(geo);
latLng = new LatLng(); break;
latLng.setLatitude(Double.parseDouble(y)); case "LineString": //线
latLng.setLongitude(Double.parseDouble(x)); case "Polygon": //
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
assert latLineString != null;
latLng = latLineString.get(0);
break;
}
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show); BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f)); markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f));
markerStation.setZIndex(4); markerStation.setZIndex(4);
moveLatlng(latLng, null); moveLatlng(latLng, null);
}
}
String describe = showPoiEntity.getMemo();//任务描述
if (describe != null && !describe.equals("")) {
editDescribe.setText(describe);
}
initPhone();
int station_type = showPoiEntity.getStation_type();
if (station_type == 1) {
spinnerType.setSelection(0, true);
} else if (station_type == 2) {
spinnerType.setSelection(1, true);
} else if (station_type == 3) {
spinnerType.setSelection(2, true);
} else if (station_type == 4) {
spinnerType.setSelection(3, true);
}
String telPhone = showPoiEntity.getTelPhone();
if (telPhone != null && !telPhone.equals("") && !telPhone.equals("null")) {
String[] phones = telPhone.split("\\|");
for (int i = 0; i < phones.length; i++) {
if (i == 0) {
if (!StringUtils.isEmpty(phones[i])) {
if (phones[i].contains("-")) { // 包含区号数据的电话
String[] split = phones[i].split("-");
if (split.length > 1) {
poiBeans.add(new PhoneBean("电话", split[1] + "", split[0] + "", R.drawable.icon_add_bg));
} else {
poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg));
}
} else {
poiBeans.add(new PhoneBean("电话", phones[i] + "", "", R.drawable.icon_add_bg));
}
}
} else {
if (!StringUtils.isEmpty(phones[i])) {
if (phones[i].contains("-")) { // 包含区号数据的电话
String[] split = phones[i].split("-");
if (split.length > 1) {
poiBeans.add(new PhoneBean("", split[1] + "", split[0] + "", R.drawable.icon_del_bg));
} else {
poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg));
}
} else {
if (phones[i] != null) {
poiBeans.add(new PhoneBean("", phones[i] + "", "", R.drawable.icon_del_bg));
} else {
poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg));
}
}
}
}
}
} else {
if (Constant.CODE == null || Constant.CODE.equals("")) {
poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg));
} else { } else {
poiBeans.add(new PhoneBean("电话", "", Constant.CODE, R.drawable.icon_add_bg)); String x = showPoiEntity.getX();
} String y = showPoiEntity.getY();
} if (x != null && y != null) {
contactView = new ContactView(getActivity(), linearContact, poiBeans); latLng = new LatLng();
contactView.resetView(); latLng.setLatitude(Double.parseDouble(y));
//poiRecycleAdapter.setList(poiBeans); latLng.setLongitude(Double.parseDouble(x));
if (showPoiEntity.getName() != null) { BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
linearExist.setVisibility(View.VISIBLE); markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f));
spinnerExist.setSelection(showPoiEntity.getExistence(), true); markerStation.setZIndex(4);
existence = showPoiEntity.getExistence(); moveLatlng(latLng, null);
}
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(Objects.requireNonNull(getActivity())).load(photo).into(ivPanorama);
tvPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivName);
tvNamePic.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivInternal);
tvInternal.setTag(photo);
} else if (split[split.length - 1].startsWith("d")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivElse);
tvElse.setTag(photo);
} else if (split[split.length - 1].startsWith("e")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivScutcheon);
tvScutcheon.setTag(photo);
} }
} }
} String describe = showPoiEntity.getMemo();//任务描述
new Thread(new Runnable() { if (describe != null && !describe.equals("")) {
@Override editDescribe.setText(describe);
public void run() {
List<ChargingPileEntity> chargingPileList = chargingPileDao.getChargingPileByStationId(showPoiEntity.getId());
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
chargingPileAdapter.setChargingPileEntities(chargingPileList);
initPileMarkerShow();
}
});
} }
}).start(); initPhone();
if (showPoiEntity.getTaskStatus() == 3) { int station_type = showPoiEntity.getStation_type();
disables(); if (station_type == 1) {
spinnerType.setSelection(0, true);
} else if (station_type == 2) {
spinnerType.setSelection(1, true);
} else if (station_type == 3) {
spinnerType.setSelection(2, true);
} else if (station_type == 4) {
spinnerType.setSelection(3, true);
}
String telPhone = showPoiEntity.getTelPhone();
if (telPhone != null && !telPhone.equals("") && !telPhone.equals("null")) {
String[] phones = telPhone.split("\\|");
for (int i = 0; i < phones.length; i++) {
if (i == 0) {
if (!StringUtils.isEmpty(phones[i])) {
if (phones[i].contains("-")) { // 包含区号数据的电话
String[] split = phones[i].split("-");
if (split.length > 1) {
poiBeans.add(new PhoneBean("电话", split[1] + "", split[0] + "", R.drawable.icon_add_bg));
} else {
poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg));
}
} else {
poiBeans.add(new PhoneBean("电话", phones[i] + "", "", R.drawable.icon_add_bg));
}
}
} else {
if (!StringUtils.isEmpty(phones[i])) {
if (phones[i].contains("-")) { // 包含区号数据的电话
String[] split = phones[i].split("-");
if (split.length > 1) {
poiBeans.add(new PhoneBean("", split[1] + "", split[0] + "", R.drawable.icon_del_bg));
} else {
poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg));
}
} else {
if (phones[i] != null) {
poiBeans.add(new PhoneBean("", phones[i] + "", "", R.drawable.icon_del_bg));
} else {
poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg));
}
}
}
}
}
} else {
if (Constant.CODE == null || Constant.CODE.equals("")) {
poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg));
} else {
poiBeans.add(new PhoneBean("电话", "", Constant.CODE, R.drawable.icon_add_bg));
}
}
contactView = new ContactView(getActivity(), linearContact, poiBeans);
contactView.resetView();
//poiRecycleAdapter.setList(poiBeans);
if (showPoiEntity.getName() != null) {
linearExist.setVisibility(View.VISIBLE);
spinnerExist.setSelection(showPoiEntity.getExistence(), true);
existence = showPoiEntity.getExistence();
}
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(Objects.requireNonNull(getActivity())).load(photo).into(ivPanorama);
tvPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivName);
tvNamePic.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivInternal);
tvInternal.setTag(photo);
} else if (split[split.length - 1].startsWith("d")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivElse);
tvElse.setTag(photo);
} else if (split[split.length - 1].startsWith("e")) {
Glide.with(Objects.requireNonNull(getActivity())).load(photo).into(ivScutcheon);
tvScutcheon.setTag(photo);
}
}
}
new Thread(new Runnable() {
@Override
public void run() {
List<ChargingPileEntity> chargingPileList = chargingPileDao.getChargingPileByStationId(showPoiEntity.getId());
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
chargingPileAdapter.setChargingPileEntities(chargingPileList);
initPileMarkerShow();
}
});
}
}).start();
if (showPoiEntity.getTaskStatus() == 3) {
disables();
}
initPile();
} }
initPile();
} }
private void initPile() { private void initPile() {
@ -648,7 +666,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
/** /*
* 得到电话区号电话位数 * 得到电话区号电话位数
*/ */
private void initPhone() { private void initPhone() {
@ -678,7 +696,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Constant.CODE = code; Constant.CODE = code;
Constant.TelLength = telLength; Constant.TelLength = telLength;
/* for (int i = 0; i < poiBeans.size(); i++) { /*for (int i = 0; i < poiBeans.size(); i++) {
poiBeans.get(i).setArea(Constant.CODE); poiBeans.get(i).setArea(Constant.CODE);
} }
contactView = new ContactView(getActivity(), linearContact, poiBeans); contactView = new ContactView(getActivity(), linearContact, poiBeans);
@ -700,22 +718,17 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public void initRemovePileSharePre() { public void initRemovePileSharePre() {
//获取SharedPreferences对象方法中两个参数的意思为第一个name //获取SharedPreferences对象方法中两个参数的意思为第一个name
//表示文件名系统将会在/dada/dada/包名/shared_prefs目录下生成 //表示文件名系统将会在/dada/dada/包名/shared_prefs目录下生成
//一个以该参数命名的.xml文件第二个mode表示创建的模式通过查看 //一个以该参数命名的.xml文件第二个mode表示创建的模式通过查看
//方法注释得知建议以0或者MODE_PRIVATE为默认值 //方法注释得知建议以0或者MODE_PRIVATE为默认值
SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0); SharedPreferences poi = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.DATA_FILE, 0);
//获取Editor对象 //获取Editor对象
SharedPreferences.Editor edit = poi.edit(); SharedPreferences.Editor edit = poi.edit();
//根据要保存的数据的类型调用对应的put方法,以键值对的形式添加新值 //根据要保存的数据的类型调用对应的put方法,以键值对的形式添加新值
edit.putString("chargingPileEntity", null); edit.putString("chargingPileEntity", null);
//提交新值必须执行否则前面的操作都无效 //提交新值必须执行否则前面的操作都无效
edit.apply(); edit.apply();
} }
//禁用所有可操作性控件 //禁用所有可操作性控件
@ -725,13 +738,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
tvExamine.setEnabled(false); tvExamine.setEnabled(false);
editSiteContent.setEnabled(false); editSiteContent.setEnabled(false);
linearContact.setEnabled(false); linearContact.setEnabled(false);
ivPanorama.setEnabled(false); rlPanorama.setEnabled(false);
ivName.setEnabled(false); rlName.setEnabled(false);
ivInternal.setEnabled(false); rlInternalPhotos.setEnabled(false);
ivElse.setEnabled(false); rlElse.setEnabled(false);
rlScutcheon.setEnabled(false);
editDescribe.setEnabled(false); editDescribe.setEnabled(false);
btnSaveLocal.setEnabled(false); btnSaveLocal.setEnabled(false);
linearChargingPile.setEnabled(false); linearChargingPile.setEnabled(false);
spinnerType.setEnabled(false);
spinnerExist.setEnabled(false);
} }
@Override @Override
@ -740,7 +756,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
//存储对象 //存储对象
poiBeans = new ArrayList<>(); poiBeans = new ArrayList<>();
chargingStationList = new ArrayList<>(); chargingStationList = new ArrayList<>();
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE); SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
SharedPreferences.Editor sharedEdit = sharedPreferences.edit(); SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
@ -969,7 +984,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
/** /*
* 根据充电站数据检查充电桩数据如果没有网络保存则批量网络保存 * 根据充电站数据检查充电桩数据如果没有网络保存则批量网络保存
*/ */
private void saveChargingPileByChargingStation(PoiEntity chargingStationPoiEntity) { private void saveChargingPileByChargingStation(PoiEntity chargingStationPoiEntity) {
@ -986,7 +1001,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
/** /*
* 上传充电桩数据 * 上传充电桩数据
*/ */
private void chargingPileUploadNetWork(ChargingPileEntity chargingPileEntity) { private void chargingPileUploadNetWork(ChargingPileEntity chargingPileEntity) {
@ -1008,7 +1023,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC) Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(chargingPileFileList).postFileSynchronization(); .fileList(chargingPileFileList)
.postFileSynchronization();
if (execute != null) { if (execute != null) {
assert execute.body() != null; assert execute.body() != null;
String pileUpLoadResultStr = execute.body().string(); String pileUpLoadResultStr = execute.body().string();
@ -1027,8 +1043,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
/* /* OkGo
OkGo
// 请求方式和请求url // 请求方式和请求url
.<PoiUploadBean>post(HttpInterface.CS_TASK_UP_LOAD_PIC) .<PoiUploadBean>post(HttpInterface.CS_TASK_UP_LOAD_PIC)
// 请求的 tag, 主要用于取消对应的请求 // 请求的 tag, 主要用于取消对应的请求
@ -1057,8 +1072,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
Toast.makeText(getActivity(), poiUploadBeanResponse.code() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), poiUploadBeanResponse.code() + "", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + ""); Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + "");
} }
}); });*/
*/
private void initRoadSaveLocal(boolean isLocal) { private void initRoadSaveLocal(boolean isLocal) {
XXPermissions.with(this) XXPermissions.with(this)
@ -1105,10 +1119,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) { private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
if (poiEntity == null || poiEntity.getBodyId() == 0) { if (poiEntity != null ) {
if (poiEntity.getTaskId()==0){
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
return;
}
}else {
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
assert poiEntity != null;
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
return; return;
} }
new Thread(new Runnable() { new Thread(new Runnable() {
@ -1123,7 +1141,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
} }
getActivity().runOnUiThread(new Runnable() { Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
@ -1179,24 +1197,26 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
// 充电站数据已经保存在服务上批量保存充电桩数据 // 充电站数据已经保存在服务上批量保存充电桩数据
saveChargingPileByChargingStation(poiEntity); saveChargingPileByChargingStation(poiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
if (isLocal) { public void run() {
stationUploadByNetWork(poiEntity, chargingStationList); if (isLocal) {
Constant.isPresent = false; stationUploadByNetWork(poiEntity, chargingStationList);
// chargingPileUploadNetWork(chargingPileBody, fileList); Constant.isPresent = false;
} else { // chargingPileUploadNetWork(chargingPileBody, fileList);
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); } else {
Message obtain = Message.obtain(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
getActivity().onBackPressed(); EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
} }
Log.d("TAG", "onSuccess: " + chargingStationBean.getBody()); });
}
}); }
} }
}).start(); }).start();
} else { } else {
@ -1315,6 +1335,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPanorama.getTag()!=null){
File filePanorama = new File((String) tvPanorama.getTag());
filePanorama.delete();
tvPanorama.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath); tvPanorama.setTag(andGetPath);
} }
@ -1324,6 +1349,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvNamePic.getTag()!=null){
File fileName = new File((String) tvNamePic.getTag());
fileName.delete();
tvNamePic.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
tvNamePic.setTag(andGetPath); tvNamePic.setTag(andGetPath);
} }
@ -1333,6 +1363,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvInternal.getTag()!=null){
File fileInternal = new File((String) tvInternal.getTag());
fileInternal.delete();
tvInternal.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
tvInternal.setTag(andGetPath); tvInternal.setTag(andGetPath);
} }
@ -1342,6 +1377,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvElse.getTag()!=null){
File fileElse = new File((String) tvElse.getTag());
fileElse.delete();
tvElse.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse);
tvElse.setTag(andGetPath); tvElse.setTag(andGetPath);
} }
@ -1351,6 +1391,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvScutcheon.getTag()!=null){
File fileScutcheon = new File((String) tvScutcheon.getTag());
fileScutcheon.delete();
tvScutcheon.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon);
tvScutcheon.setTag(andGetPath); tvScutcheon.setTag(andGetPath);
} }
@ -1376,9 +1421,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
hashMap.put("sign_exist", chargingPileEntity.getSign_exist()); hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
httpParams.put("detail", String.valueOf(hashMap)); httpParams.put("detail", String.valueOf(hashMap));
try { try {
Response execute = OkGoBuilder.getInstance().url(HttpInterface.SUBMIT_CSTASK) Response execute = OkGoBuilder
.getInstance()
.url(HttpInterface.SUBMIT_CSTASK)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(httpParams).getSynchronization(); .params(httpParams)
.getSynchronization();
if (execute != null) { if (execute != null) {
assert execute.body() != null; assert execute.body() != null;
String responseBodyStr = execute.body().string(); String responseBodyStr = execute.body().string();

View File

@ -722,7 +722,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy(); super.onDestroy();
filterBuilder.append("onDestroy ,"); filterBuilder.append("onDestroy ");
filterBuilder.append("\r\n"); filterBuilder.append("\r\n");
FileUtils.writeFile(logFile.getAbsolutePath(), filterBuilder.toString(), true); FileUtils.writeFile(logFile.getAbsolutePath(), filterBuilder.toString(), true);
} }

View File

@ -108,10 +108,10 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
break; break;
case R.id.linear_end: case R.id.linear_end:
findBuilder.append("点击了帮助中心:能力测评 ,"); findBuilder.append("点击了帮助中心:能力测评 ,");
Toast.makeText(getContext(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show(); // Toast.makeText(getContext(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
/*Intent endIntent = new Intent(getActivity(), FragmentManagement.class); Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
endIntent.putExtra("tag", 11); endIntent.putExtra("tag", 11);
startActivity(endIntent);*/ startActivity(endIntent);
break; break;
} }

View File

@ -160,7 +160,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (arguments != null) {//poiEntity if (arguments != null) {//poiEntity
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity"); poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
if (poiEntity != null) { if (poiEntity != null) {
tvTitle.setText(poiEntity.getName()); tvTitle.setText(poiEntity.getName()+"");
if (poiEntity.getPrecision() == null) { if (poiEntity.getPrecision() == null) {
tvMoney.setText("" + 0); tvMoney.setText("" + 0);
} else { } else {
@ -250,7 +250,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
case R.id.btn_cancel_get://结束领取 case R.id.btn_cancel_get://结束领取
gatherGetBuilder.append("点击了结束领取的按钮 ,"); gatherGetBuilder.append("点击了结束领取的按钮 ,");
if (poiEntity != null) { if (poiEntity != null) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId(), poiEntity); initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity);
} }
break; break;
case R.id.btn_get_task://领取任务 case R.id.btn_get_task://领取任务
@ -258,17 +258,17 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (poiEntity != null) { if (poiEntity != null) {
int type = poiEntity.getType(); int type = poiEntity.getType();
if (type == 6) {//面状任务的领取类型 if (type == 6) {//面状任务的领取类型
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false); initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity, false);
} else if (type == 1) {//poi的领取类型 } else if (type == 1) {//poi的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, 1); receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity, false, 1);
} else if (type == 2) {//充电站的领取类型 } else if (type == 2) {//充电站的领取类型
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false, 1); chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity, false, 1);
} else if (type == 3) {//poi录像的领取类型 } else if (type == 3) {//poi录像的领取类型
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), false, 1); taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity, false, 1);
} else if (type == 4) {//道路的领取类型 } else if (type == 4) {//道路的领取类型
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), false, 1); taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity, false, 1);
} else if (type == 5) {//其他的领取类型 } else if (type == 5) {//其他的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false, 1); receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity, false, 1);
} }
} }
break; break;
@ -307,7 +307,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (poiEntity != null) { if (poiEntity != null) {
int type = poiEntity.getType(); int type = poiEntity.getType();
if (type == 6) { if (type == 6) {
initSubmitPolygonTask(HttpInterface.COMPLETE, poiEntity.getTaskId()); initSubmitPolygonTask(HttpInterface.COMPLETE, poiEntity);
} else { } else {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
@ -334,20 +334,20 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (type == 6) { if (type == 6) {
int taskStatus = poiEntity.getTaskStatus(); int taskStatus = poiEntity.getTaskStatus();
if (taskStatus != 1) { if (taskStatus != 1) {
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true); initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity, true);
} else { } else {
initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity); initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity);
} }
} else if (type == 1) {//poi的领取类型 } else if (type == 1) {//poi的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true, 5); receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity, true, 5);
} else if (type == 2) {//充电站的领取类型 } else if (type == 2) {//充电站的领取类型
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true, 5); chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity, true, 5);
} else if (type == 3) {//poi录像的领取类型 } else if (type == 3) {//poi录像的领取类型
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity.getTaskId(), true, 5); taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK, poiEntity, true, 5);
} else if (type == 4) {//道路的领取类型 } else if (type == 4) {//道路的领取类型
taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity.getTaskId(), true, 5); taskByNet(HttpInterface.RECEIVED_ROAD_TASK, poiEntity, true, 5);
} else if (type == 5) {//其他的领取类型 } else if (type == 5) {//其他的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true, 5); receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity, true, 5);
} }
} }
} }
@ -355,11 +355,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 筛选充电站领取任务 * @param url 筛选充电站领取任务
*/ */
private void chargingTaskByWork(String url, int taskId, boolean isSaver, int statusId) { private void chargingTaskByWork(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + poiEntity.getTaskId())
.cls(ReceivedBean.class) .cls(ReceivedBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams()) .params(new HttpParams())
@ -373,10 +373,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId); PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(poiEntity.getTaskId());
if (taskIdPoiEntity == null) { if (taskIdPoiEntity == null) {
PoiEntity chargingStationEntity = new PoiEntity(); PoiEntity chargingStationEntity = new PoiEntity();
chargingStationEntity.setTaskId(taskId); chargingStationEntity.setTaskId(poiEntity.getTaskId());
chargingStationEntity.setStation_type(stationBean.getSptype()); chargingStationEntity.setStation_type(stationBean.getSptype());
chargingStationEntity.setName(stationBean.getName()); chargingStationEntity.setName(stationBean.getName());
chargingStationEntity.setDescribe(stationBean.getMemo()); chargingStationEntity.setDescribe(stationBean.getMemo());
@ -420,47 +420,53 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
chargingPileEntity.setP(csTaskList.get(i).getGeo()); chargingPileEntity.setP(csTaskList.get(i).getGeo());
chargingPileEntityList[i] = chargingPileEntity; chargingPileEntityList[i] = chargingPileEntity;
} }
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList); InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getContext(), chargingPileEntityList);
} }
// senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX()); // senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
if (statusId == 1 || statusId == 5) { if (statusId == 1 || statusId == 5) {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingStationEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingStationEntity);
} }
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1); public void run() {
if (isSaver) { initViewByTaskStatus(1);
Message obtain = Message.obtain(); if (isSaver) {
obtain.what = Constant.GATHER_GET_MAP; Message obtain = Message.obtain();
obtain.obj = chargingStationEntity; obtain.what = Constant.GATHER_GET_MAP;
EventBus.getDefault().post(obtain); obtain.obj = chargingStationEntity;
} else { EventBus.getDefault().post(obtain);
Message obtain = Message.obtain(); } else {
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
EventBus.getDefault().post(obtain);
}
} }
} });
}); }
} else { } else {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1); public void run() {
if (isSaver) { initViewByTaskStatus(1);
Message obtain = Message.obtain(); if (isSaver) {
obtain.what = Constant.GATHER_GET_MAP; Message obtain = Message.obtain();
obtain.obj = taskIdPoiEntity; obtain.what = Constant.GATHER_GET_MAP;
EventBus.getDefault().post(obtain); obtain.obj = taskIdPoiEntity;
} else { EventBus.getDefault().post(obtain);
Message obtain = Message.obtain(); } else {
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
EventBus.getDefault().post(obtain);
}
} }
} });
});
}
} }
} }
}).start(); }).start();
@ -482,15 +488,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 面妆任务领取任务 * @param url 面妆任务领取任务
*/ */
private void initPolygonTask(String url, int taskId, boolean aBoolean) { private void initPolygonTask(String url, PoiEntity poiEntity, boolean aBoolean) {
if (taskId == 0) { if (poiEntity.getTaskId() == 0) {
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
return; return;
} }
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + poiEntity.getTaskId())
.cls(PolygonTaskBean.class) .cls(PolygonTaskBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams()) .params(new HttpParams())
@ -530,21 +536,23 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void run() { public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), polygonEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), polygonEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1); public void run() {
Toast.makeText(getActivity(), "领取成功", Toast.LENGTH_SHORT).show(); initViewByTaskStatus(1);
if (aBoolean) { Toast.makeText(getActivity(), "领取成功", Toast.LENGTH_SHORT).show();
initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK , polygonEntity); if (aBoolean) {
} else { initCompleteTask(HttpInterface.SUBMIT_POLYGON_TASK , polygonEntity);
Message obtains = Message.obtain(); } else {
obtains.what = Constant.JOB_WORD_MONITOR; Message obtains = Message.obtain();
obtains.obj = true; obtains.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtains); obtains.obj = true;
EventBus.getDefault().post(obtains);
}
} }
} });
}); }
} }
}).start(); }).start();
} else { } else {
@ -565,14 +573,14 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
* @param url * @param url
* 所以类型的结束领取 * 所以类型的结束领取
*/ */
private void initEndReceiveTask(String url, int taskId, PoiEntity poiEntity) { private void initEndReceiveTask(String url, PoiEntity poiEntity) {
if (taskId == 0) { if (poiEntity.getTaskId() == 0) {
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
return; return;
} }
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("taskIds", taskId); httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", ""); httpParams.put("auditIds", "");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
@ -592,17 +600,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (poiEntity.getType() == 2) { if (poiEntity.getType() == 2) {
chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId()); chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId());
} }
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
Log.d("TAG", "run: " + response.getMessage()); public void run() {
initViewByTaskStatus(0); Log.d("TAG", "run: " + response.getMessage());
Message obtain = Message.obtain(); initViewByTaskStatus(0);
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
} EventBus.getDefault().post(obtain);
}); }
});
}
} }
}).start(); }).start();
@ -646,20 +656,22 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void run() { public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
Message obtain = Message.obtain(); public void run() {
obtain.what = Constant.TREASURE_FRAGMENT; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.TREASURE_FRAGMENT;
EventBus.getDefault().post(obtain); obtain.obj = true;
Message obtains = Message.obtain(); EventBus.getDefault().post(obtain);
obtains.what = Constant.JOB_WORD_MONITOR; Message obtains = Message.obtain();
obtains.obj = true; obtains.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtains); obtains.obj = true;
onBackPressed(); EventBus.getDefault().post(obtains);
} onBackPressed();
}); }
});
}
} }
}).start(); }).start();
} else { } else {
@ -679,16 +691,18 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 面妆任务 结束采集 * @param url 面妆任务 结束采集
*/ */
private void initSubmitPolygonTask(String url, int taskId) { private void initSubmitPolygonTask(String url, PoiEntity poiEntity) {
if (taskId == 0) { if (poiEntity.getTaskId() == 0) {
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
return; return;
} }
HttpParams httpParams = new HttpParams();
httpParams.put("id",poiEntity.getTaskId());
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url) .url(url)
.params(new HttpParams("id", String.valueOf(taskId))) .params(httpParams)
.cls(UnPolygonTaskBean.class) .cls(UnPolygonTaskBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<UnPolygonTaskBean>() { .getRequest(new Callback<UnPolygonTaskBean>() {
@ -699,7 +713,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.deleteFormTaskID(taskId); poiDao.deletePoiEntity(poiEntity);
} }
}).start(); }).start();
} else { } else {
@ -719,11 +733,15 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url poi类型对应的url * @param url poi类型对应的url
*/ */
private void receivedTaskByNet(String url, int taskId, boolean isSaver, int statusId) { private void receivedTaskByNet(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
if (poiEntity.getTaskId() != 0) {
Toast.makeText(getActivity(), "无此任务", Toast.LENGTH_SHORT).show();
return;
}
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + poiEntity.getTaskId())
.cls(ReceivedPoiBean.class) .cls(ReceivedPoiBean.class)
.params(new HttpParams()) .params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
@ -737,11 +755,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId); PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(poiEntity.getTaskId());
if (taskIdPoiEntity == null) {//数据库没有这条数据 if (taskIdPoiEntity == null) {//数据库没有这条数据
ReceivedPoiBean.BodyBean listBean = response.getBody(); ReceivedPoiBean.BodyBean listBean = response.getBody();
PoiEntity poiListEntity = new PoiEntity(); PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setTaskId(taskId); poiListEntity.setTaskId(poiEntity.getTaskId());
poiListEntity.setName(listBean.getName()); poiListEntity.setName(listBean.getName());
poiListEntity.setDescribe(listBean.getMemo()); poiListEntity.setDescribe(listBean.getMemo());
poiListEntity.setCreateTime(listBean.getEndDate()); poiListEntity.setCreateTime(listBean.getEndDate());
@ -779,42 +797,47 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (statusId == 1 || statusId == 5) { if (statusId == 1 || statusId == 5) {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
} }
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1);//已领取 public void run() {
if (isSaver) { initViewByTaskStatus(1);//已领取
Message obtain = Message.obtain(); if (isSaver) {
obtain.what = Constant.GATHER_GET_MAP; Message obtain = Message.obtain();
obtain.obj = poiListEntity; obtain.what = Constant.GATHER_GET_MAP;
EventBus.getDefault().post(obtain); obtain.obj = poiListEntity;
} else { EventBus.getDefault().post(obtain);
Message obtain = Message.obtain(); } else {
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
} EventBus.getDefault().post(obtain);
}
}
});
} else {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
initViewByTaskStatus(1);
if (isSaver) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = taskIdPoiEntity;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} }
} });
}); }
} else {
if (getActivity()!=null){
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
initViewByTaskStatus(1);
if (isSaver) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = taskIdPoiEntity;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
});
}
} }
} }
}).start(); }).start();
@ -845,11 +868,11 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 不同任务类型对应的url * @param url 不同任务类型对应的url
*/ */
private void taskByNet(String url, int taskId, boolean isSaver, int statusId) { private void taskByNet(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + poiEntity.getTaskId())
.cls(TaskByNetBean.class) .cls(TaskByNetBean.class)
.params(new HttpParams()) .params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
@ -863,10 +886,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(taskId); PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(poiEntity.getTaskId());
if (taskIdPoiEntity == null) {//数据库没有这条数据 if (taskIdPoiEntity == null) {//数据库没有这条数据
PoiEntity poiListEntity = new PoiEntity(); PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setTaskId(taskId); poiListEntity.setTaskId(poiEntity.getTaskId());
poiListEntity.setName(listBean.getName()); poiListEntity.setName(listBean.getName());
poiListEntity.setDescribe(listBean.getMemo()); poiListEntity.setDescribe(listBean.getMemo());
poiListEntity.setCreateTime(listBean.getEndDate()); poiListEntity.setCreateTime(listBean.getEndDate());
@ -897,42 +920,46 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (statusId == 1 || statusId == 5) { if (statusId == 1 || statusId == 5) {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
} }
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1); public void run() {
if (isSaver) { initViewByTaskStatus(1);
Message obtain = Message.obtain(); if (isSaver) {
obtain.what = Constant.GATHER_GET_MAP; Message obtain = Message.obtain();
obtain.obj = poiListEntity; obtain.what = Constant.GATHER_GET_MAP;
EventBus.getDefault().post(obtain); obtain.obj = poiListEntity;
} else { EventBus.getDefault().post(obtain);
Message obtain = Message.obtain(); } else {
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
EventBus.getDefault().post(obtain);
}
} }
} });
}); }
} else { } else {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
initViewByTaskStatus(1); public void run() {
if (isSaver) { initViewByTaskStatus(1);
Message obtain = Message.obtain(); if (isSaver) {
obtain.what = Constant.GATHER_GET_MAP; Message obtain = Message.obtain();
obtain.obj = taskIdPoiEntity; obtain.what = Constant.GATHER_GET_MAP;
EventBus.getDefault().post(obtain); obtain.obj = taskIdPoiEntity;
} else { EventBus.getDefault().post(obtain);
Message obtain = Message.obtain(); } else {
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
} EventBus.getDefault().post(obtain);
}
} }
}); });
}
} }
} }
}).start(); }).start();

View File

@ -48,7 +48,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private TextView poiVideoAuditProcess; private TextView poiVideoAuditProcess;
private TextView poiVideoAuditThrough; private TextView poiVideoAuditThrough;
private TextView poiVideoAuditProcessAbleNotThrough; private TextView poiVideoAuditProcessAbleNotThrough;
private int hasPage;
private File logFile; private File logFile;
private StringBuilder hasSubmitBuilder; private StringBuilder hasSubmitBuilder;
@ -107,9 +106,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private void initOtherSubMitWork() { private void initOtherSubMitWork() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", "5"); httpParams.put("type", 5);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
httpParams.put("pageNum", hasPage+""); httpParams.put("pageNum", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -126,9 +125,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
otherAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + ""); otherAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + "");
otherAuditThrough.setText(hasSubmitBeanBody.getPassCount() + ""); otherAuditThrough.setText(hasSubmitBeanBody.getPassCount() + "");
otherAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + ""); otherAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
hasPage++;
} }
} else { } else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show();
} }
@ -145,9 +142,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private void initCaningSubMitWork() { private void initCaningSubMitWork() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", "2"); httpParams.put("type", 2);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
httpParams.put("pageNum", hasPage+""); httpParams.put("pageNum", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -164,7 +161,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
chargingAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + ""); chargingAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + "");
chargingAuditThrough.setText(hasSubmitBeanBody.getPassCount() + ""); chargingAuditThrough.setText(hasSubmitBeanBody.getPassCount() + "");
chargingAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + ""); chargingAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
hasPage++;
} }
} else { } else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show();
@ -183,9 +179,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private void initRoadSubMitWork() { private void initRoadSubMitWork() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", "4"); httpParams.put("type", 4);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
httpParams.put("pageNum", hasPage+""); httpParams.put("pageNum", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -202,7 +198,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
roadAuditProcess.setText(hasSubmitBeanBody.getAuditingCount()+""); roadAuditProcess.setText(hasSubmitBeanBody.getAuditingCount()+"");
roadAuditThrough.setText(hasSubmitBeanBody.getPassCount()+""); roadAuditThrough.setText(hasSubmitBeanBody.getPassCount()+"");
roadAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + ""); roadAuditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
hasPage++;
} }
} else { } else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
@ -221,9 +216,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private void initPoiVideoSubMitWork() { private void initPoiVideoSubMitWork() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", "3"); httpParams.put("type", 3);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
httpParams.put("pageNum", hasPage+""); httpParams.put("pageNum", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -240,7 +235,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
poiVideoAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + ""); poiVideoAuditProcess.setText(hasSubmitBeanBody.getAuditingCount() + "");
poiVideoAuditThrough.setText(hasSubmitBeanBody.getPassCount() + ""); poiVideoAuditThrough.setText(hasSubmitBeanBody.getPassCount() + "");
poiVideoAuditProcessAbleNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + ""); poiVideoAuditProcessAbleNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
hasPage++;
} }
} else { } else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), hasSubmitBean.getMessage() + "", Toast.LENGTH_SHORT).show();
@ -259,9 +253,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
private void initPoiSubMitWork() { private void initPoiSubMitWork() {
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", "1"); httpParams.put("type", 1);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
httpParams.put("pageNum", hasPage+""); httpParams.put("pageNum", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -278,7 +272,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
auditProcess.setText(hasSubmitBeanBody.getAuditingCount() + ""); auditProcess.setText(hasSubmitBeanBody.getAuditingCount() + "");
auditThrough.setText(hasSubmitBeanBody.getPassCount() + ""); auditThrough.setText(hasSubmitBeanBody.getPassCount() + "");
auditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + ""); auditNotThrough.setText(hasSubmitBeanBody.getNotPassCount() + "");
hasPage++;
Log.d("TAG", "onSuccess: " + hasSubmitBean.getBody() + ""); Log.d("TAG", "onSuccess: " + hasSubmitBean.getBody() + "");
} }
} else { } else {

View File

@ -63,9 +63,9 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
private void initNetWork(boolean b) { private void initNetWork(boolean b) {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1"); httpParams.put("fid", 1);
httpParams.put("pageNum", issuePage); httpParams.put("pageNum", issuePage);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.MSG_LISt) .url(HttpInterface.MSG_LISt)

View File

@ -95,9 +95,9 @@ public class MessageFragment extends BaseFragment implements View.OnClickListen
private void initNetwork() { private void initNetwork() {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("fid", "5"); httpParams.put("fid", 5);
httpParams.put("pageNum", messagePage+""); httpParams.put("pageNum", messagePage);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", 10);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.MSG_LISt) .url(HttpInterface.MSG_LISt)

View File

@ -72,6 +72,7 @@ import org.greenrobot.eventbus.Subscribe;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -292,7 +293,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivPicture.setImageDrawable(null); ivPicture.setImageDrawable(null);
ivPicture.setTag(null); if (tvPicture.getTag()!=null){
File file = new File((String) tvPicture.getTag());
file.delete();
tvPicture.setTag(null);
}
return false; return false;
} }
}); });
@ -308,7 +313,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivPictures.setImageDrawable(null); ivPictures.setImageDrawable(null);
ivPictures.setTag(null); if (tvPictures.getTag()!=null){
File file = new File((String) tvPictures.getTag());
file.delete();
tvPictures.setTag(null);
}
return false; return false;
} }
}); });
@ -319,6 +328,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
private void disables() { private void disables() {
spinnerOther.setEnabled(false); spinnerOther.setEnabled(false);
linearExist.setEnabled(false);
spinnerExist.setEnabled(false);
checkPot.setEnabled(false); checkPot.setEnabled(false);
editTaskName.setEnabled(false); editTaskName.setEnabled(false);
rlPicture.setEnabled(false); rlPicture.setEnabled(false);
@ -607,22 +618,24 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override @Override
public void run() { public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
if (isLocal) { public void run() {
otherUploadByNet(body, otherUploadList); if (isLocal) {
Constant.isPresent = false; otherUploadByNet(body, otherUploadList);
} else { Constant.isPresent = false;
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); } else {
Message obtain = Message.obtain(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
getActivity().onBackPressed(); EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
} }
} });
}); }
} }
}).start(); }).start();
} else { } else {
@ -679,6 +692,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPicture.getTag()!=null){
File filePicture = new File(String.valueOf(tvPicture.getTag()));
filePicture.delete();
tvPicture.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPicture); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPicture);
tvPicture.setTag(andGetPath); tvPicture.setTag(andGetPath);
} }
@ -688,6 +706,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPictures.getTag()!=null){
File filePictures = new File(String.valueOf(tvPictures.getTag()));
filePictures.delete();
tvPictures.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPictures); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPictures);
tvPictures.setTag(andGetPath); tvPictures.setTag(andGetPath);
} }

View File

@ -115,6 +115,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private Point screenPoiPositions; private Point screenPoiPositions;
private File logFile; private File logFile;
private StringBuilder poiBuilder; private StringBuilder poiBuilder;
private RelativeLayout relativePhone;
public static PoiFragment newInstance(Bundle bundle) { public static PoiFragment newInstance(Bundle bundle) {
PoiFragment fragment = new PoiFragment(); PoiFragment fragment = new PoiFragment();
@ -240,6 +241,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
tvCard = findViewById(R.id.tv_card); tvCard = findViewById(R.id.tv_card);
ivElse = findViewById(R.id.iv_else); ivElse = findViewById(R.id.iv_else);
tvElse = findViewById(R.id.tv_else); tvElse = findViewById(R.id.tv_else);
relativePhone = findViewById(R.id.linear_phone);
linearContact = findViewById(R.id.linear_contact); linearContact = findViewById(R.id.linear_contact);
rlPanorama = findViewById(R.id.rl_panorama); rlPanorama = findViewById(R.id.rl_panorama);
rlPanorama.setOnClickListener(this); rlPanorama.setOnClickListener(this);
@ -292,7 +294,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivPanorama.setImageDrawable(null); ivPanorama.setImageDrawable(null);
ivPanorama.setTag(null); if (tvPanorama.getTag()!=null){
File file = new File((String) tvPanorama.getTag());
file.delete();
tvPanorama.setTag(null);
}
return false; return false;
} }
}); });
@ -307,7 +313,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivName.setImageDrawable(null); ivName.setImageDrawable(null);
ivName.setTag(null); if (tvPoiNamePic.getTag()!=null){
File file = new File((String) tvPoiNamePic.getTag());
file.delete();
tvPoiNamePic.setTag(null);
}
return false; return false;
} }
}); });
@ -322,7 +332,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivElse.setImageDrawable(null); ivElse.setImageDrawable(null);
ivElse.setTag(null); if (tvElse.getTag()!=null){
File file = new File((String) tvElse.getTag());
file.delete();
tvElse.setTag(null);
}
return false; return false;
} }
}); });
@ -337,7 +351,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivInternal.setImageDrawable(null); ivInternal.setImageDrawable(null);
ivInternal.setTag(null); if (tvInternal.getTag()!=null){
File file = new File((String) tvInternal.getTag());
file.delete();
tvInternal.setTag(null);
}
return false; return false;
} }
}); });
@ -353,7 +371,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
ivCard.setImageDrawable(null); ivCard.setImageDrawable(null);
ivCard.setTag(null); if (tvCard.getTag()!=null){
File file = new File((String) tvCard.getTag());
file.delete();
tvCard.setTag(null);
}
return false; return false;
} }
}); });
@ -580,6 +602,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
ivElse.setEnabled(false); ivElse.setEnabled(false);
editDescribe.setEnabled(false); editDescribe.setEnabled(false);
btnSaveLocal.setEnabled(false); btnSaveLocal.setEnabled(false);
spinnerExist.setEnabled(false);
relativePhone.setEnabled(false);
} }
@Override @Override
@ -950,6 +974,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPanorama.getTag()!=null){
File filePanorama = new File((String) tvPanorama.getTag());
filePanorama.delete();
tvPanorama.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath); tvPanorama.setTag(andGetPath);
} }
@ -959,6 +988,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvPoiNamePic.getTag()!=null){
File fileName = new File((String) tvPoiNamePic.getTag());
fileName.delete();
tvPoiNamePic.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
tvPoiNamePic.setTag(andGetPath); tvPoiNamePic.setTag(andGetPath);
} }
@ -968,6 +1002,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvInternal.getTag()!=null){
File fileInternal = new File((String) tvInternal.getTag());
fileInternal.delete();
tvInternal.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
tvInternal.setTag(andGetPath); tvInternal.setTag(andGetPath);
} }
@ -977,6 +1016,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvCard.getTag()!=null){
File fileCard = new File((String) tvCard.getTag());
fileCard.delete();
tvCard.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard);
tvCard.setTag(andGetPath); tvCard.setTag(andGetPath);
} }
@ -986,6 +1030,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null; assert file != null;
File videoFile = new File(file); File videoFile = new File(file);
if (videoFile.exists()) { if (videoFile.exists()) {
if (tvElse.getTag()!=null){
File fileElse = new File((String) tvElse.getTag());
fileElse.delete();
tvElse.setTag(null);
}
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse);
tvElse.setTag(andGetPath); tvElse.setTag(andGetPath);
} }

View File

@ -348,7 +348,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
break; break;
case R.id.tv_short://手动拍摄 case R.id.tv_short://手动拍摄
poiVideoBuilder.append("点击了手动拍摄的按钮 ,"); poiVideoBuilder.append("点击了手动拍摄的按钮 ,");
Intent intents = new Intent(getContext(), PicturesActivity.class); Intent intents = new Intent(getActivity(), PicturesActivity.class);
File filePath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath()); File filePath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
intents.putExtra(Constant.INTENT_JPG_PATH, filePath.getAbsolutePath()); intents.putExtra(Constant.INTENT_JPG_PATH, filePath.getAbsolutePath());
intents.putExtra("poiEntity", showPoiEntity); intents.putExtra("poiEntity", showPoiEntity);
@ -358,7 +358,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
break; break;
case R.id.tv_combo://自动连拍: case R.id.tv_combo://自动连拍:
poiVideoBuilder.append("点击了自动连拍的按钮 ,"); poiVideoBuilder.append("点击了自动连拍的按钮 ,");
Intent intent = new Intent(getContext(), PicturesActivity.class); Intent intent = new Intent(getActivity(), PicturesActivity.class);
File fileJpgPath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath()); File fileJpgPath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
intent.putExtra(Constant.INTENT_JPG_PATH, fileJpgPath.getAbsolutePath()); intent.putExtra(Constant.INTENT_JPG_PATH, fileJpgPath.getAbsolutePath());
intent.putExtra("poiEntity", showPoiEntity); intent.putExtra("poiEntity", showPoiEntity);
@ -498,21 +498,24 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override @Override
public void run() { public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
if (isLocal) { public void run() {
poiVideoUpload(poiVideoBody, fileZip); if (isLocal) {
} else { poiVideoUpload(poiVideoBody, fileZip);
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); } else {
Message obtain = Message.obtain(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
getActivity().onBackPressed(); EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
} }
} });
});
}
} }
}).start(); }).start();
} else { } else {

View File

@ -499,22 +499,24 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
@Override @Override
public void run() { public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
if (isLocal) { public void run() {
poiVideoUpload(roadBody, fileZip); if (isLocal) {
Constant.isPresent = false; poiVideoUpload(roadBody, fileZip);
} else { Constant.isPresent = false;
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); } else {
Message obtain = Message.obtain(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
obtain.what = Constant.JOB_WORD_MONITOR; Message obtain = Message.obtain();
obtain.obj = true; obtain.what = Constant.JOB_WORD_MONITOR;
EventBus.getDefault().post(obtain); obtain.obj = true;
getActivity().onBackPressed(); EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
} }
} });
}); }
} }
}).start(); }).start();
} else { } else {
@ -523,8 +525,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
} else { } else {
Toast.makeText(getActivity(), "" + roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "" + roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
} }
} }
@Override @Override
@ -711,13 +711,15 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
} }
sb.append("-").append(formats); sb.append("-").append(formats);
poiEntity.setName(sb.toString()); poiEntity.setName(sb.toString());
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
etRoadName.setText(sb); public void run() {
etRoadName.setEnabled(false); etRoadName.setText(sb);
} etRoadName.setEnabled(false);
}); }
});
}
} }
String desc = etDesc.getText().toString().trim(); String desc = etDesc.getText().toString().trim();
if (!desc.equals("")) { if (!desc.equals("")) {

View File

@ -139,9 +139,9 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
private void initNetWork(boolean aNet) { private void initNetWork(boolean aNet) {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("fid", "3"); httpParams.put("fid", 3);
httpParams.put("pageNum", taskPage); httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", "20"); httpParams.put("pageSize", 20);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.LIST_TASK_EXPLAIN) .url(HttpInterface.LIST_TASK_EXPLAIN)

View File

@ -870,222 +870,223 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
//List<PoiEntity> allTaskStatus = poiDao.getAllPoi(); //List<PoiEntity> allTaskStatus = poiDao.getAllPoi();
List<PoiEntity> allPoiStatus = poiDao.getAllPoiStatus(); List<PoiEntity> allPoiStatus = poiDao.getAllPoiStatus();
if (allPoiStatus != null) { if (allPoiStatus != null) {
poiDao.deleteAll(allPoiStatus); poiDao.deleteAll(allPoiStatus);
} }
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { if (getActivity()!=null){
@Override getActivity().runOnUiThread(new Runnable() {
public void run() { @Override
for (int i = 0; i < removablesLocality.size(); i++) { public void run() {
removablesLocality.get(i).remove(); for (int i = 0; i < removablesLocality.size(); i++) {
} removablesLocality.get(i).remove();
removablesLocality.clear(); }
for (int i = 0; i < allTaskStatus.size(); i++) { removablesLocality.clear();
PoiEntity poiEntity = allTaskStatus.get(i); for (int i = 0; i < allTaskStatus.size(); i++) {
String geoWkt = allTaskStatus.get(i).getGeoWkt(); PoiEntity poiEntity = allTaskStatus.get(i);
LatLng latLng = null; String geoWkt = allTaskStatus.get(i).getGeoWkt();
Log.d("TAG", "onSuccess: " + geoWkt); LatLng latLng = null;
if (geoWkt != null) { Log.d("TAG", "onSuccess: " + geoWkt);
String geo = Geohash.getInstance().decode(geoWkt);//解密geo if (geoWkt != null) {
Geometry geometry = GeometryTools.createGeometry(geo); String geo = Geohash.getInstance().decode(geoWkt);//解密geo
switch (geometry.getGeometryType()) { Geometry geometry = GeometryTools.createGeometry(geo);
case "Point": // switch (geometry.getGeometryType()) {
latLng = GeometryTools.createLatLng(geo); case "Point": //
break; latLng = GeometryTools.createLatLng(geo);
case "LineString": //线 break;
case "MultiLineString"://多线 case "LineString": //线
BitmapDescriptor bitmapLine = null; case "MultiLineString"://多线
int color = 0; BitmapDescriptor bitmapLine = null;
if (poiEntity.getType() == 3) {//poi录像 int color = 0;
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows); if (poiEntity.getType() == 3) {//poi录像
} else if (poiEntity.getType() == 4) {//道路录像 bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows); } else if (poiEntity.getType() == 4) {//道路录像
} bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
if (poiEntity.getTaskStatus() == 1) { }
color = Color.parseColor("#FFE70C"); if (poiEntity.getTaskStatus() == 1) {
} else { color = Color.parseColor("#FFE70C");
color = Color.parseColor("#BDBDBD"); } else {
} color = Color.parseColor("#BDBDBD");
List<LatLng> latLineString = GeometryTools.getLatLags(geo); }
// 构造 PolylineOnions List<LatLng> latLineString = GeometryTools.getLatLags(geo);
PolylineOptions polylineOptions = new PolylineOptions() // 构造 PolylineOnions
.addAll(latLineString) PolylineOptions polylineOptions = new PolylineOptions()
// 折线设置圆形线头 .addAll(latLineString)
.lineCap(true) // 折线设置圆形线头
.color(color) .lineCap(true)
// 折线宽度为5像素 .color(color)
.width(28) // 折线宽度为5像素
.arrow(true) .width(28)
.arrowSpacing(80) .arrow(true)
.arrowTexture(bitmapLine); .arrowSpacing(80)
// 绘制折线 .arrowTexture(bitmapLine);
Polyline polyline = tencentMap.addPolyline(polylineOptions); // 绘制折线
if (polyline != null) { Polyline polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(MARKER_LINE); if (polyline != null) {
removablesLocality.add(polyline); polyline.setZIndex(MARKER_LINE);
if (latLineString != null && latLineString.size() > 0) { removablesLocality.add(polyline);
latLng = latLineString.get(0); if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0);
}
}
break;
case "Polygon": //
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().//连接封闭图形的点
addAll(latPolygon).//填充颜色为浅蓝色
fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色
strokeColor(0xff00ff00).//边线宽度15像素
strokeWidth(5));
if (polygon != null) {
polygon.setZIndex(MARKER_FACE);
removablesLocality.add(polygon);
Point centroid = geometry.getCentroid();
double x = centroid.getX();
double y = centroid.getY();
latLng = new LatLng();
latLng.setLatitude(y);
latLng.setLongitude(x);
} }
}
break;
case "Polygon": //
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().//连接封闭图形的点
addAll(latPolygon).//填充颜色为浅蓝色
fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色
strokeColor(0xff00ff00).//边线宽度15像素
strokeWidth(5));
if (polygon != null) {
polygon.setZIndex(MARKER_FACE);
removablesLocality.add(polygon);
Point centroid = geometry.getCentroid();
double x = centroid.getX();
double y = centroid.getY();
latLng = new LatLng();
latLng.setLatitude(y);
latLng.setLongitude(x);
}
/*if (latPolygon != null && latPolygon.size() > 0) { /*if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0); latLng = latPolygon.get(0);
}*/ }*/
break;
}
} else {
if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) {
latLng = new LatLng(Double.parseDouble(allTaskStatus.get(i).getY()), Double.parseDouble(allTaskStatus.get(i).getX()));
}
}
switch (poiEntity.getType()) {
case 1://poi
BitmapDescriptor poiDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
} else {
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
}
assert latLng != null;
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor)
.flat(true)
.anchor(0.5f, 1f)
.clockwise(false));
poiMarker.setClickable(true);
poiMarker.setZIndex(MARKER_DOT);
poiMarker.setTitle(poiEntity.getName() + "");
poiMarker.setTag(poiEntity);
removablesLocality.add(poiMarker);
String poiGeo = initGeo(latLng);
geoMarker(poiGeo, poiMarker);
break;
case 2://充电站
BitmapDescriptor chargeDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
} else {
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
}
assert latLng != null;
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor)
.flat(true)
.anchor(0.5f, 1f)
.clockwise(false));
stationMarker.setClickable(true);
stationMarker.setZIndex(MARKER_DOT);
stationMarker.setTitle(poiEntity.getName() + "");
stationMarker.setTag(poiEntity);
removablesLocality.add(stationMarker);
String stationGeo = initGeo(latLng);
geoMarker(stationGeo, stationMarker);
break;
case 3://poi录像
BitmapDescriptor poiVideoDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
} else {
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoivideo);
}
assert latLng != null;
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
poiVideoMarker.setClickable(true);
poiVideoMarker.setZIndex(MARKER_DOT);
poiVideoMarker.setTitle(poiEntity.getName() + "");
poiVideoMarker.setTag(poiEntity);
removablesLocality.add(poiVideoMarker);
String poiVideoGeo = initGeo(latLng);
geoMarker(poiVideoGeo, poiVideoMarker);
break;
case 4://道路录像
BitmapDescriptor roadDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
} else {
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
}
assert latLng != null;
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
roadMarker.setClickable(true);
roadMarker.setZIndex(MARKER_DOT);
roadMarker.setTitle(poiEntity.getName() + "");
roadMarker.setTag(poiEntity);
removablesLocality.add(roadMarker);
String roadGeo = initGeo(latLng);
geoMarker(roadGeo, roadMarker);
break;
case 5://其他
BitmapDescriptor otherDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
} else {
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
}
assert latLng != null;
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
otherMarker.setClickable(true);
otherMarker.setZIndex(MARKER_DOT);
otherMarker.setTitle(poiEntity.getName() + "");
otherMarker.setTag(poiEntity);
removablesLocality.add(otherMarker);
String otherGeo = initGeo(latLng);
geoMarker(otherGeo, otherMarker);
break;
case 6://面状任务
BitmapDescriptor Descriptor = null;
if (poiEntity.getTaskStatus() == 1) {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
} else {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
}
assert latLng != null;
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor)
.anchor(0.5f, 1f)
.clockwise(false)
.flat(true));
planarMarker.setClickable(true);
planarMarker.setZIndex(MARKER_DOT);
planarMarker.setTitle(poiEntity.getName() + "");
planarMarker.setTag(poiEntity);
removablesLocality.add(planarMarker);
String planarGeo = initGeo(latLng);
geoMarker(planarGeo, planarMarker);
break; break;
} }
} else {
if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) {
latLng = new LatLng(Double.parseDouble(allTaskStatus.get(i).getY()), Double.parseDouble(allTaskStatus.get(i).getX()));
}
}
switch (poiEntity.getType()) {
case 1://poi
BitmapDescriptor poiDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
} else {
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
}
assert latLng != null;
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor)
.flat(true)
.anchor(0.5f, 1f)
.clockwise(false));
poiMarker.setClickable(true);
poiMarker.setZIndex(MARKER_DOT);
poiMarker.setTitle(poiEntity.getName() + "");
poiMarker.setTag(poiEntity);
removablesLocality.add(poiMarker);
String poiGeo = initGeo(latLng);
geoMarker(poiGeo, poiMarker);
break;
case 2://充电站
BitmapDescriptor chargeDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
} else {
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
}
assert latLng != null;
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor)
.flat(true)
.anchor(0.5f, 1f)
.clockwise(false));
stationMarker.setClickable(true);
stationMarker.setZIndex(MARKER_DOT);
stationMarker.setTitle(poiEntity.getName() + "");
stationMarker.setTag(poiEntity);
removablesLocality.add(stationMarker);
String stationGeo = initGeo(latLng);
geoMarker(stationGeo, stationMarker);
break;
case 3://poi录像
BitmapDescriptor poiVideoDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
} else {
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoivideo);
}
assert latLng != null;
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
poiVideoMarker.setClickable(true);
poiVideoMarker.setZIndex(MARKER_DOT);
poiVideoMarker.setTitle(poiEntity.getName() + "");
poiVideoMarker.setTag(poiEntity);
removablesLocality.add(poiVideoMarker);
String poiVideoGeo = initGeo(latLng);
geoMarker(poiVideoGeo, poiVideoMarker);
break;
case 4://道路录像
BitmapDescriptor roadDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
} else {
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
}
assert latLng != null;
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
roadMarker.setClickable(true);
roadMarker.setZIndex(MARKER_DOT);
roadMarker.setTitle(poiEntity.getName() + "");
roadMarker.setTag(poiEntity);
removablesLocality.add(roadMarker);
String roadGeo = initGeo(latLng);
geoMarker(roadGeo, roadMarker);
break;
case 5://其他
BitmapDescriptor otherDescriptor = null;
if (poiEntity.getTaskStatus() == 1) {
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
} else {
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
}
assert latLng != null;
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor)
.anchor(0.5f, 1f)
.flat(true)
.clockwise(false));
otherMarker.setClickable(true);
otherMarker.setZIndex(MARKER_DOT);
otherMarker.setTitle(poiEntity.getName() + "");
otherMarker.setTag(poiEntity);
removablesLocality.add(otherMarker);
String otherGeo = initGeo(latLng);
geoMarker(otherGeo, otherMarker);
break;
case 6://面状任务
BitmapDescriptor Descriptor = null;
if (poiEntity.getTaskStatus() == 1) {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
} else {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
}
assert latLng != null;
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor)
.anchor(0.5f, 1f)
.clockwise(false)
.flat(true));
planarMarker.setClickable(true);
planarMarker.setZIndex(MARKER_DOT);
planarMarker.setTitle(poiEntity.getName() + "");
planarMarker.setTag(poiEntity);
removablesLocality.add(planarMarker);
String planarGeo = initGeo(latLng);
geoMarker(planarGeo, planarMarker);
break;
} }
Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_POI_WORD;
obtain.obj = allTaskStatus;
EventBus.getDefault().post(obtain);
} }
Message obtain = Message.obtain(); });
obtain.what = Constant.JOB_SEARCH_POI_WORD;
obtain.obj = allTaskStatus; }
EventBus.getDefault().post(obtain);
}
});
} }
}).start(); }).start();
} }
@ -1519,7 +1520,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
CameraUpdate cameraSigma = CameraUpdate cameraSigma =
CameraUpdateFactory.newCameraPosition(new CameraPosition( CameraUpdateFactory.newCameraPosition(new CameraPosition(
new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度 new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度
cameraPosition==null?10:cameraPosition.zoom, //目标缩放级别 cameraPosition==null?7:cameraPosition.zoom, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) 0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0) 0)); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma); tencentMap.animateCamera(cameraSigma);

View File

@ -153,26 +153,26 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams()) .params(new HttpParams())
.getRequest(new Callback<GetPriceBean>() { .getRequest(new Callback<GetPriceBean>() {
@SuppressLint("SetTextI18n")
@Override @Override
public void onSuccess(GetPriceBean response, int id) { public void onSuccess(GetPriceBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (response.getCode() == 200) { if (response.getCode() == 200) {
Double userPrice = response.getBody().getUserPrice(); GetPriceBean.BodyBean body = response.getBody();
Double userPrice = body.getUserPrice();
tvTotal.setText(userPrice + ""); tvTotal.setText(userPrice + "");
canExchangePrice = response.getBody().getCanExchangePrice(); canExchangePrice = body.getCanExchangePrice();
tvUnit.setText(canExchangePrice + ""); tvUnit.setText(canExchangePrice + "");
tvAlready.setText(response.getBody().getHaveExchangePrice()+""); tvAlready.setText(body.getHaveExchangePrice()+"");
poiPushMoney.setText(response.getBody().getPoiPushPrice()+""); poiPushMoney.setText(body.getPoiPushPrice()+"");
poiReportMoney.setText(response.getBody().getPoiNonepushPrice()+""); poiReportMoney.setText(body.getPoiNonepushPrice()+"");
poiVideoPushMoney.setText(response.getBody().getPoivideoPushPrice()+""); poiVideoPushMoney.setText(body.getPoivideoPushPrice()+"");
poiVideoReportMoney.setText(response.getBody().getPoivideoNonepushPrice()+""); poiVideoReportMoney.setText(body.getPoivideoNonepushPrice()+"");
roadPushMoney.setText(response.getBody().getRoadPushPrice()+""); roadPushMoney.setText(body.getRoadPushPrice()+"");
roadReportMoney.setText(response.getBody().getRoadNonepushPrice()+""); roadReportMoney.setText(body.getRoadNonepushPrice()+"");
chargingPushMoney.setText(response.getBody().getCsPushPrice() + ""); chargingPushMoney.setText(body.getCsPushPrice() + "");
chargingReportMoney.setText(response.getBody().getCsNonepushPrice() + ""); chargingReportMoney.setText(body.getCsNonepushPrice() + "");
otherPushMoney.setText(response.getBody().getOtherPushPrice() + ""); otherPushMoney.setText(body.getOtherPushPrice() + "");
otherReportMoney.setText(response.getBody().getOtherNonepushPrice() + ""); otherReportMoney.setText(body.getOtherNonepushPrice() + "");
} else { } else {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
} }
@ -245,7 +245,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
setLoadingDialogText("提现中..."); setLoadingDialogText("提现中...");
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("exchangeMoney", etAllPrice.getText().toString()); httpParams.put("exchangeMoney", etAllPrice.getText().toString());
httpParams.put("payType", "1"); httpParams.put("payType", 1);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.USER_PRICE_EXCHANGE) .url(HttpInterface.USER_PRICE_EXCHANGE)

View File

@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.api.Constant;
public class HttpInterface { public class HttpInterface {
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口 public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口 public static final String IP= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String USER_PATH ="/user/";//我的 public static final String USER_PATH ="/user/";//我的
public static final String MSG_LIST_PATH ="/msgList/";//发现 public static final String MSG_LIST_PATH ="/msgList/";//发现

View File

@ -366,19 +366,21 @@ public class PoiSaveUtils {
if (chargingStationPoiEntity != null) { if (chargingStationPoiEntity != null) {
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(mContext).getChargingPileDao().getChargingPileByStationId(chargingStationPoiEntity.getId()); List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(mContext).getChargingPileDao().getChargingPileByStationId(chargingStationPoiEntity.getId());
PoiEntity poiEntity = PoiDatabase.getInstance(mContext).getPoiDao().getPoiEntity(chargingStationPoiEntity.getId()); PoiEntity poiEntity = PoiDatabase.getInstance(mContext).getPoiDao().getPoiEntity(chargingStationPoiEntity.getId());
if (poiEntity!=null){
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) { if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
// 依次上传充电桩数据如果有一条数据未上传成功则返回false // 依次上传充电桩数据如果有一条数据未上传成功则返回false
for (ChargingPileEntity pileEntity : chargingPileEntityList) { for (ChargingPileEntity pileEntity : chargingPileEntityList) {
if (pileEntity.getBodyId() == 0) { if (pileEntity.getBodyId() == 0) {
int saveResult = saveChargingPile2NetWork(pileEntity, poiEntity.getBodyId()); int saveResult = saveChargingPile2NetWork(pileEntity, poiEntity.getBodyId());
if (saveResult == 200) { if (saveResult == 200) {
result = result & true; result = result & true;
} else { } else {
result = result & false; result = result & false;
}
} }
} }
} }
} }
} }
Log.d("TAGss", "saveChargingPileByChargingStation" + result); Log.d("TAGss", "saveChargingPileByChargingStation" + result);

View File

@ -71,7 +71,6 @@
app:layout_constraintBottom_toBottomOf="@+id/tv_time" app:layout_constraintBottom_toBottomOf="@+id/tv_time"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_time" /> app:layout_constraintTop_toTopOf="@+id/tv_time" />
<TextView <TextView
android:id="@+id/tv_describe" android:id="@+id/tv_describe"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -85,7 +85,8 @@
android:id="@+id/linear_exist" android:id="@+id/linear_exist"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/underline" android:background="@drawable/underline"
android:padding="2dp" android:padding="2dp"
android:visibility="gone" android:visibility="gone"

View File

@ -240,7 +240,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:orientation="vertical"></LinearLayout> android:orientation="vertical">
</LinearLayout>
</RelativeLayout> </RelativeLayout>