Commit 7061a8a5 authored by 陈前's avatar 陈前

统计订单~~

parent 8c7684aa
...@@ -49,6 +49,11 @@ public class C { ...@@ -49,6 +49,11 @@ public class C {
public static final String synchronousDown = PKG + "downLoad/downLoad"; public static final String synchronousDown = PKG + "downLoad/downLoad";
} }
public final class STA {
public static final String statistics = PKG + "downLoad/getTodayCount";
}
public final class SMS { public final class SMS {
/** /**
* 注册发送短信验证码 * 注册发送短信验证码
......
...@@ -248,7 +248,6 @@ public final class ApiFactory { ...@@ -248,7 +248,6 @@ public final class ApiFactory {
} }
/** /**
* 销售订单查询接口 * 销售订单查询接口
* *
...@@ -257,12 +256,13 @@ public final class ApiFactory { ...@@ -257,12 +256,13 @@ public final class ApiFactory {
* @return * @return
*/ */
public static Observable<Pager<com.xingdata.zzdpos.model.Saleorder>> getSaleOrderList(int pageNulmber, int public static Observable<Pager<com.xingdata.zzdpos.model.Saleorder>> getSaleOrderList(int pageNulmber, int
pageSize,long startDate,long endDate) { pageSize, long startDate, long endDate) {
return Api.getInstance().service.getSaleOrder(pageNulmber, pageSize, startDate, return Api.getInstance().service.getSaleOrder(pageNulmber, pageSize, startDate,
endDate).onErrorReturn(new endDate).onErrorReturn(new
ErrorFilter<>()).map(new ResultFilter<>()).subscribeOn(Schedulers.io()) ErrorFilter<>()).map(new ResultFilter<>()).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()); .observeOn(AndroidSchedulers.mainThread());
} }
/** /**
* 获取订单详情 * 获取订单详情
* *
...@@ -723,6 +723,18 @@ public final class ApiFactory { ...@@ -723,6 +723,18 @@ public final class ApiFactory {
} }
} }
public static class Sat {
/**
* 查询统计详情
*/
public static Observable<Sat> queryNotice() {
return Api.getInstance().service.querySat()
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
}
public static class Psb { public static class Psb {
......
...@@ -172,6 +172,9 @@ interface ApiService { ...@@ -172,6 +172,9 @@ interface ApiService {
Observable<HttpMessage<Pager<Notice>>> queryNotice(@Query("pageNumber") int pageNum, @Query Observable<HttpMessage<Pager<Notice>>> queryNotice(@Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize); ("pageSize") int pageSize);
@POST(C.URL.STA.statistics)
Observable<HttpMessage<ApiFactory.Sat>> querySat();
@POST(C.URL.PSB.queryDetail) @POST(C.URL.PSB.queryDetail)
Observable<HttpMessage<Psb>> queryPsbDetail(@Query("psbNo") String psbNo, @Query("id") long id); Observable<HttpMessage<Psb>> queryPsbDetail(@Query("psbNo") String psbNo, @Query("id") long id);
......
package com.xingdata.zzdpos.model;
/**
* Created by Administrator on 2017/12/25.
*/
public class Sta {
/**
* 销售额
*/
private Long saleAmt = 0L;
/**
* 订单数
*/
private Long saleCount = 0L;
public Long getSaleAmt() {
return saleAmt;
}
public void setSaleAmt(Long saleAmt) {
this.saleAmt = saleAmt;
}
public Long getSaleCount() {
return saleCount;
}
public void setSaleCount(Long saleCount) {
this.saleCount = saleCount;
}
public Long getVipCount() {
return vipCount;
}
public void setVipCount(Long vipCount) {
this.vipCount = vipCount;
}
public Long getVipAddCount() {
return vipAddCount;
}
public void setVipAddCount(Long vipAddCount) {
this.vipAddCount = vipAddCount;
}
public Long getCardAmt() {
return cardAmt;
}
public void setCardAmt(Long cardAmt) {
this.cardAmt = cardAmt;
}
public Long getCardCount() {
return cardCount;
}
public void setCardCount(Long cardCount) {
this.cardCount = cardCount;
}
/**
* 会员总数
*/
private Long vipCount = 0L;
/**
* 新增会员数
*/
private Long vipAddCount = 0L;
/**
* 充值总金额
*/
private Long cardAmt = 0L;
/**
* 充值次数
*/
private Long cardCount = 0L;
}
...@@ -32,5 +32,11 @@ public interface StatisticsContract { ...@@ -32,5 +32,11 @@ public interface StatisticsContract {
* 获取订单列表 * 获取订单列表
*/ */
public abstract void getOrderList(int pageNumber, int pageSize, long startDate, long endDate, OrderListFragment orderListFragment); public abstract void getOrderList(int pageNumber, int pageSize, long startDate, long endDate, OrderListFragment orderListFragment);
/**
* 获取统计详情
*/
public abstract void getSat();
} }
} }
...@@ -14,7 +14,8 @@ import com.xingdata.zzdpos.ui.statistics.fragment.OrderListFragment; ...@@ -14,7 +14,8 @@ import com.xingdata.zzdpos.ui.statistics.fragment.OrderListFragment;
public class StatisticsPresenter extends StatisticsContract.Presenter { public class StatisticsPresenter extends StatisticsContract.Presenter {
private int pageSize=20; private int pageSize = 20;
@Override @Override
public void onAttached() { public void onAttached() {
...@@ -33,13 +34,25 @@ public class StatisticsPresenter extends StatisticsContract.Presenter { ...@@ -33,13 +34,25 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
}) })
.subscribe(orderlist -> { .subscribe(orderlist -> {
fragment.setData(orderlist,orderlist.isFirstPage()); fragment.setData(orderlist, orderlist.isFirstPage());
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getSat() {
ApiFactory.Sat.queryNotice().doFinally(() -> {
})
.subscribe(sat -> {
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
}); });
} }
public void getOrderList(int pageNumber, long startDate, long endDate,OrderListFragment fragment) { public void getOrderList(int pageNumber, long startDate, long endDate, OrderListFragment fragment) {
getOrderList(pageNumber,pageSize,startDate,endDate,fragment); getOrderList(pageNumber, pageSize, startDate, endDate, fragment);
} }
} }
...@@ -32,6 +32,7 @@ public class StatisticsFragment extends BaseFragment<StatisticsPresenter, Fragme ...@@ -32,6 +32,7 @@ public class StatisticsFragment extends BaseFragment<StatisticsPresenter, Fragme
@Override @Override
public void initView() { public void initView() {
mPresenter.getSat();
mViewBinding.icTitle.setOnClickListener(new OnClickListener() { mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
......
...@@ -30,23 +30,20 @@ ...@@ -30,23 +30,20 @@
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="2" android:weightSum="2"
android:padding="@dimen/dp_4"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content">
<Button <Button
android:layout_margin="1dp" android:layout_margin="@dimen/all_padding"
android:id="@+id/btn_cancel" android:id="@+id/btn_cancel"
style="@style/button_passive" style="@style/button_passive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/all_cancel" android:text="@string/all_cancel"
android:textSize="@dimen/dialog_button_text_size" android:textSize="@dimen/all_text_size"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btn_confirm" app:layout_constraintRight_toLeftOf="@id/btn_confirm"
...@@ -54,17 +51,15 @@ ...@@ -54,17 +51,15 @@
tools:targetApi="lollipop" /> tools:targetApi="lollipop" />
<Button <Button
android:layout_margin="1dp" android:layout_margin="@dimen/all_padding"
android:id="@+id/btn_confirm" android:id="@+id/btn_confirm"
style="@style/button_positive" style="@style/button_positive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/all_confirm" android:text="@string/all_confirm"
android:textSize="@dimen/dialog_button_text_size" android:textSize="@dimen/all_text_size"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_cancel" app:layout_constraintLeft_toRightOf="@id/btn_cancel"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
</data> </data>
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/cl_default" android:id="@+id/cl_default"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
android:singleLine="true" android:singleLine="true"
android:text="¥9999" android:text="¥9999"
android:textColor="@color/red900" android:textColor="@color/red900"
android:textSize="@dimen/big_text_size" android:textSize="@dimen/all_text_size_big"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -64,14 +63,13 @@ ...@@ -64,14 +63,13 @@
<TextView <TextView
android:id="@+id/handover_tv_sumamt_hint" android:id="@+id/handover_tv_sumamt_hint"
android:paddingTop="@dimen/all_margin"
android:paddingBottom="@dimen/all_padding"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingBottom="@dimen/all_padding"
android:paddingTop="@dimen/all_margin"
android:text="实收金额" android:text="实收金额"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/small_text_size"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -90,10 +88,10 @@ ...@@ -90,10 +88,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/dp_4"
android:paddingStart="@dimen/dp_4"
android:paddingEnd="@dimen/dp_4"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingEnd="@dimen/dp_4"
android:paddingStart="@dimen/dp_4"
android:paddingTop="@dimen/dp_4"
android:weightSum="2" android:weightSum="2"
app:layout_constraintTop_toBottomOf="@id/view1"> app:layout_constraintTop_toBottomOf="@id/view1">
...@@ -109,56 +107,64 @@ ...@@ -109,56 +107,64 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_date" /> android:text="@string/handover_date"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_oper" /> android:text="@string/handover_oper"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_orderNum" /> android:text="@string/handover_orderNum"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_cash" /> android:text="@string/handover_cash"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_wechat" /> android:text="@string/handover_wechat"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_alipay" /> android:text="@string/handover_alipay"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_bank" /> android:text="@string/handover_bank"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/handover_vip" /> android:text="@string/handover_vip"
android:textSize="@dimen/small_text_size" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -175,7 +181,8 @@ ...@@ -175,7 +181,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{date}" android:text="@{date}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -184,7 +191,8 @@ ...@@ -184,7 +191,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{operName}" android:text="@{operName}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -193,7 +201,8 @@ ...@@ -193,7 +201,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{orderNum}" android:text="@{orderNum}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -202,7 +211,8 @@ ...@@ -202,7 +211,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{cash}" android:text="@{cash}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -211,7 +221,8 @@ ...@@ -211,7 +221,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{wechat}" android:text="@{wechat}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -220,7 +231,8 @@ ...@@ -220,7 +231,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{alipay}" android:text="@{alipay}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -229,7 +241,8 @@ ...@@ -229,7 +241,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{bank}" android:text="@{bank}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
<TextView <TextView
style="@style/textView_body_small" style="@style/textView_body_small"
...@@ -238,7 +251,8 @@ ...@@ -238,7 +251,8 @@
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="@{vipPay}" android:text="@{vipPay}"
android:textColor="@color/black_likui" /> android:textColor="@color/black_likui"
android:textSize="@dimen/small_text_size" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<style name="dialog_title"> <style name="dialog_title">
<item name="android:background">@color/white</item> <item name="android:background">@color/white</item>
<item name="android:textSize">@dimen/dialog_title_text_size</item> <item name="android:textSize">@dimen/big_text_size</item>
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:padding">@dimen/dialog_padding</item> <item name="android:padding">@dimen/dialog_padding</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment