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
a3e60298
Commit
a3e60298
authored
Mar 24, 2020
by
杨钧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review修改代码
parent
580d3277
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
36 deletions
+23
-36
KaServiceImpl.java
...va/cn/quantgroup/customer/service/impl/KaServiceImpl.java
+1
-1
OrderServiceImpl.java
...cn/quantgroup/customer/service/impl/OrderServiceImpl.java
+22
-35
No files found.
src/main/java/cn/quantgroup/customer/service/impl/KaServiceImpl.java
View file @
a3e60298
...
@@ -180,7 +180,7 @@ public class KaServiceImpl implements IKaService {
...
@@ -180,7 +180,7 @@ public class KaServiceImpl implements IKaService {
param
.
put
(
"isSucc"
,
isSucc
);
param
.
put
(
"isSucc"
,
isSucc
);
String
result
=
null
;
String
result
;
try
{
try
{
result
=
httpService
.
get
(
url
,
param
);
result
=
httpService
.
get
(
url
,
param
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/cn/quantgroup/customer/service/impl/OrderServiceImpl.java
View file @
a3e60298
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.enums.OrderStatusEnums
;
import
cn.quantgroup.customer.model.Tuple
;
import
cn.quantgroup.customer.model.Tuple
;
import
cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory
;
import
cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
...
@@ -13,7 +12,6 @@ import cn.quantgroup.customer.service.IOrderService;
...
@@ -13,7 +12,6 @@ import cn.quantgroup.customer.service.IOrderService;
import
cn.quantgroup.customer.service.IXyqbService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
cn.quantgroup.customer.util.DateUtil
;
import
cn.quantgroup.customer.util.DateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -116,20 +114,20 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -116,20 +114,20 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
LoanOrderMapping
>
orderMappingResult
=
kaService
.
findOrderMapping
(
orderQuery
);
JsonResult
<
LoanOrderMapping
>
orderMappingResult
=
kaService
.
findOrderMapping
(
orderQuery
);
LoanOrderMapping
loanOrderMapping
;
LoanOrderMapping
loanOrderMapping
;
if
(!
orderMappingResult
.
isSuccess
())
{
if
(!
orderMappingResult
.
isSuccess
())
{
log
.
error
(
"{} 查询订单信息orderMapping失败 result={} orderQuery={}"
,
logPre
,
orderMappingResult
,
orderQuery
);
log
.
warn
(
"{} 查询订单信息orderMapping失败 result={} orderQuery={}"
,
logPre
,
orderMappingResult
,
orderQuery
);
return
JsonResult
.
buildErrorStateResult
(
ErrorCodeEnum
.
RETURN_ERROR
.
getMessage
(),
ErrorCodeEnum
.
RETURN_ERROR
.
getCode
());
return
JsonResult
.
buildErrorStateResult
(
orderMappingResult
.
getMsg
(),
ErrorCodeEnum
.
RETURN_ERROR
.
getCode
());
}
}
loanOrderMapping
=
orderMappingResult
.
getData
();
loanOrderMapping
=
orderMappingResult
.
getData
();
// 可能是进件失败,此时需要根据渠道订单号和渠道号查询进件request表
if
(
Objects
.
nonNull
(
loanOrderMapping
))
{
if
(
Objects
.
nonNull
(
loanOrderMapping
))
{
return
buildHasOrderMapping
(
orderQuery
,
loanOrderMapping
);
return
buildHasOrderMapping
(
orderQuery
,
loanOrderMapping
);
}
else
{
}
else
{
if
(
Objects
.
isNull
(
orderQuery
.
getChannelId
())
||
StringUtils
.
isBlank
(
orderQuery
.
getChannelOrderNo
()))
{
// 可能两种结果 1)进件失败 此时需要根据渠道订单号和渠道号查询进件流水 2)不存在该订单
log
.
error
(
"{} orderMapping为空,且渠道号和渠道订单号为空 result={} orderQuery={}"
,
logPre
,
orderMappingResult
,
orderQuery
);
if
(
StringUtils
.
isNotBlank
(
orderQuery
.
getChannelOrderNo
())
&&
Objects
.
nonNull
(
orderQuery
.
getChannelId
()))
{
return
JsonResult
.
buildErrorStateResult
(
ErrorCodeEnum
.
PARAM_ERROR
.
getMessage
(),
ErrorCodeEnum
.
PARAM_ERROR
.
getCode
());
}
else
{
return
buildNoOrderMapping
(
orderQuery
.
getChannelOrderNo
(),
orderQuery
.
getChannelId
());
return
buildNoOrderMapping
(
orderQuery
.
getChannelOrderNo
(),
orderQuery
.
getChannelId
());
}
else
{
// 不存在订单信息
return
JsonResult
.
buildSuccessResult
(
"订单不存在"
,
null
);
}
}
}
}
}
}
...
@@ -143,12 +141,17 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -143,12 +141,17 @@ public class OrderServiceImpl implements IOrderService {
*/
*/
private
JsonResult
buildNoOrderMapping
(
String
channelOrderNo
,
Long
channelId
)
{
private
JsonResult
buildNoOrderMapping
(
String
channelOrderNo
,
Long
channelId
)
{
String
logPre
=
"OrderServiceImpl.buildNoOrderMapping"
;
String
logPre
=
"OrderServiceImpl.buildNoOrderMapping"
;
// 查询
订单
信息 查询ka
// 查询
进件流水
信息 查询ka
JsonResult
<
ApplyRequestHistory
>
orderMappingResult
=
kaService
.
queryLatestChannelRequestFlows
(
channelOrderNo
,
channelId
);
JsonResult
<
ApplyRequestHistory
>
orderMappingResult
=
kaService
.
queryLatestChannelRequestFlows
(
channelOrderNo
,
channelId
);
ApplyRequestHistory
applyRequestHistory
;
if
(!
orderMappingResult
.
isSuccess
())
{
if
(!
orderMappingResult
.
isSuccess
()
||
Objects
.
isNull
(
applyRequestHistory
=
orderMappingResult
.
getData
()))
{
log
.
error
(
"{} 查询渠道进件流水信息异常 result={} channelOrderNo={},channelId={}"
,
logPre
,
orderMappingResult
,
channelOrderNo
,
channelId
);
log
.
error
(
"{} 最新渠道进件请求流水失败,不存在进件流水信息 result={} channelOrderNo={},channelId={}"
,
logPre
,
orderMappingResult
,
channelOrderNo
,
channelId
);
return
JsonResult
.
buildErrorStateResult
(
"查询渠道进件流水信息异常"
,
ErrorCodeEnum
.
RETURN_ERROR
.
getCode
());
return
JsonResult
.
buildErrorStateResult
(
"不存在进件流水信息"
,
ErrorCodeEnum
.
RETURN_ERROR
.
getCode
());
}
ApplyRequestHistory
applyRequestHistory
=
orderMappingResult
.
getData
();
// 不存在进件流水信息 返回查询不到该笔订单
if
(
Objects
.
isNull
(
applyRequestHistory
))
{
return
JsonResult
.
buildSuccessResult
(
"订单不存在"
,
null
);
}
}
// 存在进件流水,进件失败
// 存在进件流水,进件失败
...
@@ -220,33 +223,17 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -220,33 +223,17 @@ public class OrderServiceImpl implements IOrderService {
private
Tuple
<
Boolean
,
String
>
validate
(
OrderQueryParam
orderQuery
)
{
private
Tuple
<
Boolean
,
String
>
validate
(
OrderQueryParam
orderQuery
)
{
Tuple
<
Boolean
,
String
>
result
=
new
Tuple
<>();
Tuple
<
Boolean
,
String
>
result
=
new
Tuple
<>();
result
.
setKey
(
false
);
result
.
setKey
(
false
);
int
orderParam
=
0
;
if
(
Objects
.
isNull
(
orderQuery
))
{
if
(
Objects
.
isNull
(
orderQuery
))
{
result
.
setValue
(
"请求参数为空"
);
result
.
setValue
(
"请求参数为空"
);
return
result
;
return
result
;
}
}
if
(
StringUtils
.
isNotBlank
(
orderQuery
.
getChannelOrderNo
()))
{
if
(
Objects
.
isNull
(
orderQuery
.
getChannelId
()))
{
result
.
setValue
(
"查询参数渠道订单号和渠道号要同时存在"
);
return
result
;
}
orderParam
++;
}
if
(
StringUtils
.
isNotBlank
(
orderQuery
.
getApplyOrderNo
()))
{
orderParam
++;
}
if
(
Objects
.
nonNull
(
orderQuery
.
getLoanId
()))
{
if
(
StringUtils
.
isBlank
(
orderQuery
.
getApplyOrderNo
())
orderParam
++;
&&
StringUtils
.
isBlank
(
orderQuery
.
getApplyOrderNo
())
}
&&
Objects
.
isNull
(
orderQuery
.
getLoanId
())
&&
Objects
.
isNull
(
orderQuery
.
getChannelId
()))
{
if
(
orderParam
==
0
)
{
result
.
setValue
(
"请求参数为空"
);
result
.
setValue
(
"请求参数为空"
);
return
result
;
return
result
;
}
else
if
(
orderParam
>
1
)
{
result
.
setValue
(
"只能使用渠道号和渠道订单号组合查询"
);
return
result
;
}
}
result
.
setKey
(
true
);
result
.
setKey
(
true
);
...
@@ -274,7 +261,7 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -274,7 +261,7 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
List
<
CallbackRecord
>>
sendFailRecordResult
=
kaService
.
querySendRecords
(
applyNo
,
channelId
,
Boolean
.
FALSE
);
JsonResult
<
List
<
CallbackRecord
>>
sendFailRecordResult
=
kaService
.
querySendRecords
(
applyNo
,
channelId
,
Boolean
.
FALSE
);
if
(!
sendFailRecordResult
.
isSuccess
())
{
if
(!
sendFailRecordResult
.
isSuccess
())
{
log
.
error
(
"{} 查询发送失败记录失败 orderQuery :{},sendFailRecordResult:{}"
,
logPre
,
orderQuery
,
sendFailRecordResult
);
log
.
error
(
"{} 查询发送失败记录失败 orderQuery :{},sendFailRecordResult:{}"
,
logPre
,
orderQuery
,
sendFailRecordResult
);
return
send
Succ
RecordResult
;
return
send
Fail
RecordResult
;
}
}
//聚合信息
//聚合信息
List
<
CallbackRecord
>
callbackRecords
=
doMergeLists
(
sendSuccRecordResult
.
getData
(),
sendFailRecordResult
.
getData
());
List
<
CallbackRecord
>
callbackRecords
=
doMergeLists
(
sendSuccRecordResult
.
getData
(),
sendFailRecordResult
.
getData
());
...
...
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