Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Data-王博
finance-api
Commits
ad46c034
Commit
ad46c034
authored
Feb 17, 2017
by
Data-王博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
湖北消金 - 因为时间范围的
parent
eaf659de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
9 deletions
+51
-9
HubeiCFCField.java
.../java/cn/quantgroup/financial/constant/HubeiCFCField.java
+10
-0
IHuBeiService.java
...n/java/cn/quantgroup/financial/service/IHuBeiService.java
+4
-0
HuBeiServiceImpl.java
...n/quantgroup/financial/service/impl/HuBeiServiceImpl.java
+37
-9
No files found.
src/main/java/cn/quantgroup/financial/constant/HubeiCFCField.java
View file @
ad46c034
...
...
@@ -83,6 +83,16 @@ public class HubeiCFCField {
}
};
public
static
final
Map
<
Byte
,
HubeiCFCDataType
>
HubeiTypeMap
=
new
HashMap
<
Byte
,
HubeiCFCDataType
>(){
{
put
(
HubeiCFCDataType
.
RETURN_BATCH_DEBIT
.
get
(),
HubeiCFCDataType
.
RETURN_BATCH_DEBIT
);
put
(
HubeiCFCDataType
.
RETURN_BATCH_COMPENSATION
.
get
(),
HubeiCFCDataType
.
RETURN_BATCH_COMPENSATION
);
put
(
HubeiCFCDataType
.
RETURN_BATCH_COMPENSATION
.
get
(),
HubeiCFCDataType
.
RETURN_BATCH_COMPENSATION
);
put
(
HubeiCFCDataType
.
SEND_DEBIT
.
get
(),
HubeiCFCDataType
.
SEND_DEBIT
);
put
(
HubeiCFCDataType
.
SEND_ADVANCE_REPAYMENT_CHECK
.
get
(),
HubeiCFCDataType
.
SEND_ADVANCE_REPAYMENT_CHECK
);
}
};
public
static
final
String
chanel_9009
=
"9009"
;
/**
...
...
src/main/java/cn/quantgroup/financial/service/IHuBeiService.java
View file @
ad46c034
...
...
@@ -7,6 +7,7 @@ import cn.quantgroup.financial.model.huibeicfc.HuBeiCFCResponse;
import
cn.quantgroup.financial.model.huibeicfc.HuBeiDocName
;
import
cn.quantgroup.financial.model.huibeicfc.HuBeiHistory
;
import
org.dom4j.DocumentException
;
import
org.springframework.scheduling.annotation.Async
;
import
org.xml.sax.SAXException
;
import
javax.activation.DataSource
;
...
...
@@ -45,7 +46,10 @@ public interface IHuBeiService {
* 异常邮件通知
* @param messageString
*/
@Async
void
sendMailNotice
(
String
messageString
);
@Async
void
sendMailNotice
(
List
<
HuBeiHistory
>
huBeiHistoryList
,
String
noticeMessage
);
/**
* 每日附件发送
...
...
src/main/java/cn/quantgroup/financial/service/impl/HuBeiServiceImpl.java
View file @
ad46c034
...
...
@@ -372,6 +372,7 @@ public class HuBeiServiceImpl implements IHuBeiService {
*/
Map
<
Long
,
List
<
RepayXyqbDetail
>>
listRepayDetailMap
=
getRepayXyqbMap
(
loanHistoryIdList
);
List
<
HuBeiHistory
>
returnHuBeiHistoryList
=
new
ArrayList
<>();
List
<
HuBeiHistory
>
errorHuBeiHistoryList
=
new
ArrayList
<>();
//先查所有提前还款
Date
[]
dates
=
HubeiCFCUtil
.
getDateScope
();
returnHuBeiHistoryList
.
addAll
(
advanceRepayment
(
loanHistoryIdList
,
dates
[
0
],
dates
[
1
]));
...
...
@@ -379,6 +380,7 @@ public class HuBeiServiceImpl implements IHuBeiService {
int
index
=
0
;
for
(;
index
<
sendHuBeiHistoryList
.
size
();
index
++){
HuBeiHistory
history
=
sendHuBeiHistoryList
.
get
(
index
);
Long
loanId
=
contractNoMapLoanId
.
get
(
history
.
getContactNo
());
...
...
@@ -398,8 +400,8 @@ public class HuBeiServiceImpl implements IHuBeiService {
Collections
.
sort
(
repayXyqbDetailList
,
new
RepayXyqbCompartor
());
if
(!
CollectionUtils
.
isEmpty
(
repayXyqbDetailList
)){
RepayXyqbDetail
repayXyqbDetail
=
repayXyqbDetailList
.
get
(
0
);
//
等于送盘文件当前期
if
(
repayXyqbDetail
.
getCurrTermNo
().
compareTo
(
history
.
getCurrTermNo
())==
0
){
//
应还日或者逾期 湖北不能接收再提前还款
if
(
repayXyqbDetail
List
.
size
()==
0
&&
repayXyqbDetail
.
getCurrTermNo
().
compareTo
(
history
.
getCurrTermNo
())==
0
){
RepaymentPlanDetail
repaymentPlanDetail
=
noYetContractMapRepayPlan
.
get
(
history
.
getContactNo
());
if
(
repaymentPlanDetail
!=
null
){
//湖北罚息
...
...
@@ -408,13 +410,12 @@ public class HuBeiServiceImpl implements IHuBeiService {
BigDecimal
reallyRepayAmount
=
repaymentPlanDetail
.
getPrincipal
().
add
(
repaymentPlanDetail
.
getInterest
()).
add
(
hubeiOverdueInterest
);
returnHuBeiHistoryList
.
add
(
deitHuiBeiHistory
(
history
,
sendHuBeiDocName
.
getCreateTime
(),
reallyRepayAmount
,
HubeiCFCField
.
tradeCodeSuccess
));
}
//去除第一个
repayXyqbDetailList
=
repayXyqbDetailList
.
subList
(
1
,
repayXyqbDetailList
.
size
());
}
//剩下的提前还款
List
<
HuBeiHistory
>
advanceHistoryList
=
advanceHuiBeiHistory
(
repayXyqbDetailList
);
if
(!
CollectionUtils
.
isEmpty
(
advanceHistoryList
)){
returnHuBeiHistoryList
.
addAll
(
advanceHistoryList
);
}
else
{
//这部分
List
<
HuBeiHistory
>
advanceHistoryList
=
advanceHuiBeiHistory
(
repayXyqbDetailList
);
if
(!
CollectionUtils
.
isEmpty
(
advanceHistoryList
)){
errorHuBeiHistoryList
.
addAll
(
advanceHistoryList
);
}
}
continue
;
}
...
...
@@ -435,6 +436,13 @@ public class HuBeiServiceImpl implements IHuBeiService {
returnHuBeiHistoryList
.
add
(
deitHuiBeiHistory
(
history
,
sendHuBeiDocName
.
getCreateTime
(),
BigDecimal
.
ZERO
,
HubeiCFCField
.
tradeCodeNoTrade
));
}
//给相关人员发送异常的邮件
if
(!
CollectionUtils
.
isEmpty
(
errorHuBeiHistoryList
)){
sendMailNotice
(
errorHuBeiHistoryList
,
"异常的数据:"
);
}
return
returnHuBeiHistoryList
;
}
...
...
@@ -633,6 +641,26 @@ public class HuBeiServiceImpl implements IHuBeiService {
}
}
@Async
@Override
public
void
sendMailNotice
(
List
<
HuBeiHistory
>
huBeiHistoryList
,
String
noticeMessage
){
try
{
if
(
CollectionUtils
.
isEmpty
(
huBeiHistoryList
)){
return
;
}
StringBuilder
errorStringBuilder
=
new
StringBuilder
(
noticeMessage
+
"\r"
);
for
(
HuBeiHistory
huBeiHistory:
huBeiHistoryList
){
errorStringBuilder
.
append
(
huBeiHandlerDispatcher
.
builder
(
HubeiCFCField
.
HubeiTypeMap
.
get
(
huBeiHistory
.
getDataType
()),
huBeiHistory
)).
append
(
"\r"
);
}
String
message
=
errorStringBuilder
.
toString
();
if
(!
StringUtils
.
isEmpty
(
message
)){
sendMailNotice
(
message
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
private
String
[]
getMailListByType
(
Byte
type
){
List
<
MailInfo
>
mailInfoList
=
huBeiCFCDao
.
getListByType
(
type
);
if
(
CollectionUtils
.
isEmpty
(
mailInfoList
)){
...
...
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