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"
......
This diff is collapsed.
...@@ -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