Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TangKuPos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
王海
TangKuPos
Commits
141632db
Commit
141632db
authored
Dec 26, 2017
by
王海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交发券
parent
7061a8a5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
95 additions
and
11 deletions
+95
-11
app/src/main/java/com/xingdata/zzdpos/C.java
app/src/main/java/com/xingdata/zzdpos/C.java
+2
-0
app/src/main/java/com/xingdata/zzdpos/api/ApiFactory.java
app/src/main/java/com/xingdata/zzdpos/api/ApiFactory.java
+16
-3
app/src/main/java/com/xingdata/zzdpos/api/ApiService.java
app/src/main/java/com/xingdata/zzdpos/api/ApiService.java
+8
-1
app/src/main/java/com/xingdata/zzdpos/base/BaseDialog.java
app/src/main/java/com/xingdata/zzdpos/base/BaseDialog.java
+4
-2
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTickerC.java
...in/java/com/xingdata/zzdpos/ui/sendticke/SendTickerC.java
+10
-0
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketActivity.java
.../com/xingdata/zzdpos/ui/sendticke/SendTicketActivity.java
+5
-0
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketContract.java
.../com/xingdata/zzdpos/ui/sendticke/SendTicketContract.java
+4
-0
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketPresenter.java
...com/xingdata/zzdpos/ui/sendticke/SendTicketPresenter.java
+10
-0
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/fragment/SendTickerFragment.java
...data/zzdpos/ui/sendticke/fragment/SendTickerFragment.java
+34
-5
app/src/main/res/layout/fragment_send_ticker.xml
app/src/main/res/layout/fragment_send_ticker.xml
+2
-0
No files found.
app/src/main/java/com/xingdata/zzdpos/C.java
View file @
141632db
...
@@ -255,6 +255,8 @@ public class C {
...
@@ -255,6 +255,8 @@ public class C {
private
static
final
String
ROOT_URL
=
PKG
+
"ticket/"
;
private
static
final
String
ROOT_URL
=
PKG
+
"ticket/"
;
public
static
final
String
query
=
ROOT_URL
+
"query"
;
public
static
final
String
query
=
ROOT_URL
+
"query"
;
public
static
final
String
ticketBatchSend
=
ROOT_URL
+
"batchSend"
;
}
}
public
final
class
SSSKU
{
public
final
class
SSSKU
{
...
...
app/src/main/java/com/xingdata/zzdpos/api/ApiFactory.java
View file @
141632db
...
@@ -557,7 +557,8 @@ public final class ApiFactory {
...
@@ -557,7 +557,8 @@ public final class ApiFactory {
.
retryWhen
(
new
RetryHelper
(
3
));
.
retryWhen
(
new
RetryHelper
(
3
));
}
}
public
static
Observable
<
com
.
xingdata
.
zzdpos
.
model
.
Saleorder
>
addOrderPayMis
(
com
.
xingdata
.
zzdpos
.
model
.
Saleorder
.
Pay
saleorderPay
)
{
public
static
Observable
<
com
.
xingdata
.
zzdpos
.
model
.
Saleorder
>
addOrderPayMis
(
com
.
xingdata
.
zzdpos
.
model
.
Saleorder
.
Pay
saleorderPay
)
{
return
Api
.
getInstance
().
service
.
addOrderPayMis
(
saleorderPay
)
return
Api
.
getInstance
().
service
.
addOrderPayMis
(
saleorderPay
)
.
onErrorReturn
(
new
ErrorFilter
<>())
.
onErrorReturn
(
new
ErrorFilter
<>())
.
map
(
new
ResultFilter
<>())
.
map
(
new
ResultFilter
<>())
...
@@ -577,6 +578,16 @@ public final class ApiFactory {
...
@@ -577,6 +578,16 @@ public final class ApiFactory {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
retryWhen
(
new
RetryHelper
(
3
));
.
retryWhen
(
new
RetryHelper
(
3
));
}
}
public
static
Observable
<
String
>
batchSend
(
String
birthdayType
,
String
vipLevel
,
Long
vipId
,
Long
truleId
)
{
return
Api
.
getInstance
().
service
.
ticketBatchSend
(
birthdayType
,
vipLevel
,
vipId
,
truleId
)
.
onErrorReturn
(
new
ErrorFilter
<>())
.
map
(
new
ResultFilter
<>())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
retryWhen
(
new
RetryHelper
(
3
));
}
}
}
public
static
class
Sssku
{
public
static
class
Sssku
{
...
@@ -700,7 +711,8 @@ public final class ApiFactory {
...
@@ -700,7 +711,8 @@ public final class ApiFactory {
* @param pageSize
* @param pageSize
* @return
* @return
*/
*/
public
static
Observable
<
Pager
<
com
.
xingdata
.
zzdpos
.
model
.
Cs
>>
querCsList
(
int
pageNulmber
,
int
public
static
Observable
<
Pager
<
com
.
xingdata
.
zzdpos
.
model
.
Cs
>>
querCsList
(
int
pageNulmber
,
int
pageSize
,
long
startDate
,
long
endDate
)
{
pageSize
,
long
startDate
,
long
endDate
)
{
return
Api
.
getInstance
().
service
.
querCsList
(
pageNulmber
,
pageSize
,
startDate
,
return
Api
.
getInstance
().
service
.
querCsList
(
pageNulmber
,
pageSize
,
startDate
,
endDate
).
onErrorReturn
(
new
endDate
).
onErrorReturn
(
new
...
@@ -933,7 +945,8 @@ public final class ApiFactory {
...
@@ -933,7 +945,8 @@ public final class ApiFactory {
}
}
public
static
Observable
<
com
.
xingdata
.
zzdpos
.
model
.
Ms
>
add
(
com
.
xingdata
.
zzdpos
.
model
.
Ms
ms
)
{
public
static
Observable
<
com
.
xingdata
.
zzdpos
.
model
.
Ms
>
add
(
com
.
xingdata
.
zzdpos
.
model
.
Ms
ms
)
{
return
Api
.
getInstance
().
service
.
addMs
(
ms
)
return
Api
.
getInstance
().
service
.
addMs
(
ms
)
.
onErrorReturn
(
new
ErrorFilter
<>())
.
onErrorReturn
(
new
ErrorFilter
<>())
.
map
(
new
ResultFilter
<>())
.
map
(
new
ResultFilter
<>())
...
...
app/src/main/java/com/xingdata/zzdpos/api/ApiService.java
View file @
141632db
...
@@ -136,7 +136,8 @@ interface ApiService {
...
@@ -136,7 +136,8 @@ interface ApiService {
@POST
(
C
.
URL
.
ORDER
.
queryOrderList
)
@POST
(
C
.
URL
.
ORDER
.
queryOrderList
)
Observable
<
HttpMessage
<
Pager
<
Saleorder
>>>
getSaleOrder
(
@Query
(
"pageNumber"
)
int
pageNum
,
@Query
Observable
<
HttpMessage
<
Pager
<
Saleorder
>>>
getSaleOrder
(
@Query
(
"pageNumber"
)
int
pageNum
,
@Query
(
"pageSize"
)
int
pageSize
,
@Query
(
"startDate"
)
long
startDate
,
@Query
(
"endDate"
)
long
endDate
);
(
"pageSize"
)
int
pageSize
,
@Query
(
"startDate"
)
long
startDate
,
@Query
(
"endDate"
)
long
endDate
);
@POST
(
C
.
URL
.
ORDER
.
getOrderDetail
)
@POST
(
C
.
URL
.
ORDER
.
getOrderDetail
)
Observable
<
HttpMessage
<
Saleorder
>>
getOrderDetail
(
@Query
(
"id"
)
String
orderId
);
Observable
<
HttpMessage
<
Saleorder
>>
getOrderDetail
(
@Query
(
"id"
)
String
orderId
);
...
@@ -197,6 +198,12 @@ interface ApiService {
...
@@ -197,6 +198,12 @@ interface ApiService {
@POST
(
C
.
URL
.
TICKET
.
query
)
@POST
(
C
.
URL
.
TICKET
.
query
)
Observable
<
HttpMessage
<
Pager
<
Ticket
>>>
queryTicket
(
@Query
(
"vipId"
)
Long
vipId
);
Observable
<
HttpMessage
<
Pager
<
Ticket
>>>
queryTicket
(
@Query
(
"vipId"
)
Long
vipId
);
@POST
(
C
.
URL
.
TICKET
.
ticketBatchSend
)
Observable
<
HttpMessage
<
String
>>
ticketBatchSend
(
@Query
(
"birthdayType"
)
String
birthdayType
,
@Query
(
"vipLevel"
)
String
vipLevel
,
@Query
(
"vipId"
)
Long
vipId
,
@Query
(
"truleId"
)
Long
truleId
);
@POST
(
C
.
URL
.
SALEORDER
.
addOrderMis
)
@POST
(
C
.
URL
.
SALEORDER
.
addOrderMis
)
Observable
<
HttpMessage
<
String
>>
addOrderMis
(
@Body
Saleorder
.
Param
saleorderParam
);
Observable
<
HttpMessage
<
String
>>
addOrderMis
(
@Body
Saleorder
.
Param
saleorderParam
);
...
...
app/src/main/java/com/xingdata/zzdpos/base/BaseDialog.java
View file @
141632db
...
@@ -32,7 +32,8 @@ import io.reactivex.functions.Consumer;
...
@@ -32,7 +32,8 @@ import io.reactivex.functions.Consumer;
import
io.reactivex.functions.Function
;
import
io.reactivex.functions.Function
;
public
abstract
class
BaseDialog
<
P
extends
BasePresenter
,
B
extends
ViewDataBinding
>
extends
DialogFragment
{
public
abstract
class
BaseDialog
<
P
extends
BasePresenter
,
B
extends
ViewDataBinding
>
extends
DialogFragment
{
private
DialogBaseBinding
mBaseBinding
;
private
DialogBaseBinding
mBaseBinding
;
private
Disposable
mDisp
;
private
Disposable
mDisp
;
...
@@ -161,7 +162,8 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
...
@@ -161,7 +162,8 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
if
(!
isShowing
)
{
if
(!
isShowing
)
{
super
.
show
(
activity
.
getSupportFragmentManager
(),
this
.
getTag
());
super
.
show
(
activity
.
getSupportFragmentManager
(),
this
.
getTag
());
isShowing
=
true
;
isShowing
=
true
;
Observable
.
interval
(
0
,
1
,
TimeUnit
.
SECONDS
).
take
(
recLen
+
1
).
map
(
new
Function
<
Long
,
Long
>()
{
Observable
.
interval
(
0
,
1
,
TimeUnit
.
SECONDS
).
take
(
recLen
+
1
).
map
(
new
Function
<
Long
,
Long
>()
{
@Override
@Override
public
Long
apply
(
@io
.
reactivex
.
annotations
.
NonNull
Long
aLong
)
throws
Exception
{
public
Long
apply
(
@io
.
reactivex
.
annotations
.
NonNull
Long
aLong
)
throws
Exception
{
return
recLen
-
aLong
;
return
recLen
-
aLong
;
...
...
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTickerC.java
View file @
141632db
...
@@ -40,5 +40,15 @@ public class SendTickerC {
...
@@ -40,5 +40,15 @@ public class SendTickerC {
return
vipTypeList
;
return
vipTypeList
;
}
}
public
static
Long
getServerId
(
long
id
)
{
if
(
id
==
10001
l
)
{
return
1
l
;
}
else
if
(
id
==
10002
l
)
{
return
2
l
;
}
else
if
(
id
==
10003
l
)
{
return
3
l
;
}
return
-
1
l
;
}
}
}
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketActivity.java
View file @
141632db
...
@@ -50,6 +50,11 @@ public class SendTicketActivity extends BaseActivity<SendTicketPresenter,
...
@@ -50,6 +50,11 @@ public class SendTicketActivity extends BaseActivity<SendTicketPresenter,
mPresenter
.
sendTickerFragment
.
truleQuerySucc
(
trulePager
,
loadingDialog
);
mPresenter
.
sendTickerFragment
.
truleQuerySucc
(
trulePager
,
loadingDialog
);
}
}
@Override
public
void
sendTickerSucc
(
LoadingDialog
loadingDialog
)
{
}
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
...
...
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketContract.java
View file @
141632db
...
@@ -33,6 +33,8 @@ public interface SendTicketContract {
...
@@ -33,6 +33,8 @@ public interface SendTicketContract {
void
loadVip
(
Vip
vip
);
void
loadVip
(
Vip
vip
);
void
truleQuerySucc
(
Pager
<
Trule
>
trulePager
,
LoadingDialog
loadingDialog
);
void
truleQuerySucc
(
Pager
<
Trule
>
trulePager
,
LoadingDialog
loadingDialog
);
void
sendTickerSucc
(
LoadingDialog
loadingDialog
);
}
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
...
@@ -52,5 +54,7 @@ public interface SendTicketContract {
...
@@ -52,5 +54,7 @@ public interface SendTicketContract {
abstract
void
truleQuery
(
LoadingDialog
loadingDialog
);
abstract
void
truleQuery
(
LoadingDialog
loadingDialog
);
abstract
void
sendTicker
(
String
birthdayType
,
String
vipLevel
,
Long
vipId
,
Long
truleId
,
LoadingDialog
loadingDialog
);
}
}
}
}
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/SendTicketPresenter.java
View file @
141632db
...
@@ -54,4 +54,14 @@ public class SendTicketPresenter extends SendTicketContract.Presenter {
...
@@ -54,4 +54,14 @@ public class SendTicketPresenter extends SendTicketContract.Presenter {
mView
.
error
(
throwable
.
getMessage
(),
loadingDialog
);
mView
.
error
(
throwable
.
getMessage
(),
loadingDialog
);
});
});
}
}
@Override
public
void
sendTicker
(
String
birthdayType
,
String
vipLevel
,
Long
vipId
,
Long
truleId
,
LoadingDialog
loadingDialog
)
{
ApiFactory
.
Ticket
.
batchSend
(
birthdayType
,
vipLevel
,
vipId
,
truleId
).
subscribe
(
s
->
{
mView
.
sendTickerSucc
(
loadingDialog
);
},
throwable
->
{
mView
.
error
(
throwable
.
getMessage
(),
loadingDialog
);
});
}
}
}
app/src/main/java/com/xingdata/zzdpos/ui/sendticke/fragment/SendTickerFragment.java
View file @
141632db
...
@@ -87,15 +87,44 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
...
@@ -87,15 +87,44 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
break
;
break
;
case
R
.
id
.
btn_send
:
{
case
R
.
id
.
btn_send
:
{
if
(
isNull
())
{
if
(
isNull
())
{
ToastUtils
.
showLong
(
"发券"
);
long
tickerId
=
truleList
.
get
(
nowTickerItemId
).
getTruleMapId
();
loadingDialog
.
show
((
BaseActivity
)
getActivity
());
if
(
nowtype
==
0
)
{
//单独会员发券
mPresenter
.
sendTicker
(
null
,
null
,
nowVip
.
getVipId
(),
tickerId
,
loadingDialog
);
}
else
if
(
nowtype
==
1
)
{
Long
tempLevelId
=
levelList
.
get
(
nowVipGroupId
).
getId
();
if
(
tempLevelId
==
SendTickerC
.
getVipType
().
get
(
0
).
getId
())
{
//选择全部会员
mPresenter
.
sendTicker
(
null
,
null
,
null
,
tickerId
,
loadingDialog
);
return
;
}
for
(
int
i
=
1
;
i
<
SendTickerC
.
getVipType
().
size
();
i
++)
{
long
tempServerId
=
SendTickerC
.
getServerId
(
tempLevelId
);
//选择 当月下月以及流失会员
if
(
tempLevelId
==
SendTickerC
.
getVipType
().
get
(
i
).
getId
()
&&
tempServerId
!=
-
1
)
{
mPresenter
.
sendTicker
(
tempServerId
+
""
,
null
,
null
,
tickerId
,
loadingDialog
);
return
;
}
}
//选择金牌银牌等会员类别
mPresenter
.
sendTicker
(
null
,
levelList
.
get
(
nowVipGroupId
)
.
getVipLevel
()
+
""
,
null
,
tickerId
,
loadingDialog
);
}
}
}
ToastUtils
.
showLong
(
"发券"
);
}
}
break
;
default
:
{
}
break
;
}
}
}
}
});
});
...
...
app/src/main/res/layout/fragment_send_ticker.xml
View file @
141632db
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_top"
android:id=
"@+id/ll_top"
android:layout_above=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -186,6 +187,7 @@
...
@@ -186,6 +187,7 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:layout_height=
"?attr/actionBarSize"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
...
...
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