Commit 3f5df67d by Wyh

6.20 H5在線支付完成沒有新訂單語音提示問題、報表無法顯示當天的問題、。。。。

parent 5a9abff9
package com.gingersoft.gsa.cloud.base.utils.time; package com.gingersoft.gsa.cloud.base.utils.time;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -141,7 +142,8 @@ public class TimeUtils { ...@@ -141,7 +142,8 @@ public class TimeUtils {
return sf.format(endDate); return sf.format(endDate);
} }
/**@param beginTime 開始時間 /**
* @param beginTime 開始時間
* @param distance 差距: 昨天天傳負一,今天傳零,明天傳一 * @param distance 差距: 昨天天傳負一,今天傳零,明天傳一
* @param type 類型: 1、天 Calendar.DATE 2、年Calendar.YEAR 3、月Calendar.MONTH * @param type 類型: 1、天 Calendar.DATE 2、年Calendar.YEAR 3、月Calendar.MONTH
* @param sf {@link #DEFAULT_DATE_MD} * @param sf {@link #DEFAULT_DATE_MD}
...@@ -521,4 +523,29 @@ public class TimeUtils { ...@@ -521,4 +523,29 @@ public class TimeUtils {
long between_days = (time2 - time1) / (1000 * 3600 * 24); long between_days = (time2 - time1) / (1000 * 3600 * 24);
return Integer.parseInt(String.valueOf(between_days)); return Integer.parseInt(String.valueOf(between_days));
} }
/**
* 獲取傳入時間的前x天或后x的時間
*
* @param date
* @param day
* @return
*/
public static String getDatebyDate(String date, int day) {
Log.e("eee", "時間" + date);
if (day == 0) {
return "";
}
try {
Date date1 = TimeUtils.DATE_FORMAT_DATE.parse(date);
Calendar cal = Calendar.getInstance();
cal.setTime(date1);
long time = cal.getTimeInMillis() + (day * 24 * 60 * 60 * 1000);
return TimeUtils.DATE_FORMAT_DATE.format(time);
} catch (ParseException e) {
e.printStackTrace();
}
return "";
}
} }
...@@ -5,8 +5,8 @@ ext { ...@@ -5,8 +5,8 @@ ext {
buildToolsVersion: '28.0.3', buildToolsVersion: '28.0.3',
minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19 minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19
targetSdkVersion : 28, targetSdkVersion : 28,
versionCode : 4, versionCode : 5,
versionName : "1.0.4" versionName : "1.0.5"
] ]
version = [ version = [
......
...@@ -85,7 +85,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -85,7 +85,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
private BusinessInfoAdapter businessInfoAdapter; private BusinessInfoAdapter businessInfoAdapter;
//查詢多少天的數據 //查詢多少天的數據
private int manyDay = 6; private int manyDay = 7;
public static BusinessReportFragment newInstance() { public static BusinessReportFragment newInstance() {
BusinessReportFragment fragment = new BusinessReportFragment(); BusinessReportFragment fragment = new BusinessReportFragment();
...@@ -110,15 +110,13 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -110,15 +110,13 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
@Override @Override
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
//獲取一段時間內的營業信息,默認獲取七天的數據 //獲取一段時間內的營業信息,默認獲取七天的數據
String startTime = TimeUtils.getOldDate(-manyDay); startTime = TimeUtils.getOldDate(-manyDay);
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mRestaurantName.setText(GsaCloudApplication.getRestaurantName(mContext)); mRestaurantName.setText(GsaCloudApplication.getRestaurantName(mContext));
mTvStartTime.setText(startTime); mTvStartTime.setText(TimeUtils.getOldDate(-manyDay + 1));
mTvEndTime.setText(TimeUtils.getOldDate(0)); mTvEndTime.setText(TimeUtils.getOldDate(0));
getInfo();
} }
/** /**
...@@ -195,7 +193,6 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -195,7 +193,6 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
*/ */
@Override @Override
public void loadChart(List<MainBusinessBean.DataBean> data) { public void loadChart(List<MainBusinessBean.DataBean> data) {
manyDay = data.size();
Object[] chartData = new Object[manyDay]; Object[] chartData = new Object[manyDay];
String[] xData = new String[manyDay]; String[] xData = new String[manyDay];
...@@ -203,7 +200,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -203,7 +200,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
//設置默認時間為當前的起止時間 //設置默認時間為當前的起止時間
try { try {
cal.setTime(TimeUtils.DATE_FORMAT_DATE.parse(mTvStartTime.getText().toString())); cal.setTime(TimeUtils.DATE_FORMAT_DATE.parse(startTime));
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -361,8 +358,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -361,8 +358,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
// } // }
// } // }
// } // }
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString()); getInfo();
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString());
}).setOnDismissListener(o -> { }).setOnDismissListener(o -> {
if (triangleView.isOpen()) { if (triangleView.isOpen()) {
triangleView.toggle(); triangleView.toggle();
...@@ -374,4 +370,11 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -374,4 +370,11 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
e.printStackTrace(); e.printStackTrace();
} }
} }
private String startTime;
private void getInfo() {
startTime = TimeUtils.getDatebyDate(mTvStartTime.getText().toString(), -1);
String endTime = TimeUtils.getDatebyDate(mTvEndTime.getText().toString(), 1);
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, endTime);
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, endTime);
}
} }
...@@ -112,7 +112,9 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor ...@@ -112,7 +112,9 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
} }
private void getPayMenthInfo() { private void getPayMenthInfo() {
mPresenter.getPaymentInfo(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString()); String startTime = TimeUtils.getDatebyDate(mTvStartTime.getText().toString(), -1);
String endTime = TimeUtils.getDatebyDate(mTvEndTime.getText().toString(), 1);
mPresenter.getPaymentInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, endTime);
} }
/** /**
......
...@@ -406,7 +406,9 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales ...@@ -406,7 +406,9 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
} }
private void getSaleReprot() { private void getSaleReprot() {
mPresenter.getSalesReportInfo(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString()); String startTime = TimeUtils.getDatebyDate(mTvStartTime.getText().toString(), -1);
String endTime = TimeUtils.getDatebyDate(mTvEndTime.getText().toString(), 1);
mPresenter.getSalesReportInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, endTime);
} }
......
...@@ -98,9 +98,11 @@ class GetInfoUpdateService : Service() { ...@@ -98,9 +98,11 @@ class GetInfoUpdateService : Service() {
if (postCallBack != null) { if (postCallBack != null) {
postCallBack!!.callBack(type) postCallBack!!.callBack(type)
} }
//-1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知"
if (type == 3 || type == 4 || type == 5 if (type == 3 || type == 4 || type == 5
|| type == 6 || type == 7) { || type == 6 || type == 7) {
if (type == 6 || type == 7) { if (type == 6) {
} else { } else {
//播放提示音 //播放提示音
......
package com.gingersoft.gsa.other_order_mode.ui.activity package com.gingersoft.gsa.other_order_mode.ui.activity
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import android.widget.TableLayout
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.R2
import com.gingersoft.gsa.other_order_mode.model.viewModel.HistoryOrderViewModel import com.gingersoft.gsa.other_order_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.HistoryOrderAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.ui.fragment.HistoryFragment import com.gingersoft.gsa.other_order_mode.ui.fragment.HistoryFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import com.gingersoft.gsa.other_order_mode.util.setState
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.scwang.smartrefresh.layout.SmartRefreshLayout
import kotlinx.android.synthetic.main.activity_history_order.* import kotlinx.android.synthetic.main.activity_history_order.*
import java.text.ParseException import java.text.ParseException
import java.util.* import java.util.*
......
...@@ -39,7 +39,6 @@ class HistoryFragment : BaseFragment() { ...@@ -39,7 +39,6 @@ class HistoryFragment : BaseFragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity!!.viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply { viewModel = ViewModelProvider(activity!!.viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply {
historyData.observe(viewLifecycleOwner, Observer{ it -> historyData.observe(viewLifecycleOwner, Observer{ it ->
cancelDialogForLoading() cancelDialogForLoading()
refresh_layout.finishRefresh() refresh_layout.finishRefresh()
...@@ -111,6 +110,7 @@ class HistoryFragment : BaseFragment() { ...@@ -111,6 +110,7 @@ class HistoryFragment : BaseFragment() {
} }
private fun getHistoryInfo(page: Int = pageIndex) { private fun getHistoryInfo(page: Int = pageIndex) {
showLoading()
viewModel.getHistoryOrderList(activity!!, page.toString(), viewModel.searchValue.value!!, viewModel.historyTime.value!!, viewModel.historyTime.value!!, viewModel.status.value!!) viewModel.getHistoryOrderList(activity!!, page.toString(), viewModel.searchValue.value!!, viewModel.historyTime.value!!, viewModel.historyTime.value!!, viewModel.status.value!!)
} }
......
...@@ -126,7 +126,10 @@ class PlaceholderFragment : BaseFragment() { ...@@ -126,7 +126,10 @@ class PlaceholderFragment : BaseFragment() {
} }
// 綁定監聽當前fragment的數據項 // 綁定監聽當前fragment的數據項
pageViewModel.mOrderList[arguments?.getInt(INDEX)!!].observe(viewLifecycleOwner, Observer { pageViewModel.mOrderList[arguments?.getInt(INDEX)!!].observe(viewLifecycleOwner, Observer {
it.let { adapter.setData(it) } it?.let {
layout_nodata.setState(it.size <= 0)
adapter.setData(it)
}
}) })
// 设置 Header 顏色 // 设置 Header 顏色
...@@ -134,7 +137,7 @@ class PlaceholderFragment : BaseFragment() { ...@@ -134,7 +137,7 @@ class PlaceholderFragment : BaseFragment() {
// 下拉刷新,加載更多 // 下拉刷新,加載更多
refresh_layout.setOnRefreshListener { refresh_layout.setOnRefreshListener {
refresh() refresh()
//重新拉取一遍送貨員和第三方派送信息 //重新拉取一遍送貨員信息
pageViewModel.getDeliveryInfo(context!!) pageViewModel.getDeliveryInfo(context!!)
} }
refresh_layout.setOnLoadMoreListener { refresh_layout.setOnLoadMoreListener {
...@@ -162,9 +165,9 @@ class PlaceholderFragment : BaseFragment() { ...@@ -162,9 +165,9 @@ class PlaceholderFragment : BaseFragment() {
private fun getOrderList(pageViewModel: PageViewModel, isLoadMore: Boolean) { private fun getOrderList(pageViewModel: PageViewModel, isLoadMore: Boolean) {
pageViewModel.getOrderList(activity!!, arguments?.getInt(INDEX) pageViewModel.getOrderList(activity!!, arguments?.getInt(INDEX)
?: 0, page.toString(), isLoadMore) { ?: 0, page.toString(), isLoadMore) {
if (!isLoadMore) { // if (!isLoadMore) {
layout_nodata.setState(it <= 0) // layout_nodata.setState(it <= 0)
} // }
refresh_layout.finishRefresh() refresh_layout.finishRefresh()
refresh_layout.finishLoadMore() refresh_layout.finishLoadMore()
} }
......
...@@ -1171,7 +1171,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -1171,7 +1171,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
} }
} }
} }
if (IActivity.getFoodGroupGridViewAdapter() != null) {
IActivity.getFoodGroupGridViewAdapter().notifyDataSetChanged(); IActivity.getFoodGroupGridViewAdapter().notifyDataSetChanged();
}
mFoodAdapter.notifyDataSetChanged(); mFoodAdapter.notifyDataSetChanged();
} }
......
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