Commit 59c51817 by 宁斌

餐種過濾條件導致套餐 未顯示問題

parent 3e3bdd2e
......@@ -4,9 +4,11 @@ buildscript {
ext.kotlin_version = '1.4.21'
repositories {
// 添加阿里云 maven 地址
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
// jcenter()
google()
jcenter()
mavenCentral()
}
dependencies {
......@@ -37,6 +39,11 @@ buildscript {
allprojects {
repositories {
// 添加阿里云 maven 地址
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
// jcenter()
google()
jcenter()
mavenLocal()
......@@ -50,8 +57,6 @@ allprojects {
maven {url 'https://storage.googleapis.com/r8-releases/raw'}
//阿里云仓库
maven { url "http://maven.aliyun.com/nexus/content/repositories/releases" }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
}
......
......@@ -41,8 +41,7 @@ import com.gingersoft.gsa.cloud.common.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.service.ICommandService;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.ui.utils.AppDialog;
......@@ -204,7 +203,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
private void initService() {
//開啟websocket
Intent intent = new Intent(getApplicationContext(), DataNotificationService.class);
Intent intent = new Intent(getApplicationContext(), ICommandService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent);
} else {
......@@ -219,13 +218,13 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
registerReceiver(clearHeartBroadcastReceiver, intentFilter);
}
private DataNotificationService.MyBind bind = null;
private ICommandService.MyBind bind = null;
private long lastMsgTime = 0;
private ServiceConnection serviceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
bind = (DataNotificationService.MyBind) service;
bind = (ICommandService.MyBind) service;
if (bind != null) {
bind.setOnPostCallBack(type -> {
// -1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知"
......
......@@ -28,7 +28,7 @@
</intent-filter>
</activity>
<service android:name="com.gingersoft.gsa.cloud.common.service.DataNotificationService" />
<service android:name="com.gingersoft.gsa.cloud.common.service.ICommandService" />
<meta-data
android:name="com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
......
......@@ -7,7 +7,7 @@ import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil;
import com.billy.cc.core.component.IComponent;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.cloud.common.service.ICommandService;
import com.gingersoft.gsa.delivery_pick_mode.data.network.ServiceCreator;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity.PrjQueryActivity;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity.SendOrderActivity;
......@@ -52,7 +52,7 @@ public class DeliveryPickComponent implements IComponent {
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
case "closeHeart":
Intent intent = new Intent(cc.getContext(), DataNotificationService.class);
Intent intent = new Intent(cc.getContext(), ICommandService.class);
cc.getContext().stopService(intent);
break;
case "historyActivity":
......
......@@ -22,7 +22,7 @@ import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails.Companion.veri
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import com.gingersoft.gsa.cloud.common.core.user.UserContext
import com.gingersoft.gsa.cloud.common.logan.LoganManager
import com.gingersoft.gsa.cloud.common.service.DataNotificationService
import com.gingersoft.gsa.cloud.common.service.ICommandService
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
import com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
......@@ -544,8 +544,8 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}, { e ->
listener.invoke(getMsgBean(0, "", false))
e.printStackTrace()
DataNotificationService.loginfo.append("錯誤信息111:" + e.message + " LOCALIZEDMESSAGE:" + e.localizedMessage + e.cause)
DataNotificationService.loginfo.append("\n")
ICommandService.loginfo.append("錯誤信息111:" + e.message + " LOCALIZEDMESSAGE:" + e.localizedMessage + e.cause)
ICommandService.loginfo.append("\n")
})
}
......@@ -685,12 +685,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//添加PRJ
//單獨包起來,哪怕這接口報錯也不要影響到正常的邏輯
repository.addPrj(dataBean.Order_ID.toString(), restaurantId.toString(), ids.toString())
DataNotificationService.loginfo.append("添加PRJ:orderId:" + dataBean.Order_ID.toString() + "restaurantId:" + restaurantId + "orderDetailsIds:" + ids.toString())
DataNotificationService.loginfo.append("\n")
ICommandService.loginfo.append("添加PRJ:orderId:" + dataBean.Order_ID.toString() + "restaurantId:" + restaurantId + "orderDetailsIds:" + ids.toString())
ICommandService.loginfo.append("\n")
}, {
it.printStackTrace()
DataNotificationService.loginfo.append("錯誤信息222:" + it.message + " LOCALIZEDMESSAGE:" + it.localizedMessage + it.cause)
DataNotificationService.loginfo.append("\n")
ICommandService.loginfo.append("錯誤信息222:" + it.message + " LOCALIZEDMESSAGE:" + it.localizedMessage + it.cause)
ICommandService.loginfo.append("\n")
})
}
if (isPrintBill) {
......
......@@ -28,7 +28,7 @@ import com.gingersoft.gsa.cloud.common.constans.FunctionManagerConstants
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
import com.gingersoft.gsa.cloud.common.function.FunctionManager
import com.gingersoft.gsa.cloud.common.service.DataNotificationService
import com.gingersoft.gsa.cloud.common.service.ICommandService
import com.gingersoft.gsa.cloud.common.service.PostCallBack
import com.gingersoft.gsa.cloud.common.utils.other.SPUtils
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
......@@ -79,7 +79,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
private var layoutHeight: Float = 0F
private var btnHeight: Float = 0F
var bind: DataNotificationService.MyBind? = null
var bind: ICommandService.MyBind? = null
//最後一次長連接過來的消息類型
var lastMsgType: Int = 0
......@@ -392,7 +392,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
*/
private fun initWebSocket() {
//開啟webSocket
val service = Intent(applicationContext, DataNotificationService::class.java)
val service = Intent(applicationContext, ICommandService::class.java)
val notification: NotificationManagerCompat = NotificationManagerCompat.from(this)
if (!notification.areNotificationsEnabled()) {
//未開啟通知權限
......@@ -444,7 +444,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
private var serviceConnection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName, service: IBinder) {
bind = service as DataNotificationService.MyBind
bind = service as ICommandService.MyBind
bind?.let { it ->
it.setOnPostCallBack(object : PostCallBack {
override fun callBack(type: Int) {
......
......@@ -3,7 +3,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.activity;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.cloud.common.service.ICommandService;
import com.gingersoft.gsa.delivery_pick_mode.R;
public class LogActivity extends AppCompatActivity {
......@@ -14,13 +14,13 @@ public class LogActivity extends AppCompatActivity {
setContentView(R.layout.activity_log);
loadInfo();
findViewById(R.id.btn_clear_log).setOnClickListener(v -> {
DataNotificationService.loginfo.setLength(0);
ICommandService.loginfo.setLength(0);
loadInfo();
});
findViewById(R.id.btn_back).setOnClickListener(v ->finish());
}
private void loadInfo() {
((TextView) findViewById(R.id.tv_log)).setText(DataNotificationService.loginfo.toString());
((TextView) findViewById(R.id.tv_log)).setText(ICommandService.loginfo.toString());
}
}
......@@ -33,7 +33,9 @@ import com.gingersoft.gsa.cloud.login.mvp.contract.LoginInterfaceImpl;
import com.gingersoft.gsa.cloud.login.mvp.presenter.LoginPresenter;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.google.android.material.textfield.TextInputEditText;
import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.ImmersionBar;
import com.gyf.immersionbar.OnKeyboardListener;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.integration.AppManager;
import com.jess.arms.utils.ArmsUtils;
......@@ -51,6 +53,7 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.OnClick;
import me.jessyan.autosize.utils.LogUtils;
import static com.jess.arms.utils.Preconditions.checkNotNull;
......@@ -121,8 +124,13 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// StatusBarUtil.setColor(this,Color.parseColor("#E7F2FF"));
// StatusBarUtil.setColor(this,ArmsUtils.getColor(mContext,R.color.trans));
ImmersionBar.with(this)
.statusBarColor("#E7F2FF") //状态栏颜色,不写默认透明色
.statusBarDarkFont(true) //原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持
.fitsSystemWindows(true)
// .fullScreen(true)
.init();
}
@Override
......
......@@ -100,9 +100,12 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// StatusBarUtil.setColor(this,ArmsUtils.getColor(mContext,R.color.trans));
ImmersionBar.with(this)
.barColor(R.color.theme_white_color).init();
.statusBarColor(R.color.theme_white_color) //状态栏颜色,不写默认透明色
.statusBarDarkFont(true) //原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持
.fitsSystemWindows(true)
// .fullScreen(true)
.init();
}
@Override
......@@ -185,7 +188,13 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
public void onPageSelected(int position) {
super.onPageSelected(position);
ImmersionBar.with(WelcomeActivity.this).barColor(R.color.theme_color).init();
ImmersionBar.with(WelcomeActivity.this)
.statusBarColor(R.color.theme_color) //状态栏颜色,不写默认透明色
.statusBarDarkFont(true) //原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持
.fitsSystemWindows(true)
.keyboardEnable(true)
.navigationBarColor(R.color.red)
.init();
updateUI(position);
if (++position == guideBeanList.size() && mTvExperience.getVisibility() != View.VISIBLE) {
......
......@@ -4,10 +4,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:background="@color/theme_white_color"/>
<RelativeLayout
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_30"
android:background="@color/theme_white_color">
<TextView
......
......@@ -5,14 +5,18 @@
android:layout_height="match_parent"
android:background="@color/theme_white_color"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:layout_marginTop="@dimen/dp_30">
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:background="#E7F2FF"/>
<ImageView
android:id="@+id/iv_top_bg"
android:layout_width="match_parent"
......
......@@ -132,7 +132,7 @@ public class ComponentMain implements IComponent {
}
private void openActivity(CC cc) {
Intent intent = new Intent(cc.getContext(), MainActivity.class);
Intent intent = new Intent(cc.getContext(), NewMainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
cc.getContext().startActivity(intent);
// CCUtil.createNavigateIntent(cc, NewMainActivity.class);
......
......@@ -4,12 +4,9 @@ import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Message;
import android.text.TextUtils;
import android.util.SparseArray;
......@@ -38,7 +35,7 @@ import com.gingersoft.gsa.cloud.common.function.FunctionManager;
import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpBean;
import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpStrategy;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.cloud.common.service.IServiceManager;
import com.gingersoft.gsa.cloud.common.utils.AppDevices;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.StytemUtils;
......@@ -218,25 +215,8 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
}
private void initService() {
boolean deliveryOrderServiceRunning = StytemUtils.isServiceRunning("com.gingersoft.gsa.cloud.common.service.DataNotificationService", this);
if (!deliveryOrderServiceRunning) {
Intent service = new Intent(GsaCloudApplication.getAppContext(), DataNotificationService.class);
service.putExtra(DataNotificationService.CONNECTION_TYPE, DataNotificationService.mCurrConnectionType);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(service);
} else {
startService(service);
}
}
boolean prjServiceRunning = StytemUtils.isServiceRunning("com.joe.print.mvp.print.service.PrjService", this);
if (!prjServiceRunning) {
//開啟Prj打印服務
CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.setActionName("openPrintService")
.build()
.call();
}
IServiceManager.startICommandService(GsaCloudApplication.getAppContext());
IServiceManager.startPrjService(GsaCloudApplication.getAppContext());
}
/**
......@@ -247,17 +227,17 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
List<MainSideMenuBean> mainSideMenuBeans = new ArrayList<>();
if (BuildConfig.DEBUG) {
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "複製Token"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "複製Token"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "查看日誌"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "廚房單原圖"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_mall_center, "商城中心"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_mall_center, "商城中心"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_about_us, "關於我們"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_password, "修改密碼"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "設置"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "查看日誌"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "設置"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "查看日誌"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "切換環境"));
}
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "上傳日誌"));
// mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "上傳日誌"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "清機"));
if (AppDevices.isHywebPos()) {
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "N5清機"));
......
......@@ -15,8 +15,6 @@ import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
......@@ -41,13 +39,12 @@ import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpBean;
import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpStrategy;
import com.gingersoft.gsa.cloud.common.leaks.WeakHandler;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.cloud.common.service.ICommandService;
import com.gingersoft.gsa.cloud.common.utils.AppDevices;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.StytemUtils;
import com.gingersoft.gsa.cloud.common.utils.encryption.Aes;
import com.gingersoft.gsa.cloud.common.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.gingersoft.gsa.cloud.database.bean.Function;
......@@ -57,16 +54,13 @@ import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerHomeComponent;
import com.gingersoft.gsa.cloud.main.mvp.contract.HomeContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.HomeTurnoverBean;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.MainSideMenuBean;
import com.gingersoft.gsa.cloud.main.mvp.presenter.HomePresenter;
import com.gingersoft.gsa.cloud.main.mvp.presenter.NewMainPresenter;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.ExpandListActivity;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.LookLogActivity;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.RestaurantQrCodeActivity;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.SettlementActivity;
import com.gingersoft.gsa.cloud.main.mvp.ui.activity.menu.FoodMenuManageActivity;
import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.HomeFunctionAdapter;
import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.MainOrderingAdapter;
import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.MainSideMenuAdapter;
import com.gingersoft.gsa.cloud.main.mvp.ui.view.SlidingMenu;
......@@ -80,22 +74,15 @@ import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.DeviceUtils;
import com.lihang.ShadowLayout;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.section.QMUISection;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.tbruyelle.rxpermissions2.RxPermissions;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import butterknife.BindView;
import butterknife.BindViews;
......@@ -264,10 +251,10 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
}
private void initService() {
boolean deliveryOrderServiceRunning = StytemUtils.isServiceRunning("com.gingersoft.gsa.cloud.common.service.DataNotificationService", _mActivity);
boolean deliveryOrderServiceRunning = StytemUtils.isServiceRunning("com.gingersoft.gsa.cloud.common.service.ICommandService", _mActivity);
if (!deliveryOrderServiceRunning) {
Intent service = new Intent(GsaCloudApplication.getAppContext(), DataNotificationService.class);
service.putExtra(DataNotificationService.CONNECTION_TYPE, DataNotificationService.mCurrConnectionType);
Intent service = new Intent(GsaCloudApplication.getAppContext(), ICommandService.class);
service.putExtra(ICommandService.CONNECTION_TYPE, ICommandService.mCurrConnectionType);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mContext.startForegroundService(service);
} else {
......
......@@ -6,6 +6,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
......@@ -63,7 +64,6 @@ public class MyFragment extends BaseFragment<MyPresenter> implements MyContract.
@Override
public void initData(@Nullable Bundle savedInstanceState) {
}
......
package com.gingersoft.gsa.cloud.table.di.module;
import android.content.Context;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.mvp.contract.TableContract;
import com.gingersoft.gsa.cloud.table.mvp.model.TableModel;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodAdapter;
import com.jess.arms.di.scope.ActivityScope;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -24,4 +34,16 @@ public abstract class TableModule {
@Binds
abstract TableContract.Model bindTableModel(TableModel model);
@ActivityScope
@Provides
static List<Food> provideFoodList() {
return new ArrayList<>();
}
@ActivityScope
@Provides
static FoodAdapter provideFoodAdapter(Context context, List<Food> foodList, int fromType) {
return new FoodAdapter(context, foodList, fromType);
}
}
\ No newline at end of file
......@@ -77,18 +77,18 @@ public class TableModel extends BaseModel implements TableContract.Model {
@Override
public Observable<TableBean> getTables(int restaurantId, boolean update) {
// return mRepositoryManager
// .obtainRetrofitService(TableService.class)
// .getTables(restaurantId);
return Observable.just(mRepositoryManager
return mRepositoryManager
.obtainRetrofitService(TableService.class)
.getTables(restaurantId))
.flatMap((Function<Observable<TableBean>, ObservableSource<TableBean>>) listObservable ->
mRepositoryManager.obtainCacheService(TableCache.class)
.getTables(listObservable,
new DynamicKey(1),
new EvictDynamicKey(update))
.map(listReply -> listReply.getData()));
.getTables(restaurantId);
// return Observable.just(mRepositoryManager
// .obtainRetrofitService(TableService.class)
// .getTables(restaurantId))
// .flatMap((Function<Observable<TableBean>, ObservableSource<TableBean>>) listObservable ->
// mRepositoryManager.obtainCacheService(TableCache.class)
// .getTables(listObservable,
// new DynamicKey(1),
// new EvictDynamicKey(update))
// .map(listReply -> listReply.getData()));
}
......@@ -142,14 +142,18 @@ public class TableModel extends BaseModel implements TableContract.Model {
@Override
public Observable<BaseResult> getFoodSummarys(int restaurantId, boolean isDefault, byte businessType, boolean update) {
return Observable.just(mRepositoryManager
return mRepositoryManager
.obtainRetrofitService(TableService.class)
.getFoodSummarys(restaurantId, isDefault, businessType))
.flatMap((Function<Observable<BaseResult>, ObservableSource<BaseResult>>) listObservable -> mRepositoryManager.obtainCacheService(TableCache.class)
.getFoodSummarys(listObservable,
new DynamicKey(1),
new EvictDynamicKey(update))
.map(listReply -> listReply.getData()));
.getFoodSummarys(restaurantId, isDefault, businessType);
// return Observable.just(mRepositoryManager
// .obtainRetrofitService(TableService.class)
// .getFoodSummarys(restaurantId, isDefault, businessType))
// .flatMap((Function<Observable<BaseResult>, ObservableSource<BaseResult>>) listObservable -> mRepositoryManager.obtainCacheService(TableCache.class)
// .getFoodSummarys(listObservable,
// new DynamicKey(1),
// new EvictDynamicKey(update))
// .map(listReply -> listReply.getData()));
}
......
package com.gingersoft.gsa.cloud.table.mvp.model.utils;
import android.text.TextUtils;
import android.util.ArrayMap;
import com.gingersoft.gsa.cloud.database.bean.ComboItem;
import com.gingersoft.gsa.cloud.database.bean.Discount;
......@@ -27,17 +28,18 @@ public class MealConditionFilterUtils {
* @return
*/
public static List<Food> foodConditionFilter(List<Food> foodList, int summary) {
if (foodList.size() == 0) {
return foodList;
}
List<Food> newFoodList = new ArrayList<>();
if (foodList == null || foodList.size() > 0) {
String strSummary = String.valueOf(summary);
for (Food food : foodList) {
String foodSummary = food.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newFoodList.add(food);
}
String strSummary = String.valueOf(summary);
for (Food food : foodList) {
String foodSummary = food.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newFoodList.add(food);
}
}
}
......@@ -53,17 +55,18 @@ public class MealConditionFilterUtils {
* @return
*/
public static List<ComboItem> comboConditionFilter(List<ComboItem> comboItemList, int summary) {
if (comboItemList.size() == 0) {
return comboItemList;
}
List<ComboItem> newComboItemList = new ArrayList<>();
if (newComboItemList == null || newComboItemList.size() > 0) {
String strSummary = String.valueOf(summary);
for (ComboItem comboItem : comboItemList) {
String foodSummary = comboItem.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newComboItemList.add(comboItem);
}
String strSummary = String.valueOf(summary);
for (ComboItem comboItem : comboItemList) {
String foodSummary = comboItem.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
String[] summarys = foodSummary.split(",");
for (String item : summarys) {
if (item.equals(strSummary)) {
newComboItemList.add(comboItem);
}
}
}
......@@ -80,10 +83,13 @@ public class MealConditionFilterUtils {
* @return
*/
public static List<Discount> discountConditionFilter(List<Discount> discountList, byte discountScope, byte placeOrderType) {
if (discountList.size() == 0) {
return discountList;
}
String strScope = String.valueOf(discountScope);
String strType = String.valueOf(placeOrderType);
Map<String, Discount> newDiscountMaps = new HashMap<>();
Map<String, Discount> newDiscountMaps = new ArrayMap<>();
for (Discount discount : discountList) {
newDiscountMaps.put(discount.getId() + "-" + discount.getDiscountType() + "-" + discount.getPlaceOrderType(), discount);
}
......
......@@ -108,12 +108,16 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
ImageLoader mImageLoader;
@Inject
AppManager mAppManager;
// @Inject
FoodAdapter mFoodAdapter;
// @Inject
List<Food> mFoodList;
private MealStandActivity IActivity;
private CancelFoodDialog mCancelFoodDialog;
private FoodAdapter mFoodAdapter;
private ComboAdapter mComboAdapter;
private ModifierAdapter mModifierAdapter;
private DiscountAdapter mDiscountAdapter;
......@@ -124,7 +128,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
/**
* 當前食品組下食品
*/
private List<Food> mFoodList = new ArrayList<>();
// private List<Food> mFoodList = new ArrayList<>();
/**
* 套餐细项数据
......
......@@ -140,7 +140,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
private List<Function> mBottomFunctionList = new ArrayList<>(5);
private TableAction mTableAction;
private List<TableAction> mTableActions = new ArrayList<>(5);
private List<TableAction> mTableActions = new ArrayList<>(8);
/**
* 当前区域ID
......@@ -193,6 +193,19 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
startTablePolling();
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
for (TableAction action : mTableActions) {
action.destroy();
}
stopTablePolling();
}
private void initTableActions(Activity context, List<Function> functions) {
for (Function function : functions) {
if (function.getResUrl().endsWith("init")) {
......@@ -211,17 +224,73 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
for (TableAction action : mTableActions) {
action.destroy();
/**
* 執行餐檯操作
*/
public boolean doTableAction(TableBean.DataBean dataBean) {
if (mTableAction != null) {
mTableAction.setActionListener(new TableAction.OnActionListener() {
@Override
public void setOperatContentText(String content) {
mRootView.setTableActionContentText(content);
}
@Override
public void resetTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
initTable(tableBean.getId(), tableBean.getTableNumber(), true);
}
@Override
public void resetSkyTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
if (tableBean.getScanId() == null) {
mRootView.showMessage(tableBean.getTableName() + "不是skyorder檯");
return;
}
resetSkyorder(tableBean.getId(), String.valueOf(tableBean.getScanId()));
}
@Override
public void moveTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
// if (dataBean.getId() == tableBean.getId()) {
// CommonTipDialog.showSurpisedDialog(IActivity, "相同檯不能轉移", null, null, null, null, null);
// return;
// }
getTableToMove(tableBean);
}
@Override
public void splitTableAction(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
splitTable(tableBean);
}
@Override
public void printSkyorderSuccess() {
initTableActionParameter();
mRootView.canceTableAction();
IActivity.initSkyorderModeState();
}
@Override
public void showSplitTableDialogAction() {
showSplitTableDialog(dataBean.getId());
}
@Override
public void cancel() {
initTableActionParameter();
mRootView.canceTableAction();
}
});
mTableAction.action(dataBean);
return true;
}
stopTablePolling();
return false;
}
public void initBottomFunction() {
......@@ -963,75 +1032,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
/**
* 執行餐檯操作
*/
public boolean doTableAction(TableBean.DataBean dataBean) {
if (mTableAction != null) {
mTableAction.setActionListener(new TableAction.OnActionListener() {
@Override
public void setOperatContentText(String content) {
mRootView.setTableActionContentText(content);
}
@Override
public void resetTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
initTable(tableBean.getId(), tableBean.getTableNumber(), true);
}
@Override
public void resetSkyTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
if (tableBean.getScanId() == null) {
mRootView.showMessage(tableBean.getTableName() + "不是skyorder檯");
return;
}
resetSkyorder(tableBean.getId(), String.valueOf(tableBean.getScanId()));
}
@Override
public void moveTable(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
// if (dataBean.getId() == tableBean.getId()) {
// CommonTipDialog.showSurpisedDialog(IActivity, "相同檯不能轉移", null, null, null, null, null);
// return;
// }
getTableToMove(tableBean);
}
@Override
public void splitTableAction(TableBean.DataBean tableBean) {
LoganManager.w_tableMode(TAG, mTableAction.getActionTitle() + " tableName=" + tableBean.getTableName());
splitTable(tableBean);
}
@Override
public void printSkyorderSuccess() {
initTableActionParameter();
mRootView.canceTableAction();
IActivity.initSkyorderModeState();
}
@Override
public void showSplitTableDialogAction() {
showSplitTableDialog(dataBean.getId());
}
@Override
public void cancel() {
initTableActionParameter();
mRootView.canceTableAction();
}
});
mTableAction.action(dataBean);
return true;
}
return false;
}
/**
* 初始化操作參數
*/
public void initTableActionParameter() {
......
......@@ -23,9 +23,11 @@ import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.constans.GoldConstants;
import com.gingersoft.gsa.cloud.common.core.table.TableBean;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.service.IServiceManager;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.gingersoft.gsa.cloud.table.R;
......@@ -216,8 +218,9 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@Override
public void onClick(View v) {
LoganManager.w_tableMode(TAG, "手動刷新餐檯數據");
launchActivity(new Intent(mContext, CoordinatorlayoutActivity.class));
// getTables(true, null);
// launchActivity(new Intent(mContext, CoordinatorlayoutActivity.class));
getTables(true, null);
IServiceManager.startICommandService(GsaCloudApplication.getAppContext());
}
});
rightButton2.setOnClickListener(new View.OnClickListener() {
......
......@@ -7,8 +7,8 @@ ext {
targetSdkVersion : 29,
//正式版: 1.0.3 3
//內部測試版:1.2.0 20
versionCode : 29,
versionName : "1.2.9"
versionCode : 30,
versionName : "1.3.0"
]
version = [
......
......@@ -33,7 +33,7 @@
android:name="design_height_in_dp"
android:value="640"/>
<service
android:name="com.gingersoft.gsa.cloud.common.service.DataNotificationService"
android:name="com.gingersoft.gsa.cloud.common.service.ICommandService"
android:enabled="true" />
</application>
</manifest>
......@@ -50,7 +50,10 @@ import com.gingersoft.gsa.cloud.database.DaoManager;
import com.hyweb.n5.lib.exception.NoInitPrinterException;
import com.hyweb.n5.lib.util.PrinterUtil;
import com.jess.arms.base.BaseApplication;
import com.jess.arms.utils.DeviceUtils;
import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.util.QMUIDeviceHelper;
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
......@@ -462,6 +465,9 @@ public class GsaCloudApplication extends BaseApplication {
//当然, 在 APP 内您必须使用 sp 来作为字体的单位, 否则此功能无效, 不设置或将此值设为 0 则取消此功能
// .setPrivateFontScale(0.8f)
//解决已高度基准适配时底部有空隙的问题
// .setScreenHeight((QMUIDisplayHelper.getScreenHeight(this)))
//屏幕适配监听器
.setOnAdaptListener(new onAdaptListener() {
@Override
......
......@@ -8,10 +8,12 @@ import android.text.TextUtils;
import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.R;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.google.gson.JsonIOException;
import com.google.gson.JsonParseException;
import com.jess.arms.integration.AppManager;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
......@@ -21,6 +23,10 @@ import org.json.JSONException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import javax.inject.Inject;
import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.utils.AutoSizeUtils;
import me.jessyan.rxerrorhandler.handler.listener.ResponseErrorListener;
import retrofit2.HttpException;
import timber.log.Timber;
......@@ -30,8 +36,15 @@ public class MyResponseErrorListener implements ResponseErrorListener {
private final String TAG = getClass().getSimpleName();
// private AppManager mAppManager;
private boolean showloggedDialog = false;
// public MyResponseErrorListener(Context context) {
// mAppManager = ArmsUtils.obtainAppComponentFromContext(context)
// .appManager();
// }
@Override
public void handleResponseError(Context context, Throwable t) {
/* 用来提供处理所有错误的监听rxjava必要要使用ErrorHandleSubscriber(默认实现Subscriber的onError方法),此监听才生效 */
......@@ -51,7 +64,7 @@ public class MyResponseErrorListener implements ResponseErrorListener {
// ArmsUtils.snackbarText(msg);
// LogUtil.d("handleResponseError: " + t.getMessage());
LoganManager.w_code(TAG,"請求錯誤: "+t.getMessage());
LoganManager.w_code(TAG, "請求錯誤: " + t.getMessage());
if (!TextUtils.isEmpty(msg)) {
ToastUtils.show(context, msg);
......@@ -69,6 +82,7 @@ public class MyResponseErrorListener implements ResponseErrorListener {
} else if (httpException.code() == 307) {
msg = ArmsUtils.getString(context, R.string.response_error_request_was_redirected_to_another_page);
} else if (httpException.code() == 401) {
// Activity activity = mAppManager.getCurrentActivity();
Activity activity = GsaCloudApplication.getAppContext().getCurrentActivity();
// if (!showloggedDialog && activity != null) {
if (activity != null) {
......
......@@ -40,7 +40,7 @@ import org.json.JSONObject
import java.util.*
import java.util.concurrent.TimeUnit
class DataNotificationService : Service() {
class ICommandService : Service() {
private val TAG = "heart"
......@@ -68,15 +68,15 @@ class DataNotificationService : Service() {
/**
* prj數據
*/
private var PRJ_DATA = 10
private val PRJ_DATA = 10
/**
* prj數據
*/
private var TABLE_DATA = 11
private val TABLE_DATA = 11
private var NOMAL_NOTIFITY_ID = 456
private var DELIVETY_NOTIFITY_ID = 123
private val NOMAL_NOTIFITY_ID = 456
private val DELIVETY_NOTIFITY_ID = 123
companion object {
@kotlin.jvm.JvmField
......@@ -84,27 +84,25 @@ class DataNotificationService : Service() {
@kotlin.jvm.JvmField
var CONNECTION_TYPE = "connection_type"
val CONNECTION_TYPE = "connection_type"
/**
* 开启外送接单长连
*/
@kotlin.jvm.JvmField
var OPEN_DELIVET_ORDER_CONNECTION = 2
val OPEN_DELIVET_ORDER_CONNECTION = 2
/**
* 开启数据接收长连(prj,餐台数据)
*/
@kotlin.jvm.JvmField
var OPEN_OTHER_CONNECTION = 1
val OPEN_OTHER_CONNECTION = 1
/**
* 当前连接类型
*/
@kotlin.jvm.JvmField
var mCurrConnectionType = OPEN_OTHER_CONNECTION
}
override fun onBind(intent: Intent?): IBinder? {
......@@ -242,7 +240,7 @@ class DataNotificationService : Service() {
}
fun setOnPostCallBack(postCallBack: PostCallBack?) {
this@DataNotificationService.postCallBack = postCallBack
this@ICommandService.postCallBack = postCallBack
}
fun execute(block: (isShow: Boolean) -> Unit) {
......@@ -282,7 +280,7 @@ class DataNotificationService : Service() {
it.newWebSocket(request, object : WebSocketListener() {
override fun onOpen(webSocket: WebSocket, response: Response) {//开启长连接成功的回调
super.onOpen(webSocket, response)
if (!this@DataNotificationService.isDestroy) {
if (!this@ICommandService.isDestroy) {
mWebSocket = webSocket
send(mCurrConnectionType)
putTimeLog("連接成功")
......@@ -354,7 +352,7 @@ class DataNotificationService : Service() {
override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {//长连接连接失败的回调
super.onFailure(webSocket, t, response)
Log.e(TAG, "onFailure " + t.message)
if (!this@DataNotificationService.isDestroy) {
if (!this@ICommandService.isDestroy) {
//連接斷開,定時五秒,如果未重連,播放提示音
delayFun({
initSoundPool(R.raw.raw_disconnect)
......
package com.gingersoft.gsa.cloud.common.service;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.utils.StytemUtils;
import com.gingersoft.gsa.cloud.component.ComponentName;
/**
* @作者: bin
* @創建時間: 2021-03-31 10:21
* @更新時間: 2021-03-31 10:21
* @描述:
*/
public class IServiceManager {
public static final String TAG = IServiceManager.class.getSimpleName();
public static void startICommandService(Context context) {
boolean deliveryOrderServiceRunning = StytemUtils.isServiceRunning("com.gingersoft.gsa.cloud.common.service.ICommandService", context);
if (!deliveryOrderServiceRunning) {
Intent service = new Intent(GsaCloudApplication.getAppContext(), ICommandService.class);
service.putExtra(ICommandService.CONNECTION_TYPE, ICommandService.mCurrConnectionType);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(service);
} else {
context.startService(service);
}
LoganManager.w_tableMode(TAG, "启动->ICommandService");
}
}
public static void startPrjService(Context context) {
boolean prjServiceRunning = StytemUtils.isServiceRunning("com.joe.print.mvp.print.service.PrjService", context);
if (!prjServiceRunning) {
//開啟Prj打印服務
CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.setActionName("openPrintService")
.build()
.call();
LoganManager.w_tableMode(TAG, "启动->PrjService");
}
}
}
......@@ -8,6 +8,9 @@ import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Transient;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import lombok.Data;
/**
......
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