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
d06be2a1
Commit
d06be2a1
authored
Oct 29, 2018
by
qyw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信支付成功
parent
44a32eb0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
693 additions
and
77 deletions
+693
-77
LocalRecordReportAdapter.java
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/LocalRecordReportAdapter.java
+62
-0
APIService.java
TOP_Pay/app/src/main/java/com/ifavine/pay/api/APIService.java
+4
-2
APIWrapper.java
TOP_Pay/app/src/main/java/com/ifavine/pay/api/APIWrapper.java
+18
-8
JsonResponseBodyConverter.java
TOP_Pay/app/src/main/java/com/ifavine/pay/api/JsonResponseBodyConverter.java
+1
-1
Constants.java
TOP_Pay/app/src/main/java/com/ifavine/pay/common/Constants.java
+1
-1
MainActivity.java
TOP_Pay/app/src/main/java/com/ifavine/pay/ui/activity/MainActivity.java
+10
-10
DialogMainSetUtils.java
TOP_Pay/app/src/main/java/com/ifavine/pay/utils/DialogMainSetUtils.java
+209
-34
CommonListResponse.java
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/CommonListResponse.java
+4
-0
LocalRecordReport.java
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/LocalRecordReport.java
+14
-0
dialog_report_local.xml
TOP_Pay/app/src/main/res/layout/dialog_report_local.xml
+225
-18
dialog_report_sum.xml
TOP_Pay/app/src/main/res/layout/dialog_report_sum.xml
+3
-3
item_local_report.xml
TOP_Pay/app/src/main/res/layout/item_local_report.xml
+142
-0
No files found.
TOP_Pay/app/src/main/java/com/ifavine/pay/adapter/LocalRecordReportAdapter.java
0 → 100644
View file @
d06be2a1
package
com
.
ifavine
.
pay
.
adapter
;
import
android.content.Context
;
import
android.widget.TextView
;
import
com.ifavine.pay.R
;
import
com.ifavine.pay.ui.base.ListBaseAdapter
;
import
com.ifavine.pay.ui.base.SuperViewHolder
;
import
com.ifavine.pay.vo.LocalRecordReport
;
import
com.ifavine.pay.vo.MonthRecordReport
;
/**
* Created by Administrator on 2018/10/25.
*/
public
class
LocalRecordReportAdapter
extends
ListBaseAdapter
<
LocalRecordReport
>
{
public
LocalRecordReportAdapter
(
Context
context
)
{
super
(
context
);
}
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
item_local_report
;
}
@Override
public
void
onBindItemHolder
(
SuperViewHolder
holder
,
final
int
position
)
{
LocalRecordReport
q
=
mDataList
.
get
(
position
);
TextView
V_no
=
holder
.
getView
(
R
.
id
.
V_no
);
TextView
V_AllowanceAmount
=
holder
.
getView
(
R
.
id
.
V_AllowanceAmount
);
TextView
V_CanteenName
=
holder
.
getView
(
R
.
id
.
V_CanteenName
);
TextView
V_Consumption
=
holder
.
getView
(
R
.
id
.
V_Consumption
);
TextView
V_ConsumptionDate
=
holder
.
getView
(
R
.
id
.
V_ConsumptionDate
);
TextView
V_Department
=
holder
.
getView
(
R
.
id
.
V_Department
);
TextView
V_DinnerAmount
=
holder
.
getView
(
R
.
id
.
V_DinnerAmount
);
TextView
V_DinnerType
=
holder
.
getView
(
R
.
id
.
V_DinnerType
);
TextView
V_EmpName
=
holder
.
getView
(
R
.
id
.
V_EmpName
);
TextView
V_EmpNo
=
holder
.
getView
(
R
.
id
.
V_EmpNo
);
TextView
V_Post
=
holder
.
getView
(
R
.
id
.
V_Post
);
TextView
V_Remark
=
holder
.
getView
(
R
.
id
.
V_Remark
);
TextView
V_TransactionNo
=
holder
.
getView
(
R
.
id
.
V_TransactionNo
);
TextView
V_WindowName
=
holder
.
getView
(
R
.
id
.
V_WindowName
);
V_no
.
setText
((
position
+
1
)
+
""
);
V_AllowanceAmount
.
setText
(
q
.
AllowanceAmount
);
V_CanteenName
.
setText
(
q
.
CanteenName
);
V_Consumption
.
setText
(
q
.
Consumption
);
V_ConsumptionDate
.
setText
(
q
.
ConsumptionDate
);
V_Department
.
setText
(
q
.
Department
);
V_DinnerAmount
.
setText
(
q
.
DinnerAmount
);
V_DinnerType
.
setText
(
q
.
DinnerType
);
V_EmpName
.
setText
(
q
.
EmpName
);
V_EmpNo
.
setText
(
q
.
EmpNo
);
V_Post
.
setText
(
q
.
Post
);
V_Remark
.
setText
(
q
.
Remark
);
V_TransactionNo
.
setText
(
q
.
TransactionNo
);
V_WindowName
.
setText
(
q
.
WindowName
);
}
}
TOP_Pay/app/src/main/java/com/ifavine/pay/api/APIService.java
View file @
d06be2a1
...
...
@@ -4,6 +4,8 @@ package com.ifavine.pay.api;
import
com.ifavine.pay.vo.CanteenWindow
;
import
com.ifavine.pay.vo.CommonListResponse
;
import
com.ifavine.pay.vo.CommonResponse
;
import
com.ifavine.pay.vo.LocalRecordReport
;
import
com.ifavine.pay.vo.MonthRecordReport
;
import
com.ifavine.pay.vo.User
;
import
com.ifavine.pay.vo.WindowCostAmount
;
...
...
@@ -32,11 +34,11 @@ public abstract interface APIService {
@POST
(
"WebChat/GetLocalRecordReport"
)
Call
<
Common
Response
<
String
>>
GetLocalRecordReport
(
@Body
RequestBody
info
);
Call
<
Common
ListResponse
<
LocalRecordReport
>>
GetLocalRecordReport
(
@Body
RequestBody
info
);
@POST
(
"WebChat/GetMonthRecordReport"
)
Call
<
Common
Response
<
String
>>
GetMonthRecordReport
(
@Body
RequestBody
info
);
Call
<
Common
ListResponse
<
MonthRecordReport
>>
GetMonthRecordReport
(
@Body
RequestBody
info
);
@POST
(
"WebChat/GetConsumRecordReport"
)
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/api/APIWrapper.java
View file @
d06be2a1
package
com
.
ifavine
.
pay
.
api
;
import
android.text.TextUtils
;
import
com.ifavine.pay.vo.CanteenWindow
;
import
com.ifavine.pay.vo.CommonListResponse
;
import
com.ifavine.pay.vo.CommonResponse
;
import
com.ifavine.pay.vo.LocalRecordReport
;
import
com.ifavine.pay.vo.MonthRecordReport
;
import
com.ifavine.pay.vo.User
;
import
com.ifavine.pay.vo.WindowCostAmount
;
...
...
@@ -115,10 +119,10 @@ public class APIWrapper extends RetrofitUtil {
* @param PageSize
* @return
*/
public
Call
<
Common
Response
<
String
>>
GetLocalRecordReport
(
String
CanteenName
,
String
WindowName
,
String
sDate
,
String
eDate
,
String
dinnerType
,
String
PageIndex
,
String
PageSize
)
{
public
Call
<
Common
ListResponse
<
LocalRecordReport
>>
GetLocalRecordReport
(
String
CanteenName
,
String
WindowName
,
String
sDate
,
String
eDate
,
String
dinnerType
,
String
record
,
String
PageIndex
,
String
PageSize
)
{
// "CanteenName": "第二食堂",
// "WindowName": "7号",
// "sDate": "2018-02-10 16:14:54.000",
...
...
@@ -132,7 +136,12 @@ public class APIWrapper extends RetrofitUtil {
obj
.
put
(
"WindowName"
,
WindowName
);
obj
.
put
(
"sDate"
,
sDate
);
obj
.
put
(
"eDate"
,
eDate
);
obj
.
put
(
"dinnerType"
,
dinnerType
);
if
(!
TextUtils
.
isEmpty
(
dinnerType
))
{
obj
.
put
(
"dinnerType"
,
dinnerType
);
}
if
(!
TextUtils
.
isEmpty
(
record
))
{
obj
.
put
(
"record"
,
record
);
}
obj
.
put
(
"PageIndex"
,
PageIndex
);
obj
.
put
(
"PageSize"
,
PageSize
);
}
catch
(
Exception
e
)
{
...
...
@@ -143,13 +152,14 @@ public class APIWrapper extends RetrofitUtil {
}
/**
* @param
Cantee
nName
* @param
WindowName
* @param
Wi
nName
* @param
CanteenNo
* @param sDate
* @param eDate
* @param dinnerType
* @param PageIndex
* @param PageSize
* @param record
* @return
*/
public
Call
<
CommonResponse
<
String
>>
GetConsumRecordReport
(
String
WinName
,
String
CanteenNo
,
...
...
@@ -187,7 +197,7 @@ public class APIWrapper extends RetrofitUtil {
*
* @return
*/
public
Call
<
Common
Response
<
String
>>
GetMonthRecordReport
(
String
Year
,
String
Month
)
{
public
Call
<
Common
ListResponse
<
MonthRecordReport
>>
GetMonthRecordReport
(
String
Year
,
String
Month
)
{
// "CanteenName": "第二食堂",
// "WindowName": "7号",
// "sDate": "2018-02-10 16:14:54.000",
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/api/JsonResponseBodyConverter.java
View file @
d06be2a1
...
...
@@ -46,7 +46,7 @@ public class JsonResponseBodyConverter<T> implements Converter<ResponseBody, T>
String
data
=
null
;
try
{
//数据解密
String
d
=
responseBody
.
string
().
replaceAll
(
"\\\\"
,
""
);
String
d
=
responseBody
.
string
().
replaceAll
(
"\\\\
r\\\\n"
,
""
).
replaceAll
(
"\\\\
"
,
""
);
data
=
d
.
substring
(
1
,
d
.
length
()
-
1
);
Log
.
i
(
"aaaaa"
,
"response data:"
+
data
);
}
catch
(
Exception
e
)
{
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/common/Constants.java
View file @
d06be2a1
...
...
@@ -11,7 +11,7 @@ public class Constants {
public
static
String
LANG
=
"zn-cn"
;
public
static
String
PREF_NAME
=
"pref_manage"
;
public
static
int
PAGE_SIZE
=
1
0
;
public
static
int
PAGE_SIZE
=
2
0
;
public
static
String
CONTACT_PAGE_SIZE
=
"20"
;
public
static
final
String
IMAGE_TEMP
=
"topoa/image_temp"
;
public
static
final
String
IMAGE_DOWNLOAD
=
"topoa/image_dowload"
;
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/ui/activity/MainActivity.java
View file @
d06be2a1
...
...
@@ -281,18 +281,18 @@ public class MainActivity extends BaseActivity {
new
PopWindowMainReport
(
mContext
,
new
PopWindowMainReport
.
CallBackPosition
()
{
@Override
public
void
selectIndex
(
final
int
index
)
{
DialogUtil
.
showInputDialog
(
mContext
,
null
,
"请输入管理员密码"
,
"请输入管理员密码"
,
"确定"
,
"取消"
,
new
View
.
OnClickListener
(
)
{
@Override
public
void
onClick
(
View
view
)
{
if
(
index
==
0
)
{
DialogMainSetUtils
.
showReportLocalDialog
(
mContext
,
"本机消费记录查询"
,
null
,
true
);
}
else
if
(
index
==
1
)
{
DialogMainSetUtils
.
showReportRecordDialog
(
mContext
,
"消费记录查询"
,
null
,
true
);
}
else
if
(
index
==
2
)
{
if
(
index
==
0
)
{
DialogMainSetUtils
.
showReportLocalDialog
(
mContext
,
"本机消费记录查询"
,
null
,
true
);
}
else
if
(
index
==
1
)
{
DialogMainSetUtils
.
showReportRecordDialog
(
mContext
,
"消费记录查询"
,
null
,
true
);
}
else
if
(
index
==
2
)
{
DialogUtil
.
showInputDialog
(
mContext
,
null
,
"请输入管理员密码"
,
"请输入管理员密码"
,
"确定"
,
"取消"
,
new
View
.
OnClickListener
(
)
{
@Override
public
void
onClick
(
View
view
)
{
DialogMainSetUtils
.
showReportSumDialog
(
mContext
,
"每月消费汇总查询"
,
null
,
true
);
}
}
}
,
null
,
true
);
}
,
null
,
true
);
}
}
}).
showAtBottom
(
tv_table
);
break
;
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/utils/DialogMainSetUtils.java
View file @
d06be2a1
...
...
@@ -30,6 +30,7 @@ import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.ifavine.pay.R
;
import
com.ifavine.pay.adapter.LocalRecordReportAdapter
;
import
com.ifavine.pay.adapter.MonthRecordReportAdapter
;
import
com.ifavine.pay.adapter.ReportMonthsAdapter
;
import
com.ifavine.pay.adapter.SpinnerAdapter
;
...
...
@@ -41,6 +42,7 @@ import com.ifavine.pay.view.datepicker.DateUtil;
import
com.ifavine.pay.vo.CanteenWindow
;
import
com.ifavine.pay.vo.CommonListResponse
;
import
com.ifavine.pay.vo.CommonResponse
;
import
com.ifavine.pay.vo.LocalRecordReport
;
import
com.ifavine.pay.vo.MonthRecordReport
;
import
com.ifavine.pay.vo.VersionBean
;
import
com.ifavine.pay.vo.WindowCostAmount
;
...
...
@@ -204,6 +206,10 @@ public class DialogMainSetUtils {
Response
<
CommonResponse
>
response
)
{
DialogUtil
.
dismissTipDialog
();
if
(
response
.
isSuccessful
())
{
if
(
response
.
body
()
==
null
)
{
AppContext
.
showToast
(
"请求失败,请重试"
);
return
;
}
if
(
response
.
body
().
Status
!=
200
)
{
AppContext
.
showToast
(
response
.
body
().
Message
);
return
;
...
...
@@ -639,8 +645,10 @@ public class DialogMainSetUtils {
@Override
public
void
onResponse
(
Call
<
CommonResponse
>
call
,
Response
<
CommonResponse
>
response
)
{
DialogUtil
.
dismissTipDialog
();
if
(
response
.
isSuccessful
())
{
if
(
response
.
body
()
==
null
)
{
AppContext
.
showToast
(
"请求失败,请重试"
);
return
;
}
if
(
response
.
body
().
Status
!=
200
)
{
...
...
@@ -696,19 +704,103 @@ public class DialogMainSetUtils {
Button
btn_search
=
(
Button
)
view
.
findViewById
(
R
.
id
.
dialog_search
);
Button
btn_close
=
(
Button
)
view
.
findViewById
(
R
.
id
.
dialog_close
);
final
TextView
t0
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_Total
);
final
TextView
t1
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalDinnerAmount
);
final
TextView
t2
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalAllowanceAmount
);
final
TextView
t3
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalConsumption
);
final
List
<
TextView
>
list
=
new
ArrayList
<>();
list
.
add
(
t0
);
list
.
add
(
t1
);
list
.
add
(
t2
);
list
.
add
(
t3
);
final
TextView
tv_date1
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_date1
);
final
TextView
tv_date2
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_date2
);
TextView
tv_title
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
dialog_title
);
ImageView
iv_cancel
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
iv_cancel
);
Spinner
spinner1
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner1
);
Spinner
spinner2
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner2
);
final
Spinner
spinner1
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner1
);
final
Spinner
spinner2
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner2
);
tv_date1
.
setText
(
DateUtil
.
formatDate
(
new
Date
().
getTime
(),
"yyyy-MM-dd"
));
tv_date2
.
setText
(
DateUtil
.
formatDate
(
new
Date
().
getTime
(),
"yyyy-MM-dd"
));
final
LRecyclerView
mLRecyclerView
=
(
LRecyclerView
)
view
.
findViewById
(
R
.
id
.
mLRecyclerView
);
final
LocalRecordReportAdapter
adapter
=
new
LocalRecordReportAdapter
(
mContext
);
LRecyclerViewAdapter
mLRecyclerViewAdapter
=
new
LRecyclerViewAdapter
(
adapter
);
mLRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mContext
)
{
});
mLRecyclerView
.
setAdapter
(
mLRecyclerViewAdapter
);
mLRecyclerView
.
setPullRefreshEnabled
(
true
);
mLRecyclerView
.
setLoadMoreEnabled
(
true
);
mCurrent
=
1
;
mLRecyclerView
.
setOnRefreshListener
(
new
OnRefreshListener
()
{
@Override
public
void
onRefresh
()
{
t0
.
setText
(
null
);
t1
.
setText
(
null
);
t2
.
setText
(
null
);
t3
.
setText
(
null
);
mCurrent
=
1
;
mLRecyclerView
.
setNoMore
(
false
);
mLRecyclerView
.
setLoadMoreEnabled
(
true
);
adapter
.
clear
();
String
sDate
=
tv_date1
.
getText
().
toString
()
+
" 00:00:00.001"
;
String
eDate
=
tv_date2
.
getText
().
toString
()
+
" 23:59:59.999"
;
String
dinnerType
=
""
;
String
record
=
""
;
int
p1
=
spinner1
.
getSelectedItemPosition
();
int
p2
=
spinner2
.
getSelectedItemPosition
();
if
(
p1
==
0
)
{
dinnerType
=
""
;
}
else
{
dinnerType
=
""
+
p1
;
}
if
(
p2
==
0
)
{
record
=
""
;
}
else
{
record
=
""
+
p2
;
}
GetLocalRecordReport
(
mLRecyclerView
,
adapter
,
sDate
,
eDate
,
dinnerType
,
record
,
String
.
valueOf
(
mCurrent
),
String
.
valueOf
(
Constants
.
PAGE_SIZE
),
list
);
}
});
mLRecyclerView
.
setOnLoadMoreListener
(
new
OnLoadMoreListener
()
{
@Override
public
void
onLoadMore
()
{
if
(
mCurrent
*
Constants
.
PAGE_SIZE
<
mCount
)
{
mCurrent
++;
isLoadMore
=
true
;
String
sDate
=
tv_date1
.
getText
().
toString
()
+
" 00:00:00.001"
;
String
eDate
=
tv_date2
.
getText
().
toString
()
+
" 23:59:59.999"
;
String
dinnerType
=
""
;
String
record
=
""
;
int
p1
=
spinner1
.
getSelectedItemPosition
();
int
p2
=
spinner2
.
getSelectedItemPosition
();
if
(
p1
==
0
)
{
dinnerType
=
""
;
}
else
{
dinnerType
=
""
+
p1
;
}
if
(
p2
==
0
)
{
record
=
""
;
}
else
{
record
=
""
+
p2
;
}
GetLocalRecordReport
(
mLRecyclerView
,
adapter
,
sDate
,
eDate
,
dinnerType
,
record
,
String
.
valueOf
(
mCurrent
),
String
.
valueOf
(
Constants
.
PAGE_SIZE
),
list
);
}
else
{
mLRecyclerView
.
setNoMore
(
true
);
isLoadMore
=
false
;
}
}
});
String
options
[]
=
mContext
.
getResources
().
getStringArray
(
R
.
array
.
main_report_type
);
SpinnerAdapter
adapter
=
new
SpinnerAdapter
(
mContext
,
SpinnerAdapter
adapter
1
=
new
SpinnerAdapter
(
mContext
,
android
.
R
.
layout
.
simple_spinner_item
,
options
);
spinner1
.
setAdapter
(
adapter
);
spinner1
.
setAdapter
(
adapter
1
);
String
options2
[]
=
mContext
.
getResources
().
getStringArray
(
R
.
array
.
main_report_record_type
);
SpinnerAdapter
adapter2
=
new
SpinnerAdapter
(
mContext
,
...
...
@@ -728,7 +820,7 @@ public class DialogMainSetUtils {
@Override
public
void
onClick
(
View
v
)
{
dialog
.
dismiss
();
mLRecyclerView
.
refresh
();
}
});
}
...
...
@@ -801,6 +893,58 @@ public class DialogMainSetUtils {
}
private
static
void
GetLocalRecordReport
(
final
LRecyclerView
mLRecyclerView
,
final
LocalRecordReportAdapter
adapter
,
String
sDate
,
String
eDate
,
String
dinnerType
,
String
record
,
String
PageIndex
,
String
PageSize
,
final
List
<
TextView
>
tvs
)
{
String
WindowName
=
SPUtil
.
getInstance
().
readString
(
"WindowName"
);
String
CanTeenName
=
SPUtil
.
getInstance
().
readString
(
"CanTeenName"
);
Call
<
CommonListResponse
<
LocalRecordReport
>>
call
=
APIWrapper
.
getInstance
().
GetLocalRecordReport
(
CanTeenName
,
WindowName
,
sDate
,
eDate
,
dinnerType
,
record
,
PageIndex
,
PageSize
);
call
.
enqueue
(
new
Callback
<
CommonListResponse
<
LocalRecordReport
>>()
{
@Override
public
void
onResponse
(
Call
<
CommonListResponse
<
LocalRecordReport
>>
call
,
Response
<
CommonListResponse
<
LocalRecordReport
>>
response
)
{
DialogUtil
.
dismissTipDialog
();
mLRecyclerView
.
refreshComplete
(
Constants
.
PAGE_SIZE
);
if
(
response
.
isSuccessful
())
{
if
(
response
.
body
()
==
null
)
{
AppContext
.
showToast
(
"请求失败,请重试"
);
return
;
}
if
(
response
.
body
().
Status
!=
200
)
{
AppContext
.
showToast
(
response
.
body
().
Message
);
return
;
}
List
<
LocalRecordReport
>
data
=
response
.
body
().
ModelJson
;
adapter
.
addAll
(
data
);
mCount
=
response
.
body
().
Total
;
if
(
mCurrent
*
Constants
.
PAGE_SIZE
<
response
.
body
().
Total
)
{
mLRecyclerView
.
setNoMore
(
false
);
}
else
{
mLRecyclerView
.
setNoMore
(
true
);
isLoadMore
=
false
;
}
if
(
tvs
!=
null
)
{
tvs
.
get
(
0
).
setText
(
response
.
body
().
Total
+
""
);
tvs
.
get
(
1
).
setText
(
response
.
body
().
TotalDinnerAmount
);
tvs
.
get
(
2
).
setText
(
response
.
body
().
TotalAllowanceAmount
);
tvs
.
get
(
3
).
setText
(
response
.
body
().
TotalConsumption
);
}
}
}
@Override
public
void
onFailure
(
Call
<
CommonListResponse
<
LocalRecordReport
>>
call
,
Throwable
t
)
{
DialogUtil
.
dismissTipDialog
();
AppContext
.
showToast
(
"请求失败,请重试"
);
mLRecyclerView
.
refreshComplete
(
Constants
.
PAGE_SIZE
);
}
});
}
public
static
Dialog
showReportRecordDialog
(
final
Context
mContext
,
final
String
title
,
final
View
.
OnClickListener
okListener
,
boolean
cancelable
)
{
...
...
@@ -926,8 +1070,8 @@ public class DialogMainSetUtils {
return
dialog
;
}
static
int
mCurrent
=
0
;
static
int
mCount
=
1
0
;
static
int
mCurrent
=
1
;
static
int
mCount
=
2
0
;
static
boolean
isLoadMore
=
false
;
public
static
Dialog
showReportSumDialog
(
final
Context
mContext
,
final
String
title
,
final
View
.
OnClickListener
okListener
,
...
...
@@ -945,10 +1089,14 @@ public class DialogMainSetUtils {
Button
btn_search
=
(
Button
)
view
.
findViewById
(
R
.
id
.
dialog_search
);
Button
btn_close
=
(
Button
)
view
.
findViewById
(
R
.
id
.
dialog_close
);
final
TextView
t1
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalDinnerAmount
);
final
TextView
t2
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalAllowanceAmount
);
final
TextView
t3
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_TotalConsumption
);
TextView
tv_title
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
dialog_title
);
Spinner
spinner1
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
sp_year
);
Spinner
spinner2
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner2
);
final
Spinner
spinner1
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
sp_year
);
final
Spinner
spinner2
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner2
);
final
LRecyclerView
mLRecyclerView
=
(
LRecyclerView
)
view
.
findViewById
(
R
.
id
.
mLRecyclerView
);
final
MonthRecordReportAdapter
adapter
=
new
MonthRecordReportAdapter
(
mContext
);
LRecyclerViewAdapter
mLRecyclerViewAdapter
=
new
LRecyclerViewAdapter
(
adapter
);
...
...
@@ -961,19 +1109,27 @@ public class DialogMainSetUtils {
mLRecyclerView
.
setOnRefreshListener
(
new
OnRefreshListener
()
{
@Override
public
void
onRefresh
()
{
t1
.
setText
(
null
);
t2
.
setText
(
null
);
t3
.
setText
(
null
);
adapter
.
clear
();
mCurrent
=
1
;
// getMessageList();
String
year
=
spinner1
.
getSelectedItem
().
toString
();
String
month
=
spinner2
.
getSelectedItem
().
toString
();
GetMonthRecordReport
(
mLRecyclerView
,
adapter
,
year
.
substring
(
0
,
year
.
length
()
-
1
),
month
.
substring
(
0
,
month
.
length
()
-
1
),
t1
,
t2
,
t3
);
}
});
mLRecyclerView
.
refresh
();
mLRecyclerView
.
setOnLoadMoreListener
(
new
OnLoadMoreListener
()
{
@Override
public
void
onLoadMore
()
{
if
(
mCurrent
*
Constants
.
PAGE_SIZE
<
mCount
)
{
adapter
.
clear
();
mCurrent
++;
isLoadMore
=
true
;
//getMessageList();
String
year
=
spinner1
.
getSelectedItem
().
toString
();
String
month
=
spinner2
.
getSelectedItem
().
toString
();
GetMonthRecordReport
(
mLRecyclerView
,
adapter
,
year
.
substring
(
0
,
year
.
length
()
-
1
),
month
.
substring
(
0
,
month
.
length
()
-
1
),
t1
,
t2
,
t3
);
}
else
{
mLRecyclerView
.
setNoMore
(
true
);
isLoadMore
=
false
;
...
...
@@ -982,23 +1138,6 @@ public class DialogMainSetUtils {
});
final
List
<
MonthRecordReport
>
beanList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
MonthRecordReport
bean
=
new
MonthRecordReport
();
bean
.
AllowanceAmount
=
"链接"
+
i
;
bean
.
asConsumption
=
"类型"
+
i
;
bean
.
CanteenName
=
"version_description"
+
i
;
bean
.
WindowName
=
"version_id"
+
i
;
beanList
.
add
(
bean
);
}
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
mLRecyclerView
.
refreshComplete
(
1
);
adapter
.
setDataList
(
beanList
);
}
},
2000
);
String
options
[]
=
mContext
.
getResources
().
getStringArray
(
R
.
array
.
main_year
);
SpinnerAdapter
adapter1
=
new
SpinnerAdapter
(
mContext
,
android
.
R
.
layout
.
simple_spinner_item
,
options
);
...
...
@@ -1022,7 +1161,8 @@ public class DialogMainSetUtils {
@Override
public
void
onClick
(
View
v
)
{
dialog
.
dismiss
();
adapter
.
clear
();
mLRecyclerView
.
refresh
();
}
});
}
...
...
@@ -1032,10 +1172,45 @@ public class DialogMainSetUtils {
dialog
.
dismiss
();
}
});
dialog
.
show
();
return
dialog
;
}
private
static
void
GetMonthRecordReport
(
final
LRecyclerView
mLRecyclerView
,
final
MonthRecordReportAdapter
adapter
,
String
year
,
String
month
,
final
TextView
t1
,
final
TextView
t2
,
final
TextView
t3
)
{
Call
<
CommonListResponse
<
MonthRecordReport
>>
call
=
APIWrapper
.
getInstance
().
GetMonthRecordReport
(
year
,
month
);
call
.
enqueue
(
new
Callback
<
CommonListResponse
<
MonthRecordReport
>>()
{
@Override
public
void
onResponse
(
Call
<
CommonListResponse
<
MonthRecordReport
>>
call
,
Response
<
CommonListResponse
<
MonthRecordReport
>>
response
)
{
DialogUtil
.
dismissTipDialog
();
mLRecyclerView
.
refreshComplete
(
Constants
.
PAGE_SIZE
);
if
(
response
.
isSuccessful
())
{
if
(
response
.
body
()
==
null
)
{
AppContext
.
showToast
(
"请求失败,请重试"
);
return
;
}
if
(
response
.
body
().
Status
!=
200
)
{
AppContext
.
showToast
(
response
.
body
().
Message
);
return
;
}
List
<
MonthRecordReport
>
data
=
response
.
body
().
ModelJson
;
adapter
.
setDataList
(
data
);
t1
.
setText
(
response
.
body
().
TotalDinnerAmount
);
t2
.
setText
(
response
.
body
().
TotalAllowanceAmount
);
t3
.
setText
(
response
.
body
().
TotalConsumption
);
}
}
@Override
public
void
onFailure
(
Call
<
CommonListResponse
<
MonthRecordReport
>>
call
,
Throwable
t
)
{
DialogUtil
.
dismissTipDialog
();
AppContext
.
showToast
(
"请求失败,请重试"
);
mLRecyclerView
.
refreshComplete
(
0
);
}
});
}
}
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/CommonListResponse.java
View file @
d06be2a1
...
...
@@ -14,6 +14,10 @@ public class CommonListResponse<T> extends Entity {
public
List
<
T
>
ModelJson
;
public
int
Status
;
public
String
Message
;
public
String
TotalDinnerAmount
;
public
String
TotalAllowanceAmount
;
public
String
TotalConsumption
;
public
int
Total
;
public
class
Data
<
T
>
{
public
List
<
T
>
list
;
...
...
TOP_Pay/app/src/main/java/com/ifavine/pay/vo/LocalRecordReport.java
View file @
d06be2a1
...
...
@@ -5,4 +5,18 @@ package com.ifavine.pay.vo;
*/
public
class
LocalRecordReport
{
public
String
CanteenName
;
public
String
WindowName
;
public
String
ConsumptionDate
;
public
String
EmpNo
;
public
String
EmpName
;
public
String
Department
;
public
String
Post
;
public
String
DinnerType
;
public
String
DinnerAmount
;
public
String
AllowanceAmount
;
public
String
Consumption
;
public
String
TransactionNo
;
public
String
Remark
;
}
TOP_Pay/app/src/main/res/layout/dialog_report_local.xml
View file @
d06be2a1
...
...
@@ -173,48 +173,255 @@
</LinearLayout>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"20dp"
android:layout_weight=
"1"
android:background=
"@drawable/bg_white_radius_stroke"
android:orientation=
"vertical"
>
<HorizontalScrollView
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
>
<ListView
android:id=
"@+id/listView"
android:layout_width=
"fill_parent"
android:layout_height=
"match_parent"
></ListView>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"fill_parent"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"20dp"
android:layout_weight=
"1"
android:background=
"@drawable/bg_white_radius_stroke"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/textView3"
android:layout_width=
"100dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"序号"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"食堂"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:layout_marginLeft=
"15dp"
android:gravity=
"center"
android:text=
"窗口"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"250dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"日期"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"工号"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:layout_marginLeft=
"20dp"
android:gravity=
"center"
android:text=
"姓名"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"250dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"部门"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"职务"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"用餐类型"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"消费金额"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"公司补助"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:layout_marginLeft=
"20dp"
android:gravity=
"center"
android:text=
"个人消费"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"320dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"商户单号"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
<TextView
android:layout_width=
"300dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:text=
"备注"
android:textColor=
"@color/font_blue_16"
android:textSize=
"25dp"
/>
</LinearLayout>
<View
android:layout_width=
"fill_parent"
android:layout_height=
"1dp"
android:background=
"@color/main_gray"
/>
<com.github.jdsjlzx.recyclerview.LRecyclerView
android:id=
"@+id/mLRecyclerView"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_marginTop=
"10dp"
/>
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:layout_weight=
"1"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"消费人数:
(早餐:100 午餐:100 晚餐:100 宵夜:100)
"
android:text=
"消费人数:"
android:textColor=
"@color/font_black_32"
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_Total"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginLeft=
"150dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"合计:(消费金额:"
android:textColor=
"@color/font_black_32"
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_TotalDinnerAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
" 公司补助: "
android:textColor=
"@color/font_black_32"
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_TotalAllowanceAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
" 个人消费: "
android:textColor=
"@color/font_black_32"
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_TotalConsumption"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:layout_weight=
"1"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"
合计:(消费金额:100 公司补助:100 个人消费:100
)"
android:text=
")"
android:textColor=
"@color/font_black_32"
android:textSize=
"23dp"
/>
...
...
TOP_Pay/app/src/main/res/layout/dialog_report_sum.xml
View file @
d06be2a1
...
...
@@ -215,12 +215,12 @@
<TextView
android:id=
"@+id/tv_TotalDinnerAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"100"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
...
...
@@ -235,12 +235,12 @@
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_TotalAllowanceAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"100"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
...
...
@@ -255,12 +255,12 @@
android:textSize=
"23dp"
/>
<TextView
android:id=
"@+id/tv_TotalConsumption"
android:layout_width=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:paddingRight=
"10dp"
android:text=
"100"
android:textColor=
"@color/red"
android:textSize=
"23dp"
/>
...
...
TOP_Pay/app/src/main/res/layout/item_local_report.xml
0 → 100644
View file @
d06be2a1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"60dp"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/V_no"
android:layout_width=
"100dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"序号"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_CanteenName"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"食堂"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_WindowName"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"窗口"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_ConsumptionDate"
android:layout_width=
"250dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"日期"
android:textColor=
"@color/font_black_20"
android:textSize=
"20dp"
/>
<TextView
android:id=
"@+id/V_EmpNo"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"工号"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_EmpName"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"姓名"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_Department"
android:layout_width=
"200dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"部门"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_Post"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"职务"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_DinnerType"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"用餐类型"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_DinnerAmount"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"消费金额"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_AllowanceAmount"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"公司补助"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_Consumption"
android:layout_width=
"160dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"个人消费"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
<TextView
android:id=
"@+id/V_TransactionNo"
android:layout_width=
"320dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"商户单号"
android:textColor=
"@color/font_black_20"
android:textSize=
"20dp"
/>
<TextView
android:id=
"@+id/V_Remark"
android:layout_width=
"300dp"
android:layout_height=
"60dp"
android:gravity=
"center"
android:text=
"备注"
android:textColor=
"@color/font_black_20"
android:textSize=
"25dp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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