Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-mobile
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d1a3415c
authored
May 21, 2021
by
caosy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
劵置换
parent
9624de4f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
3 deletions
src/main/java/com/ctrip/fun/golf/api/basic/VoucherMController.java
src/main/java/com/ctrip/fun/golf/service/basic/VoucherMService.java
src/main/resources/rpc.properties
src/main/java/com/ctrip/fun/golf/api/basic/VoucherMController.java
View file @
d1a3415c
...
...
@@ -9,6 +9,7 @@ import java.util.Map;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -20,18 +21,21 @@ import com.ctrip.fun.common.vo.PagedResponseBean;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.ResponseError
;
import
com.ctrip.fun.common.vo.ResponseStatusEnum
;
import
com.ctrip.fun.common.vo.SortDirectionEnum
;
import
com.ctrip.fun.common.vo.basic.VoucherGetLogBean
;
import
com.ctrip.fun.common.vo.basic.VoucherGiftQuery
;
import
com.ctrip.fun.common.vo.basic.VoucherItemDTO
;
import
com.ctrip.fun.common.vo.basic.VoucherQueryDto
;
import
com.ctrip.fun.common.vo.basic.VoucherQueryRequestDTO
;
import
com.ctrip.fun.common.vo.basic.VoucherRequestDto
;
import
com.ctrip.fun.common.vo.basic.VoucherShareLogBean
;
import
com.ctrip.fun.common.vo.basic.VoucherShareLogQuery
;
import
com.ctrip.fun.common.vo.membership.MbsOrderBean
;
import
com.ctrip.fun.golf.secrity.Security
;
import
com.ctrip.fun.golf.secrity.UserContext
;
import
com.ctrip.fun.golf.service.basic.VoucherMService
;
import
com.ctrip.fun.golf.vo.ErrorBean
;
/**
*
...
...
@@ -304,4 +308,83 @@ public class VoucherMController {
return
response
;
}
/**
* 换卷列表
*/
@ResponseBody
@Security
@RequestMapping
(
value
=
"/voucher/getVoucherGiftList"
,
method
=
RequestMethod
.
GET
,
params
=
{
"token"
,
"uid"
,
"pagerOffset"
,
"pagerPerPage"
,
"status"
})
public
Object
getVoucherGiftList
(
@RequestParam
String
token
,
VoucherGiftQuery
voucherGiftQuery
)
{
voucherGiftQuery
.
setToken
(
token
);
return
voucherService
.
getVoucherGiftList
(
voucherGiftQuery
);
}
/**
* 客户确认换卷
*/
@ResponseBody
@Transactional
@Security
@RequestMapping
(
value
=
"/voucher/voucherGiftAffirm"
,
method
=
RequestMethod
.
GET
,
params
=
{
"token"
,
"id"
})
public
Object
voucherGiftAffirm
(
@RequestParam
String
token
,
VoucherGiftQuery
voucherGiftQuery
)
{
Response
<?>
response
=
new
Response
();
Request
<
VoucherGiftQuery
>
request
=
new
Request
<
VoucherGiftQuery
>();
voucherGiftQuery
.
setUid
(
UserContext
.
getUserId
());
request
.
setUserId
(
UserContext
.
getUserId
());
request
.
setBody
(
voucherGiftQuery
);
response
=
voucherService
.
voucherGiftAffirm
(
request
);
if
(
response
.
getStatus
()
==
ResponseStatusEnum
.
SUCCESS
.
getValue
())
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"success"
,
true
);
return
map
;
}
else
{
return
handFailResponse
(
response
);
}
}
/**
* 客户取消换卷
*/
@ResponseBody
@Security
@RequestMapping
(
value
=
"/voucher/voucherGiftCancel"
,
method
=
RequestMethod
.
GET
,
params
=
{
"token"
,
"id"
})
public
Object
voucherGiftCancel
(
@RequestParam
String
token
,
VoucherGiftQuery
voucherGiftQuery
)
{
Response
<?>
response
=
new
Response
();
Request
<
VoucherGiftQuery
>
request
=
new
Request
<
VoucherGiftQuery
>();
voucherGiftQuery
.
setUid
(
UserContext
.
getUserId
());
request
.
setUserId
(
UserContext
.
getUserId
());
request
.
setBody
(
voucherGiftQuery
);
response
=
voucherService
.
voucherGiftCancel
(
request
);
if
(
response
.
getStatus
()
==
ResponseStatusEnum
.
SUCCESS
.
getValue
())
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"success"
,
true
);
return
map
;
}
else
{
return
handFailResponse
(
response
);
}
}
/**
* @param response
* @return
*/
protected
Object
handFailResponse
(
Response
<?>
response
)
{
ErrorBean
errorBean
=
new
ErrorBean
();
if
(
response
.
getStatus
()
==
ResponseStatusEnum
.
FAIL
.
getValue
())
{
errorBean
.
setCode
(
500
);
}
else
{
errorBean
.
setCode
(
response
.
getStatus
());
}
errorBean
.
setMessage
(
response
.
getMessage
());
return
errorBean
;
}
}
src/main/java/com/ctrip/fun/golf/service/basic/VoucherMService.java
View file @
d1a3415c
package
com
.
ctrip
.
fun
.
golf
.
service
.
basic
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.ParameterizedTypeReference
;
...
...
@@ -14,6 +12,8 @@ import com.ctrip.fun.common.vo.PagedResponseBean;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.basic.VoucherGetLogBean
;
import
com.ctrip.fun.common.vo.basic.VoucherGiftQuery
;
import
com.ctrip.fun.common.vo.basic.VoucherGiftVo
;
import
com.ctrip.fun.common.vo.basic.VoucherItemDTO
;
import
com.ctrip.fun.common.vo.basic.VoucherQueryDto
;
import
com.ctrip.fun.common.vo.basic.VoucherQueryRequestDTO
;
...
...
@@ -318,4 +318,42 @@ public class VoucherMService extends BaseService {
}).
getBody
();
return
response
;
}
public
Object
getVoucherGiftList
(
VoucherGiftQuery
query
){
PagedResponseBean
<
VoucherGiftVo
>
pagedResponseBean
=
new
PagedResponseBean
<
VoucherGiftVo
>(
0
,
new
ArrayList
<
VoucherGiftVo
>());
String
uri
=
super
.
getServiceUri
(
"uri.voucher.getVoucherGiftList"
);
HttpEntity
<
Request
<
VoucherGiftQuery
>>
entity
=
new
HttpEntity
<
Request
<
VoucherGiftQuery
>>(
new
Request
<
VoucherGiftQuery
>(
null
,
query
));
Response
<
PagedResponseBean
<
VoucherGiftVo
>>
response
=
null
;
try
{
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<
PagedResponseBean
<
VoucherGiftVo
>>>()
{
}).
getBody
();
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
pagedResponseBean
;
}
if
(
response
==
null
||
response
.
getStatus
()
!=
0
||
response
.
getBody
()
==
null
)
{
return
pagedResponseBean
;
}
return
response
.
getBody
();
}
public
Response
<?>
voucherGiftAffirm
(
Request
<
VoucherGiftQuery
>
request
)
{
String
uri
=
super
.
getServiceUri
(
"uri.voucher.voucherGiftAffirm"
);
HttpEntity
<
Request
<
VoucherGiftQuery
>>
entity
=
new
HttpEntity
<
Request
<
VoucherGiftQuery
>>(
request
);
Response
<?>
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<?>>()
{
}).
getBody
();
return
response
;
}
public
Response
<?>
voucherGiftCancel
(
Request
<
VoucherGiftQuery
>
request
)
{
String
uri
=
super
.
getServiceUri
(
"uri.voucher.voucherGiftCancel"
);
HttpEntity
<
Request
<
VoucherGiftQuery
>>
entity
=
new
HttpEntity
<
Request
<
VoucherGiftQuery
>>(
request
);
Response
<?>
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<?>>()
{
}).
getBody
();
return
response
;
}
}
src/main/resources/rpc.properties
View file @
d1a3415c
...
...
@@ -141,6 +141,9 @@ uri.voucher.findUserVoucherById=/fun-golf-service/Voucher/findUserVoucherById
uri.voucherRule.addVoucherRoleUsers
=
/fun-golf-service/voucherRule/addVoucherRoleUsers/{id}
uri.voucherRule.findUserVoucherById
=
/fun-golf-service/voucherRule/getVoucherRuleById
uri.voucherRule.getVoucherRuleRemark
=
/fun-golf-service/voucherRule/getVoucherRuleRemark
uri.voucher.getVoucherGiftList
=
/fun-golf-service/Voucher/getVoucherGiftList
uri.voucher.voucherGiftAffirm
=
/fun-golf-service/Voucher/voucherGiftAffirm
uri.voucher.voucherGiftCancel
=
/fun-golf-service/Voucher/voucherGiftCancel
uri.tour.search
=
/fun-golf-service/tour/search
uri.tour.cities
=
/fun-golf-service/tour/cities
...
...
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