提交 4d0224c9 authored 作者: lgd's avatar lgd

1.坩埚销售发货

2.TODO 供应订单三个功能测试,
上级 356f0bb3
...@@ -130,6 +130,33 @@ public class AddStockChooseBean { ...@@ -130,6 +130,33 @@ public class AddStockChooseBean {
private Object deptId; private Object deptId;
private double actionQuantity; private double actionQuantity;
private String chooseNum; private String chooseNum;
private String orderType;
private String orderId;
private String fromStockId;
public String getFromStockId() {
return fromStockId;
}
public void setFromStockId(String fromStockId) {
this.fromStockId = fromStockId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getChooseNum() { public String getChooseNum() {
return chooseNum; return chooseNum;
......
...@@ -199,10 +199,10 @@ public class SendApplyAddActivity extends WorkToolBarActivity { ...@@ -199,10 +199,10 @@ public class SendApplyAddActivity extends WorkToolBarActivity {
String code = etLogisticsCode.getText().toString(); String code = etLogisticsCode.getText().toString();
String remark = etRemark.getText().toString(); String remark = etRemark.getText().toString();
String time = tvTime.getText().toString(); String time = tvTime.getText().toString();
if (TextUtils.isEmpty(time)) { // if (TextUtils.isEmpty(time)) {
toast("请选择发货时间"); // toast("请选择发货时间");
return; // return;
} // }
if (TextUtils.isEmpty(price)) { if (TextUtils.isEmpty(price)) {
toast("请输入运费"); toast("请输入运费");
return; return;
......
...@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSON; ...@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bigkoo.pickerview.listener.OnTimeSelectListener; import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.gson.JsonObject;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean; import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
...@@ -109,9 +110,10 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -109,9 +110,10 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
@Override @Override
public void onItemChildClick(BaseQuickAdapter baseQuickAdapter, View view, int i) { public void onItemChildClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
startActivityForResult(SendApplyCrucibleChooseActivity.class, startActivityForResult(SendApplyCrucibleChooseActivity.class,
10002,"position", i+"" 10002, "position", i + ""
,"deptId", getIntent().getStringExtra("deptId"), , "deptId", getIntent().getStringExtra("deptId"),
"productId", dataList.get(i).getProductId()+""); "num", MathUtils.converData(dataList.get(i).getCanOutStoreProductSum(),3) ,
"productId", dataList.get(i).getProductId() + "");
} }
}); });
} }
...@@ -182,7 +184,7 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -182,7 +184,7 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
if (entry.getValue()) { if (entry.getValue()) {
OrderDetail.OrderItemsBean recordsBean = dataList.get(entry.getKey()); OrderDetail.OrderItemsBean recordsBean = dataList.get(entry.getKey());
JSONObject returnData = new JSONObject(); JSONObject returnData = new JSONObject();
if (null==recordsBean.getBackList()) { if (null == recordsBean.getBackList()) {
toast("请选择来源"); toast("请选择来源");
return false; return false;
} }
...@@ -196,7 +198,11 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -196,7 +198,11 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
returnData.put("productAmount", recordsBean.getCount()); returnData.put("productAmount", recordsBean.getCount());
for (AddStockChooseBean.RecordsBean bean : recordsBean.getBackList()) { for (AddStockChooseBean.RecordsBean bean : recordsBean.getBackList()) {
bean.setActionQuantity(Double.valueOf(bean.getChooseNum())); bean.setActionQuantity(Double.valueOf(bean.getChooseNum()));
bean.setOrderId(getIntent().getStringExtra("id"));
bean.setOrderType(orderType);
bean.setFromStockId(bean.getStockId() + "");
} }
returnData.put("stockFromDetails", recordsBean.getBackList()); returnData.put("stockFromDetails", recordsBean.getBackList());
info.add(returnData); info.add(returnData);
} }
...@@ -239,7 +245,7 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -239,7 +245,7 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
Observable<BaseBean> observable; Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) { if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().sendForwardApply(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param)); observable = RtfUtils.getRtf().sendForwardApply(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param));
} else { } else {
observable = RtfUtils.getRtf().sendForwardApply(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param)); observable = RtfUtils.getRtf().sendForwardApply(getIntent().getStringExtra("id"), WorkUtils.convertMapToBody(param));
} }
observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() { observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
...@@ -298,8 +304,9 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -298,8 +304,9 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
String clientName = data.getStringExtra("clientName"); String clientName = data.getStringExtra("clientName");
clientId = data.getIntExtra("id", 0); clientId = data.getIntExtra("id", 0);
tvLogisticsCompany.setText(clientName); tvLogisticsCompany.setText(clientName);
}else if (requestCode == 10002 && resultCode == 10002){ } else if (requestCode == 10002 && resultCode == 10002) {
List<AddStockChooseBean.RecordsBean> backList =JSON.parseArray(getIntent().getStringExtra("stock"),AddStockChooseBean.RecordsBean.class); List<AddStockChooseBean.RecordsBean> backList = JSON.parseArray(data.getStringExtra("stock"),
AddStockChooseBean.RecordsBean.class);
Integer position = Integer.valueOf(data.getStringExtra("position")); Integer position = Integer.valueOf(data.getStringExtra("position"));
String count = data.getStringExtra("count"); String count = data.getStringExtra("count");
dataList.get(position).setBackList(backList); dataList.get(position).setBackList(backList);
...@@ -322,7 +329,6 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -322,7 +329,6 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
@Subscribe @Subscribe
public void refresh(SendWeightEvent event) { public void refresh(SendWeightEvent event) {
Map<Integer, Boolean> isChoose = dataAdapter.getIsChoose(); Map<Integer, Boolean> isChoose = dataAdapter.getIsChoose();
List<JSONObject> info = new ArrayList<>(); List<JSONObject> info = new ArrayList<>();
String totalWeight = "0"; String totalWeight = "0";
...@@ -332,10 +338,14 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity { ...@@ -332,10 +338,14 @@ public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
JSONObject returnData = new JSONObject(); JSONObject returnData = new JSONObject();
if (TextUtils.isEmpty(recordsBean.getChooseNum()) || Double.valueOf(recordsBean.getChooseNum()) == 0d) { if (TextUtils.isEmpty(recordsBean.getChooseNum()) || Double.valueOf(recordsBean.getChooseNum()) == 0d) {
} }
totalWeight = MathUtils.add(totalWeight, MathUtils.multiply(recordsBean.getChooseNum(), totalWeight = MathUtils.add(totalWeight, MathUtils.multiply(recordsBean.getCount(),
String.valueOf(recordsBean.getProductWeight()), 3), 3); String.valueOf(recordsBean.getProductWeight()), 3), 3);
returnData.put("productId", recordsBean.getProductId()); returnData.put("productId", recordsBean.getProductId());
returnData.put("productAmount", recordsBean.getChooseNum()); returnData.put("productAmount", recordsBean.getCount());
for (AddStockChooseBean.RecordsBean bean : recordsBean.getBackList()) {
bean.setActionQuantity(Double.valueOf(bean.getChooseNum()));
}
returnData.put("stockFromDetails", recordsBean.getBackList());
info.add(returnData); info.add(returnData);
} }
} }
......
package com.wd.workoffice.ui.activity.bat.order; package com.wd.workoffice.ui.activity.bat.order;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -15,7 +19,6 @@ import com.wd.workoffice.bean.AddStockChooseBean; ...@@ -15,7 +19,6 @@ import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.event.ModifyCarEvent; import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.AddStockCrucibleChooseAdapter;
import com.wd.workoffice.ui.adapter.SendApplyCrucibleChooseAdapter; import com.wd.workoffice.ui.adapter.SendApplyCrucibleChooseAdapter;
import com.wd.workoffice.util.MathUtils; import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
...@@ -24,6 +27,7 @@ import org.greenrobot.eventbus.EventBus; ...@@ -24,6 +27,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -52,6 +56,16 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity { ...@@ -52,6 +56,16 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
RelativeLayout llBottom; RelativeLayout llBottom;
@BindView(R.id.rv_product) @BindView(R.id.rv_product)
RecyclerView rvProduct; RecyclerView rvProduct;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.ll_search)
LinearLayout llSearch;
@BindView(R.id.tv_count_desc)
TextView tvCountDesc;
@BindView(R.id.ll_title)
LinearLayout llTitle;
private List<AddStockChooseBean.RecordsBean> productList; private List<AddStockChooseBean.RecordsBean> productList;
private SendApplyCrucibleChooseAdapter productAdapter; private SendApplyCrucibleChooseAdapter productAdapter;
private int page = 1; private int page = 1;
...@@ -61,6 +75,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity { ...@@ -61,6 +75,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false)); rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
tvCountDesc.setText(String.format("(可申请数量%s)", getIntent().getStringExtra("num")));
} }
@Override @Override
...@@ -125,7 +140,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity { ...@@ -125,7 +140,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
if (entry.getValue()) { if (entry.getValue()) {
isHas = true; isHas = true;
backList.add(productList.get(entry.getKey())); backList.add(productList.get(entry.getKey()));
if (TextUtils.isEmpty(productList.get(entry.getKey()).getChooseNum())|| if (TextUtils.isEmpty(productList.get(entry.getKey()).getChooseNum()) ||
TextUtils.equals(productList.get(entry.getKey()).getChooseNum(), "0")) { TextUtils.equals(productList.get(entry.getKey()).getChooseNum(), "0")) {
toast("请输入数量"); toast("请输入数量");
return; return;
...@@ -133,6 +148,11 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity { ...@@ -133,6 +148,11 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
} }
} }
if (isHas) { if (isHas) {
if (new BigDecimal(Double.valueOf(tvPrice.getText().toString().split(": ")[1])).
compareTo(new BigDecimal(getIntent().getStringExtra("num"))) == 1) {
toast(String.format("可申请数量最大为%s", MathUtils.converData(getIntent().getStringExtra("num"), 3)));
return;
}
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("stock", JSON.toJSONString(backList)); intent.putExtra("stock", JSON.toJSONString(backList));
intent.putExtra("position", getIntent().getStringExtra("position")); intent.putExtra("position", getIntent().getStringExtra("position"));
...@@ -214,6 +234,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity { ...@@ -214,6 +234,7 @@ public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
} }
}); });
} }
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_finish, menu); getMenuInflater().inflate(R.menu.menu_finish, menu);
......
...@@ -29,15 +29,14 @@ public class SendApplyAddCrucibleAdapter extends BaseQuickAdapter<OrderDetail.Or ...@@ -29,15 +29,14 @@ public class SendApplyAddCrucibleAdapter extends BaseQuickAdapter<OrderDetail.Or
public SendApplyAddCrucibleAdapter(int layoutResId, List data) { public SendApplyAddCrucibleAdapter(int layoutResId, List data) {
super(layoutResId, data); super(layoutResId, data);
for (int i = 0; i < isChoose.entrySet().size(); i++) { for (int i = 0; i < data.size(); i++) {
isChoose.put(i, false); isChoose.put(i, false);
} }
} }
@Override @Override
protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean item) { protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean item) {
if (!TextUtils.isEmpty(item.getCount())){ if (!TextUtils.isEmpty(item.getCount())) {
helper.setText(R.id.tv_from, item.getCount()); helper.setText(R.id.tv_from, item.getCount());
} }
helper.setText(R.id.tv_name, item.getProductSimpleCode()); helper.setText(R.id.tv_name, item.getProductSimpleCode());
...@@ -52,11 +51,11 @@ public class SendApplyAddCrucibleAdapter extends BaseQuickAdapter<OrderDetail.Or ...@@ -52,11 +51,11 @@ public class SendApplyAddCrucibleAdapter extends BaseQuickAdapter<OrderDetail.Or
helper.setText(R.id.tv_apply_send_num, MathUtils.converData(item.getCanOutStoreProductSum(), 3)); helper.setText(R.id.tv_apply_send_num, MathUtils.converData(item.getCanOutStoreProductSum(), 3));
helper.setText(R.id.tv_send_num, MathUtils.converData(item.getShipSum(), 3)); helper.setText(R.id.tv_send_num, MathUtils.converData(item.getShipSum(), 3));
CheckBox cbChoose = helper.getView(R.id.cb_check); CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setChecked(isChoose.get(helper.getAdapterPosition()) == null ? false : isChoose.get(helper.getAdapterPosition()));
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked()); isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked());
EventBus.getDefault().post(new SendWeightEvent()); EventBus.getDefault().post(new SendWeightEvent());
} }
}); });
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:visibility="gone"
android:id="@+id/rl_time" android:id="@+id/rl_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论