提交 7bcd78af authored 作者: lgd's avatar lgd

1.订单追踪

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 9bc90d09
......@@ -480,4 +480,11 @@ public interface MesApiService {
*/
@POST("/himes/api/customer/show/page.json")
Observable<BaseMesBean> clientPhoneList(@Query("functionId") String functionId, @Body RequestBody requestBody);
/**
* @return
*/
@POST("/himes/api/order/show/list.json")
Observable<BaseMesBean> orderList(@Query("functionId") String functionId, @Body RequestBody requestBody);
}
......@@ -40,7 +40,7 @@ public class MesOrderActivity extends WorkToolBarActivity {
private String tab[] = {
"全部", "已排程", "未排程"};
private String order[] = {
"0", "1", "2"};
"", "1", "0"};
@Override
protected void initView() {
......@@ -57,8 +57,6 @@ public class MesOrderActivity extends WorkToolBarActivity {
MesOrderFragment saleFragment = new MesOrderFragment();
Bundle bundle = new Bundle();
bundle.putString("state", order[i]);
bundle.putString("orderId", getIntent().getStringExtra("orderId"));
bundle.putString("orderType", getIntent().getStringExtra("orderType"));
saleFragment.setArguments(bundle);
data.add(saleFragment);
......
package com.wd.workoffice.ui.activity.mes.order;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
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.MesOrderBean;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.utils.TimeUtils;
/**
* 订单追踪 详情
......@@ -14,9 +23,48 @@ import butterknife.ButterKnife;
public class MesOrderDetailActivity extends WorkToolBarActivity {
@BindView(R.id.tv_top_no)
TextView tvTopNo;
@BindView(R.id.tv_status)
TextView tvStatus;
@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_factory_name)
TextView tvFactoryName;
@BindView(R.id.tv_factory_code)
TextView tvFactoryCode;
@BindView(R.id.tv_order_time)
TextView tvOrderTime;
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_weight)
TextView tvWeight;
@BindView(R.id.tv_time)
TextView tvTime;
@Override
protected void initView() {
ButterKnife.bind(this);
MesOrderBean.ListBean info = JSON.parseObject(getIntent().getStringExtra("info"), MesOrderBean.ListBean.class);
if (TextUtils.equals(info.getScheduleStatus(), "") || TextUtils.equals(info.getScheduleStatus(), "0")) {
tvStatus.setText("未排程");
} else {
tvStatus.setText("已排程");
}
tvTopNo.setText(String.format("制造令单号:%s", info.getManufactureOrderNumber()));
tvNo.setText(info.getManufactureOrderNumber());
tvFactoryName.setText(info.getSiteName());
tvFactoryCode.setText(info.getSiteCode());
tvNum.setText(info.getPlanCount() + "");
tvProCode.setText(info.getProductCode());
tvProName.setText(info.getProductName());
tvWeight.setText(info.getUnit());
tvTime.setText(TimeUtils.millis2String(info.getDeliveryDate()));
tvOrderTime.setText(TimeUtils.millis2String(info.getCreateDateTime()));
}
@Override
......
......@@ -2,44 +2,43 @@ package com.wd.workoffice.ui.adapter;
import android.graphics.Color;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.bean.mesBean.MesOrderBean;
import java.util.List;
import androidx.annotation.Nullable;
import flexible.xd.android_base.utils.TimeUtils;
/**
* Created by flexible on 2018/8/13.
*/
public class MesOrderAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
public class MesOrderAdapter extends BaseQuickAdapter<MesOrderBean.ListBean, BaseViewHolder> {
public MesOrderAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, Object item) {
if (helper.getAdapterPosition() % 2 == 0) {
helper.setTextColor(R.id.tv_status, Color.parseColor("#FF34AA68"));
helper.setText(R.id.tv_status,"已排程");
} else {
protected void convert(BaseViewHolder helper, MesOrderBean.ListBean item) {
if (TextUtils.equals(item.getScheduleStatus(),"")||TextUtils.equals(item.getScheduleStatus(),"0") ) {
helper.setTextColor(R.id.tv_status, Color.parseColor("#FFD16A6A"));
helper.setText(R.id.tv_status,"未排程");
} else {
helper.setTextColor(R.id.tv_status, Color.parseColor("#FF34AA68"));
helper.setText(R.id.tv_status,"已排程");
}
// helper.setText(R.id.tv_name, item.getSerialNumber());
// helper.setText(R.id.tv_reason, item.getApplyRemark());
// helper.setText(R.id.tv_time, item.getCreatedTime());
// if (status == 0) {
// helper.setVisible(R.id.ll_btn, true);
// helper.addOnClickListener(R.id.tv_agree);
// helper.addOnClickListener(R.id.tv_refuse);
// }
// }
helper.setText(R.id.tv_no,String.format("指令单号:%s", item.getManufactureOrderNumber()));
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_factory_name, item.getSiteName());
helper.setText(R.id.tv_num, item.getPlanCount()+"");
helper.setText(R.id.tv_time, TimeUtils.millis2String(item.getDeliveryDate()));
}
}
......
......@@ -14,9 +14,12 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.BaseMesBean;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.mesBean.MesOrderBean;
import com.wd.workoffice.bean.mesBean.TakeOnBean;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
......@@ -31,6 +34,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -60,9 +64,7 @@ public class MesOrderFragment extends WorkBaseFg {
private int page = 1;
private Map<String, Object> param;
private MesOrderAdapter dataAdapter;
private List<Object> dataList;
private String orderId;
private String orderType;
private List<MesOrderBean.ListBean> dataList;
@Override
protected void initView() {
......@@ -73,20 +75,18 @@ public class MesOrderFragment extends WorkBaseFg {
@Override
protected void initData() {
param = WorkUtils.pageKey();
param.put("status", state);
param.put("orderId", orderId);
param = WorkUtils.pageMesKey();
page = 1;
param.put("current", page);
param.put("pageNum", page);
Map<String ,Object> paramMap =new HashMap<>();
param.put("paramMap", paramMap);
paramMap.put("scheduleStatus",state);
dataList = new ArrayList<>();
dataAdapter = new MesOrderAdapter(R.layout.item_mes_order, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
dataList.add(null);
dataList.add(null);
dataList.add(null);
dataAdapter.notifyDataSetChanged();
// getData();
getData();
}
......@@ -96,23 +96,11 @@ public class MesOrderFragment extends WorkBaseFg {
Bundle arguments = getArguments();
if (arguments != null) {
state = arguments.getString("state");
orderId = arguments.getString("orderId");
orderType = arguments.getString("orderType");
}
}
private void getData() {
Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().sendApplyList(param);
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
observable = RtfUtils.getRtf().sendPoApplyList(param);
} else if (TextUtils.equals(orderType, OrderType.CRUCIBLE.getCode())) {
observable = RtfUtils.getRtf().sendCoApplyList(param);
} else {
observable = RtfUtils.getRtf().sendApplyList(param);
}
observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
RtfUtils.getMesRtf().orderList("1",WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
......@@ -124,15 +112,14 @@ public class MesOrderFragment extends WorkBaseFg {
}
@Override
public void onSuccess(BaseBean data) {
public void onSuccess(BaseMesBean data) {
hideLoading();
if (data.getCode() != 0) {
if (!data.isSuccess()) {
toast(data.getMessage());
return;
}
List<SendApplyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), SendApplyBean.class).getRecords();
List<MesOrderBean.ListBean> getList = JSON.parseObject(data.getData().toString(), MesOrderBean.class).getList();
if (page == 1) {
srlRefresh.finishRefresh();
dataList.clear();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
......@@ -155,115 +142,28 @@ public class MesOrderFragment extends WorkBaseFg {
protected void initEvent() {
srlRefresh.setOnRefreshListener(refreshLayout -> {
page = 1;
param.put("current", page);
param.put("pageNum", page);
getData();
});
dataAdapter.setOnLoadMoreListener(() -> {
param.put("current", page);
param.put("pageNum", page);
getData();
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(MesOrderDetailActivity.class);
startActivity(MesOrderDetailActivity.class,"info",JSON.toJSONString(dataList.get(position)));
}
});
}
private void checkDialog(int status, int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = LayoutInflater.from(getActivity()).inflate(R.layout.view_check, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvDesc = view.findViewById(R.id.tv_desc);
tvDesc.setText(status == 1 ? "通过" : "拒绝");
TextView tvNum = view.findViewById(R.id.tv_num);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
EditText etRemark = view.findViewById(R.id.et_content);
WorkUtils.addNumListener(etRemark, tvNum);
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (status!=1&&TextUtils.isEmpty(etRemark.getText().toString())) {
toast("请填写备注");
return;
}
check(status, etRemark.getText().toString(), id);
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
private void check(int status, String remark, int id) {
Map<String, Object> param = WorkUtils.simpleParam();
param.put("status", status);
param.put("auditRemark", remark);
param.put("id", id);
Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().sendApplyCheck(WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
observable = RtfUtils.getRtf().sendPoApplyCheck(WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.CRUCIBLE.getCode())) {
observable = RtfUtils.getRtf().sendCoApplyCheck(WorkUtils.convertMapToBody(param));
} else {
observable = RtfUtils.getRtf().sendApplyCheck(WorkUtils.convertMapToBody(param));
}
observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
toast("操作成功");
EventBus.getDefault().post(new CheckSendEvent());
}
});
}
@Override
protected int layoutId() {
return R.layout.fg_work_contacts;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckSendEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
......@@ -13,10 +13,10 @@
android:paddingVertical="14mm">
<TextView
android:id="@+id/tv_name"
android:id="@+id/tv_top_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单编号:DD10001"
android:text="指令单号:"
android:textSize="16sp" />
<TextView
......@@ -61,14 +61,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单日期:"
android:text="指令单号"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_reason"
android:layout_width="wrap_content"
android:id="@+id/tv_no"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -81,13 +83,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="计划数量"
android:text="产品名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_pro_name"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -100,13 +105,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="产品名称"
android:text="产品编码"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_pro_code"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -125,7 +133,10 @@
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_factory_name"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -138,13 +149,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="计划开始日期"
android:text="工厂编码"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_factory_code"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -157,13 +171,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="要求交货日期"
android:text="订单日期"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_order_time"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -176,13 +193,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="实际开始日期"
android:text="计划数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_num"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -195,13 +215,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="实际结束日期"
android:text="单位"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_weight"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
......@@ -214,16 +237,20 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发货数量"
android:text="要求交货时间"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_time"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
......
......@@ -21,10 +21,10 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单编号:DD10001"
android:text="制造令单号:"
android:textSize="16sp" />
<TextView
......@@ -44,7 +44,6 @@
android:layout_marginTop="12mm"
android:maxLines="1"
android:text="--------------------------------------------------------------------------------------------------------------------------------" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -53,18 +52,19 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单日期:"
android:text="产品名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_reason"
android:layout_width="wrap_content"
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -73,17 +73,21 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="计划数量"
android:text="工厂名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_factory_name"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -92,17 +96,21 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="产品名称"
android:text="计划数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_num"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -111,15 +119,19 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="工厂名称"
android:text="要求交货时间:"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/tv_time"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="right"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论