提交 1f774d92 authored 作者: lgd's avatar lgd

1.限制三位小数

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 b9f9f08c
...@@ -101,7 +101,7 @@ public class AddCrucibleCarActivity extends WorkToolBarActivity { ...@@ -101,7 +101,7 @@ public class AddCrucibleCarActivity extends WorkToolBarActivity {
public void onViewClicked() { public void onViewClicked() {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice()+"", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
// startActivity(StoreSaleConfirmActivity.class, "pro", JSON.toJSONString(productList), // startActivity(StoreSaleConfirmActivity.class, "pro", JSON.toJSONString(productList),
// "subProcess", getIntent().getStringExtra("subProcess"), // "subProcess", getIntent().getStringExtra("subProcess"),
...@@ -142,7 +142,7 @@ public class AddCrucibleCarActivity extends WorkToolBarActivity { ...@@ -142,7 +142,7 @@ public class AddCrucibleCarActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(productList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(productList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , recordsBean.getInternalPrice()+"", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
} }
......
...@@ -174,7 +174,7 @@ public class AddCrucibleConfirmActivity extends WorkToolBarActivity { ...@@ -174,7 +174,7 @@ public class AddCrucibleConfirmActivity extends WorkToolBarActivity {
data.put("productId", recordsBean.getId()); data.put("productId", recordsBean.getId());
data.put("type", "PDS"); data.put("type", "PDS");
// data.put("tranFromStockId", recordsBean.getCarPrice()); // data.put("tranFromStockId", recordsBean.getCarPrice());
data.put("innerPrice", recordsBean.getInternalPrice()); data.put("innerPrice", MathUtils.converData(recordsBean.getInternalPrice(),3));
data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID
data.put("outerPrice", recordsBean.getCarPrice()); data.put("outerPrice", recordsBean.getCarPrice());
data.put("productCount", recordsBean.getCarNum()); data.put("productCount", recordsBean.getCarNum());
...@@ -299,7 +299,7 @@ public class AddCrucibleConfirmActivity extends WorkToolBarActivity { ...@@ -299,7 +299,7 @@ public class AddCrucibleConfirmActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(proList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(proList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : proList) { for (ProductBean.RecordsBean recordsBean : proList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getInternalPrice() + "", allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), MathUtils.converData(recordsBean.getInternalPrice(),3),
3), 3); 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
......
package com.wd.workoffice.ui.activity.bat.order; package com.wd.workoffice.ui.activity.bat.order;
import android.text.Editable; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
...@@ -18,9 +17,7 @@ import com.wd.workoffice.R; ...@@ -18,9 +17,7 @@ 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;
import com.wd.workoffice.bean.OrderDetail; import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.event.CheckOrderEvent; import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType; import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
...@@ -43,7 +40,6 @@ import butterknife.BindView; ...@@ -43,7 +40,6 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer; import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
/** /**
...@@ -119,6 +115,8 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -119,6 +115,8 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
ImageView ivSetting; ImageView ivSetting;
@BindView(R.id.rl_set) @BindView(R.id.rl_set)
RelativeLayout rlSet; RelativeLayout rlSet;
@BindView(R.id.ll_see_more)
LinearLayout llSeeMore;
private OrderDetail dataBean; private OrderDetail dataBean;
private List<OrderDetail.OrderFlowsBean> flowList; private List<OrderDetail.OrderFlowsBean> flowList;
private OrderProcessAdapter flowAdapter; private OrderProcessAdapter flowAdapter;
...@@ -301,10 +299,10 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -301,10 +299,10 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
"identity", identity, "identity", identity,
"status", dataBean.getStatus() + "", "status", dataBean.getStatus() + "",
"orderType", dataBean.getExpandInfo().getOrderType(), "orderType", dataBean.getExpandInfo().getOrderType(),
"enterStockType",dataBean.getEnterStockType(), "enterStockType", dataBean.getEnterStockType(),
"deptId",dataBean.getLaunchDeptId()+"", "deptId", dataBean.getLaunchDeptId() + "",
"returnNum",TextUtils.equals(dataBean.getEnterStockType(),"1")? "returnNum", TextUtils.equals(dataBean.getEnterStockType(), "1") ?
proList.get(position).getCanOutReturnSum(): proList.get(position).getCanUsedReturnSum(), proList.get(position).getCanOutReturnSum() : proList.get(position).getCanUsedReturnSum(),
"num", proList.get(position).getCanUseProductSum() + "", "num", proList.get(position).getCanUseProductSum() + "",
"product", proList.get(position).getProductName(), "product", proList.get(position).getProductName(),
"simpleCode", proList.get(position).getProductSimpleCode(), "simpleCode", proList.get(position).getProductSimpleCode(),
...@@ -345,16 +343,16 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -345,16 +343,16 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
settingDialog.show(); settingDialog.show();
break; break;
case R.id.tv_refuse: case R.id.tv_refuse:
if (status==200){ if (status == 200) {
checkReceiveDialog(2,dataBean.getId()); checkReceiveDialog(2, dataBean.getId());
}else { } else {
checkDialog(2); checkDialog(2);
} }
break; break;
case R.id.tv_agree: case R.id.tv_agree:
if (status==200){ if (status == 200) {
checkReceiveDialog(1,dataBean.getId()); checkReceiveDialog(1, dataBean.getId());
}else { } else {
checkDialog(1); checkDialog(1);
} }
break; break;
...@@ -386,11 +384,11 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -386,11 +384,11 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
View view = LayoutInflater.from(this).inflate(R.layout.view_check_order, null); View view = LayoutInflater.from(this).inflate(R.layout.view_check_order, null);
TextView tvOk = view.findViewById(R.id.tv_ok); TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvPrice = view.findViewById(R.id.tv_price); TextView tvPrice = view.findViewById(R.id.tv_price);
tvPrice.setText(MathUtils.converData(dataBean.getLaunchOrderAmount(),3)); tvPrice.setText(MathUtils.converData(dataBean.getLaunchOrderAmount(), 3));
TextView tvNum = view.findViewById(R.id.tv_num); TextView tvNum = view.findViewById(R.id.tv_num);
TextView tvCancel = view.findViewById(R.id.tv_cancel); TextView tvCancel = view.findViewById(R.id.tv_cancel);
EditText etRemark = view.findViewById(R.id.et_content); EditText etRemark = view.findViewById(R.id.et_content);
WorkUtils.addNumListener(etRemark,tvNum); WorkUtils.addNumListener(etRemark, tvNum);
builder.setView(view); builder.setView(view);
AlertDialog addCartDialog = builder.create(); AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
...@@ -481,7 +479,6 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -481,7 +479,6 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
} }
private void checkReceiveDialog(int status, String id) { private void checkReceiveDialog(int status, String id) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_check, null); View view = LayoutInflater.from(this).inflate(R.layout.view_check, null);
...@@ -491,7 +488,7 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -491,7 +488,7 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
TextView tvNum = view.findViewById(R.id.tv_num); TextView tvNum = view.findViewById(R.id.tv_num);
TextView tvCancel = view.findViewById(R.id.tv_cancel); TextView tvCancel = view.findViewById(R.id.tv_cancel);
EditText etRemark = view.findViewById(R.id.et_content); EditText etRemark = view.findViewById(R.id.et_content);
WorkUtils.addNumListener(etRemark,tvNum); WorkUtils.addNumListener(etRemark, tvNum);
builder.setView(view); builder.setView(view);
AlertDialog addCartDialog = builder.create(); AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
...@@ -545,4 +542,11 @@ public class OutOrderDetailActivity extends WorkToolBarActivity { ...@@ -545,4 +542,11 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
} }
}); });
} }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
} }
...@@ -209,7 +209,7 @@ public class ProductConfirmActivity extends WorkToolBarActivity { ...@@ -209,7 +209,7 @@ public class ProductConfirmActivity extends WorkToolBarActivity {
private void changeNumAndPrice() { private void changeNumAndPrice() {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : toList) { for (ProductBean.RecordsBean recordsBean : toList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getInternalPrice() + "", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
tvBase5.setText(String.valueOf(allPrice)); tvBase5.setText(String.valueOf(allPrice));
......
...@@ -172,7 +172,7 @@ public class ProductOrderApplyDetailActivity extends WorkToolBarActivity { ...@@ -172,7 +172,7 @@ public class ProductOrderApplyDetailActivity extends WorkToolBarActivity {
private void changeNumAndPrice() { private void changeNumAndPrice() {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : toList) { for (ProductBean.RecordsBean recordsBean : toList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
tvBase5.setText(String.valueOf(allPrice)); tvBase5.setText(String.valueOf(allPrice));
} }
......
...@@ -107,7 +107,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -107,7 +107,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
public void onViewClicked() { public void onViewClicked() {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , recordsBean.getInternalPrice() + "", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , MathUtils.converData(recordsBean.getInternalPrice(),3) , 3), 3);
} }
if (productList.size() == 0) { if (productList.size() == 0) {
toast("购物车里没有产品哦"); toast("购物车里没有产品哦");
...@@ -145,7 +145,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -145,7 +145,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(productList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(productList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getInternalPrice() + "", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
} }
......
...@@ -182,7 +182,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity { ...@@ -182,7 +182,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
data.put("productId", recordsBean.getId()); data.put("productId", recordsBean.getId());
data.put("type", "PDS"); data.put("type", "PDS");
// data.put("tranFromStockId", recordsBean.getCarPrice()); // data.put("tranFromStockId", recordsBean.getCarPrice());
data.put("innerPrice", recordsBean.getInternalPrice()); data.put("innerPrice", MathUtils.converData(recordsBean.getInternalPrice(),3));
data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID
data.put("outerPrice", recordsBean.getCarPrice()); data.put("outerPrice", recordsBean.getCarPrice());
data.put("productCount", recordsBean.getCarNum()); data.put("productCount", recordsBean.getCarNum());
......
...@@ -119,7 +119,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity { ...@@ -119,7 +119,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum()
, recordsBean.getInternalPrice() + "", 3), 3); , MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
startActivity(StoreTradingConfirmActivity.class, "pro", getIntent().getStringExtra("pro"), startActivity(StoreTradingConfirmActivity.class, "pro", getIntent().getStringExtra("pro"),
"subProcess", getIntent().getStringExtra("subProcess"), "subProcess", getIntent().getStringExtra("subProcess"),
......
...@@ -351,7 +351,7 @@ public class StoreTradingConfirmActivity extends WorkToolBarActivity { ...@@ -351,7 +351,7 @@ public class StoreTradingConfirmActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(proList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(proList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : proList) { for (ProductBean.RecordsBean recordsBean : proList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , recordsBean.getInternalPrice() + "", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() , MathUtils.converData(recordsBean.getInternalPrice(),3), 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
} }
......
...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.ProDetail; ...@@ -14,6 +14,7 @@ import com.wd.workoffice.bean.ProDetail;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
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.util.MathUtils;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import butterknife.BindView; import butterknife.BindView;
...@@ -97,7 +98,7 @@ public class WorkProDetailActivity extends WorkToolBarActivity { ...@@ -97,7 +98,7 @@ public class WorkProDetailActivity extends WorkToolBarActivity {
tvKind.setText(proBean.getOfKind()); tvKind.setText(proBean.getOfKind());
tvUnit.setText(proBean.getUnit()); tvUnit.setText(proBean.getUnit());
tvWeight.setText(String.valueOf(proBean.getWeight())); tvWeight.setText(String.valueOf(proBean.getWeight()));
tvPrice.setText(String.valueOf(proBean.getInternalPrice())); tvPrice.setText(MathUtils.converData(proBean.getInternalPrice(),3));
tvStatus.setText(TextUtils.equals(proBean.getStatus(), "1") ? "正常" : "冻结"); tvStatus.setText(TextUtils.equals(proBean.getStatus(), "1") ? "正常" : "冻结");
tvProcess.setText(proBean.getProcessType()); tvProcess.setText(proBean.getProcessType());
}else { }else {
......
...@@ -20,6 +20,7 @@ import com.wd.workoffice.presenter.WorkProPresenter; ...@@ -20,6 +20,7 @@ import com.wd.workoffice.presenter.WorkProPresenter;
import com.wd.workoffice.ui.adapter.ProSupplierAdapter; import com.wd.workoffice.ui.adapter.ProSupplierAdapter;
import com.wd.workoffice.ui.adapter.SaleSupplierAdapter; import com.wd.workoffice.ui.adapter.SaleSupplierAdapter;
import com.wd.workoffice.ui.adapter.WorkProductAdapter; import com.wd.workoffice.ui.adapter.WorkProductAdapter;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -261,7 +262,7 @@ public class WorkProSearchActivity extends WorkBaseActivity implements WorkProCo ...@@ -261,7 +262,7 @@ public class WorkProSearchActivity extends WorkBaseActivity implements WorkProCo
shelfAction="down"; shelfAction="down";
tvOk.setText("下架"); tvOk.setText("下架");
} }
tvPrice.setText(String.valueOf(data.getInternalPrice()).concat("/").concat(data.getUnit())); tvPrice.setText(MathUtils.converData(data.getInternalPrice(),3).concat("/").concat(data.getUnit()));
tvName.setText(data.getName()); tvName.setText(data.getName());
builder.setView(view); builder.setView(view);
AlertDialog addCartDialog = builder.create(); AlertDialog addCartDialog = builder.create();
......
...@@ -42,7 +42,7 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB ...@@ -42,7 +42,7 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB
helper.setText(R.id.tv_spec, item.getSpec()); helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(), 3))); helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(), 3)));
helper.setText(R.id.tv_unit, MathUtils.converData(item.getWeight(), 3).concat("吨")); helper.setText(R.id.tv_unit, MathUtils.converData(item.getWeight(), 3).concat("吨"));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), item.getInternalPrice() + "", 3)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), MathUtils.converData(item.getInternalPrice(),3), 3));
helper.addOnClickListener(R.id.tv_delete); helper.addOnClickListener(R.id.tv_delete);
AddAndReduceView num = helper.getView(R.id.ar_num); AddAndReduceView num = helper.getView(R.id.ar_num);
num.setMaxNum(item.getCanUseProductSum()); num.setMaxNum(item.getCanUseProductSum());
......
...@@ -47,7 +47,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -47,7 +47,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
helper.setText(R.id.tv_spec, item.getSpec()); helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(),3))); helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(),3)));
helper.setText(R.id.tv_unit, MathUtils.converData(item.getWeight(),3).concat("吨")); helper.setText(R.id.tv_unit, MathUtils.converData(item.getWeight(),3).concat("吨"));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), item.getInternalPrice() + "", 3)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), MathUtils.converData(item.getInternalPrice(),3), 3));
if (type == 1) { if (type == 1) {
helper.addOnClickListener(R.id.rl_choose_dep); helper.addOnClickListener(R.id.rl_choose_dep);
helper.addOnClickListener(R.id.rl_upload); helper.addOnClickListener(R.id.rl_upload);
...@@ -64,7 +64,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -64,7 +64,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
@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 , String.valueOf(item.getInternalPrice()), 3)); helper.setText(R.id.tv_all_price, MathUtils.multiply(vs , MathUtils.converData(item.getInternalPrice(),3), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
...@@ -103,7 +103,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -103,7 +103,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
return; return;
} }
item.setCarPrice(s.toString()); item.setCarPrice(s.toString());
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), String.valueOf(item.getInternalPrice()), 3)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), MathUtils.converData(item.getInternalPrice(),3), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
......
...@@ -5,6 +5,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter; ...@@ -5,6 +5,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List; import java.util.List;
...@@ -32,7 +33,7 @@ public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBea ...@@ -32,7 +33,7 @@ public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBea
helper.setText(R.id.tv_card, item.getSoleCode()); helper.setText(R.id.tv_card, item.getSoleCode());
helper.setText(R.id.tv_card_name, item.getName()); helper.setText(R.id.tv_card_name, item.getName());
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(MathUtils.converData(item.getInternalPrice(),3)));
helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨")); helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨"));
helper.addOnClickListener(R.id.tv_cart); helper.addOnClickListener(R.id.tv_cart);
if (type == 1) { if (type == 1) {
......
...@@ -36,7 +36,7 @@ public class TradingConfimProAdapter extends BaseQuickAdapter<ProductBean.Record ...@@ -36,7 +36,7 @@ public class TradingConfimProAdapter extends BaseQuickAdapter<ProductBean.Record
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) { protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getName()); helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_num, String.valueOf(item.getCarNum())); helper.setText(R.id.tv_num, String.valueOf(item.getCarNum()));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getInternalPrice() + "", 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() , MathUtils.converData(item.getInternalPrice(),3), 3));
helper.addOnClickListener(R.id.rl_upload); helper.addOnClickListener(R.id.rl_upload);
if (!TextUtils.isEmpty(item.getUrl())){ if (!TextUtils.isEmpty(item.getUrl())){
helper.setText(R.id.tv_upload, "已上传,点击替换"); helper.setText(R.id.tv_upload, "已上传,点击替换");
......
...@@ -35,15 +35,15 @@ public class TradingProCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBe ...@@ -35,15 +35,15 @@ public class TradingProCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBe
helper.setText(R.id.tv_card, item.getSoleCode()); helper.setText(R.id.tv_card, item.getSoleCode());
helper.setText(R.id.tv_card_name, item.getSoleCode()); helper.setText(R.id.tv_card_name, item.getSoleCode());
helper.setText(R.id.tv_spec, item.getSpec()); helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, String.valueOf(item.getInternalPrice())); helper.setText(R.id.tv_price, MathUtils.converData(item.getInternalPrice(),3));
helper.setText(R.id.tv_all_price, "小计:"+MathUtils.multiply(item.getCarNum() + "", item.getInternalPrice() + "", 3)); helper.setText(R.id.tv_all_price, "小计:"+MathUtils.multiply(item.getCarNum(), MathUtils.converData(item.getInternalPrice(),3), 3));
AddAndReduceView num = helper.getView(R.id.ar_num); AddAndReduceView num = helper.getView(R.id.ar_num);
num.setNumber(item.getCarNum()); num.setNumber(item.getCarNum());
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.getInternalPrice() + "", 3)); helper.setText(R.id.tv_all_price, "小计:"+MathUtils.multiply(vs , MathUtils.converData(item.getInternalPrice(),3), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
......
...@@ -9,6 +9,7 @@ import com.chad.library.adapter.base.BaseViewHolder; ...@@ -9,6 +9,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.bean.LogisticDetailBean; import com.wd.workoffice.bean.LogisticDetailBean;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.util.MathUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -36,7 +37,7 @@ public class TradingProDetailAdapter extends BaseQuickAdapter<ProductBean.Record ...@@ -36,7 +37,7 @@ public class TradingProDetailAdapter extends BaseQuickAdapter<ProductBean.Record
helper.setText(R.id.tv_card, item.getSoleCode() ); helper.setText(R.id.tv_card, item.getSoleCode() );
helper.setText(R.id.tv_card_name, item.getSoleCode()); helper.setText(R.id.tv_card_name, item.getSoleCode());
helper.setText(R.id.tv_spec,item.getSpec()); helper.setText(R.id.tv_spec,item.getSpec());
helper.setText(R.id.tv_price,String.valueOf(item.getInternalPrice())); helper.setText(R.id.tv_price, MathUtils.converData(item.getInternalPrice(),3));
CheckBox cbChoose = helper.getView(R.id.cb_check); CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
......
...@@ -6,6 +6,7 @@ import com.chad.library.adapter.base.BaseViewHolder; ...@@ -6,6 +6,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.workEnum.PagePermissionType; import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public class WorkProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean ...@@ -26,7 +27,7 @@ public class WorkProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean
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(MathUtils.converData(item.getInternalPrice(),3)));
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) {//未上架 if (item.getIsExpectOut() == 0) {//未上架
......
...@@ -82,7 +82,7 @@ public class MathUtils { ...@@ -82,7 +82,7 @@ public class MathUtils {
} }
BigDecimal bg = new BigDecimal(value); BigDecimal bg = new BigDecimal(value);
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(bg.setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(bg.setScale(scale, RoundingMode.DOWN));
} }
public static String converData(double value, Integer scale) { public static String converData(double value, Integer scale) {
...@@ -94,7 +94,7 @@ public class MathUtils { ...@@ -94,7 +94,7 @@ public class MathUtils {
} }
BigDecimal bg = new BigDecimal(strValue); BigDecimal bg = new BigDecimal(strValue);
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(bg.setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(bg.setScale(scale, RoundingMode.DOWN));
} }
...@@ -108,7 +108,7 @@ public class MathUtils { ...@@ -108,7 +108,7 @@ public class MathUtils {
BigDecimal b1 = new BigDecimal(v1.trim()); BigDecimal b1 = new BigDecimal(v1.trim());
BigDecimal b2 = new BigDecimal(v2.trim()); BigDecimal b2 = new BigDecimal(v2.trim());
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(b1.multiply(b2).setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(b1.multiply(b2).setScale(scale, RoundingMode.DOWN));
} }
public static String add(String v1, String v2, Integer scale) { public static String add(String v1, String v2, Integer scale) {
...@@ -121,7 +121,7 @@ public class MathUtils { ...@@ -121,7 +121,7 @@ public class MathUtils {
BigDecimal b1 = new BigDecimal(v1.trim()); BigDecimal b1 = new BigDecimal(v1.trim());
BigDecimal b2 = new BigDecimal(v2.trim()); BigDecimal b2 = new BigDecimal(v2.trim());
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(b1.add(b2).setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(b1.add(b2).setScale(scale, RoundingMode.DOWN));
} }
public static String subtract(String v1, String v2, Integer scale) { public static String subtract(String v1, String v2, Integer scale) {
...@@ -134,7 +134,7 @@ public class MathUtils { ...@@ -134,7 +134,7 @@ public class MathUtils {
BigDecimal b1 = new BigDecimal(v1.trim()); BigDecimal b1 = new BigDecimal(v1.trim());
BigDecimal b2 = new BigDecimal(v2.trim()); BigDecimal b2 = new BigDecimal(v2.trim());
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(b1.subtract(b2).setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(b1.subtract(b2).setScale(scale, RoundingMode.DOWN));
} }
public static String divide(String v1, String v2, Integer scale) { public static String divide(String v1, String v2, Integer scale) {
...@@ -147,7 +147,7 @@ public class MathUtils { ...@@ -147,7 +147,7 @@ public class MathUtils {
BigDecimal b1 = new BigDecimal(v1.trim()); BigDecimal b1 = new BigDecimal(v1.trim());
BigDecimal b2 = new BigDecimal(v2.trim()); BigDecimal b2 = new BigDecimal(v2.trim());
DecimalFormat decimalFormat = new DecimalFormat("#######################.###"); DecimalFormat decimalFormat = new DecimalFormat("#######################.###");
return decimalFormat.format(b1.divide(b2).setScale(scale, RoundingMode.HALF_UP)); return decimalFormat.format(b1.divide(b2).setScale(scale, RoundingMode.DOWN));
} }
......
...@@ -147,6 +147,24 @@ ...@@ -147,6 +147,24 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingVertical="10mm" /> android:paddingVertical="10mm" />
<LinearLayout
android:id="@+id/ll_see_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingVertical="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看更多" />
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/arrow_down" />
</LinearLayout>
<View style="@style/ViewX" /> <View style="@style/ViewX" />
<LinearLayout <LinearLayout
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论