Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-tools
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
QG
financial-tools
Commits
f9d54384
Commit
f9d54384
authored
Jan 04, 2017
by
data-赵 玉龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据
parent
5da1e63e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
126 additions
and
37 deletions
+126
-37
DifCheckOutAPP.java
src/main/java/cn/gq/financial/app/DifCheckOutAPP.java
+14
-16
OfflineRapay.java
src/main/java/cn/gq/financial/app/OfflineRapay.java
+91
-0
RepayFinancialAPP.java
src/main/java/cn/gq/financial/app/RepayFinancialAPP.java
+3
-3
DifCheckOutHandler.java
.../java/cn/gq/financial/app/handler/DifCheckOutHandler.java
+2
-2
AbstractBills.java
src/main/java/cn/gq/financial/bills/AbstractBills.java
+1
-0
BaitiaoOfflineDetailService.java
.../cn/gq/financial/service/BaitiaoOfflineDetailService.java
+3
-0
BaitiaoOnlineDetailService.java
...a/cn/gq/financial/service/BaitiaoOnlineDetailService.java
+1
-1
DetailService.java
src/main/java/cn/gq/financial/service/DetailService.java
+1
-1
XYQBDetailService.java
src/main/java/cn/gq/financial/service/XYQBDetailService.java
+1
-1
BillParsers.java
src/main/java/cn/gq/financial/utils/BillParsers.java
+5
-4
applicationContext.properties
src/main/resources/applicationContext.properties
+4
-9
No files found.
src/main/java/cn/gq/financial/app/DifCheckOutAPP.java
View file @
f9d54384
...
...
@@ -45,27 +45,25 @@ public class DifCheckOutAPP {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
try
{
File
file
=
new
File
(
"E:\\financial-system-data\\
weichat
\\baitiao"
);
File
file
=
new
File
(
"E:\\financial-system-data\\
yeepay
\\baitiao"
);
File
[]
files
=
file
.
listFiles
();
List
<
WX
Bill
>
bills
=
new
ArrayList
<>();
List
<
Yeepay
Bill
>
bills
=
new
ArrayList
<>();
for
(
File
f
:
files
)
{
List
<
WXBill
>
wxBills
=
BillParsers
.
parseBillFromInputStream
(
f
,
WX
Bill
.
class
);
List
<
YeepayBill
>
wxBills
=
BillParsers
.
parseBillFromInputStream
(
f
,
Yeepay
Bill
.
class
);
bills
.
addAll
(
wxBills
);
}
// List<WXBill> lostBills = bills.stream().filter(bill->{
// return lostOrder.contains(bill.getOrderId());
// }).collect(Collectors.toList());
}
// BigDecimal imcomes = new BigDecimal("0");
// BigDecimal poundages = new BigDecimal("0");
// for(YeepayBill bill:bills){
// BigDecimal imcome = bill.getIncome();
// BigDecimal poundage = bill.getPoundage();
// imcomes = imcomes.add(imcome);
// poundages = poundages.add(poundage);
// }
// System.out.println(imcomes);
// System.out.println(poundages);
//
// List<String> collect = lostBills.stream().map(WXBill::getSrcStr).collect(Collectors.toList());
// FileUtils.writeOutStrsToFile(collect,"E:\\work\\balance\\10\\微信丢失的.txt");
// BigDecimal totalRepay = bills.stream().map(YeepayBill::getIncome).reduce(BigDecimal.ZERO,BigDecimal::add);
// BigDecimal totalPoundage = bills.stream().map(YeepayBill::getPoundage).reduce(BigDecimal.ZERO,BigDecimal::add);
// System.out.println(totalRepay);
// System.out.println(totalPoundage);
getSpringContext
().
getBean
(
DifCheckOutHandler
.
class
).
checkDif
(
bills
);
}
catch
(
Exception
e
){
...
...
src/main/java/cn/gq/financial/app/OfflineRapay.java
0 → 100644
View file @
f9d54384
package
cn
.
gq
.
financial
.
app
;
import
cn.gq.financial.app.handler.RepayHandler
;
import
cn.gq.financial.bills.AbstractBills
;
import
cn.gq.financial.bills.PayType
;
import
cn.gq.financial.bills.UMPayBills
;
import
cn.gq.financial.bills.WeichatBills
;
import
cn.gq.financial.model.bill.Bill
;
import
cn.gq.financial.model.bill.UMPayBill
;
import
cn.gq.financial.model.bill.WXBill
;
import
cn.gq.financial.model.bill.YeepayBill
;
import
cn.gq.financial.service.BaitiaoOfflineDetailService
;
import
cn.gq.financial.service.FinancialRepayDetailService
;
import
cn.gq.financial.utils.Constants
;
import
com.google.common.base.Joiner
;
import
org.apache.commons.io.FileUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Paths
;
public
class
OfflineRapay
{
static
final
String
CONFIG_LOCAL
=
"applicationContext.xml"
;
static
final
String
ROOT_DIR
=
"E:\\financial-system-data\\"
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
OfflineRapay
.
class
);
/**
* Tip: 对帐单时 只需修改currentMonth和payType
* currentMonth 当前是几月就输入几 无须减1 后续代码里面已经处理
*/
static
Integer
currentMonth
=
11
;
static
PayType
payType
=
PayType
.
YeePay_Xjd
;
static
AbstractBills
bill
;
static
String
path
=
""
;
static
Class
<?
extends
Bill
>
clazz
=
null
;
private
static
ClassPathXmlApplicationContext
context
=
null
;
static
{
path
=
Joiner
.
on
(
File
.
separator
).
join
(
ROOT_DIR
,
payType
.
path
());
switch
(
payType
.
getChannelName
())
{
case
"微信"
:
bill
=
new
WeichatBills
(
currentMonth
,
path
);
clazz
=
WXBill
.
class
;
break
;
case
"易宝"
:
clazz
=
YeepayBill
.
class
;
break
;
case
"联动"
:
bill
=
new
UMPayBills
(
currentMonth
,
path
);
clazz
=
UMPayBill
.
class
;
break
;
}
// 拉取帐单前先清理目录
if
(!
"易宝"
.
equals
(
payType
.
getChannelName
()))
{
if
(
Paths
.
get
(
path
).
toFile
().
exists
())
{
try
{
FileUtils
.
cleanDirectory
(
Paths
.
get
(
path
).
toFile
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
bill
.
pullBills
(
payType
);
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
try
{
LOGGER
.
info
(
"======开始处理["
+
path
+
"]目录下面的还款账单======"
);
long
begin
=
System
.
currentTimeMillis
();
BaitiaoOfflineDetailService
baitiaoOfflineDetailService
=
getSpringContext
().
getBean
(
BaitiaoOfflineDetailService
.
class
);
baitiaoOfflineDetailService
.
getDetailByPayCenterRepayOrder
(
null
);
LOGGER
.
info
(
"总计耗时--->{}mm"
,
(
System
.
currentTimeMillis
()
-
begin
));
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
finally
{
context
.
close
();
}
}
public
static
ClassPathXmlApplicationContext
getSpringContext
()
{
if
(
null
==
context
)
{
context
=
new
ClassPathXmlApplicationContext
(
CONFIG_LOCAL
);
}
return
context
;
}
}
src/main/java/cn/gq/financial/app/RepayFinancialAPP.java
View file @
f9d54384
...
...
@@ -29,9 +29,9 @@ public class RepayFinancialAPP {
* Tip: 对帐单时 只需修改currentMonth和payType
* currentMonth 当前是几月就输入几 无须减1 后续代码里面已经处理
*/
static
Integer
currentMonth
=
1
1
;
static
Integer
currentMonth
=
1
2
;
static
PayType
payType
=
PayType
.
WeiChat
_Xjd
;
static
PayType
payType
=
PayType
.
YeePay
_Xjd
;
static
AbstractBills
bill
;
...
...
@@ -72,7 +72,7 @@ public class RepayFinancialAPP {
LOGGER
.
info
(
"======开始处理["
+
path
+
"]目录下面的还款账单======"
);
long
begin
=
System
.
currentTimeMillis
();
RepayHandler
handler
=
getSpringContext
().
getBean
(
RepayHandler
.
class
);
//按照参数,对账
//按照参数,对账
++++++++++
handler
.
repayBillDetailHandler
(
path
,
clazz
,
payType
.
getChannelAccount
(),
currentMonth
);
FinancialRepayDetailService
repayDetailService
=
getSpringContext
().
getBean
(
FinancialRepayDetailService
.
class
);
if
(
Constants
.
result
.
size
()
!=
0
)
{
...
...
src/main/java/cn/gq/financial/app/handler/DifCheckOutHandler.java
View file @
f9d54384
...
...
@@ -45,7 +45,7 @@ public class DifCheckOutHandler {
wrong
.
addAll
(
checkOut
(
bills
.
subList
((
i
*
item_size
),
bills
.
size
())));
}
}
FileUtils
.
writeOutStrsToFile
(
wrong
,
"E:\\
work\\balance\\10\\微信-白条
丢失的.txt"
);
FileUtils
.
writeOutStrsToFile
(
wrong
,
"E:\\
financial-system-data\\yeepay\\baitiao\\易宝
丢失的.txt"
);
}
private
Collection
<?
extends
String
>
checkOut
(
List
<?
extends
Bill
>
bills
)
{
...
...
@@ -68,7 +68,7 @@ public class DifCheckOutHandler {
}
}
else
{
// res.add("订单-->".concat(bill.getOrderId()).concat(" 详细丢失了,交易时间-->").concat(DateFormatUtils.ISO_DATE_FORMAT.format(bill.getTrandingDate())));
res
.
add
(((
WX
Bill
)
bill
).
getSrcStr
());
res
.
add
(((
Yeepay
Bill
)
bill
).
getSrcStr
());
}
});
...
...
src/main/java/cn/gq/financial/bills/AbstractBills.java
View file @
f9d54384
...
...
@@ -194,6 +194,7 @@ public abstract class AbstractBills {
*/
private
void
initBillDates
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
YEAR
,
2016
);
calendar
.
set
(
Calendar
.
MONTH
,
currentMonth
-
1
);
int
totalDays
=
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
for
(
int
i
=
1
;
i
<=
totalDays
;
i
++)
{
...
...
src/main/java/cn/gq/financial/service/BaitiaoOfflineDetailService.java
View file @
f9d54384
...
...
@@ -56,6 +56,9 @@ public class BaitiaoOfflineDetailService implements DetailService {
try
{
OfflineOrderEntityExample
orderExample
=
new
OfflineOrderEntityExample
();
orderExample
.
createCriteria
().
andIdEqualTo
(
Long
.
valueOf
(
entity
.
getMerchantOrderNo
()));
// List<Long> list = new ArrayList<Long>();
//
// orderExample.createCriteria().andIdIn(list);
//.andIsActiveEqualTo(Boolean.FALSE);
OfflineOrderEntity
offlineOrder
=
offlineOrderEntityMapper
.
selectByExample
(
orderExample
).
get
(
0
);
...
...
src/main/java/cn/gq/financial/service/BaitiaoOnlineDetailService.java
View file @
f9d54384
...
...
@@ -252,7 +252,7 @@ public class BaitiaoOnlineDetailService implements DetailService {
List
<
BaitiaoExpEntity
>
list
=
exportExcelMapper
.
baitiaoRepayExport
(
subList
);
baitiaoExpEntities
.
addAll
(
list
);
}
if
(
StringUtils
.
equals
(
BIZ_TYPE_BILL_BAITIAO
,
bizType
))
{
if
(
StringUtils
.
equals
(
BIZ_TYPE_BILL_BAITIAO
,
bizType
)
&&
baitiaoOrderIds
.
size
()
>
0
)
{
List
<
String
>
subList
=
payCenterOrders
.
subList
(
i
*
item_size
,
baitiaoOrderIds
.
size
());
List
<
BaitiaoExpEntity
>
list
=
exportExcelMapper
.
baitiaoBillRepayExport
(
subList
);
baitiaoExpEntities
.
addAll
(
list
);
...
...
src/main/java/cn/gq/financial/service/DetailService.java
View file @
f9d54384
...
...
@@ -12,7 +12,7 @@ public interface DetailService {
static
String
BIZ_TYPE_XYQB
=
"现金贷"
;
static
String
BIZ_TYPE_BAITIAO
=
"线上白条"
;
static
String
BIZ_TYPE_OFFLINE
=
"线下白条"
;
String
BIZ_TYPE_BILL_BAITIAO
=
"帐单白条"
;
static
String
BIZ_TYPE_BILL_BAITIAO
=
"帐单白条"
;
public
List
<
RepayDetailFinancial
>
getDetailByPayCenterRepayOrder
(
List
<
RepayOrderEntity
>
list
);
}
src/main/java/cn/gq/financial/service/XYQBDetailService.java
View file @
f9d54384
...
...
@@ -32,7 +32,7 @@ import cn.gq.financial.utils.HttpUtils;
public
class
XYQBDetailService
implements
DetailService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
XYQBDetailService
.
class
);
static
final
String
url
=
"http://
127.0.0.1
:9004/ex/repayment/loan/detail"
;
static
final
String
url
=
"http://
localhost
:9004/ex/repayment/loan/detail"
;
@Autowired
ExportExcelMapper
exportExcelMapper
;
...
...
src/main/java/cn/gq/financial/utils/BillParsers.java
View file @
f9d54384
...
...
@@ -165,20 +165,21 @@ public class BillParsers {
if
(
contents
==
null
||
contents
.
length
==
0
)
{
throw
new
IllegalArgumentException
(
"Invalid contents: "
+
StringUtils
.
join
(
contents
,
","
));
}
yeepayBill
.
setTrandingDate
(
DateUtils
.
parseDate
(
contents
[
1
],
"yyyy-MM-dd HH:mm:ss.SSS"
));
//yeepayBill.setTrandingDate(DateUtils.parseDate(contents[1], "yyyy-MM-dd HH:mm:ss.SSS"));
yeepayBill
.
setTrandingDate
(
DateUtils
.
parseDate
(
contents
[
1
],
"yyyy-MM-dd HH:mm:ss"
));
yeepayBill
.
setAccountType
(
contents
[
2
]);
yeepayBill
.
setBizType
(
contents
[
3
]);
if
(
StringUtils
.
isNotBlank
(
contents
[
4
]))
{
yeepayBill
.
setOrderId
(
contents
[
4
]);
}
if
(
StringUtils
.
isNotBlank
(
contents
[
5
]))
{
yeepayBill
.
setIncome
(
new
BigDecimal
(
contents
[
5
]));
yeepayBill
.
setIncome
(
new
BigDecimal
(
contents
[
5
]
.
trim
()
));
}
if
(
StringUtils
.
isNotBlank
(
contents
[
6
]))
{
yeepayBill
.
setCost
(
new
BigDecimal
(
contents
[
6
]));
yeepayBill
.
setCost
(
new
BigDecimal
(
contents
[
6
]
.
trim
()
));
}
if
(
StringUtils
.
isNotBlank
(
contents
[
7
]))
{
yeepayBill
.
setPoundage
(
new
BigDecimal
(
contents
[
7
]));
yeepayBill
.
setPoundage
(
new
BigDecimal
(
contents
[
7
]
.
trim
()
));
}
return
yeepayBill
;
}
...
...
src/main/resources/applicationContext.properties
View file @
f9d54384
...
...
@@ -11,11 +11,6 @@ xyqb.jdbc.username=xyqb_query
xyqb.jdbc.password
=
Uiwb@o^fR&nHOa5t
#local
local.jdbc.url
=
jdbc:mysql://127.0.0.1:3306/financial?useUnicode=true&characterEncoding=UTF8
local.jdbc.username
=
root
local.jdbc.password
=
root
#mall
mall.jdbc.url
=
jdbc:mysql://172.16.1.7:3306/mall?useUnicode=true&characterEncoding=UTF8
mall.jdbc.username
=
xyqb_query
...
...
@@ -34,9 +29,9 @@ lkbadmin.jdbc.password=wj0msj8J8/v2Ee6Xl75ZDizrJBdEDOAQGlxTGKbRFng=
#localDB
local.repayment.jdbc.url
=
jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8
local.repayment.jdbc.username
=
root
local.repayment.jdbc.password
=
root
local.repayment.jdbc.password
=
123456
#offlineBaitiao
offlineBaitiao.jdbc.url
=
jdbc:mysql://172.16.1.104:3306/offline?useUnicode=true&characterEncoding=UTF8
offlineBaitiao.jdbc.username
=
dataquery
offlineBaitiao.jdbc.password
=
querydata
\ No newline at end of file
offlineBaitiao.jdbc.url
=
jdbc:mysql://172.16.1.244:33312/offline?useUnicode=true&characterEncoding=UTF8
offlineBaitiao.jdbc.username
=
xyqb_query
offlineBaitiao.jdbc.password
=
Uiwb@o^fR&nHOa5t
\ No newline at end of file
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