Commit 17e6dcfb by mReturn

备件收货相关功能开发

parent de5cc93a
......@@ -231,8 +231,8 @@ public class CommonUtils {
sb.append(list.get(i));
}
}
resultString = sb.toString();
}
resultString = sb.toString();
return resultString;
}
......
......@@ -33,6 +33,7 @@ import com.dayu.order.api.protocol.bean.ServiceStationBean;
import com.dayu.order.api.protocol.bean.SopListBean;
import com.dayu.order.api.protocol.companyManager;
import com.dayu.order.api.protocol.data.AddDialRecordData;
import com.dayu.order.api.protocol.data.PartReceiveData;
import com.dayu.order.api.protocol.data.PartSendData;
import com.dayu.order.api.protocol.data.ReceivePartData;
import com.dayu.order.api.protocol.data.SendPartData;
......@@ -522,8 +523,13 @@ public interface OrderService {
/**
* 备件收货
*/
@POST(Constants.API_7700 + "/spSendOutGoods/confirmReceive")
Observable<BaseResponse<Boolean>> receivePart(@Body PartReceiveData data);
/**
* 备件收货(旧版)
*/
@PUT(Constants.API_7200 + "/ordersLogistics")
Observable<BaseResponse<Boolean>> receivePart(@Body ReceivePartData data);
Observable<BaseResponse<Boolean>> receivePartOld(@Body ReceivePartData data);
/**
* 备件物流详情
......
package com.dayu.order.api.protocol.data;
public class PartReceiveData {
public int id; //备件物流ID ,
public String comment ; //备注
public String receiverPicUrl ; //备注
public String updated ; //备注
public PartReceiveData() {
}
public PartReceiveData(int id, String comment, String receiverPicUrl, String updated) {
this.id = id;
this.comment = comment;
this.receiverPicUrl = receiverPicUrl;
this.updated = updated;
}
}
......@@ -85,6 +85,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
@Override
public void applyOrReturnPart() {
toDetail(true,null);
// if (mType == 1) {
// Bundle bundle = new Bundle();
// bundle.putInt(Constants.ORDER_ID, mOrderId);
......@@ -99,9 +100,13 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
public void toDetail(boolean canEdit, OrderPartListBean partListBean) {
Bundle bundle = new Bundle();
bundle.putBoolean(Constants.CAN_EDIT,canEdit);
bundle.putInt(Constants.ID, partListBean.getId());
bundle.putSerializable(Constants.ORDER_DETAIL, mDetail);
bundle.putSerializable(Constants.PART_DETAIL, partListBean);
if (partListBean == null){
bundle.putInt(Constants.ID, -1);
}else {
bundle.putInt(Constants.ID, partListBean.getId());
bundle.putSerializable(Constants.PART_DETAIL, partListBean);
}
if (mType == 1) {
mView.startActivity(OrderPartReceiveActivity.class, bundle);
} else if (mType == 2) {
......
......@@ -12,6 +12,7 @@ import com.dayu.order.api.OrderService;
import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.api.protocol.bean.OrderPardDeatilBean;
import com.dayu.order.api.protocol.bean.OrderPartListBean;
import com.dayu.order.api.protocol.data.PartReceiveData;
import com.dayu.order.api.protocol.data.ReceivePartData;
import com.dayu.order.common.PartReceiverEvent;
import com.dayu.utils.CommonUtils;
......@@ -90,10 +91,25 @@ public class PartRecievePresenter extends PartReceiveContract.Presenter {
}
}
//收货
private void receivePart(List<String> imgs) {
mView.showDialog();
String picUrl = CommonUtils.list2String(imgs);
PartReceiveData receiveData = new PartReceiveData(partId,remark.get(),picUrl,mUser.getAccountName());
Api.getService(OrderService.class).receivePart(receiveData).compose(Api.applySchedulers())
.subscribe(baseObserver(success -> {
if (success) {
ToastUtils.showShortToast("收货成功");
EventBus.getDefault().post(new PartReceiverEvent());
mView.dumpBack();
} else {
ToastUtils.showShortToast("收货失败");
}
}));
}
//收货
private void receivePartOld(List<String> imgs) {
mView.showDialog();
List<ReceivePartData.PicItem> pics = null;
if (imgs != null && imgs.size() > 0) {
pics = new ArrayList<>();
......@@ -104,7 +120,7 @@ public class PartRecievePresenter extends PartReceiveContract.Presenter {
}
}
ReceivePartData receivedData = new ReceivePartData(partId, remark.get(), pics);
Api.getService(OrderService.class).receivePart(receivedData).compose(Api.applySchedulers())
Api.getService(OrderService.class).receivePartOld(receivedData).compose(Api.applySchedulers())
.subscribe(baseObserver(success -> {
if (success) {
ToastUtils.showShortToast("收货成功");
......
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