提交 d6032a03 authored 作者: lgd's avatar lgd

1.往来款项

2.//TODO erp用户激活测试,忘记/重置密码测试,往来物流和应付测试,物流新增,产品下单还差附件,mes,消息,刷新token
上级 748feb58
...@@ -736,6 +736,31 @@ ...@@ -736,6 +736,31 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Work.Base" android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkContactsMoneyActivity"
android:configChanges="keyboardHidden|orientation"
android:label="应收账款"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkContactsMoneyFlowActivity"
android:configChanges="keyboardHidden|orientation"
android:label="流水"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkContactsMoneyFlowDetailActivity"
android:configChanges="keyboardHidden|orientation"
android:label="流水详情"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider" android:authorities="com.wd.workoffice.fileprovider"
......
package com.wd.workoffice.bean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ContactsMoneyBean {
/**
* records : [{"createdBy":680,"createdByName":null,"createdTime":"2020-04-06 17:41:01","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":31,"financeDeptArApPartId":20,"transitPartType":"CUSTOMER","processCode":"PROCESS_SALE","expectAmount":20,"applyAmount":0,"finishAmount":0,"version":1,"createdUser":"吴同得","admin":null,"adminId":null,"deptId":null,"transitPartId":null,"type":null,"deptIdList":null,"processCodeName":"销售流程"}]
* total : 1
* size : 10
* current : 1
* orders : []
* searchCount : true
* pages : 1
*/
private int total;
private int size;
private int current;
private boolean searchCount;
private int pages;
private List<RecordsBean> records;
private List<?> orders;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
public boolean isSearchCount() {
return searchCount;
}
public void setSearchCount(boolean searchCount) {
this.searchCount = searchCount;
}
public int getPages() {
return pages;
}
public void setPages(int pages) {
this.pages = pages;
}
public List<RecordsBean> getRecords() {
return records;
}
public void setRecords(List<RecordsBean> records) {
this.records = records;
}
public List<?> getOrders() {
return orders;
}
public void setOrders(List<?> orders) {
this.orders = orders;
}
public static class RecordsBean {
/**
* createdBy : 680
* createdByName : null
* createdTime : 2020-04-06 17:41:01
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 31
* financeDeptArApPartId : 20
* transitPartType : CUSTOMER
* processCode : PROCESS_SALE
* expectAmount : 20.0
* applyAmount : 0.0
* finishAmount : 0.0
* version : 1
* createdUser : 吴同得
* admin : null
* adminId : null
* deptId : null
* transitPartId : null
* type : null
* deptIdList : null
* processCodeName : 销售流程
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private int financeDeptArApPartId;
private String transitPartType;
private String processCode;
private double expectAmount;
private double applyAmount;
private double finishAmount;
private int version;
private String createdUser;
private Object admin;
private Object adminId;
private Object deptId;
private Object transitPartId;
private Object type;
private Object deptIdList;
private String processCodeName;
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public Object getCreatedByName() {
return createdByName;
}
public void setCreatedByName(Object createdByName) {
this.createdByName = createdByName;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public Object getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Object updatedBy) {
this.updatedBy = updatedBy;
}
public Object getUpdatedByName() {
return updatedByName;
}
public void setUpdatedByName(Object updatedByName) {
this.updatedByName = updatedByName;
}
public Object getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Object updatedTime) {
this.updatedTime = updatedTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getFinanceDeptArApPartId() {
return financeDeptArApPartId;
}
public void setFinanceDeptArApPartId(int financeDeptArApPartId) {
this.financeDeptArApPartId = financeDeptArApPartId;
}
public String getTransitPartType() {
return transitPartType;
}
public void setTransitPartType(String transitPartType) {
this.transitPartType = transitPartType;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public double getExpectAmount() {
return expectAmount;
}
public void setExpectAmount(double expectAmount) {
this.expectAmount = expectAmount;
}
public double getApplyAmount() {
return applyAmount;
}
public void setApplyAmount(double applyAmount) {
this.applyAmount = applyAmount;
}
public double getFinishAmount() {
return finishAmount;
}
public void setFinishAmount(double finishAmount) {
this.finishAmount = finishAmount;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public Object getAdmin() {
return admin;
}
public void setAdmin(Object admin) {
this.admin = admin;
}
public Object getAdminId() {
return adminId;
}
public void setAdminId(Object adminId) {
this.adminId = adminId;
}
public Object getDeptId() {
return deptId;
}
public void setDeptId(Object deptId) {
this.deptId = deptId;
}
public Object getTransitPartId() {
return transitPartId;
}
public void setTransitPartId(Object transitPartId) {
this.transitPartId = transitPartId;
}
public Object getType() {
return type;
}
public void setType(Object type) {
this.type = type;
}
public Object getDeptIdList() {
return deptIdList;
}
public void setDeptIdList(Object deptIdList) {
this.deptIdList = deptIdList;
}
public String getProcessCodeName() {
return processCodeName;
}
public void setProcessCodeName(String processCodeName) {
this.processCodeName = processCodeName;
}
}
}
...@@ -149,6 +149,51 @@ public class FlowBean { ...@@ -149,6 +149,51 @@ public class FlowBean {
private String receiveDeptName; private String receiveDeptName;
private String launchDeptName; private String launchDeptName;
private String createdName; private String createdName;
private String linkSerialNumber;
private String invoiceTypeName;
private String createdUser;
private String targetName;
private String sourceName;
public String getTargetName() {
return targetName;
}
public void setTargetName(String targetName) {
this.targetName = targetName;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public String getLinkSerialNumber() {
return linkSerialNumber;
}
public void setLinkSerialNumber(String linkSerialNumber) {
this.linkSerialNumber = linkSerialNumber;
}
public String getInvoiceTypeName() {
return invoiceTypeName;
}
public void setInvoiceTypeName(String invoiceTypeName) {
this.invoiceTypeName = invoiceTypeName;
}
public int getCreatedBy() { public int getCreatedBy() {
return createdBy; return createdBy;
......
...@@ -804,6 +804,7 @@ public interface ApiService { ...@@ -804,6 +804,7 @@ public interface ApiService {
*/ */
@PUT("/moneyBackApply/exam") @PUT("/moneyBackApply/exam")
Observable<BaseBean> checkMoneyBack(@Body RequestBody requestBody); Observable<BaseBean> checkMoneyBack(@Body RequestBody requestBody);
/** /**
* 付款回款 * 付款回款
* orderType * orderType
...@@ -842,8 +843,6 @@ public interface ApiService { ...@@ -842,8 +843,6 @@ public interface ApiService {
Observable<BaseBean> packageTicketOrder(@QueryMap Map<String, Object> param); Observable<BaseBean> packageTicketOrder(@QueryMap Map<String, Object> param);
/** /**
* 为外采购查询的订单 * 为外采购查询的订单
* customerId * customerId
...@@ -890,7 +889,26 @@ public interface ApiService { ...@@ -890,7 +889,26 @@ public interface ApiService {
@GET("/supplierOrder/item/page/list") @GET("/supplierOrder/item/page/list")
Observable<BaseBean> supplierTicketOrder(@QueryMap Map<String, Object> param); Observable<BaseBean> supplierTicketOrder(@QueryMap Map<String, Object> param);
/**
* app查看某一往来单位的应收或应付账款
* transitPartId
* type
* AR:应收 AP应付(String)
* searchValue
*
* @return
*/
@GET("/finance-dept-ar-ap-part-detail/app/page/list")
Observable<BaseBean> contactsMoney(@QueryMap Map<String, Object> param);
/**
* 部门应收应付账款流水
*
* @return
*/
@GET("/finance-dept-ar-ap-part/flow/page/list")
Observable<BaseBean> contactsMoneyFlow(@QueryMap Map<String, Object> param);
} }
package com.wd.workoffice.ui.activity.bat.work; package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -69,15 +68,22 @@ public class WorkContactsDetailActivity extends WorkToolBarActivity { ...@@ -69,15 +68,22 @@ public class WorkContactsDetailActivity extends WorkToolBarActivity {
} }
@OnClick({R.id.ll_pay,R.id.ll_info, R.id.ll_receive, R.id.ll_live, R.id.ll_settle, R.id.ll_receive_ticket, R.id.ll_open_ticket, R.id.ll_order, R.id.ll_return}) @OnClick({R.id.ll_pay, R.id.ll_info, R.id.ll_receive, R.id.ll_live, R.id.ll_settle, R.id.ll_receive_ticket, R.id.ll_open_ticket, R.id.ll_order, R.id.ll_return})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.ll_info: case R.id.ll_info:
startActivity(WorkContactsInfoActivity.class, "id", getIntent().getStringExtra("id")); startActivity(WorkContactsInfoActivity.class, "id", getIntent().getStringExtra("id"));
break; break;
case R.id.ll_receive: case R.id.ll_receive:
startActivity(WorkContactsMoneyActivity.class, "type","1","id", getIntent().getStringExtra("id"));
break; break;
case R.id.ll_pay: case R.id.ll_pay:
if (TextUtils.equals("物流公司", getIntent().getStringExtra("partTypeNames"))) {
startActivity(WorkContactsMoneyActivity.class, "type","3","id", getIntent().getStringExtra("id"));
}else {
startActivity(WorkContactsMoneyActivity.class, "type","2","id", getIntent().getStringExtra("id"));
}
break; break;
case R.id.ll_live: case R.id.ll_live:
break; break;
......
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
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.ContactsMoneyBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ContactsGetMoneyAdapter;
import com.wd.workoffice.util.WorkUtils;
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.disposables.Disposable;
/**
* 应收账款
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkContactsMoneyActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
@BindView(R.id.tv_process)
TextView tvProcess;
@BindView(R.id.tv_get)
TextView tvGet;
@BindView(R.id.tv_apply)
TextView tvApply;
@BindView(R.id.tv_back)
TextView tvBack;
@BindView(R.id.tv_dep)
TextView tvDep;
private Map<String, Object> param;
private List<ContactsMoneyBean.RecordsBean> dataList;
private ContactsGetMoneyAdapter dataAdapter;
private int page = 1;
private String type;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
type = getIntent().getStringExtra("type");
dataList = new ArrayList<>();
dataAdapter = new ContactsGetMoneyAdapter(R.layout.item_contacts_get_money, dataList, Integer.valueOf(type));
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
param.put("transitPartId", getIntent().getStringExtra("id"));
if (TextUtils.equals("1", type)) {
param.put("type", "AR");//AR:应收 AP应付(String)
} else if (TextUtils.equals("2", type)) {
param.put("type", "AP");
tvGet.setText("应付款(万)");
} else {//3
param.put("type", "AP");
tvDep.setVisibility(View.GONE);
tvGet.setText("应付款(万)");
}
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().contactsMoney(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<ContactsMoneyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), ContactsMoneyBean.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(WorkContactsMoneyFlowActivity.class, "id", dataList.get(position).getId() + "");
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_contacts_get_money;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.view.View;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.FlowBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ContactsMoneyFlowAdapter;
import com.wd.workoffice.ui.adapter.WorkFlowAdapter;
import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.util.WorkUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.disposables.Disposable;
/**
* 往来流水详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkContactsMoneyFlowActivity extends WorkToolBarActivity {
@BindView(R.id.tv_start)
TextView tvStart;
@BindView(R.id.tv_end)
TextView tvEnd;
@BindView(R.id.rv_data)
RecyclerView rvData;
private Map<String, Object> param;
int page;
private List<FlowBean.RecordsBean> clientList;
private ContactsMoneyFlowAdapter clientAdapter;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new ContactsMoneyFlowAdapter(R.layout.item_work_flow, clientList);
clientAdapter.bindToRecyclerView(rvData);
clientAdapter.setEmptyView(R.layout.view_empty_content,rvData);
param = WorkUtils.pageKey();
param.put("financeDeptArApPartDetailId", getIntent().getStringExtra("id"));
page = 1;
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().contactsMoneyFlow(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<FlowBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(), FlowBean.class).getRecords();
if (page == 1) {
clientList.clear();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
}
if (dataList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(WorkContactsMoneyFlowDetailActivity.class,"detail",JSON.toJSONString(clientList.get(position)));
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_work_account_flow;
}
@OnClick({R.id.tv_start, R.id.tv_end})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_start:
PickTimeUtils.showPickThree(this, new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {
String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd"));
param.put("searchStartTime",time+ " 00:00:00");
tvStart.setText(time);
page = 1;
param.put("current", page);
getData();
}
}).show();
break;
case R.id.tv_end:
PickTimeUtils.showPickThree(this, new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {
String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd"));
param.put("searchEndTime", time+ " 23:59:59");
tvEnd.setText(time);
page = 1;
param.put("current", page);
getData();
}
}).show();
break;
}
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.FlowBean;
import com.wd.workoffice.util.MathUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 工作台 - 部门
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkContactsMoneyFlowDetailActivity extends WorkToolBarActivity {
@BindView(R.id.tv_show_type)
TextView tvShowType;
@BindView(R.id.tv_id)
TextView tvId;
@BindView(R.id.tv_price)
TextView tvPrice;
@BindView(R.id.tv_from_account)
TextView tvFromAccount;
@BindView(R.id.tv_to_account)
TextView tvToAccount;
@BindView(R.id.tv_operating)
TextView tvOperating;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.tv_desc)
TextView tvDesc;
private FlowBean.RecordsBean dataBean;
@Override
protected void initView() {
ButterKnife.bind(this);
dataBean = JSON.parseObject(getIntent().getStringExtra("detail"), FlowBean.RecordsBean.class);
tvShowType.setText(dataBean.getInvoiceTypeName());
tvId.setText(dataBean.getLinkSerialNumber());
tvToAccount.setText(dataBean.getTargetName());
tvFromAccount.setText(dataBean.getSourceName());
tvPrice.setText(MathUtils.converData(String.valueOf(dataBean.getMoney()), 2));
tvDesc.setText(dataBean.getRemark());
tvOperating.setText(dataBean.getCreatedUser());
tvTime.setText(dataBean.getCreatedTime());
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_contacts_flow_detail;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ClientBean;
import com.wd.workoffice.bean.ContactsMoneyBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class ContactsGetMoneyAdapter extends BaseQuickAdapter<ContactsMoneyBean.RecordsBean, BaseViewHolder> {
int type;
public ContactsGetMoneyAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public ContactsGetMoneyAdapter(int layoutResId, @Nullable List<ContactsMoneyBean.RecordsBean> data, int type) {
super(layoutResId, data);
this.type = type;
}
@Override
protected void convert(BaseViewHolder helper, ContactsMoneyBean.RecordsBean item) {
helper.setText(R.id.tv_process, item.getProcessCodeName());
helper.setText(R.id.tv_get, MathUtils.divide(String.valueOf(item.getExpectAmount()), "10000", 4));
helper.setText(R.id.tv_apply, MathUtils.divide(String.valueOf(item.getApplyAmount()), "10000", 4));
helper.setText(R.id.tv_back, MathUtils.divide(String.valueOf(item.getFinishAmount()), "10000", 4));
if (type == 3) {
helper.setVisible(R.id.tv_dep, true);
}
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.FlowBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class ContactsMoneyFlowAdapter extends BaseQuickAdapter<FlowBean.RecordsBean, BaseViewHolder> {
public ContactsMoneyFlowAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, FlowBean.RecordsBean item) {
helper.setText(R.id.tv_price, String.valueOf(item.getMoney()));
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_desc, item.getLinkSerialNumber());
helper.setText(R.id.tv_dep, item.getInvoiceTypeName());
}
}
...@@ -130,4 +130,17 @@ public class MathUtils { ...@@ -130,4 +130,17 @@ public class MathUtils {
BigDecimal b2 = new BigDecimal(v2.trim()); BigDecimal b2 = new BigDecimal(v2.trim());
return b1.subtract(b2).setScale(scale).toString(); return b1.subtract(b2).setScale(scale).toString();
} }
public static String divide(String v1, String v2, Integer scale) {
if (TextUtils.isEmpty(v1)) {
v1 = "0";
}
if (TextUtils.isEmpty(v2)) {
v2 = "0";
}
BigDecimal b1 = new BigDecimal(v1.trim());
BigDecimal b2 = new BigDecimal(v2.trim());
return b1.divide(b2).setScale(scale).toString();
}
} }
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="单据类型"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_show_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="单据编号"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="金额"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="源账户"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_from_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="目标账户"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_to_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="操作人"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_operating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="生成时间"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_sup"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="生成原因"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:text="权限:无"
android:textColor="@color/main_sup_color"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/srl_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="5mm"
android:paddingVertical="15mm">
<TextView
android:id="@+id/tv_dep"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="接单部门"
android:visibility="gone"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_process"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="所属流程"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="应收款(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_apply"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="申请中(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_back"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="已回款(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:layout_marginHorizontal="10mm"
android:gravity="center"
android:src="@mipmap/arrow_right_gray"
android:visibility="invisible" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="5mm"
android:paddingVertical="8mm">
<TextView
android:id="@+id/tv_dep"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="接单部门"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_process"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="所属流程"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="应收款(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_apply"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="申请中(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_back"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="已回款(万)"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:layout_marginHorizontal="10mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论