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
a4eb4e5b
Commit
a4eb4e5b
authored
Oct 23, 2023
by
张庆
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
eebb161b
f41cd772
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
29 deletions
+70
-29
GetSignContractCommand.java
...java/com/jqtx/windows/command/GetSignContractCommand.java
+39
-0
SignContractCommand.java
...in/java/com/jqtx/windows/command/SignContractCommand.java
+5
-22
Swagger2Config.java
...n/java/com/jqtx/windows/common/config/Swagger2Config.java
+2
-2
IProtocalFeignService.java
...x/windows/infrastructure/feign/IProtocalFeignService.java
+5
-0
RouterConfig.java
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
+7
-5
SignContractRequest.java
...ava/com/jqtx/windows/web/request/SignContractRequest.java
+12
-0
No files found.
src/main/java/com/jqtx/windows/command/GetSignContractCommand.java
0 → 100644
View file @
a4eb4e5b
package
com
.
jqtx
.
windows
.
command
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jqtx.infrastructure.oss.starter.config.OssUtils
;
import
com.jqtx.windows.common.factory.AbstractCommand
;
import
com.jqtx.windows.common.factory.RuntimeContextHolder
;
import
com.jqtx.windows.component.model.GetSignContractModel
;
import
com.jqtx.windows.infrastructure.feign.IProtocalFeignService
;
import
com.jqtx.windows.web.response.GetSignContractResponse
;
import
com.jqtx.windows.web.response.JsonResult
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
GetSignContractCommand
extends
AbstractCommand
{
@Autowired
private
IProtocalFeignService
iProtocalFeignService
;
@Autowired
private
OssUtils
ossUtils
;
@Override
public
JsonResult
execute
()
{
String
requestBody
=
RuntimeContextHolder
.
currentRuntimeContext
().
getRequestBody
();
GetSignContractModel
getSignContractModel
=
JSONObject
.
parseObject
(
requestBody
,
GetSignContractModel
.
class
);
GetSignContractResponse
getSignContractResponse
=
new
GetSignContractResponse
();
JsonResult
<
String
>
rongdanPdfJsonResult
=
iProtocalFeignService
.
getFilePathPdf
(
getSignContractModel
.
getLoanNo
(),
"rongdan"
);
if
(
rongdanPdfJsonResult
.
isSuccess
()
&&
StringUtils
.
isNotEmpty
(
rongdanPdfJsonResult
.
getResult
())){
getSignContractResponse
.
setSignStatus
(
"SIGN"
);
String
path
=
ossUtils
.
generateTempURL
(
rongdanPdfJsonResult
.
getResult
());
getSignContractResponse
.
setContractFileUrl
(
path
);
}
else
{
getSignContractResponse
.
setSignStatus
(
"SIGN_ING"
);
}
return
JsonResult
.
success
(
getSignContractResponse
);
}
}
src/main/java/com/jqtx/windows/command/SignContractCommand.java
View file @
a4eb4e5b
package
com
.
jqtx
.
windows
.
command
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jqtx.infrastructure.oss.starter.config.OssUtils
;
import
com.jqtx.windows.common.factory.AbstractCommand
;
import
com.jqtx.windows.common.factory.RuntimeContextHolder
;
import
com.jqtx.windows.component.model.GetSignContractModel
;
import
com.jqtx.windows.infrastructure.feign.IProtocalFeignService
;
import
com.jqtx.windows.web.re
sponse.GetSignContractResponse
;
import
com.jqtx.windows.web.re
quest.SignContractRequest
;
import
com.jqtx.windows.web.response.JsonResult
;
import
org.apache.commons.lang3.StringUtils
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
SignContractCommand
extends
AbstractCommand
{
@Autowired
private
IProtocalFeignService
iProtocalFeignService
;
@Autowired
private
OssUtils
ossUtils
;
@Override
public
JsonResult
execute
()
{
String
requestBody
=
RuntimeContextHolder
.
currentRuntimeContext
().
getRequestBody
();
GetSignContractModel
getSignContractModel
=
JSONObject
.
parseObject
(
requestBody
,
GetSignContractModel
.
class
);
GetSignContractResponse
getSignContractResponse
=
new
GetSignContractResponse
();
JsonResult
<
String
>
rongdanPdfJsonResult
=
iProtocalFeignService
.
getFilePathPdf
(
getSignContractModel
.
getLoanNo
(),
"rongdan"
);
if
(
rongdanPdfJsonResult
.
isSuccess
()
&&
StringUtils
.
isNotEmpty
(
rongdanPdfJsonResult
.
getResult
())){
getSignContractResponse
.
setSignStatus
(
"SIGN"
);
String
path
=
ossUtils
.
generateTempURL
(
rongdanPdfJsonResult
.
getResult
());
getSignContractResponse
.
setContractFileUrl
(
path
);
}
else
{
getSignContractResponse
.
setSignStatus
(
"SIGN_ING"
);
}
return
JsonResult
.
success
(
getSignContractResponse
);
SignContractRequest
signContractRequest
=
JSONObject
.
parseObject
(
requestBody
,
SignContractRequest
.
class
);
iProtocalFeignService
.
uploadRongdan
(
signContractRequest
);
return
JsonResult
.
success
();
}
}
src/main/java/com/jqtx/windows/common/config/Swagger2Config.java
View file @
a4eb4e5b
...
...
@@ -18,8 +18,8 @@ public class Swagger2Config {
@Bean
public
Docket
createRestApi
(
Environment
environment
)
{
Profiles
profiles
=
Profiles
.
of
(
"dev"
,
"test"
);
boolean
flag
=
environment
.
acceptsProfiles
(
profiles
)
;
boolean
flag
=
true
;
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
pathMapping
(
"/"
)
.
apiInfo
(
apiInfo
()).
enable
(
flag
)
.
select
()
...
...
src/main/java/com/jqtx/windows/infrastructure/feign/IProtocalFeignService.java
View file @
a4eb4e5b
...
...
@@ -2,6 +2,7 @@ package com.jqtx.windows.infrastructure.feign;
import
com.jqtx.windows.component.model.UploadPdfRequest
;
import
com.jqtx.windows.infrastructure.feign.hytric.IProtocolFeignServiceHystric
;
import
com.jqtx.windows.web.request.SignContractRequest
;
import
com.jqtx.windows.web.response.JsonResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -16,4 +17,8 @@ public interface IProtocalFeignService {
@PostMapping
(
"/attach/uploadProtocolPdf"
)
JsonResult
<
String
>
uploadProtocolPdf
(
@RequestBody
UploadPdfRequest
uploadPdfRequest
);
@PostMapping
(
"/attach/uploadRongdan"
)
JsonResult
<
String
>
uploadRongdan
(
@RequestBody
SignContractRequest
signContractRequest
);
}
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
View file @
a4eb4e5b
...
...
@@ -22,16 +22,17 @@ public class RouterConfig implements CommandLineRunner {
@Autowired
private
GetCreditCommand
getCreditCommand
;
@Autowired
private
SignContractCommand
s
ignContractCommand
;
private
GetSignContractCommand
getS
ignContractCommand
;
@Autowired
private
SyncCreditCommand
syncCreditCommand
;
@Autowired
private
SyncLoanCommand
syncLoanCommand
;
@Autowired
private
SaveProtocolCommand
saveProtocolCommand
;
@Autowired
private
BackedCommand
backedCommand
;
@Autowired
private
SignContractCommand
signContractCommand
;
private
static
HashMap
<
String
,
AbstractCommand
>
commandHashMap
=
new
HashMap
<>();
...
...
@@ -48,10 +49,11 @@ public class RouterConfig implements CommandLineRunner {
commandHashMap
.
put
(
"getCredit"
,
getCreditCommand
);
commandHashMap
.
put
(
"loanSubmit"
,
loanSubmitCommand
);
commandHashMap
.
put
(
"getLoanResult"
,
loanStatusCommand
);
commandHashMap
.
put
(
"signContract"
,
s
aveProtocol
Command
);
commandHashMap
.
put
(
"getSignContract"
,
s
ignContractCommand
);
commandHashMap
.
put
(
"signContract"
,
s
ignContract
Command
);
commandHashMap
.
put
(
"getSignContract"
,
getS
ignContractCommand
);
commandHashMap
.
put
(
"syncLoan"
,
syncLoanCommand
);
commandHashMap
.
put
(
"syncCreditResult"
,
syncCreditCommand
);
commandHashMap
.
put
(
"syncBack"
,
backedCommand
);
}
}
src/main/java/com/jqtx/windows/web/request/SignContractRequest.java
0 → 100644
View file @
a4eb4e5b
package
com
.
jqtx
.
windows
.
web
.
request
;
import
lombok.Data
;
@Data
public
class
SignContractRequest
{
private
String
orderNo
;
private
String
loanNo
;
private
byte
[]
contractPdfFileBase64
;
private
String
signKeyword
;
}
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