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
32a6175e
Commit
32a6175e
authored
Jul 20, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
6ee011a9
5a00f250
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
462 additions
and
238 deletions
+462
-238
RabbitConstant.java
...wxiaoqi/security/common/config/rabbit/RabbitConstant.java
+4
-2
OrderGoodsDTO.java
.../com/github/wxiaoqi/security/admin/dto/OrderGoodsDTO.java
+4
-2
RegisterQueueDTO.java
...m/github/wxiaoqi/security/admin/dto/RegisterQueueDTO.java
+1
-1
pom.xml
ace-modules/ace-admin/pom.xml
+6
-0
IntegralMQHandler.java
...hub/wxiaoqi/security/admin/handler/IntegralMQHandler.java
+0
-49
WaterMQHandler.java
...github/wxiaoqi/security/admin/handler/WaterMQHandler.java
+145
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+48
-28
ActivityPopularizeBiz.java
...com/xxfc/platform/activity/biz/ActivityPopularizeBiz.java
+6
-3
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+2
-2
RabbitActivityConfig.java
...m/xxfc/platform/activity/config/RabbitActivityConfig.java
+6
-9
PopularizeMQHandler.java
...m/xxfc/platform/activity/handler/PopularizeMQHandler.java
+3
-2
ActivityPopularizeController.java
.../platform/activity/rest/ActivityPopularizeController.java
+9
-0
appVersionQuery.java
...c/main/java/com/xxfc/platform/app/vo/appVersionQuery.java
+24
-0
AppVersionBiz.java
...rc/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
+24
-4
AppVersionMapper.java
...n/java/com/xxfc/platform/app/mapper/AppVersionMapper.java
+6
-1
AppVersionController.java
...java/com/xxfc/platform/app/rest/AppVersionController.java
+22
-6
AppVersionController.xml
...server/src/main/resources/mapper/AppVersionController.xml
+24
-0
ImCommentBiz.java
.../src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
+2
-2
ImQuestionBiz.java
...src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
+2
-2
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+7
-6
OrderMQDTO.java
...main/java/com/xxfc/platform/order/pojo/mq/OrderMQDTO.java
+11
-2
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+46
-11
MQconstant.java
...java/com/xxfc/platform/universal/constant/MQconstant.java
+0
-8
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+7
-5
CertificationController.java
...latform/universal/controller/CertificationController.java
+30
-1
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+23
-92
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/config/rabbit/RabbitConstant.java
View file @
32a6175e
...
...
@@ -13,11 +13,12 @@ public class RabbitConstant {
public
static
final
String
ADMIN_TOPIC
=
ADMIN
+
TOPIC_EXC
;
public
static
final
String
ORDER
=
"order"
;
public
static
final
String
ORDER_TOPIC
=
ORDER
+
TOPIC_EXC
;
public
static
final
String
INTEGRAL
=
"integral"
;
public
static
final
String
INTEGRAL_TOPIC
=
INTEGRAL
+
TOPIC_EXC
;
/**************************key*********************************/
public
static
final
String
KEY_APPUSER_REGISTER
=
"appUser.register"
;
public
static
final
String
KEY_APPUSER_AUTH
=
"appUser.auth"
;
public
static
final
String
INTEGRAL_ROUTING_KEY
=
"integral_routing_key"
;
public
static
final
String
KEY_ORDER_PAY
=
"order.pay"
;
public
static
final
String
KEY_ORDER_FINLISH
=
"order.finlish"
;
public
static
final
String
KEY_ORDER_CANCEL
=
"order.cancel"
;
...
...
@@ -26,6 +27,7 @@ public class RabbitConstant {
exchangeTopicSet
=
new
HashSet
<
String
>()
{{
add
(
ADMIN_TOPIC
);
add
(
ORDER_TOPIC
);
add
(
INTEGRAL_TOPIC
);
}};
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/OrderGoodsDTO.java
View file @
32a6175e
...
...
@@ -11,8 +11,10 @@ import java.math.BigDecimal;
@Data
public
class
OrderGoodsDTO
{
public
static
final
Integer
TYPE_RENT
=
1
;
public
static
final
Integer
TYPE_TOUR
=
2
;
public
static
final
Integer
TYPE_MEMBER
=
3
;
public
static
final
Integer
TYPE_CAMPSITE
=
4
;
/**
* 商品id
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/RegisterQueueDTO.java
View file @
32a6175e
...
...
@@ -12,7 +12,7 @@ public class RegisterQueueDTO {
/**
* 执行方法的入参
*/
RegisterParamDTO
I
nParamDTO
;
RegisterParamDTO
i
nParamDTO
;
/**
* app用户id
...
...
ace-modules/ace-admin/pom.xml
View file @
32a6175e
...
...
@@ -225,6 +225,12 @@
<artifactId>
xx-universal-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-order-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
<finalName>
ace-admin
</finalName>
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/IntegralMQHandler.java
deleted
100644 → 0
View file @
6ee011a9
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
handler
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.config.RabbitAdminConfig
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
config
.
RabbitAdminConfig
.*;
@Component
@Slf4j
public
class
IntegralMQHandler
{
@Autowired
AppUserSellingWaterBiz
waterBiz
;
@RabbitListener
(
queues
=
ORDER_WATER_QUEUE
)
public
void
integralHandler
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
log
.
info
(
"接收到的消息失败"
);
e
.
printStackTrace
();
}
}
@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/handler/WaterMQHandler.java
0 → 100644
View file @
32a6175e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
handler
;
import
cn.hutool.db.sql.Order
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.dto.OrderGoodsDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.support.AmqpHeaders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.messaging.handler.annotation.Headers
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
config
.
RabbitAdminConfig
.*;
@Component
@Slf4j
public
class
WaterMQHandler
{
@Autowired
AppUserSellingWaterBiz
waterBiz
;
/**
* 佣金
* @param
*/
@RabbitListener
(
queues
=
ORDER_WATER_QUEUE
)
public
void
integralHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
String
messageId
=
message
.
getMessageProperties
().
getMessageId
();
String
msg
=
new
String
(
message
.
getBody
(),
"UTF-8"
);
OrderMQDTO
orderMQDTO
=
JSONUtil
.
toBean
(
msg
,
OrderMQDTO
.
class
);
OrderWaterDTO
orderWaterDTO
=
new
OrderWaterDTO
(){{
setUserId
(
orderMQDTO
.
getUserId
());
setOrderNo
(
orderMQDTO
.
getNo
());
setOrderId
(
orderMQDTO
.
getId
());
}};
switch
(
OrderTypeEnum
.
get
(
orderMQDTO
.
getType
()))
{
case
RENT_VEHICLE:
orderWaterDTO
.
setGoodsDTOList
(
new
ArrayList
<
OrderGoodsDTO
>(){{
add
(
new
OrderGoodsDTO
(){{
setGoodId
(
orderMQDTO
.
getOrderRentVehicleDetail
().
getModelId
());
setGoodNumber
(
1
);
setImg
(
orderMQDTO
.
getPicture
());
setPrice
(
orderMQDTO
.
getGoodsAmount
());
setTitle
(
orderMQDTO
.
getName
());
setType
(
OrderGoodsDTO
.
TYPE_RENT
);
}});
}}
);
break
;
case
TOUR:
orderWaterDTO
.
setGoodsDTOList
(
new
ArrayList
<
OrderGoodsDTO
>(){{
add
(
new
OrderGoodsDTO
(){{
setGoodId
(
orderMQDTO
.
getOrderTourDetail
().
getGoodId
());
setGoodNumber
(
1
);
setImg
(
orderMQDTO
.
getPicture
());
setPrice
(
orderMQDTO
.
getGoodsAmount
());
setTitle
(
orderMQDTO
.
getName
());
setType
(
OrderGoodsDTO
.
TYPE_RENT
);
}});
}}
);
break
;
case
MEMBER:
orderWaterDTO
.
setGoodsDTOList
(
new
ArrayList
<
OrderGoodsDTO
>(){{
add
(
new
OrderGoodsDTO
(){{
setGoodId
(
orderMQDTO
.
getOrderMemberDetail
().
getMemberLevelId
());
setGoodNumber
(
1
);
setImg
(
orderMQDTO
.
getPicture
());
setPrice
(
orderMQDTO
.
getGoodsAmount
());
setTitle
(
orderMQDTO
.
getName
());
setType
(
OrderGoodsDTO
.
TYPE_MEMBER
);
}});
}}
);
break
;
default
:
break
;
}
waterBiz
.
orderWater
(
orderWaterDTO
);
executorService
.
shutdown
();
Long
deliveryTag
=
(
Long
)
headers
.
get
(
AmqpHeaders
.
DELIVERY_TAG
);
// 手动签收
channel
.
basicAck
(
deliveryTag
,
false
);
}
catch
(
Exception
e
)
{
log
.
info
(
"接收到的消息失败"
);
try
{
channel
.
basicNack
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
,
false
);
}
catch
(
IOException
i
)
{
i
.
printStackTrace
();
}
e
.
printStackTrace
();
}
}
});
// log.info("接收到的消息:json = {}", json);
// try{
//
// OrderWaterDTO orderWaterDTO = JSONObject.parseObject(json, OrderWaterDTO.class);
// waterBiz.orderWater(orderWaterDTO);
// }catch (Exception e){
// log.info("接收到的消息失败");
// e.printStackTrace();
// }
}
@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 @
32a6175e
...
...
@@ -216,7 +216,6 @@ public class AppPermissionService {
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
)
{
String
activityCode
=
null
;
// 判断参数和验证码
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
...
...
@@ -280,7 +279,7 @@ public class AppPermissionService {
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
if
(
parentId
!=
null
&&
parentId
>
0
){
if
(
parentId
!=
null
&&
parentId
>
0
&&
StringUtils
.
isNotBlank
(
activityCode
)
){
rsUserDetail
.
setInviterAccount
(
parentId
);
}
//生成邀请码 长度改为8 不然重复率太高
...
...
@@ -298,7 +297,7 @@ public class AppPermissionService {
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
...
...
@@ -343,8 +342,10 @@ public class AppPermissionService {
switch
(
sign
){
case
1
:
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
ADMIN_TOPIC
,
KEY_APPUSER_REGISTER
,
JSONUtil
.
toJsonStr
(
registerQueueDTO
));
break
;
case
2
:
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
ADMIN_TOPIC
,
KEY_APPUSER_AUTH
,
JSONUtil
.
toJsonStr
(
registerQueueDTO
));
break
;
default
:
break
;
}
...
...
@@ -354,9 +355,9 @@ public class AppPermissionService {
}
/**
* 自动登录
* 自动登录
type;1-app;2-小程序
*/
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
,
String
code
)
{
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
,
String
code
,
String
activityCode
,
Integer
type
)
{
JSONObject
data
=
new
JSONObject
();
AppUserVo
userVo
=
appUserDetailBiz
.
getUserInfoById
(
userid
);
if
(
userVo
!=
null
)
{
...
...
@@ -383,25 +384,16 @@ public class AppPermissionService {
//更新登录时间 和 ip
String
clientIp
=
getIp
();
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
(
type
!=
null
&&
type
==
1
){
try
{
Integer
parentId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
))
{
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
}
Integer
parentId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code1
))
{
parentId
=
appUserDetailBiz
.
getUserByCode
(
code1
);
//绑定上下线关系
if
(
parentId
!=
null
&&
parentId
>
0
)
{
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
}
}
//活动消息
Integer
state
=
userVo
.
getState
();
if
(
state
!=
null
&&
state
==
1
){
...
...
@@ -410,10 +402,11 @@ public class AppPermissionService {
}
userVo
.
setState
(
2
);
appUserDetailBiz
.
updUuserInfoById
(
userVo
);
sendQueue
(
username
,
null
,
headimgurl
,
nickname
,
null
,
null
,
null
,
null
,
code
1
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_ACTIVATE
);
sendQueue
(
username
,
null
,
headimgurl
,
nickname
,
null
,
null
,
null
,
null
,
code
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_ACTIVATE
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
...
...
@@ -508,8 +501,17 @@ public class AppPermissionService {
userDetail.setNickname(nickname);
appUserDetailBiz.updateSelectiveById(userDetail);
}*/
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
// 到im登录,获取返回结果
/*Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
...
...
@@ -596,7 +598,16 @@ public class AppPermissionService {
headimgurl
=
userVo
.
getHeadimgurl
();
nickname
=
userVo
.
getNickname
();
}
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
,
code
);
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
,
code
,
activityCode
,
1
);
/* // 到im注册,获取返回结果
Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
...
...
@@ -638,7 +649,16 @@ public class AppPermissionService {
}
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
code
);
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
code
,
activityCode
,
1
);
/*// 到im注册,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
...
...
@@ -679,7 +699,7 @@ public class AppPermissionService {
appUserLoginBiz
.
updatePasswordById
(
user
);
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
null
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
null
,
null
,
null
);
/* // 到im登录,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
...
...
@@ -833,7 +853,7 @@ public class AppPermissionService {
* @return
*/
public
JSONObject
appletLoginByUserId
(
Integer
uid
)
{
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
,
null
);
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
,
null
,
null
,
2
);
if
(
data
.
getDate
(
"userId"
)
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
@@ -901,7 +921,7 @@ public class AppPermissionService {
/* //参加新人活动
jionActivity(userid);*/
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
,
null
,
2
);
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityPopularizeBiz.java
View file @
32a6175e
...
...
@@ -43,15 +43,18 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
public
static
final
String
POPULARIZE_0101
=
"0101"
;
public
static
final
String
PREFIX
=
"P"
;
public
void
handleRegister
(
RegisterQueueDTO
registerQueueDTO
)
{
String
activityCode
=
registerQueueDTO
.
getInParamDTO
().
getActivityCode
();
String
activityCode
=
registerQueueDTO
.
getInParamDTO
().
getActivityCode
()
.
replace
(
PREFIX
,
""
)
;
AppUserDTO
appUserDTO
=
userFeign
.
userDetailById
(
registerQueueDTO
.
getAppUserId
()).
getData
();
//获取活动code,并且注册来源是app 并且
是邀请注册
//获取活动code,并且注册来源是app 并且
非普通登录
if
(
POPULARIZE_0101
.
equals
(
registerQueueDTO
.
getInParamDTO
().
getActivityCode
())
&&
RegisterQueueDTO
.
SIGN_LOGIN
.
equals
(
registerQueueDTO
.
getSign
()))
{
&&
!
RegisterQueueDTO
.
SIGN_LOGIN
.
equals
(
registerQueueDTO
.
getSign
()))
{
//查询出活动
ActivityPopularize
activityPopularize
=
popularizeBiz
.
selectOne
(
new
ActivityPopularize
(){{
setCode
(
activityCode
);
}});
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
32a6175e
...
...
@@ -121,11 +121,11 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if
(
amout
.
compareTo
(
new
BigDecimal
(
"0.00"
))>
0
&&
list
.
size
()>
0
){
for
(
UserCouponVo
couponVo:
list
){
Integer
status
=
2
;
if
(
couponVo
.
get
Channel
()==
1
){
if
(
couponVo
.
get
Type
()==
1
){
if
(
amout
.
compareTo
(
couponVo
.
getWithAmount
())>=
0
){
status
=
1
;
}
}
else
if
(
couponVo
.
get
Channel
()==
3
){
}
else
if
(
couponVo
.
get
Type
()==
3
){
status
=
1
;
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/config/RabbitActivityConfig.java
View file @
32a6175e
...
...
@@ -3,13 +3,10 @@ package com.xxfc.platform.activity.config;
import
com.github.wxiaoqi.security.common.config.RabbitCommonConfig
;
import
com.github.wxiaoqi.security.common.config.rabbit.BindDTO
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.ArrayList
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.*;
/**
* rabbitmq配置类
* 包含: 不知道什么orderWater队列
...
...
@@ -26,12 +23,12 @@ public class RabbitActivityConfig extends RabbitCommonConfig {
public
static
final
String
INTEGRAL_HANDLE_QUEUE
=
"integral_handle_queue"
;
static
{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
add
(
new
BindDTO
(
INTEGRAL_QUEUE
,
ORDER_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
ADMIN_TOPIC
,
KEY_APPUSER_REGISTER
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
ADMIN_TOPIC
,
KEY_APPUSER_AUTH
));
add
(
new
BindDTO
(
ACTIVITY_NEW_QUEUE
,
ADMIN_TOPIC
,
KEY_APPUSER_REGISTER
));
add
(
new
BindDTO
(
ACTIVITY_NEW_QUEUE
,
ADMIN_TOPIC
,
KEY_APPUSER_AUTH
));
add
(
new
BindDTO
(
INTEGRAL_HANDLE_QUEUE
,
MQconstant
.
INTEGRAL_EXCHANGE
,
MQc
onstant
.
INTEGRAL_ROUTING_KEY
));
add
(
new
BindDTO
(
INTEGRAL_QUEUE
,
RabbitConstant
.
ORDER_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.register"
));
add
(
new
BindDTO
(
POPULARZIE_0101_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.auth"
));
add
(
new
BindDTO
(
ACTIVITY_NEW_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.register"
));
add
(
new
BindDTO
(
ACTIVITY_NEW_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"appUser.auth"
));
add
(
new
BindDTO
(
INTEGRAL_HANDLE_QUEUE
,
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitC
onstant
.
INTEGRAL_ROUTING_KEY
));
}};
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/handler/PopularizeMQHandler.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
activity
.
handler
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO
;
import
com.rabbitmq.client.Channel
;
...
...
@@ -47,7 +48,7 @@ public class PopularizeMQHandler {
log
.
info
(
"接收到的消息:msg = {}, 消息ID是:messageId = {} "
,
msg
,
messageId
);
if
(
StringUtils
.
isNotBlank
(
msg
))
{
RegisterQueueDTO
registerQueueDTO
=
JSON
Object
.
parseObject
(
msg
,
RegisterQueueDTO
.
class
);
RegisterQueueDTO
registerQueueDTO
=
JSON
Util
.
toBean
(
msg
,
RegisterQueueDTO
.
class
);
activityPopularizeBiz
.
handleRegister
(
registerQueueDTO
);
}
...
...
@@ -80,7 +81,7 @@ public class PopularizeMQHandler {
log
.
info
(
"接收到的消息:msg = {}, 消息ID是:messageId = {} "
,
msg
,
messageId
);
if
(
StringUtils
.
isNotBlank
(
msg
))
{
RegisterQueueDTO
registerQueueDTO
=
JSON
Object
.
parseObject
(
msg
,
RegisterQueueDTO
.
class
);
RegisterQueueDTO
registerQueueDTO
=
JSON
Util
.
toBean
(
msg
,
RegisterQueueDTO
.
class
);
if
(
registerQueueDTO
!=
null
&&(
registerQueueDTO
.
getSign
()==
RegisterQueueDTO
.
SIGN_NEW
||
registerQueueDTO
.
getSign
()==
RegisterQueueDTO
.
SIGN_ACTIVATE
)){
activityUserJoinBiz
.
joinActivity
(
registerQueueDTO
.
getAppUserId
());
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/ActivityPopularizeController.java
View file @
32a6175e
...
...
@@ -206,4 +206,13 @@ public class ActivityPopularizeController extends BaseController<ActivityPopular
return
finishUserVO
;
}).
collect
(
Collectors
.
toList
()));
}
// public static void main(String[] args) {
// Map<String, String> map = new HashMap<String, String>(){{
//// put("1", null);
//// put("2", null);
// }};
// List<String> list = map.entrySet().stream().map(k -> k.getKey()).collect(Collectors.toList());
// System.out.println(list);
// }
}
\ No newline at end of file
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/vo/appVersionQuery.java
0 → 100644
View file @
32a6175e
package
com
.
xxfc
.
platform
.
app
.
vo
;
import
lombok.Data
;
@Data
public
class
appVersionQuery
{
private
Integer
page
;
private
Integer
limit
;
/**
* 版本名称
*/
private
String
versionName
;
/**
* 版本号
*/
private
String
version
;
/**
* 更新内容
*/
private
String
content
;
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
app
.
biz
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.vo.appVersionQuery
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.RowBounds
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
...
...
@@ -81,6 +85,18 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
getVersionH5
(
Integer
type
){
Example
example
=
new
Example
(
AppVersion
.
class
);
example
.
createCriteria
().
andEqualTo
(
"isDel"
,
0
).
andEqualTo
(
"downloadSwitch"
,
0
).
andEqualTo
(
"sysType"
,
type
);
example
.
setOrderByClause
(
"version DESC"
);
List
<
AppVersion
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()>
0
){
AppVersion
appVersion
=
list
.
get
(
0
);
return
new
ObjectRestResponse
().
status
(
RestCode
.
SUCCESS
.
getStatus
()).
msg
(
RestCode
.
SUCCESS
.
getMsg
()).
data
(
appVersion
).
rel
(
false
);
}
return
ObjectRestResponse
.
succ
();
}
public
RestResponse
uploadDrivingLicense
(
MultipartFile
file
)
throws
IOException
{
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
File
.
separator
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
...
...
@@ -124,13 +140,10 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
appVersion
.
setDownloadSwitch
(
0
);
insertSelective
(
appVersion
);
}
public
AppVersion
get
(
Integer
id
)
{
if
(
id
==
null
)
{
throw
new
IllegalArgumentException
(
"Parameter is null"
);
}
return
selectById
(
id
);
}
...
...
@@ -138,7 +151,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
* 修改一条信息
* @param appVersion
*/
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateAppVersionById
(
AppVersion
appVersion
)
{
updateSelectiveById
(
appVersion
);
}
...
...
@@ -155,4 +168,11 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
.
build
();
mapper
.
updateByExampleSelective
(
appVersion
,
example
);
}
public
PageInfo
<
AppVersion
>
getAll
(
appVersionQuery
query
)
{
PageHelper
.
startPage
(
query
.
getPage
(),
query
.
getLimit
());
List
<
AppVersion
>
appVersionList
=
mapper
.
getAllByquery
(
query
);
return
PageInfo
.
of
(
appVersionList
);
}
}
\ No newline at end of file
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/AppVersionMapper.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
app
.
mapper
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.vo.appVersionQuery
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
*
*
...
...
@@ -11,5 +15,6 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-06-24 10:34:00
*/
public
interface
AppVersionMapper
extends
Mapper
<
AppVersion
>
{
List
<
AppVersion
>
getAllByquery
(
appVersionQuery
query
);
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppVersionController.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
app
.
rest
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.biz.AppVersionBiz
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.vo.appVersionQuery
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -43,15 +46,22 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@IgnoreUserToken
public
ObjectRestResponse
info
(
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"version"
,
defaultValue
=
""
)
String
version
@RequestParam
(
value
=
"version"
,
defaultValue
=
""
)
String
version
,
@RequestParam
(
value
=
"isH5"
,
defaultValue
=
"0"
)
Integer
isH5
){
return
baseBiz
.
getVersion
(
version
,
type
);
ObjectRestResponse
restResponse
=
null
;
if
(
isH5
!=
null
&&
isH5
==
1
){
restResponse
=
baseBiz
.
getVersionH5
(
type
);
}
else
{
restResponse
=
baseBiz
.
getVersion
(
version
,
type
);
}
return
restResponse
;
}
@Override
@ApiOperation
(
"添加"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
background/
add"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
AppVersion
>
add
(
@RequestBody
AppVersion
appVersion
){
baseBiz
.
insertAppVersion
(
appVersion
);
return
new
ObjectRestResponse
<
AppVersion
>();
...
...
@@ -59,21 +69,27 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@ApiOperation
(
"查询"
)
@RequestMapping
(
value
=
"/getAppVersion/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
background/
getAppVersion/{id}"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
AppVersion
>
getAppVersion
(
@PathVariable
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
get
(
id
));
}
@ApiOperation
(
"查询所有"
)
@RequestMapping
(
value
=
"/background/getAppVersions"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
PageInfo
<
AppVersion
>>
getAppVersions
(
@RequestBody
appVersionQuery
query
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getAll
(
query
));
}
@Override
@ApiOperation
(
"修改"
)
@RequestMapping
(
value
=
"/update/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/
background/
update/{id}"
,
method
=
RequestMethod
.
PUT
)
public
ObjectRestResponse
<
AppVersion
>
update
(
@RequestBody
AppVersion
appVersion
){
baseBiz
.
updateAppVersionById
(
appVersion
);
return
new
ObjectRestResponse
<
AppVersion
>();
}
@ApiOperation
(
"删除"
)
@DeleteMapping
(
value
=
"/remove/{id}"
)
@DeleteMapping
(
value
=
"/
background/
remove/{id}"
)
public
ObjectRestResponse
<
AppVersion
>
remove
(
@PathVariable
Integer
id
){
baseBiz
.
remove
(
id
);
return
new
ObjectRestResponse
<
AppVersion
>();
...
...
xx-app/xx-app-server/src/main/resources/mapper/AppVersionController.xml
0 → 100644
View file @
32a6175e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.app.mapper.AppVersionMapper"
>
<select
id=
"getAllByquery"
parameterType=
"com.xxfc.platform.app.vo.appVersionQuery"
resultType=
"com.xxfc.platform.app.entity.AppVersion"
>
select * from app_version
where 1=1
<if
test=
"versionName !=null and versionName != ''"
>
and version_name like concat('%',#{versionName},'%')
</if>
<if
test=
"version !=null and version != ''"
>
and version like concat('%',#{version},'%')
</if>
<if
test=
"content != null and content != ''"
>
and content like concat('%',#{content},'%')
</if>
</select>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
View file @
32a6175e
...
...
@@ -3,13 +3,13 @@ package com.xxfc.platform.im.biz;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.im.dto.MsgTypeEnum
;
import
com.xxfc.platform.im.dto.UpdateTypeEnum
;
import
com.xxfc.platform.im.entity.ImComment
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.mapper.ImCommentMapper
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -55,7 +55,7 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
jsonObject
.
put
(
"userId"
,
appUserDTO
.
getUserid
());
jsonObject
.
put
(
"channelId"
,
newValue
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"COMMENTPUBLISH"
);
mqSenderFeign
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQc
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitC
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
return
ObjectRestResponse
.
succ
();
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
View file @
32a6175e
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.im.biz;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
...
@@ -11,7 +12,6 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
import
com.xxfc.platform.im.dto.UpdateTypeEnum
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.mapper.ImQuestionMapper
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -70,7 +70,7 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
jsonObject
.
put
(
"userId"
,
appUserDTO
.
getUserid
());
jsonObject
.
put
(
"channelId"
,
newValue
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"PUBLISH"
);
mqSenderFeign
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQc
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitC
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
return
ObjectRestResponse
.
succ
();
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
32a6175e
...
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.im.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
...
...
@@ -18,6 +17,8 @@ import com.xxfc.platform.im.vo.MsgVo;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.types.ObjectId
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -52,11 +53,11 @@ public class MsgBiz {
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
,
type
);
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
Page
Helper
.
startPage
(
page
,
limit
);
Page
able
pageable
=
PageRequest
.
of
(--
page
,
limit
);
Query
query
=
null
;
List
<
Msg
>
msgList
=
null
;
if
(
type
!=
null
)
{
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
))
.
with
(
pageable
)
;
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
...
...
@@ -64,7 +65,7 @@ public class MsgBiz {
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
))
.
with
(
pageable
)
;
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
...
...
@@ -76,11 +77,11 @@ public class MsgBiz {
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
);
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
Page
Helper
.
startPage
(
page
,
limit
);
Page
able
pageable
=
PageRequest
.
of
(--
page
,
limit
);
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
))
.
with
(
pageable
)
;
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/mq/OrderMQDTO.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
order
.
pojo
.
mq
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderMemberDetail
;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.entity.OrderTourDetail
;
import
lombok.Data
;
@Data
public
class
OrderMQDTO
{
public
class
OrderMQDTO
extends
BaseOrder
{
public
static
final
Integer
ORDER_CRT
=
1
;
public
static
final
Integer
ORDER_CANCEL
=
2
;
public
static
final
Integer
ORDER_PAY
=
4
;
public
static
final
Integer
ORDER_FINISH
=
6
;
Integer
orderId
;
OrderRentVehicleDetail
orderRentVehicleDetail
;
OrderTourDetail
orderTourDetail
;
OrderMemberDetail
orderMemberDetail
;
/**
* 标记是什么操作
* 0--删除"
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
32a6175e
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
...
...
@@ -22,6 +24,7 @@ import com.xxfc.platform.order.pojo.order.OrderListVo;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
...
...
@@ -41,6 +44,7 @@ import java.util.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.*;
/**
*
...
...
@@ -83,6 +87,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
@Autowired
UserFeign
userFeign
;
@Autowired
MQSenderFeign
mqSenderFeign
;
@Autowired
OrderMsgBiz
orderMsgBiz
;
...
...
@@ -187,6 +194,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
*/
@Transactional
public
void
cancel
(
BaseOrder
baseOrder
)
{
OrderRentVehicleDetail
orvd
=
new
OrderRentVehicleDetail
();
OrderTourDetail
otd
=
new
OrderTourDetail
();
OrderMemberDetail
omd
=
new
OrderMemberDetail
();
if
(
cancelAble
.
get
(
baseOrder
.
getType
()).
contains
(
baseOrder
.
getStatus
()))
{
BaseOrder
updateOrder
=
new
BaseOrder
(){{
setId
(
baseOrder
.
getId
());
...
...
@@ -201,7 +211,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()))
{
//判断订单类型
if
(
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
...
...
@@ -228,7 +238,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
}
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderTourDetail
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
Long
timeLag
=
otd
.
getStartTime
()
-
System
.
currentTimeMillis
();
...
...
@@ -245,7 +255,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//处理取消流程
if
(
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
...
...
@@ -266,13 +276,21 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
}
}
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderTourDetail
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
//增加库存
tourFeign
.
stock
(
otd
.
getSpePriceId
(),
otd
.
getTotalNumber
(),
TourFeign
.
STOCK_PLUS
);
}
OrderMQDTO
orderMQDTO
=
new
OrderMQDTO
();
orderMQDTO
.
setOrderMemberDetail
(
omd
);
orderMQDTO
.
setOrderRentVehicleDetail
(
orvd
);
orderMQDTO
.
setOrderTourDetail
(
otd
);
//发送队列消息
sendQueue
(
orderMQDTO
,
OrderMQDTO
.
ORDER_CANCEL
);
}
else
{
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
}
...
...
@@ -413,6 +431,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
@Transactional
public
void
payNotifyHandle
(
String
orderNo
,
String
tradeNo
,
Integer
type
)
{
OrderRentVehicleDetail
orvd
=
new
OrderRentVehicleDetail
();
OrderTourDetail
otd
=
new
OrderTourDetail
();
OrderMemberDetail
omd
=
new
OrderMemberDetail
();
BaseOrder
baseOrder
=
this
.
selectOne
(
new
BaseOrder
()
{{
setNo
(
orderNo
);
...
...
@@ -462,7 +481,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
updateOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_TOSTART
.
getCode
());
OrderTourDetail
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
otd
=
orderTourDetailBiz
.
selectOne
(
new
OrderTourDetail
(){{
setOrderId
(
baseOrder
.
getId
());
}});
...
...
@@ -479,6 +498,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//处理后台用户提醒短信的发送
orderMsgBiz
.
handelBgUserMsg4Pay
(
orvd
,
baseOrder
,
appUserDTO
,
OrderMsgBiz
.
RENT_PAY
);
//发送队列消息
OrderMQDTO
orderMQDTO
=
BeanUtil
.
toBean
(
baseOrder
,
OrderMQDTO
.
class
);
orderMQDTO
.
setOrderRentVehicleDetail
(
orvd
);
orderMQDTO
.
setOrderTourDetail
(
otd
);
orderMQDTO
.
setOrderMemberDetail
(
omd
);
sendQueue
(
orderMQDTO
,
OrderMQDTO
.
ORDER_PAY
);
}
}
else
{
log
.
error
(
" order has payed , orderNo:{}, tradeNo:{} "
,
orderNo
,
tradeNo
);
...
...
@@ -512,13 +538,22 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
return
zero
;
}
private
void
sendQueue
(
Integer
orderId
,
Integer
sign
)
{
private
void
sendQueue
(
OrderMQDTO
orderMQDTO
,
Integer
sign
)
{
try
{
OrderMQDTO
orderMQDTO
=
new
OrderMQDTO
(){{
setOrderId
(
orderId
);
setSign
(
sign
);
}};
//mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_REGISTER_SUCCESS, JSONUtil.toJsonStr(orderMQDTO));
orderMQDTO
.
setSign
(
sign
);
switch
(
sign
)
{
case
2
:
mqSenderFeign
.
sendMessage
(
ORDER_TOPIC
,
KEY_ORDER_CANCEL
,
JSONUtil
.
toJsonStr
(
orderMQDTO
));
break
;
case
4
:
mqSenderFeign
.
sendMessage
(
ORDER_TOPIC
,
KEY_ORDER_PAY
,
JSONUtil
.
toJsonStr
(
orderMQDTO
));
break
;
case
6
:
mqSenderFeign
.
sendMessage
(
ORDER_TOPIC
,
KEY_ORDER_FINLISH
,
JSONUtil
.
toJsonStr
(
orderMQDTO
));
break
;
default
:
break
;
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/MQconstant.java
deleted
100644 → 0
View file @
6ee011a9
package
com
.
xxfc
.
platform
.
universal
.
constant
;
public
class
MQconstant
{
public
static
final
String
INTEGRAL_EXCHANGE
=
"integral_exchange"
;
public
static
final
String
INTEGRAL_ROUTING_KEY
=
"integral_routing_key"
;
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
32a6175e
...
...
@@ -11,13 +11,13 @@ import com.alipay.api.internal.util.AlipaySignature;
import
com.alipay.api.request.*
;
import
com.alipay.api.response.*
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.HTTPSUtils
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.OrderPay
;
import
com.xxfc.platform.universal.mapper.OrderPayMapper
;
...
...
@@ -64,6 +64,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
@Value
(
"${universal.url}"
)
String
weixinHost
;
String
notifyUrl
=
weixinHost
+
"/service/payment/notify/alipay"
;
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
log
.
error
(
"-----参数为空-----------"
);
...
...
@@ -157,8 +159,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
jsonObject
.
put
(
"integralRuleCode"
,
"BUYMEMBER"
);
}
log
.
info
(
"支付订单号:orderNo = {}, orderType = {}"
,
newValue
.
getOrderNo
(),
newValue
.
getChannel
());
log
.
info
(
"支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}"
,
MQconstant
.
INTEGRAL_EXCHANGE
,
MQc
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
mqServiceBiZ
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQc
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
log
.
info
(
"支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}"
,
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitC
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
mqServiceBiZ
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitC
onstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
if
(
StringUtils
.
isNotBlank
(
pay
.
getNotifyUrl
())){
String
url
=
pay
.
getNotifyUrl
();
...
...
@@ -260,7 +262,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
@SuppressWarnings
(
"rawtypes"
)
private
ObjectRestResponse
generateAliPayment
(
String
orderCode
,
String
description
,
String
payType
,
Integer
amount
)
{
BigDecimal
realAmount
=
new
BigDecimal
(
amount
.
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
String
notifyUrl
=
SystemConfig
.
weixinHost
+
"/service/payment/notify/alipay"
;
String
notifyUrl
=
weixinHost
+
"/service/payment/notify/alipay"
;
//实例化客户端
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
...
...
@@ -302,7 +304,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
//预授权冻结
public
ObjectRestResponse
fundAuthOrderAppFreeze
(
AlipayClient
alipayClient
)
throws
AlipayApiException
{
AlipayFundAuthOrderAppFreezeRequest
request
=
new
AlipayFundAuthOrderAppFreezeRequest
();
String
notifyUrl
=
SystemConfig
.
weixinHost
+
"/service/payment/notify/alipay"
;
AlipayFundAuthOrderAppFreezeModel
model
=
new
AlipayFundAuthOrderAppFreezeModel
();
model
.
setOrderTitle
(
"支付宝预授权"
);
model
.
setOutOrderNo
(
"2018077735255938023"
);
//替换为实际订单号
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/CertificationController.java
View file @
32a6175e
...
...
@@ -2,14 +2,19 @@ package com.xxfc.platform.universal.controller;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.universal.biz.MQServiceBiZ
;
import
com.xxfc.platform.universal.entity.IdInformation
;
import
com.xxfc.platform.universal.service.CertificationService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -35,6 +40,14 @@ public class CertificationController {
@Autowired
private
UserFeign
userFeign
;
@Qualifier
(
"applicationTaskExecutor"
)
@Autowired
private
TaskExecutor
executor
;
@Autowired
MQServiceBiZ
mqServiceBiZ
;
...
...
@@ -84,7 +97,16 @@ public class CertificationController {
log
.
info
(
"----type========="
+
type
);
try
{
if
(
type
!=
null
&&
type
==
0
){
return
certificationService
.
certificate
(
idInformation
);
ObjectRestResponse
<
Integer
>
result
=
certificationService
.
certificate
(
idInformation
);
if
(
result
.
getRel
())
{
executor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
setIntegral
(
appUserDTO
.
getUserid
(),
result
.
getData
());
}
});
}
return
result
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -94,5 +116,12 @@ public class CertificationController {
}
private
void
setIntegral
(
Integer
userid
,
Integer
iId
){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
userid
);
jsonObject
.
put
(
"integralRuleCode"
,
"CRETIFICATION"
);
jsonObject
.
put
(
"channelId"
,
iId
);
mqServiceBiZ
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
32a6175e
...
...
@@ -4,24 +4,26 @@ package com.xxfc.platform.universal.service;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.universal.biz.IdInformationBiz
;
import
com.xxfc.platform.universal.entity.IdInformation
;
import
com.xxfc.platform.universal.mapper.IdInformationMapper
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.Validation
;
import
javafx.application.Application
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.StatusLine
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.poi.ss.usermodel.DateUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -132,88 +134,13 @@ public class CertificationService {
@Autowired
private
UserFeign
userFeign
;
// //身份证号+姓名认证
//
// public ObjectRestResponse stringCertificate(IdInformation idInformation) {
// HashedMap hashMap = new HashedMap();
// // 认证状态:true是认证过
//
//
// Integer certificateType = idInformation.getCertificateType();
// if (certificateType == 0) {
//
// if (!Validation.isIdCard(idInformation.getIdNumber())) {
// return ObjectRestResponse.createFailedResult(ResultCode.WRONG_FORMAT_OF_ID_CARD, "身份证格式错误");
// }
// }
//
//
// if (idInformation == null) {
//
//
// return ObjectRestResponse.createFailedResult(ResultCode.INCOMPLETE_DATA, "未填写");
//
//
// }
//
// if (idInformation.getExpirationDate() == null) {
//
// return ObjectRestResponse.createFailedResult(ResultCode.INCOMPLETE_DATA, "请填写证件到期时间");
// }
//
//
// //判断是否有填写身份证号
// if (StringUtils.isBlank(idInformation.getIdNumber())) {
// return ObjectRestResponse.createFailedResult(ResultCode.INCOMPLETE_DATA, "请填写身份证号");
//
//
// }
//
// //判断是有否填写名字
// if (StringUtils.isBlank(idInformation.getName())) {
//
// return ObjectRestResponse.createFailedResult(ResultCode.INCOMPLETE_DATA, "请填写姓名");
//
// }
//
// //获取查询参数
// Map<String, String> querys = new HashMap<String, String>();
// querys.put(idCardName, idInformation.getIdNumber());
//
// querys.put(cName, idInformation.getName());
//
// //认证
// String result = certificate(querys);
// System.out.println(result);
//
// //判断返回的值是否为空
// if (!StringUtils.isBlank(result)) {
//
// Map<String, String> resultMap = (Map<String, String>) JSONObject.parse(result);
//
// if (resultMap != null) {
// //认证成功
// if (certifResultCode.equals(resultMap.get(certifRet))) {
// Boolean aBoolean = addIdInformation(idInformation);
// if (aBoolean) {
//
// return ObjectRestResponse.succ();
// }
//
//
// }
// }
// }
// return ObjectRestResponse.createDefaultFail();
//
//
// }
@Autowired
private
ApplicationContext
applicationContext
;
// 身份证图片进行实名认证
public
ObjectRestResponse
certificate
(
IdInformation
idInformation
)
{
public
ObjectRestResponse
<
Integer
>
certificate
(
IdInformation
idInformation
)
{
//1.判断
//携带返回参数的map
HashedMap
hashMap
=
new
HashedMap
();
...
...
@@ -367,11 +294,11 @@ public class CertificationService {
}
}
idInformation
.
setExpirationDate
(
expirationDate
);
Boolean
aBoolean
=
addIdInformation
(
idInformation
);
log
.
info
(
"----请求admin========="
+
aBoolean
);
if
(
aBoolean
)
{
return
ObjectRestResponse
.
succ
();
CertificationService
cs
=
applicationContext
.
getBean
(
this
.
getClass
());
ObjectRestResponse
objRR
=
cs
.
addIdInformation
(
idInformation
);
log
.
info
(
"----请求admin========="
+
objRR
);
if
(
objRR
.
getRel
()
)
{
return
ObjectRestResponse
.
succ
(
objRR
.
getData
()
);
}
}
...
...
@@ -468,25 +395,29 @@ public class CertificationService {
//认证通过保存到数据库当中
public
Boolean
addIdInformation
(
IdInformation
idInformation
)
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ObjectRestResponse
<
Integer
>
addIdInformation
(
IdInformation
idInformation
)
{
log
.
info
(
"----idInformation========="
+
idInformation
);
//保存认证信息
try
{
idInformationMapper
.
addIdInformation
(
idInformation
);
idInformationMapper
.
insertSelective
(
idInformation
);
//认证成功后修改用户,用户认证状态
ObjectRestResponse
authentication
=
userFeign
.
authentication
(
idInformation
.
getUserLonginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
return
ObjectRestResponse
.
succ
(
idInformation
.
getId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
TransactionAspectSupport
.
currentTransactionStatus
();
return
ObjectRestResponse
.
createDefaultFail
();
}
//认证成功后修改用户,用户认证状态
ObjectRestResponse
authentication
=
userFeign
.
authentication
(
idInformation
.
getUserLonginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
return
authentication
.
getRel
();
}
}
...
...
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