Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
e425d871
Commit
e425d871
authored
May 26, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整打印时间间隔到4s
parent
fe3304e3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
SystemParameterDialog.kt
...in/java/com/miya/fastcashier/log/SystemParameterDialog.kt
+6
-4
PrintService.kt
...rc/main/java/com/miya/fastcashier/service/PrintService.kt
+2
-2
BaseFunction.kt
app/src/main/java/com/miya/fastcashier/utils/BaseFunction.kt
+12
-0
dialog_system_parameter.xml
app/src/main/res/layout/dialog_system_parameter.xml
+5
-5
No files found.
app/src/main/java/com/miya/fastcashier/log/SystemParameterDialog.kt
View file @
e425d871
...
...
@@ -3,10 +3,7 @@ package com.miya.fastcashier.log
import
android.app.Dialog
import
android.content.Context
import
com.miya.fastcashier.service.AccountService.getAccountInfo
import
com.miya.fastcashier.utils.getVersion
import
com.miya.fastcashier.net.ApiConfig.baseUrl
import
com.miya.fastcashier.utils.getWifyName
import
com.miya.fastcashier.utils.getNetIp
import
com.miya.fastcashier.R
import
com.miya.fastcashier.beans.SelfCashierAccountInfo
import
com.miya.fastcashier.service.AccountService
...
...
@@ -19,6 +16,8 @@ import android.view.Gravity
import
android.view.View
import
com.miya.fastcashier.BuildConfig
import
com.miya.fastcashier.databinding.DialogSystemParameterBinding
import
com.miya.fastcashier.utils.*
import
java.util.*
class
SystemParameterDialog
(
context
:
Context
)
:
Dialog
(
context
,
R
.
style
.
CommonDialog
)
{
...
...
@@ -46,7 +45,10 @@ class SystemParameterDialog(context: Context) : Dialog(context, R.style.CommonDi
setInfo
(
viewBinding
.
tvEquipment
,
"sunmi_v2pro"
)
setInfo
(
viewBinding
.
tvServerUrl
,
baseUrl
)
setInfo
(
viewBinding
.
tvWifiName
,
getWifyName
(
context
))
setInfo
(
viewBinding
.
tvNetIp
,
if
(
getNetIp
(
context
)
==
null
)
"未知"
else
getNetIp
(
context
))
setInfo
(
viewBinding
.
tvLog
,
"${getVersionCode(context)}_${DateUtils.format8(Date())}.txt"
)
setInfo
(
viewBinding
.
tvPrintType
,
if
(
PrinterManager
.
getInstance
().
printer
==
null
)
context
.
resources
.
getString
(
R
.
string
.
app_unkown
)
else
PrinterManager
.
getInstance
().
printer
.
printerName
...
...
app/src/main/java/com/miya/fastcashier/service/PrintService.kt
View file @
e425d871
...
...
@@ -70,7 +70,7 @@ object PrintService {
serialNumber
)
Timer
().
schedule
(
3
000
)
{
Timer
().
schedule
(
4
000
)
{
printCustomer
(
printer
,
payServiceResponse
,
...
...
@@ -275,7 +275,7 @@ object PrintService {
payServiceResponse
,
selfCashierAccountInfo
)
Timer
().
schedule
(
3
000
)
{
Timer
().
schedule
(
4
000
)
{
refundPrintCustomer
(
printer
,
payServiceResponse
,
...
...
app/src/main/java/com/miya/fastcashier/utils/BaseFunction.kt
View file @
e425d871
...
...
@@ -103,6 +103,18 @@ fun getVersion(context: Context): String? {
return
version
}
fun
getVersionCode
(
context
:
Context
):
String
?
{
val
packageManager
=
context
.
packageManager
val
packageInfo
:
PackageInfo
var
version
=
""
try
{
packageInfo
=
packageManager
.
getPackageInfo
(
context
.
packageName
,
0
)
version
=
"${packageInfo.versionCode}"
}
catch
(
e
:
PackageManager
.
NameNotFoundException
)
{
e
.
printStackTrace
()
}
return
version
}
/**
* 判断是否有网络连接
...
...
app/src/main/res/layout/dialog_system_parameter.xml
View file @
e425d871
...
...
@@ -277,18 +277,18 @@
app:layout_constraintTop_toTopOf=
"@id/tv_wifi_name_text"
/>
<TextView
android:id=
"@+id/tv_
net_ip
_text"
android:id=
"@+id/tv_
log
_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"
网络IP
"
android:text=
"
日志名称
"
android:textColor=
"@color/color_333333"
android:textSize=
"30sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_wifi_name_text"
/>
<TextView
android:id=
"@+id/tv_
net_ip
"
android:id=
"@+id/tv_
log
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"right"
...
...
@@ -296,7 +296,7 @@
android:textColor=
"@color/color_333333"
android:textSize=
"30sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_
net_ip
_text"
/>
app:layout_constraintTop_toTopOf=
"@id/tv_
log
_text"
/>
<TextView
android:id=
"@+id/tv_print_type_text"
...
...
@@ -307,7 +307,7 @@
android:textColor=
"@color/color_333333"
android:textSize=
"30sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_
net_ip
_text"
/>
app:layout_constraintTop_toBottomOf=
"@id/tv_
log
_text"
/>
<TextView
android:id=
"@+id/tv_print_type"
...
...
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