执行中运单完成状态优化,运单详情偶发不刷新,登录数据类型控制

This commit is contained in:
lijia 2024-10-22 17:15:34 +08:00
parent a2be579ae9
commit db9990eec0
4 changed files with 48 additions and 15 deletions

View File

@ -79,6 +79,13 @@ public class HuoYuanRequset{
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
RequestUtil.start(1, HuoYuanFragmengt.START_ORDER,re,con,hd);
}
public void startOrder2(int id){
Map<String,Object> map=new HashMap<>();
map.put("waybillId",id);
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
RequestUtil.start(1, "refreshorderDetail",re,con,hd);
}
//装货
public void loading(LUInputBean lub){
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getLOADING(), gson.toJson(lub)),getToken(con),con);

View File

@ -23,6 +23,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.FragmentActivity;
import com.alct.mdp.MDPLocationCollectionManager;
import com.alct.mdp.callback.OnDownloadResultListener;
@ -198,8 +199,20 @@ public class HomeFragment extends BaseFragment {
initStart();
StartOrderParts.setStartOrder(con, sob);
if (sob.getData() != null && !sob.getData().getWaybillStatus().equals("已取消")) {
dealCurWay(sob.getData());
ur.getJtts(sob.getData().getShippingNoteNumber());
StartOrderBean.DataDTO.WayChildrenDTO xData = null;
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
if (2 == sob.getData().getWayChildren().get(i).getType()) {
xData = sob.getData().getWayChildren().get(i);
break;
}
}
if (xData != null && xData.getStatus() == 3) {
SPUtils.remove(con, "curWaybillId");
llCurWay.setVisibility(View.GONE);
} else {
dealCurWay(sob.getData());
ur.getJtts(sob.getData().getShippingNoteNumber());
}
} else {
SPUtils.remove(con, "curWaybillId");
llCurWay.setVisibility(View.GONE);
@ -280,9 +293,9 @@ public class HomeFragment extends BaseFragment {
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl()) ||
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl()) ||
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
if (xToast==null){
if (xToast == null) {
xToast = new XToast(act);
}else if (xToast!=null&&xToast.isShow()){
} else if (xToast != null && xToast.isShow()) {
xToast.cancel();
}
xToast.setContentView(R.layout.view_bc)
@ -716,7 +729,7 @@ public class HomeFragment extends BaseFragment {
qr.getBankCardList();
}
ur.getDriverExpire();
hyr.startOrder(curWaybillId==-1 ? 0 : curWaybillId);
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
// hyr.startOrder(0);
ur.driverAuthData();
}
@ -776,8 +789,13 @@ public class HomeFragment extends BaseFragment {
Log.e("开始轨迹上传服务", "-----");
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
order_state.setText("" + sob.getData().getWaybillStatus());
Intent serviceIn = new Intent(con, TrackService.class);
getActivity().startService(serviceIn);
try {
Intent serviceIn = new Intent(con, TrackService.class);
getActivity().startActivity(serviceIn);
} catch (Exception e) {
e.printStackTrace();
}
} else {
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
order_start.setVisibility(View.GONE);

View File

@ -107,10 +107,10 @@ public class StartYunDanActivity extends BaseActivity {
switch (m.what) {
case RequsetCodeConstants.SUCCESS:
//获取页面数据
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
if (CacheGroup.cacheList.get("refreshorderDetail") != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
Log.e("-运单-", CacheGroup.cacheList.get("refreshorderDetail"));
sob = gson.fromJson(CacheGroup.cacheList.get("refreshorderDetail"), StartOrderBean.class);
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
customDialog.dismiss();
@ -126,7 +126,7 @@ public class StartYunDanActivity extends BaseActivity {
} else {
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
}
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
CacheGroup.cacheList.remove("refreshorderDetail");
CacheGroup.cacheList.remove(GET_EVALUTE);
}
//保存评价
@ -484,9 +484,15 @@ public class StartYunDanActivity extends BaseActivity {
if (map != null) {
map.onResume();
}
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
hyr.startOrder(id);
if (customDialog==null){
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
}else{
if (!customDialog.isShowing()){
customDialog.show();
}
}
hyr.startOrder2(id);
hyr.getEvaluate(id);
}
@ -598,7 +604,7 @@ public class StartYunDanActivity extends BaseActivity {
public void search() {
String latitude = sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude();
if (TextUtils.isEmpty(latitude)){
if (TextUtils.isEmpty(latitude)) {
return;
}
// try {

View File

@ -47,6 +47,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入手机号码"
android:inputType="phone"
android:textColor="#ff000000"
android:textSize="@dimen/sp_14"
android:maxLength="11"
@ -65,6 +66,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:inputType="number"
android:id="@+id/input_code"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12"