提交 68f5ce94 authored 作者: lgd's avatar lgd

1.组装订单申请详情

2.//TODO erp用户激活测试,忘记/重置密码测试,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,组装下单,产品下单还差附件测试,mes,刷新token
上级 a73a3f9d
...@@ -1104,6 +1104,15 @@ ...@@ -1104,6 +1104,15 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Work.Base" android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ProductOrderApplyDetailActivity"
android:configChanges="keyboardHidden|orientation"
android:label="组装申请"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider" android:authorities="com.wd.workoffice.fileprovider"
......
...@@ -94,6 +94,15 @@ public class OrderBean { ...@@ -94,6 +94,15 @@ public class OrderBean {
private List<OrderFlowsBean> orderFlows; private List<OrderFlowsBean> orderFlows;
private String serialNumber; private String serialNumber;
private String appliedByName; private String appliedByName;
private String applyRemark;
public String getApplyRemark() {
return applyRemark;
}
public void setApplyRemark(String applyRemark) {
this.applyRemark = applyRemark;
}
public String getAppliedByName() { public String getAppliedByName() {
return appliedByName; return appliedByName;
......
...@@ -124,6 +124,24 @@ public class ProAddBean { ...@@ -124,6 +124,24 @@ public class ProAddBean {
private String orderTypeName; private String orderTypeName;
private String carNum; private String carNum;
private String carPrice; private String carPrice;
private String spec;
private double quantity;
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getCarPrice() { public String getCarPrice() {
return carPrice; return carPrice;
......
...@@ -175,6 +175,34 @@ public class ProductBean { ...@@ -175,6 +175,34 @@ public class ProductBean {
private String chooseNum; private String chooseNum;
private double canUseProductSum; private double canUseProductSum;
private String productName;
private double outerPrice;
private double quantity;
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public double getOuterPrice() {
return outerPrice;
}
public void setOuterPrice(double outerPrice) {
this.outerPrice = outerPrice;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
public double getCarDoubleNum() { public double getCarDoubleNum() {
return carDoubleNum; return carDoubleNum;
} }
......
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class CheckProApplyEvent {
public CheckProApplyEvent() {
}
}
...@@ -1540,5 +1540,29 @@ public interface ApiService { ...@@ -1540,5 +1540,29 @@ public interface ApiService {
@GET("/product/can-package/page/list") @GET("/product/can-package/page/list")
Observable<BaseBean> saleOrderTargetPro(@QueryMap Map<String, Object> param); Observable<BaseBean> saleOrderTargetPro(@QueryMap Map<String, Object> param);
/**
* 3获取当前客户可组装成品(分页)
*
* @return
*/
@GET("/package-end/item/list")
Observable<BaseBean> packageEndPro(@Query("applyId") Integer id);
/**
* 3获取当前客户可组装成品(分页)
*
* @return
*/
@GET("/package-source/item/list")
Observable<BaseBean> packageSourcePro(@Query("applyId") Integer id);
/**
* 8组装申请审批
*
* @return
*/
@PUT("/packageApply/exam/{applyId}")
Observable<BaseBean> packageApply(@Path("applyId") String id,@Body RequestBody requestBody);
} }
package com.wd.workoffice.ui.activity.bat.order;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.OrderBean;
import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.CheckProApplyEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ProApplyDetailAdapter;
import com.wd.workoffice.ui.adapter.ProApplyTargetAddAdapter;
import com.wd.workoffice.ui.adapter.ProTargetAddAdapter;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
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 ProductOrderApplyDetailActivity extends WorkToolBarActivity {
@BindView(R.id.tv_refuse)
TextView tvRefuse;
@BindView(R.id.tv_agree)
TextView tvAgree;
@BindView(R.id.ll_bottom)
LinearLayout llBottom;
@BindView(R.id.tv_base1)
TextView tvBase1;
@BindView(R.id.tv_base2)
TextView tvBase2;
@BindView(R.id.tv_base3)
TextView tvBase3;
@BindView(R.id.tv_base4)
TextView tvBase4;
@BindView(R.id.tv_base5)
TextView tvBase5;
@BindView(R.id.rv_from)
RecyclerView rvFrom;
@BindView(R.id.rv_to)
RecyclerView rvTo;
@BindView(R.id.tv_remark)
TextView tvRemark;
private Map<String, Object> param;
private ProApplyTargetAddAdapter toAdapter;
private List<ProductBean.RecordsBean> toList;
private List<ProAddBean.RecordsBean> fromList;
private ProApplyDetailAdapter fromAdapter;
private OrderBean info;
@Override
protected void initView() {
ButterKnife.bind(this);
rvFrom.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
rvTo.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
info = JSON.parseObject(getIntent().getStringExtra("info"), OrderBean.class);
tvBase1.setText(info.getCustomerName());
tvBase2.setText(info.getEnterStockName());
tvBase3.setText(info.getEnterStockName());
tvBase4.setText(info.getUsedStockName());
tvRemark.setText(info.getApplyRemark());
fromList = new ArrayList<>();
fromAdapter = new ProApplyDetailAdapter(R.layout.item_product_apply_pro, fromList);
fromAdapter.bindToRecyclerView(rvFrom);
toList = new ArrayList<>();
toAdapter = new ProApplyTargetAddAdapter(R.layout.item_product_target_pro, toList);
toAdapter.bindToRecyclerView(rvTo);
changeNumAndPrice();
if (TextUtils.equals(info.getStatus() + "", "0")) {
llBottom.setVisibility(View.VISIBLE);
} else {
llBottom.setVisibility(View.GONE);
}
param = new HashMap<>();
param.put("id", info.getId());
getData(Integer.valueOf(info.getId()));
}
private void getData(Integer id) {
RtfUtils.getRtf().packageSourcePro(id).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;
}
List<ProAddBean.RecordsBean> dataList = JSON.parseArray(data.getData().toString(), ProAddBean.RecordsBean.class);
fromList.clear();
fromList.addAll(dataList);
fromAdapter.notifyDataSetChanged();
}
});
RtfUtils.getRtf().packageEndPro(id).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;
}
List<ProductBean.RecordsBean> dataList = JSON.parseArray(data.getData().toString(), ProductBean.RecordsBean.class);
toList.addAll(dataList);
toAdapter.notifyDataSetChanged();
}
});
}
private void changeNumAndPrice() {
String allPrice = "";
for (ProductBean.RecordsBean recordsBean : toList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 3), 3);
}
tvBase5.setText(String.valueOf(allPrice));
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_product_apply_detail;
}
@OnClick({R.id.tv_refuse, R.id.tv_agree})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_refuse:
checkDialog(2);
break;
case R.id.tv_agree:
checkDialog(1);
break;
}
}
private void checkDialog(int status) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).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);
etRemark.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
tvNum.setText(s.length() + "/140");
}
});
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(etRemark.getText().toString())) {
toast("请填写备注");
return;
}
check(status, etRemark.getText().toString());
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
private void check(int status, String remark) {
param.put("status", status);
param.put("auditRemark", remark);
RtfUtils.getRtf().packageApply(info.getId(), WorkUtils.convertMapToBody(param)).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;
}
EventBus.getDefault().post(new CheckProApplyEvent());
toast("操作成功");
finish();
}
});
}
}
...@@ -93,7 +93,10 @@ public class ProductOrderSearchActivity extends WorkBaseActivity { ...@@ -93,7 +93,10 @@ public class ProductOrderSearchActivity extends WorkBaseActivity {
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(WorkLogisticsDetailActivity.class, "info", JSON.toJSONString(dataList.get(position))); startActivity(ProductOrderDetailActivity.class,
"identity",identity,
"id", dataList.get(position).getId() + "",
"status", dataList.get(position).getStatus() + "");
} }
}); });
} }
......
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.ProAddBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class ProApplyDetailAdapter extends BaseQuickAdapter<ProAddBean.RecordsBean, BaseViewHolder> {
public ProApplyDetailAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ProAddBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_in_price, String.valueOf(item.getInnerPrice()));
helper.setText(R.id.tv_num, item.getQuantity() + "");
}
}
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.ProductBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class ProApplyTargetAddAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
public ProApplyTargetAddAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_in_price, String.valueOf(item.getInternalPrice()));
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_num, item.getQuantity() + "");
helper.setText(R.id.tv_price, String.valueOf(item.getOuterPrice()));
helper.setVisible(R.id.iv_cart, false);
}
}
...@@ -13,8 +13,11 @@ import com.wd.workoffice.bean.LogisticBean; ...@@ -13,8 +13,11 @@ import com.wd.workoffice.bean.LogisticBean;
import com.wd.workoffice.bean.OrderBean; import com.wd.workoffice.bean.OrderBean;
import com.wd.workoffice.bean.event.CheckLogisticEvent; import com.wd.workoffice.bean.event.CheckLogisticEvent;
import com.wd.workoffice.bean.event.CheckOrderEvent; import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.bean.event.CheckProApplyEvent;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderApplyDetailActivity;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderDetailActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkLogisticsDetailActivity; import com.wd.workoffice.ui.activity.bat.work.WorkLogisticsDetailActivity;
import com.wd.workoffice.ui.adapter.SaleProductAdapter; import com.wd.workoffice.ui.adapter.SaleProductAdapter;
import com.wd.workoffice.ui.adapter.SaleProductApplyAdapter; import com.wd.workoffice.ui.adapter.SaleProductApplyAdapter;
...@@ -141,7 +144,8 @@ public class ProductOrderApplyListFragment extends WorkBaseFg { ...@@ -141,7 +144,8 @@ public class ProductOrderApplyListFragment extends WorkBaseFg {
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(WorkLogisticsDetailActivity.class, "info", JSON.toJSONString(dataList.get(position))); startActivity(ProductOrderApplyDetailActivity.class,
"info", JSON.toJSONString(dataList.get(position)));
} }
}); });
} }
...@@ -165,7 +169,7 @@ public class ProductOrderApplyListFragment extends WorkBaseFg { ...@@ -165,7 +169,7 @@ public class ProductOrderApplyListFragment extends WorkBaseFg {
} }
@Subscribe @Subscribe
public void refresh(CheckOrderEvent event) { public void refresh(CheckProApplyEvent event) {
page = 1; page = 1;
param.put("current", page); param.put("current", page);
getData(); getData();
......
...@@ -256,20 +256,10 @@ ...@@ -256,20 +256,10 @@
<View style="@style/ViewX" /> <View style="@style/ViewX" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="18mm"
android:paddingVertical="15mm"
android:text="运输方式及费用承担:"
android:textSize="16sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:background="@drawable/shape_confirm_order" android:background="@drawable/shape_confirm_order"
android:orientation="vertical"> android:orientation="vertical">
......
<?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_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingTop="10mm"
android:paddingBottom="20mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:text="邢台德龙钢铁客户"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<RelativeLayout
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_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
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_in_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15mm"
android:text="申请数量:"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论