Commit 0960bece by 罗翻

处理工单修改

parent 54740205
...@@ -314,6 +314,19 @@ ...@@ -314,6 +314,19 @@
<string name="payer_dialog_title">未选择费用承担方</string> <string name="payer_dialog_title">未选择费用承担方</string>
<string name="payer_select_title">确认操作</string> <string name="payer_select_title">确认操作</string>
<string name="payer_select_content">您修改了费用承担方,可能会导致费用争议。修改后不能调整,确认此操作吗?</string> <string name="payer_select_content">您修改了费用承担方,可能会导致费用争议。修改后不能调整,确认此操作吗?</string>
<string name="failed_get_address">获取地址失败</string>
<string name="check_initial_state">查看初始状态</string>
<string name="reassignment_reason">改派原因</string>
<string name="cancle_reason">取消原因</string>
<string name="check_reason">查看结果</string>
<string name="check_accept">查看验收申请</string>
<string name="check_location">查看位置</string>
<string name="no_remark">备注:暂无</string>
<string name="remark_order">备注:</string>
<string name="no_reassignment">改派原因:暂无</string>
<string name="no_cancle">取消原因:暂无</string>
<string name="check_content">验收内容</string>
<string name="system_chcek">系统验收</string>
<!--消息--> <!--消息-->
......
...@@ -16,7 +16,7 @@ public interface OrderServerContract { ...@@ -16,7 +16,7 @@ public interface OrderServerContract {
abstract class Presenter extends BaseListPresenter<View> { abstract class Presenter extends BaseListPresenter<View> {
public abstract void dumpToSop(); public abstract void dumpToSop();
public abstract void dumpCheckContent(int postion,int state); public abstract void dumpCheckContent(int postion);
public abstract void dumpMap(double latitude,double longitude,String address); public abstract void dumpMap(double latitude,double longitude,String address);
......
...@@ -5,10 +5,12 @@ import android.os.Bundle; ...@@ -5,10 +5,12 @@ import android.os.Bundle;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.location.base.BaseMapActivity; import com.dayu.location.base.BaseMapActivity;
import com.dayu.order.R;
import com.dayu.order.api.protocol.OrderDetail; import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.ui.activity.CheckContentActivity; import com.dayu.order.ui.activity.CheckContentActivity;
import com.dayu.order.ui.activity.SopWebViewActivity; import com.dayu.order.ui.activity.SopWebViewActivity;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -58,11 +60,10 @@ public class OrderServerPresenter extends OrderServerContract.Presenter { ...@@ -58,11 +60,10 @@ public class OrderServerPresenter extends OrderServerContract.Presenter {
} }
@Override @Override
public void dumpCheckContent(int postion, int state) { public void dumpCheckContent(int postion) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable(Constants.ORDER_DETAIL, mDetails); bundle.putSerializable(Constants.ORDER_DETAIL, mDetails);
bundle.putInt(Constants.ORDER_POSTION, postion); bundle.putInt(Constants.ORDER_POSTION, postion);
bundle.putInt(ORDER_STATE, state);
mView.startActivity(CheckContentActivity.class, bundle); mView.startActivity(CheckContentActivity.class, bundle);
} }
...@@ -73,7 +74,7 @@ public class OrderServerPresenter extends OrderServerContract.Presenter { ...@@ -73,7 +74,7 @@ public class OrderServerPresenter extends OrderServerContract.Presenter {
bundle.putDouble(Constants.LATITUDE, latitude); bundle.putDouble(Constants.LATITUDE, latitude);
bundle.putString("address", address); bundle.putString("address", address);
if (longitude == 0 && latitude == 0) { if (longitude == 0 && latitude == 0) {
ToastUtils.showShortToast("获取位置失败!"); ToastUtils.showShortToast(UIUtils.getString(R.string.failed_get_address));
return; return;
} }
mView.startActivity(BaseMapActivity.class, bundle); mView.startActivity(BaseMapActivity.class, bundle);
......
...@@ -39,24 +39,22 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte ...@@ -39,24 +39,22 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
@Override @Override
public void initView() { public void initView() {
mBind.title.setText("验收内容"); mBind.title.setText(UIUtils.getString(R.string.check_content));
mBind.tvBack.setOnClickListener(v -> finish()); mBind.tvBack.setOnClickListener(v -> finish());
payerUrl = new ArrayList<>(); payerUrl = new ArrayList<>();
serverUrl = new ArrayList<>(); serverUrl = new ArrayList<>();
mdimension = (UtilsScreen.getScreenWidth(mActivity) - UtilsScreen.dip2px(mActivity, 20)) / 5; mdimension = (UtilsScreen.getScreenWidth(mActivity) - UtilsScreen.dip2px(mActivity, 20)) / 5;
Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE); Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
int state = bundle.getInt(Constants.ORDER_STATE, 0);
OrderDetail detail = (OrderDetail) bundle.getSerializable(Constants.ORDER_DETAIL); OrderDetail detail = (OrderDetail) bundle.getSerializable(Constants.ORDER_DETAIL);
int position = bundle.getInt(Constants.ORDER_POSTION); int position = bundle.getInt(Constants.ORDER_POSTION);
String obj = detail.getRecord().get(position).getOrderObj(); String obj = detail.getRecord().get(position).getOrderObj();
if (obj == null) { if (obj == null) {
ToastUtils.showShortToast("没有数据"); ToastUtils.showShortToast(UIUtils.getString(R.string.no_data));
return; return;
} }
Gson gson = new Gson(); Gson gson = new Gson();
CheckContentOrder info = gson.fromJson(obj, CheckContentOrder.class); CheckContentOrder info = gson.fromJson(obj, CheckContentOrder.class);
List<CheckContentOrder.Pics> pics = info.getListOperatorPics(); List<CheckContentOrder.Pics> pics = info.getListOperatorPics();
if (state == Constants.FINISH_ORDER) {
if (pics != null && pics.size() > 0) { if (pics != null && pics.size() > 0) {
for (CheckContentOrder.Pics pic : pics) { for (CheckContentOrder.Pics pic : pics) {
if (pic.getPictureType() == 1) { if (pic.getPictureType() == 1) {
...@@ -66,7 +64,6 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte ...@@ -66,7 +64,6 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
} }
} }
} }
}
if (!TextUtils.isEmpty(info.getCategoryName())) { if (!TextUtils.isEmpty(info.getCategoryName())) {
mBind.tvProduct.setText(info.getCategoryName()); mBind.tvProduct.setText(info.getCategoryName());
} else { } else {
......
...@@ -5,7 +5,6 @@ import android.view.Gravity; ...@@ -5,7 +5,6 @@ import android.view.Gravity;
import android.view.View; import android.view.View;
import com.dayu.base.ui.adapter.CoreAdapter; import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.protocol.OrderDetail; import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.databinding.ServeDatailsItemBinding; import com.dayu.order.databinding.ServeDatailsItemBinding;
...@@ -49,28 +48,30 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv ...@@ -49,28 +48,30 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverState.setText("【" + item.getOperation() + "】"); holder.serverState.setText("【" + item.getOperation() + "】");
holder.serverCheck.setVisibility(View.VISIBLE); holder.serverCheck.setVisibility(View.VISIBLE);
holder.serverComment.setText(item.getOperationComment()); holder.serverComment.setText(item.getOperationComment());
if ((item.getCommentInfo() != null && item.getCommentInfo().contains("预约时间"))) { if ((item.getCommentInfo() != null && item.getCommentInfo().contains(UIUtils.getString(R.string.appointment_time)))) {
holder.serverTimeComment.setText(item.getCommentInfo()); holder.serverTimeComment.setText(item.getCommentInfo());
holder.serverCheck.setVisibility(View.GONE); holder.serverCheck.setVisibility(View.GONE);
} else if ("工单备注".equals(item.getCommentName())) { } else if (UIUtils.getString(R.string.order_remark).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) { if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("备注:暂无"); holder.serverTimeComment.setText(UIUtils.getString(R.string.no_remark));
} else { } else {
holder.serverTimeComment.setText("备注:" + item.getCommentInfo()); holder.serverTimeComment.setText(UIUtils.getString(R.string.remark_order) + item.getCommentInfo());
} }
holder.serverCheck.setText("查看初始状态"); holder.serverCheck.setText(UIUtils.getString(R.string.check_initial_state));
} else if ("改派原因".equals(item.getCommentName())) { } else if (UIUtils.getString(R.string.system_chcek).equals(item.getOperation())) {
holder.serverCheck.setText(UIUtils.getString(R.string.check_accept));
} else if (UIUtils.getString(R.string.reassignment_reason).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) { if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("改派原因:暂无"); holder.serverTimeComment.setText(UIUtils.getString(R.string.no_reassignment));
} else { } else {
holder.serverTimeComment.setText("改派原因:" + item.getCommentInfo()); holder.serverTimeComment.setText(UIUtils.getString(R.string.reassignment_reason) + ":" + item.getCommentInfo());
} }
holder.serverCheck.setVisibility(View.GONE); holder.serverCheck.setVisibility(View.GONE);
} else if ("取消原因".equals(item.getCommentName())) { } else if (UIUtils.getString(R.string.cancle_reason).equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) { if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("取消原因:暂无"); holder.serverTimeComment.setText(UIUtils.getString(R.string.no_cancle));
} else { } else {
holder.serverTimeComment.setText("取消原因:" + item.getCommentInfo()); holder.serverTimeComment.setText(UIUtils.getString(R.string.cancle_reason) + ":" + item.getCommentInfo());
} }
holder.serverCheck.setVisibility(View.GONE); holder.serverCheck.setVisibility(View.GONE);
} else { } else {
...@@ -81,19 +82,19 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv ...@@ -81,19 +82,19 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder.serverCheck.setText(item.getCommentName()); holder.serverCheck.setText(item.getCommentName());
} }
} }
if ("查看结果".equals(item.getCommentName())) { if (UIUtils.getString(R.string.check_reason).equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop()); holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop());
} }
if ("查看验收申请".equals(item.getCommentName())) { if (UIUtils.getString(R.string.check_accept).equals(item.getCommentName()) || UIUtils.getString(R.string.system_chcek).equals(item.getOperation())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpCheckContent(position, Constants.FINISH_ORDER)); holder.serverCheck.setOnClickListener(v -> presenter.dumpCheckContent(position));
} }
if ("工单备注".equals(item.getCommentName())) { if (UIUtils.getString(R.string.order_remark).equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpCheckContent(position, Constants.WATING_ORDER)); holder.serverCheck.setOnClickListener(v -> presenter.dumpCheckContent(position));
} }
if ("查看位置".equals(item.getCommentName())) { if (UIUtils.getString(R.string.check_location).equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpMap(item.getLatitude(), item.getLongitude(), item.getAddress())); holder.serverCheck.setOnClickListener(v -> presenter.dumpMap(item.getLatitude(), item.getLongitude(), item.getAddress()));
} }
if ("查看结果".equals(item.getCommentName())) { if (UIUtils.getString(R.string.check_reason).equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop()); holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop());
} }
} }
......
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