Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
customer-service
Commits
40bde7ad
Commit
40bde7ad
authored
Jul 09, 2020
by
xiaozhe.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
迁移谛听功能
parent
9801c77c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
160 additions
and
6 deletions
+160
-6
UserCardInfo.java
...n/java/cn/quantgroup/customer/model/pay/UserCardInfo.java
+11
-0
OperateRest.java
src/main/java/cn/quantgroup/customer/rest/OperateRest.java
+17
-0
UserRest.java
src/main/java/cn/quantgroup/customer/rest/UserRest.java
+37
-2
IXyqbService.java
...ain/java/cn/quantgroup/customer/service/IXyqbService.java
+18
-0
XyqbServiceImpl.java
.../cn/quantgroup/customer/service/impl/XyqbServiceImpl.java
+76
-4
SignUtil.java
src/main/java/cn/quantgroup/customer/util/SignUtil.java
+1
-0
No files found.
src/main/java/cn/quantgroup/customer/model/pay/UserCardInfo.java
0 → 100644
View file @
40bde7ad
package
cn
.
quantgroup
.
customer
.
model
.
pay
;
import
lombok.Data
;
@Data
public
class
UserCardInfo
{
private
String
cardNo
;
private
String
bankName
;
private
String
phoneNo
;
private
Long
id
;
}
src/main/java/cn/quantgroup/customer/rest/OperateRest.java
View file @
40bde7ad
...
@@ -4,10 +4,13 @@ import cn.quantgroup.customer.aop.OperateLog;
...
@@ -4,10 +4,13 @@ import cn.quantgroup.customer.aop.OperateLog;
import
cn.quantgroup.customer.rest.param.ordermapping.OperateEntryParam
;
import
cn.quantgroup.customer.rest.param.ordermapping.OperateEntryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IOrderService
;
import
cn.quantgroup.customer.service.IOrderService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
...
@@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
public
class
OperateRest
{
public
class
OperateRest
{
@Autowired
@Autowired
private
IOrderService
orderService
;
private
IOrderService
orderService
;
@Autowired
private
IXyqbService
xyqbService
;
/**
/**
* 添加或移除白名单
* 添加或移除白名单
...
@@ -36,4 +41,16 @@ public class OperateRest {
...
@@ -36,4 +41,16 @@ public class OperateRest {
log
.
info
(
"[结清白名单设置操作],请求参数:operateEntryParam={}"
,
operateEntryParam
);
log
.
info
(
"[结清白名单设置操作],请求参数:operateEntryParam={}"
,
operateEntryParam
);
return
orderService
.
setOrCancelSettleUpWhiteList
(
operateEntryParam
);
return
orderService
.
setOrCancelSettleUpWhiteList
(
operateEntryParam
);
}
}
@PostMapping
(
"/user/card/change_reserved_phone"
)
public
JsonResult
changeUserPayCardReservedPhone
(
@RequestParam
(
required
=
true
)
String
cardId
,
@RequestParam
(
required
=
true
)
String
phoneNo
){
Boolean
result
=
xyqbService
.
changePayCardReservedPhoneNo
(
cardId
,
phoneNo
);
if
(
BooleanUtils
.
isTrue
(
result
))
{
return
JsonResult
.
buildSuccessResult
(
"修改预留手机号成功"
,
result
);
}
else
{
return
JsonResult
.
buildErrorStateResult
(
"修改预留手机号失败"
,
result
);
}
}
}
}
src/main/java/cn/quantgroup/customer/rest/UserRest.java
View file @
40bde7ad
...
@@ -2,7 +2,9 @@ package cn.quantgroup.customer.rest;
...
@@ -2,7 +2,9 @@ package cn.quantgroup.customer.rest;
import
cn.quantgroup.customer.entity.User
;
import
cn.quantgroup.customer.entity.User
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.model.pay.UserCardInfo
;
import
cn.quantgroup.customer.model.user.AuthBean
;
import
cn.quantgroup.customer.model.user.AuthBean
;
import
cn.quantgroup.customer.model.xyqbuser.UserBasicInfo
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneApplyStatus
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneApplyStatus
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneAuditStatus
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneAuditStatus
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneProcessingStatus
;
import
cn.quantgroup.customer.rest.enums.phone.ModifyPhoneProcessingStatus
;
...
@@ -10,13 +12,14 @@ import cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit;
...
@@ -10,13 +12,14 @@ import cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery
;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.param.user.UserQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.MoResult
;
import
cn.quantgroup.customer.rest.vo.MoResult
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Required
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -24,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -24,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.security.Principal
;
import
java.security.Principal
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
...
@@ -33,11 +37,13 @@ import static cn.quantgroup.customer.constant.Constant.GSON;
...
@@ -33,11 +37,13 @@ import static cn.quantgroup.customer.constant.Constant.GSON;
public
class
UserRest
{
public
class
UserRest
{
private
final
IUserService
userService
;
private
final
IUserService
userService
;
private
final
IXyqbService
xyqbService
;
@Autowired
@Autowired
public
UserRest
(
IUserService
userService
)
{
public
UserRest
(
IUserService
userService
,
IXyqbService
xyqbService
)
{
this
.
userService
=
userService
;
this
.
userService
=
userService
;
this
.
xyqbService
=
xyqbService
;
}
}
@PostMapping
(
value
=
"/login"
)
@PostMapping
(
value
=
"/login"
)
...
@@ -190,4 +196,33 @@ public class UserRest {
...
@@ -190,4 +196,33 @@ public class UserRest {
}
}
/**
* 查询用户详细信息(根据手机号或身份证号查询)
* @param userQueryParam
* @return
*/
@PostMapping
(
value
=
"/detail"
)
public
JsonResult
findUserDetail
(
UserQueryParam
userQueryParam
)
{
JsonResult
<
UserBasicInfo
>
userInfo
=
userService
.
findUserInfo
(
userQueryParam
);
if
(!
userInfo
.
isSuccess
())
{
return
JsonResult
.
buildErrorStateResult
(
userInfo
.
getMsg
(),
userInfo
.
getData
());
}
return
userInfo
;
}
/**
* 查询用户绑卡信息
*
* @param userId
* @return
*/
@PostMapping
(
value
=
"/card_list"
)
public
JsonResult
findUserCardList
(
@RequestParam
(
required
=
true
)
Long
userId
)
{
List
<
UserCardInfo
>
userPayCardList
=
xyqbService
.
findUserPayCardList
(
userId
);
return
JsonResult
.
buildSuccessResult
(
"success"
,
userPayCardList
);
}
}
}
src/main/java/cn/quantgroup/customer/service/IXyqbService.java
View file @
40bde7ad
package
cn
.
quantgroup
.
customer
.
service
;
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.model.order.*
;
import
cn.quantgroup.customer.model.order.*
;
import
cn.quantgroup.customer.model.pay.UserCardInfo
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
...
@@ -89,4 +90,21 @@ public interface IXyqbService {
...
@@ -89,4 +90,21 @@ public interface IXyqbService {
* @return
* @return
*/
*/
JsonResult
<
EarlySettleUpTrial
>
earlySettleUpTrial
(
Long
loanId
);
JsonResult
<
EarlySettleUpTrial
>
earlySettleUpTrial
(
Long
loanId
);
/**
* 查询用户在支付中心绑卡信息
* @param userId
* @return
*/
List
<
UserCardInfo
>
findUserPayCardList
(
Long
userId
);
/**
* 修改用户支付中心卡预留手机号
* @param cardId
* @param phoneNo
* @return
*/
Boolean
changePayCardReservedPhoneNo
(
String
cardId
,
String
phoneNo
);
}
}
src/main/java/cn/quantgroup/customer/service/impl/XyqbServiceImpl.java
View file @
40bde7ad
...
@@ -2,6 +2,7 @@ package cn.quantgroup.customer.service.impl;
...
@@ -2,6 +2,7 @@ package cn.quantgroup.customer.service.impl;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.model.order.*
;
import
cn.quantgroup.customer.model.order.*
;
import
cn.quantgroup.customer.model.pay.UserCardInfo
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
...
@@ -15,7 +16,10 @@ import cn.quantgroup.customer.service.IXyqbService;
...
@@ -15,7 +16,10 @@ import cn.quantgroup.customer.service.IXyqbService;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.util.JSONTools
;
import
cn.quantgroup.customer.util.JSONTools
;
import
cn.quantgroup.customer.util.SignUtil
;
import
cn.quantgroup.customer.util.SignUtil
;
import
cn.quantgroup.user.retbean.XUser
;
import
cn.quantgroup.user.vo.UserSysResult
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -23,29 +27,34 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
...
@@ -23,29 +27,34 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.google.common.reflect.TypeToken
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
@Slf4j
@Slf4j
@Service
(
"xyqbService"
)
@Service
(
"xyqbService"
)
public
class
XyqbServiceImpl
implements
IXyqbService
{
public
class
XyqbServiceImpl
implements
IXyqbService
{
@Value
(
"${api.http}"
)
@Value
(
"${api.http}"
)
private
String
xyqbSysUrl
;
private
String
xyqbSysUrl
;
@Value
(
"${fund.pay.api-host}"
)
@Value
(
"${fund.pay.api-host}"
)
private
String
clothoSysUrl
;
private
String
clothoSysUrl
;
@Value
(
"${payapi.http}"
)
private
String
payapi
;
private
final
IHttpService
httpService
;
private
final
IHttpService
httpService
;
private
final
UserSdkImpl
userSdk
;
@Autowired
@Autowired
public
XyqbServiceImpl
(
IHttpService
httpService
)
{
public
XyqbServiceImpl
(
IHttpService
httpService
,
UserSdkImpl
userSdk
)
{
this
.
httpService
=
httpService
;
this
.
httpService
=
httpService
;
this
.
userSdk
=
userSdk
;
}
}
@Override
@Override
...
@@ -488,4 +497,67 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -488,4 +497,67 @@ public class XyqbServiceImpl implements IXyqbService {
}
}
}
}
}
}
/**
* 查询用户在支付中心绑卡信息
*
* @param userId
* @return
*/
@Override
public
List
<
UserCardInfo
>
findUserPayCardList
(
Long
userId
)
{
List
<
UserCardInfo
>
userCardInfoList
=
Lists
.
newArrayList
();
UserSysResult
<
XUser
>
userByUser
=
userSdk
.
getService
().
findUserByUserId
(
userId
);
if
(
userByUser
==
null
)
{
log
.
error
(
"查询用户信息失败,user为空.userId:{}"
,
userId
);
return
userCardInfoList
;
}
String
uuid
=
userByUser
.
getData
().
getUuid
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"uuid"
,
uuid
);
Map
<
String
,
String
>
kefu
=
(
Map
<
String
,
String
>)
SignUtil
.
sign
(
"kefu"
,
map
);
log
.
info
(
"向支付中心获取卡列表,req:{}"
,
map
);
String
result
=
httpService
.
get
(
payapi
.
concat
(
"/ex/common/kefu/card/list"
),
kefu
);
log
.
info
(
"向支付中心获取卡列表,result:{}"
,
result
);
JsonResult
cardListResult
=
GSON
.
fromJson
(
result
,
new
TypeToken
<
JsonResult
>()
{}.
getType
());
if
(
cardListResult
==
null
||
!
cardListResult
.
isSuccess
())
{
log
.
error
(
"查询用户支付中心卡信息失败,userId:{}"
,
userId
);
return
userCardInfoList
;
}
if
(
cardListResult
.
getData
()
!=
null
&&
((
List
)
cardListResult
.
getData
()).
size
()
>
0
)
{
userCardInfoList
=
GSON
.
fromJson
(
GSON
.
toJson
(
cardListResult
.
getData
()),
new
TypeToken
<
List
<
UserCardInfo
>>()
{
}.
getType
());
}
return
userCardInfoList
;
}
/**
* 修改用户支付中心卡预留手机号
* @param cardId
* @param phoneNo
* @return
*/
@Override
public
Boolean
changePayCardReservedPhoneNo
(
String
cardId
,
String
phoneNo
)
{
if
(
cardId
==
null
||
StringUtils
.
isEmpty
(
phoneNo
))
{
log
.
error
(
"修改预留手机号失败,cardId或phoneNo为空"
);
return
false
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"cardId"
,
cardId
);
map
.
put
(
"phoneNo"
,
phoneNo
);
Map
<
String
,
String
>
kefu
=
(
Map
<
String
,
String
>)
SignUtil
.
sign
(
"kefu"
,
map
);
log
.
info
(
"向支付中心修改预留手机号,req:{}"
,
map
);
String
result
=
httpService
.
get
(
payapi
.
concat
(
"/ex/common/kefu/card/change/phone_no"
),
kefu
);
log
.
info
(
"向支付中心修改预留手机号,result:{}"
,
result
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
new
TypeToken
<
JsonResult
>()
{}.
getType
());
if
(
jsonResult
==
null
||
!
jsonResult
.
isSuccess
())
{
log
.
error
(
"修改预留手机号失败,支付中心修改预留手机号 cardId:{},phoneNo:{}"
,
cardId
,
phoneNo
);
return
false
;
}
return
true
;
}
}
}
src/main/java/cn/quantgroup/customer/util/SignUtil.java
View file @
40bde7ad
...
@@ -23,6 +23,7 @@ public class SignUtil {
...
@@ -23,6 +23,7 @@ public class SignUtil {
apiKeys
.
put
(
KA_API_KEY
,
"aukpaqy3za9lkjisdfaoqtdtxumrjqzm"
);
apiKeys
.
put
(
KA_API_KEY
,
"aukpaqy3za9lkjisdfaoqtdtxumrjqzm"
);
apiKeys
.
put
(
"xyqb"
,
"cd6yFfEgI0t67JaOYtLxTqXvumfJbsZi"
);
apiKeys
.
put
(
"xyqb"
,
"cd6yFfEgI0t67JaOYtLxTqXvumfJbsZi"
);
apiKeys
.
put
(
"kefu"
,
"iy4tv3sc6y7jaj8pxipsjb05afew6sgy"
);
}
}
public
static
void
addKeys
(
String
appid
,
String
key
)
{
public
static
void
addKeys
(
String
appid
,
String
key
)
{
...
...
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