提交 1f9235c4 authored 作者: lgd's avatar lgd

1.修改订单显示状态

2.提前结束审核修改
上级 df8ede3a
......@@ -175,6 +175,11 @@ public class CrucibleOrderDetailActivity extends WorkToolBarActivity {
llApply.setVisibility(View.VISIBLE);
tvSendApply.setVisibility(View.GONE);
break;
case 420:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
tvSendApply.setVisibility(View.GONE);
break;
case 500:
if (TextUtils.equals(type, "1")) {//1坩埚生产 2 坩埚销售
llBottom.setVisibility(View.VISIBLE);
......
......@@ -19,6 +19,9 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.EndApplyBean;
import com.wd.workoffice.bean.event.AddLogEvent;
import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
......@@ -26,6 +29,9 @@ import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.EndApplyAdapter;
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;
......@@ -86,7 +92,7 @@ public class EndApplyActivity extends WorkToolBarActivity {
} else {
observable = RtfUtils.getRtf().endApplyList(getIntent().getStringExtra("orderId"), param);
}
observable .compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
......@@ -105,6 +111,7 @@ public class EndApplyActivity extends WorkToolBarActivity {
return;
}
List<EndApplyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), EndApplyBean.class).getRecords();
srlRefresh.finishRefresh();
dataList.clear();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
......@@ -240,9 +247,26 @@ public class EndApplyActivity extends WorkToolBarActivity {
return;
}
toast("操作成功");
EventBus.getDefault().post(new CheckOrderEvent());
getData();
}
});
}
@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) {
getData();
}
}
......@@ -12,11 +12,13 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.EndApplyBean;
import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
......@@ -65,7 +67,7 @@ public class EndApplyDetailActivity extends WorkToolBarActivity {
tvTime.setText(info.getCreatedTime());
tvPerson.setText(info.getApplyUserName());
tvRemark.setText(info.getApplyRemark());
if (TextUtils.equals(info.getStatus(), "0")) {
if (TextUtils.equals(info.getStatus(), "0") && TextUtils.equals(UserKeeper.getInstance().getUserDepId(), String.valueOf(info.getCanAuditDeptId()))) {
llBottom.setVisibility(View.VISIBLE);
} else {
llBottom.setVisibility(View.GONE);
......@@ -74,8 +76,9 @@ public class EndApplyDetailActivity extends WorkToolBarActivity {
param.put("id", info.getId());
changePermission();
}
private void changePermission() {
String orderType =getIntent().getStringExtra("orderType");
String orderType = getIntent().getStringExtra("orderType");
boolean hasPermission = true;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
hasPermission = WorkUtils.hasPermission(PagePermissionType.SO_ADVANCE_AUDIT.getPermission());
......@@ -126,7 +129,7 @@ public class EndApplyDetailActivity extends WorkToolBarActivity {
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (status!=1&&TextUtils.isEmpty(etRemark.getText().toString())) {
if (status != 1 && TextUtils.isEmpty(etRemark.getText().toString())) {
toast("请填写备注");
return;
}
......@@ -148,16 +151,16 @@ public class EndApplyDetailActivity extends WorkToolBarActivity {
param.put("status", status);
param.put("auditRemark", remark);
param.put("id", info.getId());
String orderType =getIntent().getStringExtra("orderType");
Observable<BaseBean> observable ;
String orderType = getIntent().getStringExtra("orderType");
Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().endSoCheck(info.getId()+"",WorkUtils.convertMapToBody(param));
observable = RtfUtils.getRtf().endSoCheck(info.getId() + "", WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
observable = RtfUtils.getRtf().endPoCheck(info.getId()+"",WorkUtils.convertMapToBody(param));
observable = RtfUtils.getRtf().endPoCheck(info.getId() + "", WorkUtils.convertMapToBody(param));
} else {
observable = RtfUtils.getRtf().endSoCheck(info.getId()+"",WorkUtils.convertMapToBody(param));
observable = RtfUtils.getRtf().endSoCheck(info.getId() + "", WorkUtils.convertMapToBody(param));
}
observable .compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
observable.compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
......@@ -177,6 +180,7 @@ public class EndApplyDetailActivity extends WorkToolBarActivity {
}
toast("操作成功");
EventBus.getDefault().post(new CheckSendEvent());
EventBus.getDefault().post(new CheckOrderEvent());
finish();
}
});
......
......@@ -151,6 +151,8 @@ public class InsideOrderDetailActivity extends WorkToolBarActivity {
break;
case 410:
break;
case 420:
break;
case 500:
break;
case 600:
......
......@@ -268,6 +268,13 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
llApply.setVisibility(View.VISIBLE);
rlSet.setVisibility(View.VISIBLE);
break;
case 420:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
if (dataBean != null && dataBean.getAttr() == 400) {
tvSendApply.setVisibility(View.GONE);
}
break;
case 500:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
......
......@@ -115,6 +115,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
private RecyclerView rvFlowSheet;
private List<OrderDetail.OrderFlowsBean> flowSheetList;
private OrderProcessAdapter flowSheetAdapter;
@Override
protected void initView() {
ButterKnife.bind(this);
......@@ -171,6 +172,13 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
break;
case 420:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
if (dataBean != null && dataBean.getAttr() == 400) {
tvSendApply.setVisibility(View.GONE);
}
break;
case 500:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
......@@ -222,10 +230,10 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
dataBean = JSON.parseObject(data.getData().toString(), OrderDetail.class);
flowSheetList.addAll(dataBean.getOrderFlows());
flowSheetAdapter.notifyDataSetChanged();
if (dataBean.getOrderFlows().size()<=3){
if (dataBean.getOrderFlows().size() <= 3) {
llSeeMore.setVisibility(View.GONE);
flowList.addAll(dataBean.getOrderFlows());
}else {
} else {
flowList.addAll(dataBean.getOrderFlows().subList(0, 3));
}
flowAdapter.notifyDataSetChanged();
......@@ -324,7 +332,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
}
@OnClick({R.id.ll_see_more,R.id.tv_finish_apply, R.id.tv_send_apply, R.id.tv_refuse, R.id.tv_agree})
@OnClick({R.id.ll_see_more, R.id.tv_finish_apply, R.id.tv_send_apply, R.id.tv_refuse, R.id.tv_agree})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.ll_see_more:
......
package com.wd.workoffice.ui.adapter;
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.EndApplyBean;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
......@@ -17,16 +20,11 @@ import androidx.annotation.Nullable;
*/
public class EndApplyAdapter extends BaseQuickAdapter<EndApplyBean.RecordsBean, BaseViewHolder> {
int status;
public EndApplyAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public EndApplyAdapter(int layoutResId, @Nullable List<EndApplyBean.RecordsBean> data, int status) {
super(layoutResId, data);
this.status = status;
}
@Override
protected void convert(BaseViewHolder helper, EndApplyBean.RecordsBean item) {
......@@ -34,11 +32,11 @@ public class EndApplyAdapter extends BaseQuickAdapter<EndApplyBean.RecordsBean,
helper.setText(R.id.tv_reason, item.getApplyRemark());
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_status, WorkUtils.getFinancialStatus(Integer.valueOf(item.getStatus())));
// if (status == 0) {
// helper.setVisible(R.id.ll_btn, true);
// helper.addOnClickListener(R.id.tv_agree);
// helper.addOnClickListener(R.id.tv_refuse);
// }
if (TextUtils.equals(item.getStatus(), "0") && TextUtils.equals(UserKeeper.getInstance().getUserDepId(), String.valueOf(item.getCanAuditDeptId()))) {
helper.setVisible(R.id.ll_btn, true);
helper.addOnClickListener(R.id.tv_agree);
helper.addOnClickListener(R.id.tv_refuse);
}
}
......
......@@ -56,7 +56,14 @@ public class InsideOrderDetailProductAdapter extends BaseQuickAdapter<OrderDetai
helper.setGone(R.id.tv_flow, false);
helper.setGone(R.id.tv_quality, false);
break;
case 400:
case 410:
helper.setGone(R.id.ll_btn, true);
helper.setGone(R.id.tv_get, false);
helper.setGone(R.id.tv_return, false);
helper.setGone(R.id.tv_flow, false);
helper.setGone(R.id.tv_quality, false);
break;
case 420:
helper.setGone(R.id.ll_btn, true);
helper.setGone(R.id.tv_get, false);
helper.setGone(R.id.tv_return, false);
......
......@@ -37,11 +37,12 @@ public class OrderDetailProductAdapter extends BaseQuickAdapter<OrderDetail.Orde
helper.setText(R.id.tv_card, item.getProductSoleCode());
helper.setText(R.id.tv_card_name, item.getProductSimpleCode());
helper.setText(R.id.tv_spec, item.getProductSpec());
helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInnerPrice())));
helper.setText(R.id.tv_all_price, "¥".concat(MathUtils.multiply(String.valueOf(item.getProductCount()),String.valueOf(item.getInnerPrice()),3)));
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInnerPrice(),3)));
helper.setText(R.id.tv_all_price, "¥".concat(MathUtils.multiply(MathUtils.converData(item.getProductCount(),3),
MathUtils.converData(item.getInnerPrice(),3),3)));
helper.setText(R.id.tv_unit, item.getProductUnit());
helper.setText(R.id.tv_from, WorkUtils.getOrderFrom(item.getType()));
helper.setText(R.id.tv_num, String.valueOf(item.getProductCount()));
helper.setText(R.id.tv_num, MathUtils.converData(item.getProductCount(),3));
helper.addOnClickListener(R.id.tv_get);
helper.addOnClickListener(R.id.tv_return);
helper.addOnClickListener(R.id.tv_flow);
......@@ -63,6 +64,9 @@ public class OrderDetailProductAdapter extends BaseQuickAdapter<OrderDetail.Orde
case 410:
helper.setGone(R.id.ll_btn, true);
break;
case 420:
helper.setGone(R.id.ll_btn, true);
break;
case 500:
helper.setGone(R.id.ll_btn, true);
break;
......@@ -86,5 +90,6 @@ public class OrderDetailProductAdapter extends BaseQuickAdapter<OrderDetail.Orde
helper.setGone(R.id.tv_get, false);
}
}
}
......@@ -74,7 +74,6 @@
<LinearLayout
android:id="@+id/ll_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论