提交 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"
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论