提交 7b9f8d5e authored 作者: lgd's avatar lgd

1.仓库 库存详情

2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级 33d4058d
...@@ -456,6 +456,14 @@ ...@@ -456,6 +456,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.WorkWarehouseStockActivity"
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;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WarehouseStockBean {
/**
* records : [{"createdBy":111,"createdByName":null,"createdTime":"2020-01-02 16:13:10","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":96,"productId":32,"stockId":15,"quantity":0.744,"lockQuantity":0.256,"version":4,"stockName":"技术中心安阳钢铁未结算库","stockSign":null,"productName":"浸入式水口(方坯)","productSoleCode":"70LTJ568-1001","productSimpleCode":"J568-1","productSpec":"90","productUnit":"支","productWeight":0,"deptId":null,"deptName":null,"quantityDetailList":null,"quantityFlowList":null}]
* 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 : 111
* createdByName : null
* createdTime : 2020-01-02 16:13:10
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 96
* productId : 32
* stockId : 15
* quantity : 0.744
* lockQuantity : 0.256
* version : 4
* stockName : 技术中心安阳钢铁未结算库
* stockSign : null
* productName : 浸入式水口(方坯)
* productSoleCode : 70LTJ568-1001
* productSimpleCode : J568-1
* productSpec : 90
* productUnit : 支
* productWeight : 0.0
* deptId : null
* deptName : null
* quantityDetailList : null
* quantityFlowList : null
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private int productId;
private int stockId;
private double quantity;
private double lockQuantity;
private int version;
private String stockName;
private Object stockSign;
private String productName;
private String productSoleCode;
private String productSimpleCode;
private String productSpec;
private String productUnit;
private double productWeight;
private Object deptId;
private Object deptName;
private Object quantityDetailList;
private Object quantityFlowList;
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 getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public int getStockId() {
return stockId;
}
public void setStockId(int stockId) {
this.stockId = stockId;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public double getLockQuantity() {
return lockQuantity;
}
public void setLockQuantity(double lockQuantity) {
this.lockQuantity = lockQuantity;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getStockName() {
return stockName;
}
public void setStockName(String stockName) {
this.stockName = stockName;
}
public Object getStockSign() {
return stockSign;
}
public void setStockSign(Object stockSign) {
this.stockSign = stockSign;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSoleCode() {
return productSoleCode;
}
public void setProductSoleCode(String productSoleCode) {
this.productSoleCode = productSoleCode;
}
public String getProductSimpleCode() {
return productSimpleCode;
}
public void setProductSimpleCode(String productSimpleCode) {
this.productSimpleCode = productSimpleCode;
}
public String getProductSpec() {
return productSpec;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public String getProductUnit() {
return productUnit;
}
public void setProductUnit(String productUnit) {
this.productUnit = productUnit;
}
public double getProductWeight() {
return productWeight;
}
public void setProductWeight(double productWeight) {
this.productWeight = productWeight;
}
public Object getDeptId() {
return deptId;
}
public void setDeptId(Object deptId) {
this.deptId = deptId;
}
public Object getDeptName() {
return deptName;
}
public void setDeptName(Object deptName) {
this.deptName = deptName;
}
public Object getQuantityDetailList() {
return quantityDetailList;
}
public void setQuantityDetailList(Object quantityDetailList) {
this.quantityDetailList = quantityDetailList;
}
public Object getQuantityFlowList() {
return quantityFlowList;
}
public void setQuantityFlowList(Object quantityFlowList) {
this.quantityFlowList = quantityFlowList;
}
}
}
...@@ -539,4 +539,13 @@ public interface ApiService { ...@@ -539,4 +539,13 @@ public interface ApiService {
*/ */
@GET("/invoiceApply/app/page/list/part") @GET("/invoiceApply/app/page/list/part")
Observable<BaseBean> openTicket(@QueryMap Map<String, Object> param); Observable<BaseBean> openTicket(@QueryMap Map<String, Object> param);
/**
* app端从往来单位进入查看开票单
*
* @return
*/
@GET("/stockQuantity/app/page/list")
Observable<BaseBean> stockList(@QueryMap Map<String, Object> param);
} }
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
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.WarehouseStockBean;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
import com.wd.workoffice.ui.adapter.WorkWarhosutStockAdapter;
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 WorkWarehouseStockActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
@BindView(R.id.tv_name)
TextView tvName;
private Map<String, Object> param;
private List<WarehouseStockBean.RecordsBean> dataList;
private WorkWarhosutStockAdapter dataAdapter;
private int page = 1;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
tvName.setText(getIntent().getStringExtra("name"));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new WorkWarhosutStockAdapter(R.layout.item_work_warehoust_stock, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
param.put("stockId", getIntent().getStringExtra("id"));
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().stockList(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<WarehouseStockBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), WarehouseStockBean.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);
}
@Override
protected int layoutId() {
return R.layout.activity_work_warehosue_stock;
}
}
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.WarehouseStockBean;
import com.wd.workoffice.bean.ProPriceBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkWarhosutStockAdapter extends BaseQuickAdapter<WarehouseStockBean.RecordsBean, BaseViewHolder> {
public WorkWarhosutStockAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WarehouseStockBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_code, "品名:".concat(item.getProductSoleCode()));
helper.setText(R.id.tv_img_code, "图号:".concat(item.getProductSimpleCode()));
helper.setText(R.id.tv_num,String.valueOf(item.getQuantity()));
helper.addOnClickListener(R.id.ll_num);
helper.addOnClickListener(R.id.tv_detail);
helper.addOnClickListener(R.id.tv_flow);
}
}
...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.listener.WarehouseFilterClickListener; ...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.listener.WarehouseFilterClickListener;
import com.wd.workoffice.contract.WorkWarehouseContract; import com.wd.workoffice.contract.WorkWarehouseContract;
import com.wd.workoffice.presenter.WorkWarehousePresenter; import com.wd.workoffice.presenter.WorkWarehousePresenter;
import com.wd.workoffice.ui.activity.bat.work.WorkProDetailActivity; import com.wd.workoffice.ui.activity.bat.work.WorkProDetailActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkWarehouseStockActivity;
import com.wd.workoffice.ui.adapter.WorkWarehouseAdapter; import com.wd.workoffice.ui.adapter.WorkWarehouseAdapter;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.util.ddmfilter.WarehouseFilterData; import com.wd.workoffice.util.ddmfilter.WarehouseFilterData;
...@@ -112,7 +113,9 @@ public class WorkWarehouse1Fragment extends WorkBaseFg implements WorkWarehouseC ...@@ -112,7 +113,9 @@ public class WorkWarehouse1Fragment extends WorkBaseFg implements WorkWarehouseC
workProductAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { workProductAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(WorkProDetailActivity.class, "pro", JSON.toJSONString(dataList.get(position))); startActivity(WorkWarehouseStockActivity.class,
"id", dataList.get(position).getId()+"",
"name",dataList.get(position).getName());
} }
}); });
} }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="90mm" />
<stroke
android:width="1mm"
android:color="@color/black" />
</shape>
\ No newline at end of file
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableRight="@mipmap/arrow_down" android:drawableRight="@mipmap/arrow_down"
android:paddingVertical="13mm" android:paddingVertical="13mm"
android:gravity="center_vertical"
android:text="开始时间" android:text="开始时间"
android:textSize="13sp" /> android:textSize="13sp" />
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableRight="@mipmap/arrow_down" android:drawableRight="@mipmap/arrow_down"
android:paddingVertical="13mm" android:paddingVertical="13mm"
android:gravity="center_vertical"
android:text="结束时间" android:text="结束时间"
android:textSize="13sp" /> android:textSize="13sp" />
</LinearLayout> </LinearLayout>
......
<?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:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/black"
android:paddingVertical="10mm" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_data"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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:layout_centerHorizontal="true"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8mm"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1111"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_img_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8mm"
android:text="1111"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/ll_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="0"
android:textColor="@color/black"
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:text="库存数量"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8mm"
android:src="@mipmap/arrow_right_my" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="18mm">
<TextView
android:id="@+id/tv_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_stock_circle"
android:paddingHorizontal="12mm"
android:paddingVertical="4mm"
android:text="库存明细"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_flow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@drawable/shape_stock_circle"
android:paddingHorizontal="12mm"
android:paddingVertical="4mm"
android:text="库存流水"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论