提交 a20621d8 authored 作者: lgd's avatar lgd

1.r入库

2.//TODO erp用户激活测试,忘记/重置密码测试,领用申请列表/退件列表/参数,坩埚下单页面,组装下单,产品下单还差附件测试,mes,消息,刷新token
上级 c583000d
......@@ -928,6 +928,39 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ReturnApplyActivity"
android:configChanges="keyboardHidden|orientation"
android:label="退货申请列表"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.AddStockApplyActivity"
android:configChanges="keyboardHidden|orientation"
android:label="入库申请列表"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.AddStockApplyAddActivity"
android:configChanges="keyboardHidden|orientation"
android:label="添加入库申请"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.AddStockApplyDetailActivity"
android:configChanges="keyboardHidden|orientation"
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"
......
......@@ -876,7 +876,7 @@ public class OrderDetail {
private String productUnit;
private double productWeight;
private double canOutStoreProductSum;
private int canInStoreProductSum;
private double canInStoreProductSum;
private double canUseProductSum;
private Object canPackageSum;
private Object launchDeptName;
......@@ -1173,11 +1173,11 @@ public class OrderDetail {
this.canOutStoreProductSum = canOutStoreProductSum;
}
public int getCanInStoreProductSum() {
public double getCanInStoreProductSum() {
return canInStoreProductSum;
}
public void setCanInStoreProductSum(int canInStoreProductSum) {
public void setCanInStoreProductSum(double canInStoreProductSum) {
this.canInStoreProductSum = canInStoreProductSum;
}
......
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class CheckAddStockEvent {
public CheckAddStockEvent() {
}
}
......@@ -1196,5 +1196,38 @@ public interface ApiService {
*/
@PUT("/useApply/so/audit/{applyId}")
Observable<BaseBean> useApplyCheck(@Path("applyId") String applyId, @Body RequestBody requestBody);
/**
* step7_7-退货申请流水列表
*
* @return
*/
@GET("/returnApply/so/page/list")
Observable<BaseBean> returnApplyList(@QueryMap Map<String, Object> param);
/**
* step4_1-发起入库申请
*
* @return
*/
@POST(" /procedureStart/so/applyStock/{orderItemId}")
Observable<BaseBean> addStockApplyAdd(@Path("orderItemId") String orderItemId, @Body RequestBody requestBody);
/**
* /enterStoreApply/so/app/page/list
*
* @return
*/
@GET("/enterStoreApply/so/app/page/list")
Observable<BaseBean> addStockApplyList(@QueryMap Map<String, Object> param);
/**
* /enterStoreApply/so/app/page/list
*
* @return
*/
@PUT("/enterStoreApply/so/audit/{id}")
Observable<BaseBean> addStockApplyCheck(@Path("id") String id, @Body RequestBody requestBody);
}
package com.wd.workoffice.ui.activity.bat.order;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import com.google.android.material.tabs.TabLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.adapter.VpDataAdapter;
import com.wd.workoffice.ui.fg.AddStockApplyFragment;
import com.wd.workoffice.ui.fg.UseApplyFragment;
import java.util.ArrayList;
import java.util.List;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 发货申请列表
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class AddStockApplyActivity extends WorkToolBarActivity {
@BindView(R.id.tl_tab)
TabLayout tlTab;
@BindView(R.id.vp_data)
ViewPager vpData;
private String tab[] = {
"待审核", "已通过", "已驳回"};
private String order[] = {
"0", "1", "2"};
@Override
protected void initView() {
ButterKnife.bind(this);
tlTab.setupWithViewPager(vpData);
tlTab.setTabMode(TabLayout.MODE_FIXED);
}
@Override
protected void initData() {
FragmentManager sfm = getSupportFragmentManager();
List<Fragment> data = new ArrayList<>();
for (int i = 0; i < tab.length; i++) {
AddStockApplyFragment saleFragment = new AddStockApplyFragment();
Bundle bundle = new Bundle();
bundle.putString("state", order[i]);
bundle.putString("orderId", getIntent().getStringExtra("orderId"));
bundle.putString("productId", getIntent().getStringExtra("productId"));
bundle.putString("num", getIntent().getStringExtra("num"));
saleFragment.setArguments(bundle);
data.add(saleFragment);
}
VpDataAdapter vpFgAdapter = new VpDataAdapter(sfm, data);
vpData.setAdapter(vpFgAdapter);
for (int i = 0; i < tab.length; i++) {
tlTab.getTabAt(i).setText(tab[i]);
}
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_order;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (TextUtils.equals(getIntent().getStringExtra("status"), "300")) {
getMenuInflater().inflate(R.menu.menu_add, menu);
}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.add:
startActivity(AddStockApplyAddActivity.class,
"num", getIntent().getStringExtra("num"),
"productId", getIntent().getStringExtra("productId"),
"orderItemId", getIntent().getStringExtra("orderItemId"),
"simpleCode", getIntent().getStringExtra("simpleCode"),
"id", getIntent().getStringExtra("orderId"));
break;
}
return super.onOptionsItemSelected(item);
}
}
package com.wd.workoffice.ui.activity.bat.order;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.event.CheckUseEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.HashMap;
import java.util.Map;
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 AddStockApplyAddActivity extends WorkToolBarActivity {
@BindView(R.id.tv_bottom)
TextView tvBottom;
@BindView(R.id.et_img_code)
TextView etImgCode;
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.et_num)
EditText etNum;
@BindView(R.id.et_remark)
EditText etRemark;
@BindView(R.id.tv_remark_num)
TextView tvRemarkNum;
@BindView(R.id.et_box_num)
EditText etBoxNum;
private Map<String, Object> param;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
tvNum.setText(String.format("最大领用数量(%s)", getIntent().getStringExtra("num")));
param = new HashMap<>();
param.put("productId", getIntent().getStringExtra("productId"));
param.put("simpleCode", getIntent().getStringExtra("simpleCode"));
etImgCode.setText(getIntent().getStringExtra("simpleCode"));
}
@Override
protected void initEvent() {
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) {
tvRemarkNum.setText(s.length() + "/140");
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_add_stock_apply_add;
}
@OnClick(R.id.tv_bottom)
public void onViewClicked() {
submit();
}
private void submit() {
String num = etNum.getText().toString();
String remark = etRemark.getText().toString();
String boxCode = etBoxNum.getText().toString();
if (TextUtils.isEmpty(num)) {
toast("请输入库数量");
return;
}
param.put("productAmount", num);
param.put("boxCode", boxCode);
param.put("orderItemId", getIntent().getStringExtra("orderItemId"));
param.put("applyRemark", remark);
RtfUtils.getRtf().addStockApplyAdd(getIntent().getStringExtra("id"), 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;
}
toast("提交申请成功");
EventBus.getDefault().post(new CheckAddStockEvent());
finish();
}
});
}
}
package com.wd.workoffice.ui.activity.bat.order;
import android.os.Bundle;
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.UseApplyBean;
import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.event.CheckUseEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
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 AddStockApplyDetailActivity 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_num)
TextView tvNum;
@BindView(R.id.tv_person)
TextView tvPerson;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.tv_remark)
TextView tvRemark;
@BindView(R.id.tv_check_person)
TextView tvCheckPerson;
@BindView(R.id.tv_check_time)
TextView tvCheckTime;
@BindView(R.id.tv_check_remark)
TextView tvCheckRemark;
@BindView(R.id.tv_check_status)
TextView tvCheckStatus;
@BindView(R.id.ll_check)
LinearLayout llCheck;
@BindView(R.id.tv_box_num)
TextView tvBoxNum;
private UseApplyBean.RecordsBean info;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
info = JSON.parseObject(getIntent().getStringExtra("info"), UseApplyBean.RecordsBean.class);
tvNum.setText(String.valueOf(info.getProductAmount()));
tvBoxNum.setText(String.valueOf(info.getBoxCode()));
tvPerson.setText(String.valueOf(info.getCreatedByName()));
tvTime.setText(info.getCreatedTime());
tvRemark.setText(String.valueOf(info.getApplyRemark()));
if (TextUtils.equals(info.getStatus(), "0")) {
llBottom.setVisibility(View.VISIBLE);
llCheck.setVisibility(View.GONE);
} else {
llBottom.setVisibility(View.GONE);
llCheck.setVisibility(View.VISIBLE);
tvCheckPerson.setText(info.getUpdatedByName());
tvCheckTime.setText(info.getUpdatedTime());
tvCheckRemark.setText(info.getAuditRemark());
tvCheckStatus.setText(WorkUtils.getFinancialStatus(Integer.valueOf(info.getStatus())));
}
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_add_stock_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, info.getId());
break;
case R.id.tv_agree:
checkDialog(1, info.getId());
break;
}
}
private void checkDialog(int status, int id) {
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()) && status == 2) {
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("result", status);
param.put("comment", remark);
param.put("id", id);
RtfUtils.getRtf().addStockApplyCheck(id + "", 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;
}
toast("操作成功");
EventBus.getDefault().post(new CheckAddStockEvent());
}
});
}
}
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.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
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.ReturnApplyBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.EndApplyAdapter;
import com.wd.workoffice.ui.adapter.RetrunSendApplyAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
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 ReturnApplyActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<ReturnApplyBean.RecordsBean> dataList;
private RetrunSendApplyAdapter dataAdapter;
private int page = 1;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new RetrunSendApplyAdapter(R.layout.item_return_apply, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
page = 1;
param.put("current", page);
param.put("orderId", getIntent().getStringExtra("orderId"));
// param.put("productId", getIntent().getStringExtra("productId"));
getData();
}
private void getData() {
RtfUtils.getRtf().returnApplyList(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;
}
List<ReturnApplyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), ReturnApplyBean.class).getRecords();
if (page == 1) {
srlRefresh.finishRefresh();
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(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
param.put("current", page);
getData();
}
});
dataAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(EndApplyDetailActivity.class, "info", JSON.toJSONString(dataList.get(position)));
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// if (TextUtils.equals("status", getIntent().getStringExtra("300"))) {
// getMenuInflater().inflate(R.menu.menu_add, menu);
// }
// return super.onCreateOptionsMenu(menu);
// }
//
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
// switch (item.getItemId()) {
// case R.id.add:
// checkDialog();
// break;
// }
// return super.onOptionsItemSelected(item);
// }
// private void checkDialog() {
// 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("提前申请结束");
// 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(etRemark.getText().toString());
// addCartDialog.dismiss();
// }
// });
// tvCancel.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// addCartDialog.dismiss();
// }
// });
// addCartDialog.show();
// }
//
//
// private void check(String remark) {
// Map<String, Object> param = WorkUtils.simpleParam();
// param.put("orderType", getIntent().getStringExtra("orderType"));
// param.put("applyRemark", remark);
// param.put("orderId", getIntent().getStringExtra("orderId"));
// RtfUtils.getRtf().endApply(getIntent().getStringExtra("orderId"), 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;
// }
// toast("操作成功");
// getData();
// }
// });
// }
}
......@@ -9,8 +9,6 @@ import android.widget.TextView;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.event.CheckUseEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
......@@ -85,7 +83,7 @@ public class UseApplyAddActivity extends WorkToolBarActivity {
@Override
protected int layoutId() {
return R.layout.activity_end_apply_add;
return R.layout.activity_use_apply_add;
}
......
......@@ -20,7 +20,9 @@ import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckTicketEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.AddStockApplyActivity;
import com.wd.workoffice.ui.activity.bat.order.EndApplyActivity;
import com.wd.workoffice.ui.activity.bat.order.ReturnApplyActivity;
import com.wd.workoffice.ui.activity.bat.order.SendApplyActivity;
import com.wd.workoffice.ui.activity.bat.order.UseApplyActivity;
import com.wd.workoffice.ui.activity.bat.order.UseApplyAddActivity;
......@@ -232,8 +234,23 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
"productId", proList.get(position).getProductId() + "");
break;
case R.id.tv_add:
startActivity(AddStockApplyActivity.class,
"status", dataBean.getStatus() + "",
"num", proList.get(position).getCanInStoreProductSum() + "",
"product", proList.get(position).getProductName(),
"simpleCode", proList.get(position).getProductSimpleCode(),
"orderId", getIntent().getStringExtra("id"),
"orderItemId", proList.get(position).getId(),
"productId", proList.get(position).getProductId() + "");
break;
case R.id.tv_return:
startActivity(ReturnApplyActivity.class,
"status", dataBean.getStatus() + "",
"num", proList.get(position).getStoreSum() + "",
"product", proList.get(position).getProductName(),
"simpleCode", proList.get(position).getProductSimpleCode(),
"orderId", getIntent().getStringExtra("id"),
"productId", proList.get(position).getProductId() + "");
break;
case R.id.tv_flow:
break;
......
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.AddStockBean;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class AddStockSendApplyAdapter extends BaseQuickAdapter<AddStockBean.RecordsBean, BaseViewHolder> {
int status;
public AddStockSendApplyAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public AddStockSendApplyAdapter(int layoutResId, @Nullable List<AddStockBean.RecordsBean> data, int status) {
super(layoutResId, data);
this.status = status;
}
@Override
protected void convert(BaseViewHolder helper, AddStockBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getSerialNumber());
helper.setText(R.id.tv_num, String.valueOf(item.getProductAmount()));
helper.setText(R.id.tv_box_num, String.valueOf(item.getBoxCode()));
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_status, WorkUtils.getReturnStatus(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);
}
}
}
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.ReturnApplyBean;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class RetrunSendApplyAdapter extends BaseQuickAdapter<ReturnApplyBean.RecordsBean, BaseViewHolder> {
int status;
public RetrunSendApplyAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public RetrunSendApplyAdapter(int layoutResId, @Nullable List<ReturnApplyBean.RecordsBean> data, int status) {
super(layoutResId, data);
this.status = status;
}
@Override
protected void convert(BaseViewHolder helper, ReturnApplyBean.RecordsBean item) {
helper.setText(R.id.tv_name, String.format("%s发起的申请", item.getCreatedByName()));
helper.setText(R.id.tv_code, String.format("申请编号:%s", item.getSerialNumber()));
helper.setText(R.id.tv_num, String.valueOf(item.getProductAmount()));
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_status, WorkUtils.getReturnStatus(Integer.valueOf(item.getStatus())));
helper.setText(R.id.tv_type, item.getReturnTypeName());
// if (status == 0) {
// helper.setVisible(R.id.ll_btn, true);
// helper.addOnClickListener(R.id.tv_agree);
// helper.addOnClickListener(R.id.tv_refuse);
// }
}
}
package com.wd.workoffice.ui.fg;
import android.os.Bundle;
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.TextView;
import com.alibaba.fastjson.JSON;
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.WorkBaseFg;
import com.wd.workoffice.bean.AddStockBean;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.AddStockApplyDetailActivity;
import com.wd.workoffice.ui.adapter.AddStockSendApplyAdapter;
import com.wd.workoffice.ui.adapter.SendApplyAdapter;
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;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
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 AddStockApplyFragment extends WorkBaseFg {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private String state;
private int page = 1;
private Map<String, Object> param;
private AddStockSendApplyAdapter dataAdapter;
private List<AddStockBean.RecordsBean> dataList;
private String orderId;
private String productId;
@Override
protected void initView() {
ButterKnife.bind(this, getContentView());
rvData.setLayoutManager(new LinearLayoutManager(getActivity(), RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
param = WorkUtils.pageKey();
param.put("status", state);
param.put("orderId", orderId);
param.put("productId", productId);
page = 1;
param.put("current", page);
dataList = new ArrayList<>();
dataAdapter = new AddStockSendApplyAdapter(R.layout.item_add_stock_apply, dataList, Integer.valueOf(state));
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
getData();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle arguments = getArguments();
if (arguments != null) {
state = arguments.getString("state");
orderId = arguments.getString("orderId");
productId = arguments.getString("productId");
}
}
private void getData() {
RtfUtils.getRtf().addStockApplyList(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;
}
List<AddStockBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), AddStockBean.class).getRecords();
if (page == 1) {
srlRefresh.finishRefresh();
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("current", page);
getData();
});
dataAdapter.setOnLoadMoreListener(() -> {
param.put("current", page);
getData();
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(AddStockApplyDetailActivity.class, "info", JSON.toJSONString(dataList.get(position)));
}
});
dataAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
switch (view.getId()) {
case R.id.tv_refuse:
checkDialog(2, dataList.get(position).getId());
break;
case R.id.tv_agree:
checkDialog(1, dataList.get(position).getId());
break;
}
}
});
}
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);
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()) && status == 2) {
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("result", status);
param.put("comment", remark);
param.put("id", id);
RtfUtils.getRtf().addStockApplyCheck(id + "", 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;
}
toast("操作成功");
EventBus.getDefault().post(new CheckAddStockEvent());
}
});
}
@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(CheckAddStockEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
......@@ -189,6 +189,24 @@ public class WorkUtils {
}
return name;
}
/**
* 财务状态
* 10未审核 11 12 13 14已通过 21 22 23 24不通过(尾号1部门管理员 2业务部 3财务部 4集团,首数字1:通过,2:驳回)
* @param code
* @return
*/
public static String getReturnStatus(Integer code) {
String name = "";
if (code ==10){
name="未审核";
}else if (code.toString().startsWith("1")){
name="已通过";
}
else if (code.toString().startsWith("2")){
name="已驳回";
}
return name;
}
/**
* 刷新token
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_bottom"
android:layout_width="match_parent"
android:layout_height="48mm"
android:layout_alignParentBottom="true"
android:background="#5C768A"
android:gravity="center"
android:orientation="horizontal"
android:text="提交入库申请"
android:textColor="@color/white"
android:textSize="16sp" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/tv_bottom"
android:background="@color/white">
<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:paddingHorizontal="20mm"
android:paddingVertical="9mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="图号"
android:textSize="14sp" />
<TextView
android:id="@+id/et_img_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="9mm">
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="入库数量"
android:textSize="14sp" />
<EditText
android:id="@+id/et_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:inputType="numberDecimal"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:hint="输入数量"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="9mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="箱号"
android:textSize="14sp" />
<EditText
android:id="@+id/et_box_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:inputType="numberDecimal"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:hint="输入数量"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm"
android:text="申请备注:"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:background="@drawable/shape_confirm_order"
android:orientation="vertical">
<EditText
android:id="@+id/et_remark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:background="@null"
android:gravity="top"
android:hint="请输入"
android:minLines="4"
android:padding="5mm"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_remark_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="4mm"
android:text="0/140"
android:textColor="@color/flexible_text_gray" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
android:layout_marginTop="5mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="邢台德龙钢铁客户"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#0841F0"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="入库数量:"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="箱号:"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_box_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="申请时间:"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10mm"
android:visibility="gone">
<TextView
android:id="@+id/tv_agree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_product_choose"
android:gravity="center"
android:paddingHorizontal="10mm"
android:paddingVertical="5mm"
android:text="通过"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_refuse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@drawable/selector_product_choose"
android:gravity="center"
android:paddingHorizontal="10mm"
android:paddingVertical="5mm"
android:text="驳回"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?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"
android:layout_marginTop="5mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="邢台德龙钢铁客户"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#0841F0"
android:textSize="14sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm">
<TextView
android:id="@+id/tv_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#0841F0"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="退货数量:"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="退货类别:"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10mm"
android:visibility="gone">
<TextView
android:id="@+id/tv_agree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_product_choose"
android:gravity="center"
android:paddingHorizontal="10mm"
android:paddingVertical="5mm"
android:text="通过"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_refuse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@drawable/selector_product_choose"
android:gravity="center"
android:paddingHorizontal="10mm"
android:paddingVertical="5mm"
android:text="驳回"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论