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
77d8172f
Commit
77d8172f
authored
Oct 23, 2023
by
张庆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增挡板规则
parent
107413cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
39 deletions
+59
-39
GetCreditCommand.java
src/main/java/com/jqtx/windows/command/GetCreditCommand.java
+23
-20
LoanStatusCommand.java
...main/java/com/jqtx/windows/command/LoanStatusCommand.java
+22
-19
BaseConfig.java
src/main/java/com/jqtx/windows/common/config/BaseConfig.java
+14
-0
No files found.
src/main/java/com/jqtx/windows/command/GetCreditCommand.java
View file @
77d8172f
...
...
@@ -3,6 +3,7 @@ package com.jqtx.windows.command;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.jqtx.windows.common.config.BaseConfig
;
import
com.jqtx.windows.common.config.SpringContextConfig
;
import
com.jqtx.windows.common.exception.BizException
;
import
com.jqtx.windows.common.factory.AbstractCommand
;
...
...
@@ -22,6 +23,8 @@ import org.springframework.stereotype.Service;
public
class
GetCreditCommand
extends
AbstractCommand
{
@Autowired
private
CreditComponent
creditComponent
;
@Autowired
private
BaseConfig
baseConfig
;
public
JsonResult
execute
()
{
String
requestBody
=
RuntimeContextHolder
.
currentRuntimeContext
().
getRequestBody
();
...
...
@@ -45,28 +48,28 @@ public class GetCreditCommand extends AbstractCommand {
response
.
setOrderNo
(
credit
.
getOrderNo
());
response
.
setUpdateTime
(
LocalDateTimeUtil
.
formatNormal
(
credit
.
getGmtModified
()));
//偶数TODO
// if (!SpringContextConfig.getActiveProfile().equals("prod")) {
// response.setStatus("1");
// response.setApprovalAmount("10000.00");
//// String substring = credit.getOrderNo().substring(credit.getOrderNo().length() - 1, credit.getOrderNo().length());
//// if (Integer.valueOf(substring) % 2 == 0) {
//// response.setStatus("1");
//// response.setApprovalAmount("10000.00");
//// } else {
//// response.setStatus("2");
//// //response.setApprovalAmount("10000.00");
//// response.setRemark("挡板拒绝");
//// }
// } else {
if
(
CreditResultStatusEnum
.
PASS
.
name
().
equals
(
credit
.
getCreditResult
()))
{
if
(
baseConfig
.
getUseBaffle
().
equals
(
"use"
))
{
response
.
setStatus
(
"1"
);
response
.
setApprovalAmount
(
credit
.
getCreditAmt
());
}
if
(
CreditResultStatusEnum
.
REFUSED
.
name
().
equals
(
credit
.
getCreditResult
()))
{
response
.
setStatus
(
"2"
);
response
.
setApprovalAmount
(
"10000.00"
);
// String substring = credit.getOrderNo().substring(credit.getOrderNo().length() - 1, credit.getOrderNo().length());
// if (Integer.valueOf(substring) % 2 == 0) {
// response.setStatus("1");
// response.setApprovalAmount("10000.00");
// } else {
// response.setStatus("2");
// //response.setApprovalAmount("10000.00");
// response.setRemark("挡板拒绝");
// }
}
else
{
if
(
CreditResultStatusEnum
.
PASS
.
name
().
equals
(
credit
.
getCreditResult
()))
{
response
.
setStatus
(
"1"
);
response
.
setApprovalAmount
(
credit
.
getCreditAmt
());
}
if
(
CreditResultStatusEnum
.
REFUSED
.
name
().
equals
(
credit
.
getCreditResult
()))
{
response
.
setStatus
(
"2"
);
}
response
.
setRemark
(
credit
.
getMemo
());
}
response
.
setRemark
(
credit
.
getMemo
());
//}
return
response
;
}
}
src/main/java/com/jqtx/windows/command/LoanStatusCommand.java
View file @
77d8172f
package
com
.
jqtx
.
windows
.
command
;
import
com.alibaba.fastjson.JSON
;
import
com.jqtx.windows.common.config.BaseConfig
;
import
com.jqtx.windows.common.config.SpringContextConfig
;
import
com.jqtx.windows.common.exception.BizException
;
import
com.jqtx.windows.common.factory.AbstractCommand
;
...
...
@@ -26,6 +27,8 @@ public class LoanStatusCommand extends AbstractCommand {
@Autowired
private
LoanComponent
loanComponent
;
@Autowired
private
BaseConfig
baseConfig
;
@Override
public
JsonResult
execute
()
{
...
...
@@ -40,27 +43,27 @@ public class LoanStatusCommand extends AbstractCommand {
if
(
Objects
.
isNull
(
loanModel
))
{
throw
new
BizException
(
ExceptionCodeEnum
.
BIZ_CREDIT_NOT_FOUND_ERROR
);
}
// if (!SpringContextConfig.getActiveProfile().equals("prod")) {
// response.setStatus(1);
// response.setRemark("挡板:提现通过");
//// String substring = loanModel.getOrderNo().substring(loanModel.getOrderNo().length() - 1, loanModel.getOrderNo().length());
//// if (Integer.valueOf(substring) % 2 == 0) {
//// response.setStatus(1);
//// response.setRemark("挡板:提现通过");
//// } else {
//// response.setStatus(2);
//// response.setRemark("挡板:提现拒绝,去别家看看");
//// }
// } else {
if
(
"PASS"
.
equals
(
loanModel
.
getLoanCreditResult
()))
{
if
(
baseConfig
.
getUseBaffle
().
equals
(
"use"
))
{
response
.
setStatus
(
1
);
response
.
setRemark
(
"提现通过"
);
}
if
(
"REFUSED"
.
equals
(
loanModel
.
getLoanCreditResult
()))
{
response
.
setStatus
(
2
);
response
.
setRemark
(
"提现拒绝,去别家看看"
);
response
.
setRemark
(
"挡板:提现通过"
);
// String substring = loanModel.getOrderNo().substring(loanModel.getOrderNo().length() - 1, loanModel.getOrderNo().length());
// if (Integer.valueOf(substring) % 2 == 0) {
// response.setStatus(1);
// response.setRemark("挡板:提现通过");
// } else {
// response.setStatus(2);
// response.setRemark("挡板:提现拒绝,去别家看看");
// }
}
else
{
if
(
"PASS"
.
equals
(
loanModel
.
getLoanCreditResult
()))
{
response
.
setStatus
(
1
);
response
.
setRemark
(
"提现通过"
);
}
if
(
"REFUSED"
.
equals
(
loanModel
.
getLoanCreditResult
()))
{
response
.
setStatus
(
2
);
response
.
setRemark
(
"提现拒绝,去别家看看"
);
}
}
//}
return
JsonResult
.
success
(
response
);
}
}
src/main/java/com/jqtx/windows/common/config/BaseConfig.java
0 → 100644
View file @
77d8172f
package
com
.
jqtx
.
windows
.
common
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
@Data
@Configuration
@ConfigurationProperties
(
prefix
=
"baseconfig"
)
public
class
BaseConfig
{
private
String
useBaffle
;
}
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