Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
59c51817
Commit
59c51817
authored
Apr 01, 2021
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
餐種過濾條件導致套餐 未顯示問題
parent
3e3bdd2e
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
311 additions
and
203 deletions
+311
-203
build.gradle
+9
-4
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
+4
-5
component-delivery-pick/src/main/debug/AndroidManifest.xml
+1
-1
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/DeliveryPickComponent.java
+2
-2
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+7
-7
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
+4
-4
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/LogActivity.java
+3
-3
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
+10
-2
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+12
-3
component-login/src/main/res/layout/activity_welcome.xml
+6
-0
component-login/src/main/res/layout/user_login_activity_login.xml
+6
-2
component-main/src/main/java/com/gingersoft/gsa/cloud/main/ComponentMain.java
+1
-1
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
+8
-28
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/HomeFragment.java
+4
-17
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/MyFragment.java
+1
-1
component-table/src/main/java/com/gingersoft/gsa/cloud/table/di/module/TableModule.java
+23
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
+22
-18
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MealConditionFilterUtils.java
+11
-5
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+6
-2
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+79
-79
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+5
-2
config.gradle
+2
-2
library-common/src/main/AndroidManifest.xml
+1
-1
library-common/src/main/java/com/gingersoft/gsa/cloud/app/GsaCloudApplication.java
+6
-0
library-common/src/main/java/com/gingersoft/gsa/cloud/common/config/globalconfig/applyOptions/MyResponseErrorListener.java
+15
-1
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/ICommandService.kt
+11
-13
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/IServiceManager.java
+49
-0
library-database/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
+3
-0
No files found.
build.gradle
View file @
59c51817
...
...
@@ -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'
}
}
...
...
component-coldchain/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
View file @
59c51817
...
...
@@ -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
(),
DataNotification
Service
.
class
);
Intent
intent
=
new
Intent
(
getApplicationContext
(),
ICommand
Service
.
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
DataNotification
Service
.
MyBind
bind
=
null
;
private
ICommand
Service
.
MyBind
bind
=
null
;
private
long
lastMsgTime
=
0
;
private
ServiceConnection
serviceConnection
=
new
ServiceConnection
()
{
@Override
public
void
onServiceConnected
(
ComponentName
name
,
IBinder
service
)
{
bind
=
(
DataNotification
Service
.
MyBind
)
service
;
bind
=
(
ICommand
Service
.
MyBind
)
service
;
if
(
bind
!=
null
)
{
bind
.
setOnPostCallBack
(
type
->
{
// -1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知"
...
...
component-delivery-pick/src/main/debug/AndroidManifest.xml
View file @
59c51817
...
...
@@ -28,7 +28,7 @@
</intent-filter>
</activity>
<service
android:name=
"com.gingersoft.gsa.cloud.common.service.
DataNotification
Service"
/>
<service
android:name=
"com.gingersoft.gsa.cloud.common.service.
ICommand
Service"
/>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/DeliveryPickComponent.java
View file @
59c51817
...
...
@@ -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.
DataNotification
Service
;
import
com.gingersoft.gsa.cloud.common.service.
ICommand
Service
;
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
(),
DataNotification
Service
.
class
);
Intent
intent
=
new
Intent
(
cc
.
getContext
(),
ICommand
Service
.
class
);
cc
.
getContext
().
stopService
(
intent
);
break
;
case
"historyActivity"
:
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
59c51817
...
...
@@ -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.
DataNotification
Service
import
com.gingersoft.gsa.cloud.common.service.
ICommand
Service
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
()
DataNotification
Service
.
loginfo
.
append
(
"錯誤信息111:"
+
e
.
message
+
" LOCALIZEDMESSAGE:"
+
e
.
localizedMessage
+
e
.
cause
)
DataNotification
Service
.
loginfo
.
append
(
"\n"
)
ICommand
Service
.
loginfo
.
append
(
"錯誤信息111:"
+
e
.
message
+
" LOCALIZEDMESSAGE:"
+
e
.
localizedMessage
+
e
.
cause
)
ICommand
Service
.
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
())
DataNotification
Service
.
loginfo
.
append
(
"添加PRJ:orderId:"
+
dataBean
.
Order_ID
.
toString
()
+
"restaurantId:"
+
restaurantId
+
"orderDetailsIds:"
+
ids
.
toString
())
DataNotification
Service
.
loginfo
.
append
(
"\n"
)
ICommand
Service
.
loginfo
.
append
(
"添加PRJ:orderId:"
+
dataBean
.
Order_ID
.
toString
()
+
"restaurantId:"
+
restaurantId
+
"orderDetailsIds:"
+
ids
.
toString
())
ICommand
Service
.
loginfo
.
append
(
"\n"
)
},
{
it
.
printStackTrace
()
DataNotification
Service
.
loginfo
.
append
(
"錯誤信息222:"
+
it
.
message
+
" LOCALIZEDMESSAGE:"
+
it
.
localizedMessage
+
it
.
cause
)
DataNotification
Service
.
loginfo
.
append
(
"\n"
)
ICommand
Service
.
loginfo
.
append
(
"錯誤信息222:"
+
it
.
message
+
" LOCALIZEDMESSAGE:"
+
it
.
localizedMessage
+
it
.
cause
)
ICommand
Service
.
loginfo
.
append
(
"\n"
)
})
}
if
(
isPrintBill
)
{
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
View file @
59c51817
...
...
@@ -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.
DataNotification
Service
import
com.gingersoft.gsa.cloud.common.service.
ICommand
Service
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
:
DataNotification
Service
.
MyBind
?
=
null
var
bind
:
ICommand
Service
.
MyBind
?
=
null
//最後一次長連接過來的消息類型
var
lastMsgType
:
Int
=
0
...
...
@@ -392,7 +392,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
*/
private
fun
initWebSocket
()
{
//開啟webSocket
val
service
=
Intent
(
applicationContext
,
DataNotification
Service
::
class
.
java
)
val
service
=
Intent
(
applicationContext
,
ICommand
Service
::
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
DataNotification
Service
.
MyBind
bind
=
service
as
ICommand
Service
.
MyBind
bind
?.
let
{
it
->
it
.
setOnPostCallBack
(
object
:
PostCallBack
{
override
fun
callBack
(
type
:
Int
)
{
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/LogActivity.java
View file @
59c51817
...
...
@@ -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.
DataNotification
Service
;
import
com.gingersoft.gsa.cloud.common.service.
ICommand
Service
;
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
->
{
DataNotification
Service
.
loginfo
.
setLength
(
0
);
ICommand
Service
.
loginfo
.
setLength
(
0
);
loadInfo
();
});
findViewById
(
R
.
id
.
btn_back
).
setOnClickListener
(
v
->
finish
());
}
private
void
loadInfo
()
{
((
TextView
)
findViewById
(
R
.
id
.
tv_log
)).
setText
(
DataNotification
Service
.
loginfo
.
toString
());
((
TextView
)
findViewById
(
R
.
id
.
tv_log
)).
setText
(
ICommand
Service
.
loginfo
.
toString
());
}
}
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
View file @
59c51817
...
...
@@ -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
...
...
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
View file @
59c51817
...
...
@@ -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
)
{
...
...
component-login/src/main/res/layout/activity_welcome.xml
View file @
59c51817
...
...
@@ -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
...
...
component-login/src/main/res/layout/user_login_activity_login.xml
View file @
59c51817
...
...
@@ -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"
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/ComponentMain.java
View file @
59c51817
...
...
@@ -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
(),
New
MainActivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
cc
.
getContext
().
startActivity
(
intent
);
// CCUtil.createNavigateIntent(cc, NewMainActivity.class);
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
View file @
59c51817
...
...
@@ -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清機"
));
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/HomeFragment.java
View file @
59c51817
...
...
@@ -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.
DataNotification
Service
;
import
com.gingersoft.gsa.cloud.common.service.
ICommand
Service
;
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.
DataNotification
Service"
,
_mActivity
);
boolean
deliveryOrderServiceRunning
=
StytemUtils
.
isServiceRunning
(
"com.gingersoft.gsa.cloud.common.service.
ICommand
Service"
,
_mActivity
);
if
(!
deliveryOrderServiceRunning
)
{
Intent
service
=
new
Intent
(
GsaCloudApplication
.
getAppContext
(),
DataNotification
Service
.
class
);
service
.
putExtra
(
DataNotificationService
.
CONNECTION_TYPE
,
DataNotification
Service
.
mCurrConnectionType
);
Intent
service
=
new
Intent
(
GsaCloudApplication
.
getAppContext
(),
ICommand
Service
.
class
);
service
.
putExtra
(
ICommandService
.
CONNECTION_TYPE
,
ICommand
Service
.
mCurrConnectionType
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
mContext
.
startForegroundService
(
service
);
}
else
{
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/MyFragment.java
View file @
59c51817
...
...
@@ -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
;
...
...
@@ -64,7 +65,6 @@ public class MyFragment extends BaseFragment<MyPresenter> implements MyContract.
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
}
@Override
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/di/module/TableModule.java
View file @
59c51817
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
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
View file @
59c51817
...
...
@@ -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()));
}
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MealConditionFilterUtils.java
View file @
59c51817
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,8 +28,10 @@ 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
();
...
...
@@ -41,7 +44,6 @@ public class MealConditionFilterUtils {
}
}
}
}
return
newFoodList
;
}
...
...
@@ -53,8 +55,10 @@ 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
();
...
...
@@ -67,7 +71,6 @@ public class MealConditionFilterUtils {
}
}
}
}
return
newComboItemList
;
}
...
...
@@ -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
Hash
Map
<>();
Map
<
String
,
Discount
>
newDiscountMaps
=
new
Array
Map
<>();
for
(
Discount
discount
:
discountList
)
{
newDiscountMaps
.
put
(
discount
.
getId
()
+
"-"
+
discount
.
getDiscountType
()
+
"-"
+
discount
.
getPlaceOrderType
(),
discount
);
}
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
59c51817
...
...
@@ -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<>();
/**
* 套餐细项数据
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
59c51817
...
...
@@ -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
}
}
/**
* 執行餐檯操作
*/
public
boolean
doTableAction
(
TableBean
.
DataBean
dataBean
)
{
if
(
mTableAction
!=
null
)
{
mTableAction
.
setActionListener
(
new
TableAction
.
OnActionListener
()
{
@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
void
setOperatContentText
(
String
content
)
{
mRootView
.
setTableActionContentText
(
content
);
}
stopTablePolling
();
@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
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
()
{
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
59c51817
...
...
@@ -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
()
{
...
...
config.gradle
View file @
59c51817
...
...
@@ -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
=
[
...
...
library-common/src/main/AndroidManifest.xml
View file @
59c51817
...
...
@@ -33,7 +33,7 @@
android:name=
"design_height_in_dp"
android:value=
"640"
/>
<service
android:name=
"com.gingersoft.gsa.cloud.common.service.
DataNotification
Service"
android:name=
"com.gingersoft.gsa.cloud.common.service.
ICommand
Service"
android:enabled=
"true"
/>
</application>
</manifest>
library-common/src/main/java/com/gingersoft/gsa/cloud/app/GsaCloudApplication.java
View file @
59c51817
...
...
@@ -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
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/config/globalconfig/applyOptions/MyResponseErrorListener.java
View file @
59c51817
...
...
@@ -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
)
{
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/
DataNotification
Service.kt
→
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/
ICommand
Service.kt
View file @
59c51817
...
...
@@ -40,7 +40,7 @@ import org.json.JSONObject
import
java.util.*
import
java.util.concurrent.TimeUnit
class
DataNotification
Service
:
Service
()
{
class
ICommand
Service
:
Service
()
{
private
val
TAG
=
"heart"
...
...
@@ -68,15 +68,15 @@ class DataNotificationService : Service() {
/**
* prj數據
*/
private
va
r
PRJ_DATA
=
10
private
va
l
PRJ_DATA
=
10
/**
* prj數據
*/
private
va
r
TABLE_DATA
=
11
private
va
l
TABLE_DATA
=
11
private
va
r
NOMAL_NOTIFITY_ID
=
456
private
va
r
DELIVETY_NOTIFITY_ID
=
123
private
va
l
NOMAL_NOTIFITY_ID
=
456
private
va
l
DELIVETY_NOTIFITY_ID
=
123
companion
object
{
@kotlin
.
jvm
.
JvmField
...
...
@@ -84,27 +84,25 @@ class DataNotificationService : Service() {
@kotlin
.
jvm
.
JvmField
va
r
CONNECTION_TYPE
=
"connection_type"
va
l
CONNECTION_TYPE
=
"connection_type"
/**
* 开启外送接单长连
*/
@kotlin
.
jvm
.
JvmField
va
r
OPEN_DELIVET_ORDER_CONNECTION
=
2
va
l
OPEN_DELIVET_ORDER_CONNECTION
=
2
/**
* 开启数据接收长连(prj,餐台数据)
*/
@kotlin
.
jvm
.
JvmField
va
r
OPEN_OTHER_CONNECTION
=
1
va
l
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
@
DataNotification
Service
.
postCallBack
=
postCallBack
this
@
ICommand
Service
.
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
@
DataNotification
Service
.
isDestroy
)
{
if
(!
this
@
ICommand
Service
.
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
@
DataNotification
Service
.
isDestroy
)
{
if
(!
this
@
ICommand
Service
.
isDestroy
)
{
//連接斷開,定時五秒,如果未重連,播放提示音
delayFun
({
initSoundPool
(
R
.
raw
.
raw_disconnect
)
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/IServiceManager.java
0 → 100644
View file @
59c51817
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"
);
}
}
}
library-database/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
View file @
59c51817
...
...
@@ -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
;
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment