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
29ef77d7
Commit
29ef77d7
authored
Oct 24, 2023
by
BlackJokerCJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiyi
parent
9b3a270e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
1 deletion
+86
-1
SignContractCommand.java
...in/java/com/jqtx/windows/command/SignContractCommand.java
+2
-0
CreditComponent.java
...main/java/com/jqtx/windows/component/CreditComponent.java
+3
-1
CreditComponentImpl.java
.../com/jqtx/windows/component/impl/CreditComponentImpl.java
+11
-0
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/SignContractCommand.java
View file @
29ef77d7
...
...
@@ -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 @
29ef77d7
...
...
@@ -12,5 +12,7 @@ public interface CreditComponent {
void
updateByOrderNo
(
String
orderNo
,
CreditModel
model
);
List
<
CreditModel
>
getListModelByCreditThirdStatus
(
String
init
);
List
<
CreditModel
>
getListModelByCreditThirdStatus
(
String
token
);
List
<
CreditModel
>
getListModelByCreditThirdToken
(
String
token
);
}
src/main/java/com/jqtx/windows/component/impl/CreditComponentImpl.java
View file @
29ef77d7
...
...
@@ -63,4 +63,15 @@ 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
());
}
}
src/main/java/com/jqtx/windows/component/impl/LoanComponentImpl.java
View file @
29ef77d7
...
...
@@ -47,6 +47,7 @@ public class LoanComponentImpl implements LoanComponent {
WindowsLoanExample
example
=
new
WindowsLoanExample
();
WindowsLoanExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andOrderNoEqualTo
(
orderNo
);
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 @
29ef77d7
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 @
29ef77d7
...
...
@@ -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