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

1.上下架

2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级 26210863
...@@ -126,6 +126,7 @@ public class ProductBean { ...@@ -126,6 +126,7 @@ public class ProductBean {
* transitPartId : null * transitPartId : null
* transitPartTypeCode : null * transitPartTypeCode : null
* remark : null * remark : null
*
*/ */
private int createdBy; private int createdBy;
...@@ -156,7 +157,7 @@ public class ProductBean { ...@@ -156,7 +157,7 @@ public class ProductBean {
private Object outDeptName; private Object outDeptName;
private String productTypeName; private String productTypeName;
private Object expectOutputDeptName; private Object expectOutputDeptName;
private Object isExpectOut; private int isExpectOut;
private Object ofKindName; private Object ofKindName;
private String statusName; private String statusName;
private Object relList; private Object relList;
...@@ -425,11 +426,11 @@ public class ProductBean { ...@@ -425,11 +426,11 @@ public class ProductBean {
this.expectOutputDeptName = expectOutputDeptName; this.expectOutputDeptName = expectOutputDeptName;
} }
public Object getIsExpectOut() { public int getIsExpectOut() {
return isExpectOut; return isExpectOut;
} }
public void setIsExpectOut(Object isExpectOut) { public void setIsExpectOut(int isExpectOut) {
this.isExpectOut = isExpectOut; this.isExpectOut = isExpectOut;
} }
......
...@@ -35,7 +35,7 @@ public class WorkProModel implements WorkProContract.Model { ...@@ -35,7 +35,7 @@ public class WorkProModel implements WorkProContract.Model {
Map<String,Object> param =new HashMap<>(); Map<String,Object> param =new HashMap<>();
param.put("id",id); param.put("id",id);
param.put("shelfAction",shelfAction); param.put("shelfAction",shelfAction);
return RtfUtils.getRtf().onSalePro(WorkUtils.convertMapToBody(param)); return RtfUtils.getRtf().onSalePro(param);
} }
public static WorkProModel newInstance() { public static WorkProModel newInstance() {
......
...@@ -403,8 +403,8 @@ public interface ApiService { ...@@ -403,8 +403,8 @@ public interface ApiService {
* @return * @return
*/ */
@PUT("/product/app/shelf") @PUT("/product/app/shelf")
Observable<BaseBean> onSalePro(@Body RequestBody requestBody); // Observable<BaseBean> onSalePro(@Body RequestBody requestBody);
Observable<BaseBean> onSalePro(@QueryMap Map<String, Object> param);
/** /**
* 下单 * 下单
* <p> * <p>
......
package com.wd.workoffice.ui.activity.bat.work; package com.wd.workoffice.ui.activity.bat.work;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity; import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.bean.ContactsBean; import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.contract.WorkContactsContract; import com.wd.workoffice.contract.WorkContactsContract;
import com.wd.workoffice.contract.WorkProContract;
import com.wd.workoffice.presenter.WorkContactsPresenter; import com.wd.workoffice.presenter.WorkContactsPresenter;
import com.wd.workoffice.presenter.WorkProPresenter;
import com.wd.workoffice.ui.adapter.WorkContactsAdapter; import com.wd.workoffice.ui.adapter.WorkContactsAdapter;
import com.wd.workoffice.ui.adapter.WorkProductAdapter;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
......
...@@ -21,12 +21,17 @@ public class WorkProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean ...@@ -21,12 +21,17 @@ public class WorkProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean
@Override @Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) { protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getSimpleCode()); helper.setText(R.id.tv_name, item.getSimpleCode());
helper.setText(R.id.tv_card, "品号:"+item.getSoleCode()); helper.setText(R.id.tv_card, "品号:" + item.getSoleCode());
helper.setText(R.id.tv_img_card, "图号:"+item.getSimpleCode()); helper.setText(R.id.tv_img_card, "图号:" + item.getSimpleCode());
helper.setText(R.id.tv_spec, "规格:"+item.getSpec()); helper.setText(R.id.tv_spec, "规格:" + item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice()))); helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice())));
helper.addOnClickListener(R.id.btn_modify); helper.addOnClickListener(R.id.btn_modify);
helper.addOnClickListener(R.id.btn_on_sale); helper.addOnClickListener(R.id.btn_on_sale);
if (item.getIsExpectOut() == 0) {//未上架
helper.setText(R.id.btn_on_sale, "上架");
} else {
helper.setText(R.id.btn_on_sale, "下架");
}
} }
} }
package com.wd.workoffice.ui.fg; package com.wd.workoffice.ui.fg;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg; import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.ContactsBean; import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.listener.ProFilterClickListener;
import com.wd.workoffice.contract.WorkContactsContract; import com.wd.workoffice.contract.WorkContactsContract;
import com.wd.workoffice.contract.WorkProContract;
import com.wd.workoffice.presenter.WorkContactsPresenter; import com.wd.workoffice.presenter.WorkContactsPresenter;
import com.wd.workoffice.presenter.WorkProPresenter;
import com.wd.workoffice.ui.activity.bat.work.WorkProDetailActivity;
import com.wd.workoffice.ui.adapter.WorkContactsAdapter; import com.wd.workoffice.ui.adapter.WorkContactsAdapter;
import com.wd.workoffice.ui.adapter.WorkProductAdapter;
import com.wd.workoffice.util.ProFilterData;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.DropDownMenu;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView; import butterknife.BindView;
......
...@@ -209,6 +209,15 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View ...@@ -209,6 +209,15 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View
TextView tvOk = view.findViewById(R.id.tv_ok); TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel); TextView tvCancel = view.findViewById(R.id.tv_cancel);
TextView tvTitle = view.findViewById(R.id.tv_title); TextView tvTitle = view.findViewById(R.id.tv_title);
String shelfAction;
if (data.getIsExpectOut() == 0) {//未上架
tvTitle.setText("确认上架?");
shelfAction="up";
} else {
tvTitle.setText( "确认下架?");
shelfAction="down";
}
TextView tvPrice = view.findViewById(R.id.tv_price); TextView tvPrice = view.findViewById(R.id.tv_price);
TextView tvName = view.findViewById(R.id.tv_name); TextView tvName = view.findViewById(R.id.tv_name);
tvPrice.setText(String.valueOf(data.getInternalPrice()).concat("/").concat(data.getUnit())); tvPrice.setText(String.valueOf(data.getInternalPrice()).concat("/").concat(data.getUnit()));
...@@ -218,7 +227,7 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View ...@@ -218,7 +227,7 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
workProPresenter.onSale(data.getId(), "down"); workProPresenter.onSale(data.getId(), shelfAction);
addCartDialog.dismiss(); addCartDialog.dismiss();
} }
}); });
...@@ -260,6 +269,7 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View ...@@ -260,6 +269,7 @@ public class WorkProFragment extends WorkBaseFg implements WorkProContract.View
@Override @Override
public void modify(String msg) { public void modify(String msg) {
page = 1; page = 1;
param.put("current", page);
workProPresenter.getPro(param); workProPresenter.getPro(param);
toast(msg); toast(msg);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论