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
48b9e2e3
Commit
48b9e2e3
authored
Nov 23, 2023
by
BlackJokerCJ
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
65619948
73e78749
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
27 deletions
+43
-27
BackedCommand.java
src/main/java/com/jqtx/windows/command/BackedCommand.java
+4
-10
BackedBurdenJob.java
src/main/java/com/jqtx/windows/job/BackedBurdenJob.java
+25
-15
RedeemJob.java
src/main/java/com/jqtx/windows/job/RedeemJob.java
+14
-2
No files found.
src/main/java/com/jqtx/windows/command/BackedCommand.java
View file @
48b9e2e3
...
@@ -103,16 +103,10 @@ public class BackedCommand extends AbstractCommand {
...
@@ -103,16 +103,10 @@ public class BackedCommand extends AbstractCommand {
planList
=
loanPlanComponent
.
getByLoan
(
loanNo
);
planList
=
loanPlanComponent
.
getByLoan
(
loanNo
);
LoanModel
loanModel
=
loanComponent
.
getByLoanNo
(
loanNo
);
LoanModel
loanModel
=
loanComponent
.
getByLoanNo
(
loanNo
);
//存在还款中计划改为还款中
List
<
LoanPlanModel
>
overduedList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
OVERDUED
.
getCode
()).
collect
(
Collectors
.
toList
());
List
<
LoanPlanModel
>
backingList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
BACKING
.
getCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
overduedList
))
{
if
(
CollectionUtils
.
isEmpty
(
backingList
))
{
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
OVERDUED
.
getCode
());
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
SETTLED
.
getCode
());
}
else
{
//存在还款中计划改为还款中
List
<
LoanPlanModel
>
backingList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
SETTLED
.
getCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
backingList
))
{
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
SETTLED
.
getCode
());
}
}
}
if
(
IsSettleEnum
.
ONE
.
getCode
().
equals
(
backedRequest
.
getIsSettle
()))
{
if
(
IsSettleEnum
.
ONE
.
getCode
().
equals
(
backedRequest
.
getIsSettle
()))
{
loanModel
.
setLoanStatus
(
DebtPlanStatusEnum
.
SETTLED
.
getCode
());
loanModel
.
setLoanStatus
(
DebtPlanStatusEnum
.
SETTLED
.
getCode
());
...
...
src/main/java/com/jqtx/windows/job/BackedBurdenJob.java
View file @
48b9e2e3
...
@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -64,9 +65,8 @@ public class BackedBurdenJob {
...
@@ -64,9 +65,8 @@ public class BackedBurdenJob {
if
(
sftp
.
isDir
(
"/download/assurance/"
+
date
))
{
if
(
sftp
.
isDir
(
"/download/assurance/"
+
date
))
{
sftp
.
cd
(
"/download/assurance/"
+
date
);
sftp
.
cd
(
"/download/assurance/"
+
date
);
sftp
.
get
(
"assurance_"
+
date
+
".txt"
,
"/assurance_sftp.txt"
);
sftp
.
get
(
"assurance_"
+
date
+
".txt"
,
"/assurance_sftp.txt"
);
ossUtils
.
ossUpload
(
"ZN/assurance_/"
+
"assurance_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/assurance_sftp.txt"
));
ossUtils
.
ossUpload
(
"ZN/assurance/"
+
"assurance_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/assurance_sftp.txt"
));
FileUtil
.
del
(
"/assurance_sftp.txt"
);
String
stringObject
=
getStringObject
(
"ZN/assurance/"
+
"assurance_"
+
date
+
".txt"
);
String
stringObject
=
ossUtils
.
getStringObject
(
"ZN/assurance_/"
+
"assurance_"
+
date
+
".txt"
);
log
.
info
(
"oss融担数据:{}"
,
stringObject
);
log
.
info
(
"oss融担数据:{}"
,
stringObject
);
//存储并去平账
//存储并去平账
List
<
BurdenModel
>
getlist
=
getlist
(
stringObject
);
List
<
BurdenModel
>
getlist
=
getlist
(
stringObject
);
...
@@ -74,12 +74,23 @@ public class BackedBurdenJob {
...
@@ -74,12 +74,23 @@ public class BackedBurdenJob {
backedBurdenComponent
.
insert
(
model
);
backedBurdenComponent
.
insert
(
model
);
backedBurden
(
model
);
backedBurden
(
model
);
}
}
FileUtil
.
del
(
"/assurance_sftp.txt"
);
}
else
{
}
else
{
log
.
info
(
"浙农融担文件不存在:{}"
,
date
);
log
.
info
(
"浙农融担文件不存在:{}"
,
date
);
}
}
}
}
public
String
getStringObject
(
String
uri
)
{
byte
[]
bytes
=
new
byte
[
0
];
try
{
bytes
=
ossUtils
.
ossDownLoad
(
uri
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
new
String
(
bytes
);
}
/**
/**
* 组装还融担的全部model
* 组装还融担的全部model
...
@@ -130,15 +141,15 @@ public class BackedBurdenJob {
...
@@ -130,15 +141,15 @@ public class BackedBurdenJob {
String
refundNo
=
SnowSequenceHelper
.
nextSequence
(
SnowSequenceHelper
.
REFUND_NO
);
String
refundNo
=
SnowSequenceHelper
.
nextSequence
(
SnowSequenceHelper
.
REFUND_NO
);
//生成 windows_repay 信息
//生成 windows_repay 信息
RepayModel
repayModel
=
creditRepay
(
model
,
refundNo
);
RepayModel
repayModel
=
creditRepay
(
model
,
refundNo
);
loanRepayComponent
.
insert
(
repayModel
);
//生成 windows_backed_detail 信息
//生成 windows_backed_detail 信息
BackedDetailModel
backedDetailModel
=
creditBackedDetailModel
(
model
,
refundNo
);
BackedDetailModel
backedDetailModel
=
creditBackedDetailModel
(
model
,
refundNo
);
backedDetailComponent
.
insert
(
backedDetailModel
);
//修改 windows_plan backAmt 信息 还款状态
//修改 windows_plan backAmt 信息 还款状态
upWindowsPlan
(
model
);
upWindowsPlan
(
model
);
//修改 windows_loan 还款状态
//修改 windows_loan 还款状态
LoanModel
loanModel
=
loanComponent
.
getByLoanNo
(
model
.
getLoanNo
());
LoanModel
loanModel
=
loanComponent
.
getByLoanNo
(
model
.
getLoanNo
());
upWindowsLoan
(
loanModel
);
upWindowsLoan
(
loanModel
);
loanRepayComponent
.
insert
(
repayModel
);
backedDetailComponent
.
insert
(
backedDetailModel
);
}
}
/**
/**
...
@@ -199,7 +210,7 @@ public class BackedBurdenJob {
...
@@ -199,7 +210,7 @@ public class BackedBurdenJob {
planModel
.
setBackedBurden
(
new
BigDecimal
(
model
.
getPepayBurden
()));
planModel
.
setBackedBurden
(
new
BigDecimal
(
model
.
getPepayBurden
()));
BigDecimal
planAmt
=
planModel
.
getPlanBen
().
add
(
planModel
.
getPlanXi
()).
add
(
planModel
.
getPlanFu
()).
add
(
planModel
.
getPlanFa
()).
add
(
planModel
.
getPlanBurden
());
BigDecimal
planAmt
=
planModel
.
getPlanBen
().
add
(
planModel
.
getPlanXi
()).
add
(
planModel
.
getPlanFu
()).
add
(
planModel
.
getPlanFa
()).
add
(
planModel
.
getPlanBurden
());
BigDecimal
backedAmt
=
planModel
.
getBackedBen
().
add
(
planModel
.
getBackedXi
()).
add
(
planModel
.
getBackedFu
()).
add
(
planModel
.
getBackedFa
()).
add
(
planModel
.
getBackedBurden
());
BigDecimal
backedAmt
=
planModel
.
getBackedBen
().
add
(
planModel
.
getBackedXi
()).
add
(
planModel
.
getBackedFu
()).
add
(
planModel
.
getBackedFa
()).
add
(
planModel
.
getBackedBurden
());
if
(
planAmt
.
compareTo
(
backedAmt
)
==
0
)
{
if
(
!(
planAmt
.
compareTo
(
backedAmt
)
>
0
)
)
{
planModel
.
setStatus
(
LoanStatusEnum
.
SETTLED
.
getCode
());
planModel
.
setStatus
(
LoanStatusEnum
.
SETTLED
.
getCode
());
}
}
loanPlanComponent
.
updateByLoanPlanModel
(
planModel
);
loanPlanComponent
.
updateByLoanPlanModel
(
planModel
);
...
@@ -207,18 +218,17 @@ public class BackedBurdenJob {
...
@@ -207,18 +218,17 @@ public class BackedBurdenJob {
private
void
upWindowsLoan
(
LoanModel
loanModel
)
{
private
void
upWindowsLoan
(
LoanModel
loanModel
)
{
List
<
LoanPlanModel
>
planList
=
loanPlanComponent
.
getByLoan
(
loanModel
.
getLoanNo
());
List
<
LoanPlanModel
>
planList
=
loanPlanComponent
.
getByLoan
(
loanModel
.
getLoanNo
());
List
<
LoanPlanModel
>
overduedList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
OVERDUED
.
getCode
()).
collect
(
Collectors
.
toList
());
//存在还款中计划改为还款中
if
(
CollectionUtils
.
isNotEmpty
(
overduedList
))
{
List
<
LoanPlanModel
>
backingList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
BACKING
.
getCode
()).
collect
(
Collectors
.
toList
());
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
OVERDUED
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
backingList
))
{
}
else
{
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
SETTLED
.
getCode
());
//存在还款中计划改为还款中
List
<
LoanPlanModel
>
backingList
=
planList
.
stream
().
filter
(
i
->
i
.
getStatus
()
==
DebtPlanStatusEnum
.
BACKING
.
getCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
backingList
))
{
loanModel
.
setLoanStatus
(
DebtInfoStatusEnum
.
SETTLED
.
getCode
());
}
}
}
//修改 windows_loan 还款状态
//修改 windows_loan 还款状态
loanComponent
.
updateByLoanNo
(
loanModel
);
loanComponent
.
updateByLoanNo
(
loanModel
);
}
}
public
static
void
main
(
String
[]
args
)
{
}
}
}
src/main/java/com/jqtx/windows/job/RedeemJob.java
View file @
48b9e2e3
...
@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -45,16 +46,27 @@ public class RedeemJob {
...
@@ -45,16 +46,27 @@ public class RedeemJob {
sftp
.
cd
(
"/download/compensatory/"
+
date
);
sftp
.
cd
(
"/download/compensatory/"
+
date
);
sftp
.
get
(
"compensatory_"
+
date
+
".txt"
,
"/compensatory_sftp.txt"
);
sftp
.
get
(
"compensatory_"
+
date
+
".txt"
,
"/compensatory_sftp.txt"
);
ossUtils
.
ossUpload
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/compensatory_sftp.txt"
));
ossUtils
.
ossUpload
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/compensatory_sftp.txt"
));
FileUtil
.
del
(
"/compensatory_sftp.txt"
);
String
stringObject
=
getStringObject
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
);
String
stringObject
=
ossUtils
.
getStringObject
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
);
log
.
info
(
"oss代偿数据:{}"
,
stringObject
);
log
.
info
(
"oss代偿数据:{}"
,
stringObject
);
redeemComponent
.
insert
(
getlist
(
stringObject
));
redeemComponent
.
insert
(
getlist
(
stringObject
));
FileUtil
.
del
(
"/compensatory_sftp.txt"
);
}
else
{
}
else
{
log
.
info
(
"浙农代偿文件不存在:{}"
,
date
);
log
.
info
(
"浙农代偿文件不存在:{}"
,
date
);
}
}
}
}
public
String
getStringObject
(
String
uri
)
{
byte
[]
bytes
=
new
byte
[
0
];
try
{
bytes
=
ossUtils
.
ossDownLoad
(
uri
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
new
String
(
bytes
);
}
/**
/**
* 封装model
* 封装model
*
*
...
...
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