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

1.质量工单列表

2.TODO 单独菜单
上级 1c516f0e
......@@ -2466,6 +2466,16 @@
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.work.QualityWorkActivity"
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"
......
package com.wd.workoffice.bean.mesBean;
import com.alibaba.fastjson.annotation.JSONField;
import com.wd.workoffice.app.BaseMesPageBean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WokrOrderBean extends BaseMesPageBean {
private List<ListBean> list;
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public static class ListBean {
/**
* id : 0a062314e35c11ea8334fa163e1166bd
* createDateTime : 1597979503000
* updateDateTime : 1597980500000
* woCode : GD20082100001
* description : 1
* locationId : f4765abfdab011ea8334fa163e1166bd
* assetId : null
* parentId : null
* failureCodeId : null
* questionId : null
* workType : 2
* woType : 1
* status : 5
* siteId : 076068cfffa211e98334fa163e1166bd
* shutDown : true
* shutdownTime : null
* recoveryTime : null
* grant : true
* materiel : true
* detailedInformation : 1
* schedStart : null
* schedFinish : null
* actStart : null
* actFinish : null
* pmCode : null
* standardOperation : null
* delete : false
* createBy : 398c852b38e911ea8334fa163e1166bd
* changeBy : 398c852b38e911ea8334fa163e1166bd
* failureCode : null
* failureName : null
* questionCode : null
* questionName : null
* parentCode : null
* parentName : null
* locationCode : HW
* locationName : 测试
* assetCode : null
* assetName : null
* siteCode : ZW
* siteName : 正望钢水集团
* linkedNumberId : 697eccdb9e5f11ea8334fa163e1166bd
* linkedNumber : DJB2005251003
* createName : hello
* procId : 1227505
* approved : null
*/
private String id;
private long createDateTime;
private long updateDateTime;
private String woCode;
private String description;
private String locationId;
private Object assetId;
private Object parentId;
private Object failureCodeId;
private Object questionId;
private int workType;
private int woType;
private int status;
private String siteId;
private boolean shutDown;
private Object shutdownTime;
private Object recoveryTime;
private boolean grant;
private boolean materiel;
private String detailedInformation;
private Object schedStart;
private Object schedFinish;
private Object actStart;
private Object actFinish;
private Object pmCode;
private Object standardOperation;
private boolean delete;
private String createBy;
private String changeBy;
private Object failureCode;
private Object failureName;
private Object questionCode;
private Object questionName;
private Object parentCode;
private Object parentName;
private String locationCode;
private String locationName;
private Object assetCode;
private Object assetName;
private String siteCode;
private String siteName;
private String linkedNumberId;
private String linkedNumber;
private String createName;
private String procId;
private Object approved;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
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 getWoCode() {
return woCode;
}
public void setWoCode(String woCode) {
this.woCode = woCode;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLocationId() {
return locationId;
}
public void setLocationId(String locationId) {
this.locationId = locationId;
}
public Object getAssetId() {
return assetId;
}
public void setAssetId(Object assetId) {
this.assetId = assetId;
}
public Object getParentId() {
return parentId;
}
public void setParentId(Object parentId) {
this.parentId = parentId;
}
public Object getFailureCodeId() {
return failureCodeId;
}
public void setFailureCodeId(Object failureCodeId) {
this.failureCodeId = failureCodeId;
}
public Object getQuestionId() {
return questionId;
}
public void setQuestionId(Object questionId) {
this.questionId = questionId;
}
public int getWorkType() {
return workType;
}
public void setWorkType(int workType) {
this.workType = workType;
}
public int getWoType() {
return woType;
}
public void setWoType(int woType) {
this.woType = woType;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getSiteId() {
return siteId;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public boolean isShutDown() {
return shutDown;
}
public void setShutDown(boolean shutDown) {
this.shutDown = shutDown;
}
public Object getShutdownTime() {
return shutdownTime;
}
public void setShutdownTime(Object shutdownTime) {
this.shutdownTime = shutdownTime;
}
public Object getRecoveryTime() {
return recoveryTime;
}
public void setRecoveryTime(Object recoveryTime) {
this.recoveryTime = recoveryTime;
}
public boolean isGrant() {
return grant;
}
public void setGrant(boolean grant) {
this.grant = grant;
}
public boolean isMateriel() {
return materiel;
}
public void setMateriel(boolean materiel) {
this.materiel = materiel;
}
public String getDetailedInformation() {
return detailedInformation;
}
public void setDetailedInformation(String detailedInformation) {
this.detailedInformation = detailedInformation;
}
public Object getSchedStart() {
return schedStart;
}
public void setSchedStart(Object schedStart) {
this.schedStart = schedStart;
}
public Object getSchedFinish() {
return schedFinish;
}
public void setSchedFinish(Object schedFinish) {
this.schedFinish = schedFinish;
}
public Object getActStart() {
return actStart;
}
public void setActStart(Object actStart) {
this.actStart = actStart;
}
public Object getActFinish() {
return actFinish;
}
public void setActFinish(Object actFinish) {
this.actFinish = actFinish;
}
public Object getPmCode() {
return pmCode;
}
public void setPmCode(Object pmCode) {
this.pmCode = pmCode;
}
public Object getStandardOperation() {
return standardOperation;
}
public void setStandardOperation(Object standardOperation) {
this.standardOperation = standardOperation;
}
public boolean isDelete() {
return delete;
}
public void setDelete(boolean delete) {
this.delete = delete;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getChangeBy() {
return changeBy;
}
public void setChangeBy(String changeBy) {
this.changeBy = changeBy;
}
public Object getFailureCode() {
return failureCode;
}
public void setFailureCode(Object failureCode) {
this.failureCode = failureCode;
}
public Object getFailureName() {
return failureName;
}
public void setFailureName(Object failureName) {
this.failureName = failureName;
}
public Object getQuestionCode() {
return questionCode;
}
public void setQuestionCode(Object questionCode) {
this.questionCode = questionCode;
}
public Object getQuestionName() {
return questionName;
}
public void setQuestionName(Object questionName) {
this.questionName = questionName;
}
public Object getParentCode() {
return parentCode;
}
public void setParentCode(Object parentCode) {
this.parentCode = parentCode;
}
public Object getParentName() {
return parentName;
}
public void setParentName(Object parentName) {
this.parentName = parentName;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public String getLocationName() {
return locationName;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
}
public Object getAssetCode() {
return assetCode;
}
public void setAssetCode(Object assetCode) {
this.assetCode = assetCode;
}
public Object getAssetName() {
return assetName;
}
public void setAssetName(Object assetName) {
this.assetName = assetName;
}
public String getSiteCode() {
return siteCode;
}
public void setSiteCode(String siteCode) {
this.siteCode = siteCode;
}
public String getSiteName() {
return siteName;
}
public void setSiteName(String siteName) {
this.siteName = siteName;
}
public String getLinkedNumberId() {
return linkedNumberId;
}
public void setLinkedNumberId(String linkedNumberId) {
this.linkedNumberId = linkedNumberId;
}
public String getLinkedNumber() {
return linkedNumber;
}
public void setLinkedNumber(String linkedNumber) {
this.linkedNumber = linkedNumber;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
public String getProcId() {
return procId;
}
public void setProcId(String procId) {
this.procId = procId;
}
public Object getApproved() {
return approved;
}
public void setApproved(Object approved) {
this.approved = approved;
}
}
}
\ No newline at end of file
package com.wd.workoffice.bean.workEnum;
import android.text.TextUtils;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public enum WorkOrder {
DRAFT("草稿", 1), PENDING("待审批", 2),
PROCESSING("处理中", 3), FINISH("已完成", 4), REFUSE("已驳回", 5);
private String name;
private Integer code;
WorkOrder(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void Integer(Integer code) {
this.code = code;
}
public static String getNameByCode(int code){
String name = "";
for (WorkOrder value : WorkOrder.values()) {
if (value.getCode() == code) {
name = value.getName();
}
}
return name;
}
}
......@@ -660,6 +660,15 @@ public interface MesApiService {
@POST("/himes/api/mpsProduct/show/getBySingleCode/list.json")
Observable<BaseMesBean> getMpsProductByBasket(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* 质量工单
*
* @return
*/
@POST("/himes/api/workOrder/show/pageWorkOrder.json")
Observable<BaseMesBean> pageWorkOrder(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* 用户信息采集历史详情
*
......
package com.wd.workoffice.ui.activity.mes.work;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.bean.mesBean.QualityTraceabilityBean;
import com.wd.workoffice.bean.mesBean.WokrOrderBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.mes.QualityTraceabilityDetailActivity;
import com.wd.workoffice.ui.adapter.QualityTraceabilityAdapter;
import com.wd.workoffice.ui.adapter.QualityWorkAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
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 QualityWorkActivity extends WorkBaseActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private int page = 1;
private Map<String, Object> param;
private List<WokrOrderBean.ListBean> dataList;
private QualityWorkAdapter dataAdapter;
private Map<String, Object> paramMap;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new QualityWorkAdapter(R.layout.item_quality_work, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageMesKey();
param.put("pageNum", 1);
paramMap = WorkUtils.simpleParam();
param.put("paramMap", paramMap);
getData();
}
private void getData() {
RtfUtils.getMesRtf().pageWorkOrder("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<WokrOrderBean.ListBean> getList = JSON.parseObject(data.getData().toString(), WokrOrderBean.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
protected void initEvent() {
srlRefresh.setOnRefreshListener(refreshLayout -> {
page = 1;
param.put("pageNum", page);
getData();
});
dataAdapter.setOnLoadMoreListener(() -> {
param.put("pageNum", page);
getData();
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(QualityTraceabilityDetailActivity.class, "info",
JSON.toJSONString(dataList.get(position)));
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
}
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.QualityTraceabilityBean;
import com.wd.workoffice.bean.mesBean.WokrOrderBean;
import com.wd.workoffice.bean.workEnum.WorkOrder;
import java.util.List;
import flexible.xd.android_base.utils.TimeUtils;
/**
* Created by flexible on 2018/8/13.
*/
public class QualityWorkAdapter extends BaseQuickAdapter<WokrOrderBean.ListBean, BaseViewHolder> {
public QualityWorkAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WokrOrderBean.ListBean item) {
helper.setText(R.id.tv_no, String.format("工单:%s", item.getWoCode()));
helper.setText(R.id.tv_status, WorkOrder.getNameByCode(item.getStatus()));
helper.setText(R.id.tv_location, item.getSiteName());
helper.setText(R.id.tv_position, item.getLocationName());
helper.setText(R.id.tv_time, TimeUtils.millis2String(item.getCreateDateTime()));
}
}
......@@ -7,12 +7,14 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.vo.BatLayoutVo;
import com.wd.workoffice.ui.activity.mes.MesFeedbackActivity;
import com.wd.workoffice.ui.activity.mes.repair.MesServiceActivity;
import com.wd.workoffice.ui.activity.mes.QualityTraceabilityActivity;
import com.wd.workoffice.ui.activity.mes.analysis.MesAnalysisActivity;
import com.wd.workoffice.ui.activity.mes.order.MesOrderProcessActivity;
import com.wd.workoffice.ui.activity.mes.report.MesReportActivity;
import com.wd.workoffice.ui.activity.mes.ticket.MesTicketActivity;
import com.wd.workoffice.ui.activity.mes.work.QualityWorkActivity;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
import com.wd.workoffice.util.WorkUtils;
......@@ -40,13 +42,13 @@ public class MesFragment extends WorkBaseFg {
// R.mipmap.mes_icon5, R.mipmap.mes_icon6, R.mipmap.mes_icon7, R.mipmap.mes_icon8,
// R.mipmap.mes_icon9, R.mipmap.mes_icon10, R.mipmap.mes_icon10};
int[] dataImg = new int[]{R.mipmap.mes_icon1, R.mipmap.mes_icon2, R.mipmap.mes_icon3, R.mipmap.mes_icon4,
R.mipmap.mes_icon5,
R.mipmap.mes_icon5, R.mipmap.mes_icon8,
R.mipmap.mes_icon9,R.mipmap.mes_icon10};
// String[] dataName = new String[]{"订单追踪", "质量报表", "质量分析", "质量绩效",
// "质量追溯", "质量反馈", "过程检测", "报废管理", "检维修记录", "设备监控"
// , "工单管理"};
String[] dataName = new String[]{"订单追踪", "质量报表", "缺陷字典", "质量绩效",
"质量追溯", "检维修记录"
"质量追溯", "质量工单","检维修记录"
, "市场服务"};
......@@ -117,15 +119,15 @@ public class MesFragment extends WorkBaseFg {
break;
case 5:
// startActivity(MesFeedbackActivity.class);
startActivity(MesServiceActivity.class);
startActivity(QualityWorkActivity.class);
break;
case 6:
// startActivity(MesProcessActivity.class);
startActivity(MesTicketActivity.class);
startActivity(MesServiceActivity.class);
break;
case 7:
// startActivity(MesScrappedActivity.class);
startActivity(MesTicketActivity.class);
break;
case 8:
// startActivity(MesServiceActivity.class);
......
<?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:layout_centerHorizontal="true"
android:layout_margin="8mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingTop="10mm"
android:paddingBottom="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm">
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="工单:"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#0841F0"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="地点:"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5mm"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="位置:"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5mm"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="创建时间:"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5mm"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论