Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
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
胡慧
cash-loan-flow-boss
Commits
3a471b8f
Commit
3a471b8f
authored
Aug 12, 2019
by
王俊权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
贷前关单
parent
ef7b8145
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
OrderController.java
...ashloanflowboss/api/order/controller/OrderController.java
+5
-0
OrderService.java
...roup/cashloanflowboss/api/order/service/OrderService.java
+32
-0
JolyneCenter.java
.../quantgroup/cashloanflowboss/spi/jolyne/JolyneCenter.java
+24
-0
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/order/controller/OrderController.java
View file @
3a471b8f
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
order
.
controller
;
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
order
.
controller
;
import
cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo
;
import
cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo
;
import
cn.quantgroup.cashloanflowboss.api.order.model.OrderVo
;
import
cn.quantgroup.cashloanflowboss.api.order.service.OrderService
;
import
cn.quantgroup.cashloanflowboss.api.order.service.OrderService
;
import
cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit
;
import
cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit
;
import
cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole
;
import
cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole
;
...
@@ -37,4 +38,8 @@ public class OrderController {
...
@@ -37,4 +38,8 @@ public class OrderController {
return
Result
.
buildSuccess
(
orderService
.
approveOpt
(
approveVo
));
return
Result
.
buildSuccess
(
orderService
.
approveOpt
(
approveVo
));
}
}
@PostMapping
(
value
=
"/cancel/loan"
,
consumes
=
"application/json"
)
public
Result
cancel
(
@RequestBody
@Valid
OrderVo
orderVo
)
{
return
Result
.
buildSuccess
(
orderService
.
cancel
(
orderVo
));
}
}
}
src/main/java/cn/quantgroup/cashloanflowboss/api/order/service/OrderService.java
View file @
3a471b8f
...
@@ -9,9 +9,13 @@ import cn.quantgroup.cashloanflowboss.core.Application;
...
@@ -9,9 +9,13 @@ import cn.quantgroup.cashloanflowboss.core.Application;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping
;
import
cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository
;
import
cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository
;
import
cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenter
;
import
cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenter
;
import
cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneCenter
;
import
cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService
;
import
cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService
;
import
cn.quantgroup.cashloanflowboss.utils.JSONTools
;
import
cn.quantgroup.cashloanflowboss.utils.JSONTools
;
import
cn.quantgroup.user.retbean.XUser
;
import
cn.quantgroup.user.retbean.XUser
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
java.util.concurrent.ConcurrentMap
;
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
;
...
@@ -41,6 +45,8 @@ public class OrderService {
...
@@ -41,6 +45,8 @@ public class OrderService {
private
XyqbUserService
xyqbUserService
;
private
XyqbUserService
xyqbUserService
;
@Autowired
@Autowired
private
ClothoCenter
clothoCenter
;
private
ClothoCenter
clothoCenter
;
@Autowired
private
JolyneCenter
jolyneCenter
;
...
@@ -150,4 +156,30 @@ public class OrderService {
...
@@ -150,4 +156,30 @@ public class OrderService {
return
false
;
return
false
;
}
}
}
}
public
boolean
cancel
(
OrderVo
orderVo
){
ClfOrderMapping
orderMapping
=
clfOrderMappingRepository
.
findByChannelOrderNoLastOne
(
orderVo
.
getChannelOrderNumber
());
if
(
orderMapping
==
null
)
{
log
.
info
(
"cancel,关单失败,无订单 channelOrderNumber={}"
,
orderVo
.
getChannelOrderNumber
());
return
false
;
}
XUser
xUser
=
xyqbUserService
.
findXUserById
(
orderMapping
.
getQgUserId
());
if
(
xUser
==
null
)
{
log
.
info
(
"cancel,关单失败,未找到用户 channelOrderNumber={}"
,
orderVo
.
getChannelOrderNumber
());
return
false
;
}
Long
userId
=
xUser
.
getId
();
ConcurrentMap
<
Object
,
Object
>
data
=
Maps
.
newConcurrentMap
();
ArrayList
<
Object
>
cancel_list
=
Lists
.
newArrayList
();
cancel_list
.
add
(
"update xyqb.quota_credit set is_active=0 where user_id="
+
userId
);
cancel_list
.
add
(
"update xyqb.quota_account set is_active=0 where user_id="
+
userId
);
cancel_list
.
add
(
"update xyqb.loan_application_history set progress=16 where user_id="
+
userId
);
cancel_list
.
add
(
"update xyqb.loan_application_history set is_active=0 where user_id="
+
userId
);
cancel_list
.
add
(
"delete from apply_quota_record where user_id="
+
userId
);
cancel_list
.
add
(
"delete from user_operation_history where user_id="
+
userId
);
data
.
put
(
"sql"
,
cancel_list
);
String
cancel_result
=
jolyneCenter
.
cancel
(
JSONTools
.
serialize
(
data
));
return
"success"
.
equals
(
cancel_result
);
}
}
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/jolyne/JolyneCenter.java
0 → 100644
View file @
3a471b8f
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
jolyne
;
import
cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenter
;
import
java.util.Map
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Component
@FeignClient
(
name
=
"JolyneServiceCenter"
,
url
=
"http://192.168.4.156:9001/executeSQL/{{NAMESPACE}}"
,
fallback
=
JolyneCenter
.
Fallback
.
class
)
public
interface
JolyneCenter
{
@PostMapping
(
value
=
"/xyqb"
,
consumes
=
"application/json"
)
String
cancel
(
@RequestParam
(
"json"
)
String
cancelData
);
@Component
class
Fallback
implements
JolyneCenter
{
@Override
public
String
cancel
(
String
cancelData
)
{
return
null
;
}
}
}
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