fix: 修改bug
This commit is contained in:
parent
cbcaf38b65
commit
143fc22492
@ -37,8 +37,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 118
|
||||
versionName "8.231110-通用测试版"
|
||||
versionCode 119
|
||||
versionName "8.231201-测试版"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
ndk {
|
||||
|
||||
@ -1365,7 +1365,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePicture4PoiActivity.this);
|
||||
|
||||
@ -1224,7 +1224,7 @@ public class AutoTakePicture4PoiVideoActivity extends BaseActivity implements Vi
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiVideoActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePicture4PoiVideoActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePicture4PoiVideoActivity.this);
|
||||
|
||||
@ -1416,7 +1416,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
Gson gson = new Gson();
|
||||
UnPolygonTaskBean response = gson.fromJson(bodyString, UnPolygonTaskBean.class);
|
||||
if (response.getCode() == 200) {
|
||||
PoiDatabase.getInstance(AutoTakePictureActivity.this).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(AutoTakePictureActivity.this).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
// 不需要删除照片,自动采集时照片是临时保存在tmp目录下
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(AutoTakePictureActivity.this);
|
||||
|
||||
@ -117,7 +117,7 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiEntityDeleteUtil.getInstance().deleteUtil(context, poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,16 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
public void onBindViewHolder(@NotNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
PoiEntity poiEntity = allRoad.get(position);
|
||||
holder.tvName.setText(poiEntity.getName());
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
if (poiEntity.getCreateTime()!=null&&!poiEntity.getCreateTime().trim().isEmpty()) {
|
||||
holder.tvCreateTime.setText("领取时间:"+poiEntity.getCreateTime());
|
||||
} else {
|
||||
holder.tvCreateTime.setVisibility(View.GONE);
|
||||
}
|
||||
if (poiEntity.getUnReceivedTime()!=null&&!poiEntity.getUnReceivedTime().trim().isEmpty()) {
|
||||
holder.tvExpirationTime.setText("过期时间:"+poiEntity.getUnReceivedTime());
|
||||
} else {
|
||||
holder.tvExpirationTime.setVisibility(View.GONE);
|
||||
}
|
||||
//获取checkBox点击的记录
|
||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@ -196,7 +205,7 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvName, tvText, tvDay;
|
||||
private TextView tvName, tvText, tvCreateTime, tvExpirationTime;
|
||||
private CheckBox cbUnSubmit;
|
||||
private ProgressBar pbUpload;
|
||||
private TextView tvUploadProgress, tvUploadResult;
|
||||
@ -206,7 +215,8 @@ public class HasReceiveAdapter extends RecyclerView.Adapter<HasReceiveAdapter.Vi
|
||||
super(itemView);
|
||||
tvName = itemView.findViewById(R.id.tv_road_name);
|
||||
tvText = itemView.findViewById(R.id.tv_text);
|
||||
tvDay = itemView.findViewById(R.id.tv_road_day);
|
||||
tvCreateTime = itemView.findViewById(R.id.tv_poi_createtime);
|
||||
tvExpirationTime = itemView.findViewById(R.id.tv_poi_expirationtime);
|
||||
cbUnSubmit = itemView.findViewById(R.id.cb_unSubmit);
|
||||
pbUpload = itemView.findViewById(R.id.pb_stay_upload);
|
||||
tvUploadProgress = itemView.findViewById(R.id.tv_pb_stay_upload);
|
||||
|
||||
@ -117,7 +117,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiEntityDeleteUtil.getInstance().deleteUtil(context, poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
public void onBindViewHolder(@NotNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
PoiEntity poiEntity = allRoad.get(position);
|
||||
holder.tvName.setText(poiEntity.getName());
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
holder.tvDay.setText("保存时间:"+poiEntity.getCreateTime());
|
||||
//获取checkBox点击的记录
|
||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@ -29,6 +29,10 @@ import com.tencent.map.navi.TencentNavi;
|
||||
import com.tencent.navi.surport.utils.DeviceUtils;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMapInitializer;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.umeng.message.IUmengRegisterCallback;
|
||||
import com.umeng.message.PushAgent;
|
||||
import com.umeng.message.UmengMessageHandler;
|
||||
import com.umeng.message.entity.UMessage;
|
||||
import com.umeng.umcrash.UMCrash;
|
||||
import com.umeng.umcrash.UMCrashCallback;
|
||||
|
||||
@ -44,7 +48,7 @@ import okhttp3.OkHttpClient;
|
||||
public class UserApplication extends Application {
|
||||
public static UserApplication userApplication;
|
||||
public static ExecutorService fixedThreadPool;
|
||||
// public static PushAgent instance;
|
||||
public static PushAgent instance;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@ -102,45 +106,45 @@ public class UserApplication extends Application {
|
||||
return "注册友盟异常查看功能";
|
||||
}
|
||||
});
|
||||
// instance = PushAgent.getInstance(this);
|
||||
// instance.register(new IUmengRegisterCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s) {
|
||||
// //注册成功会返回deviceToken deviceToken是推送消息的唯一标志
|
||||
// Constant.DEVICE_TOKEN = s;
|
||||
// Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
||||
// }
|
||||
// });
|
||||
// instance.onAppStart();
|
||||
// UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
||||
// //处理通知栏消息
|
||||
// @Override
|
||||
// public void dealWithNotificationMessage(Context context, UMessage msg) {
|
||||
// super.dealWithNotificationMessage(context, msg);
|
||||
// Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
||||
// Constant.NOTIFICATION=msg.getRaw().toString();
|
||||
// }
|
||||
//
|
||||
// //自定义通知样式,此方法可以修改通知样式等
|
||||
// @Override
|
||||
// public Notification getNotification(Context context, UMessage msg) {
|
||||
// Log.i("TAGEE", "getNotification: "+msg.getRaw().toString());
|
||||
// return super.getNotification(context, msg);
|
||||
// }
|
||||
//
|
||||
// //处理透传消息
|
||||
// @Override
|
||||
// public void dealWithCustomMessage(Context context, UMessage msg) {
|
||||
// super.dealWithCustomMessage(context, msg);
|
||||
// Log.i("TAGEE", "dealWithCustomMessage:" + msg.getRaw().toString());
|
||||
// }
|
||||
// };
|
||||
// instance.setMessageHandler(msgHandler);
|
||||
instance = PushAgent.getInstance(this);
|
||||
instance.register(new IUmengRegisterCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
//注册成功会返回deviceToken deviceToken是推送消息的唯一标志
|
||||
Constant.DEVICE_TOKEN = s;
|
||||
Log.i("TAGEE", "Success 注册成功:deviceToken:--> " + Constant.DEVICE_TOKEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("TAGEE", "Failure 注册失败:--> " + "code:" + s + ", desc:" + s1);
|
||||
}
|
||||
});
|
||||
instance.onAppStart();
|
||||
UmengMessageHandler msgHandler = new UmengMessageHandler() {
|
||||
//处理通知栏消息
|
||||
@Override
|
||||
public void dealWithNotificationMessage(Context context, UMessage msg) {
|
||||
super.dealWithNotificationMessage(context, msg);
|
||||
Log.i("TAGEE", "dealWithNotificationMessage:" + msg.getRaw().toString());
|
||||
Constant.NOTIFICATION=msg.getRaw().toString();
|
||||
}
|
||||
|
||||
//自定义通知样式,此方法可以修改通知样式等
|
||||
@Override
|
||||
public Notification getNotification(Context context, UMessage msg) {
|
||||
Log.i("TAGEE", "getNotification: "+msg.getRaw().toString());
|
||||
return super.getNotification(context, msg);
|
||||
}
|
||||
|
||||
//处理透传消息
|
||||
@Override
|
||||
public void dealWithCustomMessage(Context context, UMessage msg) {
|
||||
super.dealWithCustomMessage(context, msg);
|
||||
Log.i("TAGEE", "dealWithCustomMessage:" + msg.getRaw().toString());
|
||||
}
|
||||
};
|
||||
instance.setMessageHandler(msgHandler);
|
||||
//App处于前台时不显示通知
|
||||
//instance.setNotificationOnForeground(false);
|
||||
//设置显示通知的数量
|
||||
|
||||
@ -115,7 +115,7 @@ public class JobSearchBean implements Serializable {
|
||||
private String memo;
|
||||
private String telephone;
|
||||
|
||||
private int publish; // 是否已发布,如果是未发布的数据,则用半透明形式展示
|
||||
private int publish; // 是否已发布,如果是未发布的数据,则用半透明形式展示,0-未发布,1-已发布
|
||||
|
||||
public int getCanReceived() {
|
||||
return canReceived;
|
||||
|
||||
@ -816,7 +816,7 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
||||
@ -917,7 +917,7 @@ public class BuildingInFragment extends BaseDrawerFragment implements View.OnCli
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
||||
@ -1767,7 +1767,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
if (showPoiEntity != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
|
||||
@ -75,6 +75,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
private StringBuilder gatherGetBuilder;
|
||||
private TextView tvStartNav;
|
||||
private TextView tvMatchTrack; // 手动匹配轨迹照片
|
||||
private DateFormat receiverDateFormate; // 接收任务时间的格式化对象
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
@ -89,6 +90,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
receiverDateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time == null) {
|
||||
@ -280,32 +282,39 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
* 根据当前数据状态重新构建领取对话框按钮的显隐
|
||||
* */
|
||||
private void initViewByTaskStatus(int taskStatus) {
|
||||
switch (taskStatus) {
|
||||
case 0://未领取
|
||||
btnCancelGet.setVisibility(View.GONE);//取消领取
|
||||
btnGetTask.setVisibility(View.VISIBLE);//领取任务
|
||||
btnGather.setVisibility(View.VISIBLE);//立即采集
|
||||
btnFinishGather.setVisibility(View.GONE);//结束采集
|
||||
break;
|
||||
case 1://已领取
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
case 2://已保存
|
||||
case 3://已提交
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 4://结束采集
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
if (poiEntity.getPublish() == 1) { // 如果是已发布的数据
|
||||
switch (taskStatus) {
|
||||
case 0://未领取
|
||||
btnCancelGet.setVisibility(View.GONE);//取消领取
|
||||
btnGetTask.setVisibility(View.VISIBLE);//领取任务
|
||||
btnGather.setVisibility(View.VISIBLE);//立即采集
|
||||
btnFinishGather.setVisibility(View.GONE);//结束采集
|
||||
break;
|
||||
case 1://已领取
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
case 2://已保存
|
||||
case 3://已提交
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 4://结束采集
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
} else { // 未发布数据,所有按钮都隐藏
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,7 +400,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
requireActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -466,6 +475,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
chargingStationEntity.setUnReceivedTime(stationBean.getUnReceivedTime());
|
||||
chargingStationEntity.setPrecision(stationBean.getPrice() + "");
|
||||
chargingStationEntity.setAddress(stationBean.getAddress());
|
||||
chargingStationEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (stationBean.getTelephone() == null || stationBean.getTelephone().equals("") || stationBean.getTelephone().equals("null")) {
|
||||
chargingStationEntity.setTelPhone(null);
|
||||
} else {
|
||||
@ -605,6 +615,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
PoiEntity polygonEntity = new PoiEntity();
|
||||
polygonEntity.setRecord_way(poiEntity.getRecord_way());
|
||||
polygonEntity.setWork_type(poiEntity.getWork_type());
|
||||
polygonEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (listBean != null) {
|
||||
polygonEntity.setTaskId(listBean.getId());
|
||||
polygonEntity.setName(listBean.getName());
|
||||
@ -694,7 +705,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
if (poiEntity.getType() == 2) {
|
||||
PoiDatabase.getInstance(getContext()).getChargingPileDao().deleteChargingFidPileEntity(poiEntity.getId());
|
||||
}
|
||||
@ -846,7 +857,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -921,6 +932,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setRecord_way(poiEntity.getRecord_way());
|
||||
poiListEntity.setWork_type(poiEntity.getWork_type());
|
||||
poiEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
if (listBean.getType() == 1) {
|
||||
if (listBean.getTelephone() == null || listBean.getTelephone().equals("") || listBean.getTelephone().equals("null")) {
|
||||
poiListEntity.setTelPhone(null);
|
||||
@ -1052,6 +1064,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||
String encodeStr = listBean.getGeo();
|
||||
String geo = Geohash.getInstance().decode(encodeStr);
|
||||
poiListEntity.setCreateTime(receiverDateFormate.format(new Date()));
|
||||
// 生成对应的x和y poiEntity.setX
|
||||
GeometryTools.obitainPoiEntityXY(geo, poiListEntity);
|
||||
if (statusId == 1 || statusId == 5) {
|
||||
|
||||
@ -474,7 +474,7 @@ public class HasReceiveFragment extends BaseFragment implements View.OnClickList
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.getUnReceivedTimeStamp()<=new Date().getTime()) {
|
||||
// 删除该条数据,并且将此数据移除出当前列表
|
||||
roadDao.deletePoiEntity(poiEntity);
|
||||
roadDao.deletePoiEntityById(poiEntity.getId());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@ -498,7 +498,7 @@ public class HasReceiveFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
// 数据库中移除该数据
|
||||
roadDao.deletePoiEntity(poiEntity);
|
||||
roadDao.deletePoiEntityById(poiEntity.getId());
|
||||
iteratorAgain.remove();
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -901,7 +901,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
|
||||
@ -1268,7 +1268,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
|
||||
@ -819,7 +819,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
||||
@ -927,7 +927,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
||||
@ -816,7 +816,7 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntityById(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
|
||||
@ -44,6 +44,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.github.lazylibrary.util.DensityUtil;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
@ -1951,6 +1952,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiListEntity.setType(listBean.getType());
|
||||
poiListEntity.setRecord_way(listBean.getCanReceived());
|
||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||
poiListEntity.setPublish(listBean.getPublish());
|
||||
String beanGeo = listBean.getGeo();
|
||||
String geo = Geohash.getInstance().decode(beanGeo);
|
||||
// 生成对应的x和y poiEntity.setX
|
||||
@ -2131,7 +2133,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onSuccess(LatestPushMessageResponse response, int id) {
|
||||
tvLatestPush.setVisibility(View.GONE); // 默认先隐藏推荐任务按钮
|
||||
if (response != null) {
|
||||
if (response != null&&response.getBody()!=null) {
|
||||
Map<String, String> responseBody = response.getBody();
|
||||
// 解析response
|
||||
// 获取当前json的id,如果id大于等于0,则根据Content内容尝试展示提示信息
|
||||
@ -2160,6 +2162,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onBind(com.kongzue.dialogx.dialogs.CustomDialog dialog, View v) {
|
||||
ImageView photo = v.findViewById(R.id.img_photo);
|
||||
TextView tvConfirm = v.findViewById(R.id.tv_confirm);
|
||||
// // Glide增加加载中图片显示
|
||||
// RequestOptions options = new RequestOptions()
|
||||
// .placeholder(R.mipmap.ic_launcher);
|
||||
// 显示照片
|
||||
Glide.with(requireContext()).load(imgUrl).into(photo);
|
||||
View.OnClickListener clickListener = new View.OnClickListener() {
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package com.navinfo.outdoor.http;
|
||||
|
||||
public class HttpInterface {
|
||||
// 开发
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发地址
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-数据上传
|
||||
// // 开发
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发地址
|
||||
// public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-数据上传
|
||||
|
||||
// 测试
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口
|
||||
// public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口-数据上传
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试环境接口-数据上传
|
||||
|
||||
// 生产
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//生产地址
|
||||
|
||||
@ -61,8 +61,10 @@ public interface PoiDao {
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Delete
|
||||
void deletePoiEntity(PoiEntity... poiEntities);
|
||||
// @Delete
|
||||
// void deletePoiEntity(PoiEntity... poiEntities);
|
||||
@Query("DELETE FROM poi where id=:id")
|
||||
void deletePoiEntityById(String id);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -61,6 +61,8 @@ public class PoiEntity implements Serializable {
|
||||
private String drawLine; // 用户绘制的线型
|
||||
private String uploadResult; //上传结果
|
||||
private String unReceivedTime; // 任务领取后自动释放的时间
|
||||
@Ignore
|
||||
private int publish = 1; // 是否已发布,0-未发布,1-已发布(默认)
|
||||
|
||||
public int getRecord_way() {
|
||||
return record_way;
|
||||
@ -331,6 +333,14 @@ public class PoiEntity implements Serializable {
|
||||
this.uploadResult = uploadResult;
|
||||
}
|
||||
|
||||
public int getPublish() {
|
||||
return publish;
|
||||
}
|
||||
|
||||
public void setPublish(int publish) {
|
||||
this.publish = publish;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取经过处理后的接受任务失效时间的时间戳
|
||||
* */
|
||||
|
||||
@ -188,7 +188,8 @@ public class TencentMarkerUtils {
|
||||
}
|
||||
// publish字段标识了当前数据是否已发布,如果未发布,则半透明显示,且不可点击,否则正常显示
|
||||
float alpha = listBean.getPublish() == 0? 0.3f: 1.0f;
|
||||
boolean clickable = listBean.getPublish() == 0? false: true;
|
||||
// boolean clickable = listBean.getPublish() == 0? false: true;
|
||||
boolean clickable = true;
|
||||
switch (listBean.getType()) {
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
|
||||
@ -34,10 +34,18 @@
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_road_day"
|
||||
android:id="@+id/tv_poi_createtime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
<TextView
|
||||
android:id="@+id/tv_poi_expirationtime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
|
||||
@ -37,8 +37,8 @@
|
||||
android:id="@+id/tv_road_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="2021-05-08 13:24:36"
|
||||
android:textColor="#333"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_road_name" />
|
||||
</LinearLayout>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user