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
3a36142b
Commit
3a36142b
authored
Jun 30, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
84718696
d7d261dc
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
92 additions
and
30 deletions
+92
-30
base-module/src/main/java/com/gingersoft/gsa/cloud/base/adapter/print/BillAdapter.java
+1
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
+36
-2
base-module/src/main/res/layout/print_bill_adapter_item_bill.xml
+0
-0
config.gradle
+2
-2
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
+1
-0
print-module/src/main/java/com/joe/print/mvp/print/PrintBill.java
+11
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+3
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
+8
-4
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/SoldoutCtrlPresenter.java
+5
-4
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
+3
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/SoldoutCtrlActivity.java
+9
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+7
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/TableAdapter.java
+6
-5
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/adapter/print/BillAdapter.java
View file @
3a36142b
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
adapter
.
print
;
import
androidx.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillingBean
;
import
java.util.List
;
/**
...
...
@@ -16,7 +13,7 @@ import java.util.List;
public
class
BillAdapter
extends
BaseQuickAdapter
<
BillingBean
,
BaseViewHolder
>
{
public
BillAdapter
(
@Nullable
List
<
BillingBean
>
data
)
{
super
(
R
.
layout
.
print_item_bill
,
data
);
super
(
R
.
layout
.
print_
bill_adapter_
item_bill
,
data
);
}
@Override
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
View file @
3a36142b
...
...
@@ -33,11 +33,28 @@ public class OrderPayView extends LinearLayout {
private
int
foodCount
;
private
OnSureClickLisenter
mOnSureClickLisenter
;
private
TextView
tvDifferenceName
;
private
TextView
tvDifferenceMoney
;
private
TextView
btn_order_count
;
private
TextView
tv_total
;
/**
* 0#店內支付
* 1#貨到付款
* 2#在線支付
*/
private
final
int
orderPayType
=
0
;
/**
* 找零
*/
public
static
final
int
LINE_PAY_TYPE_CHANGE
=
1
;
/**
* 貼士
*/
public
static
final
int
LINE_PAY_TYPE_TIPS
=
2
;
public
OrderPayView
(
Context
context
)
{
this
(
context
,
null
);
}
...
...
@@ -221,6 +238,20 @@ public class OrderPayView extends LinearLayout {
}
/**
* 獲取找零或貼士金額
*
* @return
*/
public
double
getTipsPrice
()
{
double
tips
=
0.0
;
double
difference
=
getDifferenceMoney
();
if
(
difference
<
0
)
{
tips
=
difference
;
}
return
Math
.
abs
(
tips
);
}
/**
* 獲取支付差額
*
* @return
...
...
@@ -236,7 +267,7 @@ public class OrderPayView extends LinearLayout {
*
* @return
*/
p
rivate
double
getBillMoney
()
{
p
ublic
double
getBillMoney
()
{
double
totalMoney
=
0.0
;
for
(
PayMethod
method
:
mBillMoneyList
)
{
totalMoney
=
MoneyUtil
.
sum
(
totalMoney
,
method
.
getPayMoney
());
...
...
@@ -266,9 +297,12 @@ public class OrderPayView extends LinearLayout {
* @return 第一階段默認為找零
*/
public
int
getLinePayType
()
{
return
1
;
return
LINE_PAY_TYPE_CHANGE
;
}
public
List
<
PayMethod
>
getBillMoneyList
()
{
return
mBillMoneyList
;
}
public
void
setDifferenceText
(
Context
context
)
{
double
difference
=
getDifferenceMoney
();
...
...
base-module/src/main/res/layout/print_item_bill.xml
→
base-module/src/main/res/layout/print_
bill_adapter_
item_bill.xml
View file @
3a36142b
File moved
config.gradle
View file @
3a36142b
...
...
@@ -5,8 +5,8 @@ ext {
buildToolsVersion:
'28.0.3'
,
minSdkVersion
:
19
,
//N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19
targetSdkVersion
:
28
,
versionCode
:
7
,
versionName
:
"1.0.
7
"
versionCode
:
8
,
versionName
:
"1.0.
8
"
]
version
=
[
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
View file @
3a36142b
...
...
@@ -107,6 +107,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
fl_add_table
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
rl_table
.
setVisibility
(
View
.
GONE
);
viewHolder
.
fl_table_type
.
setVisibility
(
View
.
GONE
);
initAddItemDispalyMetrics
(
viewHolder
);
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintBill.java
View file @
3a36142b
...
...
@@ -12,6 +12,8 @@ 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
;
...
...
@@ -76,6 +78,9 @@ public class PrintBill extends PrinterRoot {
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
()
+
""
);
...
...
@@ -87,6 +92,12 @@ public class PrintBill extends PrinterRoot {
rvFood
.
setAdapter
(
foodAdapter
);
List
<
BillingBean
>
billingBeans
=
new
ArrayList
<>();
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
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
3a36142b
...
...
@@ -324,6 +324,9 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
*/
private
void
addTableServiceAmount
()
{
TableBean
.
DataBean
dataBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
if
(
dataBean
==
null
){
return
;
}
double
serviceAmount
=
getTotalAmountFilterByType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
,
BillOrderMoney
.
DISCOUNT_TYPE
,
BillOrderMoney
.
ROUNDING_TYPE
)
*
dataBean
.
getServiceCharge
()
/
100
;
if
(
serviceAmount
>
0
)
{
BillOrderMoney
orderMoney
=
new
BillOrderMoney
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
View file @
3a36142b
...
...
@@ -20,6 +20,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.CreateOrderRequest;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity
;
import
com.gingersoft.gsa.cloud.ui.adapter.BillMethodAdapter
;
import
com.gingersoft.gsa.cloud.ui.adapter.BillMoneyAdapter
;
import
com.gingersoft.gsa.cloud.ui.view.OrderPayView
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
...
...
@@ -202,13 +203,16 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
* 結賬
*/
public
void
toOrderPay
(
boolean
show
)
{
OrderPayView
orderPayView
=
IActivity
.
getGsaPayView
();
if
(
orderPayView
.
getBillMoneyList
()
==
null
||
orderPayView
.
getBillMoneyList
().
size
()
==
0
)
return
;
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"orderPayType"
,
String
.
valueOf
(
orderPayType
))
.
add
(
"payType"
,
String
.
valueOf
(
mBillMoneyList
.
get
(
0
).
getId
()))
.
add
(
"payType"
,
String
.
valueOf
(
orderPayView
.
getBillMoneyList
()
.
get
(
0
).
getId
()))
.
add
(
"orderId"
,
String
.
valueOf
(
MyOrderManage
.
getInstance
().
getOrderId
()))
.
add
(
"amount"
,
String
.
valueOf
(
getAmount
()))
.
add
(
"linePayType"
,
String
.
valueOf
(
getLinePayType
()))
.
add
(
"tipsPrice"
,
String
.
valueOf
(
getTipsPrice
()))
.
add
(
"amount"
,
String
.
valueOf
(
orderPayView
.
getBillMoney
()))
.
add
(
"linePayType"
,
String
.
valueOf
(
orderPayView
.
getLinePayType
()))
.
add
(
"tipsPrice"
,
String
.
valueOf
(
orderPayView
.
getTipsPrice
()))
.
build
();
mModel
.
toOrderPay
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/SoldoutCtrlPresenter.java
View file @
3a36142b
...
...
@@ -177,7 +177,7 @@ public class SoldoutCtrlPresenter extends BasePresenter<SoldoutCtrlContract.Mode
break
;
}
}
mRootView
.
showTvRestore
(
showTvRestore
);
//
mRootView.showTvRestore(showTvRestore);
if
(
datasBean
.
isStop
())
{
...
...
@@ -815,10 +815,11 @@ public class SoldoutCtrlPresenter extends BasePresenter<SoldoutCtrlContract.Mode
if
(
foodIds
.
length
>
0
)
{
FoodDaoUtils
foodDao
=
new
FoodDaoUtils
(
IActivity
);
List
<
Food
>
foodList
=
mModel
.
queryDB_FoodListByIds
(
foodIds
);
for
(
int
i
=
0
;
i
<
foodList
.
size
();
i
++)
{
foodList
.
get
(
i
).
setInvisible
(
invisible
);
if
(
foodList
!=
null
)
{
for
(
int
i
=
0
;
i
<
foodList
.
size
();
i
++)
{
foodList
.
get
(
i
).
setInvisible
(
invisible
);
}
}
// if (status) {
// if (food.getParentId() == 0) {
// updateFoodGroup();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
View file @
3a36142b
...
...
@@ -722,4 +722,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
}
public
OrderPayView
getGsaPayView
()
{
return
gsaPayView
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/SoldoutCtrlActivity.java
View file @
3a36142b
...
...
@@ -409,7 +409,7 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
}
private
void
executeMultipleRestore
(
List
<
SoldoutCtrFood
>
selectSoldoutCtrFoodList
)
{
show
Multiple
SoldoutDialog
(
this
,
"是否恢復選中食品"
,
selectSoldoutCtrFoodList
);
show
Batch
SoldoutDialog
(
this
,
"是否恢復選中食品"
,
selectSoldoutCtrFoodList
);
}
/**
...
...
@@ -475,7 +475,7 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
return
str
;
}
private
void
show
Multiple
SoldoutDialog
(
Activity
context
,
String
msg
,
List
<
SoldoutCtrFood
>
selectSoldoutCtrFoodList
)
{
private
void
show
Batch
SoldoutDialog
(
Activity
context
,
String
msg
,
List
<
SoldoutCtrFood
>
selectSoldoutCtrFoodList
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
dialogBuilder
.
setTitleIcon
(
com
.
gingersoft
.
gsa
.
cloud
.
base
.
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
msg
);
...
...
@@ -688,13 +688,13 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
@Override
public
void
showTvRestore
(
boolean
show
)
{
//
if (show) {
//
tv_restore.setVisibility(View.VISIBLE);
//
tv_soldout.setVisibility(View.GONE);
//
} else {
//
tv_restore.setVisibility(View.GONE);
//
tv_soldout.setVisibility(View.VISIBLE);
//
}
if
(
show
)
{
tv_restore
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setVisibility
(
View
.
GONE
);
}
else
{
tv_restore
.
setVisibility
(
View
.
GONE
);
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
}
@Override
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
3a36142b
...
...
@@ -19,8 +19,10 @@ import com.gingersoft.gsa.cloud.table.R2;
import
com.gingersoft.gsa.cloud.table.app.TableOperatTypeConstant
;
import
com.gingersoft.gsa.cloud.table.di.component.DaggerTableComponent
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.OrderContentPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.base.BaseFragmentActivity
;
...
...
@@ -289,6 +291,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
mPresenter
.
showOperatTipDialog
(
dataBean
);
break
;
case
TableOperatTypeConstant
.
move_table_4
:
if
(
mPresenter
.
getOriginalTableId
()
==
dataBean
.
getId
()){
CommonTipDialog
.
showCancelDialog
(
this
,
"相同檯不能转檯"
,
OrderContentPresenter
.
class
,
mPresenter
,
""
,
null
,
null
);
return
;
}
//獲取餐檯狀態
mPresenter
.
getTable
(
dataBean
.
getId
());
break
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/TableAdapter.java
View file @
3a36142b
...
...
@@ -23,6 +23,7 @@ import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.ui.view.TriangleLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
...
...
@@ -175,9 +176,9 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
}
else
if
(
difference
[
1
]
!=
0
)
{
tv_open_duration
.
setText
(
difference
[
1
]
+
":"
+
difference
[
2
]);
}
else
if
(
difference
[
2
]
!=
0
)
{
tv_open_duration
.
setText
(
String
.
valueOf
(
difference
[
2
])
);
tv_open_duration
.
setText
(
"00:"
+
difference
[
2
]
);
}
else
{
tv_open_duration
.
setText
(
""
);
tv_open_duration
.
setText
(
"
00:00
"
);
}
tv_open_duration
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
...
...
@@ -271,9 +272,9 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
@Override
public
void
onClick
(
View
v
)
{
if
(
XClickUtil
.
isFastDoubleClick
(
v
,
1000
))
{
return
;
}
//
if (XClickUtil.isFastDoubleClick(v, 1000)) {
//
return;
//
}
if
(
mOnItemClickListener
!=
null
)
{
mOnItemClickListener
.
onItemClick
(
item
,
position
);
}
...
...
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