修改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:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
android:launchMode="singleTop" />
<meta-data
android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true" />
<meta-data
android:name="TencentMapSDK"
android:value="EWWBZ-2PB62-6JXUL-CEX7G-N7UE6-XRB4V" /> <!-- 今日头屏幕适配 -->

View File

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

View File

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

View File

@ -36,7 +36,7 @@ public class Constant {
public static String MESSAGE_TYPE = "messageType";
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 void initRootFolder(String userId) {
BASE_FOLDER = ROOT_FOLDER + "/" + userId;
@ -176,7 +176,7 @@ public class Constant {
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
public static TencentMap.OnMarkerClickListener markerClickListener = null;
public static final String NAVIN_FO = "10.22";//版本日期
public static final String NAVIN_FO = "10.26";//版本日期
/*
*联系我们的QQ群名称和QQ群号
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -139,9 +139,9 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
private void initNetWork(boolean aNet) {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "3");
httpParams.put("fid", 3);
httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", "20");
httpParams.put("pageSize", 20);
OkGoBuilder.getInstance()
.Builder(getActivity())
.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> allPoiStatus = poiDao.getAllPoiStatus();
if (allPoiStatus != null) {
poiDao.deleteAll(allPoiStatus);
}
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < removablesLocality.size(); i++) {
removablesLocality.get(i).remove();
}
removablesLocality.clear();
for (int i = 0; i < allTaskStatus.size(); i++) {
PoiEntity poiEntity = allTaskStatus.get(i);
String geoWkt = allTaskStatus.get(i).getGeoWkt();
LatLng latLng = null;
Log.d("TAG", "onSuccess: " + geoWkt);
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);//解密geo
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
case "Point": //
latLng = GeometryTools.createLatLng(geo);
break;
case "LineString": //线
case "MultiLineString"://多线
BitmapDescriptor bitmapLine = null;
int color = 0;
if (poiEntity.getType() == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
} else if (poiEntity.getType() == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
}
if (poiEntity.getTaskStatus() == 1) {
color = Color.parseColor("#FFE70C");
} else {
color = Color.parseColor("#BDBDBD");
}
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
// 构造 PolylineOnions
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
.color(color)
// 折线宽度为5像素
.width(28)
.arrow(true)
.arrowSpacing(80)
.arrowTexture(bitmapLine);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
if (polyline != null) {
polyline.setZIndex(MARKER_LINE);
removablesLocality.add(polyline);
if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0);
if (getActivity()!=null){
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < removablesLocality.size(); i++) {
removablesLocality.get(i).remove();
}
removablesLocality.clear();
for (int i = 0; i < allTaskStatus.size(); i++) {
PoiEntity poiEntity = allTaskStatus.get(i);
String geoWkt = allTaskStatus.get(i).getGeoWkt();
LatLng latLng = null;
Log.d("TAG", "onSuccess: " + geoWkt);
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);//解密geo
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
case "Point": //
latLng = GeometryTools.createLatLng(geo);
break;
case "LineString": //线
case "MultiLineString"://多线
BitmapDescriptor bitmapLine = null;
int color = 0;
if (poiEntity.getType() == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
} else if (poiEntity.getType() == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
}
if (poiEntity.getTaskStatus() == 1) {
color = Color.parseColor("#FFE70C");
} else {
color = Color.parseColor("#BDBDBD");
}
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
// 构造 PolylineOnions
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
.color(color)
// 折线宽度为5像素
.width(28)
.arrow(true)
.arrowSpacing(80)
.arrowTexture(bitmapLine);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
if (polyline != null) {
polyline.setZIndex(MARKER_LINE);
removablesLocality.add(polyline);
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) {
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;
}
} 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();
}
@ -1519,7 +1520,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
CameraUpdate cameraSigma =
CameraUpdateFactory.newCameraPosition(new CameraPosition(
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~360° (正北方为0)
tencentMap.animateCamera(cameraSigma);

View File

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

View File

@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant;
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 MSG_LIST_PATH ="/msgList/";//发现

View File

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

View File

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

View File

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

View File

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