提交 1b093c22 authored 作者: lgd's avatar lgd

1.添加往来退款功能

上级 c3af98bc
......@@ -2278,6 +2278,22 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.ContactsReturnActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label=" "
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.ContactsReturnDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label=" "
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -2057,4 +2057,14 @@ public interface ApiService {
@PUT("/useApply/ao/usedStore")
Observable<BaseBean> aoUsedStore(@Body RequestBody requestBody);
/**
* step7_1 根据往来单位获取退货申请列表
*
* @return
*/
@GET("/returnApply/pageByTransitPart")
Observable<BaseBean> returnApplyByTransitPart(@QueryMap Map<String,Object> param);
}
......@@ -14,13 +14,12 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.bean.event.CheckMoneytEvent;
import com.wd.workoffice.bean.event.CheckReturnEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.RetrunSendApplyAdapter;
import com.wd.workoffice.ui.adapter.ReturnSendApplyAdapter;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
......@@ -53,7 +52,7 @@ public class ReturnApplyActivity extends WorkToolBarActivity {
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<ReturnApplyBean.RecordsBean> dataList;
private RetrunSendApplyAdapter dataAdapter;
private ReturnSendApplyAdapter dataAdapter;
private int page = 1;
private String orderType;
......@@ -68,7 +67,7 @@ public class ReturnApplyActivity extends WorkToolBarActivity {
protected void initData() {
orderType = getIntent().getStringExtra("orderType");
dataList = new ArrayList<>();
dataAdapter = new RetrunSendApplyAdapter(R.layout.item_return_apply, dataList);
dataAdapter = new ReturnSendApplyAdapter(R.layout.item_return_apply, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
......
package com.wd.workoffice.ui.activity.bat.work;
import android.text.TextUtils;
import android.view.View;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.bean.event.CheckReturnEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.ReturnDetailActivity;
import com.wd.workoffice.ui.adapter.ReturnSendApplyAdapter;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* 退货
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ContactsReturnActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<ReturnApplyBean.RecordsBean> dataList;
private ReturnSendApplyAdapter dataAdapter;
private int page = 1;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new ReturnSendApplyAdapter(R.layout.item_return_apply, dataList, 1);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
page = 1;
param.put("current", page);
param.put("transitPartId", getIntent().getStringExtra("id"));
param.put("status", 1);
getData();
}
private void getData() {
RtfUtils.getRtf().returnApplyByTransitPart(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
List<ReturnApplyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), ReturnApplyBean.class).getRecords();
if (page == 1) {
srlRefresh.finishRefresh();
dataList.clear();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
dataAdapter.loadMoreComplete();
} else {
dataAdapter.loadMoreComplete();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
dataAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
srlRefresh.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
param.put("current", page);
getData();
}
});
dataAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(ContactsReturnDetailActivity.class,
"info", JSON.toJSONString(dataList.get(position))
// "orderType", orderType
, _TITLE, getIntent().getStringExtra(_TITLE)
);
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckReturnEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.bean.event.CheckReturnEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.OutOrderDetailActivity;
import com.wd.workoffice.ui.activity.bat.order.ReturnApplyHistoryActivity;
import com.wd.workoffice.ui.activity.bat.order.SaleOrderDetailActivity;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* 退件详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ContactsReturnDetailActivity extends WorkToolBarActivity {
@BindView(R.id.tv_status)
TextView tvStatus;
@BindView(R.id.ll_top)
RelativeLayout llTop;
@BindView(R.id.tv_refuse)
TextView tvRefuse;
@BindView(R.id.tv_agree)
TextView tvAgree;
@BindView(R.id.ll_check)
LinearLayout llCheck;
@BindView(R.id.ll_bottom)
LinearLayout llBottom;
@BindView(R.id.rv_process)
RecyclerView rvProcess;
@BindView(R.id.rl_history)
RelativeLayout rlHistory;
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.tv_pro_code)
TextView tvProCode;
@BindView(R.id.tv_pro_name)
TextView tvProName;
@BindView(R.id.tv_return_num)
TextView tvReturnNum;
@BindView(R.id.tv_return_type)
TextView tvReturnType;
@BindView(R.id.tv_stock)
TextView tvStock;
@BindView(R.id.tv_person)
TextView tvPerson;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.tv_remark)
TextView tvRemark;
@BindView(R.id.rl_order)
RelativeLayout rlOrder;
@BindView(R.id.tv_top1)
TextView tvTop1;
@BindView(R.id.tv_top2)
TextView tvTop2;
@BindView(R.id.tv_top3)
TextView tvTop3;
@BindView(R.id.tv_top4)
TextView tvTop4;
@BindView(R.id.tv_top5)
TextView tvTop5;
@BindView(R.id.view_node1)
View viewNode1;
@BindView(R.id.view_line1)
View viewLine1;
@BindView(R.id.view_node2)
View viewNode2;
@BindView(R.id.view_line2)
View viewLine2;
@BindView(R.id.view_node3)
View viewNode3;
@BindView(R.id.view_line3)
View viewLine3;
@BindView(R.id.view_node4)
View viewNode4;
@BindView(R.id.view_line4)
View viewLine4;
@BindView(R.id.view_node5)
View viewNode5;
@BindView(R.id.view_line5)
View viewLine5;
@BindView(R.id.tv_dep1)
TextView tvDep1;
@BindView(R.id.tv_dep2)
TextView tvDep2;
@BindView(R.id.tv_dep3)
TextView tvDep3;
@BindView(R.id.tv_dep4)
TextView tvDep4;
@BindView(R.id.tv_dep5)
TextView tvDep5;
@BindView(R.id.ll_process)
LinearLayout llProcess;
private ReturnApplyBean.RecordsBean info;
private String orderType;
@Override
protected void initView() {
ButterKnife.bind(this);
llProcess.setVisibility(View.GONE);
llTop.setVisibility(View.GONE);
llBottom.setVisibility(View.GONE);
}
@Override
protected void initData() {
info = JSON.parseObject(getIntent().getStringExtra("info"), ReturnApplyBean.RecordsBean.class);
orderType = info.getOrderType();
changeView();
}
private void changeView() {
tvName.setText(info.getProductSimpleCode());
tvProName.setText(info.getProductName());
tvProCode.setText(info.getProductSoleCode());
tvReturnNum.setText(String.valueOf(info.getProductAmount()));
tvReturnType.setText(info.getReturnTypeName());
tvStock.setText(info.getBackStockName());
tvPerson.setText(String.valueOf(info.getCreatedByName()));
tvTime.setText(info.getCreatedTime());
tvRemark.setText(String.valueOf(info.getApplyRemark()));
tvStatus.setText(WorkUtils.getReturnStatus(Integer.valueOf(info.getStatus())));
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_bat_retrun_detail;
}
@OnClick({R.id.tv_refuse, R.id.tv_agree, R.id.rl_history, R.id.rl_order})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_refuse:
break;
case R.id.tv_agree:
break;
case R.id.rl_history:
break;
case R.id.rl_order:
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
if (!WorkUtils.hasPermission(PagePermissionType.SALE_ORDER_DETAIL.getPermission())) {
toast(R.string.permission);
return;
}
startActivity(SaleOrderDetailActivity.class,
"identity", "1",
"id", info.getOrderId());
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
if (!WorkUtils.hasPermission(PagePermissionType.PO_PURCHASE_DETAILS.getPermission())) {
toast(R.string.permission);
return;
}
startActivity(OutOrderDetailActivity.class,
"identity", "1",
"id", info.getOrderId());
}
break;
}
}
}
......@@ -110,7 +110,8 @@ public class WorkContactsDetailActivity extends WorkToolBarActivity {
toast("功能正在开发中哦!");
break;
case R.id.ll_return:
toast("功能正在开发中哦!");
startActivity(ContactsReturnActivity.class,"id", getIntent().getStringExtra("id"),
_TITLE,getIntent().getStringExtra("title"));
break;
}
}
......
......@@ -17,14 +17,14 @@ import androidx.annotation.Nullable;
* Created by flexible on 2018/8/13.
*/
public class RetrunSendApplyAdapter extends BaseQuickAdapter<ReturnApplyBean.RecordsBean, BaseViewHolder> {
int status;
public class ReturnSendApplyAdapter extends BaseQuickAdapter<ReturnApplyBean.RecordsBean, BaseViewHolder> {
int status;// 1 往来 2,订单详情退货
public RetrunSendApplyAdapter(int layoutResId, List data) {
public ReturnSendApplyAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public RetrunSendApplyAdapter(int layoutResId, @Nullable List<ReturnApplyBean.RecordsBean> data, int status) {
public ReturnSendApplyAdapter(int layoutResId, @Nullable List<ReturnApplyBean.RecordsBean> data, int status) {
super(layoutResId, data);
this.status = status;
}
......@@ -33,8 +33,9 @@ public class RetrunSendApplyAdapter extends BaseQuickAdapter<ReturnApplyBean.Rec
protected void convert(BaseViewHolder helper, ReturnApplyBean.RecordsBean item) {
helper.setText(R.id.tv_name, String.format("%s发起的申请", item.getCreatedByName()));
helper.setText(R.id.tv_code, String.format("申请编号:%s", item.getSerialNumber()));
helper.setText(R.id.tv_num, MathUtils.converData(item.getProductAmount(),3));
helper.setText(R.id.tv_num, MathUtils.converData(item.getProductAmount(), 3));
helper.setText(R.id.tv_time, item.getCreatedTime());
if (status != 1)
helper.setText(R.id.tv_status, WorkUtils.getReturnStatus(Integer.valueOf(item.getStatus())));
helper.setText(R.id.tv_type, item.getReturnTypeName());
// if (status == 0) {
......
......@@ -103,12 +103,17 @@
android:paddingVertical="10mm"
android:visibility="gone" />
<include
<LinearLayout
android:id="@+id/ll_process"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/view_return_process"
android:layout_marginVertical="10mm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
android:layout_marginVertical="10mm" />
<View style="@style/ViewX" />
......@@ -131,13 +136,14 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/arrow_right_blue"
android:textColor="@color/flexible_text_gray" />
</RelativeLayout>
<View style="@style/ViewX" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
......@@ -157,11 +163,10 @@
android:textSize="15sp" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论