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
22213142
Commit
22213142
authored
Nov 21, 2023
by
LSL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浙农定时
parent
0b008f7c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
12 deletions
+102
-12
SnowSequenceHelper.java
...m/jqtx/windows/common/config/snow/SnowSequenceHelper.java
+1
-0
RedeemComponent.java
...main/java/com/jqtx/windows/component/RedeemComponent.java
+3
-1
RedeemComponentImpl.java
.../com/jqtx/windows/component/impl/RedeemComponentImpl.java
+4
-6
BackedBurdenJob.java
src/main/java/com/jqtx/windows/job/BackedBurdenJob.java
+53
-1
RedeemJob.java
src/main/java/com/jqtx/windows/job/RedeemJob.java
+41
-4
No files found.
src/main/java/com/jqtx/windows/common/config/snow/SnowSequenceHelper.java
View file @
22213142
...
...
@@ -19,6 +19,7 @@ public class SnowSequenceHelper {
public
final
static
String
PRE_CREDIT_NO
=
"16750"
;
public
final
static
String
CREDIT_NO
=
"16760"
;
public
final
static
String
ACTION_NO
=
"0000"
;
public
final
static
String
REFUND_NO
=
"6403"
;
public
final
static
String
CREDIT_ACTION_NO
=
"1111"
;
private
static
SnowFlake
instance
=
null
;
...
...
src/main/java/com/jqtx/windows/component/RedeemComponent.java
View file @
22213142
...
...
@@ -2,7 +2,9 @@ package com.jqtx.windows.component;
import
com.jqtx.windows.component.model.RedeemModel
;
import
java.util.List
;
public
interface
RedeemComponent
{
void
insert
(
RedeemModel
model
);
void
insert
(
List
<
RedeemModel
>
model
);
}
src/main/java/com/jqtx/windows/component/impl/RedeemComponentImpl.java
View file @
22213142
package
com
.
jqtx
.
windows
.
component
.
impl
;
import
cn.hutool.extra.cglib.CglibUtil
;
import
com.jqtx.windows.component.BackedBurdenComponent
;
import
com.jqtx.windows.component.RedeemComponent
;
import
com.jqtx.windows.component.model.BurdenModel
;
import
com.jqtx.windows.component.model.RedeemModel
;
import
com.jqtx.windows.repository.entity.WindowsBurden
;
import
com.jqtx.windows.repository.entity.WindowsRedeem
;
import
com.jqtx.windows.repository.mapper.WindowsBurdenMapper
;
import
com.jqtx.windows.repository.mapper.WindowsRedeemMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
RedeemComponentImpl
implements
RedeemComponent
{
...
...
@@ -19,8 +17,8 @@ public class RedeemComponentImpl implements RedeemComponent {
private
WindowsRedeemMapper
windowsRedeemMapper
;
@Override
public
void
insert
(
RedeemModel
model
)
{
windowsRedeemMapper
.
insert
(
CglibUtil
.
copy
(
model
,
WindowsRedeem
.
class
));
public
void
insert
(
List
<
RedeemModel
>
models
)
{
models
.
stream
().
map
(
e
->
windowsRedeemMapper
.
insert
(
CglibUtil
.
copy
(
e
,
WindowsRedeem
.
class
)
));
}
}
src/main/java/com/jqtx/windows/job/BackedBurdenJob.java
View file @
22213142
...
...
@@ -5,15 +5,20 @@ import cn.hutool.core.io.FileUtil;
import
cn.hutool.core.util.CharsetUtil
;
import
cn.hutool.extra.ssh.Sftp
;
import
com.jqtx.infrastructure.oss.starter.config.OssUtils
;
import
com.jqtx.windows.common.config.snow.SnowSequenceHelper
;
import
com.jqtx.windows.component.impl.BackedBurdenComponentImpl
;
import
com.jqtx.windows.component.impl.LoanPlanComponentImpl
;
import
com.jqtx.windows.component.model.BurdenModel
;
import
com.jqtx.windows.component.model.LoanPlanModel
;
import
com.jqtx.windows.component.model.RepayModel
;
import
com.jqtx.windows.web.request.BackedRequest
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -41,7 +46,7 @@ public class BackedBurdenJob {
FileUtil
.
del
(
"/sftp.txt"
);
String
stringObject
=
ossUtils
.
getStringObject
(
"ZN/assurance_/"
+
"assurance_"
+
date
+
".txt"
);
log
.
info
(
"date:{}"
,
stringObject
);
//存储并去平账
List
<
BurdenModel
>
getlist
=
getlist
(
stringObject
);
for
(
BurdenModel
model
:
getlist
)
{
backedBurdenComponent
.
insert
(
model
);
...
...
@@ -50,6 +55,11 @@ public class BackedBurdenJob {
}
/**
* 组装还融担的全部model
* @param jsonResult
* @return
*/
private
List
<
BurdenModel
>
getlist
(
String
jsonResult
)
{
ArrayList
<
BurdenModel
>
list
=
new
ArrayList
<>();
String
[]
split
=
jsonResult
.
split
(
"\n"
);
...
...
@@ -71,9 +81,51 @@ public class BackedBurdenJob {
return
list
;
}
/**
* 获取planNo
* @param loanNo
* @param planIndex
* @return
*/
private
String
getPlanNo
(
String
loanNo
,
String
planIndex
){
LoanPlanModel
planModel
=
loanPlanComponent
.
getPlanNoByLoan
(
loanNo
,
planIndex
);
return
planModel
.
getPlanNo
();
}
/**
* 还融担
* @param model
*/
private
void
backedBurden
(
BurdenModel
model
){
//生成 windows_repay 信息
RepayModel
repayModel
=
creditRepay
(
model
);
//生成 windows_backed_detail 信息
//修改 windows_plan backAmt 信息
//修改 windows_plan 还款状态
//修改 windows_loan 还款状态
}
/**
* 生成 windows_repay
* @param model
* @return
*/
public
RepayModel
creditRepay
(
BurdenModel
model
)
{
RepayModel
windowsRepay
=
new
RepayModel
();
windowsRepay
.
setLoanNo
(
model
.
getLoanNo
());
String
refundNo
=
SnowSequenceHelper
.
nextSequence
(
SnowSequenceHelper
.
REFUND_NO
);
windowsRepay
.
setBackedNo
(
refundNo
);
windowsRepay
.
setBackedAmt
(
new
BigDecimal
(
model
.
getPepayBurden
()));
windowsRepay
.
setIsSettle
(
0
);
windowsRepay
.
setBackedType
(
"BURDEN"
);
windowsRepay
.
setRepayResult
(
"SUCCESS"
);
windowsRepay
.
setRepayStatus
(
"FINISHED"
);
windowsRepay
.
setCreator
(
"浙农"
);
windowsRepay
.
setGmtCreated
(
LocalDateTime
.
now
());
windowsRepay
.
setGmtModified
(
LocalDateTime
.
now
());
return
windowsRepay
;
}
}
src/main/java/com/jqtx/windows/job/RedeemJob.java
View file @
22213142
...
...
@@ -5,13 +5,16 @@ import cn.hutool.core.io.FileUtil;
import
cn.hutool.core.util.CharsetUtil
;
import
cn.hutool.extra.ssh.Sftp
;
import
com.jqtx.infrastructure.oss.starter.config.OssUtils
;
import
com.jqtx.windows.component.RedeemComponent
;
import
com.jqtx.windows.component.model.RedeemModel
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.
io.File
;
import
java.
util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Component
@Slf4j
...
...
@@ -19,16 +22,50 @@ public class RedeemJob {
@Autowired
private
OssUtils
ossUtils
;
@Autowired
private
RedeemComponent
redeemComponent
;
@XxlJob
(
"redeemJob"
)
public
void
run
()
{
Sftp
sftp
=
new
Sftp
(
"115.238.89.106"
,
9901
,
"xiaohua_fr"
,
"R7MADMx1lwMN5k4v"
,
CharsetUtil
.
CHARSET_UTF_8
);
String
date
=
DateUtil
.
format
(
new
Date
(),
"yyyyMMdd"
);
sftp
.
cd
(
"/download/compensatory/"
+
date
);
sftp
.
get
(
"compensatory_"
+
date
+
".txt"
,
"/compensatory_sftp.txt"
);
ossUtils
.
ossUpload
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/compensatory_sftp.txt"
));
sftp
.
cd
(
"/download/compensatory/"
+
date
);
sftp
.
get
(
"compensatory_"
+
date
+
".txt"
,
"/compensatory_sftp.txt"
);
ossUtils
.
ossUpload
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
,
FileUtil
.
file
(
"/compensatory_sftp.txt"
));
FileUtil
.
del
(
"/sftp.txt"
);
String
stringObject
=
ossUtils
.
getStringObject
(
"ZN/compensatory/"
+
"compensatory_"
+
date
+
".txt"
);
log
.
info
(
"date:{}"
,
stringObject
);
redeemComponent
.
insert
(
getlist
(
stringObject
));
}
/**
* 封装model
* @param jsonResult
* @return
*/
private
List
<
RedeemModel
>
getlist
(
String
jsonResult
)
{
ArrayList
<
RedeemModel
>
list
=
new
ArrayList
<>();
String
[]
split
=
jsonResult
.
split
(
"\n"
);
if
(
split
==
null
)
{
return
list
;
}
for
(
String
modelstr
:
split
)
{
String
[]
split1
=
modelstr
.
split
(
"\\|"
);
RedeemModel
model
=
new
RedeemModel
();
model
.
setLoanNo
(
split1
[
0
]);
model
.
setRedeemType
(
split1
[
1
]);
model
.
setPlanIndex
(
split1
[
2
]);
model
.
setRaiseTime
(
split1
[
3
]);
model
.
setBackedTime
(
split1
[
4
]);
model
.
setHoldDay
(
split1
[
5
]);
model
.
setRedeemBen
(
split1
[
6
]);
model
.
setRedeemXi
(
split1
[
7
]);
model
.
setRedeemFa
(
split1
[
8
]);
model
.
setRedeemAmount
(
split1
[
9
]);
list
.
add
(
model
);
}
return
list
;
}
}
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