Commit f63468a6 by huluobin

资产负债

parent 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);
}
}
}
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() {
}
}
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<maven.compiler.encoding>UTF-8</maven.compiler.encoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
</properties> </properties>
<artifactId>base-sync-cashier</artifactId> <artifactId>base-sync-cashier</artifactId>
......
...@@ -18,21 +18,21 @@ public class CashierJob { ...@@ -18,21 +18,21 @@ public class CashierJob {
/** /**
* 每秒同步流水 * 每秒同步流水
*/ */
@Scheduled(cron = "0/5 * * * * ?") @Scheduled(cron = "0 0/1 * * * ?")
public void syncCashier() { public void syncCashier() {
try { try {
log.info("每秒同步流水 开始"); log.info("每分钟 同步流水 开始");
syncCashierService.syncCashier(); syncCashierService.syncCashier();
log.info("每秒同步流水 结束"); log.info("每分钟 同步流水 结束");
} catch (Exception ex) { } catch (Exception ex) {
log.error("每秒同步流水 异常:", ex); log.error("每分钟 同步流水 异常:", ex);
} }
} }
/** /**
* 每秒同步流水 * 每秒同步流水
*/ */
@Scheduled(cron = "0/5 * * * * ?") @Scheduled(cron = "0 0/1 * * * ?")
public void syncWithdraw() { public void syncWithdraw() {
try { try {
log.info("每秒同步流水详情 开始"); log.info("每秒同步流水详情 开始");
...@@ -46,29 +46,32 @@ public class CashierJob { ...@@ -46,29 +46,32 @@ public class CashierJob {
/** /**
* 每天12点同步销售平台流水 * 每分钟 同步利息支出
*/ */
@Scheduled(cron = "0 0 12 * * ?") @Scheduled(cron = "0 0/1 * * * ?")
public void syncSalesPlatform() {
syncCashierService.syncSalesPlatform();
}
/**
* 每天9,12点同步利息支出
*/
@Scheduled(cron = "0 0 9,12 * * ?")
public void syncInterest() { public void syncInterest() {
syncCashierService.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() { public void syncHandleFee() {
syncCashierService.syncHandleFee(); try {
log.info("每分钟 同步流水详情 开始");
syncCashierService.syncHandleFee();
log.info("每分钟 同步流水详情 结束");
} catch (Exception ex) {
log.error("每分钟 同步流水详情 异常:", ex);
}
} }
} }
...@@ -3,16 +3,15 @@ package com.bailuntec.job.service; ...@@ -3,16 +3,15 @@ package com.bailuntec.job.service;
import com.bailuntec.api.bailuntec.cw.CwApi; import com.bailuntec.api.bailuntec.cw.CwApi;
import com.bailuntec.api.bailuntec.cw.response.GetCashiersResp; import com.bailuntec.api.bailuntec.cw.response.GetCashiersResp;
import com.bailuntec.api.bailuntec.cw.response.GetHandleFeeTradeRecordsResp; 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.api.bailuntec.cw.response.GetWithdrawDetailPagesResp;
import com.bailuntec.application.IDcBaseFinanceCashierService; import com.bailuntec.application.IDcBaseFinanceCashierService;
import com.bailuntec.application.IDcBaseFinanceCashierdetailService; import com.bailuntec.application.IDcBaseFinanceCashierdetailService;
import com.bailuntec.application.IDcBaseFinanceHandlefeeService; import com.bailuntec.application.IDcBaseFinanceHandlefeeService;
import com.bailuntec.application.IDcBaseFinanceInterestService;
import com.bailuntec.common.BeanUtils; import com.bailuntec.common.BeanUtils;
import com.bailuntec.common.ListUtil; import com.bailuntec.common.ListUtil;
import com.bailuntec.domain.DcBaseFinanceCashier; import com.bailuntec.domain.*;
import com.bailuntec.domain.DcBaseFinanceCashierdetail;
import com.bailuntec.domain.DcBaseFinanceHandlefee;
import com.bailuntec.domain.DcJobConfig;
import com.bailuntec.infrastructure.mapper.DcJobConfigMapper; import com.bailuntec.infrastructure.mapper.DcJobConfigMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -114,33 +113,35 @@ public class SyncCashierService { ...@@ -114,33 +113,35 @@ public class SyncCashierService {
dcJobConfigMapper.updateById(dcJobConfig.refresh()); dcJobConfigMapper.updateById(dcJobConfig.refresh());
} }
@Transactional @Resource
public void syncSalesPlatform() { IDcBaseFinanceInterestService dcBaseFinanceInterestService;
}
@Transactional @Transactional
public void syncInterest() { public void syncInterest() {
DcJobConfig dcJobConfig = dcJobConfigMapper.selectByName(baseSyncInterest); DcJobConfig dcJobConfig = dcJobConfigMapper.selectByName(baseSyncInterest);
log.info("请求财务手续费接口 开始"); log.info("请求利息支出接口同步百伦接口 开始");
List<GetHandleFeeTradeRecordsResp> resp = cwApi.getHandleFeeTradeRecords(dcJobConfig.getStartTimeStr(), dcJobConfig.getEndTimeStr()); List<GetRepayPlanDetailsResp> resp = cwApi.getRepayPlanDetails(dcJobConfig.getStartTimeStr(), dcJobConfig.getEndTimeStr());
resp.forEach(getHandleFeeTradeRecordsResp -> { resp.forEach(getHandleFeeTradeRecordsResp -> {
DcBaseFinanceHandlefee dcBaseFinanceHandlefee = new DcBaseFinanceHandlefee(); DcBaseFinanceInterest dcBaseFinanceInterest = new DcBaseFinanceInterest();
BeanUtils.copyProperties(getHandleFeeTradeRecordsResp, dcBaseFinanceHandlefee); 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 (dcBaseFinanceHandlefeeService.saveOrUpdate(dcBaseFinanceHandlefee, updateWrapper)) { if (dcBaseFinanceInterestService.saveOrUpdate(dcBaseFinanceInterest, updateWrapper)) {
log.info("同步一条财务手续费,财务id:{}", dcBaseFinanceHandlefee.getCwId()); log.info("同步一利息支出,borrow id:{}", dcBaseFinanceInterest.getBorrowId());
} else { } else {
log.error("同步财务手续费,财务id:{}", dcBaseFinanceHandlefee.getCwId()); log.error("同步利息支出,borrow id :{}", dcBaseFinanceInterest.getBorrowId());
} }
}); });
log.info("请求财务手续费接口 结束"); log.info("请求利息支出接口同步百伦接口 结束");
dcJobConfigMapper.updateById(dcJobConfig.refresh()); dcJobConfigMapper.updateById(dcJobConfig.refresh());
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.3.RELEASE</version> <version>2.3.3.RELEASE</version>
<configuration> <configuration>
<mainClass>com.bailuntec.job.SampleApp</mainClass> <mainClass>com.bailuntec.job.SyncCompanyApp</mainClass>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration> <configuration>
<source>8</source> <source>8</source>
<target>8</target> <target>8</target>
......
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
...@@ -5,8 +5,10 @@ import com.bailuntec.job.service.CompanyService; ...@@ -5,8 +5,10 @@ import com.bailuntec.job.service.CompanyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException;
@Slf4j @Slf4j
@Component @Component
...@@ -27,4 +29,6 @@ public class SyncCompanyJob { ...@@ -27,4 +29,6 @@ public class SyncCompanyJob {
} }
} }
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<maven.compiler.encoding>UTF-8</maven.compiler.encoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
</properties> </properties>
<artifactId>base-sync-fee</artifactId> <artifactId>base-sync-fee</artifactId>
......
FROM openjdk:8-jdk-alpine FROM openjdk:8-jdk-alpine
VOLUME /tmp 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 RUN echo "Asia/Shanghai" > /etc/timezone
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<module>base-sync-amazon-ad</module> <module>base-sync-amazon-ad</module>
<module>base-sync-cashier</module> <module>base-sync-cashier</module>
<module>base-sync-fee</module> <module>base-sync-fee</module>
<module>base-sync-balance-sheet</module>
<module>base-sync-sample</module> <module>base-sync-sample</module>
<module>base-sync-company</module> <module>base-sync-company</module>
</modules> </modules>
......
...@@ -3,22 +3,23 @@ ...@@ -3,22 +3,23 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>datacenter-base</artifactId> <artifactId>datacenter-finance</artifactId>
<groupId>com.bailuntec</groupId> <groupId>com.bailuntec</groupId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>finance-balance-sheet</artifactId>
<properties> <properties>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<skipTests>true</skipTests>
</properties> </properties>
<artifactId>base-sync-balance-sheet</artifactId>
<build> <build>
<plugins> <plugins>
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
<version>1.0.0</version> <version>1.0.0</version>
<configuration> <configuration>
<skipDockerBuild>false</skipDockerBuild> <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> </imageName>
<dockerDirectory>src/main/docker</dockerDirectory> <dockerDirectory>src/main/docker</dockerDirectory>
<resources> <resources>
...@@ -57,8 +58,16 @@ ...@@ -57,8 +58,16 @@
<serverId>bailuntec-docker</serverId> <serverId>bailuntec-docker</serverId>
</configuration> </configuration>
</plugin> </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> </plugins>
</build> </build>
</project> </project>
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
...@@ -12,15 +12,15 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -12,15 +12,15 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* </p> * </p>
* *
* @author robbendev * @author robbendev
* @since 2020/10/28 3:15 下午 * @since 2020/10/28 3:16 下午
*/ */
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@ComponentScan("com.bailuntec") @ComponentScan("com.bailuntec")
@EnableFeignClients(basePackages = {"com.bailuntec.api", "com.bailuntec.*.api"}) @EnableFeignClients(basePackages = {"com.bailuntec.api", "com.bailuntec.*.api"})
public class BalanceSheetApp { public class BalanceSheetApp {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(BalanceSheetApp.class, args); SpringApplication.run(BalanceSheetApp.class, args);
} }
} }
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);
}
}
}
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
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
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();
}
}
<?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>
...@@ -4,5 +4,5 @@ ADD mid-calculate-turnover-prepare-1.0-SNAPSHOT.jar app.jar ...@@ -4,5 +4,5 @@ ADD mid-calculate-turnover-prepare-1.0-SNAPSHOT.jar app.jar
RUN echo "Asia/Shanghai" > /etc/timezone RUN echo "Asia/Shanghai" > /etc/timezone
ENTRYPOINT ["java","-Xms50m","-Xmx150m","-jar","-Dspring.profiles.active=prod","/app.jar"] ENTRYPOINT ["java","-Xms100m","-Xmx300m","-jar","-Dspring.profiles.active=prod","/app.jar"]
EXPOSE 8080 EXPOSE 8080
...@@ -3,6 +3,7 @@ package com.bailuntec.job; ...@@ -3,6 +3,7 @@ package com.bailuntec.job;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
...@@ -18,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -18,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@ComponentScan("com.bailuntec") @ComponentScan("com.bailuntec")
@MapperScan("com.bailuntec") @EnableFeignClients(basePackages = {"com.bailuntec.api", "com.bailuntec.*.api"})
public class TurnoverPrepareApp { public class TurnoverPrepareApp {
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -25,7 +25,7 @@ public class TurnoverPrepareJob { ...@@ -25,7 +25,7 @@ public class TurnoverPrepareJob {
* 到库存表 * 到库存表
* </p> * </p>
*/ */
@Scheduled(cron = "0 0/10 * * * ? ") @Scheduled(cron = "0 0/1 * * * ? ")
public void syncBaseStock() { public void syncBaseStock() {
try { try {
log.info("每10分钟同步oms、在途、采购存在sku但环球库存不存在的库存到库存表 开始"); log.info("每10分钟同步oms、在途、采购存在sku但环球库存不存在的库存到库存表 开始");
......
...@@ -8,13 +8,15 @@ spring: ...@@ -8,13 +8,15 @@ spring:
username: root username: root
password: '#7kfnymAM$Y9-Ntf' password: '#7kfnymAM$Y9-Ntf'
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
main:
allow-bean-definition-overriding: true
#mybatis plus 配置 #mybatis plus 配置
mybatis-plus: mybatis-plus:
mapper-locations: mapper-locations:
- classpath*:com/bailuntec/mapper/*.xml - classpath*:com/bailuntec/mapper/*.xml
configuration: # configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
feign: feign:
hystrix: hystrix:
......
...@@ -8,6 +8,8 @@ spring: ...@@ -8,6 +8,8 @@ spring:
username: root username: root
password: '#7kfnymAM$Y9-Ntf' password: '#7kfnymAM$Y9-Ntf'
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
main:
allow-bean-definition-overriding: true
#mybatis plus 配置 #mybatis plus 配置
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<module>datacenter-base</module> <module>datacenter-base</module>
<module>datacenter-mid</module> <module>datacenter-mid</module>
<module>datacenter-show</module> <module>datacenter-show</module>
<module>datacenter-finance</module>
</modules> </modules>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment