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

1.质量缺陷

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 7bcd78af
package com.wd.workoffice.bean.mesBean;
import com.wd.workoffice.app.BaseMesPageBean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class AnalysisBean extends BaseMesPageBean {
/**
* pageNum : 1
* pageSize : 10
* size : 10
* startRow : 1
* endRow : 10
* total : 32
* pages : 4
* list : [{"id":"2c7b57a2755211ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1589786724000,"updateDateTime":1589786724000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2004004","defectName":"1111","productClassType":"1","mainCause":null,"severity":2,"detectionValue":null,"enable":true,"remark":null},{"id":"214a5a0e8d1211ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1589786718000,"updateDateTime":1589786718000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2005001","defectName":"3333333","productClassType":"1","mainCause":"3333333333333333333333","severity":6,"detectionValue":9,"enable":true,"remark":"3333333333333333333333"},{"id":"03d8070d755111ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585880140000,"updateDateTime":1585880140000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2004003","defectName":"111","productClassType":"1","mainCause":null,"severity":3,"detectionValue":2,"enable":true,"remark":null},{"id":"428d5da6725911ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585553828000,"updateDateTime":1585553828000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003012","defectName":"测试数据","productClassType":"0","mainCause":"测试","severity":1,"detectionValue":1,"enable":true,"remark":"测试"},{"id":"b57923256f3311ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585207846000,"updateDateTime":1585207846000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003011","defectName":"33","productClassType":"0","mainCause":"33","severity":6,"detectionValue":1,"enable":true,"remark":"33"},{"id":"9f09994d6f3311ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585207809000,"updateDateTime":1585207809000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003010","defectName":"20","productClassType":"2","mainCause":null,"severity":5,"detectionValue":null,"enable":true,"remark":null},{"id":"8d9c16136f3311ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585207779000,"updateDateTime":1585207779000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003009","defectName":"11","productClassType":"0","mainCause":null,"severity":1,"detectionValue":null,"enable":true,"remark":null},{"id":"bb6ef9e26f3111ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585206997000,"updateDateTime":1585206997000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003008","defectName":"444","productClassType":"1","mainCause":"44","severity":2,"detectionValue":2,"enable":true,"remark":"77"},{"id":"a99c9a616f3111ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585206967000,"updateDateTime":1585206967000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003002","defectName":"444","productClassType":"1","mainCause":"44","severity":2,"detectionValue":2,"enable":true,"remark":"77"},{"id":"8b6ea59d6f3111ea8334fa163e1166bd","delete":false,"createUserId":"398c852b38e911ea8334fa163e1166bd","updateUserId":"398c852b38e911ea8334fa163e1166bd","createDateTime":1585206917000,"updateDateTime":1585206917000,"createbyName":"hello","updateByName":"hello","defectCode":"QX2003001","defectName":"123","productClassType":"1","mainCause":"1","severity":2,"detectionValue":2,"enable":true,"remark":"1"}]
* prePage : 0
* nextPage : 2
* isFirstPage : true
* isLastPage : false
* hasPreviousPage : false
* hasNextPage : true
* navigatePages : 8
* navigatepageNums : [1,2,3,4]
* navigateFirstPage : 1
* navigateLastPage : 4
* firstPage : 1
* lastPage : 4
*/
private List<ListBean> list;
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public static class ListBean {
/**
* id : 2c7b57a2755211ea8334fa163e1166bd
* delete : false
* createUserId : 398c852b38e911ea8334fa163e1166bd
* updateUserId : 398c852b38e911ea8334fa163e1166bd
* createDateTime : 1589786724000
* updateDateTime : 1589786724000
* createbyName : hello
* updateByName : hello
* defectCode : QX2004004
* defectName : 1111
* productClassType : 1
* mainCause : null
* severity : 2
* detectionValue : null
* enable : true
* remark : null
*/
private String id;
private boolean delete;
private String createUserId;
private String updateUserId;
private long createDateTime;
private long updateDateTime;
private String createbyName;
private String updateByName;
private String defectCode;
private String defectName;
private String productClassType;
private Object mainCause;
private int severity;
private Object detectionValue;
private boolean enable;
private Object remark;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public boolean isDelete() {
return delete;
}
public void setDelete(boolean delete) {
this.delete = delete;
}
public String getCreateUserId() {
return createUserId;
}
public void setCreateUserId(String createUserId) {
this.createUserId = createUserId;
}
public String getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(String updateUserId) {
this.updateUserId = updateUserId;
}
public long getCreateDateTime() {
return createDateTime;
}
public void setCreateDateTime(long createDateTime) {
this.createDateTime = createDateTime;
}
public long getUpdateDateTime() {
return updateDateTime;
}
public void setUpdateDateTime(long updateDateTime) {
this.updateDateTime = updateDateTime;
}
public String getCreatebyName() {
return createbyName;
}
public void setCreatebyName(String createbyName) {
this.createbyName = createbyName;
}
public String getUpdateByName() {
return updateByName;
}
public void setUpdateByName(String updateByName) {
this.updateByName = updateByName;
}
public String getDefectCode() {
return defectCode;
}
public void setDefectCode(String defectCode) {
this.defectCode = defectCode;
}
public String getDefectName() {
return defectName;
}
public void setDefectName(String defectName) {
this.defectName = defectName;
}
public String getProductClassType() {
return productClassType;
}
public void setProductClassType(String productClassType) {
this.productClassType = productClassType;
}
public Object getMainCause() {
return mainCause;
}
public void setMainCause(Object mainCause) {
this.mainCause = mainCause;
}
public int getSeverity() {
return severity;
}
public void setSeverity(int severity) {
this.severity = severity;
}
public Object getDetectionValue() {
return detectionValue;
}
public void setDetectionValue(Object detectionValue) {
this.detectionValue = detectionValue;
}
public boolean isEnable() {
return enable;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public Object getRemark() {
return remark;
}
public void setRemark(Object remark) {
this.remark = remark;
}
}
}
......@@ -487,4 +487,11 @@ public interface MesApiService {
@POST("/himes/api/order/show/list.json")
Observable<BaseMesBean> orderList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
@POST("/himes/api/defectdict/show/page.json")
Observable<BaseMesBean> defectdictList(@Query("functionId") String functionId, @Body RequestBody requestBody);
}
package com.wd.workoffice.ui.activity.mes.analysis;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.activity.mes.report.MesReportDetailActivity;
import com.wd.workoffice.bean.mesBean.AnalysisBean;
import com.wd.workoffice.bean.mesBean.SearchBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ReportAnalysisBadAdapter;
import com.wd.workoffice.ui.adapter.ReportBadAdapter;
import com.wd.workoffice.ui.adapter.ReportProBadAdapter;
import com.wd.workoffice.ui.adapter.ReportTopAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.HashMap;
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
......@@ -34,6 +38,11 @@ public class MesAnalysisActivity extends WorkToolBarActivity {
RecyclerView rvProBad;
@BindView(R.id.ll_report)
LinearLayout llReport;
private int page = 1;
private Map<String, Object> param;
private ReportTopAdapter topAdapter;
private ReportAnalysisBadAdapter proBadAdapter;
private List<AnalysisBean.ListBean> proBadList;
@Override
protected void initView() {
......@@ -45,58 +54,61 @@ public class MesAnalysisActivity extends WorkToolBarActivity {
@Override
protected void initData() {
param = WorkUtils.pageMesKey();
page = 1;
param.put("pageNum", page);
Map<String ,Object> paramMap =new HashMap<>();
param.put("paramMap", paramMap);
List<Object> topList = new ArrayList<>();
topList.add(null);
topList.add(null);
topList.add(null);
List<Object> proBadList = new ArrayList<>();
proBadList.add(null);
proBadList.add(null);
proBadList.add(null);
ReportTopAdapter topAdapter = new ReportTopAdapter(R.layout.item_mes_report_top, topList);
ReportAnalysisBadAdapter proBadAdapter = new ReportAnalysisBadAdapter(R.layout.item_mes_analysis, proBadList);
proBadList = new ArrayList<>();
topAdapter = new ReportTopAdapter(R.layout.item_mes_report_top, topList);
proBadAdapter = new ReportAnalysisBadAdapter(R.layout.item_mes_analysis, proBadList);
topAdapter.bindToRecyclerView(rvTop);
proBadAdapter.bindToRecyclerView(rvProBad);
getData();
}
private void getData() {
RtfUtils.getMesRtf().defectdictList("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);
}
// private void getData() {
// RtfUtils.getMesRtf().searchList("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<SearchBean.ListBean> getList = JSON.parseObject(data.getData().toString(), SearchBean.class).getList();
// if (page == 1) {
// srlRefresh.finishRefresh();
// dataList.clear();
// dataList.addAll(getList);
// dataAdapter.notifyDataSetChanged();
// dataAdapter.loadMoreComplete();
// } else {
// dataAdapter.loadMoreComplete();
// dataList.addAll(getList);
// dataAdapter.notifyDataSetChanged();
// }
// if (getList.size() == 0) {
// dataAdapter.loadMoreEnd();
// } else {
// page++;
// }
// }
// }); }
@Override
public void onSuccess(BaseMesBean data) {
hideLoading();
if (!data.isSuccess()) {
toast(data.getMessage());
return;
}
List<AnalysisBean.ListBean> getList = JSON.parseObject(data.getData().toString(), AnalysisBean.class).getList();
if (page == 1) {
proBadList.clear();
proBadList.addAll(getList);
proBadAdapter.notifyDataSetChanged();
proBadAdapter.loadMoreComplete();
} else {
proBadAdapter.loadMoreComplete();
proBadList.addAll(getList);
proBadAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
proBadAdapter.loadMoreEnd();
} else {
page++;
}
}
}); }
@Override
......
......@@ -3,7 +3,10 @@ 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.ProductBean;
import com.wd.workoffice.bean.mesBean.AnalysisBean;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
......@@ -11,7 +14,7 @@ import java.util.List;
* Created by flexible on 2018/8/13.
*/
public class ReportAnalysisBadAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
public class ReportAnalysisBadAdapter extends BaseQuickAdapter<AnalysisBean.ListBean, BaseViewHolder> {
public ReportAnalysisBadAdapter(int layoutResId, List data) {
super(layoutResId, data);
......@@ -19,8 +22,10 @@ public class ReportAnalysisBadAdapter extends BaseQuickAdapter<ProductBean.Recor
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
protected void convert(BaseViewHolder helper, AnalysisBean.ListBean item) {
helper.setText(R.id.tv_bad,item.getSeverity()+"");
helper.setText(R.id.tv_name,item.getDefectName());
helper.setText(R.id.tv_clazz, WorkUtils.getClazzType(item.getProductClassType()));
}
}
......@@ -371,6 +371,25 @@ public class WorkUtils {
return name;
}
public static String getClazzType(String code) {
String name = "";
switch (code) {
case "0":
name = "塞棒";
break;
case "1":
name = "浸入式水口";
break;
case "2":
name = "长水口";
break;
case"3":
name = "其他";
break;
}
return name;
}
/**
* 判断是否有审核权限
*
......
......@@ -78,6 +78,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginHorizontal="30mm"
android:layout_marginTop="20mm">
......@@ -116,7 +117,39 @@
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="12mm">
<TextView
android:id="@+id/tv_bad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" android:textColor="@color/white"
android:text="严重程度"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" android:textColor="@color/white"
android:gravity="center"
android:text="缺陷名称"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_clazz"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" android:textColor="@color/white"
android:gravity="center"
android:text="产品类别"
android:textSize="14sp" />
</LinearLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -8,6 +8,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:paddingVertical="12mm">
<TextView
......@@ -41,7 +42,39 @@
android:text="缺陷数量"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="12mm">
<TextView
android:id="@+id/tv_bad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="严重程度"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="缺陷名称"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_clazz"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="产品类别"
android:textSize="14sp" />
</LinearLayout>
<View
style="@style/dividerX"
/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论