Commit 6981a800 authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/xingdata/zzdpos/ui/main/MainActivity.java
parents c53c1a99 c127239c
......@@ -98,6 +98,15 @@ public class C {
public static final String addStore = PKG + "shop/addShopMis";
}
public final class SMT {
/**
* 获取月份销售统计
*/
public static final String querySmt = PKG + "smt/query";
}
public final class COUNTER {
/**
* 添加款台信息
......
......@@ -11,6 +11,7 @@ import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.model.UsskuParam;
......@@ -431,6 +432,19 @@ public final class ApiFactory {
}
}
public static class Smt {
public static Observable<Pager<com.xingdata.zzdpos.model.Smt>> queryAll(int pageSize, int
pageNumber) {
return Api.getInstance().service.querySmt(pageSize, pageNumber)
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
}
public static class Ussku {
public static Observable<Pager<com.xingdata.zzdpos.model.Ussku>> usskuQuery(int pageNum,
String keyword) {
......@@ -1230,6 +1244,7 @@ public final class ApiFactory {
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3));
}
public static Observable<Pager<Mscard>> mscardQuery() {
return Api.getInstance().service.mscardQuery()
.onErrorReturn(new ErrorFilter<>())
......
......@@ -18,6 +18,7 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Sta;
......@@ -210,7 +211,7 @@ interface ApiService {
pageNum, @Query
("pageSize") int
pageSize, @Query
("startDate") long startDate, @Query("endDate") long
("startDate") long startDate, @Query("endDate") long
endDate);
@POST(C.URL.PSB.queryDetail)
......@@ -313,6 +314,10 @@ interface ApiService {
@POST(C.URL.SHOP.queryAll)
Observable<HttpMessage<List<Category>>> queryAll(@Body Category category);
@POST(C.URL.SMT.querySmt)
Observable<HttpMessage<Pager<Smt>>> querySmt(@Query("pageSize")
int pageSize, @Query("pageNumber") int pageNumber);
@POST(C.URL.USSKU.usskuQuery)
Observable<HttpMessage<Pager<Ussku>>> usskuQuery(@Query("wd") String wd, @Query("pageSize")
int pageSize, @Query("pageNumber") int pageNumber);
......
package com.xingdata.zzdpos.model;
/**
* Created by Administrator on 2018/1/18.
*/
public class Smt {
private Long sdtId;
private Long opMapId;
private Long channelMapId;
private Long merMapId;
private Long shopMapId;
private String merNameabcn;
private String shopNameabcn;
private Long cityCountyId;
private Long totalDate;
private Long totalInCnt;
private Long totalInAmt;
private Long totalAvgPrice;
private Long totalProfit;
private Long totalProfitPer;
private Long lossCnt;
private Long lossAmt;
private Long totalOutCnt;
private Long totalOutAmt;
private Long payCashCnt;
private Long payCashAmt;
private Long payBankCnt;
private Long payBankAmt;
private Long payVipcardCnt;
private Long payVipcardAmt;
private Long payWxCnt;
private Long payWxAmt;
private Long payAlipayCnt;
private Long payAlipayAmt;
private Long payOthpayCnt;
private Long payOthpayAmt;
private Long vipCnt;
private Long vipAmt;
private Long novipCnt;
private Long novipAmt;
private Long onlineCnt;
private Long onlineAmt;
private Long offlineCnt;
private Long offlineAmt;
private Long promoteCnt;
private Long promoteAmt;
private Long totalMonth;
private Long totalYear;
private Long lgeUnit;
private Long lge;
private Long avgInCnt;
public Long getSdtId() {
return sdtId;
}
public void setSdtId(Long sdtId) {
this.sdtId = sdtId;
}
public Long getOpMapId() {
return opMapId;
}
public void setOpMapId(Long opMapId) {
this.opMapId = opMapId;
}
public Long getChannelMapId() {
return channelMapId;
}
public void setChannelMapId(Long channelMapId) {
this.channelMapId = channelMapId;
}
public Long getMerMapId() {
return merMapId;
}
public void setMerMapId(Long merMapId) {
this.merMapId = merMapId;
}
public Long getShopMapId() {
return shopMapId;
}
public void setShopMapId(Long shopMapId) {
this.shopMapId = shopMapId;
}
public String getMerNameabcn() {
return merNameabcn;
}
public void setMerNameabcn(String merNameabcn) {
this.merNameabcn = merNameabcn == null ? null : merNameabcn.trim();
}
public String getShopNameabcn() {
return shopNameabcn;
}
public void setShopNameabcn(String shopNameabcn) {
this.shopNameabcn = shopNameabcn == null ? null : shopNameabcn.trim();
}
public Long getCityCountyId() {
return cityCountyId;
}
public void setCityCountyId(Long cityCountyId) {
this.cityCountyId = cityCountyId;
}
public Long getTotalDate() {
return totalDate;
}
public void setTotalDate(Long totalDate) {
this.totalDate = totalDate;
}
public Long getTotalInCnt() {
return totalInCnt;
}
public void setTotalInCnt(Long totalInCnt) {
this.totalInCnt = totalInCnt;
}
public Long getTotalInAmt() {
return totalInAmt;
}
public void setTotalInAmt(Long totalInAmt) {
this.totalInAmt = totalInAmt;
}
public Long getTotalAvgPrice() {
return totalAvgPrice;
}
public void setTotalAvgPrice(Long totalAvgPrice) {
this.totalAvgPrice = totalAvgPrice;
}
public Long getTotalProfit() {
return totalProfit;
}
public void setTotalProfit(Long totalProfit) {
this.totalProfit = totalProfit;
}
public Long getTotalProfitPer() {
return totalProfitPer;
}
public void setTotalProfitPer(Long totalProfitPer) {
this.totalProfitPer = totalProfitPer;
}
public Long getLossCnt() {
return lossCnt;
}
public void setLossCnt(Long lossCnt) {
this.lossCnt = lossCnt;
}
public Long getLossAmt() {
return lossAmt;
}
public void setLossAmt(Long lossAmt) {
this.lossAmt = lossAmt;
}
public Long getTotalOutCnt() {
return totalOutCnt;
}
public void setTotalOutCnt(Long totalOutCnt) {
this.totalOutCnt = totalOutCnt;
}
public Long getTotalOutAmt() {
return totalOutAmt;
}
public void setTotalOutAmt(Long totalOutAmt) {
this.totalOutAmt = totalOutAmt;
}
public Long getPayCashCnt() {
return payCashCnt;
}
public void setPayCashCnt(Long payCashCnt) {
this.payCashCnt = payCashCnt;
}
public Long getPayCashAmt() {
return payCashAmt;
}
public void setPayCashAmt(Long payCashAmt) {
this.payCashAmt = payCashAmt;
}
public Long getPayBankCnt() {
return payBankCnt;
}
public void setPayBankCnt(Long payBankCnt) {
this.payBankCnt = payBankCnt;
}
public Long getPayBankAmt() {
return payBankAmt;
}
public void setPayBankAmt(Long payBankAmt) {
this.payBankAmt = payBankAmt;
}
public Long getPayVipcardCnt() {
return payVipcardCnt;
}
public void setPayVipcardCnt(Long payVipcardCnt) {
this.payVipcardCnt = payVipcardCnt;
}
public Long getPayVipcardAmt() {
return payVipcardAmt;
}
public void setPayVipcardAmt(Long payVipcardAmt) {
this.payVipcardAmt = payVipcardAmt;
}
public Long getPayWxCnt() {
return payWxCnt;
}
public void setPayWxCnt(Long payWxCnt) {
this.payWxCnt = payWxCnt;
}
public Long getPayWxAmt() {
return payWxAmt;
}
public void setPayWxAmt(Long payWxAmt) {
this.payWxAmt = payWxAmt;
}
public Long getPayAlipayCnt() {
return payAlipayCnt;
}
public void setPayAlipayCnt(Long payAlipayCnt) {
this.payAlipayCnt = payAlipayCnt;
}
public Long getPayAlipayAmt() {
return payAlipayAmt;
}
public void setPayAlipayAmt(Long payAlipayAmt) {
this.payAlipayAmt = payAlipayAmt;
}
public Long getPayOthpayCnt() {
return payOthpayCnt;
}
public void setPayOthpayCnt(Long payOthpayCnt) {
this.payOthpayCnt = payOthpayCnt;
}
public Long getPayOthpayAmt() {
return payOthpayAmt;
}
public void setPayOthpayAmt(Long payOthpayAmt) {
this.payOthpayAmt = payOthpayAmt;
}
public Long getVipCnt() {
return vipCnt;
}
public void setVipCnt(Long vipCnt) {
this.vipCnt = vipCnt;
}
public Long getVipAmt() {
return vipAmt;
}
public void setVipAmt(Long vipAmt) {
this.vipAmt = vipAmt;
}
public Long getNovipCnt() {
return novipCnt;
}
public void setNovipCnt(Long novipCnt) {
this.novipCnt = novipCnt;
}
public Long getNovipAmt() {
return novipAmt;
}
public void setNovipAmt(Long novipAmt) {
this.novipAmt = novipAmt;
}
public Long getOnlineCnt() {
return onlineCnt;
}
public void setOnlineCnt(Long onlineCnt) {
this.onlineCnt = onlineCnt;
}
public Long getOnlineAmt() {
return onlineAmt;
}
public void setOnlineAmt(Long onlineAmt) {
this.onlineAmt = onlineAmt;
}
public Long getOfflineCnt() {
return offlineCnt;
}
public void setOfflineCnt(Long offlineCnt) {
this.offlineCnt = offlineCnt;
}
public Long getOfflineAmt() {
return offlineAmt;
}
public void setOfflineAmt(Long offlineAmt) {
this.offlineAmt = offlineAmt;
}
public Long getPromoteCnt() {
return promoteCnt;
}
public void setPromoteCnt(Long promoteCnt) {
this.promoteCnt = promoteCnt;
}
public Long getPromoteAmt() {
return promoteAmt;
}
public void setPromoteAmt(Long promoteAmt) {
this.promoteAmt = promoteAmt;
}
public Long getTotalMonth() {
return totalMonth;
}
public void setTotalMonth(Long totalMonth) {
this.totalMonth = totalMonth;
}
public Long getTotalYear() {
return totalYear;
}
public void setTotalYear(Long totalYear) {
this.totalYear = totalYear;
}
public Long getLgeUnit() {
return lgeUnit;
}
public void setLgeUnit(Long lgeUnit) {
this.lgeUnit = lgeUnit;
}
public Long getLge() {
return lge;
}
public void setLge(Long lge) {
this.lge = lge;
}
public Long getAvgInCnt() {
return avgInCnt;
}
public void setAvgInCnt(Long avgInCnt) {
this.avgInCnt = avgInCnt;
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.Toast;
import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.zzdpos.R;
......@@ -28,6 +29,7 @@ import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
......@@ -36,6 +38,7 @@ import io.reactivex.schedulers.Schedulers;
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> implements
MainContract.View {
public static MainActivity mainActivity;
private long mExitTime;
private int[] titleInts = {R.string.menu_cashier, R.string.menu_service, R.string.menu_myself};
private int[] iconList = {R.mipmap.icon_menu_cashier_1, R.mipmap.icon_menu_service_0, R
.mipmap.icon_menu_myself_0};
......@@ -183,7 +186,11 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public void onBackPressedSupport() {
if ((System.currentTimeMillis() - mExitTime) > 1500) {
mExitTime = System.currentTimeMillis();
} else {
mPresenter.clickHandover();
}
}
@Override
......@@ -214,5 +221,6 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
&& event.getY() > top && event.getY() < bottom);
}
return false;
}
}
......@@ -27,7 +27,7 @@ public class AddFragment extends BaseFragment<MsPresenter, FragmentMsAddBinding>
mTypeAdapter = new TypeAdapter();
mViewBinding.rlType.setAdapter(mTypeAdapter);
mViewBinding.rlType.setLayoutManager(new GridLayoutManager(mContext, 2));
mViewBinding.rlType.addItemDecoration(new MyMenuItemDecoration(mContext, 2, getResources().getColor(R.color.gray_kongming)));
mViewBinding.rlType.addItemDecoration(new MyMenuItemDecoration(mContext, 2, getResources().getColor(R.color.golden_yuji)));
// set t listener
mTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
......
......@@ -12,6 +12,7 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivitySplashBinding;
import com.xingdata.zzdpos.ui.splash.dialog.UpgradeDialog;
import com.xingdata.zzdpos.util.SystemUtil;
public class SplashActivity extends BaseActivity<com.xingdata.zzdpos.ui.splash.SplashPresenter, ActivitySplashBinding>
......@@ -29,6 +30,7 @@ public class SplashActivity extends BaseActivity<com.xingdata.zzdpos.ui.splash.S
@Override
public void initView() {
// mPresenter.init();
mViewBinding.setVersion("V"+SystemUtil.getVersionName());
mPresenter.checkUpdate();
FadingCircle doubleBounce = new FadingCircle();
mViewBinding.spinKit.setIndeterminateDrawable(doubleBounce);
......
......@@ -14,6 +14,7 @@ import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityStatisticsBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder;
......@@ -107,6 +108,11 @@ public class StatisticsActivity extends BaseActivity<StatisticsPresenter, Activi
}
}
@Override
public void getSmtListSucc(Pager<Smt> smtPager){
mStatisticsTitleFragment.getSmtListSucc(smtPager);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
......
......@@ -6,6 +6,7 @@ import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder;
......@@ -22,6 +23,7 @@ public interface StatisticsContract {
interface View extends BaseView {
void isShowLoading(Boolean is);
void getSmtListSucc(Pager<Smt> smtPager);
/**
* 设置统计信息
*/
......@@ -51,6 +53,7 @@ public interface StatisticsContract {
* 搜索成功
*/
void searchSuc(Pager<Saleorder> saleorderPager, int payType);
/**
* 日期搜索成功
*/
......@@ -65,6 +68,7 @@ public interface StatisticsContract {
* 日期搜索成功
*/
void searchTicketSuc(Pager<Ticket> ticketPager, long start, long end);
/**
* 展示日期警告
*/
......@@ -78,6 +82,9 @@ public interface StatisticsContract {
*/
public abstract void clickDate(Integer integer);
/**
* 跳转营销页
*/
......@@ -93,6 +100,10 @@ public interface StatisticsContract {
*/
public abstract void getRechargeList(int pageNumber, RechargeListFragment msListFragment);
/**
* 获取月份统计的列表
*/
public abstract void getSmtList();
/**
* 获取充值列表
......@@ -108,7 +119,8 @@ public interface StatisticsContract {
/**
* 获取已用优惠券列表
*/
public abstract void getTicketList(int pageNumber,long startDate, long endDate);
public abstract void getTicketList(int pageNumber, long startDate, long endDate);
/**
* 获取订单列表
*/
......@@ -123,6 +135,7 @@ public interface StatisticsContract {
* 搜索订单列表
*/
public abstract void getSaleOrderList(int pageNumber, int payType);
/**
* 搜索日期订单列表
*/
......
......@@ -75,7 +75,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getRechargeList(int pageNumber, RechargeListFragment msListFragment) {
mView.isShowLoading(true);
ApiFactory.Rctrace.queryRecharge(pageNumber, nowPageSize).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Rctrace.queryRecharge(pageNumber, nowPageSize).doFinally(() -> mView.isShowLoading(false))
.subscribe(vipRechargeOrderPager -> {
msListFragment.setData(vipRechargeOrderPager);
}, throwable -> {
......@@ -83,10 +83,21 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
});
}
@Override
public void getSmtList() {
mView.isShowLoading(true);
ApiFactory.Smt.queryAll(1, 12).doFinally(() -> mView.isShowLoading(false))
.subscribe(smtPager -> {
mView.getSmtListSucc(smtPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getRechargeList(int pageNumber, long startDate, long endDate) {
mView.isShowLoading(true);
ApiFactory.Rctrace.queryRecharge(pageNumber, nowPageSize, startDate, endDate).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Rctrace.queryRecharge(pageNumber, nowPageSize, startDate, endDate).doFinally(() -> mView.isShowLoading(false))
.subscribe(vipRechargeOrderPager -> {
//判断是否能加载更多
if (vipRechargeOrderPager.getList() == null || vipRechargeOrderPager.getList().size() == 0) {
......@@ -102,7 +113,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getTicketList(int pageNumber, UsedTicketListFragment msListFragment) {
mView.isShowLoading(true);
ApiFactory.Ticket.query(pageNumber, nowPageSize, 2).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Ticket.query(pageNumber, nowPageSize, 2).doFinally(() -> mView.isShowLoading(false))
.subscribe(ticketPager -> {
msListFragment.setData(ticketPager);
}, throwable -> {
......@@ -113,7 +124,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getTicketList(int pageNumber, long startDate, long endDate) {
mView.isShowLoading(true);
ApiFactory.Ticket.query(pageNumber, nowPageSize, 2, startDate, endDate).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Ticket.query(pageNumber, nowPageSize, 2, startDate, endDate).doFinally(() -> mView.isShowLoading(false))
.subscribe(ticketPager -> {
if (ticketPager.getList() == null || ticketPager.getList().size() == 0) {
ToastUtils.showShort("没有查询到相关优惠券");
......@@ -131,7 +142,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getSaleOrderList(int pageNumber, String wd) {
mView.isShowLoading(true);
ApiFactory.Test.getSaleOrderList(pageNumber, nowPageSize, "99", null, wd).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Test.getSaleOrderList(pageNumber, nowPageSize, "99", null, wd).doFinally(() -> mView.isShowLoading(false))
.subscribe(saleorderPager -> {
//判断是否能加载更多
if (saleorderPager.getList() == null || saleorderPager.getList().size() == 0) {
......@@ -152,7 +163,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getSaleOrderList(int pageNumber, int payType) {
mView.isShowLoading(true);
ApiFactory.Test.getSaleOrderList(pageNumber, nowPageSize, "99", payType).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Test.getSaleOrderList(pageNumber, nowPageSize, "99", payType).doFinally(() -> mView.isShowLoading(false))
.subscribe(saleorderPager -> {
//判断是否能加载更多
if (saleorderPager.getList() == null || saleorderPager.getList().size() == 0) {
......@@ -170,7 +181,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
@Override
public void getSaleOrderList(int pageNumber, long startDate, long endDate) {
mView.isShowLoading(true);
ApiFactory.Test.getSaleOrderList("99", pageNumber, nowPageSize, startDate, endDate).doFinally(()-> mView.isShowLoading(false))
ApiFactory.Test.getSaleOrderList("99", pageNumber, nowPageSize, startDate, endDate).doFinally(() -> mView.isShowLoading(false))
.subscribe(saleorderPager -> {
//判断是否能加载更多
if (saleorderPager.getList() == null || saleorderPager.getList().size() == 0) {
......
......@@ -13,6 +13,7 @@ import com.xingdata.zzdpos.databinding.FragmentStatisticsTitleBinding;
import com.xingdata.zzdpos.databinding.ViewSearchPaytypeBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
......@@ -244,4 +245,8 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
return false;
}
public void getSmtListSucc(Pager<Smt> smtPager) {
mOrderMainFragment.getSmtListSucc(smtPager);
}
}
......@@ -18,6 +18,8 @@ import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOrderMainBinding;
import com.xingdata.zzdpos.databinding.ItemStringBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Smt;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.FragmentStateAdapter;
......@@ -65,13 +67,12 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
return false;
});
initViewPager();
mPresenter.getSmtList();
}
public void initViewPager() {
public void initViewPager(Integer monthEnd) {
if (fragments.size() == 0) {
Observable.create(new ObservableOnSubscribe<String>() {
@Override
......@@ -80,7 +81,7 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
String[] dates = date.split("-");
int y = Integer.valueOf(dates[0]);
int m = month + 1;
for (int i = 0; i < 5; i++) {
for (int i = 0; i < 12; i++) {
if (m == 0) {
m = 12;
y--;
......@@ -91,6 +92,9 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
}
String month = String.valueOf(m).length() >= 2 ? String.valueOf(m) : "0" + String.valueOf(m);
e.onNext(y + "-" + month + "-01");
if (m == monthEnd) {
break;
}
m--;
}
e.onComplete();
......@@ -185,5 +189,21 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
}
public void getSmtListSucc(Pager<Smt> smtPager) {
int size = smtPager.getList().size();
if (size != 0) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(smtPager.getList().get(size - 1).getTotalDate());
int monthEnd = calendar.get(Calendar.MONTH);
if (monthEnd == 0) {
monthEnd = 12;
}
initViewPager(monthEnd);
} else {
initViewPager(month);
}
}
}
......@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/gray_zhouyu" />
<solid android:color="@color/gray_kongming" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout
xmlns:tools="http://schemas.android.com/tools"
<data>
<variable
name="version"
type="String" />
</data>
<android.support.constraint.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/splash"
android:orientation="vertical"
android:padding="@dimen/all_margin"
tools:context="com.xingdata.zzdpos.ui.splash.SplashActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin_big"
android:layout_marginBottom="@dimen/all_margin_big_big"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
......@@ -30,14 +35,13 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin">
<com.github.ybq.android.spinkit.SpinKitView
xmlns:app="http://schemas.android.com/apk/res-auto"
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/spin_kit"
style="@style/SpinKitView.Circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:SpinKit_Color="@color/black_zhangfei"/>
app:SpinKit_Color="@color/black_zhangfei" />
<TextView
android:id="@+id/tv_progress"
......@@ -45,7 +49,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="0 %"
android:textColor="@color/black_zhangfei"/>
android:textColor="@color/black_zhangfei" />
</RelativeLayout>
<TextView
......@@ -55,7 +59,7 @@
android:layout_marginTop="@dimen/all_padding"
android:gravity="center"
android:text="正在加载数据..."
android:textColor="@color/black_zhangfei"/>
android:textColor="@color/black_zhangfei" />
</LinearLayout>
......@@ -87,7 +91,16 @@
<!--android:text="@string/login_phone"-->
<!--android:textColor="@color/white" />-->
<!--</LinearLayout>-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{version}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
android:layout_margin="@dimen/padding_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
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