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
2c79c114
Commit
2c79c114
authored
Jul 19, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
cb3d842b
57a5037c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
113 additions
and
33 deletions
+113
-33
RabbitCommonConfig.java
...ub/wxiaoqi/security/common/config/RabbitCommonConfig.java
+3
-1
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+9
-0
RabbitAdminConfig.java
...thub/wxiaoqi/security/admin/config/RabbitAdminConfig.java
+7
-2
IntegralMQHandler.java
...hub/wxiaoqi/security/admin/handler/IntegralMQHandler.java
+19
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+49
-14
ActivityUserJoinBiz.java
...a/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
+7
-4
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+10
-4
RabbitActivityConfig.java
...m/xxfc/platform/activity/config/RabbitActivityConfig.java
+2
-5
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+1
-2
OrderRentVehicleController.java
.../xxfc/platform/order/rest/OrderRentVehicleController.java
+1
-0
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+5
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/config/RabbitCommonConfig.java
View file @
2c79c114
...
@@ -52,7 +52,9 @@ public abstract class RabbitCommonConfig {
...
@@ -52,7 +52,9 @@ public abstract class RabbitCommonConfig {
if
(
null
!=
myQueue
)
{
if
(
null
!=
myQueue
)
{
myQueue
.
forEach
(
en
->
{
myQueue
.
forEach
(
en
->
{
//避免一个队列绑定多个exchange+key 时 再次创建queueBean
//避免一个队列绑定多个exchange+key 时 再次创建queueBean
if
(
null
==
applicationContext
.
getBean
(
StrUtil
.
toCamelCase
(
en
.
getQueue
()),
Queue
.
class
))
{
try
{
Queue
queue
=
applicationContext
.
getBean
(
StrUtil
.
toCamelCase
(
en
.
getQueue
()),
Queue
.
class
);
}
catch
(
Exception
e
)
{
registerBean
(
StrUtil
.
toCamelCase
(
en
.
getQueue
()),
Queue
.
class
,
en
.
getQueue
(),
Boolean
.
TRUE
);
registerBean
(
StrUtil
.
toCamelCase
(
en
.
getQueue
()),
Queue
.
class
,
en
.
getQueue
(),
Boolean
.
TRUE
);
}
}
String
bindName
=
StrUtil
.
toCamelCase
(
en
.
getQueue
())+
"Binding"
+
en
.
getExchange
()+
"_"
+
en
.
getKey
();
String
bindName
=
StrUtil
.
toCamelCase
(
en
.
getQueue
())+
"Binding"
+
en
.
getExchange
()+
"_"
+
en
.
getKey
();
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
2c79c114
...
@@ -76,6 +76,15 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -76,6 +76,15 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
}
}
}
}
}
//永久稳定关系
public
void
foreverBind
(
Integer
user_id
){
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
user_id
);
if
(
relation
!=
null
&&
relation
.
getIsForever
()==
0
){
relation
.
setIsForever
(
1
);
getMyBiz
().
updRelation
(
relation
);
}
}
/**
/**
* 小程序分享上下线绑定
* 小程序分享上下线绑定
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/config/RabbitAdminConfig.java
View file @
2c79c114
...
@@ -22,9 +22,14 @@ import java.util.Map;
...
@@ -22,9 +22,14 @@ import java.util.Map;
public
class
RabbitAdminConfig
extends
RabbitCommonConfig
{
public
class
RabbitAdminConfig
extends
RabbitCommonConfig
{
public
static
final
String
ORDER_WATER_QUEUE
=
"order.water.queue"
;
public
static
final
String
ORDER_WATER_QUEUE
=
"order.water.queue"
;
public
static
final
String
ORDER_FINLISH_user_re_QUEUE
=
"order.cancel.userRe.queue"
;
static
{
static
{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.pay"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.finlish"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.cancel"
));
add
(
new
BindDTO
(
ORDER_FINLISH_user_re_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.finlish"
));
}};
}};
}
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/IntegralMQHandler.java
View file @
2c79c114
...
@@ -10,16 +10,19 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
...
@@ -10,16 +10,19 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
config
.
RabbitAdminConfig
.*;
@Component
@Component
@Slf4j
@Slf4j
public
class
IntegralMQHandler
{
public
class
IntegralMQHandler
{
@Autowired
@Autowired
AppUserSellingWaterBiz
waterBiz
;
AppUserSellingWaterBiz
waterBiz
;
@RabbitListener
(
queues
=
RabbitAdminConfig
.
ORDER_WATER_QUEUE
)
@RabbitListener
(
queues
=
ORDER_WATER_QUEUE
)
public
void
integralHandler
(
String
json
)
{
public
void
integralHandler
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -28,4 +31,19 @@ public class IntegralMQHandler {
...
@@ -28,4 +31,19 @@ public class IntegralMQHandler {
}
}
}
}
@RabbitListener
(
queues
=
{
ORDER_FINLISH_user_re_QUEUE
})
public
void
integralHandler2
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
log
.
info
(
"接收到的消息失败"
);
e
.
printStackTrace
();
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
2c79c114
...
@@ -287,10 +287,10 @@ public class AppPermissionService {
...
@@ -287,10 +287,10 @@ public class AppPermissionService {
rsUserDetail
.
setCode
(
UUIDUtils
.
genCodes
(
8
));
rsUserDetail
.
setCode
(
UUIDUtils
.
genCodes
(
8
));
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
//绑定上下线关系
/*
//绑定上下线关系
if(parentId!=null&&parentId>0){
if(parentId!=null&&parentId>0){
relationBiz.bindRelation(userid,parentId,1);
relationBiz.bindRelation(userid,parentId,1);
}
}
*/
//临时会员绑定
//临时会员绑定
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
//参加新人活动
//参加新人活动
...
@@ -298,7 +298,7 @@ public class AppPermissionService {
...
@@ -298,7 +298,7 @@ public class AppPermissionService {
//创建钱包
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// 登录结果要做做统一处理
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
// 到im注册,获取返回结果
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
if
(
map
!=
null
)
{
...
@@ -318,7 +318,7 @@ public class AppPermissionService {
...
@@ -318,7 +318,7 @@ public class AppPermissionService {
data
.
put
(
"imUserId"
,
imUserId
);
data
.
put
(
"imUserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
sendQueue
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
,
userid
);
sendQueue
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_NEW
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
else
{
}
else
{
return
JsonResultUtil
.
createDefaultFail
();
return
JsonResultUtil
.
createDefaultFail
();
...
@@ -329,12 +329,13 @@ public class AppPermissionService {
...
@@ -329,12 +329,13 @@ public class AppPermissionService {
}
}
}
}
private
void
sendQueue
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
String
activityCode
,
Integer
userid
)
{
private
void
sendQueue
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
String
activityCode
,
Integer
userid
,
Integer
sign
)
{
try
{
try
{
RegisterQueueDTO
registerQueueDTO
=
new
RegisterQueueDTO
();
RegisterQueueDTO
registerQueueDTO
=
new
RegisterQueueDTO
();
//出参
//出参
// registerQueueDTO.setData(data);
// registerQueueDTO.setData(data);
registerQueueDTO
.
setAppUserId
(
userid
);
registerQueueDTO
.
setAppUserId
(
userid
);
registerQueueDTO
.
setSign
(
sign
);
//入参
//入参
registerQueueDTO
.
setInParamDTO
(
new
RegisterParamDTO
(
username
,
password
,
headimgurl
,
registerQueueDTO
.
setInParamDTO
(
new
RegisterParamDTO
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
));
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
));
...
@@ -348,7 +349,7 @@ public class AppPermissionService {
...
@@ -348,7 +349,7 @@ public class AppPermissionService {
/**
/**
* 自动登录
* 自动登录
*/
*/
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
)
{
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
,
String
code
)
{
JSONObject
data
=
new
JSONObject
();
JSONObject
data
=
new
JSONObject
();
AppUserVo
userVo
=
appUserDetailBiz
.
getUserInfoById
(
userid
);
AppUserVo
userVo
=
appUserDetailBiz
.
getUserInfoById
(
userid
);
if
(
userVo
!=
null
)
{
if
(
userVo
!=
null
)
{
...
@@ -375,6 +376,39 @@ public class AppPermissionService {
...
@@ -375,6 +376,39 @@ public class AppPermissionService {
//更新登录时间 和 ip
//更新登录时间 和 ip
String
clientIp
=
getIp
();
String
clientIp
=
getIp
();
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
try
{
String
code1
=
null
;
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code1
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
if
(
StringUtils
.
isNotBlank
(
code1
)){
Integer
parentId
=
appUserDetailBiz
.
getUserByCode
(
code1
);
//绑定上下线关系
if
(
parentId
!=
null
&&
parentId
>
0
)
{
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
}
//活动消息
Integer
state
=
userVo
.
getState
();
if
(
state
!=
null
&&
state
==
1
&&
StringUtils
.
isNotBlank
(
activityCode
)){
if
(
userVo
.
getInviterAccount
()==
null
||
userVo
.
getInviterAccount
()==
0
){
userVo
.
setInviterAccount
(
parentId
);
}
userVo
.
setState
(
2
);
appUserDetailBiz
.
updUuserInfoById
(
userVo
);
sendQueue
(
username
,
null
,
headimgurl
,
nickname
,
null
,
null
,
null
,
null
,
code1
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_ACTIVATE
);
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
...
@@ -469,7 +503,7 @@ public class AppPermissionService {
...
@@ -469,7 +503,7 @@ public class AppPermissionService {
appUserDetailBiz.updateSelectiveById(userDetail);
appUserDetailBiz.updateSelectiveById(userDetail);
}*/
}*/
// 登录结果要做做统一处理
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
// 到im登录,获取返回结果
// 到im登录,获取返回结果
/*Integer imUserId=userLogin.getImUserid();
/*Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
String imPassword=userLogin.getImPassword();
...
@@ -537,7 +571,7 @@ public class AppPermissionService {
...
@@ -537,7 +571,7 @@ public class AppPermissionService {
* @return
* @return
*/
*/
@Transactional
@Transactional
public
JSONObject
weCahtLogin
(
String
openId
,
Integer
isQQ
)
{
public
JSONObject
weCahtLogin
(
String
openId
,
Integer
isQQ
,
String
code
)
{
if
(
StringUtils
.
isBlank
(
openId
))
{
if
(
StringUtils
.
isBlank
(
openId
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
}
...
@@ -556,7 +590,7 @@ public class AppPermissionService {
...
@@ -556,7 +590,7 @@ public class AppPermissionService {
headimgurl
=
userVo
.
getHeadimgurl
();
headimgurl
=
userVo
.
getHeadimgurl
();
nickname
=
userVo
.
getNickname
();
nickname
=
userVo
.
getNickname
();
}
}
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
,
code
);
/* // 到im注册,获取返回结果
/* // 到im注册,获取返回结果
Integer imUserId=userLogin.getImUserid();
Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
String imPassword=userLogin.getImPassword();
...
@@ -571,7 +605,7 @@ public class AppPermissionService {
...
@@ -571,7 +605,7 @@ public class AppPermissionService {
return
JsonResultUtil
.
createDefaultFail
();
return
JsonResultUtil
.
createDefaultFail
();
}
}
public
JSONObject
login
(
String
username
,
String
password
,
String
mobilecode
,
int
type
)
{
public
JSONObject
login
(
String
username
,
String
password
,
String
mobilecode
,
int
type
,
String
code
)
{
if
(
StringUtils
.
isBlank
(
username
)
||
((
StringUtils
.
isBlank
(
password
)
&&
type
==
1
)
||
(
StringUtils
.
isBlank
(
mobilecode
)
&&
type
==
2
)))
{
if
(
StringUtils
.
isBlank
(
username
)
||
((
StringUtils
.
isBlank
(
password
)
&&
type
==
1
)
||
(
StringUtils
.
isBlank
(
mobilecode
)
&&
type
==
2
)))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"请求参数为空"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"请求参数为空"
);
}
}
...
@@ -598,7 +632,7 @@ public class AppPermissionService {
...
@@ -598,7 +632,7 @@ public class AppPermissionService {
}
}
Integer
userid
=
user
.
getId
();
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
code
);
/*// 到im注册,获取返回结果
/*// 到im注册,获取返回结果
Integer imUserId=user.getImUserid();
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
String imPassword=user.getImPassword();
...
@@ -639,7 +673,7 @@ public class AppPermissionService {
...
@@ -639,7 +673,7 @@ public class AppPermissionService {
appUserLoginBiz
.
updatePasswordById
(
user
);
appUserLoginBiz
.
updatePasswordById
(
user
);
Integer
userid
=
user
.
getId
();
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
null
);
/* // 到im登录,获取返回结果
/* // 到im登录,获取返回结果
Integer imUserId=user.getImUserid();
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
String imPassword=user.getImPassword();
...
@@ -793,7 +827,7 @@ public class AppPermissionService {
...
@@ -793,7 +827,7 @@ public class AppPermissionService {
* @return
* @return
*/
*/
public
JSONObject
appletLoginByUserId
(
Integer
uid
)
{
public
JSONObject
appletLoginByUserId
(
Integer
uid
)
{
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
);
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
,
null
);
if
(
data
.
getDate
(
"userId"
)
!=
null
)
{
if
(
data
.
getDate
(
"userId"
)
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
}
...
@@ -847,6 +881,7 @@ public class AppPermissionService {
...
@@ -847,6 +881,7 @@ public class AppPermissionService {
rsUserDetail
.
setChannel
(
UserSourceEnum
.
APPLET
.
getCode
());
rsUserDetail
.
setChannel
(
UserSourceEnum
.
APPLET
.
getCode
());
rsUserDetail
.
setCrtHost
(
getIp
());
rsUserDetail
.
setCrtHost
(
getIp
());
setCreateIPInfo
(
rsUserDetail
);
setCreateIPInfo
(
rsUserDetail
);
rsUserDetail
.
setState
(
1
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
//创建钱包
//创建钱包
...
@@ -860,7 +895,7 @@ public class AppPermissionService {
...
@@ -860,7 +895,7 @@ public class AppPermissionService {
//参加新人活动
//参加新人活动
jionActivity
(
userid
);
jionActivity
(
userid
);
// 登录结果要做做统一处理
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
);
// 到im注册,获取返回结果
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
if
(
map
!=
null
)
{
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
View file @
2c79c114
...
@@ -2,6 +2,8 @@ package com.xxfc.platform.activity.biz;
...
@@ -2,6 +2,8 @@ package com.xxfc.platform.activity.biz;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.activity.entity.ActivityRule
;
import
com.xxfc.platform.activity.entity.ActivityRule
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -53,11 +55,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -53,11 +55,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
//领取优惠卷
//领取优惠卷
public
void
receiveCoupn
(
Integer
userId
)
{
public
ObjectRestResponse
receiveCoupn
(
Integer
userId
)
{
ActivityRule
rule
=
ruleBiz
.
getActity
();
ActivityRule
rule
=
ruleBiz
.
getActity
();
if
(
rule
==
null
)
{
if
(
rule
==
null
)
{
log
.
error
(
"----没有开启的活动----"
);
log
.
error
(
"----没有开启的活动----"
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"没有开启的活动"
)
;
}
}
Integer
activityId
=
rule
.
getId
();
Integer
activityId
=
rule
.
getId
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
...
@@ -66,11 +68,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -66,11 +68,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
userJoin
=
selectOne
(
userJoin
);
userJoin
=
selectOne
(
userJoin
);
if
(
userJoin
==
null
)
{
if
(
userJoin
==
null
)
{
log
.
error
(
"----用户没有此参与活动----userId===="
+
userId
);
log
.
error
(
"----用户没有此参与活动----userId===="
+
userId
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"不是新用户,无法参与此活动"
)
;
}
}
if
(
userJoin
.
getStatus
()!=
0
){
if
(
userJoin
.
getStatus
()!=
0
){
log
.
error
(
"----用户已领取----userId===="
+
userId
);
log
.
error
(
"----用户已领取----userId===="
+
userId
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"用户已领取"
)
;
}
}
String
value
=
rule
.
getValue
();
String
value
=
rule
.
getValue
();
JSONObject
json
=
JSONObject
.
parseObject
(
value
);
JSONObject
json
=
JSONObject
.
parseObject
(
value
);
...
@@ -88,6 +90,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -88,6 +90,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
userJoin
.
setStatus
(
1
);
userJoin
.
setStatus
(
1
);
updateById
(
userJoin
);
updateById
(
userJoin
);
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
2c79c114
...
@@ -148,6 +148,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -148,6 +148,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
//支付后更新优惠卷状态
//支付后更新优惠卷状态
public
BigDecimal
useTickerNo
(
Integer
userId
,
String
TickerNo
,
String
orderNo
,
Integer
channel
,
BigDecimal
amout
,
Integer
type
){
public
BigDecimal
useTickerNo
(
Integer
userId
,
String
TickerNo
,
String
orderNo
,
Integer
channel
,
BigDecimal
amout
,
Integer
type
){
BigDecimal
couponAmout
=
new
BigDecimal
(
"0.00"
);
BigDecimal
couponAmout
=
new
BigDecimal
(
"0.00"
);
if
(
couponAmout
.
compareTo
(
amout
)
>=
0
)
{
return
BigDecimal
.
ZERO
;
}
if
(
userId
==
null
||
userId
==
0
||
StringUtils
.
isBlank
(
TickerNo
)){
if
(
userId
==
null
||
userId
==
0
||
StringUtils
.
isBlank
(
TickerNo
)){
log
.
error
(
"----参数不能为空"
);
log
.
error
(
"----参数不能为空"
);
return
couponAmout
;
return
couponAmout
;
...
@@ -183,10 +186,13 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -183,10 +186,13 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
Integer
type
=
coupon
.
getType
();
Integer
type
=
coupon
.
getType
();
if
(
type
!=
null
)
{
if
(
type
!=
null
)
{
BigDecimal
useAmout
=
coupon
.
getUsedAmount
();
BigDecimal
useAmout
=
coupon
.
getUsedAmount
();
if
(
amout
.
compareTo
(
useAmout
)
>
0
)
{
if
(
type
==
3
||
(
type
==
1
&&
(
amout
.
compareTo
(
coupon
.
getWithAmount
())
>=
0
)))
{
if
(
type
==
3
||
(
type
==
1
&&
(
amout
.
compareTo
(
coupon
.
getWithAmount
())
>=
0
)))
{
//couponAmout = amout.subtract(useAmout);
//couponAmout = amout.subtract(useAmout);
couponAmout
=
useAmout
;
if
(
amout
.
compareTo
(
useAmout
)
>
0
)
{
couponAmout
=
useAmout
;
}
else
{
couponAmout
=
amout
;
}
}
}
}
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/config/RabbitActivityConfig.java
View file @
2c79c114
...
@@ -22,16 +22,13 @@ import java.util.ArrayList;
...
@@ -22,16 +22,13 @@ import java.util.ArrayList;
public
class
RabbitActivityConfig
extends
RabbitCommonConfig
{
public
class
RabbitActivityConfig
extends
RabbitCommonConfig
{
public
static
final
String
INTEGRAL_QUEUE
=
"integral_queue"
;
public
static
final
String
INTEGRAL_QUEUE
=
"integral_queue"
;
// public static final String POPULARZIE_REGISTER_QUEUE = "popularzie.register.queue";
// public static final String POPULARZIE_AUTH_QUEUE = "popularzie.auth.queue";
public
static
final
String
POPULARZIE_0101_QUEUE
=
"popularzie.0101.queue"
;
public
static
final
String
POPULARZIE_0101_QUEUE
=
"popularzie.0101.queue"
;
static
{
static
{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
add
(
new
BindDTO
(
INTEGRAL_QUEUE
,
RabbitConstant
.
ORDER_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
INTEGRAL_QUEUE
,
RabbitConstant
.
ORDER_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.#"
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.register"
));
// add(new BindDTO(POPULARZIE_REGISTER_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.auth"
));
// add(new BindDTO(POPULARZIE_AUTH_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.login"));
}};
}};
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
2c79c114
...
@@ -82,8 +82,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -82,8 +82,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
joinBiz
.
receiveCoupn
(
userId
);
return
joinBiz
.
receiveCoupn
(
userId
);
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRentVehicleController.java
View file @
2c79c114
...
@@ -124,6 +124,7 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -124,6 +124,7 @@ public class OrderRentVehicleController extends CommonBaseController {
/**
/**
* 优惠券*
* 优惠券*
*/
*/
@ApiModelProperty
(
value
=
"优惠卷卷号"
)
private
String
tickerNos
;
private
String
tickerNos
;
}
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
2c79c114
...
@@ -141,6 +141,11 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -141,6 +141,11 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
}
}
}
//如果有使用优惠券,则扣减
// if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) >= 0) {
//
// }
super
.
handleDetail
(
bo
);
super
.
handleDetail
(
bo
);
//发送定时取消订单(数据字典设置--5分钟)
//发送定时取消订单(数据字典设置--5分钟)
...
...
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