提交 2cc94808 authored 作者: lgd's avatar lgd

1.bat页面商店第一个页面,产品

2.//TODO erp用户激活,忘记密码测试,bat,mes,消息,我的,刷新token
上级 4c7ae0d4
package com.wd.workoffice.bean;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ProcessBean {
/**
* EXT : mollit aliquip pariatur occae
* path : ullamco Excepteur elit cillum
* code : 6608450
* data : [{"deptName":"pariatur incididunt Excepteur exercitation","sendStockTypeName":"","returnStockName":"nulla ipsum voluptate","createdByName":"Excepteur ","code":"aute non culpa ut","transitPartId":3921422,"delFlag":"officia non eu qui culpa","current":-94678683,"processName":"sed consequat qui fugiat","usedStockTypeName":"molli","inStockId":-57542933,"createdTime":"cupidatat cillum nulla","ofDefault":"sunt do reprehender","id":87463060,"sendStockTypeId":89960897,"updatedTime":"ea reprehenderit","createByName":"officia magna","transitPartName":"nostrud ullamco","updatedBy":90341068,"searchStartTime":"sed","updatedByName":"aute cupidatat","deptId":4088783,"searchKey":"quis ex Ut","searchEndTime":"consectetur voluptate","usedStockTypeId":-12015595,"size":-16268998,"createdBy":49110675,"processCode":"voluptate nulla dolore ea","name":"pariatur dolore","returnStockId":-65204182,"inStockName":"fugiat est esse","searchValue":"ut in","status":"aute in ipsum laborum"}]
* httpStatus : -37386300
* message : et sed quis
*/
/**
* deptName : pariatur incididunt Excepteur exercitation
* sendStockTypeName :
* returnStockName : nulla ipsum voluptate
* createdByName : Excepteur
* code : aute non culpa ut
* transitPartId : 3921422
* delFlag : officia non eu qui culpa
* current : -94678683
* processName : sed consequat qui fugiat
* usedStockTypeName : molli
* inStockId : -57542933
* createdTime : cupidatat cillum nulla
* ofDefault : sunt do reprehender
* id : 87463060
* sendStockTypeId : 89960897
* updatedTime : ea reprehenderit
* createByName : officia magna
* transitPartName : nostrud ullamco
* updatedBy : 90341068
* searchStartTime : sed
* updatedByName : aute cupidatat
* deptId : 4088783
* searchKey : quis ex Ut
* searchEndTime : consectetur voluptate
* usedStockTypeId : -12015595
* size : -16268998
* createdBy : 49110675
* processCode : voluptate nulla dolore ea
* name : pariatur dolore
* returnStockId : -65204182
* inStockName : fugiat est esse
* searchValue : ut in
* status : aute in ipsum laborum
*/
private String deptName;
private String sendStockTypeName;
private String returnStockName;
private String createdByName;
private String code;
private int transitPartId;
private String delFlag;
private int current;
private String processName;
private String usedStockTypeName;
private int inStockId;
private String createdTime;
private String ofDefault;
private int id;
private int sendStockTypeId;
private String updatedTime;
private String createByName;
private String transitPartName;
private int updatedBy;
private String searchStartTime;
private String updatedByName;
private int deptId;
private String searchKey;
private String searchEndTime;
private int usedStockTypeId;
private int size;
private int createdBy;
private String processCode;
private String name;
private int returnStockId;
private String inStockName;
private String searchValue;
private String status;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getSendStockTypeName() {
return sendStockTypeName;
}
public void setSendStockTypeName(String sendStockTypeName) {
this.sendStockTypeName = sendStockTypeName;
}
public String getReturnStockName() {
return returnStockName;
}
public void setReturnStockName(String returnStockName) {
this.returnStockName = returnStockName;
}
public String getCreatedByName() {
return createdByName;
}
public void setCreatedByName(String createdByName) {
this.createdByName = createdByName;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getTransitPartId() {
return transitPartId;
}
public void setTransitPartId(int transitPartId) {
this.transitPartId = transitPartId;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getUsedStockTypeName() {
return usedStockTypeName;
}
public void setUsedStockTypeName(String usedStockTypeName) {
this.usedStockTypeName = usedStockTypeName;
}
public int getInStockId() {
return inStockId;
}
public void setInStockId(int inStockId) {
this.inStockId = inStockId;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getOfDefault() {
return ofDefault;
}
public void setOfDefault(String ofDefault) {
this.ofDefault = ofDefault;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getSendStockTypeId() {
return sendStockTypeId;
}
public void setSendStockTypeId(int sendStockTypeId) {
this.sendStockTypeId = sendStockTypeId;
}
public String getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public String getCreateByName() {
return createByName;
}
public void setCreateByName(String createByName) {
this.createByName = createByName;
}
public String getTransitPartName() {
return transitPartName;
}
public void setTransitPartName(String transitPartName) {
this.transitPartName = transitPartName;
}
public int getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(int updatedBy) {
this.updatedBy = updatedBy;
}
public String getSearchStartTime() {
return searchStartTime;
}
public void setSearchStartTime(String searchStartTime) {
this.searchStartTime = searchStartTime;
}
public String getUpdatedByName() {
return updatedByName;
}
public void setUpdatedByName(String updatedByName) {
this.updatedByName = updatedByName;
}
public int getDeptId() {
return deptId;
}
public void setDeptId(int deptId) {
this.deptId = deptId;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String searchKey) {
this.searchKey = searchKey;
}
public String getSearchEndTime() {
return searchEndTime;
}
public void setSearchEndTime(String searchEndTime) {
this.searchEndTime = searchEndTime;
}
public int getUsedStockTypeId() {
return usedStockTypeId;
}
public void setUsedStockTypeId(int usedStockTypeId) {
this.usedStockTypeId = usedStockTypeId;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getReturnStockId() {
return returnStockId;
}
public void setReturnStockId(int returnStockId) {
this.returnStockId = returnStockId;
}
public String getInStockName() {
return inStockName;
}
public void setInStockName(String inStockName) {
this.inStockName = inStockName;
}
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
......@@ -2,6 +2,7 @@ package com.wd.workoffice.contract;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.bean.DepBean;
import com.wd.workoffice.bean.ProcessBean;
import java.util.List;
......@@ -17,7 +18,7 @@ import io.reactivex.Observable;
**/
public interface BatSaleContract {
interface Model extends IBaseModel {
Observable<BaseBean> getProcess(String processCode, String transitPartId);
Observable<BaseBean> getProcess(String processCode, Integer transitPartId);
Observable<BaseBean> getProduct(String phone, String verifyCode, String type);
......@@ -25,7 +26,7 @@ public interface BatSaleContract {
}
interface View extends IBaseView {
void processList(List<Object> dataList);
void processList(List<ProcessBean> dataList);
void productList(List<Object> dataList);
......@@ -34,7 +35,7 @@ public interface BatSaleContract {
interface Presenter extends IBasePresenter<View> {
void getProcess(String processCode, String transitPartId);
void getProcess(String processCode, Integer transitPartId);
void getProduct(String phone, String verifyCode, String type);
......
......@@ -17,7 +17,7 @@ public class BatSaleModel implements BatSaleContract.Model {
}
@Override
public Observable<BaseBean> getProcess(String processCode, String transitPartId) {
public Observable<BaseBean> getProcess(String processCode, Integer transitPartId) {
return RtfUtils.getRtf().getProcess(processCode, transitPartId);
}
......
package com.wd.workoffice.presenter;
import android.content.Intent;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.bean.DepBean;
import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.contract.BatSaleContract;
import com.wd.workoffice.contract.ForgetOneContract;
import com.wd.workoffice.model.BatSaleModel;
......@@ -26,7 +29,7 @@ public class BatSalePresenter extends BasePresenter<BatSaleContract.View, BatSal
@Override
public void getProcess(String processCode, String transitPartId) {
public void getProcess(String processCode, Integer transitPartId) {
mView.showLoading();
mModel.getProcess(processCode, transitPartId).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
......@@ -47,7 +50,7 @@ public class BatSalePresenter extends BasePresenter<BatSaleContract.View, BatSal
mView.onError(data.getMessage());
return;
}
// mView.processList(data.getData());
mView.processList(JSON.parseArray(data.getData().toString(), ProcessBean.class));
}
});
}
......
......@@ -219,15 +219,15 @@ public interface ApiService {
* @return
*/
@GET("/sub-process/listByDPT")
Observable<BaseBean> getProcess(@Query("processCode") String processCode, @Query("transitPartId") String transitPartId);
Observable<BaseBean> getProcess(@Query("processCode") String processCode, @Query("transitPartId") Integer transitPartId);
/**
* 根据往来单位的类别 获取当前用户所维护的往来单位列表
*
* @param name
* @param partTypeCode partTypeCode:SUPPLIER-供应商
* * CUSTOMER-客户
* * TRANSPORTERS-运输商
* * CUSTOMER-客户
* * TRANSPORTERS-运输商
* @return
*/
@GET("/transitpart/page/list/current-user/part-type")
......
package com.wd.workoffice.ui.activity.bat;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
......@@ -9,6 +10,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.DepBean;
import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.bean.workEnum.PermissType;
import com.wd.workoffice.contract.BatSaleContract;
import com.wd.workoffice.presenter.BatSalePresenter;
......@@ -17,6 +19,7 @@ import com.wd.workoffice.util.DialogUtils;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
......@@ -44,9 +47,14 @@ public class StoreSaleActivity extends WorkToolBarActivity implements BatSaleCon
RelativeLayout rlProduct;
private BatSalePresenter batSalePresenter;
private QMUIDialog.MenuDialogBuilder depDialog;
private QMUIDialog.MenuDialogBuilder processDialog;
private List<DepBean> depList;
List<String> depNameList = new ArrayList<>();
private DepBean chooseDep;
private Integer clientId;
private List<String> processNameList=new ArrayList<>();
private List<ProcessBean> processList;
private ProcessBean chooseProcess;
@Override
protected void initView() {
......@@ -54,6 +62,7 @@ public class StoreSaleActivity extends WorkToolBarActivity implements BatSaleCon
batSalePresenter = new BatSalePresenter();
batSalePresenter.onAttach(this);
depDialog = DialogUtils.listDialog(this);
processDialog = DialogUtils.listDialog(this);
}
@Override
......@@ -75,25 +84,49 @@ public class StoreSaleActivity extends WorkToolBarActivity implements BatSaleCon
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rl_client:
startActivity(StoreSaleClientActivity.class);
startActivityForResult(StoreSaleClientActivity.class, 10001);
break;
case R.id.rl_dep:
depDialog.show();
break;
case R.id.rl_process:
if (chooseDep==null){
if (clientId == null) {
toast("请先选择客户");
return;
}
processDialog.show();
break;
case R.id.rl_product:
if (clientId == null) {
toast("请选择客户");
return;
}
if (chooseDep == null) {
toast("请选择生产厂");
return;
}
if (chooseProcess == null) {
toast("请选择子流程");
return;
}
break;
}
}
@Override
public void processList(List<Object> dataList) {
public void processList(List<ProcessBean> dataList) {
processList = dataList;
for (ProcessBean process : dataList) {
processNameList.add(process.getName());
}
processDialog.addItems(processNameList.toArray(new String[processNameList.size()]), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
chooseProcess = processList.get(which);
tvProcess.setText(processNameList.get(which));
dialog.dismiss();
}
});
}
@Override
......@@ -116,4 +149,15 @@ public class StoreSaleActivity extends WorkToolBarActivity implements BatSaleCon
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 10001 && resultCode == 10001) {
String clientName = data.getStringExtra("clientName");
clientId = data.getIntExtra("id", 0);
tvClient.setText(clientName);
batSalePresenter.getProcess(PermissType.PROCESS_SALE.getCode(), clientId);
}
}
}
package com.wd.workoffice.ui.activity.bat;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -19,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
......@@ -45,17 +47,18 @@ public class StoreSaleClientActivity extends WorkToolBarActivity {
@Override
protected void initView() {
ButterKnife.bind(this);
rvClient.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new StoreClientAdapter(R.layout.item_store_client, clientList);
clientAdapter.bindToRecyclerView(rvClient);
param = WorkUtils.pageKey();
param.put("partTypeCode", "CUSTOMER");
param.put("name", "CUSTOMER");
}
@Override
protected void initData() {
getData();
}
private void getData() {
......@@ -77,7 +80,7 @@ public class StoreSaleClientActivity extends WorkToolBarActivity {
toast(data.getMessage());
return;
}
List<ClientBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(),ClientBean.class).getRecords();
List<ClientBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(), ClientBean.class).getRecords();
if (page == 1) {
clientList.clear();
clientList.addAll(dataList);
......@@ -102,13 +105,18 @@ public class StoreSaleClientActivity extends WorkToolBarActivity {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("page", page);
param.put("current", page);
getData();
}
}, rvClient);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("clientName", clientList.get(position).getName());
intent.putExtra("id", clientList.get(position).getId());
setResult(10001, intent);
finish();
}
});
}
......@@ -122,7 +130,7 @@ public class StoreSaleClientActivity extends WorkToolBarActivity {
@OnClick(R.id.btn_search)
public void onViewClicked() {
param.put("name", etKey.getText().toString());
param.put("page", 1);
param.put("current", 1);
getData();
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#333333" android:width="1dp"/>
<corners android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fff0f5f8"/>
<solid android:color="@color/input_background"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
......@@ -29,8 +29,8 @@
android:paddingHorizontal="10mm">
<ImageView
android:layout_width="10mm"
android:layout_height="10mm"
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/client_search" />
<EditText
......@@ -41,7 +41,8 @@
android:background="@null"
android:hint="搜索客户"
android:textColor="#91ABBA"
android:textColorHint="#91ABBA" />
android:textColorHint="#91ABBA"
android:textSize="14sp" />
</LinearLayout>
......@@ -59,8 +60,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_client"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="20mm"
android:layout_height="wrap_content"
android:layout_marginTop="4mm">
</androidx.recyclerview.widget.RecyclerView>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@color/input_background"
android:orientation="vertical"
android:padding="5mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已选择"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:text="订单类别:销售流程"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:text="厂家:钳锅厂"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_name3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:text="订单流程:销售二公司销售默认流程"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="客户名称:江苏沙钢集团有限公司"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/selector_product_choose"
android:gravity="center"
android:padding="5mm"
android:text="重新选择"
android:textSize="11sp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_client_search"
android:gravity="center_vertical"
android:paddingHorizontal="10mm">
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/client_search" />
<EditText
android:id="@+id/et_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2mm"
android:background="@null"
android:hint="搜索图号/品名/规则/品号"
android:maxLines="1"
android:textColor="#91ABBA"
android:textColorHint="#91ABBA"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_search"
android:layout_width="50mm"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@color/mainTextColor"
android:text="搜索"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
......@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<TextView
......@@ -10,5 +11,6 @@
android:layout_height="wrap_content"
android:text="1243"
android:textSize="16sp"
android:padding="10mm" />
android:paddingHorizontal="10mm"
android:paddingVertical="15mm" />
</LinearLayout>
\ No newline at end of file
......@@ -8,5 +8,5 @@
<color name="main_icon_select">#3F617F</color>
<color name="main_icon">#C3CED7</color>
<color name="flexible_background">#fff6f9fb</color>
<color name="input_background">#F0F5F8</color>
</resources>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论