提交 3d7b0427 authored 作者: lgd's avatar lgd

1.修改采购小数点

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 1890950a
...@@ -22,7 +22,9 @@ import org.greenrobot.eventbus.Subscribe; ...@@ -22,7 +22,9 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
...@@ -101,7 +103,7 @@ public class DeviceBuyCarActivity extends WorkToolBarActivity { ...@@ -101,7 +103,7 @@ public class DeviceBuyCarActivity extends WorkToolBarActivity {
public void onViewClicked() { public void onViewClicked() {
String allPrice = ""; String allPrice = "";
for (DeviceBean.RecordsBean recordsBean : productList) { for (DeviceBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getCarPrice()+"", 2), 2); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getCarPrice(), 3), 3);
} }
startActivity(DeviceBuyConfirmActivity.class, "pro", JSON.toJSONString(productList), startActivity(DeviceBuyConfirmActivity.class, "pro", JSON.toJSONString(productList),
"depId", getIntent().getStringExtra("depId"), "depId", getIntent().getStringExtra("depId"),
...@@ -130,7 +132,7 @@ public class DeviceBuyCarActivity extends WorkToolBarActivity { ...@@ -130,7 +132,7 @@ public class DeviceBuyCarActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(productList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(productList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (DeviceBean.RecordsBean recordsBean : productList) { for (DeviceBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getCarPrice()+"", 2), 2); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getCarPrice(), 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
} }
......
...@@ -61,11 +61,6 @@ public class DeviceBuyProductActivity extends WorkToolBarActivity { ...@@ -61,11 +61,6 @@ public class DeviceBuyProductActivity extends WorkToolBarActivity {
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false)); rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
} }
@Override
protected void onResume() {
super.onResume();
}
private void openDialog(DeviceBean.RecordsBean data) { private void openDialog(DeviceBean.RecordsBean data) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
......
...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.DeviceBean; ...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.DeviceBean;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.ModifyCarEvent; import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils; import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -37,19 +38,20 @@ public class DeviceCarAdapter extends BaseQuickAdapter<DeviceBean.RecordsBean, B ...@@ -37,19 +38,20 @@ public class DeviceCarAdapter extends BaseQuickAdapter<DeviceBean.RecordsBean, B
protected void convert(BaseViewHolder helper, DeviceBean.RecordsBean item) { protected void convert(BaseViewHolder helper, DeviceBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getTitle()); helper.setText(R.id.tv_name, item.getTitle());
helper.setText(R.id.tv_spec, item.getSpecification()); helper.setText(R.id.tv_spec, item.getSpecification());
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getCarPrice()+"", 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() , item.getCarPrice(), 3));
AddAndReduceView num = helper.getView(R.id.ar_num); AddAndReduceView num = helper.getView(R.id.ar_num);
num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() { num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override @Override
public void OnNumberChanged(String vs) { public void OnNumberChanged(String vs) {
item.setCarNum(vs); item.setCarNum(vs);
helper.setText(R.id.tv_all_price, MathUtils.multiply(vs + "", item.getCarPrice(), 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(vs + "", item.getCarPrice(), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
EditText etPrice = helper.getView(R.id.et_price); EditText etPrice = helper.getView(R.id.et_price);
etPrice.setText(item.getCarPrice()); etPrice.setText(item.getCarPrice());
WorkUtils.addDecimalsListener(etPrice);
etPrice.addTextChangedListener(new TextWatcher() { etPrice.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="领用备注" android:text="审核备注"
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <TextView
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论