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

1.往来详情 信息

2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级 977b30bd
......@@ -416,6 +416,22 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkContactsDetailActivity"
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.work.WorkContactsInfoActivity"
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"
......
package com.wd.workoffice.bean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ContactsList {
/**
* records : [{"createdBy":111,"createdByName":null,"createdTime":"2019-11-25 11:31:32","updatedBy":143,"updatedByName":null,"updatedTime":"2019-12-31 13:49:23","id":40,"name":"北京首鑫联合耐火材料有限公司1","contacter":"吕届蜂","address":"No 1173 Street , Ste. 7681","phone":"15020055000","erpId":"89","productId":null,"partTypeRelList":null,"processRelList":null,"processList":null,"referProcessList":null,"partTypeNames":"供应商","partTypeCode":null,"accountId":null,"accountName":null,"deptName":null,"channelPrice":null,"deptIdList":null,"supplier":null,"customer":null,"transporters":null,"processes":null}]
* total : 1
* size : 10
* current : 1
* orders : []
* searchCount : true
* pages : 1
*/
private int total;
private int size;
private int current;
private boolean searchCount;
private int pages;
private List<ContactsBean> records;
private List<?> orders;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
public boolean isSearchCount() {
return searchCount;
}
public void setSearchCount(boolean searchCount) {
this.searchCount = searchCount;
}
public int getPages() {
return pages;
}
public void setPages(int pages) {
this.pages = pages;
}
public List<ContactsBean> getRecords() {
return records;
}
public void setRecords(List<ContactsBean> records) {
this.records = records;
}
public List<?> getOrders() {
return orders;
}
public void setOrders(List<?> orders) {
this.orders = orders;
}
}
......@@ -2,7 +2,7 @@ package com.wd.workoffice.contract;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.ContactsList;
import java.util.List;
import java.util.Map;
......@@ -24,7 +24,7 @@ public interface WorkContactsContract {
}
interface View extends IBaseView {
void getData(List<ContactsBean.RecordsBean> dataList);
void getData(List<ContactsBean> dataList);
}
......
......@@ -3,9 +3,8 @@ package com.wd.workoffice.presenter;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.ContactsList;
import com.wd.workoffice.contract.WorkContactsContract;
import com.wd.workoffice.contract.WorkProContract;
import com.wd.workoffice.model.WorkContactsModel;
import com.wd.workoffice.retrofit.WorkObserver;
......@@ -43,7 +42,7 @@ public class WorkContactsPresenter extends BasePresenter<WorkContactsContract.V
mView.onError(data.getMessage());
return;
}
mView.getData(JSON.parseArray(JSON.parseObject(data.getData().toString()).getString("records"), ContactsBean.RecordsBean.class));
mView.getData(JSON.parseArray(JSON.parseObject(data.getData().toString()).getString("records"), ContactsBean.class));
}
});
}
......
......@@ -515,4 +515,13 @@ public interface ApiService {
*/
@GET("/stockType/app/search/list")
Observable<BaseBean> getStockType(@QueryMap Map<String, Object> param);
/**
* 查看往来单位详情
*
* @return
*/
@GET("/transitpart/{id}")
Observable<BaseBean> contactInfo(@Path("id") String id);
}
......@@ -21,7 +21,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 工作台 - 产品
* 工作台 - 往来
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
......
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 工作台 - 往来-详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkContactsDetailActivity extends WorkToolBarActivity {
@BindView(R.id.ll_info)
LinearLayout llInfo;
@BindView(R.id.ll_receive)
LinearLayout llReceive;
@BindView(R.id.ll_live)
LinearLayout llLive;
@BindView(R.id.ll_settle)
LinearLayout llSettle;
@BindView(R.id.ll_client)
LinearLayout llClient;
@BindView(R.id.ll_ticket)
LinearLayout llTicket;
@BindView(R.id.ll_order)
LinearLayout llOrder;
@BindView(R.id.ll_return)
LinearLayout llReturn;
@Override
protected void initView() {
ButterKnife.bind(this);
if (TextUtils.equals("客户", getIntent().getStringExtra("partTypeNames"))) {
llClient.setVisibility(View.GONE);
}
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_work_contacts_detail;
}
@OnClick({R.id.ll_info, R.id.ll_receive, R.id.ll_live, R.id.ll_settle, R.id.ll_ticket, R.id.ll_order, R.id.ll_return})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.ll_info:
startActivity(WorkContactsInfoActivity.class,"id",getIntent().getStringExtra("id"));
break;
case R.id.ll_receive:
break;
case R.id.ll_live:
break;
case R.id.ll_settle:
break;
case R.id.ll_ticket:
break;
case R.id.ll_order:
break;
case R.id.ll_return:
break;
}
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
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.ContactsBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkContactsInfoAdapter;
import com.wd.workoffice.util.MathUtils;
import java.util.ArrayList;
import java.util.List;
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 WorkContactsInfoActivity extends WorkToolBarActivity {
@BindView(R.id.tv_company_name)
TextView tvCompanyName;
@BindView(R.id.tv_link_man)
TextView tvLinkMan;
@BindView(R.id.tv_link_phone)
TextView tvLinkPhone;
@BindView(R.id.tv_address)
TextView tvAddress;
@BindView(R.id.tv_process)
TextView tvProcess;
@BindView(R.id.rv_data)
RecyclerView rvData;
private ContactsBean dataBean;
private WorkContactsInfoAdapter workContactsInfoAdapter;
private List<ContactsBean.PartTypeRelListBean> partTypeRelList =new ArrayList<>();
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this,RecyclerView.VERTICAL,false));
workContactsInfoAdapter = new WorkContactsInfoAdapter(R.layout.item_work_contacts_info,partTypeRelList);
}
@Override
protected void initData() {
getData();
}
private void getData() {
RtfUtils.getRtf().contactInfo(getIntent().getStringExtra("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;
}
dataBean = JSON.parseObject(data.getData().toString(), ContactsBean.class);
tvCompanyName.setText(dataBean.getName());
tvLinkMan.setText(dataBean.getContacter());
tvLinkPhone.setText(dataBean.getPhone());
tvAddress.setText(dataBean.getAddress());
tvProcess.setText(getProcessString(dataBean.getProcessList()));
partTypeRelList.addAll(dataBean.getPartTypeRelList());
}
});
}
@Override
protected void initEvent() {
}
protected String getProcessString(List<ContactsBean.ProcessListBean> data) {
String returnData = "";
if (data != null && data.size() != 0) {
for (ContactsBean.ProcessListBean process : data) {
returnData = returnData + process.getName() + ",";
}
returnData = returnData.substring(0, returnData.length() - 1);
} else {
returnData = "无";
}
return returnData;
}
@Override
protected int layoutId() {
return R.layout.activity_work_contacts_info;
}
}
......@@ -10,6 +10,7 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ContactsList;
import com.wd.workoffice.contract.WorkContactsContract;
import com.wd.workoffice.presenter.WorkContactsPresenter;
import com.wd.workoffice.ui.adapter.WorkContactsAdapter;
......@@ -49,7 +50,7 @@ public class WorkContactsSearchActivity extends WorkBaseActivity implements Work
private Map<String, Object> param;
private WorkContactsPresenter workProPresenter;
private WorkContactsAdapter workProductAdapter;
private List<ContactsBean.RecordsBean> dataList;
private List<ContactsBean> dataList;
private int page = 1;
private String partTypeNames="供应商";
private String tab[] = {"供应商", "客户", "物流公司"};
......@@ -146,7 +147,7 @@ public class WorkContactsSearchActivity extends WorkBaseActivity implements Work
@Override
public void getData(List<ContactsBean.RecordsBean> data) {
public void getData(List<ContactsBean> data) {
toast("加载完成");
if (page == 1) {
dataList.clear();
......
......@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.ContactsList;
import java.util.List;
......@@ -13,14 +13,14 @@ import java.util.List;
* Created by flexible on 2018/8/13.
*/
public class WorkContactsAdapter extends BaseQuickAdapter<ContactsBean.RecordsBean, BaseViewHolder> {
public class WorkContactsAdapter extends BaseQuickAdapter<ContactsBean, BaseViewHolder> {
public WorkContactsAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ContactsBean.RecordsBean item) {
protected void convert(BaseViewHolder helper,ContactsBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_address, item.getAddress());
helper.setText(R.id.tv_phone, item.getPhone());
......
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.ContactsBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkContactsInfoAdapter extends BaseQuickAdapter<ContactsBean.PartTypeRelListBean, BaseViewHolder> {
public WorkContactsInfoAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper,ContactsBean.PartTypeRelListBean item) {
helper.setText(R.id.tv_first_contact_type, item.getTransitPartType());
helper.setText(R.id.tv_first_dep, item.getDeptName());
helper.setText(R.id.tv_first_person, item.getAccountName());
helper.setText(R.id.tv_level, "类别".concat(MathUtils.conver(helper.getAdapterPosition())));
}
}
......@@ -8,8 +8,10 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.ContactsBean;
import com.wd.workoffice.bean.ContactsList;
import com.wd.workoffice.contract.WorkContactsContract;
import com.wd.workoffice.presenter.WorkContactsPresenter;
import com.wd.workoffice.ui.activity.bat.work.WorkContactsDetailActivity;
import com.wd.workoffice.ui.adapter.WorkContactsAdapter;
import com.wd.workoffice.util.WorkUtils;
......@@ -40,7 +42,7 @@ public class WorkContactsFragment extends WorkBaseFg implements WorkContactsCont
private Map<String, Object> param;
private WorkContactsPresenter workProPresenter;
private WorkContactsAdapter workProductAdapter;
private List<ContactsBean.RecordsBean> dataList;
private List<ContactsBean> dataList;
@Override
protected void initView() {
......@@ -87,7 +89,8 @@ public class WorkContactsFragment extends WorkBaseFg implements WorkContactsCont
workProductAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// startActivity(WorkProDetailActivity.class, "pro", JSON.toJSONString(dataList.get(position)));
startActivity(WorkContactsDetailActivity.class,
"id",dataList.get(position).getId()+"","partTypeNames", partTypeNames);
}
});
}
......@@ -99,7 +102,7 @@ public class WorkContactsFragment extends WorkBaseFg implements WorkContactsCont
}
@Override
public void getData(List<ContactsBean.RecordsBean> data) {
public void getData(List<ContactsBean> data) {
if (page == 1) {
dataList.clear();
dataList.addAll(data);
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_info"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="基本信息"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View
style="@style/dividerX"
android:layout_marginHorizontal="26mm" />
<LinearLayout
android:id="@+id/ll_receive"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="应收账款"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_client"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_live"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="现场库"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View
style="@style/dividerX"
android:layout_marginHorizontal="26mm" />
<LinearLayout
android:id="@+id/ll_settle"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="未结算库"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_ticket"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="开票单"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View
style="@style/dividerX"
android:layout_marginHorizontal="26mm" />
<LinearLayout
android:id="@+id/ll_order"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="成交订单"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View
style="@style/dividerX"
android:layout_marginHorizontal="26mm" />
<LinearLayout
android:id="@+id/ll_return"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="退货记录"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10mm">
<View
android:layout_width="8mm"
android:layout_height="18mm"
android:background="@color/red_btn_bg" />
<TextView
android:id="@+id/tv_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="类别一"
android:textSize="16sp" />
</LinearLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="往来单位类型"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_first_contact_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_gray"
android:textSize="16sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="部门"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_first_dep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_gray"
android:textSize="16sp" />
</RelativeLayout>
<View style="@style/dividerX" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:gravity="center"
android:paddingHorizontal="20mm"
android:paddingVertical="15mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="维护人"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_first_person"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="销售二公司"
android:textColor="@color/flexible_text_gray"
android:textSize="16sp" />
</RelativeLayout>
</LinearLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论