Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
fe7d731e
Commit
fe7d731e
authored
Jul 18, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加优惠卷
parent
f926c1bb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
9 deletions
+41
-9
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+3
-2
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-1
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+20
-2
UserCouponMapper.java
...a/com/xxfc/platform/activity/mapper/UserCouponMapper.java
+1
-1
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+13
-3
UserCouponMapper.xml
...ity-server/src/main/resources/mapper/UserCouponMapper.xml
+3
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
fe7d731e
...
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.common.util.ClientUtil;
import
com.github.wxiaoqi.security.common.util.EntityUtils
;
import
com.github.wxiaoqi.security.common.util.IpUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -217,8 +218,8 @@ public class AuthController {
}
@PostMapping
(
"/imi/login"
)
public
String
loginImiWithToken
(){
return
authService
.
loginImiWithToken
(
);
public
JSONObject
loginImiWithToken
(){
return
JsonResultUtil
.
createSuccessResultWithObj
(
authService
.
loginImiWithToken
()
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
fe7d731e
...
...
@@ -709,7 +709,7 @@ public class AppPermissionService {
public
String
loginImiWithUserId
(
Integer
userId
){
AppUserLogin
appUserLogin
=
appUserLoginBiz
.
getUserById
(
userId
);
String
token
=
loginIm
(
appUserLogin
.
getUsername
(),
appUserLogin
.
getImPassword
(),
userId
);
String
token
=
loginIm
(
appUserLogin
.
getUsername
(),
appUserLogin
.
getImPassword
(),
appUserLogin
.
getImUserid
()
);
return
token
;
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
fe7d731e
...
...
@@ -109,15 +109,33 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
}
//获取我的优惠卷
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
){
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
){
if
(
userId
==
null
||
userId
==
0
){
log
.
error
(
"----参数不能为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Long
time
=
System
.
currentTimeMillis
();
return
ObjectRestResponse
.
succ
(
mapper
.
getUserCouponsByType
(
userId
,
type
,
time
));
List
<
UserCouponVo
>
list
=
mapper
.
getUserCouponsByType
(
userId
,
type
,
time
,
channel
);
if
(
amout
.
compareTo
(
new
BigDecimal
(
"0.00"
))>
0
&&
list
.
size
()>
0
){
for
(
UserCouponVo
couponVo:
list
){
Integer
status
=
2
;
if
(
amout
.
compareTo
(
couponVo
.
getUsedAmount
())>=
0
){
if
(
couponVo
.
getChannel
()==
1
){
if
(
amout
.
compareTo
(
couponVo
.
getWithAmount
())>=
0
){
status
=
1
;
}
}
else
if
(
couponVo
.
getChannel
()==
3
){
status
=
1
;
}
}
couponVo
.
setStatus
(
status
);
}
}
return
ObjectRestResponse
.
succ
(
list
);
}
//获取单个优惠卷
public
UserCouponVo
getUserCoupon
(
String
tickerNo
){
if
(
StringUtils
.
isBlank
(
tickerNo
)){
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/UserCouponMapper.java
View file @
fe7d731e
...
...
@@ -17,7 +17,7 @@ import java.util.List;
public
interface
UserCouponMapper
extends
Mapper
<
UserCoupon
>
{
//我的优惠卷
public
List
<
UserCouponVo
>
getUserCouponsByType
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"type"
)
int
type
,
@Param
(
"time"
)
Long
time
);
public
List
<
UserCouponVo
>
getUserCouponsByType
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"type"
)
int
type
,
@Param
(
"time"
)
Long
time
,
@Param
(
"channel"
)
Integer
channel
);
//单个优惠卷
public
UserCouponVo
getUserCoupon
(
@Param
(
"tickerNo"
)
String
tickerNo
);
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
fe7d731e
...
...
@@ -27,15 +27,23 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
return
baseBiz
.
authledCoupon
(
userId
);
}
/**
*
* @param type 0-未使用;1-已使用;3-已过期
* @param channel 1-租车;2-旅游;null-全部
* @return
*/
@ApiOperation
(
"我的优惠卷"
)
@RequestMapping
(
value
=
"/list/{type}"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
list
(
@PathVariable
Integer
type
)
{
@RequestMapping
(
value
=
"/coupon/list"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
list
(
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"channel"
)
Integer
channel
,
@RequestParam
(
value
=
"amount"
,
defaultValue
=
"0.00"
)
BigDecimal
amount
)
{
AppUserDTO
userInfo
=
getUserInfo
();
Integer
userId
=
userInfo
.
getUserid
();
if
(
userId
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
}
return
baseBiz
.
getCouponList
(
userId
,
type
);
return
baseBiz
.
getCouponList
(
userId
,
type
,
channel
,
amount
);
}
@ApiOperation
(
"单个优惠卷信息"
)
...
...
@@ -80,4 +88,6 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/UserCouponMapper.xml
View file @
fe7d731e
...
...
@@ -46,6 +46,9 @@
<if
test=
"type==2"
>
and u.is_use=0 and u.expire_time
<
#{time}
</if>
<if
test=
"channel!=null and channel!=''"
>
and (c.channel=#{channel} or c.channel=1 )
</if>
<choose>
<when
test=
"type==1"
>
ORDER BY u.use_time DESC
...
...
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