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
f63468a6
Commit
f63468a6
authored
Nov 04, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产负债
parent
f5832850
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
355 additions
and
101 deletions
+355
-101
SampleJob.java
...ance-sheet/src/main/java/com/bailuntec/job/SampleJob.java
+0
-30
SampleService.java
...rc/main/java/com/bailuntec/job/service/SampleService.java
+0
-21
pom.xml
datacenter-base/base-sync-cashier/pom.xml
+1
-0
CashierJob.java
...c-cashier/src/main/java/com/bailuntec/job/CashierJob.java
+21
-18
SyncCashierService.java
...in/java/com/bailuntec/job/service/SyncCashierService.java
+18
-17
pom.xml
datacenter-base/base-sync-company/pom.xml
+2
-1
Dockerfile
datacenter-base/base-sync-company/src/main/docker/Dockerfile
+8
-0
SyncCompanyJob.java
...mpany/src/main/java/com/bailuntec/job/SyncCompanyJob.java
+4
-0
pom.xml
datacenter-base/base-sync-fee/pom.xml
+1
-0
Dockerfile
datacenter-base/base-sync-fee/src/main/docker/Dockerfile
+1
-1
pom.xml
datacenter-base/pom.xml
+0
-1
pom.xml
datacenter-finance/finance-balance-sheet/pom.xml
+14
-5
Dockerfile
...-finance/finance-balance-sheet/src/main/docker/Dockerfile
+8
-0
BalanceSheetApp.java
...heet/src/main/java/com/bailuntec/job/BalanceSheetApp.java
+2
-2
BalanceSheetJob.java
...heet/src/main/java/com/bailuntec/job/BalanceSheetJob.java
+124
-0
BalanceSheetService.java
...n/java/com/bailuntec/job/service/BalanceSheetService.java
+0
-0
application-prod.yml
...nce-balance-sheet/src/main/resources/application-prod.yml
+32
-0
application-test.yml
...nce-balance-sheet/src/main/resources/application-test.yml
+31
-0
BalanceSheetServiceTest.java
...va/com/bailuntec/job/service/BalanceSheetServiceTest.java
+59
-0
pom.xml
datacenter-finance/pom.xml
+18
-0
Dockerfile
...mid-calculate-turnover-prepare/src/main/docker/Dockerfile
+1
-1
TurnoverPrepareApp.java
...e/src/main/java/com/bailuntec/job/TurnoverPrepareApp.java
+2
-1
TurnoverPrepareJob.java
...e/src/main/java/com/bailuntec/job/TurnoverPrepareJob.java
+1
-1
application-prod.yml
...-turnover-prepare/src/main/resources/application-prod.yml
+4
-2
application-test.yml
...-turnover-prepare/src/main/resources/application-test.yml
+2
-0
pom.xml
pom.xml
+1
-0
No files found.
datacenter-base/base-sync-balance-sheet/src/main/java/com/bailuntec/job/SampleJob.java
deleted
100644 → 0
View file @
f5832850
package
com
.
bailuntec
.
job
;
import
com.bailuntec.job.service.SampleService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
@Slf4j
@Component
public
class
SampleJob
{
@Resource
SampleService
sampleService
;
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
public
void
baseSyncFinanceFee
()
{
try
{
log
.
info
(
"每分钟同步费用单 开始"
);
sampleService
.
sync
();
log
.
info
(
"每分钟同步费用单 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟同步费用单 异常:"
,
ex
);
}
}
}
datacenter-base/base-sync-balance-sheet/src/main/java/com/bailuntec/job/service/SampleService.java
deleted
100644 → 0
View file @
f5832850
package
com
.
bailuntec
.
job
.
service
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/10/7 11:38 上午
*/
@Slf4j
@Service
public
class
SampleService
{
public
void
sync
()
{
}
}
datacenter-base/base-sync-cashier/pom.xml
View file @
f63468a6
...
...
@@ -15,6 +15,7 @@
<maven.compiler.encoding>
UTF-8
</maven.compiler.encoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven-surefire-plugin.version>
2.18.1
</maven-surefire-plugin.version>
<maven.build.timestamp.format>
yyyyMMddHHmm
</maven.build.timestamp.format>
</properties>
<artifactId>
base-sync-cashier
</artifactId>
...
...
datacenter-base/base-sync-cashier/src/main/java/com/bailuntec/job/CashierJob.java
View file @
f63468a6
...
...
@@ -18,21 +18,21 @@ public class CashierJob {
/**
* 每秒同步流水
*/
@Scheduled
(
cron
=
"0
/5 *
* * * ?"
)
@Scheduled
(
cron
=
"0
0/1
* * * ?"
)
public
void
syncCashier
()
{
try
{
log
.
info
(
"每
秒
同步流水 开始"
);
log
.
info
(
"每
分钟
同步流水 开始"
);
syncCashierService
.
syncCashier
();
log
.
info
(
"每
秒
同步流水 结束"
);
log
.
info
(
"每
分钟
同步流水 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每
秒
同步流水 异常:"
,
ex
);
log
.
error
(
"每
分钟
同步流水 异常:"
,
ex
);
}
}
/**
* 每秒同步流水
*/
@Scheduled
(
cron
=
"0
/5 *
* * * ?"
)
@Scheduled
(
cron
=
"0
0/1
* * * ?"
)
public
void
syncWithdraw
()
{
try
{
log
.
info
(
"每秒同步流水详情 开始"
);
...
...
@@ -46,29 +46,32 @@ public class CashierJob {
/**
* 每
天12点同步销售平台流水
* 每
分钟 同步利息支出
*/
@Scheduled
(
cron
=
"0 0 12 * * ?"
)
public
void
syncSalesPlatform
()
{
syncCashierService
.
syncSalesPlatform
();
}
/**
* 每天9,12点同步利息支出
*/
@Scheduled
(
cron
=
"0 0 9,12 * * ?"
)
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
public
void
syncInterest
()
{
try
{
log
.
info
(
"每分钟 同步利息支出 开始"
);
syncCashierService
.
syncInterest
();
log
.
info
(
"每分钟 同步利息支出 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步利息支出 异常:"
,
ex
);
}
}
/**
* 每
两小时同步财务手续费
* 每
分钟 同步利息支出
*/
@Scheduled
(
cron
=
"0 0
0/2
* * ?"
)
@Scheduled
(
cron
=
"0 0
/1 *
* * ?"
)
public
void
syncHandleFee
()
{
try
{
log
.
info
(
"每分钟 同步流水详情 开始"
);
syncCashierService
.
syncHandleFee
();
log
.
info
(
"每分钟 同步流水详情 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步流水详情 异常:"
,
ex
);
}
}
}
datacenter-base/base-sync-cashier/src/main/java/com/bailuntec/job/service/SyncCashierService.java
View file @
f63468a6
...
...
@@ -3,16 +3,15 @@ package com.bailuntec.job.service;
import
com.bailuntec.api.bailuntec.cw.CwApi
;
import
com.bailuntec.api.bailuntec.cw.response.GetCashiersResp
;
import
com.bailuntec.api.bailuntec.cw.response.GetHandleFeeTradeRecordsResp
;
import
com.bailuntec.api.bailuntec.cw.response.GetRepayPlanDetailsResp
;
import
com.bailuntec.api.bailuntec.cw.response.GetWithdrawDetailPagesResp
;
import
com.bailuntec.application.IDcBaseFinanceCashierService
;
import
com.bailuntec.application.IDcBaseFinanceCashierdetailService
;
import
com.bailuntec.application.IDcBaseFinanceHandlefeeService
;
import
com.bailuntec.application.IDcBaseFinanceInterestService
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.ListUtil
;
import
com.bailuntec.domain.DcBaseFinanceCashier
;
import
com.bailuntec.domain.DcBaseFinanceCashierdetail
;
import
com.bailuntec.domain.DcBaseFinanceHandlefee
;
import
com.bailuntec.domain.DcJobConfig
;
import
com.bailuntec.domain.*
;
import
com.bailuntec.infrastructure.mapper.DcJobConfigMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -114,33 +113,35 @@ public class SyncCashierService {
dcJobConfigMapper
.
updateById
(
dcJobConfig
.
refresh
());
}
@Transactional
public
void
syncSalesPlatform
()
{
}
@Resource
IDcBaseFinanceInterestService
dcBaseFinanceInterestService
;
@Transactional
public
void
syncInterest
()
{
DcJobConfig
dcJobConfig
=
dcJobConfigMapper
.
selectByName
(
baseSyncInterest
);
log
.
info
(
"请求
财务手续费
接口 开始"
);
List
<
Get
HandleFeeTradeRecordsResp
>
resp
=
cwApi
.
getHandleFeeTradeRecord
s
(
dcJobConfig
.
getStartTimeStr
(),
dcJobConfig
.
getEndTimeStr
());
log
.
info
(
"请求
利息支出接口同步百伦
接口 开始"
);
List
<
Get
RepayPlanDetailsResp
>
resp
=
cwApi
.
getRepayPlanDetail
s
(
dcJobConfig
.
getStartTimeStr
(),
dcJobConfig
.
getEndTimeStr
());
resp
.
forEach
(
getHandleFeeTradeRecordsResp
->
{
DcBaseFinanceHandlefee
dcBaseFinanceHandlefee
=
new
DcBaseFinanceHandlefee
();
BeanUtils
.
copyProperties
(
getHandleFeeTradeRecordsResp
,
dcBaseFinanceHandlefee
);
DcBaseFinanceInterest
dcBaseFinanceInterest
=
new
DcBaseFinanceInterest
();
BeanUtils
.
copyProperties
(
getHandleFeeTradeRecordsResp
,
dcBaseFinanceInterest
,
"id"
);
LambdaQueryWrapper
<
DcBaseFinanceInterest
>
updateWrapper
=
new
LambdaQueryWrapper
<
DcBaseFinanceInterest
>()
.
eq
(
DcBaseFinanceInterest:
:
getBorrowId
,
dcBaseFinanceInterest
.
getBorrowId
())
.
eq
(
DcBaseFinanceInterest:
:
getRepayId
,
dcBaseFinanceInterest
.
getRepayId
())
.
eq
(
DcBaseFinanceInterest:
:
getContractNo
,
dcBaseFinanceInterest
.
getContractNo
());
LambdaQueryWrapper
<
DcBaseFinanceHandlefee
>
updateWrapper
=
new
LambdaQueryWrapper
<
DcBaseFinanceHandlefee
>()
.
eq
(
DcBaseFinanceHandlefee:
:
getCwId
,
dcBaseFinanceHandlefee
.
getCwId
());
//更新失败就插入
if
(
dcBaseFinance
HandlefeeService
.
saveOrUpdate
(
dcBaseFinanceHandlefee
,
updateWrapper
))
{
log
.
info
(
"同步一
条财务手续费,财务id:{}"
,
dcBaseFinanceHandlefee
.
getC
wId
());
if
(
dcBaseFinance
InterestService
.
saveOrUpdate
(
dcBaseFinanceInterest
,
updateWrapper
))
{
log
.
info
(
"同步一
利息支出,borrow id:{}"
,
dcBaseFinanceInterest
.
getBorro
wId
());
}
else
{
log
.
error
(
"同步
财务手续费,财务id:{}"
,
dcBaseFinanceHandlefee
.
getC
wId
());
log
.
error
(
"同步
利息支出,borrow id :{}"
,
dcBaseFinanceInterest
.
getBorro
wId
());
}
});
log
.
info
(
"请求
财务手续费
接口 结束"
);
log
.
info
(
"请求
利息支出接口同步百伦
接口 结束"
);
dcJobConfigMapper
.
updateById
(
dcJobConfig
.
refresh
());
}
...
...
datacenter-base/base-sync-company/pom.xml
View file @
f63468a6
...
...
@@ -27,7 +27,7 @@
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.3.3.RELEASE
</version>
<configuration>
<mainClass>
com.bailuntec.job.S
ample
App
</mainClass>
<mainClass>
com.bailuntec.job.S
yncCompany
App
</mainClass>
</configuration>
<executions>
<execution>
...
...
@@ -60,6 +60,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.5.1
</version>
<configuration>
<source>
8
</source>
<target>
8
</target>
...
...
datacenter-base/base-sync-company/src/main/docker/Dockerfile
0 → 100644
View file @
f63468a6
FROM
openjdk:8-jdk-alpine
VOLUME
/tmp
ADD
base-sync-company-1.0-SNAPSHOT.jar app.jar
RUN
echo
"Asia/Shanghai"
>
/etc/timezone
ENTRYPOINT
["java","-Xms100m","-Xmx300m","-jar","-Dspring.profiles.active=prod","/app.jar"]
EXPOSE
8080
datacenter-base/base-sync-company/src/main/java/com/bailuntec/job/SyncCompanyJob.java
View file @
f63468a6
...
...
@@ -5,8 +5,10 @@ import com.bailuntec.job.service.CompanyService;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.text.ParseException
;
@Slf4j
@Component
...
...
@@ -27,4 +29,6 @@ public class SyncCompanyJob {
}
}
datacenter-base/base-sync-fee/pom.xml
View file @
f63468a6
...
...
@@ -15,6 +15,7 @@
<maven.compiler.encoding>
UTF-8
</maven.compiler.encoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven-surefire-plugin.version>
2.18.1
</maven-surefire-plugin.version>
<maven.build.timestamp.format>
yyyyMMddHHmm
</maven.build.timestamp.format>
</properties>
<artifactId>
base-sync-fee
</artifactId>
...
...
datacenter-base/base-sync-fee/src/main/docker/Dockerfile
View file @
f63468a6
FROM
openjdk:8-jdk-alpine
VOLUME
/tmp
ADD
base-sync-
cashier
-1.0-SNAPSHOT.jar app.jar
ADD
base-sync-
fee
-1.0-SNAPSHOT.jar app.jar
RUN
echo
"Asia/Shanghai"
>
/etc/timezone
...
...
datacenter-base/pom.xml
View file @
f63468a6
...
...
@@ -18,7 +18,6 @@
<module>
base-sync-amazon-ad
</module>
<module>
base-sync-cashier
</module>
<module>
base-sync-fee
</module>
<module>
base-sync-balance-sheet
</module>
<module>
base-sync-sample
</module>
<module>
base-sync-company
</module>
</modules>
...
...
datacenter-
base/base-sync
-balance-sheet/pom.xml
→
datacenter-
finance/finance
-balance-sheet/pom.xml
View file @
f63468a6
...
...
@@ -3,22 +3,23 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
datacenter-
bas
e
</artifactId>
<artifactId>
datacenter-
financ
e
</artifactId>
<groupId>
com.bailuntec
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
finance-balance-sheet
</artifactId>
<properties>
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.encoding>
UTF-8
</maven.compiler.encoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven-surefire-plugin.version>
2.18.1
</maven-surefire-plugin.version>
<maven.build.timestamp.format>
yyyyMMddHHmm
</maven.build.timestamp.format>
<skipTests>
true
</skipTests>
</properties>
<artifactId>
base-sync-balance-sheet
</artifactId>
<build>
<plugins>
...
...
@@ -44,7 +45,7 @@
<version>
1.0.0
</version>
<configuration>
<skipDockerBuild>
false
</skipDockerBuild>
<imageName>
ccr.ccs.tencentyun.com/blt.data.job/base-
sync
-balance-sheet:${maven.build.timestamp}
<imageName>
ccr.ccs.tencentyun.com/blt.data.job/base-
finance
-balance-sheet:${maven.build.timestamp}
</imageName>
<dockerDirectory>
src/main/docker
</dockerDirectory>
<resources>
...
...
@@ -57,8 +58,16 @@
<serverId>
bailuntec-docker
</serverId>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.5.1
</version>
<configuration>
<source>
8
</source>
<target>
8
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
datacenter-finance/finance-balance-sheet/src/main/docker/Dockerfile
0 → 100644
View file @
f63468a6
FROM
openjdk:8-jdk-alpine
VOLUME
/tmp
ADD
finance-balance-sheet-1.0-SNAPSHOT.jar app.jar
RUN
echo
"Asia/Shanghai"
>
/etc/timezone
ENTRYPOINT
["java","-Xms100m","-Xmx300m","-jar","-Dspring.profiles.active=prod","/app.jar"]
EXPOSE
8080
datacenter-
base/base-sync
-balance-sheet/src/main/java/com/bailuntec/job/BalanceSheetApp.java
→
datacenter-
finance/finance
-balance-sheet/src/main/java/com/bailuntec/job/BalanceSheetApp.java
View file @
f63468a6
...
...
@@ -12,15 +12,15 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* </p>
*
* @author robbendev
* @since 2020/10/28 3:1
5
下午
* @since 2020/10/28 3:1
6
下午
*/
@SpringBootApplication
@EnableScheduling
@ComponentScan
(
"com.bailuntec"
)
@EnableFeignClients
(
basePackages
=
{
"com.bailuntec.api"
,
"com.bailuntec.*.api"
})
public
class
BalanceSheetApp
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
BalanceSheetApp
.
class
,
args
);
}
}
datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/job/BalanceSheetJob.java
0 → 100644
View file @
f63468a6
package
com
.
bailuntec
.
job
;
import
com.bailuntec.job.service.BalanceSheetService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
@Slf4j
@Component
public
class
BalanceSheetJob
{
@Resource
BalanceSheetService
balanceSheetService
;
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
syncBankAccount
()
{
try
{
log
.
info
(
"每分钟同步 银行帐号信息 开始"
);
balanceSheetService
.
syncBankAccount
();
log
.
info
(
"每分钟同步 银行帐号信息 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟同步 银行帐号信息 异常:"
,
ex
);
}
}
/**
* 同步提现在途
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
syncWithdrawOnWaySummary
()
{
try
{
log
.
info
(
"每分钟 同步提现在途 开始"
);
balanceSheetService
.
syncWithdrawOnWaySummary
();
log
.
info
(
"每分钟 同步提现在途 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步提现在途 异常:"
,
ex
);
}
}
/**
* 同步提现在途
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
syncPayPal
()
{
try
{
log
.
info
(
"每分钟 同步第三方余额 开始"
);
balanceSheetService
.
syncPayPal
();
log
.
info
(
"每分钟 同步第三方余额 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步第三方余额 异常:"
,
ex
);
}
}
/**
* 同步短期借款余额
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
syncShortBorrowBalance
()
{
try
{
log
.
info
(
"每分钟 同步提现在途 开始"
);
balanceSheetService
.
syncShortBorrowBalance
();
log
.
info
(
"每分钟 同步提现在途 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步提现在途 异常:"
,
ex
);
}
}
/**
* 同步数据中心需要的费用单
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
syncCost
()
{
try
{
log
.
info
(
"每分钟 同步数据中心需要的费用单 开始"
);
balanceSheetService
.
syncCost
();
log
.
info
(
"每分钟 同步数据中心需要的费用单 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步数据中心需要的费用单 异常:"
,
ex
);
}
}
/**
* 同步费用系统采购单:固定资产
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
syncBuy
()
{
try
{
log
.
info
(
"每分钟 同步费用系统采购单 开始"
);
balanceSheetService
.
syncBuy
();
log
.
info
(
"每分钟 同步费用系统采购单 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 同步费用系统采购单 异常:"
,
ex
);
}
}
/**
* 每天 生成资产负债表
* companyValue 0
* companyName 百伦供应链
* <p>
* {@link}
* </p>
* 数据来源
*/
@Scheduled
(
cron
=
"0 0/2 * * * ?"
)
public
void
generateBalanceSheet
()
{
try
{
log
.
info
(
"每分钟 生成资产负债表 开始"
);
balanceSheetService
.
generateBalanceSheet
();
log
.
info
(
"每分钟 生成资产负债表 结束"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"每分钟 生成资产负债表 异常:"
,
ex
);
}
}
}
datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/job/service/BalanceSheetService.java
0 → 100644
View file @
f63468a6
This diff is collapsed.
Click to expand it.
datacenter-finance/finance-balance-sheet/src/main/resources/application-prod.yml
0 → 100644
View file @
f63468a6
spring
:
# 服务名称
application
:
name
:
base-sync-sample
# 数据配置
datasource
:
url
:
jdbc:mysql://10.0.8.15:3306/bailun_datacenter?serverTimezone=GMT%2B8&characterEncoding=utf-8
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
mybatis-plus
:
mapper-locations
:
-
classpath*:com/bailuntec/mapper/*.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
feign
:
hystrix
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
30000
readTimeout
:
30000
server
:
port
:
8080
datacenter-finance/finance-balance-sheet/src/main/resources/application-test.yml
0 → 100644
View file @
f63468a6
spring
:
# 服务名称
application
:
name
:
base-sync-sample
# 数据配置
datasource
:
url
:
jdbc:mysql://gz-cdb-kp7s5i79.sql.tencentcdb.com:61691/bailun_datacenter?serverTimezone=GMT%2B8&characterEncoding=utf-8
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
mybatis-plus
:
mapper-locations
:
-
classpath*:com/bailuntec/mapper/*.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
feign
:
hystrix
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
30000
readTimeout
:
30000
server
:
port
:
1226
datacenter-finance/finance-balance-sheet/src/test/java/com/bailuntec/job/service/BalanceSheetServiceTest.java
0 → 100644
View file @
f63468a6
package
com
.
bailuntec
.
job
.
service
;
import
com.bailuntec.job.BalanceSheetApp
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.text.ParseException
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/3 5:10 下午
*/
@ActiveProfiles
(
"test"
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
BalanceSheetApp
.
class
)
public
class
BalanceSheetServiceTest
{
@Autowired
private
BalanceSheetService
balanceSheetService
;
@Test
public
void
syncBankAccount
()
{
balanceSheetService
.
syncBankAccount
();
}
@Test
public
void
syncWithdrawOnWaySummary
()
{
balanceSheetService
.
syncWithdrawOnWaySummary
();
}
@Test
public
void
syncShortBorrowBalance
()
{
balanceSheetService
.
syncShortBorrowBalance
();
}
@Test
public
void
syncCost
()
{
balanceSheetService
.
syncCost
();
}
@Test
public
void
syncBuy
()
throws
ParseException
{
balanceSheetService
.
syncBuy
();
}
@Test
public
void
generateBalanceSheet
()
{
balanceSheetService
.
generateBalanceSheet
();
}
}
datacenter-finance/pom.xml
0 → 100644
View file @
f63468a6
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
bailuntec-datacenter-job
</artifactId>
<groupId>
com.bailuntec
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
datacenter-finance
</artifactId>
<packaging>
pom
</packaging>
<modules>
<module>
finance-balance-sheet
</module>
</modules>
</project>
datacenter-mid/mid-calculate-turnover-prepare/src/main/docker/Dockerfile
View file @
f63468a6
...
...
@@ -4,5 +4,5 @@ ADD mid-calculate-turnover-prepare-1.0-SNAPSHOT.jar app.jar
RUN
echo
"Asia/Shanghai"
>
/etc/timezone
ENTRYPOINT
["java","-Xms
50m","-Xmx15
0m","-jar","-Dspring.profiles.active=prod","/app.jar"]
ENTRYPOINT
["java","-Xms
100m","-Xmx30
0m","-jar","-Dspring.profiles.active=prod","/app.jar"]
EXPOSE
8080
datacenter-mid/mid-calculate-turnover-prepare/src/main/java/com/bailuntec/job/TurnoverPrepareApp.java
View file @
f63468a6
...
...
@@ -3,6 +3,7 @@ package com.bailuntec.job;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
...
...
@@ -18,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
@ComponentScan
(
"com.bailuntec"
)
@
MapperScan
(
"com.bailuntec"
)
@
EnableFeignClients
(
basePackages
=
{
"com.bailuntec.api"
,
"com.bailuntec.*.api"
}
)
public
class
TurnoverPrepareApp
{
public
static
void
main
(
String
[]
args
)
{
...
...
datacenter-mid/mid-calculate-turnover-prepare/src/main/java/com/bailuntec/job/TurnoverPrepareJob.java
View file @
f63468a6
...
...
@@ -25,7 +25,7 @@ public class TurnoverPrepareJob {
* 到库存表
* </p>
*/
@Scheduled
(
cron
=
"0 0/1
0
* * * ? "
)
@Scheduled
(
cron
=
"0 0/1 * * * ? "
)
public
void
syncBaseStock
()
{
try
{
log
.
info
(
"每10分钟同步oms、在途、采购存在sku但环球库存不存在的库存到库存表 开始"
);
...
...
datacenter-mid/mid-calculate-turnover-prepare/src/main/resources/application-prod.yml
View file @
f63468a6
...
...
@@ -8,13 +8,15 @@ spring:
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
mybatis-plus
:
mapper-locations
:
-
classpath*:com/bailuntec/mapper/*.xml
configuration
:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
#
configuration:
#
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
feign
:
hystrix
:
...
...
datacenter-mid/mid-calculate-turnover-prepare/src/main/resources/application-test.yml
View file @
f63468a6
...
...
@@ -8,6 +8,8 @@ spring:
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
...
...
pom.xml
View file @
f63468a6
...
...
@@ -19,6 +19,7 @@
<module>
datacenter-base
</module>
<module>
datacenter-mid
</module>
<module>
datacenter-show
</module>
<module>
datacenter-finance
</module>
</modules>
...
...
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