Commit 0bb3cb46 authored by zhaopengxiang's avatar zhaopengxiang

代码整理

parent 52208a37
package com.miya.fastcashier.service package com.miya.fastcashier.service
import android.text.TextUtils import android.text.TextUtils
import com.blankj.utilcode.util.LogUtils
import com.esc.LogUlit
import com.miya.fastcashier.beans.SelfCashierAccountInfo import com.miya.fastcashier.beans.SelfCashierAccountInfo
import com.miya.fastcashier.beans.ViewOrderStatisticsInfo import com.miya.fastcashier.beans.ViewOrderStatisticsInfo
import com.miya.fastcashier.utils.DateUtils import com.miya.fastcashier.utils.DateUtils
...@@ -10,15 +8,10 @@ import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum ...@@ -10,15 +8,10 @@ import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import com.miya.fastcashier.utils.StringPriceFormat import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.isEmpty import com.miya.fastcashier.utils.isEmpty
import com.miya.fastcashier.utils.manage.OrderRecordManageKit import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.print.BuildConfig
import com.miya.print.IPrinter import com.miya.print.IPrinter
import com.miya.print.PrinterManager import com.miya.print.PrinterManager
import com.miya.print.utils.Page58MmPrintUtils import com.miya.print.utils.Page58MmPrintUtils
import com.miya.print.utils.PrintLogger
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import java.lang.Exception
import java.lang.RuntimeException
import java.util.* import java.util.*
object PrintService { object PrintService {
......
package com.miya.fastcashier.ui package com.miya.fastcashier.ui
import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.res.ResourcesCompat
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.alibaba.fastjson.JSON import com.alibaba.fastjson.JSON
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.SizeUtils
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.databinding.ActivityAliPayCodeBinding import com.miya.fastcashier.databinding.ActivityAliPayCodeBinding
import com.miya.fastcashier.databinding.ActivityPayCodeBinding
import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.ui.dialog.PayChooseDialog
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.StringPriceFormat import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.OrderRecordManageKit import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import java.util.* import java.util.*
...@@ -54,8 +38,6 @@ class AliPayCodeActivity : AppCompatActivity() { ...@@ -54,8 +38,6 @@ class AliPayCodeActivity : AppCompatActivity() {
val llBack = binding.llBack val llBack = binding.llBack
val tvPrice = binding.tvPrice val tvPrice = binding.tvPrice
val kv = MMKV.defaultMMKV()
llBack.clickWithTrigger { finish() } llBack.clickWithTrigger { finish() }
val extra = intent.getSerializableExtra("payServiceResponse") val extra = intent.getSerializableExtra("payServiceResponse")
......
...@@ -13,7 +13,6 @@ import android.widget.EditText ...@@ -13,7 +13,6 @@ import android.widget.EditText
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.blankj.utilcode.util.FileUtils
import com.blankj.utilcode.util.ToastUtils import com.blankj.utilcode.util.ToastUtils
import com.miya.fastcashier.databinding.ActivityLoginBinding import com.miya.fastcashier.databinding.ActivityLoginBinding
import com.miya.fastcashier.service.AccountService import com.miya.fastcashier.service.AccountService
......
package com.miya.fastcashier.ui package com.miya.fastcashier.ui
import android.content.Intent import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.view.Gravity
import android.widget.Toast import android.widget.Toast
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityLoginBinding
import com.miya.fastcashier.databinding.ActivityMainBinding import com.miya.fastcashier.databinding.ActivityMainBinding
import com.miya.fastcashier.service.AccountService import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.service.PrintService import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.ui.dialog.MessageDialog
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.DateSelectHelper import com.miya.fastcashier.utils.DateSelectHelper
import com.miya.fastcashier.utils.DateUtils import com.miya.fastcashier.utils.DateUtils
...@@ -24,9 +17,6 @@ import com.miya.fastcashier.utils.manage.AccountPasswordManageKit ...@@ -24,9 +17,6 @@ import com.miya.fastcashier.utils.manage.AccountPasswordManageKit
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
import com.miya.fastcashier.utils.manage.OrderRecordManageKit import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.fastcashier.viewmodel.MainViewModel import com.miya.fastcashier.viewmodel.MainViewModel
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import java.lang.Exception
import java.util.* import java.util.*
class MainActivity : BaseActivity() { class MainActivity : BaseActivity() {
......
...@@ -6,14 +6,11 @@ import android.view.KeyEvent ...@@ -6,14 +6,11 @@ import android.view.KeyEvent
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.miya.fastcashier.databinding.ActivityPayBinding import com.miya.fastcashier.databinding.ActivityPayBinding
import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.ScanGunKeyEventHelper import com.miya.fastcashier.utils.ScanGunKeyEventHelper
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.OrderRecordManageKit import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.tencent.mmkv.MMKV
import java.util.* import java.util.*
......
...@@ -3,17 +3,13 @@ package com.miya.fastcashier.ui ...@@ -3,17 +3,13 @@ package com.miya.fastcashier.ui
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import android.view.Gravity
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.config.IntentExtra import com.miya.fastcashier.config.IntentExtra
import com.miya.fastcashier.databinding.ActivityPriceInputBinding import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.ui.dialog.CommonDialog import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.ui.dialog.MessageDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog import com.miya.fastcashier.ui.dialog.PayChooseDialog
import com.miya.fastcashier.ui.dialog.PayChooseDialog.GeneratePayCodeClickListener import com.miya.fastcashier.ui.dialog.PayChooseDialog.GeneratePayCodeClickListener
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
...@@ -24,7 +20,6 @@ import com.miya.fastcashier.viewmodel.PayViewModel ...@@ -24,7 +20,6 @@ import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.fastcashier.widget.DecimalKeyboard.DELETE import com.miya.fastcashier.widget.DecimalKeyboard.DELETE
import com.miya.fastcashier.widget.DecimalKeyboard.DOT import com.miya.fastcashier.widget.DecimalKeyboard.DOT
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import java.math.BigDecimal import java.math.BigDecimal
......
...@@ -4,17 +4,10 @@ import android.content.Context ...@@ -4,17 +4,10 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.Gravity
import com.blankj.utilcode.util.ToastUtils
import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityResetAuthorizePasswordBinding import com.miya.fastcashier.databinding.ActivityResetAuthorizePasswordBinding
import com.miya.fastcashier.databinding.ActivitySettingBinding
import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.AccountPasswordManageKit import com.miya.fastcashier.utils.manage.AccountPasswordManageKit
import com.tencent.mmkv.MMKV
class ResetAuthorizePasswordActivity : BaseActivity() { class ResetAuthorizePasswordActivity : BaseActivity() {
......
...@@ -9,13 +9,11 @@ import android.view.ViewGroup ...@@ -9,13 +9,11 @@ import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import androidx.core.content.res.ResourcesCompat import androidx.core.content.res.ResourcesCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
import com.elvishew.xlog.XLog import com.elvishew.xlog.XLog
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.beans.ViewPayOrderData import com.miya.fastcashier.beans.ViewPayOrderData
...@@ -28,8 +26,6 @@ import com.miya.fastcashier.service.PrintService ...@@ -28,8 +26,6 @@ import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.utils.* import com.miya.fastcashier.utils.*
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
import com.miya.fastcashier.viewmodel.SearchOrderViewModel import com.miya.fastcashier.viewmodel.SearchOrderViewModel
import com.miya.fastcashier.widget.Divider
import com.tencent.mmkv.MMKV
/** /**
* 查单列表 * 查单列表
......
...@@ -2,17 +2,13 @@ package com.miya.fastcashier.ui ...@@ -2,17 +2,13 @@ package com.miya.fastcashier.ui
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import com.blankj.utilcode.util.ToastUtils
import com.miya.fastcashier.BaseApplication import com.miya.fastcashier.BaseApplication
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivitySettingBinding import com.miya.fastcashier.databinding.ActivitySettingBinding
import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.ui.dialog.CommonDialog import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.tencent.mmkv.MMKV
class SettingActivity : BaseActivity() { class SettingActivity : BaseActivity() {
......
package com.miya.fastcashier.ui package com.miya.fastcashier.ui
import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.res.ResourcesCompat
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.alibaba.fastjson.JSON import com.alibaba.fastjson.JSON
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.SizeUtils
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.databinding.ActivityPayCodeBinding
import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding
import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.ui.dialog.PayChooseDialog
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.StringPriceFormat import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.utils.manage.OrderRecordManageKit import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import java.util.* import java.util.*
import kotlin.concurrent.timerTask
/** /**
* 微信付款码 * 微信付款码
...@@ -54,8 +37,6 @@ class WxPayCodeActivity : AppCompatActivity() { ...@@ -54,8 +37,6 @@ class WxPayCodeActivity : AppCompatActivity() {
val llBack = binding.llBack val llBack = binding.llBack
val tvPrice = binding.tvPrice val tvPrice = binding.tvPrice
val kv = MMKV.defaultMMKV()
llBack.clickWithTrigger { finish() } llBack.clickWithTrigger { finish() }
val extra = intent.getSerializableExtra("payServiceResponse") val extra = intent.getSerializableExtra("payServiceResponse")
......
...@@ -6,13 +6,12 @@ import androidx.lifecycle.viewModelScope ...@@ -6,13 +6,12 @@ import androidx.lifecycle.viewModelScope
import com.miya.fastcashier.service.AccountService import com.miya.fastcashier.service.AccountService
import com.miya.fastcashier.service.PrintService import com.miya.fastcashier.service.PrintService
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import com.tencent.mmkv.MMKV import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.* import kotlinx.coroutines.launch
class PrintViewModel : ViewModel() { class PrintViewModel : ViewModel() {
val printResultLiveData: MutableLiveData<Result<Any>> = MutableLiveData() val printResultLiveData: MutableLiveData<Result<Any>> = MutableLiveData()
val kv = MMKV.defaultMMKV()
fun printOrder(payServiceResponse: PayServiceResponse){ fun printOrder(payServiceResponse: PayServiceResponse){
//todo 检查参数 //todo 检查参数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment