Commit d9bf5fe0 by huluobin

新数据中心

parent c81c7099
...@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* @since 2020/8/29 3:29 下午 * @since 2020/8/29 3:29 下午
*/ */
@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 SyncFeeApp { public class SyncFeeApp {
......
...@@ -60,6 +60,7 @@ public class SyncFeeService { ...@@ -60,6 +60,7 @@ public class SyncFeeService {
Integer pageNum = 1; Integer pageNum = 1;
Integer pageSize = 100; Integer pageSize = 100;
for (; ; ) { for (; ; ) {
CostResult<List<CostDto>> result = costApi.getCostList(dcJobConfig.getStartTimeStr(), CostResult<List<CostDto>> result = costApi.getCostList(dcJobConfig.getStartTimeStr(),
dcJobConfig.getEndTimeStr(), dcJobConfig.getEndTimeStr(),
pageNum, pageNum,
...@@ -70,8 +71,15 @@ public class SyncFeeService { ...@@ -70,8 +71,15 @@ public class SyncFeeService {
} }
result.getData().forEach(costDto -> { result.getData().forEach(costDto -> {
DcBaseFinanceFee dcBaseFinanceFee = new DcBaseFinanceFee(); DcBaseFinanceFee dcBaseFinanceFee = new DcBaseFinanceFee();
BeanUtils.copyProperties(costDto, dcBaseFinanceFee, "id"); BeanUtils.copyProperties(costDto, dcBaseFinanceFee);
dcBaseFinanceFee.setCreateTime(LocalDateTime.ofInstant(costDto.getCreateTime().toInstant(), ZoneId.systemDefault())); dcBaseFinanceFee.setCreateTime(LocalDateTime.ofInstant(costDto.getCreateTime().toInstant(), ZoneId.systemDefault()));
if (costDto.getPayTime() != null) {
dcBaseFinanceFee.setPayTime(LocalDateTime.ofInstant(costDto.getPayTime().toInstant(), ZoneId.systemDefault()));
}
if (costDto.getAuditTime() != null) {
dcBaseFinanceFee.setAuditTime(LocalDateTime.ofInstant(costDto.getAuditTime().toInstant(), ZoneId.systemDefault()));
}
dcBaseFinanceFee.setBjModified(LocalDateTime.now()); dcBaseFinanceFee.setBjModified(LocalDateTime.now());
//更新 //更新
int update = dcBaseFinanceFeeMapper.update(dcBaseFinanceFee, new LambdaQueryWrapper<DcBaseFinanceFee>() int update = dcBaseFinanceFeeMapper.update(dcBaseFinanceFee, new LambdaQueryWrapper<DcBaseFinanceFee>()
...@@ -83,6 +91,7 @@ public class SyncFeeService { ...@@ -83,6 +91,7 @@ public class SyncFeeService {
} }
log.info("同步一条费用单,costNo:{}", costDto.getCostNo()); log.info("同步一条费用单,costNo:{}", costDto.getCostNo());
}); });
pageNum++; pageNum++;
} }
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
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-mid</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>mid-calculate-transit</artifactId> <artifactId>mid-calculate-transit</artifactId>
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
<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> <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<skipTests>true</skipTests>
</properties> </properties>
<build> <build>
......
package com.bailuntec.job.service;
import com.bailuntec.job.MidCalculateTransitApp;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/12 10:59 上午
*/
@EnableHystrix
@ActiveProfiles(value = "test")
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MidCalculateTransitApp.class)
class MidCalculateTransitServiceTest {
@Resource
MidCalculateTransitService midCalculateTransitService;
@Test
void midCalculateOutStockQuantity() {
midCalculateTransitService.midCalculateOutStockQuantity();
}
@Test
void midCalculatePurchaseTransitQuantity() {
midCalculateTransitService.midCalculatePurchaseTransitQuantity();
}
@Test
void midCalculateTransferTransitQuantity() {
midCalculateTransitService.midCalculateTransferTransitQuantity();
}
@Test
void midCalculateNoShippedQuantity() {
midCalculateTransitService.midCalculateNoShippedQuantity();
}
}
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