提交 217c3b4e authored 作者: lgd's avatar lgd

1.产品弹窗,上下架需要在调试

2.//TODO erp用户激活,忘记密码测试,产品详情数据调整,搜索具体调试,产品下单,,bat,mes,消息,我的,刷新token
上级 d7095f41
......@@ -4,6 +4,7 @@ import com.wd.workoffice.app.BaseBean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
......@@ -11,15 +12,17 @@ import java.util.List;
**/
public class ProDetail extends BaseBean {
/**
* message : null
* data : {"productInfo":{"createdBy":1,"createdByName":null,"createdTime":"2020-02-24 15:49:48","updatedBy":680,"updatedByName":null,"updatedTime":"2020-03-20 21:09:11","id":40,"soleCode":"产品test","simpleCode":"产品test","name":"产品test","spec":"产品test","unit":"产品test","weight":1,"internalPrice":50,"processType":"外采购流程","processTypeList":null,"productTypeId":3,"ofKind":"外购贴牌","expectOutputDeptId":null,"erpId":"产品test","status":"1","createdUser":null,"shelfAction":null,"updatedUser":null,"outDeptId":null,"outDeptName":null,"productTypeName":"塞棒","expectOutputDeptName":null,"isExpectOut":false,"ofKindName":null,"statusName":null,"relList":null,"outDeptCreatedBy":null,"outDeptCreatedTime":null,"transitPartId":null,"transitPartTypeCode":null,"remark":null},"transitPartRelList":[],"outDeptRelList":[]}
* data : {"productInfo":{"createdBy":111,"createdByName":null,"createdTime":"2020-02-24 10:10:31","updatedBy":111,"updatedByName":null,"updatedTime":"2020-02-24 10:37:08","id":38,"soleCode":"耐火材料","simpleCode":"耐火材料1","name":"耐火材料","spec":"30#1","unit":"吨","weight":51,"internalPrice":78,"processType":"坩埚流程,外采购流程","processTypeList":null,"productTypeId":3,"ofKind":"外购贴牌","expectOutputDeptId":120,"erpId":"耐火材料","status":"0","createdUser":null,"shelfAction":null,"updatedUser":null,"outDeptId":null,"outDeptName":null,"productTypeName":"塞棒","expectOutputDeptName":null,"isExpectOut":true,"ofKindName":null,"statusName":null,"relList":null,"outDeptCreatedBy":null,"outDeptCreatedTime":null,"transitPartId":null,"transitPartTypeCode":null,"remark":null},"transitPartRelList":[{"createdBy":null,"createdByName":null,"createdTime":null,"updatedBy":null,"updatedByName":null,"updatedTime":null,"id":51,"name":"大庆钢铁厂1","contacter":null,"address":"","phone":"13333333333","erpId":"2237","productId":null,"partTypeRelList":null,"processRelList":null,"processList":null,"referProcessList":null,"partTypeNames":null,"partTypeCode":"CUSTOMER","accountId":675,"accountName":"李凯","deptName":"销售四公司","channelPrice":null,"deptIdList":null,"supplier":null,"customer":null,"transporters":null,"processes":null}],"outDeptRelList":[{"id":null,"productId":null,"deptId":null,"createdBy":null,"createdTime":"2020-02-24 15:40:40","deptName":"销售一公司","outByUserName":"冯帆"}]}
* path : null
* ext : null
*/
private DataBean data;
@Override
public DataBean getData() {
return data;
}
......@@ -30,14 +33,14 @@ public class ProDetail extends BaseBean {
public static class DataBean {
/**
* productInfo : {"createdBy":1,"createdByName":null,"createdTime":"2020-02-24 15:49:48","updatedBy":680,"updatedByName":null,"updatedTime":"2020-03-20 21:09:11","id":40,"soleCode":"产品test","simpleCode":"产品test","name":"产品test","spec":"产品test","unit":"产品test","weight":1,"internalPrice":50,"processType":"外采购流程","processTypeList":null,"productTypeId":3,"ofKind":"外购贴牌","expectOutputDeptId":null,"erpId":"产品test","status":"1","createdUser":null,"shelfAction":null,"updatedUser":null,"outDeptId":null,"outDeptName":null,"productTypeName":"塞棒","expectOutputDeptName":null,"isExpectOut":false,"ofKindName":null,"statusName":null,"relList":null,"outDeptCreatedBy":null,"outDeptCreatedTime":null,"transitPartId":null,"transitPartTypeCode":null,"remark":null}
* transitPartRelList : []
* outDeptRelList : []
* productInfo : {"createdBy":111,"createdByName":null,"createdTime":"2020-02-24 10:10:31","updatedBy":111,"updatedByName":null,"updatedTime":"2020-02-24 10:37:08","id":38,"soleCode":"耐火材料","simpleCode":"耐火材料1","name":"耐火材料","spec":"30#1","unit":"吨","weight":51,"internalPrice":78,"processType":"坩埚流程,外采购流程","processTypeList":null,"productTypeId":3,"ofKind":"外购贴牌","expectOutputDeptId":120,"erpId":"耐火材料","status":"0","createdUser":null,"shelfAction":null,"updatedUser":null,"outDeptId":null,"outDeptName":null,"productTypeName":"塞棒","expectOutputDeptName":null,"isExpectOut":true,"ofKindName":null,"statusName":null,"relList":null,"outDeptCreatedBy":null,"outDeptCreatedTime":null,"transitPartId":null,"transitPartTypeCode":null,"remark":null}
* transitPartRelList : [{"createdBy":null,"createdByName":null,"createdTime":null,"updatedBy":null,"updatedByName":null,"updatedTime":null,"id":51,"name":"大庆钢铁厂1","contacter":null,"address":"","phone":"13333333333","erpId":"2237","productId":null,"partTypeRelList":null,"processRelList":null,"processList":null,"referProcessList":null,"partTypeNames":null,"partTypeCode":"CUSTOMER","accountId":675,"accountName":"李凯","deptName":"销售四公司","channelPrice":null,"deptIdList":null,"supplier":null,"customer":null,"transporters":null,"processes":null}]
* outDeptRelList : [{"id":null,"productId":null,"deptId":null,"createdBy":null,"createdTime":"2020-02-24 15:40:40","deptName":"销售一公司","outByUserName":"冯帆"}]
*/
private ProductInfoBean productInfo;
private List<?> transitPartRelList;
private List<?> outDeptRelList;
private List<TransitPartRelListBean> transitPartRelList;
private List<OutDeptRelListBean> outDeptRelList;
public ProductInfoBean getProductInfo() {
return productInfo;
......@@ -47,45 +50,45 @@ public class ProDetail extends BaseBean {
this.productInfo = productInfo;
}
public List<?> getTransitPartRelList() {
public List<TransitPartRelListBean> getTransitPartRelList() {
return transitPartRelList;
}
public void setTransitPartRelList(List<?> transitPartRelList) {
public void setTransitPartRelList(List<TransitPartRelListBean> transitPartRelList) {
this.transitPartRelList = transitPartRelList;
}
public List<?> getOutDeptRelList() {
public List<OutDeptRelListBean> getOutDeptRelList() {
return outDeptRelList;
}
public void setOutDeptRelList(List<?> outDeptRelList) {
public void setOutDeptRelList(List<OutDeptRelListBean> outDeptRelList) {
this.outDeptRelList = outDeptRelList;
}
public static class ProductInfoBean {
/**
* createdBy : 1
* createdBy : 111
* createdByName : null
* createdTime : 2020-02-24 15:49:48
* updatedBy : 680
* createdTime : 2020-02-24 10:10:31
* updatedBy : 111
* updatedByName : null
* updatedTime : 2020-03-20 21:09:11
* id : 40
* soleCode : 产品test
* simpleCode : 产品test
* name : 产品test
* spec : 产品test
* unit : 产品test
* weight : 1.0
* internalPrice : 50.0
* processType : 外采购流程
* updatedTime : 2020-02-24 10:37:08
* id : 38
* soleCode : 耐火材料
* simpleCode : 耐火材料1
* name : 耐火材料
* spec : 30#1
* unit :
* weight : 51.0
* internalPrice : 78.0
* processType : 坩埚流程,外采购流程
* processTypeList : null
* productTypeId : 3
* ofKind : 外购贴牌
* expectOutputDeptId : null
* erpId : 产品test
* status : 1
* expectOutputDeptId : 120
* erpId : 耐火材料
* status : 0
* createdUser : null
* shelfAction : null
* updatedUser : null
......@@ -93,7 +96,7 @@ public class ProDetail extends BaseBean {
* outDeptName : null
* productTypeName : 塞棒
* expectOutputDeptName : null
* isExpectOut : false
* isExpectOut : true
* ofKindName : null
* statusName : null
* relList : null
......@@ -122,7 +125,7 @@ public class ProDetail extends BaseBean {
private Object processTypeList;
private int productTypeId;
private String ofKind;
private Object expectOutputDeptId;
private int expectOutputDeptId;
private String erpId;
private String status;
private Object createdUser;
......@@ -286,11 +289,11 @@ public class ProDetail extends BaseBean {
this.ofKind = ofKind;
}
public Object getExpectOutputDeptId() {
public int getExpectOutputDeptId() {
return expectOutputDeptId;
}
public void setExpectOutputDeptId(Object expectOutputDeptId) {
public void setExpectOutputDeptId(int expectOutputDeptId) {
this.expectOutputDeptId = expectOutputDeptId;
}
......@@ -438,5 +441,367 @@ public class ProDetail extends BaseBean {
this.remark = remark;
}
}
public static class TransitPartRelListBean {
/**
* createdBy : null
* createdByName : null
* createdTime : null
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 51
* name : 大庆钢铁厂1
* contacter : null
* address :
* phone : 13333333333
* erpId : 2237
* productId : null
* partTypeRelList : null
* processRelList : null
* processList : null
* referProcessList : null
* partTypeNames : null
* partTypeCode : CUSTOMER
* accountId : 675
* accountName : 李凯
* deptName : 销售四公司
* channelPrice : null
* deptIdList : null
* supplier : null
* customer : null
* transporters : null
* processes : null
*/
private Object createdBy;
private Object createdByName;
private Object createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private String name;
private Object contacter;
private String address;
private String phone;
private String erpId;
private Object productId;
private Object partTypeRelList;
private Object processRelList;
private Object processList;
private Object referProcessList;
private Object partTypeNames;
private String partTypeCode;
private int accountId;
private String accountName;
private String deptName;
private String channelPrice;
private Object deptIdList;
private Object supplier;
private Object customer;
private Object transporters;
private Object processes;
public Object getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Object createdBy) {
this.createdBy = createdBy;
}
public Object getCreatedByName() {
return createdByName;
}
public void setCreatedByName(Object createdByName) {
this.createdByName = createdByName;
}
public Object getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Object 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 getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getContacter() {
return contacter;
}
public void setContacter(Object contacter) {
this.contacter = contacter;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getErpId() {
return erpId;
}
public void setErpId(String erpId) {
this.erpId = erpId;
}
public Object getProductId() {
return productId;
}
public void setProductId(Object productId) {
this.productId = productId;
}
public Object getPartTypeRelList() {
return partTypeRelList;
}
public void setPartTypeRelList(Object partTypeRelList) {
this.partTypeRelList = partTypeRelList;
}
public Object getProcessRelList() {
return processRelList;
}
public void setProcessRelList(Object processRelList) {
this.processRelList = processRelList;
}
public Object getProcessList() {
return processList;
}
public void setProcessList(Object processList) {
this.processList = processList;
}
public Object getReferProcessList() {
return referProcessList;
}
public void setReferProcessList(Object referProcessList) {
this.referProcessList = referProcessList;
}
public Object getPartTypeNames() {
return partTypeNames;
}
public void setPartTypeNames(Object partTypeNames) {
this.partTypeNames = partTypeNames;
}
public String getPartTypeCode() {
return partTypeCode;
}
public void setPartTypeCode(String partTypeCode) {
this.partTypeCode = partTypeCode;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getChannelPrice() {
return channelPrice;
}
public void setChannelPrice(String channelPrice) {
this.channelPrice = channelPrice;
}
public Object getDeptIdList() {
return deptIdList;
}
public void setDeptIdList(Object deptIdList) {
this.deptIdList = deptIdList;
}
public Object getSupplier() {
return supplier;
}
public void setSupplier(Object supplier) {
this.supplier = supplier;
}
public Object getCustomer() {
return customer;
}
public void setCustomer(Object customer) {
this.customer = customer;
}
public Object getTransporters() {
return transporters;
}
public void setTransporters(Object transporters) {
this.transporters = transporters;
}
public Object getProcesses() {
return processes;
}
public void setProcesses(Object processes) {
this.processes = processes;
}
}
public static class OutDeptRelListBean {
/**
* id : null
* productId : null
* deptId : null
* createdBy : null
* createdTime : 2020-02-24 15:40:40
* deptName : 销售一公司
* outByUserName : 冯帆
*/
private Object id;
private Object productId;
private Object deptId;
private Object createdBy;
private String createdTime;
private String deptName;
private String outByUserName;
public Object getId() {
return id;
}
public void setId(Object id) {
this.id = id;
}
public Object getProductId() {
return productId;
}
public void setProductId(Object productId) {
this.productId = productId;
}
public Object getDeptId() {
return deptId;
}
public void setDeptId(Object deptId) {
this.deptId = deptId;
}
public Object getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Object createdBy) {
this.createdBy = createdBy;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getOutByUserName() {
return outByUserName;
}
public void setOutByUserName(String outByUserName) {
this.outByUserName = outByUserName;
}
}
}
}
......@@ -154,7 +154,7 @@ public class ProductBean {
private Object updatedUser;
private Object outDeptId;
private Object outDeptName;
private Object productTypeName;
private String productTypeName;
private Object expectOutputDeptName;
private Object isExpectOut;
private Object ofKindName;
......@@ -392,11 +392,11 @@ public class ProductBean {
this.outDeptName = outDeptName;
}
public Object getProductTypeName() {
public String getProductTypeName() {
return productTypeName;
}
public void setProductTypeName(Object productTypeName) {
public void setProductTypeName(String productTypeName) {
this.productTypeName = productTypeName;
}
......
......@@ -22,13 +22,25 @@ import io.reactivex.Observable;
public interface WorkProContract {
interface Model extends IBaseModel {
Observable<BaseBean> getPro(Map<String, Object> param);
Observable<BaseBean> modify(Integer id, String internalPrice, String remark);
Observable<BaseBean> onSale(Integer id, String shelfAction);
}
interface View extends IBaseView {
void getPro(List<ProductBean.RecordsBean> dataList);
void modify(String msg);
void onSale(String msg);
}
interface Presenter extends IBasePresenter<View> {
void getPro(Map<String, Object> param);
void modify(Integer id, String internalPrice, String remark);
void onSale(Integer id, String shelfAction);
}
}
......@@ -3,7 +3,9 @@ package com.wd.workoffice.model;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.contract.WorkProContract;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.util.WorkUtils;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.Observable;
......@@ -19,6 +21,23 @@ public class WorkProModel implements WorkProContract.Model {
return RtfUtils.getRtf().getPro(param);
}
@Override
public Observable<BaseBean> modify(Integer id, String internalPrice, String remark) {
Map<String,Object> param =new HashMap<>();
param.put("id",id);
param.put("internalPrice",internalPrice);
param.put("remark",remark);
return RtfUtils.getRtf().modifyProPrice( WorkUtils.convertMapToBody(param));
}
@Override
public Observable<BaseBean> onSale(Integer id, String shelfAction) {
Map<String,Object> param =new HashMap<>();
param.put("id",id);
param.put("shelfAction",shelfAction);
return RtfUtils.getRtf().onSalePro(WorkUtils.convertMapToBody(param));
}
public static WorkProModel newInstance() {
return new WorkProModel();
}
......
......@@ -48,6 +48,60 @@ public class WorkProPresenter extends BasePresenter<WorkProContract.View, WorkPr
});
}
@Override
public void modify(Integer id, String internalPrice, String remark) {
mView.showLoading();
mModel.modify(id, internalPrice, remark).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
mDisposable.add(d);
}
@Override
public void onFail(String errorMsg) {
mView.hideLoading();
mView.onError(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
mView.hideLoading();
if (data.getCode() != 0) {
mView.onError(data.getMessage());
return;
}
mView.modify(data.getMessage());
}
});
}
@Override
public void onSale(Integer id, String shelfAction) {
mView.showLoading();
mModel.onSale(id, shelfAction).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
mDisposable.add(d);
}
@Override
public void onFail(String errorMsg) {
mView.hideLoading();
mView.onError(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
mView.hideLoading();
if (data.getCode() != 0) {
mView.onError(data.getMessage());
return;
}
mView.onSale(data.getMessage());
}
});
}
@Override
public WorkProContract.Model bindModel() {
return WorkProModel.newInstance();
......
......@@ -225,8 +225,8 @@ public interface ApiService {
/**
* 根据往来单位的类别 获取当前用户所维护的往来单位列表
*
* @param name
* @param partTypeCode partTypeCode:SUPPLIER-供应商
* name
* partTypeCode partTypeCode:SUPPLIER-供应商
* * CUSTOMER-客户
* * TRANSPORTERS-运输商
* @return
......@@ -237,8 +237,8 @@ public interface ApiService {
/**
* 根据关联往来单位(类别为客户)和生产厂(产品上架部门) --> 获取产品列表
*
* @param outDeptId
* @param transitPartId 销售订单(客户id),外采购订单(供应商id)
* outDeptId
* transitPartId 销售订单(客户id),外采购订单(供应商id)
* <p>
* processType 销售流程PROCESS_SALE
* 外采购流程PROCESS_PURCHAS
......@@ -250,9 +250,9 @@ public interface ApiService {
/**
* 仓库
*
* @param deptId
* @param customerId
* @param sign 固定值send
* deptId
* customerId
* sign 固定值send
* 供应 参数是3个
* 坩埚的话 内部交易一个参数 deptId
* @return
......@@ -272,14 +272,14 @@ public interface ApiService {
/**
* 订单
*
* @param orderStatus app端订单筛选:
* orderStatus app端订单筛选:
* 100:待审核
* 200:待接单
* 710: 待生产 (已接单、申请提前结束)
* 500:已入库
* 600: 已交付
* 960:已关闭 (审核失败、已拒单、已提前结束)
* @param identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* @return
*/
@GET("/saleOrder/current-user/page/list")
......@@ -288,14 +288,14 @@ public interface ApiService {
/**
* 外采购订单
*
* @param orderStatus app端订单筛选:
* orderStatus app端订单筛选:
* 100:待审核
* 200:待接单
* 300 + 410 = 710: 待生产 (已接单、申请提前结束)
* 500:已入库
* 600: 已交付
* 220 + 320 + 420 = 960 :已关闭 (审核失败、已拒单、已提前结束)
* @param identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* @return
*/
@GET("/purchaseOrder/current-user/page/list")
......@@ -304,14 +304,14 @@ public interface ApiService {
/**
* 内部
*
* @param orderStatus app端订单筛选:
* orderStatus app端订单筛选:
* 100:待审核
* 200:待接单
* 300 + 410 = 710: 待生产 (已接单、申请提前结束)
* 500:已入库
* 600: 已交付
* 220 + 320 + 420 = 960 :已关闭 (审核失败、已拒单、已提前结束)
* @param identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* @return
*/
@GET("/insideOrder/current-user/page/list")
......@@ -320,13 +320,13 @@ public interface ApiService {
/**
* 供应订单
*
* @param orderStatus app端订单筛选:
* orderStatus app端订单筛选:
* 100:待审核
* 200:待接单
* 300 + 410 = 710: 待生产 (已接单、申请提前结束)
* 500:已入库
* 220 + 320 + 420 = 960 :已关闭 (审核失败、已拒单、已提前结束)
* @param identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* identity 1:作为买家(销售部门) 2:作为卖家(生产部门)
* @return
*/
@GET("/supplierOrder/current-user/page/list")
......@@ -376,4 +376,26 @@ public interface ApiService {
@GET("/product-price-change/page/list")
Observable<BaseBean> getProHistoryPrice(@QueryMap Map<String, Object> param);
/**
* 产品详情
* internalPrice 价格(内部价格)
* id
* remark
*
* @return
*/
@PUT("/product/price")
Observable<BaseBean> modifyProPrice(@Body RequestBody requestBody);
/**
* 上下架
* shelfAction
* id
*
*
* @return
*/
@PUT("/product/app/shelf")
Observable<BaseBean> onSalePro(@Body RequestBody requestBody);
}
......@@ -117,7 +117,6 @@ public class StoreSaleProductActivity extends WorkToolBarActivity {
}
});
addCartDialog.show();
}
/**
......
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ClientBean;
import com.wd.workoffice.bean.ProDetail;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import java.util.List;
import com.wd.workoffice.util.WorkUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
......@@ -70,6 +70,10 @@ public class WorkProDetailActivity extends WorkToolBarActivity {
TextView tvDepPersonPhone;
@BindView(R.id.tv_dep_person_dep)
TextView tvDepPersonDep;
@BindView(R.id.ll_on_sale)
LinearLayout llOnSale;
@BindView(R.id.ll_dep)
LinearLayout llDep;
private ProductBean.RecordsBean proBean;
@Override
......@@ -84,16 +88,16 @@ public class WorkProDetailActivity extends WorkToolBarActivity {
proBean = JSON.parseObject(pro, ProductBean.RecordsBean.class);
getData(proBean.getId());
tvCard.setText(proBean.getSoleCode());
// tvImgCard.setText(proBean.get());
tvImgCard.setText(proBean.getSimpleCode());
tvName.setText(proBean.getName());
tvSpec.setText(proBean.getSpec());
tvClazz.setText(proBean.getProcessType());
tvKind.setText(proBean.getTransitPartTypeCode());
tvClazz.setText(proBean.getProductTypeName());
tvKind.setText(proBean.getOfKind());
tvUnit.setText(proBean.getUnit());
tvWeight.setText(String.valueOf(proBean.getWeight()));
tvPrice.setText(String.valueOf(proBean.getInternalPrice()));
tvStatus.setText(proBean.getStatusName());
tvStatus.setText(TextUtils.equals(proBean.getStatus(), "1") ? "正常" : "冻结");
tvProcess.setText(proBean.getProcessType());
}
}
......@@ -116,13 +120,24 @@ public class WorkProDetailActivity extends WorkToolBarActivity {
toast(data.getMessage());
return;
}
// ProDetail.DataBean.ProductInfoBean productInfo = data.getData().getProductInfo();
// tvDep.setText(productInfo.getdep());
// tvDepName.setText(productInfo.getName());
// tvDepType.setText("类别:"+productInfo.getTransitPartTypeCode());
// tvDepType.setText("地址:"+productInfo.get;
// tvDepType.setText(""+productInfo.getName());
// tvDepName.setText(productInfo.getName());
ProDetail.DataBean info = data.getData();
if (info.getOutDeptRelList() != null && info.getOutDeptRelList().size() != 0) {
tvDep.setText(info.getOutDeptRelList().get(0).getDeptName());
llOnSale.setVisibility(View.VISIBLE);
}
if (info.getTransitPartRelList() != null && info.getTransitPartRelList().size() != 0) {
ProDetail.DataBean.TransitPartRelListBean depData = info.getTransitPartRelList().get(0);
llDep.setVisibility(View.VISIBLE);
tvDepName.setText(depData.getName());
tvDepType.setText("类别:" + WorkUtils.getClientType(depData.getPartTypeCode()));
tvDepAddress.setText("地址:" + depData.getAddress());
tvDepPrice.setText("渠道价格:" + (depData.getChannelPrice() == null ? "无" : String.valueOf(depData.getChannelPrice())));
tvDepPerson.setText("维护人:" + depData.getAccountName());
tvDepPersonPhone.setText("维护人手机号:" + depData.getPhone());
tvDepPersonDep.setText("维护部门:" + depData.getDeptName());
}
//
// transitPartRelList 往来单位关联
// * partTypeCode: SUPPLIER-供应商 CUSTOMER-客户 TRANSPORTERS-运输商
// * name:往来单位名称
......@@ -149,6 +164,7 @@ public class WorkProDetailActivity extends WorkToolBarActivity {
@OnClick(R.id.btn_price)
public void onViewClicked() {
startActivity(WorkProPriceActivity.class, "id", proBean.getId()+"");
startActivity(WorkProPriceActivity.class, "id", proBean.getId() + "");
}
}
......@@ -168,4 +168,14 @@ public class WorkProSearchActivity extends WorkBaseActivity implements WorkProCo
}
}
@Override
public void modify(String msg) {
}
@Override
public void onSale(String msg) {
}
}
......@@ -22,7 +22,7 @@ public class WorkProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getSimpleCode());
helper.setText(R.id.tv_card, "品号:"+item.getSoleCode());
// helper.setText(R.id.tv_img_card, "图号:"+item.get());
helper.setText(R.id.tv_img_card, "图号:"+item.getSimpleCode());
helper.setText(R.id.tv_spec, "规格:"+item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice())));
helper.addOnClickListener(R.id.btn_modify);
......
......@@ -2,7 +2,10 @@ package com.wd.workoffice.ui.fg;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
......@@ -18,6 +21,7 @@ import com.wd.workoffice.ui.activity.bat.work.WorkProDetailActivity;
import com.wd.workoffice.ui.adapter.WorkProductAdapter;
import com.wd.workoffice.util.ProFilterData;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import com.wd.workoffice.widget.DropDownMenu;
import java.util.ArrayList;
......@@ -25,6 +29,7 @@ import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
......@@ -138,6 +143,90 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View
startActivity(WorkProDetailActivity.class, "pro", JSON.toJSONString(dataList.get(position)));
}
});
workProductAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
switch (view.getId()) {
case R.id.btn_modify:
openModify(dataList.get(position).getId());
break;
case R.id.btn_on_sale:
openOnSale(dataList.get(position));
break;
}
}
});
}
/**
* 修改弹窗
*
* @param id
*/
private void openModify(int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = LayoutInflater.from(getActivity()).inflate(R.layout.view_pro_modify_price, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
EditText etPrice = view.findViewById(R.id.et_price);
EditText etRemark = view.findViewById(R.id.et_remark);
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;
}
if (TextUtils.isEmpty(etRemark.getText().toString())) {
toast("请填写备注");
return;
}
workProPresenter.modify(id, etPrice.getText().toString(), etRemark.getText().toString());
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
/**
* 修改上下架
*
* @param data
*/
private void openOnSale(ProductBean.RecordsBean data) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = LayoutInflater.from(getActivity()).inflate(R.layout.view_pro_on_sale, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
TextView tvTitle = view.findViewById(R.id.tv_title);
TextView tvPrice = view.findViewById(R.id.tv_price);
TextView tvName = view.findViewById(R.id.tv_name);
tvPrice.setText(String.valueOf(data.getInternalPrice()).concat("/").concat(data.getUnit()));
tvName.setText(data.getName());
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
workProPresenter.onSale(data.getId(),"down");
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
@Override
......@@ -165,4 +254,16 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View
page++;
}
}
@Override
public void modify(String msg) {
page = 1;
workProPresenter.getPro(param);
toast(msg);
}
@Override
public void onSale(String msg) {
toast(msg);
}
}
......@@ -6,6 +6,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.CountDownTimer;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
......@@ -29,22 +30,41 @@ public class WorkUtils {
/**
* 将map数据转换为 普通的 json RequestBody
*
* @param map 以前的请求参数
* @return
*/
public static RequestBody convertMapToBody(Map<?,?> map) {
public static RequestBody convertMapToBody(Map<?, ?> map) {
return RequestBody.create(MediaType.parse("application/json; charset=utf-8"), JSON.toJSONString(map));
}
public static Map<String, Object> simpleParam() {
Map<String, Object> param = new HashMap<>();
return param;
}
public static Map<String, Object> pageKey() {
Map<String, Object> param = new HashMap<>();
param.put("size", Config.SIZE);
return param;
}
/**
* code: SUPPLIER-供应商 CUSTOMER-客户 TRANSPORTERS-运输商
*
* @param code
* @return
*/
public static String getClientType(String code) {
if (TextUtils.equals("SUPPLIER", code)) {
return "供应商";
} else if (TextUtils.equals("CUSTOMER", code)) {
return "客户";
} else {
return "运输商";
}
}
public static File uriToFile(Uri uri, Context context) {
String path = null;
if ("file".equals(uri.getScheme())) {
......@@ -115,12 +135,13 @@ public class WorkUtils {
@Override
public void onTick(long millisUntilFinished) {
if (code == 0) {
txtTime.setText("( "+String.valueOf(millisUntilFinished / JianGe) + " )");
txtTime.setText("( " + String.valueOf(millisUntilFinished / JianGe) + " )");
txtTime.setTextColor(WorkApp.getApp().getResources().getColor(R.color.flexible_text_gray));
} else {
txtTime.setText("跳过 " + String.valueOf(millisUntilFinished / JianGe) + "s");
}
}
@Override
public void onFinish() {
if (code == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论