Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
windows
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
zhanhai
windows
Commits
41d6dfac
Commit
41d6dfac
authored
Oct 24, 2023
by
张庆
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a0582644
e4a01a01
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
3 deletions
+108
-3
RiskQueryDataCommand.java
...n/java/com/jqtx/windows/command/RiskQueryDataCommand.java
+8
-1
SignContractCommand.java
...in/java/com/jqtx/windows/command/SignContractCommand.java
+2
-0
CreditComponent.java
...main/java/com/jqtx/windows/component/CreditComponent.java
+5
-1
CreditComponentImpl.java
.../com/jqtx/windows/component/impl/CreditComponentImpl.java
+23
-1
LoanComponentImpl.java
...va/com/jqtx/windows/component/impl/LoanComponentImpl.java
+1
-0
ProtocolJob.java
src/main/java/com/jqtx/windows/job/ProtocolJob.java
+66
-0
RouterConfig.java
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
+3
-0
No files found.
src/main/java/com/jqtx/windows/command/RiskQueryDataCommand.java
View file @
41d6dfac
...
...
@@ -24,9 +24,16 @@ public class RiskQueryDataCommand extends AbstractCommand {
public
JsonResult
execute
()
{
String
request
=
RuntimeContextHolder
.
currentRuntimeContext
().
getRequestBody
();
RiskCreditRequest
riskCreditRequest
=
JSON
.
parseObject
(
request
,
RiskCreditRequest
.
class
);
CreditModel
creditModel
=
creditComponent
.
getByOrderNo
(
riskCreditRequest
.
getOrderNo
());
CreditModel
creditModel
=
null
;
if
(
riskCreditRequest
.
getOrderNo
()==
null
){
creditModel
=
creditComponent
.
getByCertNo
(
riskCreditRequest
.
getCertNo
());
}
else
{
creditModel
=
creditComponent
.
getByOrderNo
(
riskCreditRequest
.
getOrderNo
());
}
String
data
=
ossUtils
.
getStringObject
(
creditModel
.
getCreditThirdUrl
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
data
);
return
JsonResult
.
success
(
jsonObject
.
getJSONObject
(
riskCreditRequest
.
getApiCode
()));
}
}
src/main/java/com/jqtx/windows/command/SignContractCommand.java
View file @
41d6dfac
...
...
@@ -31,6 +31,8 @@ public class SignContractCommand extends AbstractCommand {
signContractRequest
.
setCertNo
(
creditModel
.
getCertNo
());
signContractRequest
.
setClientCell
(
creditModel
.
getClientCell
());
log
.
info
(
"融单协议提交-{}"
,
JSONObject
.
toJSON
(
signContractRequest
));
creditModel
.
setCreditThirdToken
(
"INIT"
);
creditComponent
.
updateByOrderNo
(
creditModel
.
getOrderNo
(),
creditModel
);
iProtocalFeignService
.
uploadRongdan
(
signContractRequest
);
return
JsonResult
.
success
();
}
...
...
src/main/java/com/jqtx/windows/component/CreditComponent.java
View file @
41d6dfac
...
...
@@ -12,5 +12,9 @@ public interface CreditComponent {
void
updateByOrderNo
(
String
orderNo
,
CreditModel
model
);
List
<
CreditModel
>
getListModelByCreditThirdStatus
(
String
init
);
List
<
CreditModel
>
getListModelByCreditThirdStatus
(
String
token
);
List
<
CreditModel
>
getListModelByCreditThirdToken
(
String
token
);
CreditModel
getByCertNo
(
String
certNo
);
}
src/main/java/com/jqtx/windows/component/impl/CreditComponentImpl.java
View file @
41d6dfac
...
...
@@ -30,7 +30,7 @@ public class CreditComponentImpl implements CreditComponent {
example
.
setOrderByClause
(
"id desc"
);
List
<
WindowsCredit
>
list
=
windowsCreditMapper
.
selectByExample
(
example
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
return
list
.
stream
().
map
(
e
->
CglibUtil
.
copy
(
e
,
CreditModel
.
class
)).
findFirst
().
get
(
);
return
list
.
stream
().
map
(
e
->
CglibUtil
.
copy
(
e
,
CreditModel
.
class
)).
findFirst
().
orElse
(
null
);
}
return
null
;
}
...
...
@@ -63,4 +63,26 @@ public class CreditComponentImpl implements CreditComponent {
return
list
.
stream
().
map
(
e
->
CglibUtil
.
copy
(
e
,
CreditModel
.
class
)).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
CreditModel
>
getListModelByCreditThirdToken
(
String
token
)
{
WindowsCreditExample
example
=
new
WindowsCreditExample
();
WindowsCreditExample
.
Criteria
c
=
example
.
createCriteria
();
c
.
andCreditThirdTokenEqualTo
(
token
);
example
.
setOrderByClause
(
"id desc"
);
List
<
WindowsCredit
>
list
=
windowsCreditMapper
.
selectByExample
(
example
);
return
list
.
stream
().
map
(
e
->
CglibUtil
.
copy
(
e
,
CreditModel
.
class
)).
collect
(
Collectors
.
toList
());
}
@Override
public
CreditModel
getByCertNo
(
String
certNo
)
{
WindowsCreditExample
example
=
new
WindowsCreditExample
();
WindowsCreditExample
.
Criteria
c
=
example
.
createCriteria
();
c
.
andCertNoEqualTo
(
certNo
);
example
.
setOrderByClause
(
"id desc"
);
List
<
WindowsCredit
>
list
=
windowsCreditMapper
.
selectByExample
(
example
);
return
list
.
stream
().
map
(
e
->
CglibUtil
.
copy
(
e
,
CreditModel
.
class
)).
findFirst
().
orElse
(
null
);
}
}
src/main/java/com/jqtx/windows/component/impl/LoanComponentImpl.java
View file @
41d6dfac
...
...
@@ -59,6 +59,7 @@ public class LoanComponentImpl implements LoanComponent {
criteria
.
andOrderNoEqualTo
(
orderNo
);
criteria
.
andLoanCreditResultEqualTo
(
"INIT"
);
example
.
setOrderByClause
(
"id desc"
);
List
<
WindowsLoan
>
windowsLoans
=
windowsLoanMapper
.
selectByExample
(
example
);
return
windowsLoans
.
stream
().
map
(
m
->
BeanUtil
.
toBean
(
m
,
LoanModel
.
class
)).
findFirst
().
orElse
(
null
);
}
...
...
src/main/java/com/jqtx/windows/job/ProtocolJob.java
0 → 100644
View file @
41d6dfac
package
com
.
jqtx
.
windows
.
job
;
import
cn.hutool.core.util.IdUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jqtx.infrastructure.oss.starter.config.OssUtils
;
import
com.jqtx.windows.component.CreditComponent
;
import
com.jqtx.windows.component.LoanComponent
;
import
com.jqtx.windows.component.enums.ZNPostUrlEnum
;
import
com.jqtx.windows.component.model.CreditModel
;
import
com.jqtx.windows.component.model.LoanModel
;
import
com.jqtx.windows.component.model.ZyJsonResult
;
import
com.jqtx.windows.infrastructure.feign.IProtocalFeignService
;
import
com.jqtx.windows.utils.AbcHttpClient
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
@Component
@Slf4j
public
class
ProtocolJob
{
@Autowired
private
CreditComponent
creditComponent
;
@Autowired
private
AbcHttpClient
abcHttpClient
;
@Autowired
private
IProtocalFeignService
iProtocalFeignService
;
@Autowired
private
LoanComponent
loanComponent
;
@Autowired
private
OssUtils
ossUtils
;
@XxlJob
(
"protocolJob"
)
public
void
run
()
{
List
<
CreditModel
>
creditModels
=
creditComponent
.
getListModelByCreditThirdToken
(
"INIT"
);
creditModels
.
parallelStream
().
forEach
(
p
->
{
LoanModel
loanModel
=
loanComponent
.
getByOrderNo
(
p
.
getOrderNo
());
String
protocolUrl
=
iProtocalFeignService
.
getFilePathPdf
(
loanModel
.
getLoanNo
(),
"own-rongdan"
).
getResult
();
if
(
protocolUrl
!=
null
)
{
String
path
=
ossUtils
.
generateTempURLPrivateDomain
(
protocolUrl
);
JSONObject
thirdCredit
=
new
JSONObject
();
thirdCredit
.
put
(
"orderNo"
,
loanModel
.
getOrderNo
());
thirdCredit
.
put
(
"loanNo"
,
loanModel
.
getLoanNo
());
thirdCredit
.
put
(
"transNo"
,
IdUtil
.
fastSimpleUUID
());
thirdCredit
.
put
(
"contractFileUrl"
,
path
);
ZyJsonResult
zyJsonResult
=
abcHttpClient
.
postRequest
(
thirdCredit
.
toJSONString
(),
ZNPostUrlEnum
.
CREDIT_QUERY
.
getCode
());
log
.
info
(
"zyJsonResult:[{}]"
,
JSONObject
.
toJSONString
(
zyJsonResult
));
p
.
setCreditThirdToken
(
"FINISHED"
);
creditComponent
.
updateByOrderNo
(
p
.
getOrderNo
(),
p
);
}
});
}
}
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
View file @
41d6dfac
...
...
@@ -37,6 +37,8 @@ public class RouterConfig implements CommandLineRunner {
@Autowired
private
CreditThirdDataCommand
creditThirdDataCommand
;
@Autowired
private
RiskQueryDataCommand
riskQueryDataCommand
;
private
static
HashMap
<
String
,
AbstractCommand
>
commandHashMap
=
new
HashMap
<>();
...
...
@@ -59,6 +61,7 @@ public class RouterConfig implements CommandLineRunner {
commandHashMap
.
put
(
"syncCreditResult"
,
syncCreditCommand
);
commandHashMap
.
put
(
"syncBack"
,
backedCommand
);
commandHashMap
.
put
(
"creditThirdData"
,
creditThirdDataCommand
);
commandHashMap
.
put
(
"riskThirdData"
,
riskQueryDataCommand
);
}
...
...
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