Commit 4d2b8d91 authored by 赵鹏翔's avatar 赵鹏翔

抽取用户信息、支付、打印等的基础功能类,迁移至libcommon

parent 5da54f8d
...@@ -14,12 +14,12 @@ import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy ...@@ -14,12 +14,12 @@ import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import com.fastcashier.lib_common.BaseApplication import com.fastcashier.lib_common.BaseApplication
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.DateUtils
import com.miya.fastcashier.utils.ContextUtils import com.miya.fastcashier.utils.ContextUtils
import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.DensityUtils import com.miya.fastcashier.utils.DensityUtils
import com.miya.fastcashier.utils.LogFileUtils import com.miya.fastcashier.utils.LogFileUtils
import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit import com.miya.fastcashier.utils.manage.LocalKeyDataMKManageKit
import com.miya.fastcashier.utils.manage.OrderRecordManageKit
import com.miya.print.PrinterManager import com.miya.print.PrinterManager
import com.sdy.miya.moblie.component.pay.core.net.MiYaPayMobileApiClient import com.sdy.miya.moblie.component.pay.core.net.MiYaPayMobileApiClient
import com.sdy.miya.moblie.component.pay.core.net.MiyaHttpLoggingInterceptor import com.sdy.miya.moblie.component.pay.core.net.MiyaHttpLoggingInterceptor
......
...@@ -9,6 +9,7 @@ import android.widget.TextView ...@@ -9,6 +9,7 @@ import android.widget.TextView
import com.fastcashier.lib_common.BuildConfig import com.fastcashier.lib_common.BuildConfig
import com.fastcashier.lib_common.function.account.AccountService.getAccountInfo import com.fastcashier.lib_common.function.account.AccountService.getAccountInfo
import com.fastcashier.lib_common.net.ApiConfig.baseUrl import com.fastcashier.lib_common.net.ApiConfig.baseUrl
import com.fastcashier.lib_common.util.DateUtils
import com.fastcashier.lib_common.util.getVersion import com.fastcashier.lib_common.util.getVersion
import com.fastcashier.lib_common.util.getVersionCode import com.fastcashier.lib_common.util.getVersionCode
import com.fastcashier.lib_common.util.getWifyName import com.fastcashier.lib_common.util.getWifyName
......
...@@ -8,11 +8,11 @@ import androidx.lifecycle.ViewModelProvider ...@@ -8,11 +8,11 @@ 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.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.databinding.ActivityAliPayCodeBinding import com.miya.fastcashier.databinding.ActivityAliPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
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.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
...@@ -54,7 +54,7 @@ class AliPayCodeActivity : AppCompatActivity() { ...@@ -54,7 +54,7 @@ class AliPayCodeActivity : AppCompatActivity() {
extra?.let { extra?.let {
val payServiceResponse = it as PayServiceResponse val payServiceResponse = it as PayServiceResponse
LogUtils.e(JSON.toJSONString(payServiceResponse)) LogUtils.e(JSON.toJSONString(payServiceResponse))
tvPrice.text = "¥".plus(StringPriceFormat.transStringPriceToDecimalString( payServiceResponse.tradPrice)) tvPrice.text = "¥".plus(StringPriceFormatUtils.transStringPriceToDecimalString( payServiceResponse.tradPrice))
runBlocking(Dispatchers.IO) { runBlocking(Dispatchers.IO) {
val qrcode = BitmapUtils.createBarcodeBitmap(payServiceResponse.payQrCode, 9, 453, 453) val qrcode = BitmapUtils.createBarcodeBitmap(payServiceResponse.payQrCode, 9, 453, 453)
runOnUiThread { runOnUiThread {
......
...@@ -8,15 +8,16 @@ import androidx.appcompat.app.AppCompatActivity ...@@ -8,15 +8,16 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.function.print.PrintService
import com.fastcashier.lib_common.util.DateUtils
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityMainBinding import com.miya.fastcashier.databinding.ActivityMainBinding
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.CommonDialog
import com.miya.fastcashier.utils.* import com.miya.fastcashier.utils.*
import com.miya.fastcashier.utils.manage.AccountPasswordManageKit 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.viewmodel.MainViewModel import com.miya.fastcashier.viewmodel.MainViewModel
import java.util.* import java.util.*
......
...@@ -6,11 +6,11 @@ import android.view.KeyEvent ...@@ -6,11 +6,11 @@ import android.view.KeyEvent
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.miya.fastcashier.databinding.ActivityPayBinding import com.miya.fastcashier.databinding.ActivityPayBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
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.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import java.util.* import java.util.*
......
...@@ -8,12 +8,12 @@ import androidx.lifecycle.ViewModelProvider ...@@ -8,12 +8,12 @@ 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.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.R.mipmap.ic_alipay import com.miya.fastcashier.R.mipmap.ic_alipay
import com.miya.fastcashier.R.mipmap.ic_wxpay import com.miya.fastcashier.R.mipmap.ic_wxpay
import com.miya.fastcashier.databinding.ActivityPayCodeBinding import com.miya.fastcashier.databinding.ActivityPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
import com.miya.print.utils.BitmapUtils import com.miya.print.utils.BitmapUtils
...@@ -47,7 +47,7 @@ class PayCodeActivity : AppCompatActivity() { ...@@ -47,7 +47,7 @@ class PayCodeActivity : AppCompatActivity() {
extra?.let { extra?.let {
val payServiceResponse = it as PayServiceResponse val payServiceResponse = it as PayServiceResponse
LogUtils.e(JSON.toJSONString(payServiceResponse)) LogUtils.e(JSON.toJSONString(payServiceResponse))
tvPrice.text = "¥".plus(StringPriceFormat.transStringPriceToDecimalString( payServiceResponse.tradPrice)) tvPrice.text = "¥".plus(StringPriceFormatUtils.transStringPriceToDecimalString( payServiceResponse.tradPrice))
if(payServiceResponse.chanelTag == "1"){ if(payServiceResponse.chanelTag == "1"){
//初始化微信皮肤 //初始化微信皮肤
setTheme(R.style.Theme_MiYaFastCashier_Green) setTheme(R.style.Theme_MiYaFastCashier_Green)
......
...@@ -6,9 +6,9 @@ import android.view.View ...@@ -6,9 +6,9 @@ import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.databinding.ActivityPayResultBinding import com.miya.fastcashier.databinding.ActivityPayResultBinding
import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PrintViewModel import com.miya.fastcashier.viewmodel.PrintViewModel
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
...@@ -45,7 +45,8 @@ class PayResultActivity : AppCompatActivity() { ...@@ -45,7 +45,8 @@ class PayResultActivity : AppCompatActivity() {
val extra = intent.getSerializableExtra(IntentExtra.KEY_EXTRA_PAYSERVICERESPONSE) val extra = intent.getSerializableExtra(IntentExtra.KEY_EXTRA_PAYSERVICERESPONSE)
extra?.let { extra?.let {
val payServiceResponse = it as PayServiceResponse val payServiceResponse = it as PayServiceResponse
tvPayPrice.text = "¥".plus(StringPriceFormat.transStringPriceToDecimalString( tvPayPrice.text = "¥".plus(
StringPriceFormatUtils.transStringPriceToDecimalString(
payServiceResponse.tradPrice)) payServiceResponse.tradPrice))
tvOrderNo.text = payServiceResponse.shopTradeNo tvOrderNo.text = payServiceResponse.shopTradeNo
tvPayWay.text = MiYaPayPlantformPayWayEnum.MiyaPayType.find( tvPayWay.text = MiYaPayPlantformPayWayEnum.MiyaPayType.find(
......
...@@ -7,13 +7,13 @@ import android.view.View ...@@ -7,13 +7,13 @@ import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivityPriceInputBinding import com.miya.fastcashier.databinding.ActivityPriceInputBinding
import com.miya.fastcashier.ui.dialog.CommonDialog import com.miya.fastcashier.ui.dialog.CommonDialog
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
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.WordUtil import com.miya.fastcashier.utils.WordUtil
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.miya.fastcashier.viewmodel.PayViewModel import com.miya.fastcashier.viewmodel.PayViewModel
...@@ -78,7 +78,7 @@ class PriceInputActivity : BaseActivity() { ...@@ -78,7 +78,7 @@ class PriceInputActivity : BaseActivity() {
this.payServiceResponse = this.payServiceResponse =
intent.getSerializableExtra(IntentExtra.KEY_EXTRA_DATA) as PayServiceResponse intent.getSerializableExtra(IntentExtra.KEY_EXTRA_DATA) as PayServiceResponse
binding.tvRefundPriceTotal.text = binding.tvRefundPriceTotal.text =
"¥${StringPriceFormat.transStringPriceToDecimalString(payServiceResponse.tradPrice)}" "¥${StringPriceFormatUtils.transStringPriceToDecimalString(payServiceResponse.tradPrice)}"
binding.tvScanPayCode.visibility = View.GONE binding.tvScanPayCode.visibility = View.GONE
binding.tvGeneratePayCode.visibility = View.GONE binding.tvGeneratePayCode.visibility = View.GONE
binding.tvRefund.visibility = View.VISIBLE binding.tvRefund.visibility = View.VISIBLE
...@@ -224,7 +224,7 @@ class PriceInputActivity : BaseActivity() { ...@@ -224,7 +224,7 @@ class PriceInputActivity : BaseActivity() {
return@clickWithTrigger return@clickWithTrigger
} }
val priceYuan2Fen = StringPriceFormat.transStringYuan2Fen(price) val priceYuan2Fen = StringPriceFormatUtils.transStringYuan2Fen(price)
if (priceYuan2Fen.toDouble() > payServiceResponse.tradPrice.toDouble()) { if (priceYuan2Fen.toDouble() > payServiceResponse.tradPrice.toDouble()) {
binding.tvInvalidRefundPrice.visibility = View.VISIBLE binding.tvInvalidRefundPrice.visibility = View.VISIBLE
return@clickWithTrigger return@clickWithTrigger
...@@ -263,7 +263,7 @@ class PriceInputActivity : BaseActivity() { ...@@ -263,7 +263,7 @@ class PriceInputActivity : BaseActivity() {
showProgressDialog("退款中") showProgressDialog("退款中")
viewModel.refund( viewModel.refund(
payServiceResponse, payServiceResponse,
StringPriceFormat.getPayPriceFenStringFromYuan(refundPrice, "0") StringPriceFormatUtils.getPayPriceFenStringFromYuan(refundPrice, "0")
) )
} }
} }
......
...@@ -16,6 +16,9 @@ import androidx.recyclerview.widget.RecyclerView ...@@ -16,6 +16,9 @@ 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.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum
import com.fastcashier.lib_common.function.print.PrintService
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.fastcashier.lib_common.util.dp2px import com.fastcashier.lib_common.util.dp2px
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.miya.fastcashier.R import com.miya.fastcashier.R
...@@ -24,10 +27,7 @@ import com.miya.fastcashier.dao.ViewPayOrderData ...@@ -24,10 +27,7 @@ import com.miya.fastcashier.dao.ViewPayOrderData
import com.miya.fastcashier.databinding.ActivitySearchOrderBinding import com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import com.miya.fastcashier.databinding.FragmentSearchOrderBinding import com.miya.fastcashier.databinding.FragmentSearchOrderBinding
import com.miya.fastcashier.databinding.ItemSearchOrderListBinding import com.miya.fastcashier.databinding.ItemSearchOrderListBinding
import com.miya.fastcashier.service.PrintService
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
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
...@@ -240,7 +240,7 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) ...@@ -240,7 +240,7 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
binding.tvDateTitle.text = "下单时间" binding.tvDateTitle.text = "下单时间"
if (data.refundOrderNo != null && data.refundPrice != null) { if (data.refundOrderNo != null && data.refundPrice != null) {
binding.tvPrice.text = binding.tvPrice.text =
"¥" + StringPriceFormat.transStringPriceToDecimalString(data.refundPrice) "¥" + StringPriceFormatUtils.transStringPriceToDecimalString(data.refundPrice)
binding.tvOrderNo.text = data.refundOrderNo binding.tvOrderNo.text = data.refundOrderNo
binding.tvSerialNo.text = data.tradeNo binding.tvSerialNo.text = data.tradeNo
binding.tvOrderNoTitle.text = "退款订单号" binding.tvOrderNoTitle.text = "退款订单号"
...@@ -254,7 +254,7 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) ...@@ -254,7 +254,7 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
) )
} else { } else {
binding.tvPrice.text = binding.tvPrice.text =
"¥" + StringPriceFormat.transStringPriceToDecimalString(data.tradPrice) "¥" + StringPriceFormatUtils.transStringPriceToDecimalString(data.tradPrice)
binding.tvOrderNo.text = data.orderNo binding.tvOrderNo.text = data.orderNo
binding.tvOrderNoTitle.text = "订单号" binding.tvOrderNoTitle.text = "订单号"
binding.tvSerialNoTitle.text = "流水号" binding.tvSerialNoTitle.text = "流水号"
......
...@@ -8,11 +8,11 @@ import androidx.lifecycle.ViewModelProvider ...@@ -8,11 +8,11 @@ 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.fastcashier.lib_common.config.IntentExtra import com.fastcashier.lib_common.config.IntentExtra
import com.fastcashier.lib_common.function.pay.OrderRecordManageKit
import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding import com.miya.fastcashier.databinding.ActivityWxPayCodeBinding
import com.miya.fastcashier.utils.CenterToasty import com.miya.fastcashier.utils.CenterToasty
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.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
...@@ -53,7 +53,7 @@ class WxPayCodeActivity : AppCompatActivity() { ...@@ -53,7 +53,7 @@ class WxPayCodeActivity : AppCompatActivity() {
extra?.let { extra?.let {
val payServiceResponse = it as PayServiceResponse val payServiceResponse = it as PayServiceResponse
LogUtils.e(JSON.toJSONString(payServiceResponse)) LogUtils.e(JSON.toJSONString(payServiceResponse))
tvPrice.text = "¥".plus(StringPriceFormat.transStringPriceToDecimalString( payServiceResponse.tradPrice)) tvPrice.text = "¥".plus(StringPriceFormatUtils.transStringPriceToDecimalString( payServiceResponse.tradPrice))
runBlocking(Dispatchers.IO) { runBlocking(Dispatchers.IO) {
val qrcode = BitmapUtils.createBarcodeBitmap(payServiceResponse.payQrCode, 9, 453, 453) val qrcode = BitmapUtils.createBarcodeBitmap(payServiceResponse.payQrCode, 9, 453, 453)
runOnUiThread { runOnUiThread {
......
...@@ -9,15 +9,8 @@ import android.view.WindowManager ...@@ -9,15 +9,8 @@ import android.view.WindowManager
import android.widget.Button import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import android.widget.Toast
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.utils.CenterToasty
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.widget.DecimalKeyboard
import com.miya.fastcashier.widget.NumKeyboard import com.miya.fastcashier.widget.NumKeyboard
import com.rengwuxian.materialedittext.MaterialEditText
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import java.math.BigDecimal
/** /**
* 手动输入数字 * 手动输入数字
......
package com.miya.fastcashier.ui.dialog package com.miya.fastcashier.ui.dialog
import android.app.AlertDialog
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.view.Gravity import android.view.Gravity
import android.view.WindowManager import android.view.WindowManager
import android.widget.ImageButton
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import com.fastcashier.lib_common.util.StringPriceFormatUtils
import com.miya.fastcashier.R import com.miya.fastcashier.R
import com.miya.fastcashier.utils.StringPriceFormat
import com.miya.fastcashier.utils.clickWithTrigger import com.miya.fastcashier.utils.clickWithTrigger
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
...@@ -48,7 +45,7 @@ class RefundInfoDialog(context: Context) : Dialog(context) { ...@@ -48,7 +45,7 @@ class RefundInfoDialog(context: Context) : Dialog(context) {
fun setData(payServiceResponse: PayServiceResponse, action: (PayServiceResponse) -> Unit) { fun setData(payServiceResponse: PayServiceResponse, action: (PayServiceResponse) -> Unit) {
this.payServiceResponse = payServiceResponse this.payServiceResponse = payServiceResponse
tvPrice.text = tvPrice.text =
"¥${StringPriceFormat.transStringPriceToDecimalString(payServiceResponse.tradPrice)}" "¥${StringPriceFormatUtils.transStringPriceToDecimalString(payServiceResponse.tradPrice)}"
tvRefund.clickWithTrigger { tvRefund.clickWithTrigger {
action.invoke(payServiceResponse) action.invoke(payServiceResponse)
} }
......
...@@ -2,14 +2,13 @@ package com.miya.fastcashier.utils ...@@ -2,14 +2,13 @@ package com.miya.fastcashier.utils
import android.content.Context import android.content.Context
import android.content.pm.PackageInfo import android.content.pm.PackageInfo
import com.miya.fastcashier.utils.LogFileUtils
import android.content.pm.PackageManager import android.content.pm.PackageManager
import com.miya.fastcashier.utils.LogFileUtils.DeleteLogTask
import android.os.AsyncTask import android.os.AsyncTask
import android.os.Environment import android.os.Environment
import android.util.Log import android.util.Log
import com.fastcashier.lib_common.util.DateUtils
import com.fastcashier.lib_common.util.DateUtils.*
import java.io.* import java.io.*
import java.lang.Exception
import java.nio.charset.Charset import java.nio.charset.Charset
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
...@@ -52,7 +51,7 @@ object LogFileUtils { ...@@ -52,7 +51,7 @@ object LogFileUtils {
logFiles!!.mkdirs() logFiles!!.mkdirs()
} }
val logPath = (CACHE_FILE_PATH + getVersionCode(context) val logPath = (CACHE_FILE_PATH + getVersionCode(context)
+ "_" + DateUtils.format8(Date()) + ".txt") + "_" + format8(Date()) + ".txt")
logFile = File(logPath) logFile = File(logPath)
fos = FileOutputStream(logFile, true) fos = FileOutputStream(logFile, true)
writer = OutputStreamWriter(fos, Charset.forName("utf-8")) writer = OutputStreamWriter(fos, Charset.forName("utf-8"))
...@@ -162,7 +161,7 @@ object LogFileUtils { ...@@ -162,7 +161,7 @@ object LogFileUtils {
) + 1 ) + 1
) )
val fileNameLongTimes = val fileNameLongTimes =
DateUtils.stringToLong(fileNameDate, DateUtils.DF_YYYYMMDD) stringToLong(fileNameDate, DF_YYYYMMDD)
if (currentLongTimes - fileNameLongTimes >= days * 24L * 60L * 60L * 1000L) { //符合要求,加入删除列表 if (currentLongTimes - fileNameLongTimes >= days * 24L * 60L * 60L * 1000L) { //符合要求,加入删除列表
deleteFilePathList!!.add(File(fileBean.filePath)) deleteFilePathList!!.add(File(fileBean.filePath))
} }
......
...@@ -4,10 +4,10 @@ import androidx.lifecycle.MutableLiveData ...@@ -4,10 +4,10 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.miya.fastcashier.net.bean.ViewOrderStatisticsInfo import com.fastcashier.lib_common.function.pay.PayRepository
import com.miya.fastcashier.repository.PayRepository import com.fastcashier.lib_common.function.print.PrintService
import com.miya.fastcashier.service.PrintService import com.fastcashier.lib_common.function.print.ViewOrderStatisticsInfo
import com.miya.fastcashier.utils.DateUtils import com.fastcashier.lib_common.util.DateUtils
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
......
...@@ -7,9 +7,9 @@ import androidx.lifecycle.viewModelScope ...@@ -7,9 +7,9 @@ import androidx.lifecycle.viewModelScope
import com.alibaba.fastjson.JSON import com.alibaba.fastjson.JSON
import com.elvishew.xlog.XLog import com.elvishew.xlog.XLog
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.fastcashier.lib_common.function.pay.PayRepository
import com.fastcashier.lib_common.function.print.PrintService
import com.miya.fastcashier.dao.ViewPayOrderData import com.miya.fastcashier.dao.ViewPayOrderData
import com.miya.fastcashier.repository.PayRepository
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 kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
......
...@@ -4,7 +4,7 @@ import androidx.lifecycle.MutableLiveData ...@@ -4,7 +4,7 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.miya.fastcashier.service.PrintService import com.fastcashier.lib_common.function.print.PrintService
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
......
...@@ -4,10 +4,10 @@ import android.text.TextUtils ...@@ -4,10 +4,10 @@ import android.text.TextUtils
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.fastcashier.lib_common.function.pay.MiYaPayPlantformPayWayEnum
import com.fastcashier.lib_common.util.DateUtils
import com.fastcashier.lib_common.util.isEmpty import com.fastcashier.lib_common.util.isEmpty
import com.miya.fastcashier.dao.DatabaseKeeper import com.miya.fastcashier.dao.DatabaseKeeper
import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import com.miya.fastcashier.dao.ViewPayOrderData as ViewPayOrderData1 import com.miya.fastcashier.dao.ViewPayOrderData as ViewPayOrderData1
......
...@@ -4,7 +4,6 @@ import android.text.TextUtils; ...@@ -4,7 +4,6 @@ import android.text.TextUtils;
import com.fastcashier.lib_common.base.BaseBean; import com.fastcashier.lib_common.base.BaseBean;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
package com.miya.fastcashier.utils; package com.fastcashier.lib_common.function.pay;
public class MiYaPayPlantformPayWayEnum { public class MiYaPayPlantformPayWayEnum {
......
package com.miya.fastcashier.utils.manage package com.fastcashier.lib_common.function.pay
import com.miya.fastcashier.utils.DateUtils import com.fastcashier.lib_common.util.DateUtils
import com.tencent.mmkv.MMKV import com.tencent.mmkv.MMKV
import java.util.* import java.util.*
/** /**
* 类描述:订单流水记录MMKV管理 * 类描述:订单流水记录MMKV管理
* 属于基础功能-支付功能的数据处理部分
*/ */
class OrderRecordManageKit { class OrderRecordManageKit {
companion object { companion object {
......
package com.miya.fastcashier.repository package com.fastcashier.lib_common.function.pay
import android.text.TextUtils import android.text.TextUtils
import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread
import com.fastcashier.lib_common.function.account.AccountService import com.fastcashier.lib_common.function.account.AccountService
import com.miya.fastcashier.utils.DateUtils import com.fastcashier.lib_common.util.DateUtils
import com.sdy.miya.moblie.component.pay.core.constance.AppTagConstance import com.sdy.miya.moblie.component.pay.core.constance.AppTagConstance
import com.sdy.miya.moblie.component.pay.core.result.ResultBuilder import com.sdy.miya.moblie.component.pay.core.result.ResultBuilder
import com.sdy.miya.moblie.component.pay.platform.MiYaPlatformPayService import com.sdy.miya.moblie.component.pay.platform.MiYaPlatformPayService
......
package com.miya.fastcashier.net.bean; package com.fastcashier.lib_common.function.print;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -10,6 +10,14 @@ import java.math.BigDecimal; ...@@ -10,6 +10,14 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* 类描述:基础统计数据类
* 概述:仅用于打印的数据信息模型
* 创建人:zpxiang
* 创建时间:2022/6/1
* 修改人:
* 修改时间:
*/
public class ViewOrderStatisticsInfo extends BaseBean { public class ViewOrderStatisticsInfo extends BaseBean {
private String beginDate; private String beginDate;
......
package com.miya.fastcashier.utils; package com.fastcashier.lib_common.util;
import com.blankj.utilcode.util.StringUtils; import com.blankj.utilcode.util.StringUtils;
......
package com.miya.fastcashier.utils; package com.fastcashier.lib_common.util;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
/** public class StringPriceFormatUtils {
* Created by fengyu on 2018/4/17.
*/
public class StringPriceFormat {
/** /**
* 分转元 * 分转元
......
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