提交 78c1a8ec authored 作者: lgd's avatar lgd

1.检维修记录

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 3ed1b922
...@@ -493,5 +493,15 @@ public interface MesApiService { ...@@ -493,5 +493,15 @@ public interface MesApiService {
@POST("/himes/api/defectdict/show/page.json") @POST("/himes/api/defectdict/show/page.json")
Observable<BaseMesBean> defectdictList(@Query("functionId") String functionId, @Body RequestBody requestBody); Observable<BaseMesBean> defectdictList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
@POST("/himes/api/modinspo/show/list.json")
Observable<BaseMesBean> modinspoList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
@POST("himes/api/spotCheckBill/show/page.json")
Observable<BaseMesBean> spotCheckBillList(@Query("functionId") String functionId, @Body RequestBody requestBody);
} }
...@@ -6,6 +6,7 @@ import com.google.android.material.tabs.TabLayout; ...@@ -6,6 +6,7 @@ import com.google.android.material.tabs.TabLayout;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.adapter.VpDataAdapter; import com.wd.workoffice.ui.adapter.VpDataAdapter;
import com.wd.workoffice.ui.fg.MesCheckFragment;
import com.wd.workoffice.ui.fg.MesProcessFragment; import com.wd.workoffice.ui.fg.MesProcessFragment;
import com.wd.workoffice.ui.fg.MesServiceFragment; import com.wd.workoffice.ui.fg.MesServiceFragment;
...@@ -46,12 +47,12 @@ public class MesServiceActivity extends WorkToolBarActivity { ...@@ -46,12 +47,12 @@ public class MesServiceActivity extends WorkToolBarActivity {
protected void initData() { protected void initData() {
FragmentManager sfm = getSupportFragmentManager(); FragmentManager sfm = getSupportFragmentManager();
List<Fragment> data = new ArrayList<>(); List<Fragment> data = new ArrayList<>();
for (int i = 0; i < tab.length; i++) { MesCheckFragment checkFragment = new MesCheckFragment();
data.add(checkFragment);
for (int i = 0; i < tab.length-1; i++) {
MesServiceFragment saleFragment = new MesServiceFragment(); MesServiceFragment saleFragment = new MesServiceFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("state", order[i]); bundle.putString("state", order[i]);
bundle.putString("orderId", getIntent().getStringExtra("orderId"));
bundle.putString("orderType", getIntent().getStringExtra("orderType"));
saleFragment.setArguments(bundle); saleFragment.setArguments(bundle);
data.add(saleFragment); data.add(saleFragment);
......
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.ServiceCheckBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class MesCheckAdapter extends BaseQuickAdapter<ServiceCheckBean.ListBean, BaseViewHolder> {
public MesCheckAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ServiceCheckBean.ListBean item) {
helper.setText(R.id.tv_first,item.getBillNum());
helper.setText(R.id.tv_second,item.getSpotCheckPersonName());
}
}
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.ServiceBean;
import com.wd.workoffice.bean.mesBean.ServiceCheckBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class MesServiceAdapter extends BaseQuickAdapter<ServiceBean.ListBean, BaseViewHolder> {
public MesServiceAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ServiceBean.ListBean item) {
helper.setText(R.id.tv_first,item.getInspoCode());
helper.setText(R.id.tv_second,item.getPrincipalName());
}
}
package com.wd.workoffice.ui.fg;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
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.WorkBaseFg;
import com.wd.workoffice.bean.mesBean.ServiceCheckBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.MesCheckAdapter;
import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.util.WorkUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
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 flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.disposables.Disposable;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesCheckFragment extends WorkBaseFg {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
@BindView(R.id.tv_desc1)
TextView tvDesc1;
@BindView(R.id.tv_desc2)
TextView tvDesc2;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.ll_time)
LinearLayout llTime;
private int page = 1;
private Map<String, Object> param;
private MesCheckAdapter dataAdapter;
private List<ServiceCheckBean.ListBean> dataList;
private Map<String, Object> paramMap;
@Override
protected void initView() {
ButterKnife.bind(this, getContentView());
tvDesc1.setText("点检单号");
tvDesc2.setText("检查人");
rvData.setLayoutManager(new LinearLayoutManager(getActivity(), RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
param = WorkUtils.pageMesKey();
page = 1;
param.put("pageNum", page);
paramMap = new HashMap<>();
param.put("paramMap", paramMap);
dataList = new ArrayList<>();
dataAdapter = new MesCheckAdapter(R.layout.item_mes_process, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
dataAdapter.notifyDataSetChanged();
getData();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle arguments = getArguments();
if (arguments != null) {
}
}
private void getData() {
RtfUtils.getMesRtf().spotCheckBillList("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<ServiceCheckBean.ListBean> getList = JSON.parseObject(data.getData().toString(), ServiceCheckBean.class).getList();
if (page == 1) {
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(MesOrderDetailActivity.class);
}
});
}
@Override
protected int layoutId() {
return R.layout.fg_mes_process;
}
@OnClick(R.id.ll_time)
public void onViewClicked() {
PickTimeUtils.showPickThree(getActivity(), new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View view) {
tvTime.setText(TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd")));
paramMap.put("createDateTime", TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd")));
page = 1;
param.put("pageNum", page);
getData();
}
}, false).show();
}
}
...@@ -12,25 +12,27 @@ ...@@ -12,25 +12,27 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:id="@+id/ll_time"
android:layout_width="100mm" android:layout_width="100mm"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20mm" android:layout_marginTop="15mm"
android:background="@drawable/shape_mes_time" android:background="@drawable/shape_mes_time"
android:gravity="center" android:gravity="center"
android:paddingVertical="4mm"> android:paddingVertical="4mm">
<TextView <TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="4mm" android:layout_marginRight="4mm"
android:text="2019年7月" android:text="请选择时间"
android:textColor="#ff637298" android:textColor="#ff637298"
android:textSize="13sp" /> android:textSize="13sp" />
<ImageView <ImageView
android:layout_width="5mm" android:layout_width="20mm"
android:layout_height="2mm" android:layout_height="12mm"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@mipmap/mes_time_down" /> android:src="@mipmap/mes_time_down" />
</LinearLayout> </LinearLayout>
...@@ -39,7 +41,7 @@ ...@@ -39,7 +41,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="15mm" android:layout_marginHorizontal="15mm"
android:layout_marginTop="15mm"> android:layout_marginVertical="10mm">
<TextView <TextView
android:id="@+id/tv_desc1" android:id="@+id/tv_desc1"
...@@ -71,9 +73,10 @@ ...@@ -71,9 +73,10 @@
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginHorizontal="15mm" android:layout_marginHorizontal="15mm"
android:layout_marginTop="10mm" android:layout_marginBottom="10mm"
android:paddingTop="10mm"
app:cardCornerRadius="3dp" app:cardCornerRadius="3dp"
app:cardElevation="5dp"> app:cardElevation="5dp">
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
android:paddingVertical="13mm"> android:paddingVertical="13mm">
<TextView <TextView
android:id="@+id/tv_first"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/tv_second"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论