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
b1819aac
Commit
b1819aac
authored
Dec 28, 2021
by
UIUANG\Zsc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改DT40和高版本的bug
parent
21d3c2dd
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
131 additions
and
49 deletions
+131
-49
build.gradle
app/build.gradle
+2
-2
output-metadata.json
app/release/output-metadata.json
+3
-3
yppos_v100017-1.00.017-release-2021-12-28.apk
app/release/yppos_v100017-1.00.017-release-2021-12-28.apk
+0
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
ApiResponse.kt
...rc/main/java/com/ypsx/yppos/http/data/bean/ApiResponse.kt
+1
-1
AppVersionResponse.kt
.../java/com/ypsx/yppos/http/data/bean/AppVersionResponse.kt
+3
-0
CashPaySuccess.kt
...main/java/com/ypsx/yppos/http/data/bean/CashPaySuccess.kt
+3
-0
InsertOrderProductDTO.kt
...va/com/ypsx/yppos/http/data/bean/InsertOrderProductDTO.kt
+0
-2
LoginResponse.kt
.../main/java/com/ypsx/yppos/http/data/bean/LoginResponse.kt
+3
-0
OptionsResponse.kt
...ain/java/com/ypsx/yppos/http/data/bean/OptionsResponse.kt
+3
-0
PluRelation.kt
...rc/main/java/com/ypsx/yppos/http/data/bean/PluRelation.kt
+4
-1
PosConfigResponse.kt
...n/java/com/ypsx/yppos/http/data/bean/PosConfigResponse.kt
+3
-0
SimplePosCommandResponse.kt
...com/ypsx/yppos/http/data/bean/SimplePosCommandResponse.kt
+3
-0
UploadOrderResponse.kt
...java/com/ypsx/yppos/http/data/bean/UploadOrderResponse.kt
+3
-0
OrderStatusEnum.kt
...n/java/com/ypsx/yppos/http/data/entity/OrderStatusEnum.kt
+3
-0
PosCommandStatus.kt
.../java/com/ypsx/yppos/http/data/entity/PosCommandStatus.kt
+3
-0
PosCommandType.kt
...in/java/com/ypsx/yppos/http/data/entity/PosCommandType.kt
+3
-0
PosPayMethod.kt
...main/java/com/ypsx/yppos/http/data/entity/PosPayMethod.kt
+3
-0
PosProductStyle.kt
...n/java/com/ypsx/yppos/http/data/entity/PosProductStyle.kt
+3
-0
PosShelvesStatus.kt
.../java/com/ypsx/yppos/http/data/entity/PosShelvesStatus.kt
+1
-1
PosStatus.kt
...rc/main/java/com/ypsx/yppos/http/data/entity/PosStatus.kt
+3
-0
ProductActivityType.kt
...va/com/ypsx/yppos/http/data/entity/ProductActivityType.kt
+3
-0
ApplyPosMachineRequest.kt
...om/ypsx/yppos/http/data/request/ApplyPosMachineRequest.kt
+0
-12
PosLoginRequest.kt
.../java/com/ypsx/yppos/http/data/request/PosLoginRequest.kt
+3
-0
RefreshTokenRequest.kt
...a/com/ypsx/yppos/http/data/request/RefreshTokenRequest.kt
+3
-0
ReplyCommandListRequest.kt
...m/ypsx/yppos/http/data/request/ReplyCommandListRequest.kt
+3
-0
LogService.kt
app/src/main/java/com/ypsx/yppos/jobs/LogService.kt
+1
-0
SyncProductService.kt
app/src/main/java/com/ypsx/yppos/jobs/SyncProductService.kt
+1
-0
PosBuyRepository.kt
...n/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
+1
-0
OrderProductAdapter.kt
...ain/java/com/ypsx/yppos/ui/adapter/OrderProductAdapter.kt
+4
-1
ChangeQuantityPopupWindow.kt
...java/com/ypsx/yppos/ui/popup/ChangeQuantityPopupWindow.kt
+21
-11
PrintUtils.kt
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
+12
-4
RequestMainViewModel.kt
.../com/ypsx/yppos/viewmodel/request/RequestMainViewModel.kt
+25
-10
popup_change_quantity.xml
app/src/main/res/layout/popup_change_quantity.xml
+1
-1
ServerHostDialogExt.kt
.../main/java/com/ypsx/common/app/ext/ServerHostDialogExt.kt
+2
-0
No files found.
app/build.gradle
View file @
b1819aac
...
...
@@ -15,8 +15,8 @@ android {
applicationId
"com.ypsx.yppos"
minSdkVersion
21
targetSdkVersion
30
versionCode
10001
4
versionName
"1.00.01
4
"
versionCode
10001
7
versionName
"1.00.01
7
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
...
...
app/release/output-metadata.json
View file @
b1819aac
...
...
@@ -10,9 +10,9 @@
{
"type"
:
"SINGLE"
,
"filters"
:
[],
"versionCode"
:
10001
4
,
"versionName"
:
"1.00.01
4
"
,
"outputFile"
:
"yppos_v10001
4-1.00.014-release-2021-12-22
.apk"
"versionCode"
:
10001
7
,
"versionName"
:
"1.00.01
7
"
,
"outputFile"
:
"yppos_v10001
7-1.00.017-release-2021-12-28
.apk"
}
]
}
\ No newline at end of file
app/release/yppos_v10001
4-1.00.014-release-2021-12-22
.apk
→
app/release/yppos_v10001
7-1.00.017-release-2021-12-28
.apk
View file @
b1819aac
No preview for this file type
app/src/main/AndroidManifest.xml
View file @
b1819aac
...
...
@@ -10,6 +10,7 @@
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_PRIVILEGED_PHONE_STATE "
/>
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<application
android:name=
".PosApp"
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/ApiResponse.kt
View file @
b1819aac
...
...
@@ -8,7 +8,7 @@ import com.ypsx.base.network.BaseResponse
* 描述 :服务器返回数据的基类
* 如果你的项目中有基类,那美滋滋,可以继承BaseResponse,请求时框架可以帮你自动脱壳,自动判断是否请求成功,怎么做:
* 1.继承 BaseResponse
* 2.重写isSucces 方法,编写你的业务需求,根据自己的条件判断数据是否请求成功
* 2.重写isSucces
s
方法,编写你的业务需求,根据自己的条件判断数据是否请求成功
* 3.重写 getResponseCode、getResponseData、getResponseMsg方法,传入你的 code data msg
*/
data class
ApiResponse
<
T
>(
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/AppVersionResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 版本信息
*/
data class
AppVersionResponse
(
val
desciption
:
String
?
=
null
,
val
downloadUrl
:
String
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/CashPaySuccess.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 付款成功
*/
data class
CashPaySuccess
(
var
payAmount
:
Double
,
var
changeAmount
:
Double
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/InsertOrderProductDTO.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
data class
InsertOrderProductDTO
(
var
activityPrice
:
Double
=
0.0
,
var
activitys
:
List
<
ActivityInfoDTO
>?
=
null
,
//成交价
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/LoginResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 登录信息
*/
data class
LoginResponse
(
var
accessToken
:
String
,
var
currentTime
:
String
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/OptionsResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 配置信息
*/
data class
OptionsResponse
(
var
id
:
String
,
val
key
:
String
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/PluRelation.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
class
PluRelation
(
var
plu
:
String
,
var
id
:
String
)
/**
* 扫描13位或18条码对应关系
*/
data class
PluRelation
(
var
plu
:
String
,
var
id
:
String
)
app/src/main/java/com/ypsx/yppos/http/data/bean/PosConfigResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 获取pos配置
*/
data class
PosConfigResponse
(
//小票底部文字,最多144个汉字
var
ticketBottom
:
String
?
=
null
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/SimplePosCommandResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* pos命令
*/
data class
SimplePosCommandResponse
(
//命令ID
var
id
:
Long
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/UploadOrderResponse.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.bean
/**
* 上传订单返回的结果
*/
data class
UploadOrderResponse
(
// 错误消息
var
errorMessage
:
String
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/OrderStatusEnum.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* 订单状态
*/
enum
class
OrderStatusEnum
{
//待付款
CREATED
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/PosCommandStatus.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* pos命令状态
*/
enum
class
PosCommandStatus
{
CREATE
,
CANCELED
,
PROCESSING
,
FAILED
,
SUCCESS
}
app/src/main/java/com/ypsx/yppos/http/data/entity/PosCommandType.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* pos命令类型
*/
enum
class
PosCommandType
{
UPLOAD_LOG
,
UPLOAD_DB
}
\ No newline at end of file
app/src/main/java/com/ypsx/yppos/http/data/entity/PosPayMethod.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* 付款方式
*/
enum
class
PosPayMethod
{
CARDPAY
,
//扫码聚合支付
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/PosProductStyle.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* 商品规格
*/
enum
class
PosProductStyle
{
/**
*单品
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/PosShelvesStatus.kt
View file @
b1819aac
...
...
@@ -2,7 +2,7 @@ package com.ypsx.yppos.http.data.entity
/**
* string
POS门店商品状态
POS门店商品
上下架
状态
*/
enum
class
PosShelvesStatus
{
ON
,
OFF
,
DELETED
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/PosStatus.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* pos机状态
*/
enum
class
PosStatus
{
/**
* 申请中
...
...
app/src/main/java/com/ypsx/yppos/http/data/entity/ProductActivityType.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.entity
/**
* 商品活动状态
*/
enum
class
ProductActivityType
{
UNKNOWN_ACTIVITY_TYPE
,
TIMESHARE_ACTIVITY
,
OTHER_ACTIVITY
,
UNRECOGNIZED
}
\ No newline at end of file
app/src/main/java/com/ypsx/yppos/http/data/request/ApplyPosMachineRequest.kt
View file @
b1819aac
...
...
@@ -21,16 +21,4 @@ data class ApplyPosMachineRequest(
//安装目录
var
installationDirectory
:
String
// {
// "brand": "string",
// "installDiskCapacity": "string",
// "installationDirectory": "string",
// "ip": "string",
// "macAddress": "string",
// "port": 0,
// "remark": "string",
// "specification": "string",
// "version": "string"
// }
)
app/src/main/java/com/ypsx/yppos/http/data/request/PosLoginRequest.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.request
/**
* pos机登录
*/
data class
PosLoginRequest
(
//门店id
var
workingOrgId
:
String
,
...
...
app/src/main/java/com/ypsx/yppos/http/data/request/RefreshTokenRequest.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.request
/**
* 刷新token
*/
data class
RefreshTokenRequest
(
var
refreshToken
:
String
)
app/src/main/java/com/ypsx/yppos/http/data/request/ReplyCommandListRequest.kt
View file @
b1819aac
package
com.ypsx.yppos.http.data.request
/**
* 回复命令
*/
data class
ReplyCommandListRequest
(
var
commandIds
:
List
<
String
>
)
app/src/main/java/com/ypsx/yppos/jobs/LogService.kt
View file @
b1819aac
...
...
@@ -53,6 +53,7 @@ class LogService : Service() {
HttpRequestCoroutine
.
uploadLog
(
posConfig
?.
code
!!
)
}
}
catch
(
e
:
Exception
)
{
job
?.
cancel
()
e
.
message
?.
eXLog
()
}
...
...
app/src/main/java/com/ypsx/yppos/jobs/SyncProductService.kt
View file @
b1819aac
...
...
@@ -55,6 +55,7 @@ class SyncProductService: Service() {
val
storeId
=
posConfig
?.
storeId
!!
HttpRequestCoroutine
.
syncProduct
(
storeId
)
}
catch
(
e
:
Exception
)
{
job
?.
cancel
()
e
.
message
?.
eXLog
()
}
}
...
...
app/src/main/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
View file @
b1819aac
...
...
@@ -66,6 +66,7 @@ class PosBuyRepository {
getPosBuyDao
().
insert
(
posBuy
)
for
(
payment
in
orderResponse
.
payments
)
{
payment
.
payCode
=
authCode
payment
.
toJson
().
dXLog
()
getPosBuyPaymentDao
().
insert
(
payment
)
}
orderResponse
.
products
.
toJson
().
dXLog
()
...
...
app/src/main/java/com/ypsx/yppos/ui/adapter/OrderProductAdapter.kt
View file @
b1819aac
...
...
@@ -9,12 +9,15 @@ import com.ypsx.yppos.R
import
com.ypsx.yppos.http.data.bean.InsertOrderProductDTO
import
com.ypsx.yppos.http.data.entity.PosProductStyle
import
com.ypsx.yppos.utils.RoundBackgroundColorSpan
import
java.text.DecimalFormat
class
OrderProductAdapter
(
data
:
ArrayList
<
InsertOrderProductDTO
>)
:
BaseQuickAdapter
<
InsertOrderProductDTO
,
BaseViewHolder
>(
R
.
layout
.
item_pos_product
,
data
)
{
private
var
decimalFormat
:
DecimalFormat
=
DecimalFormat
(
"###################.###########"
)
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
InsertOrderProductDTO
)
{
item
.
run
{
when
(
style
)
{
...
...
@@ -53,7 +56,7 @@ class OrderProductAdapter(data: ArrayList<InsertOrderProductDTO>) :
PosProductStyle
.
WEIGHT
.
name
->
{
holder
.
setGone
(
R
.
id
.
ll_count
,
false
)
holder
.
setGone
(
R
.
id
.
tv_weight
,
true
)
holder
.
setText
(
R
.
id
.
tv_count
,
"$quantity"
)
holder
.
setText
(
R
.
id
.
tv_count
,
decimalFormat
.
format
(
quantity
)
)
}
else
->
{
...
...
app/src/main/java/com/ypsx/yppos/ui/popup/ChangeQuantityPopupWindow.kt
View file @
b1819aac
...
...
@@ -18,6 +18,7 @@ import com.ypsx.yppos.utils.toast
import
com.ypsx.yppos.viewmodel.state.ChangeQuantityViewModel
import
razerdp.basepopup.BasePopupWindow
import
java.math.BigDecimal
import
java.text.DecimalFormat
class
ChangeQuantityPopupWindow
(
context
:
Context
)
:
BasePopupWindow
(
context
)
{
lateinit
var
bind
:
PopupChangeQuantityBinding
...
...
@@ -25,6 +26,7 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
var
onChangeClick
:
OnChangeClick
?
=
null
private
var
posProduct
:
PosProduct
?
=
null
private
var
insertOrderProductDTO
:
InsertOrderProductDTO
?=
null
private
var
decimalFormat
:
DecimalFormat
=
DecimalFormat
(
"###################.###########"
)
...
...
@@ -92,15 +94,14 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
}
bind
.
vm
?.
purchaseQuantityName
?.
set
(
purchaseQuantityName
)
bind
.
vm
?.
purchaseQuantity
?.
set
(
spec
)
bind
.
etPurchaseQuantity
.
setText
(
spec
)
val
length
=
bind
.
etPurchaseQuantity
.
text
.
toString
().
length
bind
.
etPurchaseQuantity
.
setSelection
(
length
)
//
bind.etPurchaseQuantity.setText(spec)
//
val length = bind.etPurchaseQuantity.text.toString().length
//
bind.etPurchaseQuantity.setSelection(length)
bind
.
etPurchaseQuantity
.
isFocusable
=
true
;
bind
.
etPurchaseQuantity
.
isFocusableInTouchMode
=
true
;
bind
.
etPurchaseQuantity
.
requestFocus
()
//获取焦点
}
fun
setOrderProduct
(
insertOrderProductDTO
:
InsertOrderProductDTO
)
{
this
.
type
=
1
this
.
insertOrderProductDTO
=
insertOrderProductDTO
...
...
@@ -110,7 +111,8 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
when
(
insertOrderProductDTO
.
style
)
{
PosProductStyle
.
WEIGHT
.
name
->
{
purchaseQuantityName
=
"修改重量"
spec
=
insertOrderProductDTO
.
quantity
.
toString
()
spec
=
decimalFormat
.
format
(
insertOrderProductDTO
.
quantity
)
// spec = insertOrderProductDTO.quantity.toString()
bind
.
vm
?.
productBarCode
?.
set
(
"PLU:"
+
insertOrderProductDTO
.
mnemonicCode
)
bind
.
etPurchaseQuantity
.
filters
=
arrayOf
(
WeighInputFilter
())
}
...
...
@@ -126,11 +128,11 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
}
bind
.
vm
?.
purchaseQuantityName
?.
set
(
purchaseQuantityName
)
bind
.
vm
?.
purchaseQuantity
?.
set
(
spec
)
bind
.
etPurchaseQuantity
.
setText
(
spec
)
val
length
=
bind
.
etPurchaseQuantity
.
text
.
toString
().
length
bind
.
etPurchaseQuantity
.
setSelection
(
length
)
bind
.
etPurchaseQuantity
.
isFocusable
=
true
;
bind
.
etPurchaseQuantity
.
isFocusableInTouchMode
=
true
;
//
bind.etPurchaseQuantity.setText(spec)
//
val length = bind.etPurchaseQuantity.text.toString().length
//
bind.etPurchaseQuantity.setSelection(length)
//
bind.etPurchaseQuantity.isFocusable = true;
//
bind.etPurchaseQuantity.isFocusableInTouchMode = true;
bind
.
etPurchaseQuantity
.
requestFocus
()
//获取焦点
}
...
...
@@ -143,8 +145,16 @@ class ChangeQuantityPopupWindow(context: Context) : BasePopupWindow(context) {
fun
confirm
()
{
val
purchaseQuantity
:
String
=
bind
.
etPurchaseQuantity
.
text
.
toString
()
var
purchaseQuantityHint
=
bind
.
etPurchaseQuantity
.
hint
.
toString
()
if
(
purchaseQuantity
.
isEmpty
())
{
"重量/数据不能为空"
.
toast
()
dismiss
()
if
(
type
==
0
)
{
posProduct
?.
spec
=
purchaseQuantityHint
onChangeClick
?.
confirm
(
posProduct
!!
,
null
)
}
else
{
insertOrderProductDTO
?.
quantity
=
purchaseQuantityHint
.
toDouble
()
onChangeClick
?.
confirm
(
null
,
insertOrderProductDTO
!!
)
}
return
}
if
(
BigDecimal
(
purchaseQuantity
)
==
BigDecimal
.
ZERO
)
{
...
...
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
View file @
b1819aac
...
...
@@ -38,8 +38,12 @@ object PrintUtils {
private
const
val
PRNSTS_ERR_DRIVER
=
-
257
//Printer Driver error
private
lateinit
var
printerManager
:
PrinterManager
fun
init
()
{
printerManager
=
PrinterManager
()
printerManager
.
open
()
try
{
printerManager
=
PrinterManager
()
printerManager
.
open
()
}
catch
(
e
:
Exception
)
{
"打印机打开失败"
}
}
...
...
@@ -398,7 +402,11 @@ object PrintUtils {
fun
close
()
{
printerManager
.
close
()
try
{
printerManager
.
close
()
}
catch
(
e
:
Exception
)
{
}
}
private
fun
getSpace
(
content
:
String
):
String
?
{
...
...
@@ -689,7 +697,7 @@ object PrintUtils {
product
.
quantity
,
product
.
price
,
product
.
amount
),
0
,
height
,
384
,
-
1
,
fontName
,
fontSize
,
0
,
fontStyle
,
0
),
0
,
height
,
384
,
-
1
,
fontName
,
22
,
0
,
0
,
0
)
}
}
...
...
app/src/main/java/com/ypsx/yppos/viewmodel/request/RequestMainViewModel.kt
View file @
b1819aac
...
...
@@ -108,11 +108,24 @@ class RequestMainViewModel : BaseViewModel() {
"没找到该商品"
.
toastSign
()
}
else
{
it
.
toJson
().
dXLog
()
posProduct
.
postValue
(
it
)
// val productItem =
// ProductItem(it.merchantItemId!!, it.id, it.spec.toDouble(), it.sellPrice)
// productItem.toJson().dXLog()
// productItemData.postValue(productItem)
when
{
it
.
mnemonicCode
.
isEmpty
()
->
{
val
productItem
=
ProductItem
(
it
.
merchantItemId
!!
,
it
.
id
,
it
.
spec
.
toDouble
(),
it
.
sellPrice
)
productItem
.
toJson
().
dXLog
()
productItemData
.
postValue
(
productItem
)
}
it
.
mnemonicCode
==
key
->
{
posProduct
.
postValue
(
it
)
}
else
->
{
val
productItem
=
ProductItem
(
it
.
merchantItemId
!!
,
it
.
id
,
it
.
spec
.
toDouble
(),
it
.
sellPrice
)
productItem
.
toJson
().
dXLog
()
productItemData
.
postValue
(
productItem
)
}
}
}
},
{
...
...
@@ -170,10 +183,10 @@ class RequestMainViewModel : BaseViewModel() {
}
val
amount
:
Double
=
product
.
price
.
times
(
product
.
quantity
)
?:
0.0
amountTotal
=
BigDecimalUtils
.
forPlus
(
amountTotal
.
plus
(
amount
))
var
weightCode
=
""
var
weightCode
=
""
if
(
pluList
.
size
>
index
)
{
weightCode
=
weightCode
=
if
(
pluList
[
index
].
id
==
posProduct
?.
id
)
pluList
[
index
].
plu
else
""
}
...
...
@@ -192,7 +205,7 @@ class RequestMainViewModel : BaseViewModel() {
price
=
product
.
price
?:
0.0
,
quantity
=
product
.
quantity
?:
0.0
,
tailAmount
=
0
,
weightCode
=
weightCode
,
weightCode
=
weightCode
,
name
=
posProduct
.
name
,
spec
=
posProduct
.
spec
,
unit
=
posProduct
.
unit
,
...
...
@@ -255,7 +268,7 @@ class RequestMainViewModel : BaseViewModel() {
var
posProduct
:
PosProduct
?
=
null
var
listNum
=
0
for
((
index
,
product
)
in
productPromotions
.
withIndex
())
{
for
((
index
,
product
)
in
productPromotions
.
withIndex
())
{
for
(
item
in
it
)
{
if
(
product
.
productId
==
item
.
id
)
{
posProduct
=
item
...
...
@@ -285,7 +298,7 @@ class RequestMainViewModel : BaseViewModel() {
}
var
activityPrice
=
activityInfo
?.
activityPrice
?:
0.0
var
weightCode
=
""
var
weightCode
=
""
if
(
pluList
.
size
>
index
)
{
weightCode
=
...
...
@@ -436,8 +449,10 @@ class RequestMainViewModel : BaseViewModel() {
"${CacheUtil.getRealName()}付款成功,保存数据库并打印"
.
dXLog
()
pluList
.
clear
()
launch
({
val
currentTimeMillis
=
System
.
currentTimeMillis
()
PrintUtils
.
print
(
posConfig
!!
,
it
)
PosBuyRepository
.
getInstance
().
savePosBuy
(
it
,
authCode
)
"打印和保存数据库使用耗时::${System.currentTimeMillis()-currentTimeMillis}"
.
dXLog
()
},
{
"打印完成"
.
dXLog
()
"打印完成"
.
toastSuccess
()
...
...
app/src/main/res/layout/popup_change_quantity.xml
View file @
b1819aac
...
...
@@ -77,7 +77,7 @@
android:lines=
"1"
android:paddingVertical=
"10dp"
android:paddingStart=
"10dp"
android:text=
"
@{vm.purchaseQuantity}
"
android:text=
""
android:textColor=
"#333333"
android:textColorHint=
"#999999"
android:textSize=
"20sp"
...
...
common/src/main/java/com/ypsx/common/app/ext/ServerHostDialogExt.kt
View file @
b1819aac
package
com.ypsx.common.app.ext
import
android.annotation.SuppressLint
import
androidx.appcompat.app.AppCompatActivity
import
com.afollestad.materialdialogs.MaterialDialog
import
com.afollestad.materialdialogs.list.SingleChoiceListener
...
...
@@ -16,6 +17,7 @@ private val hostMap = mapOf(
private
val
hosts
=
hostMap
.
values
.
toTypedArray
()
private
val
names
=
hostMap
.
keys
.
toList
()
@SuppressLint
(
"StaticFieldLeak"
)
private
var
materialDialog
:
MaterialDialog
?
=
null
fun
AppCompatActivity
.
showServerHostExt
(
host
:
String
,
success
:
(
String
)
->
Unit
)
{
...
...
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