Commit 49a27007 by 罗翻

增加多任务

parent 0c50c0f8
......@@ -12,16 +12,16 @@ public class Constants {
/**
* 测试环境配置.
*/
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static final String ENVIROMENT = "debug";
// public static final String BASE_URL = "http://47.94.101.239:3112";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
// public final static String CHECK_MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manySop";
// public final static String WEB_SOP_DETAIL = "http://47.94.101.239:9004/#/sopdetail";
// public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public static final boolean IS_DEBUG = true;
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String ENVIROMENT = "debug";
public static final String BASE_URL = "http://47.94.101.239:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
public final static String CHECK_MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manyServiceResult";
public final static String MULTI_WEB_SOP = "http://47.94.101.239:9004/#/manySop";
public final static String WEB_SOP_DETAIL = "http://47.94.101.239:9004/#/sopdetail";
public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
public static final boolean IS_DEBUG = true;
/**
* uat环境配置.
......@@ -33,21 +33,23 @@ public class Constants {
// public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
// public final static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail";
// public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop";
// public static final boolean IS_DEBUG = true;
/**
* 正式环境.
*/
public static final String ENVIROMENT = "release";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "https://mobile.kf.ai";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
public final static String CHECK_MULTI_WEB_SOP = "http://192.168.2.181:8080/#/manyServiceResult";
public final static String MULTI_WEB_SOP = "http://192.168.2.181:8080/#/manySop";
public static final boolean IS_DEBUG = false;
// public static final String ENVIROMENT = "release";
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static final String BASE_URL = "https://mobile.kf.ai";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
// public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
// public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
// public static final boolean IS_DEBUG = false;
/**
* 演示环境
......@@ -59,6 +61,8 @@ public class Constants {
// public final static String WEB_SOP = "http://test.sop.dayu.ai/#/sop";
// public final static String WEB_SOP_DETAIL = "http://test.sop.dayu.ai/#/sopdetail";
// public final static String WEB_ZHI_SHI = "http://test.sop.dayu.ai/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "http://test.sop.dayu.ai/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "http://test.sop.dayu.ai/#/manySop";
// public final static boolean IS_DEBUG = true;
/**
......
......@@ -14,9 +14,12 @@ public interface MultipleProcessContract {
interface View extends BaseView {
HashMap<String, Object> getParams();
void setRepairType();
}
abstract class Presenter extends BaseListPresenter<View> {
public abstract void processOrder();
public abstract void getOrderInfo(int orderId);
}
}
......@@ -3,12 +3,14 @@ package com.dayu.order.presenter.multipleprocess;
import android.databinding.ObservableField;
import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.api.protocol.Spu;
import com.dayu.order.common.OrderConstant;
import com.dayu.provider.event.RefreshServe;
import com.dayu.provider.router.RouterPath;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils;
import com.dayu.utils.UserManager;
import org.greenrobot.eventbus.EventBus;
......@@ -29,12 +31,14 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
public ObservableField<Object> mFootDatas = new ObservableField<>();
private ArrayList<Spu> mSpus;
private int mAccountId;
private String mRepairType;
@Override
public void onAttached() {
mAccountId = Integer.parseInt(UserManager.getInstance().getUser().getAccountId());
mSpus = mView.getBundle().getParcelableArrayList(OrderConstant.SPUS);
mDatas.set(mSpus);
getOrderInfo(mSpus.get(0).getOrderId());
}
@Override
......@@ -61,4 +65,21 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
EventBus.getDefault().post(new RefreshServe(1));
}));
}
@Override
public void getOrderInfo(int orderId) {
mView.showDialog();
OrderApiFactory.queryOrderInfo(orderId).subscribe(baseObserver(detail -> {
if (1 == (detail.getRepairType())) {
mRepairType = UIUtils.getString(R.string.payer_baonei);
} else if (2 == (detail.getRepairType())) {
mRepairType = UIUtils.getString(R.string.payer_baowai);
}
mView.setRepairType();
}));
}
public String getRepairType() {
return mRepairType;
}
}
......@@ -3,6 +3,7 @@ package com.dayu.order.ui.activity;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.order.R;
......@@ -24,7 +25,8 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
private EditText mMaterialsPrice;
private EditText mOtherPrice;
private EditText mDoorInfo;
private int isPay;
private int isPay = 1;
private TextView mRepairType;
@Override
public void setPresenter() {
......@@ -56,6 +58,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
mMaterialsPrice = view.findViewById(R.id.et_materials_price);
mOtherPrice = view.findViewById(R.id.et_other_price);
mDoorInfo = view.findViewById(R.id.et_door_info);
mRepairType = view.findViewById(R.id.repair_type);
swtich.setOnClickListener(v -> {
if (swtich.getSwitchButton()) {
swtich.setSwitchButton(false);
......@@ -69,6 +72,14 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
isPay = 2;
}
});
setRepairType();
}
@Override
public void setRepairType() {
if (mRepairType != null) {
mRepairType.setText(mPresenter.getRepairType());
}
}
public void clearData() {
......@@ -82,11 +93,13 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
@Override
public HashMap<String, Object> getParams() {
HashMap<String, Object> params = new HashMap<>();
if (mDoorPrice != null) {
params.put("doorPrice", mDoorPrice.getText().toString().trim());
params.put("servicePrice", mServerPrice.getText().toString().trim());
params.put("materialCost", mMaterialsPrice.getText().toString().trim());
params.put("otherPrice", mOtherPrice.getText().toString().trim());
params.put("doorPriceComment", mDoorInfo.getText().toString().trim());
}
params.put("isPay", isPay);
return params;
}
......
......@@ -53,10 +53,12 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverTime.setText(item.getCreateTime());
holder.serverState.setText("【" + item.getOperation() + "】");
holder.serverCheck.setVisibility(View.VISIBLE);
holder.serverTimeComment.setVisibility(View.GONE);
holder.serverComment.setText(item.getOperationComment());
if ((item.getCommentInfo() != null && item.getCommentInfo().contains(UIUtils.getString(R.string.appointment_time)))) {
holder.serverTimeComment.setText(item.getCommentInfo());
holder.serverCheck.setVisibility(View.GONE);
holder.serverTimeComment.setVisibility(View.VISIBLE);
} else if (UIUtils.getString(R.string.order_remark).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText(UIUtils.getString(R.string.no_remark));
......@@ -64,8 +66,10 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverTimeComment.setText(UIUtils.getString(R.string.remark_order) + item.getCommentInfo());
}
holder.serverCheck.setText(UIUtils.getString(R.string.check_initial_state));
holder.serverTimeComment.setVisibility(View.VISIBLE);
} else if (UIUtils.getString(R.string.system_chcek).equals(item.getOperation())) {
holder.serverCheck.setText(UIUtils.getString(R.string.check_accept));
holder.serverTimeComment.setVisibility(View.GONE);
} else if (UIUtils.getString(R.string.reassignment_reason).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText(UIUtils.getString(R.string.no_reassignment));
......@@ -73,6 +77,7 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverTimeComment.setText(UIUtils.getString(R.string.reassignment_reason) + ":" + item.getCommentInfo());
}
holder.serverCheck.setVisibility(View.GONE);
holder.serverTimeComment.setVisibility(View.VISIBLE);
} else if (UIUtils.getString(R.string.cancle_reason).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText(UIUtils.getString(R.string.no_cancle));
......@@ -80,6 +85,10 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverTimeComment.setText(UIUtils.getString(R.string.cancle_reason) + ":" + item.getCommentInfo());
}
holder.serverCheck.setVisibility(View.GONE);
holder.serverTimeComment.setVisibility(View.VISIBLE);
} else if (UIUtils.getString(R.string.part_record).equals(item.getOperation())) {
holder.serverCheck.setVisibility(View.GONE);
holder.serverTimeComment.setVisibility(View.GONE);
} else {
holder.serverTimeComment.setVisibility(View.GONE);
if (TextUtils.isEmpty(item.getCommentName())) {
......@@ -111,8 +120,5 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop(0));
}
}
if (UIUtils.getString(R.string.part_record).equals(item.getOperation())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpLogistics(item.getCommentName(), item.getCommentInfo()));
}
}
}
......@@ -56,7 +56,7 @@
android:layout_height="49dp"
android:layout_alignParentBottom="true"
android:background='@{presenter.mCanProcess?@color/bg_button:@color/cl_selector_hui}'
android:clickable='@{presenter.mCanProcess?true:true}'
android:clickable='@{presenter.mCanProcess?true:false}'
android:onClick="@{()->presenter.dumpToProcess()}"
android:gravity="center"
android:text="提交验收"
......
......@@ -37,7 +37,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tv_repair_type"
android:id="@+id/repair_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment