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
548dcf00
Commit
548dcf00
authored
May 29, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、SkyOrder打印上菜紙
parent
71826e2e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
317 additions
and
57 deletions
+317
-57
app/build.gradle
+82
-9
app/src/androidTest/java/com/example/gsa_cloud2/ExampleInstrumentedTest.java
+0
-27
app/src/test/java/com/example/gsa_cloud2/ExampleUnitTest.java
+0
-18
component-print/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
+0
-1
component-print/src/main/java/com/joe/print/mvp/ui/view/PrinterLoadingDialog.java
+3
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/ComponentTable.java
+20
-1
config.gradle
+1
-0
library-common/src/main/java/com/gingersoft/gsa/cloud/common/bean/SkyOrderItemDetailBean.java
+44
-0
library-common/src/main/java/com/gingersoft/gsa/cloud/common/bean/SkyOrderServingBean.java
+90
-0
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/ICommandService.kt
+29
-0
library-print/src/main/java/com/gingersoft/gsa/cloud/print/bean/adapter/AdaptationContent.java
+3
-0
library-print/src/main/java/com/gingersoft/gsa/cloud/print/bean/adapter/PrintContentAdapter.java
+44
-1
settings.gradle
+1
-0
No files found.
app/build.gradle
View file @
548dcf00
...
@@ -4,6 +4,14 @@ apply plugin: 'com.jakewharton.butterknife'
...
@@ -4,6 +4,14 @@ apply plugin: 'com.jakewharton.butterknife'
apply
plugin:
'com.didi.dokit'
apply
plugin:
'com.didi.dokit'
android
{
android
{
signingConfigs
{
GSAndroidNew
{
keyAlias
'keycypos'
keyPassword
'qingkeke'
storeFile
file
(
'cyposandroid.keyset'
)
storePassword
'qingkeke'
}
}
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
...
@@ -20,19 +28,31 @@ android {
...
@@ -20,19 +28,31 @@ android {
versionCode
rootProject
.
ext
.
android
[
"versionCode"
]
versionCode
rootProject
.
ext
.
android
[
"versionCode"
]
versionName
rootProject
.
ext
.
android
[
"versionName"
]
versionName
rootProject
.
ext
.
android
[
"versionName"
]
multiDexEnabled
true
multiDexEnabled
true
// ndk{
// abiFilters "armeabi-v7a"
// }
}
}
resourcePrefix
"app"
resourcePrefix
"user_login"
bundle
{
density
{
// Different APKs are generated for devices with different screen densities; true by default.
enableSplit
true
}
abi
{
// Different APKs are generated for devices with different CPU architectures; true by default.
enableSplit
true
}
language
{
// This is disabled so that the App Bundle does NOT split the APK for each language.
// We're gonna use the same APK for all languages.
enableSplit
true
}
}
buildTypes
{
buildTypes
{
debug
{
debug
{
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
rootProject
.
ext
.
buildType
[
"debugLogDebug"
]
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
rootProject
.
ext
.
buildType
[
"debugLogDebug"
]
buildConfigField
"boolean"
,
"USE_CANARY"
,
rootProject
.
ext
.
buildType
[
"debugUseCanary"
]
buildConfigField
"boolean"
,
"USE_CANARY"
,
rootProject
.
ext
.
buildType
[
"debugUseCanary"
]
minifyEnabled
false
minifyEnabled
false
proguardFiles
'proguard.cfg'
proguardFiles
'proguard.cfg'
signingConfig
signingConfigs
.
GSAndroidNew
}
}
release
{
release
{
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
rootProject
.
ext
.
buildType
[
"releaseLogDebug"
]
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
rootProject
.
ext
.
buildType
[
"releaseLogDebug"
]
...
@@ -40,6 +60,7 @@ android {
...
@@ -40,6 +60,7 @@ android {
minifyEnabled
false
minifyEnabled
false
zipAlignEnabled
false
zipAlignEnabled
false
proguardFiles
'proguard.cfg'
proguardFiles
'proguard.cfg'
signingConfig
signingConfigs
.
GSAndroidNew
}
}
}
}
...
@@ -56,18 +77,70 @@ android {
...
@@ -56,18 +77,70 @@ android {
def
date
=
new
Date
()
def
date
=
new
Date
()
def
formattedDate
=
date
.
format
(
'yyyy-MM-dd'
)
def
formattedDate
=
date
.
format
(
'yyyy-MM-dd'
)
if
(
variant
.
buildType
.
name
==
'release'
)
{
if
(
variant
.
buildType
.
name
==
'release'
)
{
fileName
=
"${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_正式版_.apk"
fileName
=
"正式版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
}
else
if
(
variant
.
buildType
.
name
==
'Test'
)
{
fileName
=
"${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_測試版_.apk"
}
else
if
(
variant
.
buildType
.
name
==
'debug'
)
{
}
else
if
(
variant
.
buildType
.
name
==
'debug'
)
{
fileName
=
"
${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_debug_
.apk"
fileName
=
"
测试版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}
.apk"
}
}
outputFileName
=
fileName
outputFileName
=
fileName
}
}
}
}
dexOptions
{
// incremental true
javaMaxHeapSize
"4g"
}
}
//dokit 扩展
dokitExt
{
//通用设置
comm
{
//地图经纬度开关
gpsSwitch
true
//网络开关
networkSwitch
true
//大图开关
bigImgSwitch
true
//webView js 抓包
webViewSwitch
true
}
slowMethod
{
//调用栈模式配置
stackMethod
{
//默认值为 5ms 小于该值的函数在调用栈中不显示
thresholdTime
5
//调用栈函数入口
enterMethods
=
[
"com.didichuxing.doraemondemo.MainDebugActivity.test1"
]
//黑名单 粒度最小到类 暂不支持到方法
methodBlacklist
=
[
"com.facebook.drawee.backends.pipeline.Fresco"
]
}
//普通模式配置
normalMethod
{
//默认值为 500ms 小于该值的函数在运行时不会在控制台中被打印
thresholdTime
100
//需要针对函数插装的包名
packageNames
=
[
"com.didichuxing.doraemondemo"
]
//不需要针对函数插装的包名和类名
methodBlacklist
=
[
"com.didichuxing.doraemondemo.dokit"
]
}
}
}
}
dependencies
{
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
addComponent
'component-main'
addComponent
'component-download'
addComponent
'component-table'
addComponent
'component-print'
addComponent
'component-delivery-pick'
addComponent
'component-manager'
addComponent
'component-coldchain'
addComponent
'component-supply-chain'
addComponent
'component-webview'
addComponent
'component-scan'
addComponent
'component-pay'
implementation
rootProject
.
ext
.
dependencies
[
"viewpager2"
]
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
implementation
rootProject
.
ext
.
dependencies
[
"autosize"
]
}
}
app/src/androidTest/java/com/example/gsa_cloud2/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
71826e2e
package
com
.
example
.
gsa_cloud2
;
import
android.content.Context
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getInstrumentation
().
getTargetContext
();
assertEquals
(
"com.example.gsa_cloud2"
,
appContext
.
getPackageName
());
}
}
\ No newline at end of file
app/src/test/java/com/example/gsa_cloud2/ExampleUnitTest.java
deleted
100644 → 0
View file @
71826e2e
package
com
.
example
.
gsa_cloud2
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
component-print/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
View file @
548dcf00
...
@@ -4,7 +4,6 @@ import android.content.Intent;
...
@@ -4,7 +4,6 @@ import android.content.Intent;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
...
...
component-print/src/main/java/com/joe/print/mvp/ui/view/PrinterLoadingDialog.java
View file @
548dcf00
...
@@ -79,6 +79,7 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
...
@@ -79,6 +79,7 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
@Override
@Override
public
void
dismiss
()
{
public
void
dismiss
()
{
super
.
dismiss
();
super
.
dismiss
();
mContext
=
null
;
}
}
public
PrinterLoadingDialog
build
()
{
public
PrinterLoadingDialog
build
()
{
...
@@ -172,4 +173,6 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
...
@@ -172,4 +173,6 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
protected
int
getContentViewLayoutId
()
{
protected
int
getContentViewLayoutId
()
{
return
R
.
layout
.
print_dialog_loading
;
return
R
.
layout
.
print_dialog_loading
;
}
}
}
}
component-table/src/main/java/com/gingersoft/gsa/cloud/table/ComponentTable.java
View file @
548dcf00
...
@@ -6,16 +6,21 @@ import com.billy.cc.core.component.CC;
...
@@ -6,16 +6,21 @@ import com.billy.cc.core.component.CC;
import
com.billy.cc.core.component.CCResult
;
import
com.billy.cc.core.component.CCResult
;
import
com.billy.cc.core.component.CCUtil
;
import
com.billy.cc.core.component.CCUtil
;
import
com.billy.cc.core.component.IComponent
;
import
com.billy.cc.core.component.IComponent
;
import
com.gingersoft.gsa.cloud.common.bean.SkyOrderServingBean
;
import
com.gingersoft.gsa.cloud.common.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.common.function.FModule
;
import
com.gingersoft.gsa.cloud.common.function.FModule
;
import
com.gingersoft.gsa.cloud.component.ComponentAction
;
import
com.gingersoft.gsa.cloud.component.ComponentAction
;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
import
com.gingersoft.gsa.cloud.order.order.MealOrder
;
import
com.gingersoft.gsa.cloud.order.order.MealOrder
;
import
com.gingersoft.gsa.cloud.order.order.TakeawayOrder
;
import
com.gingersoft.gsa.cloud.order.order.TakeawayOrder
;
import
com.gingersoft.gsa.cloud.print.bean.PrintContent
;
import
com.gingersoft.gsa.cloud.print.bean.adapter.PrintContentAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealBillActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealBillActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealSoldoutActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealSoldoutActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealStandActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.meal.MealStandActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.table.TableActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.order.OrderCenterActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.order.OrderCenterActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.table.TableActivity
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
...
@@ -107,6 +112,20 @@ public class ComponentTable implements IComponent {
...
@@ -107,6 +112,20 @@ public class ComponentTable implements IComponent {
}
}
break
;
break
;
}
}
case
"printSkyOrderServer"
:
//打印skyOrder上菜紙
SkyOrderServingBean
skyOrderServingBean
=
cc
.
getParamItem
(
"skyServingData"
);
PrintContent
printContent
=
new
PrintContentAdapter
().
adaptationServingPaperContent
(
skyOrderServingBean
);
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_PRINT
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
addParam
(
PrintConstans
.
PRINT_CONTENT
,
printContent
)
.
addParam
(
PrintConstans
.
PRINT_ORDER_NO
,
skyOrderServingBean
.
getOrderId
()
+
""
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc1
,
result
)
->
{
});
break
;
case
ComponentAction
.
Table
.
INT_ORDER
:
case
ComponentAction
.
Table
.
INT_ORDER
:
//初始化堂食賬單類
//初始化堂食賬單類
MealOrder
.
getInstance
().
initialization
();
MealOrder
.
getInstance
().
initialization
();
...
...
config.gradle
View file @
548dcf00
...
@@ -68,6 +68,7 @@ ext {
...
@@ -68,6 +68,7 @@ ext {
"loadsir"
:
"com.kingja.loadsir:loadsir:1.3.8"
,
"loadsir"
:
"com.kingja.loadsir:loadsir:1.3.8"
,
"lottie"
:
"com.airbnb.android:lottie:3.6.1"
,
"lottie"
:
"com.airbnb.android:lottie:3.6.1"
,
"loadingIndicatorView"
:
"com.wang.avi:library:2.1.3"
,
"loadingIndicatorView"
:
"com.wang.avi:library:2.1.3"
,
"viewpager2"
:
"androidx.viewpager2:viewpager2:1.0.0-alpha03"
,
//rx1
//rx1
"rxandroid"
:
"io.reactivex:rxandroid:1.2.1"
,
"rxandroid"
:
"io.reactivex:rxandroid:1.2.1"
,
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/bean/SkyOrderItemDetailBean.java
0 → 100644
View file @
548dcf00
package
com
.
gingersoft
.
gsa
.
cloud
.
common
.
bean
;
import
java.util.List
;
/**
* @author 宇航. 1239658231@qq.com
* Date: 2021/5/29
* Time: 11:08
* Use:
*/
public
class
SkyOrderItemDetailBean
{
/**
* itemDetail : []
* number : 1
* productName : 辣
*/
private
int
number
;
private
String
productName
;
private
List
<
SkyOrderItemDetailBean
>
itemDetail
;
public
int
getNumber
()
{
return
number
;
}
public
void
setNumber
(
int
number
)
{
this
.
number
=
number
;
}
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
public
List
<
SkyOrderItemDetailBean
>
getItemDetail
()
{
return
itemDetail
;
}
public
void
setItemDetail
(
List
<
SkyOrderItemDetailBean
>
itemDetail
)
{
this
.
itemDetail
=
itemDetail
;
}
}
library-common/src/main/java/com/gingersoft/gsa/cloud/common/bean/SkyOrderServingBean.java
0 → 100644
View file @
548dcf00
package
com
.
gingersoft
.
gsa
.
cloud
.
common
.
bean
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author 宇航. 1239658231@qq.com
* Date: 2021/5/29
* Time: 10:56
* Use:掃碼點餐上菜紙
*/
public
class
SkyOrderServingBean
implements
Serializable
{
/**
* foods : [{"itemDetail":[[{"itemDetail":[],"number":1,"productName":"辣"},{"itemDetail":[],"number":1,"productName":"甜辣"}]],"number":1,"productName":"雞飯(四客)"}]
* orderId : 11142192
* person : 9
* tableName : 512
*/
private
int
orderId
;
private
int
person
;
private
String
tableName
;
private
List
<
FoodsBean
>
foods
;
public
int
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
int
orderId
)
{
this
.
orderId
=
orderId
;
}
public
int
getPerson
()
{
return
person
;
}
public
void
setPerson
(
int
person
)
{
this
.
person
=
person
;
}
public
String
getTableName
()
{
return
tableName
;
}
public
void
setTableName
(
String
tableName
)
{
this
.
tableName
=
tableName
;
}
public
List
<
FoodsBean
>
getFoods
()
{
return
foods
;
}
public
void
setFoods
(
List
<
FoodsBean
>
foods
)
{
this
.
foods
=
foods
;
}
public
static
class
FoodsBean
{
/**
* itemDetail : [[{"itemDetail":[],"number":1,"productName":"辣"},{"itemDetail":[],"number":1,"productName":"甜辣"}]]
* number : 1
* productName : 雞飯(四客)
*/
private
int
number
;
private
String
productName
;
private
List
<
List
<
SkyOrderItemDetailBean
>>
itemDetail
;
public
int
getNumber
()
{
return
number
;
}
public
void
setNumber
(
int
number
)
{
this
.
number
=
number
;
}
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
public
List
<
List
<
SkyOrderItemDetailBean
>>
getItemDetail
()
{
return
itemDetail
;
}
public
void
setItemDetail
(
List
<
List
<
SkyOrderItemDetailBean
>>
itemDetail
)
{
this
.
itemDetail
=
itemDetail
;
}
}
}
library-common/src/main/java/com/gingersoft/gsa/cloud/common/service/ICommandService.kt
View file @
548dcf00
...
@@ -17,13 +17,17 @@ import android.widget.RemoteViews
...
@@ -17,13 +17,17 @@ import android.widget.RemoteViews
import
androidx.annotation.RequiresApi
import
androidx.annotation.RequiresApi
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationCompat
import
com.billy.cc.core.component.CC
import
com.billy.cc.core.component.CC
import
com.billy.cc.core.component.CCResult
import
com.gingersoft.gsa.cloud.common.R
import
com.gingersoft.gsa.cloud.common.R
import
com.gingersoft.gsa.cloud.common.bean.SkyOrderServingBean
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.common.constans.PrintConstans
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
import
com.gingersoft.gsa.cloud.common.utils.SoundPoolUtils
import
com.gingersoft.gsa.cloud.common.utils.SoundPoolUtils
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.okhttpUtils.OkHttp3Utils
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.component.ComponentName
import
com.gingersoft.gsa.cloud.component.ComponentName
...
@@ -107,6 +111,11 @@ class ICommandService : Service() {
...
@@ -107,6 +111,11 @@ class ICommandService : Service() {
private
val
TABLE_DATA
=
11
private
val
TABLE_DATA
=
11
/**
/**
* sky order 送單消息
*/
private
val
SKYORDER_SEND
=
13
/**
* 上次播報的時間
* 上次播報的時間
*/
*/
private
var
lastSoundTime
:
Long
=
0L
private
var
lastSoundTime
:
Long
=
0L
...
@@ -359,6 +368,17 @@ class ICommandService : Service() {
...
@@ -359,6 +368,17 @@ class ICommandService : Service() {
.
setActionName
(
"getTables"
)
.
setActionName
(
"getTables"
)
.
build
()
.
build
()
.
call
()
.
call
()
}
else
if
(
type
==
SKYORDER_SEND
)
{
//打印上菜紙
val
receivedMsgBean
=
GsonUtils
.
GsonToBean
(
text
,
ReceivedMsgBean
::
class
.
java
)
val
skyOrderServingBean
=
GsonUtils
.
GsonToBean
(
receivedMsgBean
.
value
,
SkyOrderServingBean
::
class
.
java
)
skyOrderServingBean
?.
apply
{
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_TABLE
)
.
setActionName
(
"printSkyOrderServer"
)
.
addParam
(
"skyServingData"
,
skyOrderServingBean
)
.
build
()
.
call
()
}
}
}
}
}
...
@@ -523,4 +543,12 @@ class ICommandService : Service() {
...
@@ -523,4 +543,12 @@ class ICommandService : Service() {
class
MsgBean
(
var
type
:
Int
,
var
data
:
String
,
var
token
:
String
,
var
userId
:
Int
,
var
deviceId
:
String
)
class
MsgBean
(
var
type
:
Int
,
var
data
:
String
,
var
token
:
String
,
var
userId
:
Int
,
var
deviceId
:
String
)
class
ReceivedMsgBean
{
var
data
:
String
?
=
null
var
password
:
String
?
=
null
var
token
:
String
?
=
null
var
type
:
Int
=
0
var
username
:
String
?
=
null
var
value
:
Any
?
=
null
}
}
}
\ No newline at end of file
library-print/src/main/java/com/gingersoft/gsa/cloud/print/bean/adapter/AdaptationContent.java
View file @
548dcf00
package
com
.
gingersoft
.
gsa
.
cloud
.
print
.
bean
.
adapter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
print
.
bean
.
adapter
;
import
com.gingersoft.gsa.cloud.common.bean.SkyOrderServingBean
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport
;
import
com.gingersoft.gsa.cloud.common.core.settlement.SettlementReport
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
...
@@ -28,5 +29,7 @@ public interface AdaptationContent {
...
@@ -28,5 +29,7 @@ public interface AdaptationContent {
PrintContent
adaptationServingPaperContent
(
MealOrder
mealOrder
,
TableBean
.
DataBean
tableBean
);
PrintContent
adaptationServingPaperContent
(
MealOrder
mealOrder
,
TableBean
.
DataBean
tableBean
);
PrintContent
adaptationServingPaperContent
(
SkyOrderServingBean
skyOrderServingBean
);
PrintContent
adaptationBillContent
(
MealOrder
mealOrder
,
TableBean
.
DataBean
tableBean
);
PrintContent
adaptationBillContent
(
MealOrder
mealOrder
,
TableBean
.
DataBean
tableBean
);
}
}
library-print/src/main/java/com/gingersoft/gsa/cloud/print/bean/adapter/PrintContentAdapter.java
View file @
548dcf00
package
com
.
gingersoft
.
gsa
.
cloud
.
print
.
bean
.
adapter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
print
.
bean
.
adapter
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.common.bean.SkyOrderItemDetailBean
;
import
com.gingersoft.gsa.cloud.common.bean.SkyOrderServingBean
;
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
;
import
com.gingersoft.gsa.cloud.common.constans.AppConstant
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
...
@@ -58,6 +60,7 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -58,6 +60,7 @@ public class PrintContentAdapter implements AdaptationContent {
/**
/**
* 清機打印
* 清機打印
*
* @param settlementReport
* @param settlementReport
* @return
* @return
*/
*/
...
@@ -76,6 +79,7 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -76,6 +79,7 @@ public class PrintContentAdapter implements AdaptationContent {
/**
/**
* 印單
* 印單
*
* @param mealOrder
* @param mealOrder
* @param tableBean
* @param tableBean
* @return
* @return
...
@@ -100,6 +104,7 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -100,6 +104,7 @@ public class PrintContentAdapter implements AdaptationContent {
/**
/**
* 送單
* 送單
*
* @param mealOrder
* @param mealOrder
* @param tableBean
* @param tableBean
* @return
* @return
...
@@ -121,6 +126,7 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -121,6 +126,7 @@ public class PrintContentAdapter implements AdaptationContent {
/**
/**
* 上菜紙
* 上菜紙
*
* @param mealOrder
* @param mealOrder
* @param tableBean
* @param tableBean
* @return
* @return
...
@@ -134,14 +140,28 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -134,14 +140,28 @@ public class PrintContentAdapter implements AdaptationContent {
servingPaperContent
.
setPerson
(
tableBean
.
getPerson
());
servingPaperContent
.
setPerson
(
tableBean
.
getPerson
());
servingPaperContent
.
setCreateTime
(
tableBean
.
getCreateTime
());
servingPaperContent
.
setCreateTime
(
tableBean
.
getCreateTime
());
servingPaperContent
.
setOrderNo
(
mealOrder
.
getOrderNo
());
servingPaperContent
.
setOrderNo
(
mealOrder
.
getOrderNo
());
// servingPaperContent.setFoodItemList(orderDetailItemCastPrintFoodItemList(mealOrder.getNewFoodList()));
servingPaperContent
.
setFoodItemList
(
orderDetailItemCastPrintFoodItemList
(
mealOrder
.
getShoppingCart
().
getOrderCommodityList
()));
servingPaperContent
.
setFoodItemList
(
orderDetailItemCastPrintFoodItemList
(
mealOrder
.
getShoppingCart
().
getOrderCommodityList
()));
servingPaperContent
.
setPoliteLanguage
(
GsaCloudApplication
.
functionConfiguration
.
getBottomPoliteLanguageVaule
());
servingPaperContent
.
setPoliteLanguage
(
GsaCloudApplication
.
functionConfiguration
.
getBottomPoliteLanguageVaule
());
return
servingPaperContent
;
return
servingPaperContent
;
}
}
@Override
public
PrintContent
adaptationServingPaperContent
(
SkyOrderServingBean
skyOrderServingBean
)
{
PrintServingPaperContent
servingPaperContent
=
new
PrintServingPaperContent
();
servingPaperContent
.
setBrand
(
RestaurantInfoManager
.
newInstance
().
getBrandName
());
servingPaperContent
.
setResturantName
(
RestaurantInfoManager
.
newInstance
().
getRestaurantName
());
servingPaperContent
.
setTableName
(
skyOrderServingBean
.
getTableName
());
servingPaperContent
.
setPerson
(
skyOrderServingBean
.
getPerson
());
servingPaperContent
.
setCreateTime
(
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
servingPaperContent
.
setOrderNo
(
skyOrderServingBean
.
getOrderId
()
+
""
);
servingPaperContent
.
setFoodItemList
(
skyOrderServingCastPrintFoodItemList
(
skyOrderServingBean
.
getFoods
()));
servingPaperContent
.
setPoliteLanguage
(
GsaCloudApplication
.
functionConfiguration
.
getBottomPoliteLanguageVaule
());
return
servingPaperContent
;
}
/**
/**
* 打印結賬單
* 打印結賬單
*
* @param mealOrder
* @param mealOrder
* @param tableBean
* @param tableBean
* @return
* @return
...
@@ -172,6 +192,29 @@ public class PrintContentAdapter implements AdaptationContent {
...
@@ -172,6 +192,29 @@ public class PrintContentAdapter implements AdaptationContent {
return
billContent
;
return
billContent
;
}
}
private
List
<
PrintFoodItem
>
skyOrderServingCastPrintFoodItemList
(
List
<
SkyOrderServingBean
.
FoodsBean
>
foods
)
{
List
<
PrintFoodItem
>
printFoodItems
=
new
ArrayList
<>();
for
(
SkyOrderServingBean
.
FoodsBean
food
:
foods
)
{
//上菜紙不顯示價格,填0
printFoodItems
.
add
(
new
PrintFoodItem
(
food
.
getProductName
(),
food
.
getNumber
(),
0
,
1
));
if
(
food
.
getItemDetail
()
!=
null
)
{
for
(
List
<
SkyOrderItemDetailBean
>
skyOrderItemDetailBeans
:
food
.
getItemDetail
())
{
if
(
skyOrderItemDetailBeans
!=
null
)
{
for
(
SkyOrderItemDetailBean
skyOrderItemDetailBean
:
skyOrderItemDetailBeans
)
{
printFoodItems
.
add
(
new
PrintFoodItem
(
skyOrderItemDetailBean
.
getProductName
(),
skyOrderItemDetailBean
.
getNumber
(),
0
,
2
));
if
(
skyOrderItemDetailBean
.
getItemDetail
()
!=
null
)
{
for
(
SkyOrderItemDetailBean
orderItemDetailBean
:
skyOrderItemDetailBean
.
getItemDetail
())
{
printFoodItems
.
add
(
new
PrintFoodItem
(
orderItemDetailBean
.
getProductName
(),
orderItemDetailBean
.
getNumber
(),
0
,
3
));
}
}
}
}
}
}
}
return
printFoodItems
;
}
private
List
<
PrintFoodItem
>
orderDetailItemCastPrintFoodItemList
(
List
<
OrderDetail
>
newFoodList
)
{
private
List
<
PrintFoodItem
>
orderDetailItemCastPrintFoodItemList
(
List
<
OrderDetail
>
newFoodList
)
{
List
<
PrintFoodItem
>
printFoodItems
=
new
ArrayList
<>();
List
<
PrintFoodItem
>
printFoodItems
=
new
ArrayList
<>();
if
(
newFoodList
!=
null
)
{
if
(
newFoodList
!=
null
)
{
...
...
settings.gradle
View file @
548dcf00
...
@@ -15,6 +15,7 @@ include 'cc-register',
...
@@ -15,6 +15,7 @@ include 'cc-register',
'library-order'
,
'library-order'
,
'library-print'
,
'library-print'
,
'app'
,
'component-login'
,
'component-login'
,
'component-main'
,
'component-main'
,
'component-download'
,
'component-download'
,
...
...
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