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

1.现场库,没找到接口

2.//TODO erp用户激活测试,忘记/重置密码测试,坩埚下单页面,组装列表,往来(客户两个库),产品下单还差附件,mes,消息,刷新token
上级 41f80542
...@@ -848,6 +848,14 @@ ...@@ -848,6 +848,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.WorkContactsLiveStockActivity"
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"
......
...@@ -86,8 +86,10 @@ public class WorkContactsDetailActivity extends WorkToolBarActivity { ...@@ -86,8 +86,10 @@ public class WorkContactsDetailActivity extends WorkToolBarActivity {
} }
break; break;
case R.id.ll_live: case R.id.ll_live:
startActivity(WorkContactsLiveStockActivity.class, "id", getIntent().getStringExtra("id"));
break; break;
case R.id.ll_settle: case R.id.ll_settle:
startActivity(WorkContactsLiveStockActivity.class, "id", getIntent().getStringExtra("id"));
break; break;
case R.id.ll_receive_ticket: case R.id.ll_receive_ticket:
startActivity(WorkContactsReceiveTicketActivity.class, "id", getIntent().getStringExtra("id")); startActivity(WorkContactsReceiveTicketActivity.class, "id", getIntent().getStringExtra("id"));
......
package com.wd.workoffice.ui.activity.bat.work;
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.ProPriceBean;
import com.wd.workoffice.bean.WarehoustBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkLiveStockAdapter;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
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 WorkContactsLiveStockActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<WarehoustBean.RecordsBean> dataList;
private WorkLiveStockAdapter 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 WorkLiveStockAdapter(R.layout.item_live_sotck, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content,rvData);
param = WorkUtils.pageKey();
param.put("productId", getIntent().getStringExtra("id"));
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().getWarehouse(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<WarehoustBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), WarehoustBean.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(WorkWarehouseStockActivity.class,
"id", dataList.get(position).getId()+"",
"name",dataList.get(position).getName());
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
}
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.WarehoustBean;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkLiveStockAdapter extends BaseQuickAdapter<WarehoustBean.RecordsBean, BaseViewHolder> {
public WorkLiveStockAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WarehoustBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_code, item.getCode());
WarehoustBean.RecordsBean.OfTypeBean ofType = item.getOfType();
if (ofType != null) {
helper.setText(R.id.tv_clazz, ofType.getName());
helper.setText(R.id.tv_diff, WorkUtils.getStockType(ofType.getType()));
}
helper.setText(R.id.tv_time, item.getCreatedTime());
}
}
<?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:layout_centerHorizontal="true"
android:layout_marginTop="10mm"
android:paddingTop="10mm"
android:paddingBottom="20mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="邢台德龙钢铁客户"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#0841F0"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:paddingVertical="10mm"
android:background="#FCFCFD"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="标识码"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="所属类别"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_clazz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="王紫逸"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="区分"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_diff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="王紫逸"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="创建时间"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="王紫逸"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论