Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TopPay
Overview
Overview
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
qyw
TopPay
Commits
9d39ad23
Commit
9d39ad23
authored
Oct 31, 2018
by
qyw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询ok
parent
599fa19f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
38 deletions
+150
-38
build.gradle
TOP_Pay/app/build.gradle
+1
-2
AndroidManifest.xml
TOP_Pay/app/src/main/AndroidManifest.xml
+1
-3
ConsumRecordReportAdapter.java
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/ConsumRecordReportAdapter.java
+35
-1
LocalRecordReportAdapter.java
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/LocalRecordReportAdapter.java
+35
-1
MainActivity.java
TOP_Pay/app/src/main/java/com/ifavine/pay/ui/activity/MainActivity.java
+43
-8
DialogMainSetUtils.java
TOP_Pay/app/src/main/java/com/ifavine/pay/utils/DialogMainSetUtils.java
+17
-6
DateUtil.java
TOP_Pay/app/src/main/java/com/ifavine/pay/view/datepicker/DateUtil.java
+7
-6
WindowCostAmount.java
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/WindowCostAmount.java
+2
-2
dialog_amt_set.xml
TOP_Pay/app/src/main/res/layout/dialog_amt_set.xml
+9
-9
No files found.
TOP_Pay/app/build.gradle
View file @
9d39ad23
...
@@ -61,8 +61,7 @@ dependencies {
...
@@ -61,8 +61,7 @@ dependencies {
compile
'com.gjiazhe:wavesidebar:1.3'
compile
'com.gjiazhe:wavesidebar:1.3'
compile
'com.nbsp:library:1.6'
compile
'com.nbsp:library:1.6'
compile
'com.github.sendtion:XRichText:1.1'
compile
'com.github.sendtion:XRichText:1.1'
compile
'me.yokeyword:swipebackfragment:0.3+'
+
compile
'me.yokeyword:swipebackfragment:0.3+'
'0'
// load with universal-image-loader
// load with universal-image-loader
compile
project
(
path:
':lib-zxing'
)
compile
project
(
path:
':lib-zxing'
)
compile
'pub.devrel:easypermissions:0.2.0'
compile
'pub.devrel:easypermissions:0.2.0'
...
...
TOP_Pay/app/src/main/AndroidManifest.xml
View file @
9d39ad23
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<!-- 向SDCard写入数据权限 -->
<!-- 向SDCard写入数据权限 -->
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_SETTINGS"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
<activity
android:name=
".ui.activity.WelcomeActivity"
android:name=
".ui.activity.WelcomeActivity"
android:keepScreenOn=
"true"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"landscape"
android:screenOrientation=
"landscape"
...
@@ -50,7 +49,6 @@
...
@@ -50,7 +49,6 @@
<activity
<activity
android:name=
".ui.activity.MainActivity"
android:name=
".ui.activity.MainActivity"
android:keepScreenOn=
"true"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"landscape"
android:screenOrientation=
"landscape"
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/ConsumRecordReportAdapter.java
View file @
9d39ad23
...
@@ -6,6 +6,7 @@ import android.widget.TextView;
...
@@ -6,6 +6,7 @@ import android.widget.TextView;
import
com.ifavine.pay.R
;
import
com.ifavine.pay.R
;
import
com.ifavine.pay.ui.base.ListBaseAdapter
;
import
com.ifavine.pay.ui.base.ListBaseAdapter
;
import
com.ifavine.pay.ui.base.SuperViewHolder
;
import
com.ifavine.pay.ui.base.SuperViewHolder
;
import
com.ifavine.pay.view.datepicker.DateUtil
;
import
com.ifavine.pay.vo.LocalRecordReport
;
import
com.ifavine.pay.vo.LocalRecordReport
;
/**
/**
...
@@ -42,10 +43,14 @@ public class ConsumRecordReportAdapter extends ListBaseAdapter<LocalRecordReport
...
@@ -42,10 +43,14 @@ public class ConsumRecordReportAdapter extends ListBaseAdapter<LocalRecordReport
TextView
V_Remark
=
holder
.
getView
(
R
.
id
.
V_Remark
);
TextView
V_Remark
=
holder
.
getView
(
R
.
id
.
V_Remark
);
TextView
V_TransactionNo
=
holder
.
getView
(
R
.
id
.
V_TransactionNo
);
TextView
V_TransactionNo
=
holder
.
getView
(
R
.
id
.
V_TransactionNo
);
TextView
V_WindowName
=
holder
.
getView
(
R
.
id
.
V_WindowName
);
TextView
V_WindowName
=
holder
.
getView
(
R
.
id
.
V_WindowName
);
V_no
.
setText
((
position
+
1
)
+
""
);
V_no
.
setText
((
position
+
1
)
+
""
);
V_AllowanceAmount
.
setText
(
q
.
AllowanceAmount
);
V_AllowanceAmount
.
setText
(
q
.
AllowanceAmount
);
V_Consumption
.
setText
(
q
.
Consumption
);
V_Consumption
.
setText
(
q
.
Consumption
);
V_ConsumptionDate
.
setText
(
q
.
ConsumptionDate
);
if
(
q
.
ConsumptionDate
!=
null
&&
q
.
ConsumptionDate
.
length
()
>
19
)
{
q
.
ConsumptionDate
=
q
.
ConsumptionDate
.
substring
(
0
,
19
);
}
V_ConsumptionDate
.
setText
(
q
.
ConsumptionDate
.
replaceAll
(
"T"
,
" "
));
V_Department
.
setText
(
q
.
Department
);
V_Department
.
setText
(
q
.
Department
);
V_DinnerAmount
.
setText
(
q
.
DinnerAmount
);
V_DinnerAmount
.
setText
(
q
.
DinnerAmount
);
V_DinnerType
.
setText
(
q
.
DinnerType
);
V_DinnerType
.
setText
(
q
.
DinnerType
);
...
@@ -55,5 +60,34 @@ public class ConsumRecordReportAdapter extends ListBaseAdapter<LocalRecordReport
...
@@ -55,5 +60,34 @@ public class ConsumRecordReportAdapter extends ListBaseAdapter<LocalRecordReport
V_Remark
.
setText
(
q
.
Remark
);
V_Remark
.
setText
(
q
.
Remark
);
V_TransactionNo
.
setText
(
q
.
TransactionNo
);
V_TransactionNo
.
setText
(
q
.
TransactionNo
);
V_WindowName
.
setText
(
q
.
WindowName
);
V_WindowName
.
setText
(
q
.
WindowName
);
if
(
q
.
Remark
!=
null
&&
q
.
Remark
.
contains
(
"失败"
))
{
V_no
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_AllowanceAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Consumption
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_ConsumptionDate
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Department
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_DinnerAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_DinnerType
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_EmpName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_EmpNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Post
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Remark
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_TransactionNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_WindowName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
}
else
{
V_no
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_AllowanceAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Consumption
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_ConsumptionDate
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Department
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_DinnerAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_DinnerType
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_EmpName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_EmpNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Post
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Remark
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_TransactionNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_WindowName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
}
}
}
}
}
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/LocalRecordReportAdapter.java
View file @
9d39ad23
...
@@ -48,7 +48,10 @@ public class LocalRecordReportAdapter extends ListBaseAdapter<LocalRecordReport>
...
@@ -48,7 +48,10 @@ public class LocalRecordReportAdapter extends ListBaseAdapter<LocalRecordReport>
V_AllowanceAmount
.
setText
(
q
.
AllowanceAmount
);
V_AllowanceAmount
.
setText
(
q
.
AllowanceAmount
);
V_CanteenName
.
setText
(
q
.
CanteenName
);
V_CanteenName
.
setText
(
q
.
CanteenName
);
V_Consumption
.
setText
(
q
.
Consumption
);
V_Consumption
.
setText
(
q
.
Consumption
);
V_ConsumptionDate
.
setText
(
q
.
ConsumptionDate
);
if
(
q
.
ConsumptionDate
!=
null
&&
q
.
ConsumptionDate
.
length
()
>
19
)
{
q
.
ConsumptionDate
=
q
.
ConsumptionDate
.
substring
(
0
,
19
);
}
V_ConsumptionDate
.
setText
(
q
.
ConsumptionDate
.
replaceAll
(
"T"
,
" "
));
V_Department
.
setText
(
q
.
Department
);
V_Department
.
setText
(
q
.
Department
);
V_DinnerAmount
.
setText
(
q
.
DinnerAmount
);
V_DinnerAmount
.
setText
(
q
.
DinnerAmount
);
V_DinnerType
.
setText
(
q
.
DinnerType
);
V_DinnerType
.
setText
(
q
.
DinnerType
);
...
@@ -58,5 +61,36 @@ public class LocalRecordReportAdapter extends ListBaseAdapter<LocalRecordReport>
...
@@ -58,5 +61,36 @@ public class LocalRecordReportAdapter extends ListBaseAdapter<LocalRecordReport>
V_Remark
.
setText
(
q
.
Remark
);
V_Remark
.
setText
(
q
.
Remark
);
V_TransactionNo
.
setText
(
q
.
TransactionNo
);
V_TransactionNo
.
setText
(
q
.
TransactionNo
);
V_WindowName
.
setText
(
q
.
WindowName
);
V_WindowName
.
setText
(
q
.
WindowName
);
if
(
q
.
Remark
!=
null
&&
q
.
Remark
.
contains
(
"失败"
))
{
V_no
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_AllowanceAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Consumption
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_ConsumptionDate
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Department
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_DinnerAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_DinnerType
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_EmpName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_EmpNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Post
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_Remark
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_TransactionNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_WindowName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
V_CanteenName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
red
));
}
else
{
V_no
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_AllowanceAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Consumption
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_ConsumptionDate
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Department
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_DinnerAmount
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_DinnerType
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_EmpName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_EmpNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Post
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_Remark
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_TransactionNo
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_WindowName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
V_CanteenName
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
font_black_20
));
}
}
}
}
}
TOP_Pay/app/src/main/java/com/ifavine/pay/ui/activity/MainActivity.java
View file @
9d39ad23
...
@@ -6,6 +6,7 @@ import android.media.SoundPool;
...
@@ -6,6 +6,7 @@ import android.media.SoundPool;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Message
;
import
android.provider.Settings
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.text.Editable
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
...
@@ -124,7 +125,6 @@ public class MainActivity extends BaseActivity {
...
@@ -124,7 +125,6 @@ public class MainActivity extends BaseActivity {
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
//支付提示
//支付提示
soundPool
=
new
SoundPool
(
3
,
AudioManager
.
STREAM_MUSIC
,
100
);
soundPool
=
new
SoundPool
(
3
,
AudioManager
.
STREAM_MUSIC
,
100
);
...
@@ -184,6 +184,10 @@ public class MainActivity extends BaseActivity {
...
@@ -184,6 +184,10 @@ public class MainActivity extends BaseActivity {
if
(
dateTime
==
0
)
{
if
(
dateTime
==
0
)
{
getServerDate
();
getServerDate
();
}
}
Current_Count
++;
if
(
Current_Count
>=
MAX_Mi
)
{
setSCREEN_OFF_TIMEOUT
();
}
handler
.
postDelayed
(
this
,
60
*
1000
);
handler
.
postDelayed
(
this
,
60
*
1000
);
}
}
};
};
...
@@ -207,9 +211,11 @@ public class MainActivity extends BaseActivity {
...
@@ -207,9 +211,11 @@ public class MainActivity extends BaseActivity {
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
updateCanTeenName
();
updateCanTeenName
();
getServerDate
();
getServerDate
();
initPayInfo
();
initPayInfo
();
}
}
@Override
@Override
...
@@ -261,6 +267,7 @@ public class MainActivity extends BaseActivity {
...
@@ -261,6 +267,7 @@ public class MainActivity extends BaseActivity {
@OnClick
({
R
.
id
.
tv_set
,
R
.
id
.
tv_table
,
R
.
id
.
tv_close
,
R
.
id
.
tv_reflesh
,
R
.
id
.
btn_pay
})
@OnClick
({
R
.
id
.
tv_set
,
R
.
id
.
tv_table
,
R
.
id
.
tv_close
,
R
.
id
.
tv_reflesh
,
R
.
id
.
btn_pay
})
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
Current_Count
=
0
;
switch
(
view
.
getId
())
{
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_set
:
case
R
.
id
.
tv_set
:
new
PopWindowMainSet
(
mContext
,
new
PopWindowMainSet
.
CallBackPosition
()
{
new
PopWindowMainSet
(
mContext
,
new
PopWindowMainSet
.
CallBackPosition
()
{
...
@@ -380,18 +387,21 @@ public class MainActivity extends BaseActivity {
...
@@ -380,18 +387,21 @@ public class MainActivity extends BaseActivity {
@Override
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
Log
.
e
(
"ggg"
,
"onTouchEvent"
);
Log
.
e
(
"ggg"
,
"onTouchEvent"
);
Current_Count
=
0
;
return
super
.
onTouchEvent
(
event
);
return
super
.
onTouchEvent
(
event
);
}
}
@Override
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
ev
)
{
public
boolean
dispatchTouchEvent
(
MotionEvent
ev
)
{
Log
.
e
(
"ggg"
,
"dispatchTouchEvent"
);
Log
.
e
(
"ggg"
,
"dispatchTouchEvent"
);
Current_Count
=
0
;
return
super
.
dispatchTouchEvent
(
ev
);
return
super
.
dispatchTouchEvent
(
ev
);
}
}
@Override
@Override
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
Log
.
e
(
"ggg"
,
"onKeyUp"
);
Log
.
e
(
"ggg"
,
"onKeyUp"
);
Current_Count
=
0
;
return
super
.
onKeyUp
(
keyCode
,
event
);
return
super
.
onKeyUp
(
keyCode
,
event
);
}
}
...
@@ -443,8 +453,21 @@ public class MainActivity extends BaseActivity {
...
@@ -443,8 +453,21 @@ public class MainActivity extends BaseActivity {
*/
*/
//线路处理
//线路处理
private
void
doPay
(
String
payCode
)
{
private
void
doPay
(
String
payCode
)
{
Current_Count
=
0
;
et_payCode
.
setText
(
null
);
et_payCode
.
setText
(
null
);
et_payCode
.
requestFocus
();
et_payCode
.
requestFocus
();
tv_EmpNo
.
setText
(
null
);
tv_EmpName
.
setText
(
null
);
tv_EmpDuty
.
setText
(
null
);
tv_EmpDept
.
setText
(
null
);
tv_SubCost
.
setText
(
null
);
tv_Consumption
.
setText
(
null
);
tv_Cost
.
setText
(
null
);
tv_IsConsumed
.
setText
(
null
);
tv_TradeNo
.
setText
(
null
);
tv_pay_status
.
setText
(
"支付中..."
);
tv_pay_status
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
font_black_20
));
String
Mac
=
SPUtil
.
getInstance
().
readString
(
"Mac"
);
String
Mac
=
SPUtil
.
getInstance
().
readString
(
"Mac"
);
String
DeviceNo
=
SPUtil
.
getInstance
().
readString
(
"DeviceNo"
);
String
DeviceNo
=
SPUtil
.
getInstance
().
readString
(
"DeviceNo"
);
Call
<
CommonResponse
<
String
>>
call
=
Call
<
CommonResponse
<
String
>>
call
=
...
@@ -457,10 +480,7 @@ public class MainActivity extends BaseActivity {
...
@@ -457,10 +480,7 @@ public class MainActivity extends BaseActivity {
if
(
response
.
body
()
==
null
)
{
if
(
response
.
body
()
==
null
)
{
return
;
return
;
}
}
if
(
response
.
body
().
Status
==
200
)
{
if
(
response
.
body
()
!=
null
)
{
soundPool
.
play
(
soundSucess
,
1
,
1
,
0
,
0
,
1
);
tv_pay_status
.
setText
(
"支付成功"
);
tv_pay_status
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
green
));
tv_EmpNo
.
setText
(
response
.
body
().
EmpNo
);
tv_EmpNo
.
setText
(
response
.
body
().
EmpNo
);
tv_EmpName
.
setText
(
response
.
body
().
EmpName
);
tv_EmpName
.
setText
(
response
.
body
().
EmpName
);
tv_EmpDuty
.
setText
(
response
.
body
().
EmpDuty
);
tv_EmpDuty
.
setText
(
response
.
body
().
EmpDuty
);
...
@@ -470,6 +490,11 @@ public class MainActivity extends BaseActivity {
...
@@ -470,6 +490,11 @@ public class MainActivity extends BaseActivity {
tv_Cost
.
setText
(
response
.
body
().
Cost
);
tv_Cost
.
setText
(
response
.
body
().
Cost
);
tv_IsConsumed
.
setText
(
response
.
body
().
IsConsumed
);
tv_IsConsumed
.
setText
(
response
.
body
().
IsConsumed
);
tv_TradeNo
.
setText
(
response
.
body
().
TradeNo
);
tv_TradeNo
.
setText
(
response
.
body
().
TradeNo
);
}
if
(
response
.
body
().
Status
==
200
)
{
soundPool
.
play
(
soundSucess
,
1
,
1
,
0
,
0
,
1
);
tv_pay_status
.
setText
(
"支付成功"
);
tv_pay_status
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
green
));
}
else
{
}
else
{
soundPool
.
play
(
soundFail
,
1
,
1
,
0
,
0
,
1
);
soundPool
.
play
(
soundFail
,
1
,
1
,
0
,
0
,
1
);
tv_pay_status
.
setText
(
response
.
body
().
Message
);
tv_pay_status
.
setText
(
response
.
body
().
Message
);
...
@@ -588,9 +613,9 @@ public class MainActivity extends BaseActivity {
...
@@ -588,9 +613,9 @@ public class MainActivity extends BaseActivity {
private
boolean
getTimeCompare
(
String
start
,
String
end
)
{
private
boolean
getTimeCompare
(
String
start
,
String
end
)
{
String
date
=
DateUtil
.
formatDate
(
dateTime
,
"yyyy-MM-dd"
);
String
date
=
DateUtil
.
formatDate
(
dateTime
,
"yyyy-MM-dd"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm
:ss
"
);
String
startDate
=
date
+
" "
+
start
;
String
startDate
=
date
+
" "
+
start
+
":00"
;
String
endDate
=
date
+
" "
+
end
;
String
endDate
=
date
+
" "
+
end
+
":59"
;
try
{
try
{
Date
s
=
df
.
parse
(
startDate
);
Date
s
=
df
.
parse
(
startDate
);
Date
e
=
df
.
parse
(
endDate
);
Date
e
=
df
.
parse
(
endDate
);
...
@@ -603,4 +628,14 @@ public class MainActivity extends BaseActivity {
...
@@ -603,4 +628,14 @@ public class MainActivity extends BaseActivity {
return
false
;
return
false
;
}
}
private
final
static
int
MAX_Mi
=
10
;
private
int
Current_Count
=
0
;
/**
* 设置锁屏 60分钟没有消费操作锁屏
*/
private
void
setSCREEN_OFF_TIMEOUT
()
{
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
Settings
.
System
.
putInt
(
getContentResolver
(),
android
.
provider
.
Settings
.
System
.
SCREEN_OFF_TIMEOUT
,
10
*
1000
);
}
}
}
TOP_Pay/app/src/main/java/com/ifavine/pay/utils/DialogMainSetUtils.java
View file @
9d39ad23
...
@@ -405,8 +405,18 @@ public class DialogMainSetUtils {
...
@@ -405,8 +405,18 @@ public class DialogMainSetUtils {
View
.
OnClickListener
cancelListener
,
boolean
cancelable
)
{
View
.
OnClickListener
cancelListener
,
boolean
cancelable
)
{
// 数据来源
// 数据来源
String
data
=
SPUtil
.
getInstance
().
readString
(
"WindowCostAmounts"
);
String
data
=
SPUtil
.
getInstance
().
readString
(
"WindowCostAmounts"
);
final
List
<
WindowCostAmount
>
DATA
=
gson
.
fromJson
(
data
,
new
TypeToken
<
List
<
WindowCostAmount
>>()
{
final
List
<
WindowCostAmount
>
DATA
=
new
ArrayList
<>();
final
List
<
WindowCostAmount
>
D
=
gson
.
fromJson
(
data
,
new
TypeToken
<
List
<
WindowCostAmount
>>()
{
}.
getType
());
}.
getType
());
if
(
D
==
null
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
WindowCostAmount
wca
=
new
WindowCostAmount
();
wca
.
DinnerType
=
(
i
+
1
)
+
""
;
DATA
.
add
(
wca
);
}
}
else
{
DATA
.
addAll
(
D
);
}
View
view
=
View
.
inflate
(
mContext
,
R
.
layout
.
dialog_amt_set
,
null
);
View
view
=
View
.
inflate
(
mContext
,
R
.
layout
.
dialog_amt_set
,
null
);
final
Dialog
dialog
=
new
Dialog
(
mContext
,
R
.
style
.
dialog_common
);
// 创建自定义样式dialog
final
Dialog
dialog
=
new
Dialog
(
mContext
,
R
.
style
.
dialog_common
);
// 创建自定义样式dialog
...
@@ -439,10 +449,10 @@ public class DialogMainSetUtils {
...
@@ -439,10 +449,10 @@ public class DialogMainSetUtils {
AmountView
amt6
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt6
);
AmountView
amt6
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt6
);
AmountView
amt7
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt7
);
AmountView
amt7
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt7
);
AmountView
amt8
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt8
);
AmountView
amt8
=
(
AmountView
)
view
.
findViewById
(
R
.
id
.
amt8
);
final
EditText
et1
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
et_amt1
);
final
TextView
et1
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
et_amt1
);
final
EditText
et2
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
et_amt2
);
final
TextView
et2
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
et_amt2
);
final
EditText
et3
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
et_amt3
);
final
TextView
et3
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
et_amt3
);
final
EditText
et4
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
et_amt4
);
final
TextView
et4
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
et_amt4
);
TextView
tv_title
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
dialog_title
);
TextView
tv_title
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
dialog_title
);
ImageView
iv_cancel
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
iv_cancel
);
ImageView
iv_cancel
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
iv_cancel
);
...
@@ -807,6 +817,7 @@ public class DialogMainSetUtils {
...
@@ -807,6 +817,7 @@ public class DialogMainSetUtils {
SpinnerAdapter
adapter2
=
new
SpinnerAdapter
(
mContext
,
SpinnerAdapter
adapter2
=
new
SpinnerAdapter
(
mContext
,
android
.
R
.
layout
.
simple_spinner_item
,
options2
);
android
.
R
.
layout
.
simple_spinner_item
,
options2
);
spinner2
.
setAdapter
(
adapter2
);
spinner2
.
setAdapter
(
adapter2
);
spinner2
.
setSelection
(
1
);
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
tv_title
.
setText
(
title
);
tv_title
.
setText
(
title
);
...
@@ -1075,7 +1086,7 @@ public class DialogMainSetUtils {
...
@@ -1075,7 +1086,7 @@ public class DialogMainSetUtils {
SpinnerAdapter
adapter2
=
new
SpinnerAdapter
(
mContext
,
SpinnerAdapter
adapter2
=
new
SpinnerAdapter
(
mContext
,
android
.
R
.
layout
.
simple_spinner_item
,
options2
);
android
.
R
.
layout
.
simple_spinner_item
,
options2
);
spinner2
.
setAdapter
(
adapter2
);
spinner2
.
setAdapter
(
adapter2
);
spinner2
.
setSelection
(
1
);
//窗口设置
//窗口设置
String
CanTeenCode
=
SPUtil
.
getInstance
().
readString
(
"CanTeenCode"
);
String
CanTeenCode
=
SPUtil
.
getInstance
().
readString
(
"CanTeenCode"
);
String
data
=
SPUtil
.
getInstance
().
readString
(
"CanteenWindows"
);
String
data
=
SPUtil
.
getInstance
().
readString
(
"CanteenWindows"
);
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/view/datepicker/DateUtil.java
View file @
9d39ad23
...
@@ -84,16 +84,17 @@ public class DateUtil {
...
@@ -84,16 +84,17 @@ public class DateUtil {
}
}
public
static
String
formatDate
(
String
date
,
String
format
)
{
public
static
String
formatDate
(
String
date
,
String
inFormat
,
String
outFormat
)
{
String
resultD
=
date
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
format
);
SimpleDateFormat
in
=
new
SimpleDateFormat
(
inFormat
);
SimpleDateFormat
out
=
new
SimpleDateFormat
(
outFormat
);
try
{
try
{
Date
d
=
sdf
.
parse
(
date
);
Date
d
=
in
.
parse
(
date
);
re
sultD
=
sdf
.
format
(
d
);
re
turn
out
.
format
(
d
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
resultD
;
return
null
;
}
}
public
static
String
formatDate
(
long
milliseconds
,
String
format
)
{
public
static
String
formatDate
(
long
milliseconds
,
String
format
)
{
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/WindowCostAmount.java
View file @
9d39ad23
...
@@ -21,8 +21,8 @@ public class WindowCostAmount extends Entity {
...
@@ -21,8 +21,8 @@ public class WindowCostAmount extends Entity {
public
String
DinnerType
;
public
String
DinnerType
;
public
double
DinnerAmount
;
public
double
DinnerAmount
;
public
double
AllowanceAmount
;
public
double
AllowanceAmount
;
public
String
StartTime
;
public
String
StartTime
=
"00:00"
;
public
String
EndTime
;
public
String
EndTime
=
"00:00"
;
public
String
MacAddress
;
public
String
MacAddress
;
...
...
TOP_Pay/app/src/main/res/layout/dialog_amt_set.xml
View file @
9d39ad23
...
@@ -195,7 +195,7 @@
...
@@ -195,7 +195,7 @@
app:btnWidth=
"36dp"
app:btnWidth=
"36dp"
app:tvWidth=
"120dp"
/>
app:tvWidth=
"120dp"
/>
<
EditText
<
TextView
android:id=
"@+id/et_amt1"
android:id=
"@+id/et_amt1"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
...
@@ -207,7 +207,7 @@
...
@@ -207,7 +207,7 @@
android:minHeight=
"40dp"
android:minHeight=
"40dp"
android:paddingLeft=
"5dp"
android:paddingLeft=
"5dp"
android:textColor=
"@color/font_black_32"
android:textColor=
"@color/font_black_32"
android:textSize=
"
16
sp"
/>
android:textSize=
"
25
sp"
/>
<TextView
<TextView
android:id=
"@+id/tv_date1"
android:id=
"@+id/tv_date1"
...
@@ -271,7 +271,7 @@
...
@@ -271,7 +271,7 @@
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:gravity=
"center"
android:gravity=
"center"
android:paddingTop=
"10dp"
android:paddingTop=
"10dp"
app:btnTextSize=
"
25
sp"
app:btnTextSize=
"
30
sp"
app:btnWidth=
"36dp"
app:btnWidth=
"36dp"
app:tvWidth=
"120dp"
/>
app:tvWidth=
"120dp"
/>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
app:btnWidth=
"36dp"
app:btnWidth=
"36dp"
app:tvWidth=
"120dp"
/>
app:tvWidth=
"120dp"
/>
<
EditText
<
TextView
android:id=
"@+id/et_amt2"
android:id=
"@+id/et_amt2"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
...
@@ -299,7 +299,7 @@
...
@@ -299,7 +299,7 @@
android:minHeight=
"40dp"
android:minHeight=
"40dp"
android:paddingLeft=
"5dp"
android:paddingLeft=
"5dp"
android:textColor=
"@color/font_black_32"
android:textColor=
"@color/font_black_32"
android:textSize=
"
16
sp"
/>
android:textSize=
"
25
sp"
/>
<TextView
<TextView
android:id=
"@+id/tv_date3"
android:id=
"@+id/tv_date3"
...
@@ -379,7 +379,7 @@
...
@@ -379,7 +379,7 @@
app:btnWidth=
"36dp"
app:btnWidth=
"36dp"
app:tvWidth=
"120dp"
/>
app:tvWidth=
"120dp"
/>
<
EditText
<
TextView
android:id=
"@+id/et_amt3"
android:id=
"@+id/et_amt3"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
...
@@ -391,7 +391,7 @@
...
@@ -391,7 +391,7 @@
android:minHeight=
"40dp"
android:minHeight=
"40dp"
android:paddingLeft=
"5dp"
android:paddingLeft=
"5dp"
android:textColor=
"@color/font_black_32"
android:textColor=
"@color/font_black_32"
android:textSize=
"
16
sp"
/>
android:textSize=
"
25
sp"
/>
<TextView
<TextView
android:id=
"@+id/tv_date5"
android:id=
"@+id/tv_date5"
...
@@ -471,7 +471,7 @@
...
@@ -471,7 +471,7 @@
app:btnWidth=
"36dp"
app:btnWidth=
"36dp"
app:tvWidth=
"120dp"
/>
app:tvWidth=
"120dp"
/>
<
EditText
<
TextView
android:id=
"@+id/et_amt4"
android:id=
"@+id/et_amt4"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
...
@@ -483,7 +483,7 @@
...
@@ -483,7 +483,7 @@
android:minHeight=
"40dp"
android:minHeight=
"40dp"
android:paddingLeft=
"5dp"
android:paddingLeft=
"5dp"
android:textColor=
"@color/font_black_32"
android:textColor=
"@color/font_black_32"
android:textSize=
"
16
sp"
/>
android:textSize=
"
25
sp"
/>
<TextView
<TextView
android:id=
"@+id/tv_date7"
android:id=
"@+id/tv_date7"
...
...
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