提交 75dfafec authored 作者: lgd's avatar lgd

1.开票第二步骤

2.//TODO erp用户激活测试,忘记/重置密码测试,开票第一步参数修改,开票收票新增,开票收票操作,产品下单还差附件,bat,mes,消息,刷新token
上级 8449305d
......@@ -712,7 +712,14 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkChooseProductActivity"
android:configChanges="keyboardHidden|orientation"
android:label="选择开票来源"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.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 TicketAddBean {
/**
* records : [{"createdBy":705,"createdByName":null,"createdTime":"2020-03-31 09:50:26","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":"0e071cf4258047c1b34e3d26891e2cfe","orderId":"SO10750","productId":16402,"innerPrice":11,"productCount":2,"type":"PDS","outerPrice":25,"storeSum":2,"shipSum":2,"packageSum":0,"usedSum":2,"invoiceSum":0,"usedReturnSum":0,"oddSum":0,"lotNumber":"200331006","serialNumber":"PDS20033109502646","annex":null,"tranFromStockId":null,"customerBranchFactoryId":407,"version":4,"productName":"测试单元","itemFlows":null,"stockQuantityDetailList":null,"stockQuantityDetailMaps":null,"productSoleCode":"pinhao","productSimpleCode":"tuhao","productSpec":"1*2","productUnit":"个","productWeight":null,"canOutStoreProductSum":null,"canInStoreProductSum":null,"canUseProductSum":null,"canPackageSum":null,"launchDeptName":"销售四公司","launchDeptId":null,"receiveDeptName":"技术中心","customerId":null,"customerName":"测试工厂","productOfKind":"自制成品","canInvoiceSum":2,"orderType":null,"customerBranchFactoryName":null,"orderTypeName":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 : 705
* createdByName : null
* createdTime : 2020-03-31 09:50:26
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 0e071cf4258047c1b34e3d26891e2cfe
* orderId : SO10750
* productId : 16402
* innerPrice : 11.0
* productCount : 2.0
* type : PDS
* outerPrice : 25.0
* storeSum : 2.0
* shipSum : 2.0
* packageSum : 0.0
* usedSum : 2.0
* invoiceSum : 0.0
* usedReturnSum : 0.0
* oddSum : 0.0
* lotNumber : 200331006
* serialNumber : PDS20033109502646
* annex : null
* tranFromStockId : null
* customerBranchFactoryId : 407
* version : 4
* productName : 测试单元
* itemFlows : null
* stockQuantityDetailList : null
* stockQuantityDetailMaps : null
* productSoleCode : pinhao
* productSimpleCode : tuhao
* productSpec : 1*2
* productUnit : 个
* productWeight : null
* canOutStoreProductSum : null
* canInStoreProductSum : null
* canUseProductSum : null
* canPackageSum : null
* launchDeptName : 销售四公司
* launchDeptId : null
* receiveDeptName : 技术中心
* customerId : null
* customerName : 测试工厂
* productOfKind : 自制成品
* canInvoiceSum : 2.0
* orderType : null
* customerBranchFactoryName : null
* orderTypeName : null
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private String id;
private String orderId;
private int productId;
private double innerPrice;
private int productCount;
private String type;
private double outerPrice;
private double storeSum;
private double shipSum;
private double packageSum;
private double usedSum;
private double invoiceSum;
private double usedReturnSum;
private double oddSum;
private String lotNumber;
private String serialNumber;
private Object annex;
private Object tranFromStockId;
private int customerBranchFactoryId;
private int version;
private String productName;
private Object itemFlows;
private Object stockQuantityDetailList;
private Object stockQuantityDetailMaps;
private String productSoleCode;
private String productSimpleCode;
private String productSpec;
private String productUnit;
private Object productWeight;
private Object canOutStoreProductSum;
private Object canInStoreProductSum;
private Object canUseProductSum;
private Object canPackageSum;
private String launchDeptName;
private Object launchDeptId;
private String receiveDeptName;
private Object customerId;
private String customerName;
private String productOfKind;
private double canInvoiceSum;
private Object orderType;
private Object customerBranchFactoryName;
private Object orderTypeName;
private String carPrice;
private int carNum;
public String getCarPrice() {
return carPrice;
}
public void setCarPrice(String carPrice) {
this.carPrice = carPrice;
}
public int getCarNum() {
return carNum;
}
public void setCarNum(int carNum) {
this.carNum = carNum;
}
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 String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public double getInnerPrice() {
return innerPrice;
}
public void setInnerPrice(double innerPrice) {
this.innerPrice = innerPrice;
}
public int getProductCount() {
return productCount;
}
public void setProductCount(int productCount) {
this.productCount = productCount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public double getOuterPrice() {
return outerPrice;
}
public void setOuterPrice(double outerPrice) {
this.outerPrice = outerPrice;
}
public double getStoreSum() {
return storeSum;
}
public void setStoreSum(double storeSum) {
this.storeSum = storeSum;
}
public double getShipSum() {
return shipSum;
}
public void setShipSum(double shipSum) {
this.shipSum = shipSum;
}
public double getPackageSum() {
return packageSum;
}
public void setPackageSum(double packageSum) {
this.packageSum = packageSum;
}
public double getUsedSum() {
return usedSum;
}
public void setUsedSum(double usedSum) {
this.usedSum = usedSum;
}
public double getInvoiceSum() {
return invoiceSum;
}
public void setInvoiceSum(double invoiceSum) {
this.invoiceSum = invoiceSum;
}
public double getUsedReturnSum() {
return usedReturnSum;
}
public void setUsedReturnSum(double usedReturnSum) {
this.usedReturnSum = usedReturnSum;
}
public double getOddSum() {
return oddSum;
}
public void setOddSum(double oddSum) {
this.oddSum = oddSum;
}
public String getLotNumber() {
return lotNumber;
}
public void setLotNumber(String lotNumber) {
this.lotNumber = lotNumber;
}
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
public Object getAnnex() {
return annex;
}
public void setAnnex(Object annex) {
this.annex = annex;
}
public Object getTranFromStockId() {
return tranFromStockId;
}
public void setTranFromStockId(Object tranFromStockId) {
this.tranFromStockId = tranFromStockId;
}
public int getCustomerBranchFactoryId() {
return customerBranchFactoryId;
}
public void setCustomerBranchFactoryId(int customerBranchFactoryId) {
this.customerBranchFactoryId = customerBranchFactoryId;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public Object getItemFlows() {
return itemFlows;
}
public void setItemFlows(Object itemFlows) {
this.itemFlows = itemFlows;
}
public Object getStockQuantityDetailList() {
return stockQuantityDetailList;
}
public void setStockQuantityDetailList(Object stockQuantityDetailList) {
this.stockQuantityDetailList = stockQuantityDetailList;
}
public Object getStockQuantityDetailMaps() {
return stockQuantityDetailMaps;
}
public void setStockQuantityDetailMaps(Object stockQuantityDetailMaps) {
this.stockQuantityDetailMaps = stockQuantityDetailMaps;
}
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 Object getProductWeight() {
return productWeight;
}
public void setProductWeight(Object productWeight) {
this.productWeight = productWeight;
}
public Object getCanOutStoreProductSum() {
return canOutStoreProductSum;
}
public void setCanOutStoreProductSum(Object canOutStoreProductSum) {
this.canOutStoreProductSum = canOutStoreProductSum;
}
public Object getCanInStoreProductSum() {
return canInStoreProductSum;
}
public void setCanInStoreProductSum(Object canInStoreProductSum) {
this.canInStoreProductSum = canInStoreProductSum;
}
public Object getCanUseProductSum() {
return canUseProductSum;
}
public void setCanUseProductSum(Object canUseProductSum) {
this.canUseProductSum = canUseProductSum;
}
public Object getCanPackageSum() {
return canPackageSum;
}
public void setCanPackageSum(Object canPackageSum) {
this.canPackageSum = canPackageSum;
}
public String getLaunchDeptName() {
return launchDeptName;
}
public void setLaunchDeptName(String launchDeptName) {
this.launchDeptName = launchDeptName;
}
public Object getLaunchDeptId() {
return launchDeptId;
}
public void setLaunchDeptId(Object launchDeptId) {
this.launchDeptId = launchDeptId;
}
public String getReceiveDeptName() {
return receiveDeptName;
}
public void setReceiveDeptName(String receiveDeptName) {
this.receiveDeptName = receiveDeptName;
}
public Object getCustomerId() {
return customerId;
}
public void setCustomerId(Object customerId) {
this.customerId = customerId;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getProductOfKind() {
return productOfKind;
}
public void setProductOfKind(String productOfKind) {
this.productOfKind = productOfKind;
}
public double getCanInvoiceSum() {
return canInvoiceSum;
}
public void setCanInvoiceSum(double canInvoiceSum) {
this.canInvoiceSum = canInvoiceSum;
}
public Object getOrderType() {
return orderType;
}
public void setOrderType(Object orderType) {
this.orderType = orderType;
}
public Object getCustomerBranchFactoryName() {
return customerBranchFactoryName;
}
public void setCustomerBranchFactoryName(Object customerBranchFactoryName) {
this.customerBranchFactoryName = customerBranchFactoryName;
}
public Object getOrderTypeName() {
return orderTypeName;
}
public void setOrderTypeName(Object orderTypeName) {
this.orderTypeName = orderTypeName;
}
}
}
......@@ -8,197 +8,197 @@ import java.util.List;
* github: https://github.com/FlexibleXd
**/
public class TicketDetailBean {
/**
* createdBy : 705
* createdByName : null
* createdTime : 2020-03-28 16:00:55
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 59
* applyId : 66
* orderId : AO100012
* productId : 32
* quantity : 1.0
* outProductName : 浸入式水口(方坯)
* invoiceUnitPrice : 850.0
* productName : 浸入式水口(方坯)
* productSoleCode : 70LTJ568-1001
* productSimpleCode : J568-1
* productSpec : 90
* productUnit : 支
* productWeight : 0.0
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private int applyId;
private String orderId;
private int productId;
private double quantity;
private String outProductName;
private double invoiceUnitPrice;
private String productName;
private String productSoleCode;
private String productSimpleCode;
private String productSpec;
private String productUnit;
private double productWeight;
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 getApplyId() {
return applyId;
}
public void setApplyId(int applyId) {
this.applyId = applyId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public String getOutProductName() {
return outProductName;
}
public void setOutProductName(String outProductName) {
this.outProductName = outProductName;
}
/**
* createdBy : 705
* createdByName : null
* createdTime : 2020-03-28 16:00:55
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 59
* applyId : 66
* orderId : AO100012
* productId : 32
* quantity : 1.0
* outProductName : 浸入式水口(方坯)
* invoiceUnitPrice : 850.0
* productName : 浸入式水口(方坯)
* productSoleCode : 70LTJ568-1001
* productSimpleCode : J568-1
* productSpec : 90
* productUnit : 支
* productWeight : 0.0
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private int applyId;
private String orderId;
private int productId;
private double quantity;
private String outProductName;
private double invoiceUnitPrice;
private String productName;
private String productSoleCode;
private String productSimpleCode;
private String productSpec;
private String productUnit;
private double productWeight;
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 getApplyId() {
return applyId;
}
public void setApplyId(int applyId) {
this.applyId = applyId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public String getOutProductName() {
return outProductName;
}
public double getInvoiceUnitPrice() {
return invoiceUnitPrice;
}
public void setOutProductName(String outProductName) {
this.outProductName = outProductName;
}
public void setInvoiceUnitPrice(double invoiceUnitPrice) {
this.invoiceUnitPrice = invoiceUnitPrice;
}
public double getInvoiceUnitPrice() {
return invoiceUnitPrice;
}
public String getProductName() {
return productName;
}
public void setInvoiceUnitPrice(double invoiceUnitPrice) {
this.invoiceUnitPrice = invoiceUnitPrice;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public String getProductSoleCode() {
return productSoleCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public void setProductSoleCode(String productSoleCode) {
this.productSoleCode = productSoleCode;
}
public String getProductSoleCode() {
return productSoleCode;
}
public String getProductSimpleCode() {
return productSimpleCode;
}
public void setProductSoleCode(String productSoleCode) {
this.productSoleCode = productSoleCode;
}
public void setProductSimpleCode(String productSimpleCode) {
this.productSimpleCode = productSimpleCode;
}
public String getProductSimpleCode() {
return productSimpleCode;
}
public String getProductSpec() {
return productSpec;
}
public void setProductSimpleCode(String productSimpleCode) {
this.productSimpleCode = productSimpleCode;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public String getProductSpec() {
return productSpec;
}
public String getProductUnit() {
return productUnit;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public void setProductUnit(String productUnit) {
this.productUnit = productUnit;
}
public String getProductUnit() {
return productUnit;
}
public double getProductWeight() {
return productWeight;
}
public void setProductUnit(String productUnit) {
this.productUnit = productUnit;
}
public double getProductWeight() {
return productWeight;
}
public void setProductWeight(double productWeight) {
this.productWeight = productWeight;
}
public void setProductWeight(double productWeight) {
this.productWeight = productWeight;
}
}
......@@ -539,7 +539,7 @@ public interface ApiService {
* @return
*/
@GET("/invoiceApply/po/exam")
Observable<BaseBean> poExam(@QueryMap Map<String, Object> param );
Observable<BaseBean> poExam(@QueryMap Map<String, Object> param);
/**
* co开票审核
......@@ -547,14 +547,15 @@ public interface ApiService {
* @return
*/
@GET("/invoiceApply/co/exam")
Observable<BaseBean> coExam(@QueryMap Map<String, Object> param );
Observable<BaseBean> coExam(@QueryMap Map<String, Object> param);
/**
* Fo收票审核
*
* @return
*/
@GET("/receiptInvoiceApply/fo/exam")
Observable<BaseBean> receiveFoExam(@QueryMap Map<String, Object> param );
Observable<BaseBean> receiveFoExam(@QueryMap Map<String, Object> param);
/**
* po收票审核
......@@ -562,7 +563,7 @@ public interface ApiService {
* @return
*/
@GET("/receiptInvoiceApply/po/exam")
Observable<BaseBean> receivePoExam(@QueryMap Map<String, Object> param );
Observable<BaseBean> receivePoExam(@QueryMap Map<String, Object> param);
/**
* 外采购收票分页列表
......@@ -580,6 +581,7 @@ public interface ApiService {
*/
@GET("/receiptInvoiceApply/fo/page/list")
Observable<BaseBean> receiveFoTicket(@QueryMap Map<String, Object> param);
/**
* 库存数量:一个仓库里的产品列表
*
......@@ -678,7 +680,7 @@ public interface ApiService {
* @return
*/
@GET("/invoice-apply/item/list")
Observable<BaseBean> ticketDetail(@Query("applyId")String applyId );
Observable<BaseBean> ticketDetail(@Query("applyId") String applyId);
/**
* 发票明细列表
......@@ -686,7 +688,7 @@ public interface ApiService {
* @return
*/
@GET("/receiptInvoiceApplyItem/list")
Observable<BaseBean> ticketReceiveDetail(@Query("applyId")String applyId );
Observable<BaseBean> ticketReceiveDetail(@Query("applyId") String applyId);
/**
* 获取运费开票详情(开票的运费记录)
......@@ -694,14 +696,15 @@ public interface ApiService {
* @return
*/
@GET("/finance-logistics-apply/detail/page/list")
Observable<BaseBean> logisticsDetail(@Query("applyId")String applyId );
Observable<BaseBean> logisticsDetail(@Query("applyId") String applyId);
/**
* 审批开票申请
*id
* id
* status 未处理:0 通过:1 驳回:2
* remark
* invoiceNumber
*
* @return
*/
@PUT("/finance-logistics-apply")
......@@ -710,29 +713,75 @@ public interface ApiService {
/**
* 审批开票申请
*orderType
* orderType
* applyAmount
* applyDept
* customerId
* process
* applyRemark
*
* @return
*/
@POST("/moneyBackApply/apply")
Observable<BaseBean> moneyBackApply(@Body RequestBody requestBody);
/**
* 审批开票申请
*orderType
* orderType
* applyAmount
* applyDept
* customerId
* process
* applyRemark
*
* @return
*/
@POST("/moneyPayApply/apply")
Observable<BaseBean> moneyPayApply(@Body RequestBody requestBody);
/**
* 为开票查询的订单
* customerId
* launchDeptId
* searchValue
*
* @return
*/
@GET("/saleOrder/forInvoice")
Observable<BaseBean> saleTicketOrder(@QueryMap Map<String, Object> param);
/**
* 为组装查询的订单
* customerId
* launchDeptId
* searchValue
*
* @return
*/
@GET("/package-order/item/page/list")
Observable<BaseBean> packageTicketOrder(@QueryMap Map<String, Object> param);
/**
* 为外采购查询的订单
* customerId
* launchDeptId
* searchValue
*
* @return
*/
@GET("/purchaseOrder/forInvoice")
Observable<BaseBean> purchaseTicketOrder(@QueryMap Map<String, Object> param);
/**
* /**
* 坩埚订单
* customerId
* launchDeptId
* searchValue
*
* @return
*/
@GET("/crucibleSaleOrder/forInvoice")
Observable<BaseBean> crucibleTicketOrder(@QueryMap Map<String, Object> param);
}
package com.wd.workoffice.ui.activity.bat.work;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.ProPriceBean;
import com.wd.workoffice.bean.TicketAddBean;
import com.wd.workoffice.bean.TicketDetailBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleCarActivity;
import com.wd.workoffice.ui.adapter.WorkAddTicketOrderAdapter;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
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 io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* 财务 开票 选择产品
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkChooseProductActivity extends WorkToolBarActivity {
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_ok)
TextView tvOk;
@BindView(R.id.ll_bottom)
RelativeLayout llBottom;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
private Map<String, Object> param;
private List<TicketAddBean.RecordsBean> clientList;
private WorkAddTicketOrderAdapter clientAdapter;
private int page = 1;
private List<TicketAddBean.RecordsBean> carList = new ArrayList<>();
@Override
protected void initView() {
ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
private void openDialog(TicketAddBean.RecordsBean data, int position) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
TextView tvDesc = view.findViewById(R.id.tv_desc);
tvDesc.setText("开票价格");
AddAndReduceView num = view.findViewById(R.id.ar_num);
EditText etPrice = view.findViewById(R.id.et_price);
for (TicketAddBean.RecordsBean recordsBean : carList) {
if (data.getId() == recordsBean.getId()) {
etPrice.setText(recordsBean.getCarPrice());
num.setNumber(recordsBean.getCarNum());
}
}
num.setMaxNum(data.getProductCount());
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(etPrice.getText().toString())) {
toast("请填写开票价格");
return;
}
clientList.get(position).setCarNum(num.getNumber());
clientList.get(position).setCarPrice(etPrice.getText().toString());
clientAdapter.notifyItemChanged(position);
addCart(data, num.getNumber(), etPrice.getText().toString());
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
/**
* 添加购物车
*
* @param chooseProduct 产品
* @param number 数量
* @param price 单价
*/
private void addCart(TicketAddBean.RecordsBean chooseProduct, int number, String price) {
boolean isHas = false;
for (TicketAddBean.RecordsBean recordsBean : carList) {
if (chooseProduct.getId() == recordsBean.getId()) {
isHas = true;
recordsBean.setCarNum(number);
recordsBean.setCarPrice(price);
}
}
if (!isHas) {
chooseProduct.setCarNum(number);
chooseProduct.setCarPrice(price);
carList.add(chooseProduct);
}
toast("加入购物车成功");
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new WorkAddTicketOrderAdapter(R.layout.item_ticket_add_detail, clientList);
clientAdapter.bindToRecyclerView(rvProduct);
param = WorkUtils.pageKey();
param.put("current", 1);
param.put("customerId", getIntent().getStringExtra("customerId"));
param.put("launchDeptId", getIntent().getStringExtra("depId"));
getData();
}
private void getData() {
Observable<BaseBean> observable;
if (TextUtils.equals("销售订单", getIntent().getStringExtra("orderType"))) {
observable = RtfUtils.getRtf().saleTicketOrder(param);
} else if (TextUtils.equals("组装订单", getIntent().getStringExtra("orderType"))) {
observable = RtfUtils.getRtf().packageTicketOrder(param);
} else if (TextUtils.equals("外采购订单", getIntent().getStringExtra("orderType"))) {
observable = RtfUtils.getRtf().purchaseTicketOrder(param);
} else {
observable = RtfUtils.getRtf().crucibleTicketOrder(param);
}
observable.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<TicketAddBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(), TicketAddBean.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();
}
}, rvProduct);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
openDialog(clientList.get(position),position);
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_work_choose_pro;
}
@OnClick({R.id.tv_ok, R.id.btn_search})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_ok:
if (carList.size() == 0) {
toast("购物车没有产品");
return;
}
startActivity(StoreSaleCarActivity.class, "pro", JSON.toJSONString(carList),
"subProcess", getIntent().getStringExtra("subProcess"), "customerId", getIntent().getStringExtra("transitPartId"),
"receiveDeptId", getIntent().getStringExtra("depId"), "code", getIntent().getStringExtra("code"));
break;
case R.id.btn_search:
param.put("name", etKey.getText().toString());
param.put("current", 1);
page = 1;
getData();
break;
}
}
}
......@@ -189,7 +189,7 @@ public class WorkFinancialReceiveTicketActivity extends WorkToolBarActivity {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.add:
// startActivity(WorkInStockSearchActivity.class);
startActivity(WorkFinancialReceiveTicketAddActivity.class);
break;
}
return super.onOptionsItemSelected(item);
......
......@@ -45,7 +45,7 @@ public class WorkFinancialReceiveTicketAddActivity extends WorkToolBarActivity {
private Map<String, Object> param;
private Integer clientId;
private QMUIDialog.MenuDialogBuilder typeDialog;
String[] typeList = new String[]{"外采购订单", "供应"};
String[] typeList = new String[]{"外采购订单", "供应订单"};
private String chooseType;
private Integer depId;
......@@ -75,7 +75,7 @@ public class WorkFinancialReceiveTicketAddActivity extends WorkToolBarActivity {
@Override
protected int layoutId() {
return R.layout.activity_open_ticke_addt;
return R.layout.activity_receive_ticket_add;
}
......@@ -127,7 +127,7 @@ public class WorkFinancialReceiveTicketAddActivity extends WorkToolBarActivity {
break;
case R.id.rl_client:
startActivityForResult(StoreSaleClientActivity.class, 10001,
"code", "SUPPLIER");
"code", "SUPPLIER","supplier","选择供应商");
break;
}
}
......
......@@ -93,7 +93,6 @@ public class WorkFinancialReceiveTicketDetailActivity extends WorkToolBarActivit
param = new HashMap<>();
param.put("id", getIntent().getStringExtra("id"));
orderType = getIntent().getStringExtra("type");
}
private void getData(String id) {
......
......@@ -10,6 +10,7 @@ import android.widget.TextView;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.WorkUtils;
......@@ -75,11 +76,10 @@ public class WorkFinancialTicketAddActivity extends WorkToolBarActivity {
@Override
protected int layoutId() {
return R.layout.activity_open_ticke_addt;
return R.layout.activity_open_ticket_add;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
......@@ -95,7 +95,6 @@ public class WorkFinancialTicketAddActivity extends WorkToolBarActivity {
}
@OnClick({R.id.tv_next, R.id.rl_order, R.id.rl_dep, R.id.rl_client})
public void onViewClicked(View view) {
switch (view.getId()) {
......@@ -113,13 +112,7 @@ public class WorkFinancialTicketAddActivity extends WorkToolBarActivity {
toast("请先选择客户");
return;
}
// param.put("process", PermissionType.);
// param.put("applyRemark", etRemark.getText().toString());
// param.put("applyDept", UserKeeper.getInstance().getUserDepId());
// param.put("orderType", chooseType);
// param.put("applyAmount", etPrice.getText().toString());
startActivity(StoreSaleClientActivity.class);
startActivity(WorkChooseProductActivity.class, "orderType", tvOrder.getText().toString(), "depId", "" + "", "customerId", clientId + "");
break;
case R.id.rl_order:
typeDialog.show();
......
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.TicketAddBean;
import com.wd.workoffice.bean.TicketDetailBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkAddTicketOrderAdapter extends BaseQuickAdapter<TicketAddBean.RecordsBean, BaseViewHolder> {
public WorkAddTicketOrderAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, TicketAddBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getProductSimpleCode());
helper.setText(R.id.tv_order, item.getOrderId());
helper.setText(R.id.tv_spec, item.getProductSpec());
helper.setText(R.id.tv_unit, item.getProductUnit());
helper.setText(R.id.tv_apply_num, item.getProductCount()+"");
helper.setText(R.id.tv_price, item.getCarPrice());
helper.setText(R.id.tv_num, item.getCarNum()+"");
}
}
......@@ -11,12 +11,16 @@ import android.widget.Toast;
import com.wd.workoffice.R;
import flexible.xd.android_base.utils.ToastUtil;
public class AddAndReduceView extends LinearLayout implements View.OnClickListener {
private final Button add;
private final Button remove;
private final TextView tvNum;
private int num = 1;
private int maxNum = 10000;
public AddAndReduceView(Context context, AttributeSet attrs) {
super(context, attrs);
......@@ -44,6 +48,10 @@ public class AddAndReduceView extends LinearLayout implements View.OnClickListen
num = Integer.parseInt(s);
switch (v.getId()) {
case R.id.btn_add:
if (num == maxNum) {
ToastUtil.showShort("目前已选择最大数量");
return;
}
num++;
tvNum.setText(num + "");
if (mOnNumberChangedListener != null)
......@@ -65,6 +73,14 @@ public class AddAndReduceView extends LinearLayout implements View.OnClickListen
}
}
public int getMaxNum() {
return maxNum;
}
public void setMaxNum(int maxNum) {
this.maxNum = maxNum;
}
public interface OnNumberChangedListener {
void OnNumberChanged(int vs);
}
......
<?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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="60mm"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15mm"
android:text="共选中 0 件"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="80mm"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/red_btn_bg"
android:gravity="center"
android:text="申请下单"
android:textColor="@color/white" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_client_search"
android:gravity="center_vertical"
android:paddingHorizontal="10mm">
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/client_search" />
<EditText
android:id="@+id/et_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2mm"
android:background="@null"
android:hint="搜索图号/品名/规则/品号"
android:maxLines="1"
android:textColor="#91ABBA"
android:textColorHint="#91ABBA"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_search"
android:layout_width="60mm"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@color/mainTextColor"
android:text="搜索"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_product"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
</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:layout_centerHorizontal="true"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingTop="10mm"
android:paddingBottom="20mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:text="邢台德龙钢铁客户"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<RelativeLayout
android:id="@+id/rl_dep"
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_order"
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_spec"
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_unit"
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_apply_num"
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>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开单单价:"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15mm"
android:text="申请数量:"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<ImageView
android:layout_width="25mm"
android:layout_height="25mm"
android:layout_gravity="right"
android:src="@mipmap/ticket_add_cart" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -24,6 +24,7 @@
android:paddingHorizontal="20mm">
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论