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

1.部门流水

2.//TODO erp用户激活,忘记密码测试,上下架需要在调试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级 5d029d1f
...@@ -337,6 +337,14 @@ ...@@ -337,6 +337,14 @@
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.WorkAccountFlowActivity"
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 FlowBean {
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 : 143
* createdByName : null
* createdTime : 2019-11-28 10:13:57
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 59
* type : 20
* deptId : 119
* accountId : 4
* money : 1353.96
* relOrderType : SO
* orderId : SO10583
* event : AUDIT_OK
* displayType : 20
* flowAccountId : 2
* earlyOver : 1.0422523784E7
* afterOver : 1.0421169824E7
* launchDeptId : 119
* receiveDeptId : 137
* customerId : 41
* supplierId : null
* comments : null
* remark : [销售订单下单支出] 审核通过订单款冻结
* typeName : 支出
* deptName : 技术中心
* eventName :
* flowDeptName : null
* flowAccountName : 冻结银行
* displayTypeName : 订单支出
* relOrderTypeName : 销售流程
* customerName : 安阳钢铁
* supplierName : null
* receiveDeptName : 锆碳公司
* launchDeptName : 技术中心
* createdName : 冷益飞
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private String type;
private int deptId;
private int accountId;
private double money;
private String relOrderType;
private String orderId;
private String event;
private String displayType;
private int flowAccountId;
private double earlyOver;
private double afterOver;
private int launchDeptId;
private int receiveDeptId;
private int customerId;
private Object supplierId;
private Object comments;
private String remark;
private String typeName;
private String deptName;
private String eventName;
private Object flowDeptName;
private String flowAccountName;
private String displayTypeName;
private String relOrderTypeName;
private String customerName;
private Object supplierName;
private String receiveDeptName;
private String launchDeptName;
private String createdName;
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 String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getDeptId() {
return deptId;
}
public void setDeptId(int deptId) {
this.deptId = deptId;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public double getMoney() {
return money;
}
public void setMoney(double money) {
this.money = money;
}
public String getRelOrderType() {
return relOrderType;
}
public void setRelOrderType(String relOrderType) {
this.relOrderType = relOrderType;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getEvent() {
return event;
}
public void setEvent(String event) {
this.event = event;
}
public String getDisplayType() {
return displayType;
}
public void setDisplayType(String displayType) {
this.displayType = displayType;
}
public int getFlowAccountId() {
return flowAccountId;
}
public void setFlowAccountId(int flowAccountId) {
this.flowAccountId = flowAccountId;
}
public double getEarlyOver() {
return earlyOver;
}
public void setEarlyOver(double earlyOver) {
this.earlyOver = earlyOver;
}
public double getAfterOver() {
return afterOver;
}
public void setAfterOver(double afterOver) {
this.afterOver = afterOver;
}
public int getLaunchDeptId() {
return launchDeptId;
}
public void setLaunchDeptId(int launchDeptId) {
this.launchDeptId = launchDeptId;
}
public int getReceiveDeptId() {
return receiveDeptId;
}
public void setReceiveDeptId(int receiveDeptId) {
this.receiveDeptId = receiveDeptId;
}
public int getCustomerId() {
return customerId;
}
public void setCustomerId(int customerId) {
this.customerId = customerId;
}
public Object getSupplierId() {
return supplierId;
}
public void setSupplierId(Object supplierId) {
this.supplierId = supplierId;
}
public Object getComments() {
return comments;
}
public void setComments(Object comments) {
this.comments = comments;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public Object getFlowDeptName() {
return flowDeptName;
}
public void setFlowDeptName(Object flowDeptName) {
this.flowDeptName = flowDeptName;
}
public String getFlowAccountName() {
return flowAccountName;
}
public void setFlowAccountName(String flowAccountName) {
this.flowAccountName = flowAccountName;
}
public String getDisplayTypeName() {
return displayTypeName;
}
public void setDisplayTypeName(String displayTypeName) {
this.displayTypeName = displayTypeName;
}
public String getRelOrderTypeName() {
return relOrderTypeName;
}
public void setRelOrderTypeName(String relOrderTypeName) {
this.relOrderTypeName = relOrderTypeName;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public Object getSupplierName() {
return supplierName;
}
public void setSupplierName(Object supplierName) {
this.supplierName = supplierName;
}
public String getReceiveDeptName() {
return receiveDeptName;
}
public void setReceiveDeptName(String receiveDeptName) {
this.receiveDeptName = receiveDeptName;
}
public String getLaunchDeptName() {
return launchDeptName;
}
public void setLaunchDeptName(String launchDeptName) {
this.launchDeptName = launchDeptName;
}
public String getCreatedName() {
return createdName;
}
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
}
}
...@@ -447,5 +447,13 @@ public interface ApiService { ...@@ -447,5 +447,13 @@ public interface ApiService {
@GET("/dept-account-balance/app/account-balance-info") @GET("/dept-account-balance/app/account-balance-info")
Observable<BaseBean> getAccount(); Observable<BaseBean> getAccount();
/**
* 获取部门账户的流水
* @param param
* @return
*/
@GET(" /finance/flow/page/list")
Observable<BaseBean> getFlow(@QueryMap Map<String, Object> param);
} }
...@@ -26,7 +26,7 @@ import flexible.xd.android_base.network.rtfhttp.Transformer; ...@@ -26,7 +26,7 @@ import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
/** /**
* 工作台 - 产品 * 工作台 - 部门
* author : flexible * author : flexible
* email : lgd19940421@163.com * email : lgd19940421@163.com
* github: https://github.com/FlexibleXd * github: https://github.com/FlexibleXd
...@@ -42,7 +42,7 @@ public class WorkAccountActivity extends WorkToolBarActivity { ...@@ -42,7 +42,7 @@ public class WorkAccountActivity extends WorkToolBarActivity {
TextView tvDpeFreezePrice; TextView tvDpeFreezePrice;
@BindView(R.id.tv_see_flow) @BindView(R.id.tv_see_flow)
TextView tvSeeFlow; TextView tvSeeFlow;
private AccountBean dataBean;
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
...@@ -55,6 +55,9 @@ public class WorkAccountActivity extends WorkToolBarActivity { ...@@ -55,6 +55,9 @@ public class WorkAccountActivity extends WorkToolBarActivity {
private void getData() { private void getData() {
RtfUtils.getRtf().getAccount().compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() { RtfUtils.getRtf().getAccount().compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override @Override
public void doOnSubscribe(Disposable d) { public void doOnSubscribe(Disposable d) {
} }
...@@ -72,7 +75,7 @@ public class WorkAccountActivity extends WorkToolBarActivity { ...@@ -72,7 +75,7 @@ public class WorkAccountActivity extends WorkToolBarActivity {
toast(data.getMessage()); toast(data.getMessage());
return; return;
} }
AccountBean dataBean = JSON.parseObject(data.getData().toString(), AccountBean.class); dataBean = JSON.parseObject(data.getData().toString(), AccountBean.class);
tvName.setText(dataBean.getName()); tvName.setText(dataBean.getName());
tvDpeName.setText(dataBean.getName()); tvDpeName.setText(dataBean.getName());
tvDpePrice.setText(MathUtils.converData(dataBean.getBalance(),2)); tvDpePrice.setText(MathUtils.converData(dataBean.getBalance(),2));
...@@ -93,5 +96,10 @@ public class WorkAccountActivity extends WorkToolBarActivity { ...@@ -93,5 +96,10 @@ public class WorkAccountActivity extends WorkToolBarActivity {
@OnClick(R.id.tv_see_flow) @OnClick(R.id.tv_see_flow)
public void onViewClicked() { public void onViewClicked() {
if (dataBean==null){
toast("正在加载中,请稍后");
return;
}
startActivity(WorkAccountFlowActivity.class,"id",dataBean.getDeptId()+"");
} }
} }
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.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 WorkAccountFlowActivity 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 WorkFlowAdapter 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 WorkFlowAdapter(R.layout.item_work_flow, clientList);
clientAdapter.bindToRecyclerView(rvData);
clientAdapter.setEmptyView(R.layout.view_empty_content,rvData);
param = WorkUtils.pageKey();
param.put("deptId", getIntent().getStringExtra("id"));
page = 1;
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().getFlow(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);
}
@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;
}
}
}
...@@ -41,8 +41,6 @@ public class WorkProPriceActivity extends WorkToolBarActivity { ...@@ -41,8 +41,6 @@ public class WorkProPriceActivity extends WorkToolBarActivity {
RecyclerView rvData; RecyclerView rvData;
@BindView(R.id.srl_refresh) @BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh; SmartRefreshLayout srlRefresh;
private String state;
private SaleSalePresenter saleSalePresenter;
private Map<String, Object> param; private Map<String, Object> param;
private List<ProPriceBean.RecordsBean> dataList; private List<ProPriceBean.RecordsBean> dataList;
private WorkProPriceAdapter dataAdapter; private WorkProPriceAdapter dataAdapter;
...@@ -51,8 +49,6 @@ public class WorkProPriceActivity extends WorkToolBarActivity { ...@@ -51,8 +49,6 @@ public class WorkProPriceActivity extends WorkToolBarActivity {
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
// saleSalePresenter = new SaleSalePresenter();
// saleSalePresenter.onAttach(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false)); rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
} }
......
package com.wd.workoffice.ui.adapter;
import android.text.TextUtils;
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 com.wd.workoffice.bean.ProPriceBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkFlowAdapter extends BaseQuickAdapter<FlowBean.RecordsBean, BaseViewHolder> {
public WorkFlowAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, FlowBean.RecordsBean item) {
// helper.setText(R.id.tv_price,(TextUtils.equals("支出", item.getTypeName()) ? "-" : "+") + String.valueOf(item.getMoney()));
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.getDisplayTypeName());
helper.setText(R.id.tv_dep, item.getFlowAccountName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_horizontal">
<TextView
android:id="@+id/tv_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@mipmap/arrow_down"
android:paddingVertical="15mm"
android:text="开始时间" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:text="~" />
<TextView
android:id="@+id/tv_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="15mm"
android:drawableRight="@mipmap/arrow_down"
android:text="结束时间" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_data"
android:layout_width="match_parent"
android:layout_marginTop="10mm"
android:background="@android:color/white"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textSize="14sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="10mm">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textColor="@color/flexible_text_sup"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_dep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_sup"
android:textSize="12sp" />
</RelativeLayout>
<View style="@style/dividerX" />
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论