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
70cf3b69
Commit
70cf3b69
authored
Jul 30, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.30 1、登陸頁面插畫更換 2、上菜紙、印單、結賬單打印調整 3、第三方物流接口報警推送 4、修改訂單狀態報警推送 5、打印邏輯優化
Signed-off-by: Wyh <1239658231>
parent
6bdf3095
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
319 additions
and
418 deletions
+319
-418
base-module/src/main/java/com/gingersoft/gsa/cloud/base/adapter/print/FoodAdapter.java
+29
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
+2
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/okhttpUtils/OkHttp3Utils.java
+19
-3
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/AppConstans.java
+5
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/PrintConstans.java
+12
-1
base-module/src/main/res/drawable-xhdpi/img_login_top_bg.png
+0
-0
base-module/src/main/res/layout/print_layout_print.xml
+0
-2
config.gradle
+2
-2
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/presenter/BaseLoginPresenter.java
+5
-1
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+3
-1
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
+1
-1
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
+1
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/HistoryOrderViewModel.kt
+1
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+36
-10
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
+1
-16
print-module/src/main/java/com/joe/print/mvp/presenter/PrintPresenter.java
+0
-22
print-module/src/main/java/com/joe/print/mvp/print/EpsonPrint.java
+46
-9
print-module/src/main/java/com/joe/print/mvp/print/PrintBill.java
+2
-99
print-module/src/main/java/com/joe/print/mvp/print/PrintKitchen.java
+4
-4
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrder.java
+2
-85
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
+1
-1
print-module/src/main/java/com/joe/print/mvp/print/PrintPrjKitchen.java
+6
-6
print-module/src/main/java/com/joe/print/mvp/print/PrintServe.java
+36
-14
print-module/src/main/java/com/joe/print/mvp/print/PrintSlip.java
+34
-71
print-module/src/main/java/com/joe/print/mvp/print/PrintTest.java
+3
-3
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
+39
-24
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
+2
-2
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
+2
-2
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintTestActivity.java
+0
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
+6
-6
print-module/src/main/res/layout/activity_print_test.xml
+10
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+2
-14
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+2
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/orderManager/AllOrderPresenter.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
+1
-1
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/adapter/print/FoodAdapter.java
View file @
70cf3b69
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
adapter
.
print
;
import
android.graphics.Typeface
;
import
android.text.TextPaint
;
import
android.text.style.StyleSpan
;
import
android.view.View
;
import
android.widget.TextView
;
import
androidx.annotation.Nullable
;
...
...
@@ -12,7 +11,6 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
java.util.List
;
...
...
@@ -29,6 +27,29 @@ public class FoodAdapter extends BaseQuickAdapter<OrderDetail, BaseViewHolder> {
private
int
modifierIsItalic
=
2
;
private
int
numberIsFlip
=
2
;
//熱敏打印沒有顏色,翻轉用不了
private
boolean
showPrice
=
true
;
public
FoodAdapter
(
@Nullable
List
<
OrderDetail
>
data
,
PrinterDeviceBean
deviceBean
,
boolean
showPrice
)
{
super
(
R
.
layout
.
print_item_food
,
data
);
try
{
this
.
foodFontSize
=
Integer
.
parseInt
(
deviceBean
.
getFoodFont
())
*
2
;
this
.
modifierFontSize
=
Integer
.
parseInt
(
deviceBean
.
getModifierFont
())
*
2
;
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
}
this
.
foodIsBold
=
deviceBean
.
getFoodIsBold
();
this
.
modifierIsBold
=
deviceBean
.
getModifierIsBold
();
this
.
foodIsItalic
=
deviceBean
.
getFoodIsItalic
();
this
.
modifierIsItalic
=
deviceBean
.
getModifierIsItalic
();
this
.
numberIsFlip
=
deviceBean
.
getNumberIsFlip
();
this
.
showPrice
=
showPrice
;
}
/**
*
* @param data
* @param deviceBean 打印機信息
*/
public
FoodAdapter
(
@Nullable
List
<
OrderDetail
>
data
,
PrinterDeviceBean
deviceBean
)
{
super
(
R
.
layout
.
print_item_food
,
data
);
try
{
...
...
@@ -54,6 +75,11 @@ public class FoodAdapter extends BaseQuickAdapter<OrderDetail, BaseViewHolder> {
TextView
tvFoodName
=
helper
.
getView
(
R
.
id
.
tv_food_name
);
TextView
tvNum
=
helper
.
getView
(
R
.
id
.
tv_food_quantity
);
TextView
tvPrice
=
helper
.
getView
(
R
.
id
.
tv_food_price
);
if
(
showPrice
){
tvPrice
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tvPrice
.
setVisibility
(
View
.
GONE
);
}
boolean
isBold
,
isItalic
;
if
(
item
.
getItemType
()
==
2
)
{
//細項,縮進
...
...
@@ -98,7 +124,6 @@ public class FoodAdapter extends BaseQuickAdapter<OrderDetail, BaseViewHolder> {
tvNum
.
setTypeface
(
null
,
Typeface
.
NORMAL
);
tvPrice
.
setTypeface
(
null
,
Typeface
.
NORMAL
);
}
// tvFoodName.setTypeface(null, Typeface.BOLD_ITALIC);
// tvFoodName.setTypeface(null, Typeface.BOLD);
// tvFoodName.setTypeface(null, Typeface.ITALIC);
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
View file @
70cf3b69
...
...
@@ -717,10 +717,10 @@ public class OrderDetail implements Serializable {
* 是否打印
*
* @param printTo
* @param type
* @param type
食品清單還是賬單 0 食品清單,1 賬單
* @return
*/
p
rivate
static
boolean
isPrint
(
int
printTo
,
int
type
)
{
p
ublic
static
boolean
isPrint
(
int
printTo
,
int
type
)
{
if
(
printTo
==
0
)
{
//清單和賬單都打印
return
true
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/okhttpUtils/OkHttp3Utils.java
View file @
70cf3b69
...
...
@@ -3,8 +3,9 @@ package com.gingersoft.gsa.cloud.base.utils.okhttpUtils;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Aes
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor
;
import
com.jess.arms.utils.DeviceUtils
;
...
...
@@ -15,10 +16,10 @@ import java.util.List;
import
java.util.concurrent.TimeUnit
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableEmitter
;
import
io.reactivex.ObservableOnSubscribe
;
import
io.reactivex.schedulers.Schedulers
;
import
okhttp3.Call
;
import
okhttp3.Callback
;
import
okhttp3.FormBody
;
import
okhttp3.Headers
;
import
okhttp3.Interceptor
;
import
okhttp3.MediaType
;
...
...
@@ -251,4 +252,19 @@ public class OkHttp3Utils {
}
/**
* 心跳接口報錯,推送給相關人員
*/
public
static
void
noticePersonnel
(
String
errCode
,
String
pushContent
)
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"code"
,
errCode
)
//錯誤碼
.
add
(
"shopId"
,
GsaCloudApplication
.
getGsPosShopId
(
GsaCloudApplication
.
getAppContext
()))
.
add
(
"source"
,
GsaCloudApplication
.
getAppName
()
+
""
)
//錯誤來源
.
add
(
"pushContent"
,
pushContent
+
""
)
//推送內容
.
add
(
"version"
,
DeviceUtils
.
getVersionName
(
GsaCloudApplication
.
getAppContext
()))
//系統版本
.
build
();
OkHttp3Utils
.
post
(
HttpsConstans
.
ROOT_URL
+
"/member-web/api/monitor/pushAlarm"
,
requestBody
)
.
subscribeOn
(
Schedulers
.
io
()).
subscribe
();
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/AppConstans.java
View file @
70cf3b69
...
...
@@ -5,8 +5,11 @@ package com.gingersoft.gsa.cloud.constans;
*/
public
class
AppConstans
{
public
static
final
String
RP_HEART_ERROR
=
"RP_HD"
;
//心跳斷開錯誤碼
public
static
final
String
RP_ORDER_LIST_ERROR
=
"RP_OL"
;
//訂單列表錯誤碼
public
static
final
String
RP_HEART_ERROR
=
"RP_HD001"
;
//心跳斷開錯誤碼
public
static
final
String
RP_ORDER_LIST_ERROR
=
"RP_OL002"
;
//訂單列表錯誤碼
public
static
final
String
RP_THIRE_LOGISTICS_ERROR
=
"RP_WL003"
;
//訂單列表錯誤碼
public
static
final
String
RP_UPDATE_ORDER_STATE_ERROR
=
"RP_UO_"
;
//修改訂單狀態失敗錯誤碼
public
static
final
String
RP_LOGIN_ERROR
=
"RP_LOGIN"
;
//修改訂單狀態失敗錯誤碼
public
static
final
String
SECRETKEY_VALUES
=
"2309485937845783"
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
View file @
70cf3b69
...
...
@@ -36,7 +36,7 @@ public class HttpsConstans {
//--------------------------------------------其他全局----------------------------------------------------------------------------
private
static
String
HTTP_ADDRESS_URL_FORMAL
=
"https://m.ricepon.com:8444"
;
//正式服務器
private
static
String
HTTP_ADDRESS_URL_SZ
=
"http://gingersoft.tpddns.cn:58201"
;
//深圳測試
private
static
String
HTTP_ADDRESS_URL_HK
=
"http
s
://a.ricepon.com:58201"
;
//香港測試
private
static
String
HTTP_ADDRESS_URL_HK
=
"http://a.ricepon.com:58201"
;
//香港測試
private
static
String
PATH
=
"/ricepon-cloud-gsa/api/"
;
//路徑
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/PrintConstans.java
View file @
70cf3b69
...
...
@@ -27,7 +27,18 @@ public class PrintConstans {
* 6:開錢箱
* 7:外賣接單結賬單
*/
public
static
final
String
PRINT_TYPE
=
"type"
;
//打印類型
public
static
final
String
PRINT_TYPE
=
"
print_
type"
;
//打印類型
public
static
final
String
PRINT_LOADING
=
"is_show_loading"
;
//是否顯示加載框
public
final
static
int
PRINT_TEST
=
-
1
;
//測試頁
public
final
static
int
PRINT_SERVE
=
0
;
//上菜紙
public
final
static
int
PRINT_SLIP
=
1
;
//印單
public
final
static
int
PRINT_BILL
=
2
;
//結賬單
public
final
static
int
PRINT_KITCHEN
=
3
;
//送單,廚房單
public
final
static
int
PRINT_CLEAN_MACHINE
=
4
;
//清機報表 或者其他View
public
final
static
int
PRINT_OTHER_ORDER
=
5
;
//接單內容打印 外送印單
public
final
static
int
PRINT_INSTRUCTION
=
6
;
//開錢箱
public
final
static
int
PRINT_OTHER_CLOSING
=
7
;
//外賣結賬單
}
base-module/src/main/res/drawable-xhdpi/img_login_top_bg.png
View file @
70cf3b69
63.6 KB
|
W:
|
H:
84.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
base-module/src/main/res/layout/print_layout_print.xml
View file @
70cf3b69
...
...
@@ -98,7 +98,6 @@
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"單號:"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/layout_table_name"
/>
...
...
@@ -254,7 +253,6 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"2020-01-09 上午 11:16:15"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
...
...
config.gradle
View file @
70cf3b69
...
...
@@ -7,8 +7,8 @@ ext {
targetSdkVersion
:
28
,
//正式版: 1.0.3 3
//內部測試版:1.1.7 17
versionCode
:
1
8
,
versionName
:
"1.1.
8
"
versionCode
:
1
9
,
versionName
:
"1.1.
9
"
]
version
=
[
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/presenter/BaseLoginPresenter.java
View file @
70cf3b69
...
...
@@ -4,8 +4,9 @@ import android.app.Activity;
import
android.app.Application
;
import
android.content.Intent
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.gingersoft.gsa.cloud.login.mvp.contract.BaseLoginContract
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
...
...
@@ -84,6 +85,8 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
}
else
{
GsaCloudApplication
.
isLogin
=
false
;
mRootView
.
showMessage
(
info
.
getErrMsg
());
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_LOGIN_ERROR
,
info
.
getErrMsg
());
if
(
IAcitivity
instanceof
LoginActivity
)
{
}
else
{
...
...
@@ -95,6 +98,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_LOGIN_ERROR
,
t
.
getMessage
());
if
(
IAcitivity
instanceof
LoginActivity
)
{
}
else
{
mRootView
.
launchActivity
(
new
Intent
(
IAcitivity
,
LoginActivity
.
class
));
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
View file @
70cf3b69
...
...
@@ -245,10 +245,12 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
}
@Override
public
void
showMessage
(
@NonNull
String
message
)
{
public
void
showMessage
(
String
message
)
{
if
(
message
!=
null
)
{
checkNotNull
(
message
);
ArmsUtils
.
makeText
(
this
,
message
);
}
}
@Override
public
void
launchActivity
(
@NonNull
Intent
intent
)
{
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
View file @
70cf3b69
...
...
@@ -583,7 +583,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
//清機成功,打印
PrintTransitUtils
.
getInstance
().
setPrintView
(
view
);
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
4
)
//清機打印
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_CLEAN_MACHINE
)
//清機打印
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
View file @
70cf3b69
...
...
@@ -348,7 +348,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
//清機成功,打印
PrintTransitUtils
.
getInstance
().
setPrintView
(
view
);
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
4
)
//清機打印
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_CLEAN_MACHINE
)
//清機打印
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/HistoryOrderViewModel.kt
View file @
70cf3b69
...
...
@@ -91,7 +91,7 @@ class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepo
orderDetails
.
data
!!
[
0
].
orderPayType
=
data
.
orderPayType
MyOrderManage
.
setDataBean
(
orderDetails
.
data
!!
[
0
])
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
5
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_OTHER_ORDER
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
{
_
,
result
->
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
70cf3b69
...
...
@@ -17,6 +17,8 @@ import com.billy.cc.core.component.CC
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
import
com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
...
...
@@ -129,17 +131,18 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
fun
getOrderList
(
restaurantId
:
String
,
position
:
Int
,
page
:
String
,
isLoadMore
:
Boolean
)
{
launch
({
repository
.
requestOrderList
(
restaurantId
,
fragmentStatus
[
position
],
fragmentType
[
position
],
page
,
orderNo
,
phone
).
apply
{
// throw NullPointerException("測試獲取訂單列表異常")
// throw NullPointerException("測試獲取訂單列表異常")
if
(
isSuccess
())
{
getOrderGroupNum
(
restaurantId
)
loadInfo
(
isLoadMore
,
position
)
}
else
{
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_ORDER_LIST_ERROR
,
"獲取訂單列表失敗"
)
}
}
},
{
//出錯
mOrderList
[
position
].
value
=
null
launch
({
repository
.
noticePersonnel
(
it
.
message
,
AppConstans
.
RP_ORDER_LIST_ERROR
)
},{
})
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_ORDER_LIST_ERROR
,
it
.
message
)
OtherOrderUtils
.
initSoundPool
(
GsaCloudApplication
.
getAppContext
(),
R
.
raw
.
raw_get_order_list_error
)
})
}
...
...
@@ -226,7 +229,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
var
orderDetails
=
MutableLiveData
<
OrderDetails
>()
//
待优化,将订单详情和物流送达时间分开,通过监听者通知更新物流时间
//
獲取訂單詳情和物流送達時間
fun
getShipanyAndOrderInfo
(
restaurantId
:
String
,
orderId
:
String
)
{
launch
({
withContext
(
Dispatchers
.
IO
)
{
...
...
@@ -306,6 +309,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
thirdSend
(
restaurantId
,
dataBean
,
2
,
listener
)
}
else
{
updateOrderAndPrint
(
restaurantId
,
dataBean
,
2
,
listener
)
//fantasy
}
}
}
...
...
@@ -354,6 +358,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 修改訂單狀態並打印
*/
private
suspend
fun
updateOrderAndPrint
(
restaurantId
:
String
,
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
listener
:
(
MessageBean
)
->
Unit
)
{
launch
({
repository
.
gsUpdateOrderStatus
(
dataBean
.
ID
.
toString
(),
status
,
dataBean
.
order_type
,
1
,
""
,
""
,
""
,
"0"
,
""
,
1
,
0
).
apply
{
if
(
status
==
0
||
status
==
1
||
status
==
2
)
{
//確認送單
...
...
@@ -406,10 +411,15 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
}
else
{
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_UPDATE_ORDER_STATE_ERROR
,
errorMsg
)
listener
.
invoke
(
getMsgBean
(
OrderDelivery
,
errorMsg
,
false
))
}
}
}
},
{
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_UPDATE_ORDER_STATE_ERROR
+
status
,
it
.
message
)
listener
.
invoke
(
getMsgBean
(
OrderDelivery
,
""
,
false
))
})
}
/**
...
...
@@ -419,7 +429,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//訂單信息和廚房單,打印前需要修改dataBean的order_type和orderPayType
MyOrderManage
.
setDataBean
(
dataBean
)
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
5
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_OTHER_ORDER
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
{
_
,
result
->
...
...
@@ -434,7 +444,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
private
fun
printOrderClosing
(
dataBean
:
OrderDetails
.
DataBean
,
listener
:
(
Int
,
Boolean
)
->
Unit
)
{
MyOrderManage
.
setDataBean
(
dataBean
)
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
7
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_OTHER_CLOSING
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
{
_
,
result
->
...
...
@@ -455,7 +465,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
// Log.e("eee", "錯誤信息222:" + it.message)
// })
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
6
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_INSTRUCTION
)
.
addParam
(
PrintConstans
.
PRINT_LOADING
,
false
)
.
setActionName
(
"printActivity"
)
.
build
()
...
...
@@ -481,15 +491,25 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
third
.
add
(
thirdItem
)
}
}
launch
({
//調用第三方物流接口
repository
.
thirdDelivery
(
dataBean
.
ID
.
toString
(),
third
).
apply
{
if
(
success
)
{
// listener.invoke(OrderDelivery, true)
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
listener
)
}
else
{
}
else
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
errMsg
))
{
listener
.
invoke
(
getMsgBean
(
OrderDelivery
,
errMsg
,
false
))
//第三方物流接口異常
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_THIRE_LOGISTICS_ERROR
,
errMsg
)
}
else
{
listener
.
invoke
(
getMsgBean
(
OrderDelivery
,
"指派物流失敗"
,
false
))
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_THIRE_LOGISTICS_ERROR
,
"第三方物流失敗"
)
}
}
},
{
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_THIRE_LOGISTICS_ERROR
,
it
.
message
)
listener
.
invoke
(
getMsgBean
(
OrderDelivery
,
""
,
false
))
})
}
/**
...
...
@@ -700,6 +720,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
fun
noticePersonnel
(
pushContent
:
String
?,
code
:
String
)
{
launch
({
repository
.
noticePersonnel
(
pushContent
,
code
)
},
{
})
}
private
fun
launch
(
block
:
suspend
()
->
Unit
,
error
:
suspend
(
Throwable
)
->
Unit
)
=
viewModelScope
.
launch
{
try
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
View file @
70cf3b69
...
...
@@ -267,7 +267,7 @@ class GetInfoUpdateService : Service() {
initSoundPool
(
R
.
raw
.
raw_disconnect
)
myBind
?.
block
?.
invoke
(
true
)
//推送給相關人員
noticePersonnel
(
t
.
message
)
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_HEART_ERROR
,
t
.
message
)
},
10
)
putTimeLog
(
"onFailure連接失敗,等待一分鐘後重新連接"
)
}
...
...
@@ -344,21 +344,6 @@ class GetInfoUpdateService : Service() {
.
subscribeOn
(
Schedulers
.
io
()).
subscribe
()
}
/**
* 心跳接口報錯,推送給相關人員
*/
private
fun
noticePersonnel
(
pushContent
:
String
?){
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"code"
,
AppConstans
.
RP_HEART_ERROR
)
//錯誤碼
.
add
(
"shopId"
,
GsaCloudApplication
.
getGsPosShopId
(
this
))
.
add
(
"source"
,
getString
(
R
.
string
.
app_name
))
//錯誤來源
.
add
(
"pushContent"
,
pushContent
+
""
)
//推送內容
.
add
(
"version"
,
DeviceUtils
.
getVersionName
(
this
))
//系統版本
.
build
()
OkHttp3Utils
.
post
(
HttpsConstans
.
ROOT_URL
+
"/member-web/api/monitor/pushAlarm"
,
requestBody
)
.
subscribeOn
(
Schedulers
.
io
()).
subscribe
()
}
inner
class
ClearHeartBroadcastReceiver
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
//關閉service,會調用service的onDestroy
...
...
print-module/src/main/java/com/joe/print/mvp/presenter/PrintPresenter.java
View file @
70cf3b69
...
...
@@ -166,26 +166,4 @@ public class PrintPresenter extends BasePresenter<PrintContract.Model, PrintCont
return
printerDeviceBean
;
}
public
PrinterRoot
getPrinterByType
(
int
type
)
{
if
(
type
==
PrinterRoot
.
PRINT_TEST
)
{
return
new
PrintTest
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_SERVE
)
{
return
new
PrintServe
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_SLIP
)
{
return
new
PrintSlip
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_BILL
)
{
return
new
PrintBill
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_KITCHEN
)
{
return
new
PrintPrjKitchen
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_CLEAN_MACHINE
)
{
return
new
PrintCleanMachine
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_OTHER_ORDER
)
{
return
new
PrintOtherOrder
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_INSTRUCTION
)
{
return
new
PrintInstruction
();
}
else
if
(
type
==
PrinterRoot
.
PRINT_OTHER_CLOSING
)
{
return
new
PrintOtherOrderClosing
();
}
return
null
;
}
}
print-module/src/main/java/com/joe/print/mvp/print/EpsonPrint.java
View file @
70cf3b69
...
...
@@ -8,6 +8,7 @@ import com.epson.epos2.Epos2Exception;
import
com.epson.epos2.printer.Printer
;
import
com.epson.epos2.printer.PrinterStatusInfo
;
import
com.epson.epos2.printer.ReceiveListener
;
import
com.gingersoft.gsa.cloud.print.PrintExecutor
;
import
com.joe.print.mvp.model.bean.PrintInfoBean
;
import
com.joe.print.mvp.print.utils.MyPrintUtils
;
...
...
@@ -266,6 +267,43 @@ public class EpsonPrint implements ReceiveListener {
}
}
public
void
putPrintString
(
String
ip
,
int
paperWidth
,
List
<
PrintInfoBean
>
printInfoBeans
,
PrintExecutor
.
OnPrintResultListener
printResultListener
)
{
if
(
mPrinter
==
null
)
{
printResultListener
.
onResult
(
0
,
null
);
return
;
}
connectByIp
(
ip
,
mPrinter
.
getStatus
());
if
(
mPrinter
==
null
)
{
printResultListener
.
onResult
(
0
,
null
);
return
;
}
mPrinter
.
clearCommandBuffer
();
try
{
for
(
PrintInfoBean
printInfoBean
:
printInfoBeans
)
{
if
(
printInfoBean
.
getGravity
()
==
0
)
{
mPrinter
.
addTextAlign
(
Printer
.
ALIGN_LEFT
);
}
if
(
printInfoBean
.
getGravity
()
==
1
)
{
mPrinter
.
addTextAlign
(
Printer
.
ALIGN_CENTER
);
}
if
(
printInfoBean
.
getGravity
()
==
2
)
{
mPrinter
.
addTextAlign
(
Printer
.
ALIGN_RIGHT
);
}
//如果打印多列內容,並且字體大小配置多個,則每一列取自己對應的字體大小
for
(
int
i
=
0
;
i
<
printInfoBean
.
getContent
().
length
;
i
++)
{
print
(
printInfoBean
,
i
,
paperWidth
);
}
mPrinter
.
addFeedLine
(
1
);
}
mPrinter
.
addPulse
(
Printer
.
DRAWER_LOW
,
Printer
.
PULSE_100
);
mPrinter
.
addCut
(
Printer
.
CUT_FEED
);
mPrinter
.
sendData
(
Printer
.
PARAM_DEFAULT
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
printResultListener
.
onResult
(
0
,
null
);
mPrinter
.
clearCommandBuffer
();
}
}
private
int
location
=
0
;
private
void
print
(
PrintInfoBean
printInfoBean
,
int
i
,
int
paperWidth
)
throws
Epos2Exception
{
...
...
@@ -301,21 +339,21 @@ public class EpsonPrint implements ReceiveListener {
private
void
setLanguage
(
String
language
)
throws
Epos2Exception
{
if
(
"en"
.
equals
(
language
))
{
//切換對應語言
mPrinter
.
addTextLang
(
Printer
.
LANG_EN
);
mPrinter
.
addTextLang
(
Printer
.
LANG_EN
);
//英语
}
else
if
(
"ja"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_JA
);
mPrinter
.
addTextLang
(
Printer
.
LANG_JA
);
//日本
}
else
if
(
"cn"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_ZH_CN
);
mPrinter
.
addTextLang
(
Printer
.
LANG_ZH_CN
);
//简体
}
else
if
(
"tw"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_ZH_TW
);
mPrinter
.
addTextLang
(
Printer
.
LANG_ZH_TW
);
//台湾
}
else
if
(
"ko"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_KO
);
mPrinter
.
addTextLang
(
Printer
.
LANG_KO
);
//韩语
}
else
if
(
"th"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_TH
);
mPrinter
.
addTextLang
(
Printer
.
LANG_TH
);
//泰国
}
else
if
(
"vi"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_VI
);
mPrinter
.
addTextLang
(
Printer
.
LANG_VI
);
//越南
}
else
if
(
"multi"
.
equals
(
language
))
{
mPrinter
.
addTextLang
(
Printer
.
LANG_MULTI
);
mPrinter
.
addTextLang
(
Printer
.
LANG_MULTI
);
//其他
}
}
...
...
@@ -436,7 +474,6 @@ public class EpsonPrint implements ReceiveListener {
Log
.
e
(
TAG
,
"connection->"
+
connection
+
"|online->"
+
online
+
"|coverOpen->"
+
coverOpen
+
"|paper->"
+
paper
+
"|paperFeed->"
+
paperFeed
+
"|panelSwitch->"
+
panelSwitch
+
"|waitOnline->"
+
waitOnline
+
"|drawer->"
+
drawer
+
"|errorStatus->"
+
errorStatus
+
"|autoRecoverError->"
+
autoRecoverError
+
"|buzzer->"
+
buzzer
+
"|adapter->"
+
adapter
+
"|batteryLevel->"
+
batteryLevel
);
}
private
boolean
connectPrinter
(
String
ip
)
{
if
(
mPrinter
==
null
)
{
return
false
;
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintBill.java
View file @
70cf3b69
...
...
@@ -2,29 +2,17 @@ package com.joe.print.mvp.print;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.base.adapter.print.BillAdapter
;
import
com.gingersoft.gsa.cloud.base.adapter.print.BillTypeAdapter
;
import
com.gingersoft.gsa.cloud.base.adapter.print.FoodAdapter
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillOrderMoney
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillingBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.base.utils.view.ImageUtils
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.joe.print.R
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
...
...
@@ -33,7 +21,7 @@ import java.util.List;
import
java.util.Map
;
/**
* 結賬單
* 結賬單
已改新版
*/
public
class
PrintBill
extends
PrinterRoot
{
...
...
@@ -51,90 +39,6 @@ public class PrintBill extends PrinterRoot {
return
1
;
}
/**
* 獲取"結賬單"圖片
*
* @param context
* @return
*/
private
Bitmap
getServeBitmap
(
Context
context
)
{
List
<
OrderDetail
>
foodList
=
MyOrderManage
.
getInstance
().
getOrderFoodList
();
TableBean
.
DataBean
tableBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
if
(
foodList
==
null
||
foodList
.
size
()
<=
0
||
tableBean
==
null
)
{
return
null
;
}
View
view
=
LinearLayout
.
inflate
(
context
,
R
.
layout
.
print_layout_print_bill
,
null
);
TextView
brandName
=
view
.
findViewById
(
R
.
id
.
tv_brand_name
);
TextView
restaurantName
=
view
.
findViewById
(
R
.
id
.
tv_restaurant_name
);
TextView
topOrderNum
=
view
.
findViewById
(
R
.
id
.
tv_print_bill_order_num
);
//頂部的訂單號
TextView
tableNum
=
view
.
findViewById
(
R
.
id
.
tv_dining_table_number
);
TextView
people
=
view
.
findViewById
(
R
.
id
.
tv_people
);
TextView
orderNum
=
view
.
findViewById
(
R
.
id
.
tv_order_num
);
TextView
orderData
=
view
.
findViewById
(
R
.
id
.
tv_date
);
RecyclerView
rvFood
=
view
.
findViewById
(
R
.
id
.
rv_food
);
RecyclerView
rvBillAmount
=
view
.
findViewById
(
R
.
id
.
rv_bill_amount
);
TextView
mTvTotalAmount
=
view
.
findViewById
(
R
.
id
.
tv_total_amount
);
TextView
checkOutTime
=
view
.
findViewById
(
R
.
id
.
tv_checkout_time
);
TextView
line_food_info
=
view
.
findViewById
(
R
.
id
.
line_food_info
);
RecyclerView
rvPayType
=
view
.
findViewById
(
R
.
id
.
rv_print_pay_type
);
//顯示支付方式
brandName
.
setText
(
GsaCloudApplication
.
getBrandName
(
context
));
restaurantName
.
setText
(
GsaCloudApplication
.
getRestaurantName
(
context
));
tableNum
.
setText
(
tableBean
.
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
orderData
.
setText
(
TimeUtils
.
parseTimeRepeat
(
tableBean
.
getCreateTime
(),
TimeUtils
.
DEFAULT_DATE_FORMAT
));
checkOutTime
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
FoodAdapter
foodAdapter
=
new
FoodAdapter
(
foodList
);
rvFood
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvFood
.
setAdapter
(
foodAdapter
);
List
<
BillingBean
>
billingBeans
=
new
ArrayList
<>();
//添加合計項
billingBeans
.
add
(
new
BillingBean
(
"合計"
,
MyOrderManage
.
getInstance
().
getWholeAmount
()));
//添加其他金額項
if
(
MyOrderManage
.
getInstance
().
getOrderMoneyList
().
size
()
>
0
)
{
for
(
BillOrderMoney
item
:
MyOrderManage
.
getInstance
().
getOrderMoneyList
())
{
billingBeans
.
add
(
new
BillingBean
(
item
.
getTitle
(),
item
.
getMoney
()));
}
}
if
(
billingBeans
.
size
()
<=
0
)
{
line_food_info
.
setVisibility
(
View
.
GONE
);
}
else
{
BillAdapter
billAdapter
=
new
BillAdapter
(
billingBeans
);
rvBillAmount
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvBillAmount
.
setAdapter
(
billAdapter
);
}
if
(
OpenTableManage
.
getDefault
().
getTableBean
()
!=
null
)
{
tableNum
.
setText
(
OpenTableManage
.
getDefault
().
getTableBean
().
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
}
if
(
MyOrderManage
.
getInstance
().
getOrderId
()
!=
-
1
)
{
orderNum
.
setText
(
MyOrderManage
.
getInstance
().
getOrderId
()
+
""
);
}
// BigDecimal totalAmount = new BigDecimal(0);
// for (OrderDetail OrderDetail : MyOrderManage.getInstance().getOrderFoodList()) {
// totalAmount = MoneyUtil.sum(totalAmount, OrderDetail.getPrice());
// }
//總金額
mTvTotalAmount
.
setText
(
MyOrderManage
.
getInstance
().
getTotalAmount
()
+
""
);
List
<
PayMethod
>
payBillMoneys
=
MyOrderManage
.
getInstance
().
getBillMoney
();
rvPayType
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvPayType
.
setAdapter
(
new
BillTypeAdapter
(
payBillMoneys
));
//加载条形码
// ImageView ivBarCode = view.findViewById(R.id.iv_bar_code);
// ivBarCode.setImageBitmap(BitmapUtil.generateBitmap("12312112131", 2, 450, 150));
return
viewToBitmap
(
context
,
view
);
}
private
Bitmap
getBitmap
(
Context
mContext
,
PrinterDeviceBean
deviceBean
)
{
List
<
OrderDetail
>
foodList
=
MyOrderManage
.
getInstance
().
getOrderFoodList
();
TableBean
.
DataBean
tableBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
...
...
@@ -158,7 +62,7 @@ public class PrintBill extends PrinterRoot {
layout
.
addView
(
getLine
(
mContext
));
//食品信息
layout
.
addView
(
getDiningFoodList
(
mContext
,
foodList
,
deviceBean
));
layout
.
addView
(
getDiningFoodList
(
mContext
,
foodList
,
deviceBean
,
1
,
true
));
layout
.
addView
(
getHalfLine
(
mContext
));
//訂單金額信息
...
...
@@ -181,7 +85,6 @@ public class PrintBill extends PrinterRoot {
totalAmount
=
MoneyUtil
.
sum
(
totalAmount
,
OrderDetail
.
getPrice
());
}
layout
.
addView
(
getAmountText
(
mContext
,
"總金額:"
+
totalAmount
));
// layout.addView();
layout
.
addView
(
getLine
(
mContext
));
layout
.
addView
(
getDiningBillPayMethod
(
mContext
,
MyOrderManage
.
getInstance
().
getBillMoney
()));
layout
.
addView
(
getLine
(
mContext
));
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintKitchen.java
View file @
70cf3b69
...
...
@@ -112,11 +112,11 @@ public class PrintKitchen extends PrinterRoot {
for
(
OrderDetail
orderDetail
:
entry
.
getValue
())
{
List
<
OrderDetail
>
orders
=
new
ArrayList
<>();
//這裡new集合是因為下面的方法需要的參數是list集合
orders
.
add
(
orderDetail
);
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
orders
);
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
orders
,
deviceBean
);
bitmaps
.
add
(
bitmap
);
}
}
else
{
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
entry
.
getValue
());
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
entry
.
getValue
()
,
deviceBean
);
//不帶*號,所有同樣廚房位置的食品都在一張紙上
bitmaps
.
add
(
bitmap
);
}
...
...
@@ -147,7 +147,7 @@ public class PrintKitchen extends PrinterRoot {
* @param context
* @return
*/
private
Bitmap
getKitChenPrintBitmap
(
Context
context
,
List
<
OrderDetail
>
foodList
)
{
private
Bitmap
getKitChenPrintBitmap
(
Context
context
,
List
<
OrderDetail
>
foodList
,
PrinterDeviceBean
printerDeviceBean
)
{
if
(
foodList
==
null
||
foodList
.
size
()
<=
0
)
{
return
null
;
}
...
...
@@ -188,7 +188,7 @@ public class PrintKitchen extends PrinterRoot {
tvOrderTime
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
//操作人員
tvOperator
.
setText
(
GsaCloudApplication
.
userName
);
return
viewTo
Bitmap
(
context
,
view
);
return
viewTo
ZoomBitmap
(
context
,
view
,
printerDeviceBean
);
}
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrder.java
View file @
70cf3b69
...
...
@@ -33,7 +33,7 @@ import java.util.Map;
import
java.util.Objects
;
/**
* 外送接單,印單
* 外送接單,印單
已改新版
*/
public
class
PrintOtherOrder
extends
PrinterRoot
{
...
...
@@ -48,89 +48,6 @@ public class PrintOtherOrder extends PrinterRoot {
//再將食品數據根據打印位置分組。
//打印一組之後,關閉連接,切換第二台打印機ip,如此循環
//打印完成之後,返回所有打印結果。
// Map<String, List<OrderDetails.DataBean.PRODUCTNAMEBean>> foodMaps = new HashMap<>();
// String emptyPrintLocation = "";//部分食品沒有打印位置時設置為此key,比如這是第一個食品,沒有打印位置時
// int lastEmptyPrintLocationIndex = 0;//上一次遍歷到第一個食品時都沒有打印位置時,開始的食品位置
// //獲取這個訂單的一級食品
// if (dataBean.getPRODUCT_NAME() != null) {
// for (int i = 0; i < dataBean.getPRODUCT_NAME().size(); i++) {
// OrderDetails.DataBean.PRODUCTNAMEBean food = dataBean.getPRODUCT_NAME().get(i);
// if (TextUtil.isEmptyOrNullOrUndefined(food.getPrintseting())) {
// //如果沒有打印位置,向上尋找
// if (i == 0) {
// food.setPrintseting(emptyPrintLocation);
// addToMap(foodMaps, food);
// } else {
// for (int j = i - 1; j >= lastEmptyPrintLocationIndex; j--) {
// //一直遍歷,直到找到有打印位置的食品
// // 如果所有食品都沒有打印位置的情況,為了避免多次遍歷
// // 如果本次遍歷到第一個食品,都沒有打印位置,記錄下這一次開始遍歷的下標,下一次遍歷到這個位置就停止
// if (!TextUtil.isEmptyOrNullOrUndefined(dataBean.getPRODUCT_NAME().get(j).getPrintseting())) {
// //一直遍歷,直到找到有打印位置的食品
// //判斷是否帶*號
// if (Objects.requireNonNull(dataBean.getPRODUCT_NAME().get(j).getPrintseting()).contains("*")) {
// //帶*號,則需要取得通過下標加去掉*號的標識來取得map中的集合,將i食品裝進去,這樣就能打印在一張紙上
// //如果沒取得集合,則通過打印位置去map取得集合,將j食品從map中移除,將這個j食品的和i食品裝一起
// // 生成新的key。為當前下標+"標識符"+去掉*的打印位置,不帶*的key取得的食品集合才能打印在一張紙上。
// String newKey = j + DELIMITER + dataBean.getPRODUCT_NAME().get(j).getPrintseting().replaceAll("\\*", "");
// //通過newKey取得map中的集合
// List<OrderDetails.DataBean.PRODUCTNAMEBean> newKeyfoods = foodMaps.get(newKey);
// if (newKeyfoods != null) {
// newKeyfoods.add(food);
// } else {
// List<OrderDetails.DataBean.PRODUCTNAMEBean> printsetingFoods = foodMaps.get(dataBean.getPRODUCT_NAME().get(j).getPrintseting());
// if (printsetingFoods != null) {//理論上不會為空
// printsetingFoods.remove(printsetingFoods.lastIndexOf(dataBean.getPRODUCT_NAME().get(j)));
// //移除掉之後,put到newkey中
// List<OrderDetails.DataBean.PRODUCTNAMEBean> newFoods = new ArrayList<>();
// newFoods.add(dataBean.getPRODUCT_NAME().get(j));
// newFoods.add(food);
// foodMaps.put(newKey, newFoods);
// }
// }
// break;
// } else {
// //沒有*號,不需要做多餘的操作
// food.setPrintseting(dataBean.getPRODUCT_NAME().get(j).getPrintseting());
// addToMap(foodMaps, food);
// }
// } else if (j == lastEmptyPrintLocationIndex) {
// //從i到0的打印位置都沒有,記錄下i,下次只遍歷到i就停下來
// lastEmptyPrintLocationIndex = i;
// //如果找到最初的那個食品,也沒有打印位置,設置打印位置為"null"
// food.setPrintseting(emptyPrintLocation);
// addToMap(foodMaps, food);
// }
// }
// }
// } else {
// //有打印位置,
// //已經保存過這個位置的,
// addToMap(foodMaps, food);
// }
// }
// }
// //通過打印位置生成多張用於打印的bitmap
// for (Map.Entry<String, List<OrderDetails.DataBean.PRODUCTNAMEBean>> entry : foodMaps.entrySet()) {
// String key = entry.getKey();
// List<Bitmap> bitmaps = new ArrayList<>();
// if (key.contains("*")) {
// //如果帶*號,這個集合就需要切紙,每個食品都需要單獨在一張廚房單上
// for (OrderDetails.DataBean.PRODUCTNAMEBean orderDetail : entry.getValue()) {
// List<OrderDetails.DataBean.PRODUCTNAMEBean> orders = new ArrayList<>();//這裡new集合是因為下面的方法需要的參數是list集合
// orders.add(orderDetail);
// //獲取廚房單圖片
// Bitmap bitmap = getOrderKitchenBitmap(mContext, orders, dataBean);
// bitmaps.add(bitmap);
// }
// } else {
// //獲取廚房單圖片
// Bitmap bitmap = getOrderKitchenBitmap(mContext, entry.getValue(), dataBean);
// //不帶*號,所有同樣廚房位置的食品都在一張紙上
// bitmaps.add(bitmap);
// }
// bitmapMaps.put(key, bitmaps);
// }
//如果需要打印印單,加上
List
<
Bitmap
>
bitmaps
=
new
ArrayList
<>();
// Bitmap bitmap = initPrintView(mContext, dataBean);
...
...
@@ -221,7 +138,7 @@ public class PrintOtherOrder extends PrinterRoot {
layout
.
addView
(
getTakeawayOrderInfo
(
mContext
,
data
));
//食品
layout
.
addView
(
getTextLine
(
mContext
,
"項目"
));
layout
.
addView
(
getDiningFoodList
(
mContext
,
OrderDetail
.
productMameBeanToOrderDetail
(
0
,
data
.
getPRODUCT_NAME
()),
deviceBean
));
layout
.
addView
(
getDiningFoodList
(
mContext
,
OrderDetail
.
productMameBeanToOrderDetail
(
0
,
data
.
getPRODUCT_NAME
()),
deviceBean
,
1
,
true
));
layout
.
addView
(
getLine
(
mContext
));
//訂單金額信息
List
<
PrintBillBean
>
billData
=
new
ArrayList
<>();
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
View file @
70cf3b69
...
...
@@ -29,7 +29,7 @@ import java.util.List;
import
java.util.Map
;
/**
* 打印外賣接單結賬單
* 打印外賣接單
結賬單
*/
public
class
PrintOtherOrderClosing
extends
PrinterRoot
{
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintPrjKitchen.java
View file @
70cf3b69
...
...
@@ -43,14 +43,14 @@ public class PrintPrjKitchen extends PrinterRoot {
if
(
bean
.
getStatus
()
==
2
)
{
List
<
PrjBean
.
DataBean
.
Bean
>
beans
=
new
ArrayList
<>();
beans
.
add
(
bean
);
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
key
,
beans
);
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
key
,
beans
,
deviceBean
);
bitmaps
.
add
(
bitmap
);
}
else
{
noCut
.
add
(
bean
);
}
}
if
(
noCut
.
size
()
>
0
)
{
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
key
,
noCut
);
Bitmap
bitmap
=
getKitChenPrintBitmap
(
mContext
,
key
,
noCut
,
deviceBean
);
bitmaps
.
add
(
bitmap
);
}
bitmapMaps
.
put
(
key
,
bitmaps
);
...
...
@@ -64,10 +64,10 @@ public class PrintPrjKitchen extends PrinterRoot {
return
1
;
}
public
Bitmap
getKitChenPrintBitmap
(
Context
context
,
String
key
,
PrjBean
.
DataBean
.
Bean
data
)
{
public
Bitmap
getKitChenPrintBitmap
(
Context
context
,
String
key
,
PrjBean
.
DataBean
.
Bean
data
,
PrinterDeviceBean
printerDeviceBean
)
{
List
<
PrjBean
.
DataBean
.
Bean
>
beans
=
new
ArrayList
<>();
beans
.
add
(
data
);
return
getKitChenPrintBitmap
(
context
,
key
,
beans
);
return
getKitChenPrintBitmap
(
context
,
key
,
beans
,
printerDeviceBean
);
}
/**
...
...
@@ -76,7 +76,7 @@ public class PrintPrjKitchen extends PrinterRoot {
* @param context
* @return
*/
public
Bitmap
getKitChenPrintBitmap
(
Context
context
,
String
key
,
List
<
PrjBean
.
DataBean
.
Bean
>
data
)
{
public
Bitmap
getKitChenPrintBitmap
(
Context
context
,
String
key
,
List
<
PrjBean
.
DataBean
.
Bean
>
data
,
PrinterDeviceBean
printerDeviceBean
)
{
if
(
data
==
null
||
data
.
size
()
<=
0
)
{
return
null
;
}
...
...
@@ -180,7 +180,7 @@ public class PrintPrjKitchen extends PrinterRoot {
tvOrderTime
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_MDHM
));
//操作人員
tvOperator
.
setText
(
prjBean
.
getUserName
());
return
viewTo
Bitmap
(
context
,
view
);
return
viewTo
ZoomBitmap
(
context
,
view
,
printerDeviceBean
);
}
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintServe.java
View file @
70cf3b69
...
...
@@ -2,6 +2,7 @@ package com.joe.print.mvp.print;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
...
...
@@ -9,7 +10,6 @@ import android.widget.TextView;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.base.adapter.print.BillAdapter
;
import
com.gingersoft.gsa.cloud.base.adapter.print.FoodAdapter
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillingBean
;
...
...
@@ -17,27 +17,25 @@ import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.joe.print.R
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 上菜紙打印
* 上菜紙打印
已改新版
*/
public
class
PrintServe
extends
PrinterRoot
{
@Override
public
Map
<
String
,
List
<
Bitmap
>>
getPrintBitmap
(
Context
mContext
,
PrinterDeviceBean
d
eviceBean
)
{
public
Map
<
String
,
List
<
Bitmap
>>
getPrintBitmap
(
Context
mContext
,
PrinterDeviceBean
printerD
eviceBean
)
{
Map
<
String
,
List
<
Bitmap
>>
bitmapMaps
=
new
HashMap
<>();
List
<
Bitmap
>
bitmaps
=
new
ArrayList
<>();
bitmaps
.
add
(
get
ServeBitmap
(
mContext
));
bitmaps
.
add
(
get
Bitmap
(
mContext
,
printerDeviceBean
));
bitmapMaps
.
put
(
""
,
bitmaps
);
return
bitmapMaps
;
}
...
...
@@ -48,13 +46,7 @@ public class PrintServe extends PrinterRoot {
}
/**
* 獲取"印單"圖片
*
* @param context
* @return
*/
private
Bitmap
getServeBitmap
(
Context
context
)
{
private
Bitmap
getServeBitmap
(
Context
context
,
PrinterDeviceBean
printerDeviceBean
)
{
List
<
OrderDetail
>
foodList
=
MyOrderManage
.
getInstance
().
getNewFoodList
();
if
(
foodList
==
null
||
foodList
.
size
()
<=
0
)
{
return
null
;
...
...
@@ -114,6 +106,36 @@ public class PrintServe extends PrinterRoot {
//加载条形码
// ImageView ivBarCode = view.findViewById(R.id.iv_bar_code);
// ivBarCode.setImageBitmap(BitmapUtil.generateBitmap("12312112131", 2, 450, 150));
return
viewToBitmap
(
context
,
view
);
return
viewToZoomBitmap
(
context
,
view
,
printerDeviceBean
);
}
private
Bitmap
getBitmap
(
Context
mContext
,
PrinterDeviceBean
printerDeviceBean
)
{
List
<
OrderDetail
>
foodList
=
MyOrderManage
.
getInstance
().
getOrderFoodList
();
if
(
foodList
==
null
||
foodList
.
size
()
<=
0
)
{
return
null
;
}
TableBean
.
DataBean
tableBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
LinearLayout
layout
=
new
LinearLayout
(
mContext
);
layout
.
setOrientation
(
LinearLayout
.
VERTICAL
);
//訂單頭
layout
.
addView
(
getHeader
(
mContext
));
layout
.
addView
(
getLine
(
mContext
));
//訂單信息
String
orderId
=
""
;
if
(
MyOrderManage
.
getInstance
().
getOrderId
()
!=
-
1
)
{
orderId
=
MyOrderManage
.
getInstance
().
getOrderId
()
+
""
;
}
layout
.
addView
(
getDiningTableOrderInfo
(
mContext
,
"餐檯:"
+
tableBean
.
getTableName
(),
"人數:"
+
OpenTableManage
.
getDefault
().
getPeopleNumber
(),
"單號:"
+
orderId
,
"日期:"
+
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
)));
layout
.
addView
(
getLine
(
mContext
));
layout
.
addView
(
getDiningFoodList
(
mContext
,
foodList
,
printerDeviceBean
,
0
,
false
));
layout
.
addView
(
getLine
(
mContext
));
layout
.
addView
(
getTextView
(
mContext
,
"Thank you!"
,
Gravity
.
CENTER_HORIZONTAL
,
getDimensionPixelSize
(
mContext
,
R
.
dimen
.
dp_8
)));
layout
.
addView
(
getTextView
(
mContext
,
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
),
Gravity
.
CENTER_HORIZONTAL
,
getDimensionPixelSize
(
mContext
,
R
.
dimen
.
dp_8
)));
return
viewToZoomBitmap
(
mContext
,
layout
,
printerDeviceBean
);
}
}
print-module/src/main/java/com/joe/print/mvp/print/PrintSlip.java
View file @
70cf3b69
...
...
@@ -2,16 +2,9 @@ package com.joe.print.mvp.print;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.view.
View
;
import
android.view.
Gravity
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.base.adapter.print.BillAdapter
;
import
com.gingersoft.gsa.cloud.base.adapter.print.FoodAdapter
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillOrderMoney
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillingBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
...
...
@@ -28,22 +21,24 @@ import java.util.List;
import
java.util.Map
;
/**
* 印單打印
* 印單打印
已改新版
*/
public
class
PrintSlip
extends
PrinterRoot
{
@Override
public
Map
<
String
,
List
<
Bitmap
>>
getPrintBitmap
(
Context
mContext
,
PrinterDeviceBean
deviceBean
)
{
Map
<
String
,
List
<
Bitmap
>>
bitmapMaps
=
new
HashMap
<>();
List
<
Bitmap
>
bitmaps
=
new
ArrayList
<>();
bitmaps
.
add
(
getServeBitmap
(
mContext
));
//這裡可能還需要加上廚房單的內容,有未送單的食品時。
PrintKitchen
kitchen
=
new
PrintKitchen
();
Map
<
String
,
List
<
Bitmap
>>
bitmapMaps
=
new
HashMap
<>(
kitchen
.
getPrintBitmap
(
mContext
,
deviceBean
));
if
(
bitmapMaps
.
size
()
==
0
)
{
bitmaps
.
add
(
getBitmap
(
mContext
,
deviceBean
));
bitmapMaps
.
put
(
""
,
bitmaps
);
}
else
{
merge2ResultMap
(
bitmapMaps
,
""
,
bitmaps
);
}
//這裡可能還需要加上廚房單的內容,有未送單的食品時。
// PrintKitchen kitchen = new PrintKitchen();
// Map<String, List<Bitmap>> bitmapMaps = new HashMap<>(kitchen.getPrintBitmap(mContext, deviceBean));
// if (bitmapMaps.size() == 0) {
// bitmapMaps.put("", bitmaps);
// } else {
// merge2ResultMap(bitmapMaps, "", bitmaps);
// }
return
bitmapMaps
;
}
...
...
@@ -52,44 +47,30 @@ public class PrintSlip extends PrinterRoot {
return
1
;
}
/**
* 獲取"印單"圖片
*
* @param context
* @return
*/
private
Bitmap
getServeBitmap
(
Context
context
)
{
private
Bitmap
getBitmap
(
Context
mContext
,
PrinterDeviceBean
printerDeviceBean
)
{
List
<
OrderDetail
>
foodList
=
MyOrderManage
.
getInstance
().
getOrderFoodList
();
if
(
foodList
==
null
||
foodList
.
size
()
<=
0
)
{
return
null
;
}
View
view
=
LinearLayout
.
inflate
(
context
,
R
.
layout
.
print_layout_print
,
null
);
TextView
brandName
=
view
.
findViewById
(
R
.
id
.
tv_brand_name
);
TextView
restaurantName
=
view
.
findViewById
(
R
.
id
.
tv_restaurant_name
);
TextView
tableNum
=
view
.
findViewById
(
R
.
id
.
tv_dining_table_number
);
TextView
people
=
view
.
findViewById
(
R
.
id
.
tv_people
);
TextView
orderNum
=
view
.
findViewById
(
R
.
id
.
tv_order_num
);
TextView
orderData
=
view
.
findViewById
(
R
.
id
.
tv_date
);
RecyclerView
rvFood
=
view
.
findViewById
(
R
.
id
.
rv_food
);
RecyclerView
rvBillAmount
=
view
.
findViewById
(
R
.
id
.
rv_bill_amount
);
TextView
mTvTotalAmount
=
view
.
findViewById
(
R
.
id
.
tv_total_amount
);
TextView
checkOutTime
=
view
.
findViewById
(
R
.
id
.
tv_checkout_time
);
TextView
line_food_info
=
view
.
findViewById
(
R
.
id
.
line_food_info
);
TableBean
.
DataBean
tableBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
brandName
.
setText
(
GsaCloudApplication
.
getBrandName
(
context
)
);
restaurantName
.
setText
(
GsaCloudApplication
.
getRestaurantName
(
context
)
);
LinearLayout
layout
=
new
LinearLayout
(
mContext
);
layout
.
setOrientation
(
LinearLayout
.
VERTICAL
);
tableNum
.
setText
(
tableBean
.
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
//訂單頭
layout
.
addView
(
getHeader
(
mContext
));
layout
.
addView
(
getLine
(
mContext
));
orderData
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
checkOutTime
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
FoodAdapter
foodAdapter
=
new
FoodAdapter
(
foodList
);
rvFood
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvFood
.
setAdapter
(
foodAdapter
);
//訂單信息
String
orderId
=
""
;
if
(
MyOrderManage
.
getInstance
().
getOrderId
()
!=
-
1
)
{
orderId
=
MyOrderManage
.
getInstance
().
getOrderId
()
+
""
;
}
layout
.
addView
(
getDiningTableOrderInfo
(
mContext
,
"餐檯:"
+
tableBean
.
getTableName
(),
"人數:"
+
OpenTableManage
.
getDefault
().
getPeopleNumber
(),
"單號:"
+
orderId
,
"日期:"
+
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
)));
layout
.
addView
(
getLine
(
mContext
));
layout
.
addView
(
getDiningFoodList
(
mContext
,
foodList
,
printerDeviceBean
,
0
,
true
));
layout
.
addView
(
getHalfLine
(
mContext
));
List
<
BillingBean
>
billingBeans
=
new
ArrayList
<>();
//添加合計項
billingBeans
.
add
(
new
BillingBean
(
"合計"
,
MyOrderManage
.
getInstance
().
getWholeAmount
()));
...
...
@@ -99,32 +80,14 @@ public class PrintSlip extends PrinterRoot {
billingBeans
.
add
(
new
BillingBean
(
item
.
getTitle
(),
item
.
getMoney
()));
}
}
if
(
billingBeans
.
size
()
<=
0
)
{
line_food_info
.
setVisibility
(
View
.
GONE
);
}
else
{
BillAdapter
billAdapter
=
new
BillAdapter
(
billingBeans
);
rvBillAmount
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvBillAmount
.
setAdapter
(
billAdapter
);
}
if
(
OpenTableManage
.
getDefault
().
getTableBean
()
!=
null
)
{
tableNum
.
setText
(
OpenTableManage
.
getDefault
().
getTableBean
().
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
layout
.
addView
(
getDiningBillInfo
(
mContext
,
billingBeans
));
layout
.
addView
(
getHalfLine
(
mContext
));
layout
.
addView
(
getAmountText
(
mContext
,
"總金額:"
+
MyOrderManage
.
getInstance
().
getTotalAmount
()));
layout
.
addView
(
getLine
(
mContext
));
layout
.
addView
(
getTextView
(
mContext
,
"Thank you!"
,
Gravity
.
CENTER_HORIZONTAL
,
getDimensionPixelSize
(
mContext
,
R
.
dimen
.
dp_8
)));
layout
.
addView
(
getTextView
(
mContext
,
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
),
Gravity
.
CENTER_HORIZONTAL
,
getDimensionPixelSize
(
mContext
,
R
.
dimen
.
dp_8
)));
return
viewToZoomBitmap
(
mContext
,
layout
,
printerDeviceBean
);
}
if
(
MyOrderManage
.
getInstance
().
getOrderId
()
!=
-
1
)
{
orderNum
.
setText
(
MyOrderManage
.
getInstance
().
getOrderId
()
+
""
);
}
// BigDecimal totalAmount = new BigDecimal(0);
// for (OrderDetail OrderDetail : foodList) {
// totalAmount = MoneyUtil.sum(totalAmount, MoneyUtil.priceCalculation(OrderDetail.getPrice(), OrderDetail.getNumber()));
// }
//總金額
mTvTotalAmount
.
setText
(
MyOrderManage
.
getInstance
().
getTotalAmount
()
+
""
);
//加载条形码
// ImageView ivBarCode = view.findViewById(R.id.iv_bar_code);
// ivBarCode.setImageBitmap(BitmapUtil.generateBitmap("12312112131", 2, 450, 150));
return
viewToBitmap
(
context
,
view
);
}
}
print-module/src/main/java/com/joe/print/mvp/print/PrintTest.java
View file @
70cf3b69
...
...
@@ -25,7 +25,7 @@ public class PrintTest extends PrinterRoot {
public
Map
<
String
,
List
<
Bitmap
>>
getPrintBitmap
(
Context
mContext
,
PrinterDeviceBean
deviceBean
)
{
Map
<
String
,
List
<
Bitmap
>>
bitmapMaps
=
new
HashMap
<>();
List
<
Bitmap
>
bitmaps
=
new
ArrayList
<>();
bitmaps
.
add
(
getTestPrintBitmap
(
mContext
));
bitmaps
.
add
(
getTestPrintBitmap
(
mContext
,
deviceBean
));
bitmapMaps
.
put
(
""
,
bitmaps
);
return
bitmapMaps
;
}
...
...
@@ -42,11 +42,11 @@ public class PrintTest extends PrinterRoot {
* @param context
* @return
*/
public
Bitmap
getTestPrintBitmap
(
Context
context
)
{
public
Bitmap
getTestPrintBitmap
(
Context
context
,
PrinterDeviceBean
deviceBean
)
{
View
view
=
LinearLayout
.
inflate
(
context
,
R
.
layout
.
print_test
,
null
);
TextView
tvTime
=
view
.
findViewById
(
R
.
id
.
tv_test_print_now_time
);
tvTime
.
setText
(
"時間:"
+
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
return
viewTo
Bitmap
(
context
,
view
);
return
viewTo
ZoomBitmap
(
context
,
view
,
deviceBean
);
}
}
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
View file @
70cf3b69
...
...
@@ -4,6 +4,7 @@ import android.app.Dialog;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.hardware.usb.UsbManager
;
import
android.os.Build
;
import
android.os.IBinder
;
...
...
@@ -30,7 +31,6 @@ import com.gingersoft.gsa.cloud.base.common.bean.BillingBean;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.base.utils.AidlUtil
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
...
...
@@ -62,8 +62,6 @@ import com.joe.print.mvp.ui.adapter.DialogPrinterListAdapter;
import
com.sunmi.peripheral.printer.InnerResultCallbcak
;
import
com.yanzhenjie.recyclerview.widget.DefaultItemDecoration
;
import
org.w3c.dom.Text
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collection
;
...
...
@@ -73,15 +71,7 @@ import java.util.Objects;
public
abstract
class
PrinterRoot
implements
PrintSocketHolder
.
OnStateChangedListener
,
PrintExecutor
.
OnPrintResultListener
,
ReceiveListener
{
public
final
static
int
PRINT_TEST
=
-
1
;
//測試頁
public
final
static
int
PRINT_SERVE
=
0
;
//上菜紙
public
final
static
int
PRINT_SLIP
=
1
;
//印單
public
final
static
int
PRINT_BILL
=
2
;
//結賬單
public
final
static
int
PRINT_KITCHEN
=
3
;
//送單,廚房單
public
final
static
int
PRINT_CLEAN_MACHINE
=
4
;
//清機報表
public
final
static
int
PRINT_OTHER_ORDER
=
5
;
//接單內容打印 外送印單
public
final
static
int
PRINT_INSTRUCTION
=
6
;
//開錢箱
public
final
static
int
PRINT_OTHER_CLOSING
=
7
;
//外賣結賬單
protected
final
String
MONETARY_UNIT
=
"$"
;
private
final
static
int
SUNMI_PAPER_WIDTH
=
360
;
//商米打印機紙張寬度
...
...
@@ -97,23 +87,23 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
public
static
PrinterRoot
getPrinterByType
(
int
type
)
{
//初始化USB打印
if
(
type
==
PRINT_TEST
)
{
if
(
type
==
P
rintConstans
.
P
RINT_TEST
)
{
return
new
PrintTest
();
}
else
if
(
type
==
PRINT_SERVE
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_SERVE
)
{
return
new
PrintServe
();
}
else
if
(
type
==
PRINT_SLIP
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_SLIP
)
{
return
new
PrintSlip
();
}
else
if
(
type
==
PRINT_BILL
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_BILL
)
{
return
new
PrintBill
();
}
else
if
(
type
==
PRINT_KITCHEN
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_KITCHEN
)
{
return
new
PrintPrjKitchen
();
}
else
if
(
type
==
PRINT_CLEAN_MACHINE
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_CLEAN_MACHINE
)
{
return
new
PrintCleanMachine
();
}
else
if
(
type
==
PRINT_OTHER_ORDER
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_OTHER_ORDER
)
{
return
new
PrintOtherOrder
();
}
else
if
(
type
==
PRINT_INSTRUCTION
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_INSTRUCTION
)
{
return
new
PrintInstruction
();
}
else
if
(
type
==
PRINT_OTHER_CLOSING
)
{
}
else
if
(
type
==
P
rintConstans
.
P
RINT_OTHER_CLOSING
)
{
return
new
PrintOtherOrderClosing
();
}
return
null
;
...
...
@@ -1020,8 +1010,25 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
return
view
;
}
public
View
getDiningFoodList
(
Context
mContext
,
List
<
OrderDetail
>
foodList
,
PrinterDeviceBean
deviceBean
)
{
return
getVerticalRecyclerView
(
mContext
,
new
FoodAdapter
(
foodList
,
deviceBean
));
/**
*
* @param mContext
* @param foodList
* @param deviceBean
* @param type 0 食品清單,1 結賬單
* @param showPrice 是否顯示價格
* @return
*/
public
View
getDiningFoodList
(
Context
mContext
,
List
<
OrderDetail
>
foodList
,
PrinterDeviceBean
deviceBean
,
int
type
,
boolean
showPrice
)
{
List
<
OrderDetail
>
newsFoodList
=
new
ArrayList
<>();
for
(
OrderDetail
orderDetail:
foodList
)
{
//如果食品設置了0元不打印並且食品等於0元,或者設置了不打印到單,就不打印
if
(!(
orderDetail
.
getPrintToBill
()
==
0
&&
orderDetail
.
getPrice
()
==
0
)
||
OrderDetail
.
isPrint
((
int
)
orderDetail
.
getPrintTo
(),
type
))
{
newsFoodList
.
add
(
orderDetail
);
}
}
return
getVerticalRecyclerView
(
mContext
,
new
FoodAdapter
(
newsFoodList
,
deviceBean
,
showPrice
));
}
...
...
@@ -1046,7 +1053,15 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
return
getTextView
(
mContext
,
text
,
Gravity
.
RIGHT
,
24
,
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
black
));
}
public
TextView
getTextView
(
Context
mContext
,
String
text
,
int
gravity
,
float
textSize
)
{
TextView
textView
=
new
TextView
(
mContext
);
textView
.
setWidth
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
);
textView
.
setText
(
text
);
textView
.
setTextColor
(
Color
.
BLACK
);
textView
.
setTextSize
(
textSize
);
textView
.
setGravity
(
gravity
);
return
textView
;
}
public
TextView
getTextView
(
Context
mContext
,
String
text
,
int
gravity
,
float
textSize
,
int
textColor
)
{
TextView
textView
=
new
TextView
(
mContext
);
textView
.
setWidth
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
);
...
...
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
View file @
70cf3b69
...
...
@@ -599,7 +599,7 @@ public class PrjService extends Service implements ReceiveListener {
if
(
bean
.
getStatus
()
==
2
)
{
Map
<
String
,
Bitmap
>
map
=
new
HashMap
<>();
//帶*,需要切紙的,單獨放一張紙
map
.
put
(
bean
.
getId
()
+
""
,
printPrjKitchen
.
getKitChenPrintBitmap
(
mContext
,
key
,
bean
));
map
.
put
(
bean
.
getId
()
+
""
,
printPrjKitchen
.
getKitChenPrintBitmap
(
mContext
,
key
,
bean
,
printerDeviceBean
));
bitmapMaps
.
add
(
map
);
}
else
{
noCut
.
add
(
bean
);
...
...
@@ -613,7 +613,7 @@ public class PrjService extends Service implements ReceiveListener {
stringBuffer
.
append
(
noCutData
.
getId
());
stringBuffer
.
append
(
","
);
}
map
.
put
(
stringBuffer
.
toString
(),
printPrjKitchen
.
getKitChenPrintBitmap
(
mContext
,
key
,
noCut
));
map
.
put
(
stringBuffer
.
toString
(),
printPrjKitchen
.
getKitChenPrintBitmap
(
mContext
,
key
,
noCut
,
printerDeviceBean
));
bitmapMaps
.
add
(
map
);
}
return
bitmapMaps
;
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
View file @
70cf3b69
...
...
@@ -123,7 +123,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
callId
=
CCUtil
.
getNavigateCallId
(
this
);
//獲取打印類型,根據打印類型生成對應的bitmap
type
=
CCUtil
.
getNavigateParam
(
this
,
PRINT_TYPE
,
-
1
);
type
=
CCUtil
.
getNavigateParam
(
this
,
PRINT_TYPE
,
PrintConstans
.
PRINT_TEST
);
isShowDialog
=
CCUtil
.
getNavigateParam
(
this
,
PrintConstans
.
PRINT_LOADING
,
true
);
printerInIt
=
PrinterRoot
.
getPrinterByType
(
type
);
...
...
@@ -146,7 +146,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
}
//獲取打印機列表
printerDeviceBeans
=
mPresenter
.
getAllPrintList
(
this
);
if
(
type
==
Print
erRoot
.
PRINT_TEST
)
{
if
(
type
==
Print
Constans
.
PRINT_TEST
)
{
//如果是打印測試
defaultPrint
=
CCUtil
.
getNavigateParam
(
this
,
"deviceBean"
,
null
);
}
else
{
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintTestActivity.java
View file @
70cf3b69
This diff is collapsed.
Click to expand it.
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
View file @
70cf3b69
...
...
@@ -130,7 +130,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
private
int
flipPosition
=
0
;
//數量大於1是否翻轉
public
static
List
<
String
>
printTypes
=
Arrays
.
asList
(
"網路打印"
,
"本機打印"
,
"USB打印"
);
private
List
<
String
>
fontSize
=
Arrays
.
asList
(
"預設"
,
"
1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"
6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
,
"24"
,
"25"
,
"26"
,
"27"
,
"28"
,
"29"
,
"30"
);
private
List
<
String
>
fontSize
=
Arrays
.
asList
(
"預設"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
,
"24"
,
"25"
,
"26"
,
"27"
,
"28"
,
"29"
,
"30"
);
private
List
<
String
>
booleanSelect
=
Arrays
.
asList
(
"預設"
,
"是"
,
"否"
);
...
...
@@ -325,8 +325,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
finish
();
}
private
void
showSelectFoodFontSize
(
TextView
textView
)
{
DialogUtils
.
showSelectPopop
(
this
,
fontSize
,
"字體大小"
,
0
,
i
->
{
private
void
showSelectFoodFontSize
(
TextView
textView
,
int
defaultSelect
)
{
DialogUtils
.
showSelectPopop
(
this
,
fontSize
,
"字體大小"
,
defaultSelect
,
i
->
{
textView
.
setText
(
fontSize
.
get
(
i
));
if
(
textView
.
getId
()
==
R
.
id
.
tv_food_font_size
)
{
//食品字體大小
...
...
@@ -371,10 +371,10 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
selectPrintModel
();
}
else
if
(
id
==
R
.
id
.
layout_print_device_food_font_size
)
{
//選擇食品字體大小
showSelectFoodFontSize
(
mTvFoodNameSize
);
showSelectFoodFontSize
(
mTvFoodNameSize
,
foodFondSize
);
}
else
if
(
id
==
R
.
id
.
layout_print_device_food_item_font_size
)
{
//選擇食品細項字體大小
showSelectFoodFontSize
(
mTvdetailsFontSize
);
showSelectFoodFontSize
(
mTvdetailsFontSize
,
modifierFontSize
);
}
else
if
(
id
==
R
.
id
.
layout_print_type
)
{
//選擇打印機類型
showSelectPrintType
();
...
...
@@ -586,7 +586,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
else
if
(
v
.
getId
()
==
R
.
id
.
print_test
)
{
//打印測試
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
Print
erRoot
.
PRINT_TEST
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
Print
Constans
.
PRINT_TEST
)
.
addParam
(
"deviceBean"
,
printerDeviceBean
)
.
setActionName
(
"printActivity"
)
.
build
()
...
...
print-module/src/main/res/layout/activity_print_test.xml
View file @
70cf3b69
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
tools:context=
"com.joe.print.mvp.ui.activity.PrintTestActivity"
>
<EditText
android:id=
"@+id/ed_ip"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_50"
android:layout_marginTop=
"@dimen/dp_20"
android:hint=
"请输入IP地址"
/>
<Button
android:id=
"@+id/btn_test"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_50"
android:layout_centerInParent=
"true"
android:text=
"打印測試"
/>
</
Relative
Layout>
</
Linear
Layout>
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
70cf3b69
...
...
@@ -787,7 +787,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
private
void
printSendOrder
(
boolean
initTable
)
{
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
3
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_KITCHEN
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
// if (result.isSuccess()) {
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
70cf3b69
...
...
@@ -349,7 +349,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
MyOrderManage
.
getInstance
().
setNewFoodList
(
newFoods
);
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
3
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_KITCHEN
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
());
...
...
@@ -359,18 +359,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
// }
mRootView
.
sendSuccess
();
});
//打印上菜紙
// CC.obtainBuilder("Component.Print")
// .setActionName("printActivity")
// .addParam("NewFoods", newFoods)
// .addParam("type", 0)
// .build()
// .callAsyncCallbackOnMainThread((cc, result) -> {
// if (result.isSuccess()) {
// //打印成功
// mRootView.killMyself();
// }
// });
}
public
void
printOrder
(
long
tableId
,
boolean
isSend
)
{
...
...
@@ -390,7 +378,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
public
void
onNext
(
@NonNull
BaseRespose
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
1
)
//印單
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SLIP
)
//印單
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
70cf3b69
...
...
@@ -18,6 +18,7 @@ import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
...
...
@@ -357,7 +358,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
private
void
printParper
()
{
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
"type"
,
1
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
//清空賬單數據
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/orderManager/AllOrderPresenter.java
View file @
70cf3b69
...
...
@@ -178,7 +178,7 @@ public class AllOrderPresenter extends BasePresenter<AllOrderContract.Model, All
MyOrderManage
.
getInstance
().
setBillMoney
(
payMethodList
);
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
2
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_BILL
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
());
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
View file @
70cf3b69
...
...
@@ -511,7 +511,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
//打印結賬單
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
2
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_BILL
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
());
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
View file @
70cf3b69
...
...
@@ -422,7 +422,7 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
2
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_BILL
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
());
...
...
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