Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-datacenter
Overview
Overview
Details
Activity
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
huluobin
bailuntec-datacenter
Commits
bb3d571c
Commit
bb3d571c
authored
Nov 25, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e1419cd8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
15 deletions
+58
-15
BalanceSheetController.java
...java/com/bailuntec/interfaces/BalanceSheetController.java
+25
-1
BalanceSheetJob.java
...heet/src/main/java/com/bailuntec/job/BalanceSheetJob.java
+10
-10
BalanceSheetService.java
...n/java/com/bailuntec/job/service/BalanceSheetService.java
+0
-0
BalanceSheetServiceTest.java
...va/com/bailuntec/job/service/BalanceSheetServiceTest.java
+23
-4
No files found.
datacenter-job/datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/interfaces/BalanceSheetController.java
View file @
bb3d571c
...
@@ -7,9 +7,12 @@ import com.bailuntec.job.service.BalanceSheetService;
...
@@ -7,9 +7,12 @@ import com.bailuntec.job.service.BalanceSheetService;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
...
@@ -22,7 +25,28 @@ public class BalanceSheetController {
...
@@ -22,7 +25,28 @@ public class BalanceSheetController {
@GetMapping
(
"/generate"
)
@GetMapping
(
"/generate"
)
public
String
doScheduledTask
(){
public
String
doScheduledTask
(){
try
{
try
{
balanceSheetService
.
generateBalanceSheet
();
balanceSheetService
.
generateBalanceSheet
(
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
">>>>>生成资产负债表出错"
+
e
.
getMessage
());
return
"生成资产负债表出错"
;
}
return
"生成资产负债表成功"
;
}
@PostMapping
(
"/reload"
)
public
String
reload
(
@RequestParam
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
)
LocalDate
localDate
){
try
{
LocalDateTime
localDateTime
=
localDate
.
atTime
(
23
,
59
,
59
);
balanceSheetService
.
syncBankAccount
(
localDate
);
balanceSheetService
.
syncWithdrawOnWaySummary
(
localDate
);
balanceSheetService
.
syncPayPal
(
localDateTime
);
balanceSheetService
.
syncShortBorrowBalance
(
localDate
);
balanceSheetService
.
syncCost
(
localDate
);
balanceSheetService
.
syncBuy
(
localDate
);
balanceSheetService
.
syncSemiInventoryBalance
(
localDate
);
balanceSheetService
.
generateBalanceSheet
(
localDate
);
balanceSheetService
.
getSupplierTransaction
(
localDate
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
">>>>>生成资产负债表出错"
+
e
.
getMessage
());
logger
.
error
(
">>>>>生成资产负债表出错"
+
e
.
getMessage
());
...
...
datacenter-job/datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/job/BalanceSheetJob.java
View file @
bb3d571c
...
@@ -20,7 +20,7 @@ public class BalanceSheetJob {
...
@@ -20,7 +20,7 @@ public class BalanceSheetJob {
public
void
syncBankAccount
()
{
public
void
syncBankAccount
()
{
try
{
try
{
log
.
info
(
"每天1点同步 银行帐号信息 开始"
);
log
.
info
(
"每天1点同步 银行帐号信息 开始"
);
balanceSheetService
.
syncBankAccount
();
balanceSheetService
.
syncBankAccount
(
null
);
log
.
info
(
"每天1点同步 银行帐号信息 结束"
);
log
.
info
(
"每天1点同步 银行帐号信息 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点同步 银行帐号信息 异常:"
,
ex
);
log
.
error
(
"每天1点同步 银行帐号信息 异常:"
,
ex
);
...
@@ -34,7 +34,7 @@ public class BalanceSheetJob {
...
@@ -34,7 +34,7 @@ public class BalanceSheetJob {
public
void
syncWithdrawOnWaySummary
()
{
public
void
syncWithdrawOnWaySummary
()
{
try
{
try
{
log
.
info
(
"每天1点 同步提现在途 开始"
);
log
.
info
(
"每天1点 同步提现在途 开始"
);
balanceSheetService
.
syncWithdrawOnWaySummary
();
balanceSheetService
.
syncWithdrawOnWaySummary
(
null
);
log
.
info
(
"每天1点 同步提现在途 结束"
);
log
.
info
(
"每天1点 同步提现在途 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点 同步提现在途 异常:"
,
ex
);
log
.
error
(
"每天1点 同步提现在途 异常:"
,
ex
);
...
@@ -48,7 +48,7 @@ public class BalanceSheetJob {
...
@@ -48,7 +48,7 @@ public class BalanceSheetJob {
public
void
syncPayPal
()
{
public
void
syncPayPal
()
{
try
{
try
{
log
.
info
(
"每天1点 同步第三方余额 开始"
);
log
.
info
(
"每天1点 同步第三方余额 开始"
);
balanceSheetService
.
syncPayPal
();
balanceSheetService
.
syncPayPal
(
null
);
log
.
info
(
"每天1点 同步第三方余额 结束"
);
log
.
info
(
"每天1点 同步第三方余额 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点 同步第三方余额 异常:"
,
ex
);
log
.
error
(
"每天1点 同步第三方余额 异常:"
,
ex
);
...
@@ -64,7 +64,7 @@ public class BalanceSheetJob {
...
@@ -64,7 +64,7 @@ public class BalanceSheetJob {
public
void
syncShortBorrowBalance
()
{
public
void
syncShortBorrowBalance
()
{
try
{
try
{
log
.
info
(
"每天1点 同步提现在途 开始"
);
log
.
info
(
"每天1点 同步提现在途 开始"
);
balanceSheetService
.
syncShortBorrowBalance
();
balanceSheetService
.
syncShortBorrowBalance
(
null
);
log
.
info
(
"每天1点 同步提现在途 结束"
);
log
.
info
(
"每天1点 同步提现在途 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点 同步提现在途 异常:"
,
ex
);
log
.
error
(
"每天1点 同步提现在途 异常:"
,
ex
);
...
@@ -78,7 +78,7 @@ public class BalanceSheetJob {
...
@@ -78,7 +78,7 @@ public class BalanceSheetJob {
public
void
syncCost
()
{
public
void
syncCost
()
{
try
{
try
{
log
.
info
(
"每天1点 同步数据中心需要的费用单 开始"
);
log
.
info
(
"每天1点 同步数据中心需要的费用单 开始"
);
balanceSheetService
.
syncCost
();
balanceSheetService
.
syncCost
(
null
);
log
.
info
(
"每天1点 同步数据中心需要的费用单 结束"
);
log
.
info
(
"每天1点 同步数据中心需要的费用单 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点 同步数据中心需要的费用单 异常:"
,
ex
);
log
.
error
(
"每天1点 同步数据中心需要的费用单 异常:"
,
ex
);
...
@@ -93,7 +93,7 @@ public class BalanceSheetJob {
...
@@ -93,7 +93,7 @@ public class BalanceSheetJob {
public
void
syncBuy
()
{
public
void
syncBuy
()
{
try
{
try
{
log
.
info
(
"每天1点 同步费用系统采购单 开始"
);
log
.
info
(
"每天1点 同步费用系统采购单 开始"
);
balanceSheetService
.
syncBuy
();
balanceSheetService
.
syncBuy
(
null
);
log
.
info
(
"每天1点 同步费用系统采购单 结束"
);
log
.
info
(
"每天1点 同步费用系统采购单 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天1点 同步费用系统采购单 异常:"
,
ex
);
log
.
error
(
"每天1点 同步费用系统采购单 异常:"
,
ex
);
...
@@ -109,7 +109,7 @@ public class BalanceSheetJob {
...
@@ -109,7 +109,7 @@ public class BalanceSheetJob {
public
void
syncSemiInventoryBalance
()
{
public
void
syncSemiInventoryBalance
()
{
try
{
try
{
log
.
info
(
"每天 生成半成品数据 开始"
);
log
.
info
(
"每天 生成半成品数据 开始"
);
balanceSheetService
.
syncSemiInventoryBalance
();
balanceSheetService
.
syncSemiInventoryBalance
(
null
);
log
.
info
(
"每天 生成半成品数据 结束"
);
log
.
info
(
"每天 生成半成品数据 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天 生成半成品数据 异常:"
,
ex
);
log
.
error
(
"每天 生成半成品数据 异常:"
,
ex
);
...
@@ -143,7 +143,7 @@ public class BalanceSheetJob {
...
@@ -143,7 +143,7 @@ public class BalanceSheetJob {
public
void
generateBalanceSheet
()
{
public
void
generateBalanceSheet
()
{
try
{
try
{
log
.
info
(
"每天3点 生成资产负债表 开始"
);
log
.
info
(
"每天3点 生成资产负债表 开始"
);
balanceSheetService
.
generateBalanceSheet
();
balanceSheetService
.
generateBalanceSheet
(
null
);
log
.
info
(
"每天3点 生成资产负债表 结束"
);
log
.
info
(
"每天3点 生成资产负债表 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天3点 生成资产负债表 异常:"
,
ex
);
log
.
error
(
"每天3点 生成资产负债表 异常:"
,
ex
);
...
@@ -154,7 +154,7 @@ public class BalanceSheetJob {
...
@@ -154,7 +154,7 @@ public class BalanceSheetJob {
public
void
getSupplierTransaction
()
{
public
void
getSupplierTransaction
()
{
try
{
try
{
log
.
info
(
"每天4点 取供应商往来数据:应付账款和预付账款 开始"
);
//
log
.
info
(
"每天4点 取供应商往来数据:应付账款和预付账款 开始"
);
//
balanceSheetService
.
getSupplierTransaction
();
balanceSheetService
.
getSupplierTransaction
(
null
);
log
.
info
(
"每天4点 取供应商往来数据:应付账款和预付账款 结束"
);
log
.
info
(
"每天4点 取供应商往来数据:应付账款和预付账款 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天4点 取供应商往来数据:应付账款和预付账款 异常:"
,
ex
);
log
.
error
(
"每天4点 取供应商往来数据:应付账款和预付账款 异常:"
,
ex
);
...
@@ -174,7 +174,7 @@ public class BalanceSheetJob {
...
@@ -174,7 +174,7 @@ public class BalanceSheetJob {
public
void
generateBalanceSheetNewResult
()
{
public
void
generateBalanceSheetNewResult
()
{
try
{
try
{
log
.
info
(
"每天7点 生成新资产负债结果表 开始"
);
log
.
info
(
"每天7点 生成新资产负债结果表 开始"
);
balanceSheetService
.
generateBalanceSheetNewResult
();
balanceSheetService
.
generateBalanceSheetNewResult
(
null
);
log
.
info
(
"每天7点 生成新资产负债结果表 结束"
);
log
.
info
(
"每天7点 生成新资产负债结果表 结束"
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
error
(
"每天7点 生成新资产负债结果表 异常:"
,
ex
);
log
.
error
(
"每天7点 生成新资产负债结果表 异常:"
,
ex
);
...
...
datacenter-job/datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/job/service/BalanceSheetService.java
View file @
bb3d571c
This diff is collapsed.
Click to expand it.
datacenter-job/datacenter-finance/finance-balance-sheet/src/test/java/com/bailuntec/job/service/BalanceSheetServiceTest.java
View file @
bb3d571c
...
@@ -6,13 +6,14 @@ import com.bailuntec.infrastructure.mapper.DcJobConfigMapper;
...
@@ -6,13 +6,14 @@ import com.bailuntec.infrastructure.mapper.DcJobConfigMapper;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.annotation.Rollback
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -37,10 +38,10 @@ public class BalanceSheetServiceTest {
...
@@ -37,10 +38,10 @@ public class BalanceSheetServiceTest {
@Test
@Test
public
void
syncBankAccount
()
{
public
void
syncBankAccount
()
{
balanceSheetService
.
syncBankAccount
();
//
balanceSheetService.syncBankAccount();
}
}
@Test
/*
@Test
public void syncWithdrawOnWaySummary() {
public void syncWithdrawOnWaySummary() {
balanceSheetService.syncWithdrawOnWaySummary();
balanceSheetService.syncWithdrawOnWaySummary();
}
}
...
@@ -73,9 +74,27 @@ public class BalanceSheetServiceTest {
...
@@ -73,9 +74,27 @@ public class BalanceSheetServiceTest {
@Test
@Test
@Rollback(value = false)
@Rollback(value = false)
public void generateBalanceSheet() {
public void generateBalanceSheet() {
balanceSheetService
.
ge
nerateBalanceSheet
();
balanceSheetService.ge
tSupplierTransaction
();
//LocalDate date = LocalDate.now().minusDays(1);
//LocalDate date = LocalDate.now().minusDays(1);
//balanceSheetService.getSupplierTransaction();
//balanceSheetService.getSupplierTransaction();
}*/
@Test
public
void
balanceSheetTest
()
throws
ParseException
{
for
(
long
minus
=
4
;
minus
>
1
;
minus
--)
{
//long minus = 5;
LocalDate
localDate
=
LocalDate
.
now
().
minusDays
(
minus
);
LocalDateTime
localDateTime
=
LocalDateTime
.
now
().
minusDays
(
minus
);
balanceSheetService
.
syncBankAccount
(
localDate
);
balanceSheetService
.
syncWithdrawOnWaySummary
(
localDate
);
balanceSheetService
.
syncPayPal
(
localDateTime
);
balanceSheetService
.
syncShortBorrowBalance
(
localDate
);
balanceSheetService
.
syncCost
(
localDate
);
balanceSheetService
.
syncBuy
(
localDate
);
balanceSheetService
.
syncSemiInventoryBalance
(
localDate
);
balanceSheetService
.
generateBalanceSheet
(
localDate
);
balanceSheetService
.
getSupplierTransaction
(
localDate
);
}
}
}
@Test
@Test
...
...
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