fix: 增加腾讯定位GPS信号强弱
This commit is contained in:
@@ -104,6 +104,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
private boolean isOration = true;
|
private boolean isOration = true;
|
||||||
private boolean isTerminus = false;
|
private boolean isTerminus = false;
|
||||||
private boolean isBack = true;
|
private boolean isBack = true;
|
||||||
|
private boolean isGPS = false;
|
||||||
private int type = 0;
|
private int type = 0;
|
||||||
private int radioPicture = 0;
|
private int radioPicture = 0;
|
||||||
private int videoIndex = -1;
|
private int videoIndex = -1;
|
||||||
@@ -287,6 +288,33 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
if (result != null && result.getData() != null && result.getData().length > 0) {
|
if (result != null && result.getData() != null && result.getData().length > 0) {
|
||||||
super.onPictureTaken(result);
|
super.onPictureTaken(result);
|
||||||
isBack = true;
|
isBack = true;
|
||||||
|
|
||||||
|
|
||||||
|
//判断当前的信号强度
|
||||||
|
if (!isGPS){
|
||||||
|
int gpsRssi = Constant.currentLocation.getGPSRssi();
|
||||||
|
if (gpsRssi==0){//无信号
|
||||||
|
stopTimer();
|
||||||
|
capturePicture.setChecked(false);
|
||||||
|
if (radioPicture != 1) {
|
||||||
|
capturePicture.setText("开始采集");
|
||||||
|
capturePicture.setChecked(false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}else if (gpsRssi==1){//信号弱
|
||||||
|
stopTimer();
|
||||||
|
capturePicture.setChecked(false);
|
||||||
|
if (radioPicture != 1) {
|
||||||
|
capturePicture.setText("开始采集");
|
||||||
|
capturePicture.setChecked(false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}else if (gpsRssi==2){//信号中
|
||||||
|
isGPS=true;
|
||||||
|
}else if (gpsRssi==3){//信号强
|
||||||
|
isGPS=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 如果当前手机是竖向,则不
|
// 如果当前手机是竖向,则不
|
||||||
if (isOration) {
|
if (isOration) {
|
||||||
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
||||||
@@ -360,6 +388,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
|
isBack = false;
|
||||||
|
if (isOration) {
|
||||||
|
stopTimer();
|
||||||
|
}
|
||||||
|
if (radioPicture != 1) {
|
||||||
|
capturePicture.setText("开始采集");
|
||||||
|
}
|
||||||
|
capturePicture.setChecked(false);
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -371,11 +407,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
isBack = false;
|
isBack = false;
|
||||||
|
if (isOration) {
|
||||||
|
stopTimer();
|
||||||
|
}
|
||||||
if (radioPicture != 1) {
|
if (radioPicture != 1) {
|
||||||
capturePicture.setText("开始采集");
|
capturePicture.setText("开始采集");
|
||||||
}
|
}
|
||||||
capturePicture.setChecked(false);
|
capturePicture.setChecked(false);
|
||||||
stopTimer();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -527,7 +565,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
tencentMap.animateCamera(cameraSigma);
|
tencentMap.animateCamera(cameraSigma);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,7 +777,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTerminus() {
|
private void initTerminus() {
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHold
|
|||||||
} else if (listBean.getAuditStatus() == 1) {
|
} else if (listBean.getAuditStatus() == 1) {
|
||||||
holder.tvAuditStatus.setText("审核未通过");
|
holder.tvAuditStatus.setText("审核未通过");
|
||||||
holder.tvMassage.setVisibility(View.VISIBLE);
|
holder.tvMassage.setVisibility(View.VISIBLE);
|
||||||
|
if (listBean.getAuditMsg()!=null&&!listBean.getAuditMsg().equals("")){
|
||||||
holder.tvMassage.setText(listBean.getAuditMsg());
|
holder.tvMassage.setText(listBean.getAuditMsg());
|
||||||
|
}
|
||||||
} else if (listBean.getAuditStatus() == -1) {
|
} else if (listBean.getAuditStatus() == -1) {
|
||||||
holder.tvAuditStatus.setText("待审核");
|
holder.tvAuditStatus.setText("待审核");
|
||||||
holder.tvMassage.setVisibility(View.GONE);
|
holder.tvMassage.setVisibility(View.GONE);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||||
if (poiEntity.isChecked()) {
|
if (poiEntity.isChecked()) {
|
||||||
/*PoiEntityDeleteUtil.getInstance().deleteUtil(context,poiEntity);*/
|
PoiEntityDeleteUtil.getInstance().deleteUtil(context,poiEntity);
|
||||||
poiEntity.setTaskStatus(100);
|
poiEntity.setTaskStatus(100);
|
||||||
PoiDatabase.getInstance(context).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(context).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
}
|
}
|
||||||
@@ -379,7 +380,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {}
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
|
spinnerScutcheon = findViewById(R.id.spinner_scutcheon);
|
||||||
ArrayAdapter<String> adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
|
ArrayAdapter<String> adapterScutcheon = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, scutcheon);
|
||||||
@@ -761,7 +763,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (fid != null) {
|
if (fid != null) {
|
||||||
pid = fid;
|
pid = fid;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sign_exist = chargingPileEntity.getSign_exist();
|
int sign_exist = chargingPileEntity.getSign_exist();
|
||||||
spinnerScutcheon.setSelection(sign_exist, true);
|
spinnerScutcheon.setSelection(sign_exist, true);
|
||||||
if (sign_exist == 0) {
|
if (sign_exist == 0) {
|
||||||
@@ -1237,6 +1238,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@@ -1440,7 +1444,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
FileUtils.writeFile(logFile.getAbsolutePath(), chargingPileBuilder.toString(), true);
|
FileUtils.writeFile(logFile.getAbsolutePath(), chargingPileBuilder.toString(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity chargingPileEntity) {
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity chargingPileEntity) {
|
||||||
ArrayList<String> photo = new ArrayList<>();
|
ArrayList<String> photo = new ArrayList<>();
|
||||||
@@ -1455,7 +1458,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (cp_floor != 0) {
|
if (cp_floor != 0) {
|
||||||
chargingPileEntity.setCp_floor(cp_floor);
|
chargingPileEntity.setCp_floor(cp_floor);
|
||||||
}
|
}
|
||||||
|
|
||||||
String tagPanorama = (String) tvPanorama.getTag();
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
if (tagPanorama != null && !tagPanorama.equals("")) {
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
photo.add(tagPanorama);
|
photo.add(tagPanorama);
|
||||||
@@ -1554,7 +1556,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
poiCheckResult.setMsg("开放状态未勾选");
|
poiCheckResult.setMsg("开放状态未勾选");
|
||||||
return poiCheckResult;
|
return poiCheckResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tvEquipment.getTag() == null) {
|
if (tvEquipment.getTag() == null) {
|
||||||
poiCheckResult.setCode(1);
|
poiCheckResult.setCode(1);
|
||||||
poiCheckResult.setMsg("请拍照 设备标牌");
|
poiCheckResult.setMsg("请拍照 设备标牌");
|
||||||
@@ -1590,7 +1591,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
return poiCheckResult;
|
return poiCheckResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return poiCheckResult;
|
return poiCheckResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
private RelativeLayout linearExist;
|
private RelativeLayout linearExist;
|
||||||
private Spinner spinnerExist;
|
private Spinner spinnerExist;
|
||||||
|
|
||||||
private LinearLayout linearContact;
|
private LinearLayout linearContact;
|
||||||
private ContactView contactView;
|
private ContactView contactView;
|
||||||
private ArrayList<File> chargingStationList;
|
private ArrayList<File> chargingStationList;
|
||||||
@@ -181,14 +180,24 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initBack() {
|
private void initBack() {
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
if (showPoiEntity != null) {
|
chargingStationBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
chargingStationBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
initList();
|
initList();
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -229,6 +238,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -244,17 +257,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1123,7 +1128,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
chargingPileFileList.add(new File(photoPath));
|
chargingPileFileList.add(new File(photoPath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
||||||
@@ -1140,10 +1144,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
PoiUploadBean uploadBeanResult = new Gson().fromJson(pileUpLoadResultStr, PoiUploadBean.class);
|
PoiUploadBean uploadBeanResult = new Gson().fromJson(pileUpLoadResultStr, PoiUploadBean.class);
|
||||||
if (uploadBeanResult != null) {
|
if (uploadBeanResult != null) {
|
||||||
if (uploadBeanResult.getCode() == 200) {
|
if (uploadBeanResult.getCode() == 200) {
|
||||||
/* PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
// PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||||
chargingPileFileList.get(i).delete();
|
chargingPileFileList.get(i).delete();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1220,11 +1224,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
.cls(ChargingStationBean.class)
|
.cls(ChargingStationBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
if (getActivity() != null) {
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getChargingPreserveCallback(getActivity(), poiEntity));
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getChargingPreserveCallback(getActivity(), poiEntity));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
||||||
if (poiEntity == null) {
|
if (poiEntity == null) {
|
||||||
@@ -1243,11 +1249,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (getActivity()!=null){
|
}).start();
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", poiEntity.getBodyId());
|
httpParams.put("auditId", poiEntity.getBodyId());
|
||||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
@@ -1258,17 +1261,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.cls(PoiUploadBean.class);
|
.cls(PoiUploadBean.class);
|
||||||
|
if (getActivity() != null) {
|
||||||
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity, chargingStationList));
|
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity, chargingStationList));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||||
WaitDialog.dismiss(3000);
|
WaitDialog.dismiss(3000);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存充电站数据到服务器
|
* 保存充电站数据到服务器
|
||||||
@@ -1692,6 +1692,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
poiEntity.setTaskStatus(100);
|
||||||
|
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
/* if (showPoiEntity != null) {
|
/* if (showPoiEntity != null) {
|
||||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||||
@@ -1709,8 +1711,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
poiEntity.setTaskStatus(100);
|
|
||||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
//initList();
|
//initList();
|
||||||
|
|||||||
@@ -31,19 +31,13 @@ import com.navinfo.outdoor.R;
|
|||||||
import com.navinfo.outdoor.adapter.FilterAdapter;
|
import com.navinfo.outdoor.adapter.FilterAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.bean.BaseBean;
|
|
||||||
import com.navinfo.outdoor.bean.BolBean;
|
|
||||||
import com.navinfo.outdoor.bean.FilterBatchBean;
|
import com.navinfo.outdoor.bean.FilterBatchBean;
|
||||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||||
import com.navinfo.outdoor.bean.ReceivedBean;
|
|
||||||
import com.navinfo.outdoor.bean.ReceivedPoiBean;
|
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
@@ -234,8 +228,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
|
||||||
PoiDao poiDao = poiDatabase.getPoiDao();
|
|
||||||
poiEntities = new ArrayList<>();
|
poiEntities = new ArrayList<>();
|
||||||
btnChock = new ArrayList<>();//存储选择中的的数据
|
btnChock = new ArrayList<>();//存储选择中的的数据
|
||||||
ConstraintLayout clNumber = findViewById(R.id.cl_number);
|
ConstraintLayout clNumber = findViewById(R.id.cl_number);
|
||||||
|
|||||||
@@ -158,15 +158,24 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initBack() {
|
private void initBack() {
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
otherBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
otherBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
otherBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
initList();
|
initList();
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -182,6 +191,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -197,18 +210,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
otherBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 取消 按钮,");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -356,7 +360,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
rlPictures.setOnLongClickListener(new View.OnLongClickListener() {
|
rlPictures.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
@@ -636,11 +639,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
.cls(PoiSaveBean.class)
|
.cls(PoiSaveBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
if (getActivity()!=null){
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getOtherPreserveCallback(getActivity(), poiEntity));
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getOtherPreserveCallback(getActivity(), poiEntity));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
@@ -658,11 +663,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.cls(PoiUploadBean.class);
|
.cls(PoiUploadBean.class);
|
||||||
|
if (getActivity() != null) {
|
||||||
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(), showPoiEntity, otherUploadList));
|
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(), showPoiEntity, otherUploadList));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||||
WaitDialog.dismiss(3000);
|
WaitDialog.dismiss(3000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void otherSaveByNetWork(PoiEntity poiEntity) {
|
private void otherSaveByNetWork(PoiEntity poiEntity) {
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
|
|||||||
@@ -169,15 +169,24 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initBack() {
|
private void initBack() {
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
poiBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
poiBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
poiBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
initList();
|
initList();
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -193,6 +202,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -208,18 +221,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
poiBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 取消 按钮,");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -328,7 +332,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
@@ -584,7 +587,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -869,7 +871,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (taskNameBean.getCode() == 230) {
|
} else if (taskNameBean.getCode() == 230) {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@@ -879,7 +880,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@@ -889,7 +889,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
btnUploading.setEnabled(false);
|
btnUploading.setEnabled(false);
|
||||||
btnSaveLocal.setEnabled(false);
|
btnSaveLocal.setEnabled(false);
|
||||||
editNameContent.setTextColor(Color.RED);
|
editNameContent.setTextColor(Color.RED);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -913,7 +912,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@@ -975,7 +973,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void poiSaveNet(PoiEntity poiEntity) {
|
private void poiSaveNet(PoiEntity poiEntity) {
|
||||||
@@ -994,11 +991,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
.cls(PoiSaveBean.class)
|
.cls(PoiSaveBean.class)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(httpParams);
|
.params(httpParams);
|
||||||
|
if (getActivity()!=null){
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getPoiPreserveCallback(getActivity(), poiEntity));
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getPoiPreserveCallback(getActivity(), poiEntity));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
@@ -1016,12 +1015,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.fileList(poiPicList)
|
.fileList(poiPicList)
|
||||||
.params(httpParams);
|
.params(httpParams);
|
||||||
|
if (getActivity()!=null){
|
||||||
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(), showPoiEntity, poiPicList));
|
okGoBuilder.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(), showPoiEntity, poiPicList));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||||
WaitDialog.dismiss(3000);
|
WaitDialog.dismiss(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void poiSaveByNet(PoiEntity poiEntity) {
|
private void poiSaveByNet(PoiEntity poiEntity) {
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("taskId", poiEntity.getTaskId());
|
httpParams.put("taskId", poiEntity.getTaskId());
|
||||||
|
|||||||
@@ -140,15 +140,24 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initBack() {
|
private void initBack() {
|
||||||
|
if (showPoiEntity != null) {
|
||||||
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity.getId() != null) {
|
if (showPoiEntity.getId() != null) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||||
@@ -171,6 +180,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -186,18 +199,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 取消 按钮,");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -592,12 +596,15 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
.cls(PoiVideoBean.class)
|
.cls(PoiVideoBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
if (getActivity() != null) {
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getPoiVideoPreserveCallback(getActivity(), poiEntity));
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getPoiVideoPreserveCallback(getActivity(), poiEntity));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
||||||
if (poiVideoBody == 0) {
|
if (poiVideoBody == 0) {
|
||||||
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
||||||
@@ -619,12 +626,15 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
.cls(OtherUploadPicBean.class)
|
.cls(OtherUploadPicBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
if (getActivity() != null) {
|
||||||
okGoBuilder.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(), showPoiEntity, fileZip));
|
okGoBuilder.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(), showPoiEntity, fileZip));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||||
WaitDialog.dismiss(3000);
|
WaitDialog.dismiss(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void poiVideoSave(PoiEntity poiEntity) {
|
private void poiVideoSave(PoiEntity poiEntity) {
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("taskId", poiEntity.getTaskId());
|
httpParams.put("taskId", poiEntity.getTaskId());
|
||||||
@@ -908,17 +918,20 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
String format = formatter.format(calendar.getTime());
|
String format = formatter.format(calendar.getTime());
|
||||||
poiEntity.setCreateTime(format);
|
poiEntity.setCreateTime(format);
|
||||||
poiEntity.setType(3);
|
poiEntity.setType(3);
|
||||||
|
if (showPoiEntity.getId() != null) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||||
if (fileListByUUID != null) {
|
if (fileListByUUID != null) {
|
||||||
fmPoiVideoPic.setTag(fileListByUUID);
|
fmPoiVideoPic.setTag(fileListByUUID);
|
||||||
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList((List<File>) fmPoiVideoPic.getTag());
|
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList(fileListByUUID);
|
||||||
String lineString = Geohash.getInstance().encodeList(lineStringByFileList);
|
String lineString = Geohash.getInstance().encodeList(lineStringByFileList);
|
||||||
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmPoiVideoPic.getTag());
|
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr(fileListByUUID);
|
||||||
poiEntity.setPhoto(photoStr);
|
poiEntity.setPhoto(photoStr);
|
||||||
if (lineString != null) {
|
if (lineString != null) {
|
||||||
poiEntity.setDetail(lineString);
|
poiEntity.setDetail(lineString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return poiEntity;
|
return poiEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,16 +136,24 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initBack() {
|
private void initBack() {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
|
||||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消")
|
|
||||||
.setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
roadBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确认 按钮,");
|
|
||||||
if (showPoiEntity != null) {
|
if (showPoiEntity != null) {
|
||||||
if (showPoiEntity.getTaskStatus() == 5) {
|
if (showPoiEntity.getTaskStatus() == 5) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
roadBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
roadBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 确定 按钮,");
|
||||||
if (showPoiEntity.getId() != null) {
|
if (showPoiEntity.getId() != null) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||||
@@ -168,6 +176,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
@@ -183,19 +195,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
obtain1.obj = isSliding;
|
obtain1.obj = isSliding;
|
||||||
EventBus.getDefault().post(obtain1);
|
EventBus.getDefault().post(obtain1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
roadBuilder.append(TimestampUtil.time()).append(",").append("点击了返回当前页面的 取消 按钮,");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -584,12 +586,15 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
.cls(RoadSaveBean.class)
|
.cls(RoadSaveBean.class)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN);
|
.token(Constant.ACCESS_TOKEN);
|
||||||
|
if (getActivity()!=null){
|
||||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getRoadPreserveCallback(getActivity(), poiEntity));
|
okGoBuilder.getRequest(PreserveUtils.getInstance().getRoadPreserveCallback(getActivity(), poiEntity));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||||
WaitDialog.dismiss(1000);
|
WaitDialog.dismiss(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void poiVideoUpload(int body, File fileZip) {
|
private void poiVideoUpload(int body, File fileZip) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
@@ -612,11 +617,13 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.cls(OtherUploadPicBean.class);
|
.cls(OtherUploadPicBean.class);
|
||||||
|
if (getActivity()!=null){
|
||||||
okGoBuilder.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
|
okGoBuilder.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
|
||||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||||
WaitDialog.dismiss(3000);
|
WaitDialog.dismiss(3000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void roadSaveBetWork(PoiEntity poiEntity) {
|
private void roadSaveBetWork(PoiEntity poiEntity) {
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
@@ -905,17 +912,19 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
String format = formatter.format(calendar.getTime());
|
String format = formatter.format(calendar.getTime());
|
||||||
poiEntity.setCreateTime(format);
|
poiEntity.setCreateTime(format);
|
||||||
poiEntity.setType(4);
|
poiEntity.setType(4);
|
||||||
|
if (showPoiEntity.getId() != null) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||||
if (fileListByUUID != null) {
|
if (fileListByUUID != null) {
|
||||||
fmRoadPic.setTag(fileListByUUID);
|
fmRoadPic.setTag(fileListByUUID);
|
||||||
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList((List<File>) fmRoadPic.getTag());
|
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList(fileListByUUID);
|
||||||
String encodeList = Geohash.getInstance().encodeList(lineStringByFileList);
|
String encodeList = Geohash.getInstance().encodeList(lineStringByFileList);
|
||||||
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmRoadPic.getTag());
|
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr(fileListByUUID);
|
||||||
poiEntity.setPhoto(photoStr);
|
poiEntity.setPhoto(photoStr);
|
||||||
if (encodeList != null) {
|
if (encodeList != null) {
|
||||||
poiEntity.setDetail(encodeList);
|
poiEntity.setDetail(encodeList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return poiEntity;
|
return poiEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.navinfo.outdoor.http;
|
package com.navinfo.outdoor.http;
|
||||||
|
|
||||||
public class HttpInterface {
|
public class HttpInterface {
|
||||||
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||||
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||||
|
|
||||||
|
|
||||||
public static final String USER_PATH ="/user/";//我的
|
public static final String USER_PATH ="/user/";//我的
|
||||||
|
|||||||
@@ -279,9 +279,6 @@ public class OkGoBuilder<T> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public okhttp3.Response postFileSynchronization() {
|
public okhttp3.Response postFileSynchronization() {
|
||||||
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
initTimeOut(time);
|
initTimeOut(time);
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
params.put("datetime", time);
|
params.put("datetime", time);
|
||||||
@@ -410,15 +407,6 @@ public class OkGoBuilder<T> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public okhttp3.Response getSynchronization() {
|
public okhttp3.Response getSynchronization() {
|
||||||
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
|
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(activity, "网络不可用,请检查网络", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
initTimeOut(time);
|
initTimeOut(time);
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
params.put("datetime", time);
|
params.put("datetime", time);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class PoiEntityDeleteUtil {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
initPicture(context, poiEntity);
|
initPicture( poiEntity);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -66,14 +66,13 @@ public class PoiEntityDeleteUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPicture(Context context, PoiEntity poiEntity) {
|
private void initPicture(PoiEntity poiEntity) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
||||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||||
fileListByUUID.get(i).delete();
|
fileListByUUID.get(i).delete();
|
||||||
}
|
}
|
||||||
File filePath = AWMp4ParserHelper.getInstance().getFilePath(poiEntity.getId());
|
File filePath = AWMp4ParserHelper.getInstance().getFilePath(poiEntity.getId());
|
||||||
filePath.delete();
|
filePath.delete();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.google.gson.Gson;
|
|||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.navinfo.outdoor.api.UserApplication;
|
||||||
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
||||||
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
@@ -349,8 +350,11 @@ public class PoiSaveUtils {
|
|||||||
bInt++;
|
bInt++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert execute.body() != null;
|
|
||||||
String bodyStr = execute.body().string();
|
String bodyStr = execute.body().string();
|
||||||
|
if (bodyStr==null){
|
||||||
|
bInt++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
OtherUploadPicBean otherUploadPicBean = new Gson().fromJson(bodyStr, OtherUploadPicBean.class);
|
OtherUploadPicBean otherUploadPicBean = new Gson().fromJson(bodyStr, OtherUploadPicBean.class);
|
||||||
if (otherUploadPicBean.getCode() == 200) {
|
if (otherUploadPicBean.getCode() == 200) {
|
||||||
poiEntity.setTaskStatus(100);
|
poiEntity.setTaskStatus(100);
|
||||||
@@ -358,16 +362,7 @@ public class PoiSaveUtils {
|
|||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
list.get(i).delete();
|
list.get(i).delete();
|
||||||
}
|
}
|
||||||
if (poiEntity.getType()==3||poiEntity.getType()==4) {
|
PoiEntityDeleteUtil.getInstance().deleteUtil(mContext,poiEntity);
|
||||||
if (poiEntity.getId() != null) {
|
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
|
||||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
|
||||||
fileListByUUID.get(i).delete();
|
|
||||||
}
|
|
||||||
File filePath = AWMp4ParserHelper.getInstance().getFilePath(poiEntity.getId());
|
|
||||||
filePath.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.d("TAGss", "uploadPoiNet: 成功" + anInt);
|
Log.d("TAGss", "uploadPoiNet: 成功" + anInt);
|
||||||
anInt++;
|
anInt++;
|
||||||
return;
|
return;
|
||||||
@@ -432,25 +427,27 @@ public class PoiSaveUtils {
|
|||||||
.url(HttpInterface.SUBMIT_CSTASK)
|
.url(HttpInterface.SUBMIT_CSTASK)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(httpParams).getSynchronization();
|
.params(httpParams).getSynchronization();
|
||||||
|
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (execute == null) {
|
if (execute == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (execute.code() != 200) {
|
if (execute.code() != 200) {
|
||||||
return execute.code();
|
return execute.code();
|
||||||
}
|
}
|
||||||
String responseBodyStr = execute.body().string();
|
if (execute.body().string() != null) {
|
||||||
if (responseBodyStr == null) {
|
String string = execute.body().string();
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (responseBodyStr != null) {
|
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
ChargingPileSaveBean chargingPileSaveBean = gson.fromJson(responseBodyStr, ChargingPileSaveBean.class);
|
ChargingPileSaveBean chargingPileSaveBean = gson.fromJson(string, ChargingPileSaveBean.class);
|
||||||
if (chargingPileSaveBean.getCode() != 200) {
|
if (chargingPileSaveBean.getCode() != 200) {
|
||||||
return chargingPileSaveBean.getCode();
|
return chargingPileSaveBean.getCode();
|
||||||
}
|
}
|
||||||
Log.d("TAGss", "saveChargingPile2NetWork" + 200);
|
Log.d("TAGss", "saveChargingPile2NetWork" + 200);
|
||||||
chargingPileEntity.setBodyId(chargingPileSaveBean.getBody());
|
chargingPileEntity.setBodyId(chargingPileSaveBean.getBody());
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(mContext, chargingPileEntity); // 更新当前充电桩的bodyId
|
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(mContext, chargingPileEntity); // 更新当前充电桩的bodyId
|
||||||
|
}else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -508,6 +505,9 @@ public class PoiSaveUtils {
|
|||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.fileList(chargingPileFileList).postFileSynchronization();
|
.fileList(chargingPileFileList).postFileSynchronization();
|
||||||
|
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (execute == null) {
|
if (execute == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -515,9 +515,6 @@ public class PoiSaveUtils {
|
|||||||
return execute.code();
|
return execute.code();
|
||||||
}
|
}
|
||||||
String pileUpLoadResultStr = execute.body().string();
|
String pileUpLoadResultStr = execute.body().string();
|
||||||
if (pileUpLoadResultStr == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (pileUpLoadResultStr != null) {
|
if (pileUpLoadResultStr != null) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
PoiUploadBean uploadBeanResult = gson.fromJson(pileUpLoadResultStr, PoiUploadBean.class);
|
PoiUploadBean uploadBeanResult = gson.fromJson(pileUpLoadResultStr, PoiUploadBean.class);
|
||||||
@@ -527,6 +524,8 @@ public class PoiSaveUtils {
|
|||||||
chargingPileFileList.get(i).delete();
|
chargingPileFileList.get(i).delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
android:id="@+id/tv_auditMsg"
|
android:id="@+id/tv_auditMsg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/tv_createTime"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/tv_auditStatus"
|
app:layout_constraintEnd_toStartOf="@+id/tv_auditStatus"
|
||||||
app:layout_constraintHorizontal_bias="0.9"
|
app:layout_constraintHorizontal_bias="0.9"
|
||||||
app:layout_constraintStart_toEndOf="@+id/tv_createTime"
|
app:layout_constraintStart_toEndOf="@+id/tv_createTime"
|
||||||
|
|||||||
Reference in New Issue
Block a user