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
2b3e65d7
Commit
2b3e65d7
authored
Jun 24, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.24
parent
b5628706
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
16 deletions
+78
-16
base-module/src/main/res/layout/print_layout_print_bill.xml
+4
-6
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
+15
-10
other_order_mode/src/main/res/drawable/shape_cloas_btn.xml
+7
-0
other_order_mode/src/main/res/layout/layout_order_receiving.xml
+52
-0
No files found.
base-module/src/main/res/layout/print_layout_print_bill.xml
View file @
2b3e65d7
...
@@ -19,9 +19,8 @@
...
@@ -19,9 +19,8 @@
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"gs1"
android:text=
"gs1"
app:layout_constraint
Horizontal_chainStyle=
"packed
"
app:layout_constraint
Right_toRightOf=
"parent
"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@id/tv_restaurant_name"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
<TextView
...
@@ -30,12 +29,11 @@
...
@@ -30,12 +29,11 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"5dp"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"yan"
android:text=
"yan"
app:layout_constraint
Left_toRight
Of=
"@id/tv_brand_name"
app:layout_constraint
Top_toBottom
Of=
"@id/tv_brand_name"
app:layout_constraint
Right_toRigh
tOf=
"parent"
app:layout_constraint
Left_toLef
tOf=
"parent"
app:layout_constraint
Top_toTopOf=
"@id/tv_brand_name
"
/>
app:layout_constraint
Right_toRightOf=
"parent
"
/>
<TextView
<TextView
android:id=
"@+id/tv_print_bill_order_num"
android:id=
"@+id/tv_print_bill_order_num"
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
View file @
2b3e65d7
...
@@ -141,7 +141,6 @@ class GetInfoUpdateService : Service() {
...
@@ -141,7 +141,6 @@ class GetInfoUpdateService : Service() {
// 初始化socket
// 初始化socket
private
fun
initSocket
()
{
private
fun
initSocket
()
{
Log
.
e
(
"eee"
,
"啊啊啊啊"
+
application
.
isRestricted
)
RxTimerUtil
.
cancel
()
RxTimerUtil
.
cancel
()
RxTimerUtil
.
timer
({
RxTimerUtil
.
timer
({
client
=
OkHttpClient
.
Builder
().
readTimeout
(
0
,
TimeUnit
.
MILLISECONDS
).
build
()
client
=
OkHttpClient
.
Builder
().
readTimeout
(
0
,
TimeUnit
.
MILLISECONDS
).
build
()
...
@@ -312,10 +311,13 @@ class GetInfoUpdateService : Service() {
...
@@ -312,10 +311,13 @@ class GetInfoUpdateService : Service() {
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
Log
.
e
(
TAG
,
"onDestroy"
)
Log
.
e
(
"eee"
,
"onDestroy"
)
//清除心跳
clearHeart
()
isDestroy
=
true
isDestroy
=
true
//取消廣播
unregisterReceiver
(
mReceiver
)
unregisterReceiver
(
mReceiver
)
//斷開鏈接
//斷開
長
鏈接
client
?.
let
{
client
?.
let
{
mWebSocket
?.
cancel
()
mWebSocket
?.
cancel
()
it
.
dispatcher
().
cancelAll
()
it
.
dispatcher
().
cancelAll
()
...
@@ -324,19 +326,22 @@ class GetInfoUpdateService : Service() {
...
@@ -324,19 +326,22 @@ class GetInfoUpdateService : Service() {
mWebSocket
!!
.
send
(
"-1"
)
mWebSocket
!!
.
send
(
"-1"
)
mWebSocket
!!
.
close
(
1000
,
null
)
mWebSocket
!!
.
close
(
1000
,
null
)
}
}
//停止定時心跳
RxTimerUtil
.
cancel
()
RxTimerUtil
.
cancel
()
//停止服務
//停止
前台
服務
stopForeground
(
true
)
stopForeground
(
true
)
}
}
private
fun
clearHeart
()
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
GsaCloudApplication
.
getRestaurantId
(
this
@GetInfoUpdateService
).
toString
()
+
""
)
.
build
()
OkHttp3Utils
.
post
(
HttpsConstans
.
ROOT_URL
+
"/member-web/api/restaurant/clearHeartbeat"
,
requestBody
)
//清除心跳
}
inner
class
ClearHeartBroadcastReceiver
:
BroadcastReceiver
()
{
inner
class
ClearHeartBroadcastReceiver
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
//清除心跳並關閉service
//關閉service,會調用service的onDestroy
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
GsaCloudApplication
.
getRestaurantId
(
this
@GetInfoUpdateService
).
toString
()
+
""
)
.
build
()
OkHttp3Utils
.
post
(
HttpsConstans
.
ROOT_URL
+
"/member-web/api/restaurant/clearHeartbeat"
,
requestBody
)
//清除心跳
stopSelf
()
stopSelf
()
}
}
}
}
...
...
other_order_mode/src/main/res/drawable/shape_cloas_btn.xml
0 → 100644
View file @
2b3e65d7
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/dp_8"
/>
<solid
android:color=
"@color/close_btn_color"
/>
</shape>
\ No newline at end of file
other_order_mode/src/main/res/layout/layout_order_receiving.xml
0 → 100644
View file @
2b3e65d7
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
android:padding=
"@dimen/dp_10"
>
<ImageView
android:id=
"@+id/iv_launch"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_launcher"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_toEndOf=
"@id/iv_launch"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Ricepon pos"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_14"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"外賣接單服務"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_14"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_stop_service"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:background=
"@drawable/shape_cloas_btn"
android:text=
"停止接單"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
/>
</RelativeLayout>
\ No newline at end of file
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