Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YPPos
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
朱世闯
YPPos
Commits
e9bb0e8b
Commit
e9bb0e8b
authored
3 years ago
by
UIUANG\Zsc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改打印
parent
14df108f
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
86 additions
and
23 deletions
+86
-23
build.gradle
app/build.gradle
+2
-2
output-metadata.json
app/release/output-metadata.json
+3
-3
yppos_v100006-1.00.006-release-2021-11-01.apk
app/release/yppos_v100006-1.00.006-release-2021-11-01.apk
+0
-0
PosPayMethod.kt
...main/java/com/ypsx/yppos/http/data/entity/PosPayMethod.kt
+2
-1
PosDatabase.kt
...src/main/java/com/ypsx/yppos/room/database/PosDatabase.kt
+1
-2
PosBuyRepository.kt
...n/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
+1
-1
MainActivity.kt
app/src/main/java/com/ypsx/yppos/ui/activity/MainActivity.kt
+3
-1
OrderPayAmountPopupWindow.kt
...java/com/ypsx/yppos/ui/popup/OrderPayAmountPopupWindow.kt
+19
-1
PayAmountPopupWindow.kt
...main/java/com/ypsx/yppos/ui/popup/PayAmountPopupWindow.kt
+1
-0
PrintUtils.kt
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
+6
-6
OrderPayAmountViewModel.kt
...com/ypsx/yppos/viewmodel/state/OrderPayAmountViewModel.kt
+10
-5
build.gradle
self_yppos/build.gradle
+7
-0
AppUpdaterPopupWindow.kt
...java/com/ypsx/ypselfpos/ui/popup/AppUpdaterPopupWindow.kt
+23
-0
popup_app_updater.xml
self_yppos/src/main/res/layout/popup_app_updater.xml
+6
-0
colors.xml
self_yppos/src/main/res/values/colors.xml
+1
-0
strings.xml
self_yppos/src/main/res/values/strings.xml
+1
-1
No files found.
app/build.gradle
View file @
e9bb0e8b
...
...
@@ -15,8 +15,8 @@ android {
applicationId
"com.ypsx.yppos"
minSdkVersion
21
targetSdkVersion
30
versionCode
10000
3
versionName
"1.00.00
3
"
versionCode
10000
6
versionName
"1.00.00
6
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
...
...
This diff is collapsed.
Click to expand it.
app/release/output-metadata.json
View file @
e9bb0e8b
...
...
@@ -10,9 +10,9 @@
{
"type"
:
"SINGLE"
,
"filters"
:
[],
"versionCode"
:
10000
3
,
"versionName"
:
"1.00.00
3
"
,
"outputFile"
:
"yppos_v10000
3-1.00.003-release-2021-10-27
.apk"
"versionCode"
:
10000
6
,
"versionName"
:
"1.00.00
6
"
,
"outputFile"
:
"yppos_v10000
6-1.00.006-release-2021-11-01
.apk"
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/release/yppos_v10000
3-1.00.003-release-2021-10-27
.apk
→
app/release/yppos_v10000
6-1.00.006-release-2021-11-01
.apk
View file @
e9bb0e8b
No preview for this file type
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/http/data/entity/PosPayMethod.kt
View file @
e9bb0e8b
...
...
@@ -11,5 +11,6 @@ enum class PosPayMethod {
GROUP_PAY
,
BUY_CARDPAY
,
CASH_TICKET_PAY
,
AGGREGATE_SCAN_CODE_PAY
AGGREGATE_SCAN_CODE_PAY
,
LCSW_BAR_PAY
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/room/database/PosDatabase.kt
View file @
e9bb0e8b
...
...
@@ -37,8 +37,7 @@ abstract class PosDatabase : RoomDatabase() {
context
.
applicationContext
,
PosDatabase
::
class
.
java
,
name
).
allowMainThreadQueries
()
.
fallbackToDestructiveMigration
().
build
()
).
allowMainThreadQueries
().
build
()
INSTANCE
=
instance
return
instance
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
View file @
e9bb0e8b
...
...
@@ -81,7 +81,7 @@ class PosBuyRepository {
quantity
=
product
.
paymentProductQuantity
,
barCode
=
product
.
barCode
,
tailAmount
=
product
.
tailAmount
,
amount
=
product
.
a
mount
,
amount
=
product
.
productA
mount
,
weightCode
=
product
.
weightCode
,
deleted
=
false
,
conversionRatio
=
product
.
conversionRatio
,
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/ui/activity/MainActivity.kt
View file @
e9bb0e8b
...
...
@@ -454,7 +454,9 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
requestMainViewModel
.
paySuccessState
.
observe
(
this
,
{
payAmountPopupWindow
!!
.
dismiss
()
if
(
it
.
isSuccess
)
{
if
(
payFailedPopWindow
!=
null
)
{
payFailedPopWindow
!!
.
dismiss
()
}
paySuccessPopWindow
=
PaySuccessPopWindow
(
this
)
paySuccessPopWindow
!!
.
showPopupWindow
()
paySuccessPopWindow
!!
.
setData
(
it
.
data
!!
)
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/ui/popup/OrderPayAmountPopupWindow.kt
View file @
e9bb0e8b
...
...
@@ -75,7 +75,25 @@ class OrderPayAmountPopupWindow(context: Context) : BasePopupWindow(context) {
fun
pay
()
{
var
checkedRadioButtonId
=
bind
?.
radio
?.
checkedRadioButtonId
val
payMethod
=
when
(
checkedRadioButtonId
)
{
R
.
id
.
rb_offline
->
PosPayMethod
.
CCB_BAR_PAY
R
.
id
.
rb_offline
->
{
val
payName
=
bind
!!
.
vm
?.
payName
?.
get
()
if
(
payName
!!
.
isNotEmpty
())
{
when
(
payName
)
{
PosPayMethod
.
CCB_BAR_PAY
.
name
->
{
PosPayMethod
.
CCB_BAR_PAY
}
PosPayMethod
.
LCSW_BAR_PAY
.
name
->
{
PosPayMethod
.
LCSW_BAR_PAY
}
else
->
{
PosPayMethod
.
CCB_BAR_PAY
}
}
}
else
{
PosPayMethod
.
CCB_BAR_PAY
}
}
R
.
id
.
rbCardPay
->
PosPayMethod
.
CARDPAY
else
->
PosPayMethod
.
CCB_BAR_PAY
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/ui/popup/PayAmountPopupWindow.kt
View file @
e9bb0e8b
...
...
@@ -68,6 +68,7 @@ class PayAmountPopupWindow(context: Context) : BasePopupWindow(context) {
var
title
=
""
when
(
payMethod
)
{
PosPayMethod
.
LCSW_BAR_PAY
,
PosPayMethod
.
CCB_BAR_PAY
->
{
title
=
"扫码支付"
binding
?.
vm
?.
payTitle
?.
set
(
"扫码支付"
)
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
View file @
e9bb0e8b
...
...
@@ -278,7 +278,7 @@ object PrintUtils {
if
(
payments
.
isNotEmpty
())
{
total
=
payments
[
0
].
total
.
toString
()
payMethod
=
when
(
payments
[
0
].
payMethod
)
{
PosPayMethod
.
CCB_BAR_PAY
.
name
->
{
PosPayMethod
.
CCB_BAR_PAY
.
name
,
PosPayMethod
.
LCSW_BAR_PAY
.
name
->
{
"扫码支付"
}
PosPayMethod
.
CARDPAY
.
name
->
{
...
...
@@ -562,7 +562,7 @@ object PrintUtils {
var
discountTime
=
0.0
//分时
var
discountSpecial
=
0.0
//特价
var
discountMoney
=
0.0
//满减
var
list
:
List
<
OrderActivityResponse
>?
=
null
var
list
:
List
<
OrderActivityResponse
>?
=
null
if
(
posBuy
.
activitys
!=
null
&&
posBuy
.
activitys
!=
""
)
{
list
=
Gson
().
fromJson
(
...
...
@@ -593,7 +593,7 @@ object PrintUtils {
var
discountMoney
=
0.0
var
isPromotion
=
false
if
(
product
.
activitys
!=
null
&&
product
.
activitys
!=
""
)
{
if
(
product
.
activitys
!=
null
&&
product
.
activitys
!=
""
)
{
// XLog.d(product.activitys)
val
activityInfoDTO
:
List
<
ActivityInfoDTO
>
=
...
...
@@ -626,7 +626,7 @@ object PrintUtils {
//
val
name
=
if
(
discountMoney
>
0.0
&&
isPromotion
)
{
"${index + 1} *${product.name}*"
}
else
{
}
else
{
"${index + 1} ${product.name}"
}
height
+=
printerManager
.
drawTextEx
(
...
...
@@ -710,7 +710,7 @@ object PrintUtils {
height
+=
printerManager
.
drawTextEx
(
getAmountCenterSpace
(
"应付款:${posBuy.
total
Amount}"
,
"应付款:${posBuy.
pay
Amount}"
,
"数量:${posBuy.buyNumber}"
),
0
,
...
...
@@ -749,7 +749,7 @@ object PrintUtils {
if
(
posBuyPayment
!=
null
)
{
total
=
posBuyPayment
.
total
.
toString
()
payMethod
=
when
(
posBuyPayment
.
payMethod
)
{
PosPayMethod
.
CCB_BAR_PAY
.
name
->
{
PosPayMethod
.
CCB_BAR_PAY
.
name
,
PosPayMethod
.
LCSW_BAR_PAY
.
name
->
{
"扫码支付"
}
PosPayMethod
.
CARDPAY
.
name
->
{
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ypsx/yppos/viewmodel/state/OrderPayAmountViewModel.kt
View file @
e9bb0e8b
...
...
@@ -20,6 +20,9 @@ class OrderPayAmountViewModel : BaseViewModel() {
var
scanCardPay
=
BooleanObservableField
(
false
)
var
payName
=
StringObservableField
(
""
)
var
offlineVisible
=
object
:
ObservableInt
(
scanOffline
)
{
override
fun
get
():
Int
{
return
if
(
scanOffline
.
get
())
{
...
...
@@ -48,11 +51,13 @@ class OrderPayAmountViewModel : BaseViewModel() {
if
(!
payMethods
.
isNullOrEmpty
())
{
val
payMethod
:
List
<
String
>
=
payMethods
.
split
(
","
)
for
(
str
in
payMethod
)
{
if
(
str
==
PosPayMethod
.
CCB_BAR_PAY
.
name
)
{
when
(
str
)
{
PosPayMethod
.
CCB_BAR_PAY
.
name
,
PosPayMethod
.
LCSW_BAR_PAY
.
name
->{
payName
.
set
(
str
)
scanOffline
.
set
(
true
)
}
if
(
str
==
PosPayMethod
.
CARDPAY
.
name
)
{
scanCardPay
.
set
(
true
)
PosPayMethod
.
CARDPAY
.
name
->
scanCardPay
.
set
(
true
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
self_yppos/build.gradle
View file @
e9bb0e8b
...
...
@@ -39,7 +39,14 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'com.google.android.material:material:1.2.1'
implementation
'androidx.constraintlayout:constraintlayout:2.0.1'
implementation
project
(
path:
':common'
)
implementation
project
(
path:
':base'
)
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
implementation
'io.github.razerdp:BasePopup:3.1.8'
implementation
'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
implementation
'com.github.getActivity:ToastUtils:9.5'
implementation
'com.aliyun.dpa:oss-android-sdk:2.1.0'
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
self_yppos/src/main/java/com/ypsx/ypselfpos/ui/popup/AppUpdaterPopupWindow.kt
0 → 100644
View file @
e9bb0e8b
package
com.ypsx.ypselfpos.ui.popup
import
android.content.Context
import
android.view.Gravity
import
com.ypsx.base.base.appContext
import
com.ypsx.base.ext.util.screenWidth
import
com.ypsx.ypselfpos.R
import
razerdp.basepopup.BasePopupWindow
class
AppUpdaterPopupWindow
(
context
:
Context
)
:
BasePopupWindow
(
context
)
{
init
{
setContentView
(
R
.
layout
.
popup_app_updater
)
width
=
appContext
.
screenWidth
/
4
*
3
setPopupGravity
(
GravityMode
.
RELATIVE_TO_ANCHOR
,
Gravity
.
CENTER
)
isOutSideTouchable
=
false
setOutSideDismiss
(
false
)
setBackgroundColor
(
R
.
color
.
black_60
)
}
override
fun
onBackPressed
():
Boolean
{
return
false
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
self_yppos/src/main/res/layout/popup_app_updater.xml
0 → 100644
View file @
e9bb0e8b
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
self_yppos/src/main/res/values/colors.xml
View file @
e9bb0e8b
...
...
@@ -7,4 +7,5 @@
<color
name=
"teal_700"
>
#FF018786
</color>
<color
name=
"black"
>
#FF000000
</color>
<color
name=
"white"
>
#FFFFFFFF
</color>
<color
name=
"black_60"
>
#99000000
</color>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
self_yppos/src/main/res/values/strings.xml
View file @
e9bb0e8b
<resources>
<string
name=
"app_name"
>
self_yppos
</string>
<string
name=
"app_name"
>
自助收银POS
</string>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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