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

1.利润分析页面

上级 f139d4ac
......@@ -17,6 +17,7 @@ import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
import com.wd.workoffice.ui.adapter.WorkProfitAdapter;
import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.util.WorkUtils;
......@@ -58,7 +59,7 @@ public class WorkFinancialProfitActivity extends WorkToolBarActivity {
TextView tvSale;
private Map<String, Object> param;
private List<ProPriceBean.RecordsBean> dataList;
private WorkProPriceAdapter dataAdapter;
private WorkProfitAdapter dataAdapter;
private int page = 1;
@Override
......@@ -71,7 +72,7 @@ public class WorkFinancialProfitActivity extends WorkToolBarActivity {
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new WorkProPriceAdapter(R.layout.item_pro_price, dataList);
dataAdapter = new WorkProfitAdapter(R.layout.item_profit, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
......@@ -151,7 +152,7 @@ public class WorkFinancialProfitActivity extends WorkToolBarActivity {
public void onTimeSelect(Date date, View v) {
tvTime.setText(TimeUtils.date2String(date,new SimpleDateFormat("yyyy-MM")));
}
},true);
},true).show();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
......
package com.wd.workoffice.ui.activity.bat.work;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
......@@ -15,13 +11,10 @@ import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.ui.adapter.ProfitProductAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -29,9 +22,7 @@ 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 flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.disposables.Disposable;
/**
......@@ -41,23 +32,27 @@ import io.reactivex.disposables.Disposable;
**/
public class WorkFinancialProfitDetailActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.tv_dep_name)
TextView tvDepName;
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.tv_people)
TextView tvPeople;
@BindView(R.id.tv_dep)
TextView tvDep;
@BindView(R.id.tv_order_no)
TextView tvOrderNo;
@BindView(R.id.tv_order_type)
TextView tvOrderType;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.ll_time)
LinearLayout llTime;
@BindView(R.id.tv_month_profit)
TextView tvMonthProfit;
@BindView(R.id.tv_cost)
TextView tvCost;
@BindView(R.id.tv_sale)
TextView tvSale;
@BindView(R.id.tv_order_price)
TextView tvOrderPrice;
@BindView(R.id.ll_sale)
LinearLayout llSale;
@BindView(R.id.rv_data)
RecyclerView rvData;
private Map<String, Object> param;
private List<ProPriceBean.RecordsBean> dataList;
private WorkProPriceAdapter dataAdapter;
private ProfitProductAdapter dataAdapter;
private int page = 1;
@Override
......@@ -70,7 +65,7 @@ public class WorkFinancialProfitDetailActivity extends WorkToolBarActivity {
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new WorkProPriceAdapter(R.layout.item_pro_price, dataList);
dataAdapter = new ProfitProductAdapter(R.layout.item_profit_product, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
param = WorkUtils.pageKey();
......@@ -133,32 +128,7 @@ public class WorkFinancialProfitDetailActivity extends WorkToolBarActivity {
@Override
protected int layoutId() {
return R.layout.activity_profit;
return R.layout.activity_profit_detail;
}
@OnClick(R.id.ll_time)
public void onViewClicked() {
PickTimeUtils.showPickTwo(this, new OnTimeSelectListener() {
@Override
public void onTimeSelect(Date date, View v) {
tvTime.setText(TimeUtils.date2String(date,new SimpleDateFormat("yyyy-MM")));
}
},true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_rule, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.rule:
startActivity(WorkFinancialProfitRuleActivity.class);
break;
}
return super.onOptionsItemSelected(item);
}
}
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.OrderDetail;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class ProfitProductAdapter extends BaseQuickAdapter<OrderDetail.OrderItemsBean, BaseViewHolder> {
public ProfitProductAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean item) {
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_card, item.getProductSoleCode());
helper.setText(R.id.tv_card_name, item.getProductSimpleCode());
helper.setText(R.id.tv_spec, item.getProductSpec());
helper.setText(R.id.tv_sale_price, "¥".concat(MathUtils.converData(item.getInnerPrice(),3)));
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInnerPrice(),3)));
helper.setText(R.id.tv_all_price, "¥".concat(MathUtils.multiply(MathUtils.converData(item.getProductCount(),3),
MathUtils.converData(item.getInnerPrice(),3),3)));
helper.setText(R.id.tv_unit, item.getProductUnit());
helper.setText(R.id.tv_num, MathUtils.converData(item.getProductCount(),3));
}
}
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.ProPriceBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class WorkProfitAdapter extends BaseQuickAdapter<ProPriceBean.RecordsBean, BaseViewHolder> {
public WorkProfitAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ProPriceBean.RecordsBean item) {
helper.setText(R.id.tv_price, MathUtils.converData(item.getNewPrice(),3));
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_person, "提交人:".concat(item.getCreatedByName()));
helper.setText(R.id.tv_remark, "备注:".concat(item.getRemark()));
}
}
<?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:background="@color/white"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
......
......@@ -41,9 +41,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingBottom="20mm"
android:orientation="vertical"
android:paddingHorizontal="20mm">
android:paddingHorizontal="20mm"
android:paddingBottom="20mm">
<TextView
android:id="@+id/tv_name"
......@@ -64,7 +64,6 @@
android:paddingVertical="10mm">
<RelativeLayout
android:id="@+id/rl_dep"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm">
......@@ -79,7 +78,7 @@
android:textSize="13sp" />
<TextView
android:id="@+id/tv_dep"
android:id="@+id/tv_people"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......@@ -105,7 +104,7 @@
android:textSize="13sp" />
<TextView
android:id="@+id/tv_place_name"
android:id="@+id/tv_dep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......@@ -140,6 +139,7 @@
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -156,7 +156,7 @@
android:textSize="13sp" />
<TextView
android:id="@+id/tv_send_time"
android:id="@+id/tv_order_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......@@ -165,6 +165,7 @@
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -215,7 +216,6 @@
</LinearLayout>
<View style="@style/ViewX" />
<LinearLayout
......@@ -232,12 +232,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="品信息"
android:text="品信息"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_from"
android:id="@+id/rv_data"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
......
......@@ -17,6 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm"
android:lineSpacingMultiplier="1.5"
android:text="1、销售利润=销售额-成本。销售额=销售单价×数量,计算已接单订单,除去提前结束的无效订单。"
android:textColor="@color/flexible_text_gray" />
......@@ -24,6 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15mm"
android:lineSpacingMultiplier="1.5"
android:text="2、统计时限以自然月为基本口径。"
android:textColor="@color/flexible_text_gray" />
......@@ -31,13 +33,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15mm"
android:lineSpacingMultiplier="1.5"
android:text="3、主要帮助销售公司展示销售利润,只计算具有销售下单和外采购下单权限的部门。"
android:textColor="@color/flexible_text_gray" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15mm"
android:layout_marginTop="15mm" android:lineSpacingMultiplier="1.5"
android:text="4、由于统计口径不一致、网络存在延迟等原因,统计数据可能与实际不符,请以实际交易为准。"
android:textColor="@color/flexible_text_gray" />
</LinearLayout>
\ No newline at end of file
......@@ -14,12 +14,14 @@
android:orientation="vertical">
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="订单" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
......@@ -30,6 +32,7 @@
</LinearLayout>
<TextView
android:id="@+id/tv_cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -37,6 +40,7 @@
android:text="成本(元)" />
<TextView
android:id="@+id/tv_sale"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......
<?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:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="品名"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="成本单价"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="销售单价"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_sale_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="单位"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
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:layout_alignParentLeft="true"
android:text="数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="4mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小计:"
android:textColor="@color/flexible_text_gray" />
<TextView
android:id="@+id/tv_all_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/flexible_text_gray" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论