提交 fee4a851 authored 作者: flexiblexd@163.com's avatar flexiblexd@163.com

1.工单

上级 2c98b13f
......@@ -2656,6 +2656,16 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.work.WorkTaskActivity"
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.ui.activity.mes.work;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import com.alibaba.fastjson.JSON;
......@@ -9,17 +7,17 @@ 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.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.QualityTraceabilityBean;
import com.wd.workoffice.bean.event.ChangeStatus;
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 org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -137,4 +135,23 @@ public class QualityWorkActivity extends WorkToolBarActivity {
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(ChangeStatus event) {
page = 1;
param.put("pageNum", page);
getData();
}
}
......@@ -6,9 +6,13 @@ import android.text.TextUtils;
import com.google.android.material.tabs.TabLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.ChangeStatus;
import com.wd.workoffice.ui.adapter.VpDataAdapter;
import com.wd.workoffice.ui.fg.MesOrderFragment;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
......@@ -71,6 +75,7 @@ public class WorkOrderDetailActivity extends WorkToolBarActivity {
for (int i = 0; i < tab.size(); i++) {
tlTab.getTabAt(i).setText(tab.get(i));
}
vpData.setOffscreenPageLimit(data.size());
}
@Override
......@@ -82,4 +87,20 @@ public class WorkOrderDetailActivity extends WorkToolBarActivity {
return R.layout.activity_order;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(ChangeStatus event) {
finish();
}
}
package com.wd.workoffice.ui.activity.mes.work;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
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.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.FaultTypeBean;
import com.wd.workoffice.bean.mesBean.WorkFactoryBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.FauliTypeAdapter;
import com.wd.workoffice.ui.adapter.WorkDepManageAdapter;
import com.wd.workoffice.ui.adapter.WorkFactoryAdapter;
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 butterknife.OnClick;
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 WorkOrderFacotySearchActivity extends WorkToolBarActivity {
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_client)
RecyclerView rvClient;
private Map<String, Object> param;
private List<WorkFactoryBean.SitesBean> clientList;
private WorkFactoryAdapter clientAdapter;
private int page = 1;
private Map<String, Object> paramMap;
@Override
protected void initView() {
ButterKnife.bind(this);
rvClient.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new WorkFactoryAdapter(R.layout.item_fault_search, clientList);
clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageMesKey();
paramMap = WorkUtils.simpleParam();
// paramMap.put("parentId", getIntent().getStringExtra("id"));
param.put("paramMap", paramMap);
param.put("pageNum", 1);
getData();
}
private void getData() {
RtfUtils.getMesRtf().removes("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<WorkFactoryBean.SitesBean> getList = JSON.parseObject(data.getData().toString(), WorkFactoryBean.class).getSites();
// if (page == 1) {
clientList.clear();
clientList.addAll(getList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
// } else {
// clientAdapter.loadMoreComplete();
// clientList.addAll(getList);
// clientAdapter.notifyDataSetChanged();
// }
// if (getList.size() == 0) {
// clientAdapter.loadMoreEnd();
// } else {
// page++;
// }
toast("搜索成功");
}
});
}
@Override
protected void initEvent() {
// clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
// @Override
// public void onLoadMoreRequested() {
// param.put("pageNum", page);
// getData();
// }
// }, rvClient);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("data", JSON.toJSONString(clientList.get(position)));
setResult(10001, intent);
finish();
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_mes_fault_search;
}
@OnClick(R.id.btn_search)
public void onViewClicked() {
paramMap.put("siteCode", etKey.getText().toString());
param.put("pageNum", 1);
page = 1;
getData();
}
}
package com.wd.workoffice.ui.activity.mes.work;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
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.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.WorkFactoryBean;
import com.wd.workoffice.bean.mesBean.WorkLocationBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkFactoryAdapter;
import com.wd.workoffice.ui.adapter.WorkLocationAdapter;
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 butterknife.OnClick;
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 WorkOrderLocationSearchActivity extends WorkToolBarActivity {
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_client)
RecyclerView rvClient;
private Map<String, Object> param;
private List<WorkLocationBean.ListBean> clientList;
private WorkLocationAdapter clientAdapter;
private int page = 1;
private Map<String, Object> paramMap;
@Override
protected void initView() {
ButterKnife.bind(this);
rvClient.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new WorkLocationAdapter(R.layout.item_fault_search, clientList);
clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageMesKey();
paramMap = WorkUtils.simpleParam();
paramMap.put("siteId", getIntent().getStringExtra("id"));
param.put("paramMap", paramMap);
param.put("pageNum", 1);
getData();
}
private void getData() {
RtfUtils.getMesRtf().astlocations("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<WorkLocationBean.ListBean> getList = JSON.parseObject(data.getData().toString(), WorkLocationBean.class).getList();
if (page == 1) {
clientList.clear();
clientList.addAll(getList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(getList);
clientAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
toast("搜索成功");
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("pageNum", page);
getData();
}
}, rvClient);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("data", JSON.toJSONString(clientList.get(position)));
setResult(10001, intent);
finish();
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_mes_fault_search;
}
@OnClick(R.id.btn_search)
public void onViewClicked() {
paramMap.put("locationName", etKey.getText().toString());
param.put("pageNum", 1);
page = 1;
getData();
}
}
package com.wd.workoffice.ui.activity.mes.work;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
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.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.WorkLocationBean;
import com.wd.workoffice.bean.mesBean.WorkMachineBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkLocationAdapter;
import com.wd.workoffice.ui.adapter.WorkMarchineAdapter;
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 butterknife.OnClick;
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 WorkOrderMachineSearchActivity extends WorkToolBarActivity {
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_client)
RecyclerView rvClient;
private Map<String, Object> param;
private List<WorkMachineBean.ListBean> clientList;
private WorkMarchineAdapter clientAdapter;
private int page = 1;
private Map<String, Object> paramMap;
@Override
protected void initView() {
ButterKnife.bind(this);
rvClient.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new WorkMarchineAdapter(R.layout.item_fault_search, clientList);
clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageMesKey();
paramMap = WorkUtils.simpleParam();
paramMap.put("locationId", getIntent().getStringExtra("id"));
param.put("paramMap", paramMap);
param.put("pageNum", 1);
getData();
}
private void getData() {
RtfUtils.getMesRtf().astasset("aa8faf47c93311e98334fa163e1166bd", 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<WorkMachineBean.ListBean> getList = JSON.parseObject(data.getData().toString(), WorkMachineBean.class).getList();
if (page == 1) {
clientList.clear();
clientList.addAll(getList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(getList);
clientAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
toast("搜索成功");
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("pageNum", page);
getData();
}
}, rvClient);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("data", JSON.toJSONString(clientList.get(position)));
setResult(10001, intent);
finish();
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_mes_fault_search;
}
@OnClick(R.id.btn_search)
public void onViewClicked() {
paramMap.put("description", etKey.getText().toString());
param.put("pageNum", 1);
page = 1;
getData();
}
}
package com.wd.workoffice.ui.activity.mes.work;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.WorkLinkBean;
import com.wd.workoffice.bean.mesBean.WorkMachineBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkLinkAdapter;
import com.wd.workoffice.ui.adapter.WorkMarchineAdapter;
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 butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* 关联单号
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkOrderNoSearchActivity extends WorkToolBarActivity {
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_client)
RecyclerView rvClient;
private Map<String, Object> param;
private List<JSONObject> clientList;
private WorkLinkAdapter clientAdapter;
private int page = 1;
private Map<String, Object> paramMap;
private String type;
@Override
protected void initView() {
ButterKnife.bind(this);
rvClient.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
type = getIntent().getStringExtra("type");
clientList = new ArrayList<>();
clientAdapter = new WorkLinkAdapter(R.layout.item_fault_search, clientList);
clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageMesKey();
paramMap = WorkUtils.simpleParam();
paramMap.put("chooseLocation", getIntent().getStringExtra("id"));
param.put("paramMap", paramMap);
param.put("pageNum", 1);
getData();
}
private void getData() {
Observable<BaseMesBean> modinspo = RtfUtils.getMesRtf().modinspo("1", WorkUtils.convertMapToBody(param));
switch (type) {
case "1":
modinspo = RtfUtils.getMesRtf().modinspo("1", WorkUtils.convertMapToBody(param));
break;
case "2":
modinspo = RtfUtils.getMesRtf().spotCheckBillList("1", WorkUtils.convertMapToBody(param));
break;
case "4":
modinspo = RtfUtils.getMesRtf().opmreportErrorList("1", WorkUtils.convertMapToBody(param));
break;
case "5":
modinspo = RtfUtils.getMesRtf().pjmproject("1", WorkUtils.convertMapToBody(param));
break;
}
modinspo.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<JSONObject> covertList = new ArrayList<>();
switch (type) {
case "1":
List<WorkLinkBean.ListBean> oneLinkList = JSON.parseObject(data.getData().toString(), WorkLinkBean.class).getList();
for (WorkLinkBean.ListBean linkBean : oneLinkList) {
JSONObject link = new JSONObject();
link.put("name", linkBean.getDescription());
link.put("code", linkBean.getInspoCode());
link.put("id", linkBean.getId());
covertList.add(link);
}
break;
case "2":
List<WorkLinkBean.ListBean> twoList = JSON.parseObject(data.getData().toString(), WorkLinkBean.class).getList();
for (WorkLinkBean.ListBean linkBean : twoList) {
JSONObject link = new JSONObject();
link.put("name", linkBean.getBillDescription());
link.put("code", linkBean.getBillNum());
link.put("id", linkBean.getId());
covertList.add(link);
}
break;
case "4":
List<WorkLinkBean.ListBean> fourList = JSON.parseObject(data.getData().toString(), WorkLinkBean.class).getList();
for (WorkLinkBean.ListBean linkBean : fourList) {
JSONObject link = new JSONObject();
link.put("name", linkBean.getDescription());
link.put("code", linkBean.getReportCode());
link.put("id", linkBean.getId());
covertList.add(link);
}
break;
case "5":
List<WorkLinkBean.ListBean> fiveList = JSON.parseObject(data.getData().toString(), WorkLinkBean.class).getList();
for (WorkLinkBean.ListBean linkBean : fiveList) {
JSONObject link = new JSONObject();
link.put("name", linkBean.getDescription());
link.put("code", linkBean.getProjectCode());
link.put("id", linkBean.getId());
covertList.add(link);
} break;
}
if (page == 1) {
clientList.clear();
clientList.addAll(covertList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(covertList);
clientAdapter.notifyDataSetChanged();
}
if (covertList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
toast("搜索成功");
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("pageNum", page);
getData();
}
}, rvClient);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("data", JSON.toJSONString(clientList.get(position)));
setResult(10001, intent);
finish();
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_mes_fault_search;
}
@OnClick(R.id.btn_search)
public void onViewClicked() {
paramMap.put("description", etKey.getText().toString());
param.put("pageNum", 1);
page = 1;
getData();
}
}
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.FaultTypeBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class FauliTypeAdapter extends BaseQuickAdapter<FaultTypeBean.ListBean, BaseViewHolder> {
public FauliTypeAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, FaultTypeBean.ListBean item) {
helper.setText(R.id.tv_content1, item.getFailureCode());
helper.setText(R.id.tv_content2, item.getDescription());
}
}
......@@ -30,15 +30,19 @@ public class MesServiceStandardAdapter extends BaseQuickAdapter<ServiceStandardB
@Override
protected void convert(BaseViewHolder helper, ServiceStandardBean.ListBean item) {
if (TextUtils.isEmpty(type)){
if (TextUtils.isEmpty(type)) {
helper.setText(R.id.tv_name, String.format("检查项目:%s", item.getCheckProject()));
helper.setText(R.id.tv_status, TextUtils.equals(item.getStatus(), "1") ? "异常" : "正常");//1 异常 0正常
if (!TextUtils.isEmpty(item.getStatus())) {
helper.setText(R.id.tv_status, TextUtils.equals(item.getStatus(), "1") ? "异常" : "正常");//1 异常 0正常
}
helper.setText(R.id.tv_content1, item.getProcessStandard());
helper.setText(R.id.tv_content2, item.getMeasurementUnit());
helper.setText(R.id.tv_content3, item.getFailureCode());
}else {
} else {
helper.setText(R.id.tv_name, String.format("检查项目:%s", item.getInspoProDescription()));
helper.setText(R.id.tv_status, TextUtils.equals(item.getStatus(), "1") ? "异常" : "正常");//1 异常 0正常
if (!TextUtils.isEmpty(item.getStatus())) {
helper.setText(R.id.tv_status, TextUtils.equals(item.getStatus(), "1") ? "异常" : "正常");//1 异常 0正常
}
helper.setText(R.id.tv_content1, item.getProcessStandard());
helper.setText(R.id.tv_content2, item.getUint());
helper.setText(R.id.tv_content3, item.getReportCode());
......
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.FaultTypeBean;
import com.wd.workoffice.bean.mesBean.WorkFactoryBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkFactoryAdapter extends BaseQuickAdapter<WorkFactoryBean.SitesBean, BaseViewHolder> {
public WorkFactoryAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WorkFactoryBean.SitesBean item) {
helper.setText(R.id.tv_content1, item.getSiteCode());
helper.setText(R.id.tv_content2, item.getSiteName());
}
}
package com.wd.workoffice.ui.adapter;
import com.alibaba.fastjson.JSONObject;
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.WorkLinkBean;
import com.wd.workoffice.bean.mesBean.WorkMachineBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkLinkAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder> {
public WorkLinkAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, JSONObject item) {
helper.setText(R.id.tv_content1, item.getString("name"));
helper.setText(R.id.tv_content2, item.getString("code"));
}
}
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.FaultTypeBean;
import com.wd.workoffice.bean.mesBean.WorkLocationBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkLocationAdapter extends BaseQuickAdapter<WorkLocationBean.ListBean, BaseViewHolder> {
public WorkLocationAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WorkLocationBean.ListBean item) {
helper.setText(R.id.tv_content1, item.getLocationCode());
helper.setText(R.id.tv_content2, item.getLocationName());
}
}
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.WorkLocationBean;
import com.wd.workoffice.bean.mesBean.WorkMachineBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkMarchineAdapter extends BaseQuickAdapter<WorkMachineBean.ListBean, BaseViewHolder> {
public WorkMarchineAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, WorkMachineBean.ListBean item) {
helper.setText(R.id.tv_content1, item.getAssetCode());
helper.setText(R.id.tv_content2, item.getDescription());
}
}
......@@ -27,6 +27,8 @@ public class WorkOrderTaskAdapter extends BaseQuickAdapter<WorkTaskBean.ListBean
helper.setText(R.id.tv_status, WorkOrder.getNameByCode(item.getStatus()));
helper.setText(R.id.tv_desc, item.getDescription());
helper.setText(R.id.tv_time, item.getTime()+"");
helper.addOnClickListener(R.id.tv_delete);
helper.addOnClickListener(R.id.tv_edit);
}
}
......@@ -55,4 +55,14 @@ public class PickTimeUtils {
setSubCalSize(16);
return pvTime.build();
}
public static TimePickerView showPickTime(Context ctx, OnTimeSelectListener listener, boolean todayStart) {
TimePickerBuilder pvTime = new TimePickerBuilder(ctx, listener);
if (todayStart) {
pvTime.setRangDate(Calendar.getInstance(), null);
}
pvTime.setType(new boolean[]{false, false, false, true, true, true}).setTitleSize(16).setContentTextSize(16).
setSubCalSize(16);
// .setRangDate(startDate, endDate);
return pvTime.build();
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<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:background="@color/white"
android:orientation="horizontal"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_client_search"
android:gravity="center_vertical"
android:paddingHorizontal="10mm">
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/client_search" />
<EditText
android:id="@+id/et_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2mm"
android:background="@null"
android:hint="搜索"
android:textColor="#91ABBA"
android:textColorHint="#91ABBA"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_search"
android:layout_width="60mm"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@color/mainTextColor"
android:text="搜索"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_client"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4mm">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -188,9 +188,11 @@
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<View style="@style/dividerX"
android:visibility="gone"/>
<RelativeLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -449,7 +451,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
......
......@@ -300,6 +300,7 @@
android:textSize="16sp" />
<RelativeLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -326,6 +327,7 @@
<View style="@style/dividerX" />
<RelativeLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -352,7 +354,6 @@
<View style="@style/dividerX" />
<RelativeLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -379,7 +380,7 @@
<View style="@style/dividerX" />
<RelativeLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......
......@@ -220,6 +220,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="待提交"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</RelativeLayout>
......@@ -417,7 +418,8 @@
<View style="@style/dividerX" />
<RelativeLayout
<LinearLayout
android:id="@+id/ll_recover_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -434,12 +436,18 @@
<TextView
android:id="@+id/tv_recover_time"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
<View style="@style/dividerX" />
......
......@@ -213,7 +213,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设备故障活故障代码"
android:text="缺陷或故障代码"
android:textSize="14sp" />
<TextView
......
<?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">
<LinearLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="60mm"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10mm"
android:background="@color/blue_btn"
android:paddingHorizontal="20mm"
android:paddingVertical="5mm"
android:text="取消"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10mm"
android:background="@color/blue_btn"
android:paddingHorizontal="20mm"
android:paddingVertical="5mm"
android:text="保存"
android:textColor="@color/white" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:orientation="vertical"
android:paddingBottom="20mm">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/flexible_background"
android:paddingVertical="10mm"
android:paddingLeft="10mm"
android:text="基本信息"
android:textSize="16sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任务号"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="描述"
android:textSize="14sp" />
<EditText
android:id="@+id/tv_desc"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@null"
android:hint="请输入"
android:gravity="right"
android:layout_height="wrap_content"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="估计持续时间(h)"
android:textSize="14sp" />
<EditText
android:id="@+id/tv_time"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@null"
android:hint="请输入"
android:gravity="right"
android:layout_height="wrap_content"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="状态"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="草稿"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
......@@ -136,6 +136,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_add_task"
android:layout_width="150mm"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:background="@color/blue_btn"
android:paddingHorizontal="20mm"
android:paddingVertical="5mm"
android:text="新建工单任务"
android:textColor="@color/white" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
......@@ -123,5 +123,44 @@
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="right"
android:background="@color/white"
android:orientation="horizontal"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:id="@+id/tv_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginRight="10mm"
android:background="@color/blue_btn"
android:paddingHorizontal="20mm"
android:paddingVertical="5mm"
android:text="删除"
android:textColor="@color/white" />
<TextView
android:id="@+id/tv_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:background="@color/blue_btn"
android:paddingHorizontal="20mm"
android:paddingVertical="5mm"
android:text="编辑"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论