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

1.质量报表

上级 33c17f7b
......@@ -1706,7 +1706,7 @@
<activity
android:name=".ui.activity.mes.analysis.MesAnalysisActivity"
android:configChanges="keyboardHidden|orientation"
android:label="质量分析"
android:label="缺陷字典"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
......@@ -2538,7 +2538,30 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.report.MesReportProBadDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="详情"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.report.MesReportProActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="详情"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.report.MesReportProDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="详情"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -31,19 +31,46 @@ public class ProBadBean {
* nonCompliant : null
*/
private Object seriesId;
private String seriesId;
private String variety;
private int scrapCount;
private double scrapWeight;
private double scrapRate;
private double modulus;
private Object nonCompliant;
private String nonCompliant;
private String unitPrice;
private String orderCount;
private String scapReason;
public Object getSeriesId() {
public String getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
public String getOrderCount() {
return orderCount;
}
public void setOrderCount(String orderCount) {
this.orderCount = orderCount;
}
public String getScapReason() {
return scapReason;
}
public void setScapReason(String scapReason) {
this.scapReason = scapReason;
}
public String getSeriesId() {
return seriesId;
}
public void setSeriesId(Object seriesId) {
public void setSeriesId(String seriesId) {
this.seriesId = seriesId;
}
......@@ -87,11 +114,11 @@ public class ProBadBean {
this.modulus = modulus;
}
public Object getNonCompliant() {
public String getNonCompliant() {
return nonCompliant;
}
public void setNonCompliant(Object nonCompliant) {
public void setNonCompliant(String nonCompliant) {
this.nonCompliant = nonCompliant;
}
}
......
package com.wd.workoffice.bean.mesBean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ReportProBean {
/**
* success : true
* data : [{"productId":"7103010078D","productName":"中包浸入式下水口J596","productCode":"7103010078D","specification":"3期","drawingNumber":"J596","scrapCount":2,"scrapReason":"长水口","unitPrice":0,"amountOfLoss":0,"orderCount":3,"manufactureOrderNumber":"DX200615001","scrapRate":0,"ocerCount":0}]
* message : 操作成功
* code : 10000000
* status : null
*/
private boolean success;
private String message;
private String code;
private Object status;
private List<DataBean> data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Object getStatus() {
return status;
}
public void setStatus(Object status) {
this.status = status;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* productId : 7103010078D
* productName : 中包浸入式下水口J596
* productCode : 7103010078D
* specification : 3期
* drawingNumber : J596
* scrapCount : 2
* scrapReason : 长水口
* unitPrice : 0.0
* amountOfLoss : 0.0
* orderCount : 3
* manufactureOrderNumber : DX200615001
* scrapRate : 0.0
* ocerCount : 0
*/
private String productId;
private String productName;
private String productCode;
private String specification;
private String drawingNumber;
private int scrapCount;
private String scrapReason;
private double unitPrice;
private double amountOfLoss;
private int orderCount;
private String manufactureOrderNumber;
private double scrapRate;
private int ocerCount;
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getSpecification() {
return specification;
}
public void setSpecification(String specification) {
this.specification = specification;
}
public String getDrawingNumber() {
return drawingNumber;
}
public void setDrawingNumber(String drawingNumber) {
this.drawingNumber = drawingNumber;
}
public int getScrapCount() {
return scrapCount;
}
public void setScrapCount(int scrapCount) {
this.scrapCount = scrapCount;
}
public String getScrapReason() {
return scrapReason;
}
public void setScrapReason(String scrapReason) {
this.scrapReason = scrapReason;
}
public double getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(double unitPrice) {
this.unitPrice = unitPrice;
}
public double getAmountOfLoss() {
return amountOfLoss;
}
public void setAmountOfLoss(double amountOfLoss) {
this.amountOfLoss = amountOfLoss;
}
public int getOrderCount() {
return orderCount;
}
public void setOrderCount(int orderCount) {
this.orderCount = orderCount;
}
public String getManufactureOrderNumber() {
return manufactureOrderNumber;
}
public void setManufactureOrderNumber(String manufactureOrderNumber) {
this.manufactureOrderNumber = manufactureOrderNumber;
}
public double getScrapRate() {
return scrapRate;
}
public void setScrapRate(double scrapRate) {
this.scrapRate = scrapRate;
}
public int getOcerCount() {
return ocerCount;
}
public void setOcerCount(int ocerCount) {
this.ocerCount = ocerCount;
}
}
}
......@@ -592,12 +592,19 @@ public interface MesApiService {
*/
@POST("/himes/api/modinspo/show/modinspoproject/modinspoprojectline/list.json")
Observable<BaseMesBean> serviceStandardList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
/**
* @return
*/
@POST("/himes/api/scrapAnalysis/show/list.json")
Observable<BaseMesBean> scrapAnalysisList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
@POST("/himes/api/scrapAnalysis/show/detailList.json")
Observable<BaseMesBean> scrapAnalysisDetailList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
......
......@@ -29,6 +29,7 @@ import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 缺陷字典
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
......
......@@ -15,13 +15,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.bean.WarehoustBean;
import com.wd.workoffice.bean.mesBean.MesFactoryBean;
import com.wd.workoffice.bean.mesBean.OrderBadBean;
import com.wd.workoffice.bean.mesBean.ProBadBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderAddActivity;
import com.wd.workoffice.ui.adapter.ReportBadListAdapter;
import com.wd.workoffice.ui.adapter.ReportProBadAdapter;
import com.wd.workoffice.ui.adapter.ReportTopAdapter;
......@@ -45,6 +43,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.LogUtils;
import flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.disposables.Disposable;
......@@ -72,16 +71,16 @@ public class MesReportActivity extends WorkBaseActivity {
LinearLayout llReport;
@BindView(R.id.ll_bad)
LinearLayout llBad;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.ll_time)
LinearLayout llTime;
@BindView(R.id.tv_dept)
TextView tvDept;
@BindView(R.id.tv_start)
TextView tvStart;
@BindView(R.id.tv_end)
TextView tvEnd;
@BindView(R.id.tv_first_start)
TextView tvFirstStart;
@BindView(R.id.tv_first_end)
TextView tvFirstEnd;
private ReportBadListAdapter badAdapter;
private ReportTopAdapter topAdapter;
private ReportProBadAdapter proBadAdapter;
......@@ -236,6 +235,17 @@ public class MesReportActivity extends WorkBaseActivity {
@Override
protected void initEvent() {
proBadAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
LogUtils.LOGE("flexible",tvFirstStart.getText().toString());
LogUtils.LOGE("flexible",tvFirstEnd.getText().toString());
startActivity(MesReportProBadDetailActivity.class,
"data",JSON.toJSONString(proBadList.get(position)),
"beginDate", tvFirstStart.getText().toString(),
"endDate",tvFirstEnd.getText().toString());
}
});
}
@Override
......@@ -244,7 +254,7 @@ public class MesReportActivity extends WorkBaseActivity {
}
@OnClick({R.id.tv_dept, R.id.tv_start, R.id.tv_end, R.id.ll_time, R.id.tv_report, R.id.tv_bad})
@OnClick({R.id.tv_dept, R.id.tv_start, R.id.tv_end, R.id.tv_first_start, R.id.tv_first_end, R.id.tv_report, R.id.tv_bad})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_dept:
......@@ -272,17 +282,41 @@ public class MesReportActivity extends WorkBaseActivity {
}
}, false).show();
break;
case R.id.ll_time:
PickTimeUtils.showPickTwo(this, new OnTimeSelectListener() {
case R.id.tv_first_start:
PickTimeUtils.showPickThree(this, new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View view) {
String month = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM"));
tvTime.setText(month);
addMonthParam(month);
public void onTimeSelect(Date date, View v) {
String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd"));
param.put("beginDate", time);
tvFirstStart.setText(time);
getData();
}
}).show();
}, false).show();
break;
case R.id.tv_first_end:
PickTimeUtils.showPickThree(this, new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {
String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd"));
param.put("endDate", time);
tvFirstEnd.setText(time);
getData();
}
}, false).show();
break;
// case R.id.ll_time:
// PickTimeUtils.showPickTwo(this, new OnTimeSelectListener() {
// @Override
// public void onTimeSelect(Date date, View view) {
// String month = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM"));
// tvTime.setText(month);
// addMonthParam(month);
// getData();
// }
// }).show();
// break;
case R.id.tv_report:
changView(0);
break;
......
package com.wd.workoffice.ui.activity.mes.report;
import android.view.View;
import android.widget.LinearLayout;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.ReportProBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ReportProAdapter;
import com.wd.workoffice.ui.adapter.ReportProTopAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 质量报表 产品报废排行
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesReportProActivity extends WorkToolBarActivity {
@BindView(R.id.rv_top)
RecyclerView rvTop;
@BindView(R.id.rv_pro_bad)
RecyclerView rvProBad;
@BindView(R.id.ll_report)
LinearLayout llReport;
private ReportProTopAdapter topAdapter;
private ReportProAdapter proBadAdapter;
private List<ReportProBean.DataBean> proBadList;
private List<ReportProBean.DataBean> topList;
private Map<String, Object> param;
@Override
protected void initView() {
ButterKnife.bind(this);
rvProBad.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
rvTop.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
topList = new ArrayList<>();
proBadList = new ArrayList<>();
topAdapter = new ReportProTopAdapter(R.layout.item_mes_report_top, topList);
proBadAdapter = new ReportProAdapter(R.layout.item_mes_report_pro_bad, proBadList);
topAdapter.bindToRecyclerView(rvTop);
proBadAdapter.bindToRecyclerView(rvProBad);
param = WorkUtils.simpleParam();
param.put("beginDate", getIntent().getStringExtra("beginDate"));
param.put("endDate", getIntent().getStringExtra("endDate"));
param.put("seriesId", getIntent().getStringExtra("id"));
param.put("scapReason", getIntent().getStringExtra("scapReason"));
getData();
}
private void getData() {
RtfUtils.getMesRtf().scrapAnalysisDetailList("1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMessage());
return;
}
List<ReportProBean.DataBean> getList = JSON.parseArray(data.getData().toString(), ReportProBean.DataBean.class);
Collections.sort(getList, new Comparator<ReportProBean.DataBean>() {
@Override
public int compare(ReportProBean.DataBean o1, ReportProBean.DataBean o2) {
return new BigDecimal(o2.getScrapCount()).compareTo(new BigDecimal(o1.getScrapCount()));
}
});
topList.clear();
topList.addAll(getList);
proBadList.clear();
proBadList.addAll(getList);
topAdapter.notifyDataSetChanged();
proBadAdapter.notifyDataSetChanged();
}
});
}
@Override
protected void initEvent() {
proBadAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(MesReportProDetailActivity.class, "info", JSON.toJSONString(proBadList.get(position)));
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_mes_report_pro;
}
}
package com.wd.workoffice.ui.activity.mes.report;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.MesOrderDetailBean;
import com.wd.workoffice.bean.mesBean.ProBadBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.MathUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.LogUtils;
import io.reactivex.disposables.Disposable;
/**
* 质量报告 废品报表 -详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesReportProBadDetailActivity extends WorkToolBarActivity {
@BindView(R.id.btn_detail)
Button btnDetail;
@BindView(R.id.tv_type)
TextView tvType;
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_weight)
TextView tvWeight;
@BindView(R.id.tv_bad)
TextView tvBad;
@BindView(R.id.tv_coefficient)
TextView tvCoefficient;
@BindView(R.id.tv_price)
TextView tvPrice;
@BindView(R.id.tv_order_num)
TextView tvOrderNum;
@BindView(R.id.tv_reason)
TextView tvReason;
@BindView(R.id.tv_cost)
TextView tvCost;
private ProBadBean.DataBean dataBean;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
String data = getIntent().getStringExtra("data");
if (!TextUtils.isEmpty(data)){
dataBean = JSON.parseObject(data,ProBadBean.DataBean.class);
tvType.setText(dataBean.getVariety());
tvNum.setText(dataBean.getScrapCount()+"");
tvWeight.setText(MathUtils.converData(dataBean.getScrapWeight(),3));
tvBad.setText(MathUtils.converData(dataBean.getScrapRate(),3));
// tvCoefficient.setText(MathUtils.converData(dataBean.getScrapRate(),3));
// tvPrice.setText();
tvReason.setText(dataBean.getScapReason());
tvCost.setText(dataBean.getNonCompliant());
}
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_mes_report_pro_detail;
}
@OnClick(R.id.btn_detail)
public void onViewClicked() {
startActivity(MesReportProActivity.class,
"beginDate",getIntent().getStringExtra("beginDate"),
"endDate",getIntent().getStringExtra("endDate"),
"scapReason",dataBean.getScapReason(),
"id",dataBean.getSeriesId());
}
}
package com.wd.workoffice.ui.activity.mes.report;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.OrderBadBean;
import com.wd.workoffice.bean.mesBean.ReportProBean;
import com.wd.workoffice.util.MathUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 订单追踪 产品详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesReportProDetailActivity extends WorkToolBarActivity {
@BindView(R.id.tv_no)
TextView tvNo;
@BindView(R.id.tv_pro_name)
TextView tvProName;
@BindView(R.id.tv_pro_code)
TextView tvProCode;
@BindView(R.id.tv_spec)
TextView tvSpec;
@BindView(R.id.tv_img_code)
TextView tvImgCode;
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_price)
TextView tvPrice;
@BindView(R.id.tv_lost_price)
TextView tvLostPrice;
@BindView(R.id.tv_order_num)
TextView tvOrderNum;
@BindView(R.id.tv_rate)
TextView tvRate;
@BindView(R.id.tv_finish_num)
TextView tvFinishNum;
@BindView(R.id.tv_reason)
TextView tvReason;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
ReportProBean.DataBean info = JSON.parseObject(getIntent().getStringExtra("info"), ReportProBean.DataBean.class);
tvNo.setText(info.getManufactureOrderNumber());
tvProName.setText(info.getProductName());
tvProCode.setText(info.getProductCode());
tvSpec.setText(info.getSpecification());
tvImgCode.setText(info.getDrawingNumber());
tvNum.setText(info.getScrapCount()+"");
tvPrice.setText(MathUtils.converData(info.getUnitPrice(),3));
tvLostPrice.setText(MathUtils.converData(info.getAmountOfLoss(),3));
tvOrderNum.setText(info.getOrderCount()+"");
tvRate.setText(MathUtils.converData(info.getScrapRate(),3));
tvFinishNum.setText(info.getOcerCount()+"");
tvReason.setText(info.getScrapReason());
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_mes_report_pro_detail_detail;
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.mesBean.ProBadBean;
import com.wd.workoffice.bean.mesBean.ReportProBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class ReportProAdapter extends BaseQuickAdapter<ReportProBean.DataBean, BaseViewHolder> {
public ReportProAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ReportProBean.DataBean item) {
helper.setText(R.id.tv_rank, item.getManufactureOrderNumber());
helper.setText(R.id.tv_pro_name, item.getProductName());
helper.setText(R.id.tv_weight, MathUtils.converData(item.getScrapCount(),3));
}
}
......@@ -22,8 +22,8 @@ public class ReportProBadAdapter extends BaseQuickAdapter<ProBadBean.DataBean, B
@Override
protected void convert(BaseViewHolder helper, ProBadBean.DataBean item) {
helper.setText(R.id.tv_rank, helper.getAdapterPosition()+1 + "");
helper.setText(R.id.tv_pro_name, item.getVariety());
helper.setText(R.id.tv_rank, item.getVariety());
helper.setText(R.id.tv_pro_name, item.getScapReason());
helper.setText(R.id.tv_weight, MathUtils.converData(item.getScrapWeight(),3));
}
}
......
package com.wd.workoffice.ui.adapter;
import android.view.View;
import android.view.ViewGroup;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.mesBean.ProBadBean;
import com.wd.workoffice.bean.mesBean.ReportProBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
import flexible.xd.android_base.utils.ScreenUtils;
/**
* Created by flexible on 2018/8/13.
*/
public class ReportProTopAdapter extends BaseQuickAdapter<ReportProBean.DataBean, BaseViewHolder> {
double bigValue;
int width = ScreenUtils.getScreenWidth() / 2;
public ReportProTopAdapter(int layoutResId, List<ReportProBean.DataBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ReportProBean.DataBean item) {
View progress = helper.getView(R.id.view_progress);
ViewGroup.LayoutParams layoutParams = progress.getLayoutParams();
if (helper.getAdapterPosition() == 0) {
bigValue = item.getScrapCount();
layoutParams.width = width;
} else {
if (item.getScrapCount() == 0d) {
layoutParams.width = 0;
} else {
int lastWidth = Integer.parseInt(MathUtils.multiply(String.valueOf(item.getScrapCount() / bigValue), width + "", 0));
if (lastWidth == 0) {
lastWidth = lastWidth + 5;
}
layoutParams.width = lastWidth;
}
}
helper.setText(R.id.tv_name, item.getProductName());
}
}
......@@ -22,7 +22,7 @@ import flexible.xd.android_base.utils.ScreenUtils;
public class ReportTopAdapter extends BaseQuickAdapter<ProBadBean.DataBean, BaseViewHolder> {
double bigValue;
int width= ScreenUtils.getScreenWidth()/2;
int width = ScreenUtils.getScreenWidth() / 2;
public ReportTopAdapter(int layoutResId, List<ProBadBean.DataBean> data) {
super(layoutResId, data);
......@@ -34,12 +34,15 @@ public class ReportTopAdapter extends BaseQuickAdapter<ProBadBean.DataBean, Base
ViewGroup.LayoutParams layoutParams = progress.getLayoutParams();
if (helper.getAdapterPosition() == 0) {
bigValue = item.getScrapWeight();
layoutParams.width=width;
layoutParams.width = width;
} else {
if (item.getScrapWeight() == 0d) {
layoutParams.width = 0;
} else {
int lastWidth = Integer.parseInt(MathUtils.multiply(String.valueOf(item.getScrapWeight()/bigValue), width + "", 0));
int lastWidth = Integer.parseInt(MathUtils.multiply(String.valueOf(item.getScrapWeight() / bigValue), width + "", 0));
if (lastWidth == 0) {
lastWidth = lastWidth + 5;
}
layoutParams.width = lastWidth;
}
}
......
......@@ -12,8 +12,8 @@
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Light"
android:background="#FF3F84CD"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:contentInsetEnd="0mm"
app:contentInsetEndWithActions="0mm"
app:contentInsetLeft="0mm"
......@@ -70,28 +70,44 @@
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_time"
android:layout_width="100mm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25mm"
android:background="@drawable/shape_mes_time"
android:gravity="center"
android:paddingVertical="4mm">
<TextView
android:id="@+id/tv_time"
android:id="@+id/tv_first_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4mm"
android:text="请选择时间"
android:textColor="#ff637298"
android:drawableRight="@mipmap/arrow_down"
android:gravity="center_vertical"
android:paddingVertical="13mm"
android:text="开始时间"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:gravity="center_vertical"
android:text="~" />
<TextView
android:id="@+id/tv_first_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@mipmap/arrow_down"
android:gravity="center_vertical"
android:paddingVertical="13mm"
android:text="结束时间"
android:textSize="13sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="14mm"
android:src="@mipmap/mes_time_down" />
</LinearLayout>
<androidx.cardview.widget.CardView
......@@ -134,14 +150,14 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="排名"
android:text="品种"
android:textSize="14sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="产品名称"
android:layout_weight="3"
android:text="报废原因"
android:textSize="14sp" />
<TextView
......@@ -150,6 +166,13 @@
android:layout_weight="2"
android:text="废品重量(kg)"
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4mm"
android:visibility="invisible"
android:src="@mipmap/arrow_right_gray"
android:textSize="14sp" />
</LinearLayout>
<androidx.cardview.widget.CardView
......@@ -187,13 +210,14 @@
android:layout_height="wrap_content"
android:background="@android:color/white"
android:gravity="center">
<TextView
android:id="@+id/tv_dept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15mm"
android:drawableRight="@mipmap/arrow_down"
android:gravity="center_vertical"
android:layout_marginHorizontal="15mm"
android:paddingVertical="13mm"
android:text="选择工厂"
android:textSize="13sp" />
......@@ -227,7 +251,6 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -240,7 +263,6 @@
android:layout_weight="1"
android:gravity="center"
android:text="订单单号"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
......@@ -249,7 +271,6 @@
android:layout_weight="1"
android:gravity="center"
android:text="产品编号"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
......@@ -258,7 +279,6 @@
android:layout_weight="1"
android:gravity="center"
android:text="不良率"
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_report"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15mm"
android:layout_marginTop="20mm"
app:cardCornerRadius="3dp"
app:cardElevation="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="17mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="产品报废数量排行"
android:textColor="#ff3f84cd"
android:textSize="15sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30mm"
android:layout_marginTop="20mm">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:text="指令单号"
android:textSize="14sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="产品名称"
android:textSize="14sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="报废数量"
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4mm"
android:visibility="invisible"
android:src="@mipmap/arrow_right_gray"
android:textSize="14sp" />
</LinearLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15mm"
android:layout_marginTop="10mm"
app:cardCornerRadius="3dp"
app:cardElevation="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="17mm">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_pro_bad"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="40mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="品种"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="废品数量(支)"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="废品重量(kg)"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_weight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="废品率"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_bad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="系数"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_coefficient"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<!-- <View style="@style/dividerX" />-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="价格"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<!-- <View style="@style/dividerX" />-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_order_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<!-- <View style="@style/dividerX" />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:paddingVertical="10mm"
android:text="报废原因"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_reason"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:background="@drawable/shape_confirm_order"
android:minLines="4"
android:paddingVertical="10mm" />
<View style="@style/dividerX" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:paddingVertical="10mm"
android:text="不符合要求代价"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_cost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:background="@drawable/shape_confirm_order"
android:minLines="4"
android:paddingVertical="10mm" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<Button
android:id="@+id/btn_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10mm"
android:background="@drawable/shape_blue_btn"
android:paddingHorizontal="10mm"
android:text="查看产品报废排行"
android:textColor="@color/white"
android:textSize="13sp" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="40mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="制令单号"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_no"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="产品名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_pro_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="产品编码"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_pro_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_img_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="单价"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="损失金额"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_lost_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" /><LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_order_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" /><LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="报废率"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_rate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" /><LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="完工数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_finish_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="1111"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:paddingVertical="10mm"
android:text="报废原因"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_reason"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:background="@drawable/shape_confirm_order"
android:minLines="4"
android:paddingVertical="10mm" />
<View style="@style/dividerX" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="12mm">
<TextView
android:id="@+id/tv_rank"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:text="排名"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_pro_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="产品名称"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_weight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="废品重量(kg)"
android:gravity="center"
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4mm"
android:src="@mipmap/arrow_right_gray"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
</LinearLayout>
\ No newline at end of file
......@@ -24,7 +24,7 @@
android:id="@+id/tv_pro_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:layout_weight="3"
android:text="产品名称"
android:textSize="14sp" />
......@@ -34,6 +34,13 @@
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="废品重量(kg)"
android:gravity="center"
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4mm"
android:src="@mipmap/arrow_right_gray"
android:textSize="14sp" />
</LinearLayout>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论