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
449adba4
Commit
449adba4
authored
May 31, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
类位置整理并调整
parent
33fe602c
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
90 additions
and
66 deletions
+90
-66
build.gradle
app/build.gradle
+3
-0
LoginRequest.kt
app/src/main/java/com/miya/fastcashier/beans/LoginRequest.kt
+0
-7
PayDataDao.kt
app/src/main/java/com/miya/fastcashier/dao/PayDataDao.kt
+0
-2
PayDatabase.kt
app/src/main/java/com/miya/fastcashier/dao/PayDatabase.kt
+0
-3
ViewPayOrderData.kt
...rc/main/java/com/miya/fastcashier/dao/ViewPayOrderData.kt
+1
-2
LFilePickerActivity.java
...in/java/com/miya/fastcashier/log/LFilePickerActivity.java
+2
-3
SystemParameterDialog.kt
...in/java/com/miya/fastcashier/log/SystemParameterDialog.kt
+1
-1
ApiRequest.kt
app/src/main/java/com/miya/fastcashier/net/ApiRequest.kt
+23
-5
ApiService.kt
app/src/main/java/com/miya/fastcashier/net/ApiService.kt
+4
-3
RequestSignInterceptor.kt
...n/java/com/miya/fastcashier/net/RequestSignInterceptor.kt
+1
-1
BaseBean.java
...src/main/java/com/miya/fastcashier/net/bean/BaseBean.java
+2
-2
SelfCashierAccountInfo.java
...com/miya/fastcashier/net/bean/SelfCashierAccountInfo.java
+2
-2
SelfCashierTerminalConfig.java
.../miya/fastcashier/net/bean/SelfCashierTerminalConfig.java
+2
-2
ViewOrderStatisticsInfo.java
...om/miya/fastcashier/net/bean/ViewOrderStatisticsInfo.java
+2
-2
LoginFormState.kt
...ain/java/com/miya/fastcashier/net/param/LoginFormState.kt
+1
-1
LoginParams.kt
...c/main/java/com/miya/fastcashier/net/param/LoginParams.kt
+7
-0
AccountService.kt
.../main/java/com/miya/fastcashier/service/AccountService.kt
+1
-2
PrintService.kt
...rc/main/java/com/miya/fastcashier/service/PrintService.kt
+2
-2
AliPayCodeActivity.kt
...c/main/java/com/miya/fastcashier/ui/AliPayCodeActivity.kt
+1
-1
PayActivity.kt
app/src/main/java/com/miya/fastcashier/ui/PayActivity.kt
+1
-1
PayCodeActivity.kt
app/src/main/java/com/miya/fastcashier/ui/PayCodeActivity.kt
+1
-1
PayResultActivity.kt
...rc/main/java/com/miya/fastcashier/ui/PayResultActivity.kt
+1
-3
PriceInputActivity.kt
...c/main/java/com/miya/fastcashier/ui/PriceInputActivity.kt
+1
-1
RefundActivity.kt
app/src/main/java/com/miya/fastcashier/ui/RefundActivity.kt
+0
-3
SearchOrderActivity.kt
.../main/java/com/miya/fastcashier/ui/SearchOrderActivity.kt
+1
-1
WxPayCodeActivity.kt
...rc/main/java/com/miya/fastcashier/ui/WxPayCodeActivity.kt
+1
-1
LoginViewModel.kt
...ain/java/com/miya/fastcashier/viewmodel/LoginViewModel.kt
+5
-4
MainViewModel.kt
...main/java/com/miya/fastcashier/viewmodel/MainViewModel.kt
+1
-1
PayViewModel.kt
.../main/java/com/miya/fastcashier/viewmodel/PayViewModel.kt
+1
-1
SearchOrderViewModel.kt
...va/com/miya/fastcashier/viewmodel/SearchOrderViewModel.kt
+1
-1
build.gradle
lib_common/build.gradle
+0
-3
IntentExtra.kt
...ain/java/com/fastcashier/lib_common/config/IntentExtra.kt
+1
-1
ApiConfig.kt
...src/main/java/com/fastcashier/lib_common/net/ApiConfig.kt
+18
-0
MiyaHttpLoggingInterceptor.java
...astcashier/lib_common/net/MiyaHttpLoggingInterceptor.java
+1
-2
SSLCertificatesInit.java
...a/com/fastcashier/lib_common/net/SSLCertificatesInit.java
+1
-1
No files found.
app/build.gradle
View file @
449adba4
plugins
{
id
'com.android.application'
id
'kotlin-android'
id
'kotlin-kapt'
}
apply
from:
'../versions.gradle'
...
...
@@ -68,6 +69,8 @@ android {
dependencies
{
implementation
project
(
':lib_common'
)
kapt
'androidx.room:room-compiler:2.4.0'
implementation
'androidx.room:room-runtime:2.4.0'
implementation
'com.rengwuxian.materialedittext:library:2.1.4'
implementation
'com.github.GrenderG:Toasty:1.5.2'
...
...
app/src/main/java/com/miya/fastcashier/beans/LoginRequest.kt
deleted
100644 → 0
View file @
33fe602c
package
com.miya.fastcashier.beans
import
com.google.gson.annotations.SerializedName
data class
LoginRequest
(
@SerializedName
(
"username"
)
val
username
:
String
,
@SerializedName
(
"password"
)
val
password
:
String
,
@SerializedName
(
"serialNo"
)
val
serialNo
:
String
)
app/src/main/java/com/miya/fastcashier/dao/PayDataDao.kt
View file @
449adba4
package
com.miya.fastcashier.dao
import
androidx.room.*
import
com.miya.fastcashier.beans.ViewPayOrderData
import
com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
@Dao
...
...
app/src/main/java/com/miya/fastcashier/dao/PayDatabase.kt
View file @
449adba4
...
...
@@ -2,20 +2,17 @@ package com.miya.fastcashier.dao
import
androidx.room.Database
import
androidx.room.RoomDatabase
import
com.miya.fastcashier.beans.ViewPayOrderData
import
androidx.room.Room
import
com.miya.fastcashier.utils.ContextUtils
import
androidx.sqlite.db.SupportSQLiteDatabase
import
androidx.room.migration.Migration
@Database
(
entities
=
[
ViewPayOrderData
::
class
],
exportSchema
=
false
,
version
=
2
)
abstract
class
PayDatabase
:
RoomDatabase
()
{
abstract
fun
payDataDao
():
PayDataDao
}
class
DatabaseKeeper
{
companion
object
{
...
...
app/src/main/java/com/miya/fastcashier/
beans
/ViewPayOrderData.kt
→
app/src/main/java/com/miya/fastcashier/
dao
/ViewPayOrderData.kt
View file @
449adba4
package
com.miya.fastcashier.
beans
package
com.miya.fastcashier.
dao
import
android.text.TextUtils
import
androidx.room.Entity
import
androidx.room.PrimaryKey
import
com.fastcashier.lib_common.util.isEmpty
import
com.miya.fastcashier.dao.DatabaseKeeper
import
com.miya.fastcashier.service.AccountService
import
com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import
java.lang.RuntimeException
...
...
app/src/main/java/com/miya/fastcashier/log/LFilePickerActivity.java
View file @
449adba4
...
...
@@ -18,8 +18,7 @@ import com.blankj.utilcode.util.StringUtils;
import
com.fastcashier.lib_common.BuildConfig
;
import
com.fastcashier.lib_common.net.CommonCallback
;
import
com.miya.fastcashier.R
;
import
com.miya.fastcashier.beans.SelfCashierTerminalConfig
;
import
com.miya.fastcashier.net.ApiConfig
;
import
com.miya.fastcashier.net.bean.SelfCashierTerminalConfig
;
import
com.miya.fastcashier.net.ApiRequest
;
import
com.miya.fastcashier.net.ApiService
;
import
com.miya.fastcashier.service.AccountService
;
...
...
@@ -269,7 +268,7 @@ public class LFilePickerActivity extends BaseActivity {
File
file
=
new
File
(
path
);
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
""
),
file
);
MultipartBody
.
Part
part
=
MultipartBody
.
Part
.
createFormData
(
"logFile"
,
file
.
getName
(),
requestBody
);
String
ip
=
Api
Config
.
INSTANCE
.
getDataSourceIp
(
selfCashierTerminalConfig
,
equType
);
String
ip
=
Api
Request
.
Companion
.
getInstance
()
.
getDataSourceIp
(
selfCashierTerminalConfig
,
equType
);
if
(!
TextUtils
.
isEmpty
(
selfCashierTerminalConfig
.
getScoRuntimeConfig
().
getPlatformUrl
()))
{
ip
=
selfCashierTerminalConfig
.
getScoRuntimeConfig
().
getPlatformUrl
()
+
ApiService
.
Companion
.
getUPLOAD_LOG_FILE
();
...
...
app/src/main/java/com/miya/fastcashier/log/SystemParameterDialog.kt
View file @
449adba4
...
...
@@ -7,12 +7,12 @@ import android.view.View
import
android.view.WindowManager
import
android.widget.TextView
import
com.fastcashier.lib_common.BuildConfig
import
com.fastcashier.lib_common.net.ApiConfig.baseUrl
import
com.fastcashier.lib_common.util.getVersion
import
com.fastcashier.lib_common.util.getVersionCode
import
com.fastcashier.lib_common.util.getWifyName
import
com.miya.fastcashier.R
import
com.miya.fastcashier.databinding.DialogSystemParameterBinding
import
com.miya.fastcashier.net.ApiConfig.baseUrl
import
com.miya.fastcashier.service.AccountService.getAccountInfo
import
com.miya.fastcashier.utils.*
import
com.miya.print.PrinterManager
...
...
app/src/main/java/com/miya/fastcashier/net/ApiRequest.kt
View file @
449adba4
package
com.miya.fastcashier.net
import
android.text.TextUtils
import
android.util.Log
import
com.fastcashier.lib_common.BaseApplication
import
com.fastcashier.lib_common.net.ApiConfig
import
com.fastcashier.lib_common.net.CommonCallback
import
com.miya.fastcashier.MiyaApplication
import
com.miya.fastcashier.beans.LoginRequest
import
com.miya.fastcashier.beans.SelfCashierAccountInfo
import
com.fastcashier.lib_common.net.MiyaHttpLoggingInterceptor
import
com.fastcashier.lib_common.net.SSLCertificatesInit
import
com.miya.fastcashier.net.param.LoginParams
import
com.miya.fastcashier.net.bean.SelfCashierAccountInfo
import
com.miya.fastcashier.net.bean.SelfCashierTerminalConfig
import
com.miya.fastcashier.utils.LogFileUtils
import
okhttp3.MultipartBody
import
okhttp3.OkHttpClient
...
...
@@ -65,10 +69,10 @@ class ApiRequest private constructor() {
}
fun
login
(
login
Request
:
LoginRequest
,
login
Params
:
LoginParams
,
commonCallback
:
CommonCallback
<
SelfCashierAccountInfo
>
)
{
getApiService
().
login
(
login
Request
).
enqueue
(
commonCallback
)
getApiService
().
login
(
login
Params
).
enqueue
(
commonCallback
)
}
fun
uploadFile
(
...
...
@@ -78,4 +82,18 @@ class ApiRequest private constructor() {
)
{
getApiService
().
uploadFile
(
url
,
part
).
enqueue
(
commonCallback
)
}
fun
getDataSourceIp
(
selfCashierTerminalConfig
:
SelfCashierTerminalConfig
,
equType
:
String
):
String
?
{
if
(
selfCashierTerminalConfig
?.
scoRuntimeConfig
==
null
)
{
throw
RuntimeException
(
"DataSourceIpUtils SelfCashierTerminalConfig is null"
)
}
val
path
=
"${ApiService.UPLOAD_LOG_FILE}?equType=$equType"
return
if
(
TextUtils
.
isEmpty
(
selfCashierTerminalConfig
.
scoRuntimeConfig
.
erpIp
))
(
ApiConfig
.
baseUrl
+
path
)
else
selfCashierTerminalConfig
.
scoRuntimeConfig
.
erpIp
+
path
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/net/ApiService.kt
View file @
449adba4
package
com.miya.fastcashier.net
import
com.fastcashier.lib_common.net.ApiConfig
import
com.fastcashier.lib_common.net.BaseResponse
import
com.miya.fastcashier.
beans.LoginRequest
import
com.miya.fastcashier.
beans
.SelfCashierAccountInfo
import
com.miya.fastcashier.
net.param.LoginParams
import
com.miya.fastcashier.
net.bean
.SelfCashierAccountInfo
import
okhttp3.MultipartBody
import
retrofit2.Call
import
retrofit2.http.*
...
...
@@ -31,7 +32,7 @@ interface ApiService {
}
@POST
(
LOGIN
)
fun
login
(
@Body
login
RequestCall
:
LoginRequest
):
Call
<
BaseResponse
<
SelfCashierAccountInfo
>>
fun
login
(
@Body
login
Params
:
LoginParams
):
Call
<
BaseResponse
<
SelfCashierAccountInfo
>>
@Multipart
@POST
...
...
app/src/main/java/com/miya/fastcashier/net/RequestSignInterceptor.kt
View file @
449adba4
package
com.miya.fastcashier.net
import
com.
miya.fastcashier
.net.ApiConfig.getAuthorization
import
com.
fastcashier.lib_common
.net.ApiConfig.getAuthorization
import
com.miya.fastcashier.net.ApiService.Companion.wrapUrl
import
com.miya.fastcashier.service.AccountService.getAccountInfo
import
okhttp3.Interceptor
...
...
app/src/main/java/com/miya/fastcashier/
beans/BaseDO
.java
→
app/src/main/java/com/miya/fastcashier/
net/bean/BaseBean
.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
beans
;
package
com
.
miya
.
fastcashier
.
net
.
bean
;
import
java.io.Serializable
;
...
...
@@ -7,7 +7,7 @@ import java.io.Serializable;
* 基础DO类,提供toString快方法
* Created by fys on 2016/3/31.
*/
public
class
Base
DO
implements
Serializable
{
public
class
Base
Bean
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
app/src/main/java/com/miya/fastcashier/
beans
/SelfCashierAccountInfo.java
→
app/src/main/java/com/miya/fastcashier/
net/bean
/SelfCashierAccountInfo.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
beans
;
package
com
.
miya
.
fastcashier
.
net
.
bean
;
import
android.text.TextUtils
;
...
...
@@ -11,7 +11,7 @@ import java.util.List;
* 非米雅渠道 自助结算终端用户信息类
* Created by fengyu on 2018/4/8.
*/
public
class
SelfCashierAccountInfo
extends
Base
DO
{
public
class
SelfCashierAccountInfo
extends
Base
Bean
{
@SerializedName
(
"store"
)
private
SelfCashierAccountInfo
.
ShopInfo
shopInfo
;
...
...
app/src/main/java/com/miya/fastcashier/
beans
/SelfCashierTerminalConfig.java
→
app/src/main/java/com/miya/fastcashier/
net/bean
/SelfCashierTerminalConfig.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
beans
;
package
com
.
miya
.
fastcashier
.
net
.
bean
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -7,7 +7,7 @@ import java.util.List;
* 自助收银终端 应用配置信息
* Created by fengyu on 2018/6/28.
*/
public
class
SelfCashierTerminalConfig
extends
Base
DO
{
public
class
SelfCashierTerminalConfig
extends
Base
Bean
{
private
String
shopDiyParams
;
...
...
app/src/main/java/com/miya/fastcashier/
beans
/ViewOrderStatisticsInfo.java
→
app/src/main/java/com/miya/fastcashier/
net/bean
/ViewOrderStatisticsInfo.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
beans
;
package
com
.
miya
.
fastcashier
.
net
.
bean
;
import
android.text.TextUtils
;
...
...
@@ -9,7 +9,7 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ViewOrderStatisticsInfo
extends
Base
DO
{
public
class
ViewOrderStatisticsInfo
extends
Base
Bean
{
private
String
beginDate
;
private
String
endDate
;
...
...
app/src/main/java/com/miya/fastcashier/
beans
/LoginFormState.kt
→
app/src/main/java/com/miya/fastcashier/
net/param
/LoginFormState.kt
View file @
449adba4
package
com.miya.fastcashier.
beans
package
com.miya.fastcashier.
net.param
/**
* Data validation state of the login form.
...
...
app/src/main/java/com/miya/fastcashier/net/param/LoginParams.kt
0 → 100644
View file @
449adba4
package
com.miya.fastcashier.net.param
import
com.google.gson.annotations.SerializedName
data class
LoginParams
(
@SerializedName
(
"username"
)
val
username
:
String
,
@SerializedName
(
"password"
)
val
password
:
String
,
@SerializedName
(
"serialNo"
)
val
serialNo
:
String
)
app/src/main/java/com/miya/fastcashier/service/AccountService.kt
View file @
449adba4
package
com.miya.fastcashier.service
import
com.miya.fastcashier.beans.SelfCashierAccountInfo
import
com.sdy.miya.moblie.component.pay.platform.bean.MiyaOrderRefundResponse
import
com.miya.fastcashier.net.bean.SelfCashierAccountInfo
object
AccountService
{
...
...
app/src/main/java/com/miya/fastcashier/service/PrintService.kt
View file @
449adba4
...
...
@@ -2,8 +2,8 @@ package com.miya.fastcashier.service
import
android.text.TextUtils
import
com.fastcashier.lib_common.util.isEmpty
import
com.miya.fastcashier.
beans
.SelfCashierAccountInfo
import
com.miya.fastcashier.
beans
.ViewOrderStatisticsInfo
import
com.miya.fastcashier.
net.bean
.SelfCashierAccountInfo
import
com.miya.fastcashier.
net.bean
.ViewOrderStatisticsInfo
import
com.miya.fastcashier.utils.DateUtils
import
com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import
com.miya.fastcashier.utils.StringPriceFormat
...
...
app/src/main/java/com/miya/fastcashier/ui/AliPayCodeActivity.kt
View file @
449adba4
...
...
@@ -7,7 +7,7 @@ import androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.ViewModelProvider
import
com.alibaba.fastjson.JSON
import
com.blankj.utilcode.util.LogUtils
import
com.
miya.fastcashier
.config.IntentExtra
import
com.
fastcashier.lib_common
.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityAliPayCodeBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.StringPriceFormat
...
...
app/src/main/java/com/miya/fastcashier/ui/PayActivity.kt
View file @
449adba4
...
...
@@ -5,7 +5,7 @@ import android.os.Bundle
import
android.view.KeyEvent
import
android.widget.Toast
import
androidx.lifecycle.ViewModelProvider
import
com.
miya.fastcashier
.config.IntentExtra
import
com.
fastcashier.lib_common
.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityPayBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.ScanGunKeyEventHelper
...
...
app/src/main/java/com/miya/fastcashier/ui/PayCodeActivity.kt
View file @
449adba4
...
...
@@ -7,10 +7,10 @@ import androidx.appcompat.content.res.AppCompatResources
import
androidx.lifecycle.ViewModelProvider
import
com.alibaba.fastjson.JSON
import
com.blankj.utilcode.util.LogUtils
import
com.fastcashier.lib_common.config.IntentExtra
import
com.miya.fastcashier.R
import
com.miya.fastcashier.R.mipmap.ic_alipay
import
com.miya.fastcashier.R.mipmap.ic_wxpay
import
com.miya.fastcashier.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityPayCodeBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.StringPriceFormat
...
...
app/src/main/java/com/miya/fastcashier/ui/PayResultActivity.kt
View file @
449adba4
...
...
@@ -3,12 +3,10 @@ package com.miya.fastcashier.ui
import
android.content.Intent
import
android.os.Bundle
import
android.view.View
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.ViewModelProvider
import
com.
miya.fastcashier
.config.IntentExtra
import
com.
fastcashier.lib_common
.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityPayResultBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import
com.miya.fastcashier.utils.StringPriceFormat
import
com.miya.fastcashier.utils.clickWithTrigger
...
...
app/src/main/java/com/miya/fastcashier/ui/PriceInputActivity.kt
View file @
449adba4
...
...
@@ -6,8 +6,8 @@ import android.text.TextUtils
import
android.view.View
import
android.widget.Toast
import
androidx.lifecycle.ViewModelProvider
import
com.fastcashier.lib_common.config.IntentExtra
import
com.miya.fastcashier.R
import
com.miya.fastcashier.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityPriceInputBinding
import
com.miya.fastcashier.ui.dialog.CommonDialog
import
com.miya.fastcashier.ui.dialog.PayChooseDialog
...
...
app/src/main/java/com/miya/fastcashier/ui/RefundActivity.kt
View file @
449adba4
...
...
@@ -5,16 +5,13 @@ import android.os.Bundle
import
android.view.KeyEvent
import
android.widget.Toast
import
androidx.lifecycle.ViewModelProvider
import
com.miya.fastcashier.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityRefundBinding
import
com.miya.fastcashier.ui.dialog.MessageDialog
import
com.miya.fastcashier.ui.dialog.NumberManualDialog
import
com.miya.fastcashier.ui.dialog.NumberManualDialog.NumberInputListener
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.ScanGunKeyEventHelper
import
com.miya.fastcashier.utils.clickWithTrigger
import
com.miya.fastcashier.viewmodel.PayViewModel
import
com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
class
RefundActivity
:
BaseActivity
()
{
...
...
app/src/main/java/com/miya/fastcashier/ui/SearchOrderActivity.kt
View file @
449adba4
...
...
@@ -18,7 +18,7 @@ import com.elvishew.xlog.XLog
import
com.fastcashier.lib_common.util.dp2px
import
com.google.android.material.tabs.TabLayoutMediator
import
com.miya.fastcashier.R
import
com.miya.fastcashier.
beans
.ViewPayOrderData
import
com.miya.fastcashier.
dao
.ViewPayOrderData
import
com.miya.fastcashier.dao.PayDataDao
import
com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import
com.miya.fastcashier.databinding.FragmentSearchOrderBinding
...
...
app/src/main/java/com/miya/fastcashier/ui/WxPayCodeActivity.kt
View file @
449adba4
...
...
@@ -7,7 +7,7 @@ import androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.ViewModelProvider
import
com.alibaba.fastjson.JSON
import
com.blankj.utilcode.util.LogUtils
import
com.
miya.fastcashier
.config.IntentExtra
import
com.
fastcashier.lib_common
.config.IntentExtra
import
com.miya.fastcashier.databinding.ActivityWxPayCodeBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.StringPriceFormat
...
...
app/src/main/java/com/miya/fastcashier/viewmodel/LoginViewModel.kt
View file @
449adba4
...
...
@@ -6,9 +6,9 @@ import androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.fastcashier.lib_common.net.CommonCallback
import
com.miya.fastcashier.R
import
com.miya.fastcashier.
beans
.LoginFormState
import
com.miya.fastcashier.
beans.LoginRequest
import
com.miya.fastcashier.
beans
.SelfCashierAccountInfo
import
com.miya.fastcashier.
net.param
.LoginFormState
import
com.miya.fastcashier.
net.param.LoginParams
import
com.miya.fastcashier.
net.bean
.SelfCashierAccountInfo
import
com.miya.fastcashier.net.ApiRequest
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -23,7 +23,8 @@ class LoginViewModel : ViewModel() {
viewModelScope
.
launch
(
Dispatchers
.
IO
)
{
ApiRequest
.
getInstance
().
login
(
LoginRequest
(
userName
,
passWord
,
""
),
ApiRequest
.
getInstance
().
login
(
LoginParams
(
userName
,
passWord
,
""
),
object
:
CommonCallback
<
SelfCashierAccountInfo
>(){
override
fun
onSuccess
(
data
:
SelfCashierAccountInfo
)
{
loginLiveData
.
postValue
(
Result
.
success
(
data
))
...
...
app/src/main/java/com/miya/fastcashier/viewmodel/MainViewModel.kt
View file @
449adba4
...
...
@@ -3,7 +3,7 @@ package com.miya.fastcashier.viewmodel
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.miya.fastcashier.
beans
.ViewOrderStatisticsInfo
import
com.miya.fastcashier.
net.bean
.ViewOrderStatisticsInfo
import
com.miya.fastcashier.repository.PayRepository
import
com.miya.fastcashier.service.AccountService
import
com.miya.fastcashier.service.PrintService
...
...
app/src/main/java/com/miya/fastcashier/viewmodel/PayViewModel.kt
View file @
449adba4
...
...
@@ -6,7 +6,7 @@ import androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.alibaba.fastjson.JSON
import
com.elvishew.xlog.XLog
import
com.miya.fastcashier.
beans
.ViewPayOrderData
import
com.miya.fastcashier.
dao
.ViewPayOrderData
import
com.miya.fastcashier.repository.PayRepository
import
com.miya.fastcashier.service.AccountService
import
com.miya.fastcashier.service.PrintService
...
...
app/src/main/java/com/miya/fastcashier/viewmodel/SearchOrderViewModel.kt
View file @
449adba4
...
...
@@ -10,7 +10,7 @@ import com.miya.fastcashier.utils.DateUtils
import
com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
com.miya.fastcashier.
beans
.ViewPayOrderData
as
ViewPayOrderData1
import
com.miya.fastcashier.
dao
.ViewPayOrderData
as
ViewPayOrderData1
class
SearchOrderViewModel
:
ViewModel
()
{
...
...
lib_common/build.gradle
View file @
449adba4
plugins
{
id
'com.android.library'
id
'kotlin-android'
id
'kotlin-kapt'
}
android
{
...
...
@@ -60,8 +59,6 @@ dependencies {
api
'com.guolindev.permissionx:permissionx:1.6.1'
debugApi
'com.squareup.leakcanary:leakcanary-android:2.7'
api
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
kapt
'androidx.room:room-compiler:2.4.0'
api
'androidx.room:room-runtime:2.4.0'
api
'com.blankj:utilcode:1.30.0'
api
'androidx.multidex:multidex:2.0.0@aar'
...
...
app/src/main/java/com/miya/fastcashier
/config/IntentExtra.kt
→
lib_common/src/main/java/com/fastcashier/lib_common
/config/IntentExtra.kt
View file @
449adba4
package
com.
miya.fastcashier
.config
package
com.
fastcashier.lib_common
.config
interface
IntentExtra
{
companion
object
{
...
...
app/src/main/java/com/miya/fastcashier
/net/ApiConfig.kt
→
lib_common/src/main/java/com/fastcashier/lib_common
/net/ApiConfig.kt
View file @
449adba4
package
com.
miya.fastcashier
.net
package
com.
fastcashier.lib_common
.net
import
android.text.TextUtils
import
com.fastcashier.lib_common.BuildConfig
import
com.miya.fastcashier.beans.SelfCashierTerminalConfig
object
ApiConfig
{
private
const
val
BASE_URL
=
"https://hhms.miyapay.com/"
private
const
val
BASE_URL_4_TEST
=
"https://hhmspre.miyapay.com/"
private
const
val
BASE_URL_4_TEST
=
"https://hhmspre.miyapay.com/"
//未使用
@JvmStatic
val
baseUrl
:
String
...
...
@@ -17,18 +15,4 @@ object ApiConfig {
fun
getAuthorization
(
token
:
String
):
String
{
return
"bearer $token"
}
fun
getDataSourceIp
(
selfCashierTerminalConfig
:
SelfCashierTerminalConfig
,
equType
:
String
):
String
?
{
if
(
selfCashierTerminalConfig
?.
scoRuntimeConfig
==
null
)
{
throw
RuntimeException
(
"DataSourceIpUtils SelfCashierTerminalConfig is null"
)
}
val
path
=
"${ApiService.UPLOAD_LOG_FILE}?equType=$equType"
return
if
(
TextUtils
.
isEmpty
(
selfCashierTerminalConfig
.
scoRuntimeConfig
.
erpIp
))
(
baseUrl
+
path
)
else
selfCashierTerminalConfig
.
scoRuntimeConfig
.
erpIp
+
path
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier
/net/MiyaHttpLoggingInterceptor.java
→
lib_common/src/main/java/com/fastcashier/lib_common
/net/MiyaHttpLoggingInterceptor.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
net
;
package
com
.
fastcashier
.
lib_common
.
net
;
import
java.io.EOFException
;
import
java.io.IOException
;
...
...
@@ -22,7 +22,6 @@ import okio.BufferedSource;
/**
* 基于原本的MiyaHttpLoggingInterceptor,本类做了如下改动:
* <p>
* 1. 请求整体写入,响应整体写入。但是请求和响应本身并不同时整体写入
*/
public
final
class
MiyaHttpLoggingInterceptor
implements
Interceptor
{
...
...
app/src/main/java/com/miya/fastcashier
/net/SSLCertificatesInit.java
→
lib_common/src/main/java/com/fastcashier/lib_common
/net/SSLCertificatesInit.java
View file @
449adba4
package
com
.
miya
.
fastcashier
.
net
;
package
com
.
fastcashier
.
lib_common
.
net
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
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