Commit f1400bf8 by huluobin

update

parent bee1e435
......@@ -13,7 +13,7 @@ public class DailyFeeJob extends PointJob {
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
DcBaseFinanceFeeMapper dcBaseFinanceFeeMapper = SessionUtil.getSession().getMapper(DcBaseFinanceFeeMapper.class);
LocalDate time = LocalDate.of(2020, 9, 29);
LocalDate time = LocalDate.of(2020, 10, 21);
try {
dcBaseFinanceFeeMapper.deleteDailyFee(time.minusDays(1L));
dcBaseFinanceFeeMapper.insertDailyFee(time.minusDays(1L));
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.bailuntec.domain.CostDto;
import com.bailuntec.domain.CostInfo;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.entity.DcBaseFinanceFee;
......@@ -19,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
......@@ -66,18 +64,18 @@ public class FeeJob extends PointJob {
}
if (costInfo != null && costInfo.getData().getList().size() > 0) {
List<DcBaseFinanceFee> costDtoList = costInfo.getData().getList();
for(DcBaseFinanceFee dcBaseFinanceFee : costDtoList) {
for (DcBaseFinanceFee dcBaseFinanceFee : costDtoList) {
try {
DcBaseFinanceFeeMapper dcBaseFinanceFeeMapper = SessionUtil.getSession().getMapper(DcBaseFinanceFeeMapper.class);
dcBaseFinanceFee.setBjModified(LocalDateTime.now());
int result = dcBaseFinanceFeeMapper.updateByExampleSelective(dcBaseFinanceFee, DcBaseFinanceFeeExample.newAndCreateCriteria().andCostNoEqualTo(dcBaseFinanceFee.getCostNo()).example());
if(result == 0) {
dcBaseFinanceFee.setBjModified(null);
dcBaseFinanceFeeMapper.insertSelective(dcBaseFinanceFee);
}
int result = dcBaseFinanceFeeMapper.updateByExampleSelective(dcBaseFinanceFee, DcBaseFinanceFeeExample.newAndCreateCriteria().andCostNoEqualTo(dcBaseFinanceFee.getCostNo()).example());
if (result == 0) {
dcBaseFinanceFee.setBjModified(null);
dcBaseFinanceFeeMapper.insertSelective(dcBaseFinanceFee);
}
} catch (Exception e) {
throw new RuntimeException("BeanUtils.copyProperties失败");
}finally {
} finally {
SessionUtil.closeSession();
}
}
......@@ -97,9 +95,9 @@ public class FeeJob extends PointJob {
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() - 1);
} while (0 < jobPointLog.getPageIndex());
jobPointLog.setPageIndex(0);
jobPointLog.setStartTime(jobPointLog.getEndTime());
jobPointLog.setEndTime(jobPointLog.getEndTime().plusDays(jobPointLog.getIntervalTime()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : jobPointLog.getEndTime().plusDays(jobPointLog.getIntervalTime()));
}
}
......@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test;
import java.time.LocalDateTime;
public class MainTest {
@Test
public void test() {
ManageCostJob syncManagerCostJob = new ManageCostJob();
......
......@@ -73,18 +73,6 @@
<artifactId>commons-beanutils</artifactId>
</dependency>
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/org.slf4j/slf4j-api &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/ch.qos.logback/logback-classic &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- <artifactId>logback-classic</artifactId>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
......@@ -94,7 +82,6 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<!-- 自动生成接口文档 -->
......
......@@ -20,6 +20,7 @@
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
# and t5.is_delete = 0
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
and (IF(t5.screen_type = 1,
t8.first_inbound_date &lt;= t7.duration_upper_limit or
......@@ -57,6 +58,7 @@
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
and t5.is_delete = 0
and t5.id = 4
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
and (IF(t5.screen_type = 1,
......
......@@ -5,7 +5,6 @@ import com.bailuntec.domain.entity.DcAutoTurnover;
import com.bailuntec.mapper.DcAutoSalesForecastStageConfigMapper;
import com.bailuntec.mapper.DcBaseOmsSkuMapper;
import com.bailuntec.service.AutoTurnoverService;
import com.bailuntec.utils.ReadSessionUtil;
import com.bailuntec.utils.SessionUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
......@@ -30,7 +29,7 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
@Override
public List<BigDecimal> getAutoTurnoverSaleDetails(DcAutoTurnover dcAutoTurnover, int turnoverDays, int autoForecastDay) {
SqlSession session = ReadSessionUtil.getFactory().openSession(true);
SqlSession session = SessionUtil.getFactory().openSession(true);
// SqlSession readOnlySession = ReadSessionUtil.getFactory().openSession(true);
try {
Queue<BigDecimal> forecastSalesDetails = new LinkedList<>();
......@@ -43,7 +42,6 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
//命中的预测规则
DcAutoSalesForecastStageConfig dcAutoSalesForecastStageConfig = dcAutoSalesForecastStageConfigMapper.selectMatchStage(dcAutoTurnover.getBailunSku(), dcAutoTurnover.getWarehouseCode());
//周转天数
/*
* 每个时间段的销量预测是dcAutoSalesForecastStageConfig对应时间段的三个参数对应的过去时间段的销量的加权平均*/
......
......@@ -325,7 +325,7 @@ public class AutoTurnoverJobTest {
DcBaseStockMapper dcBaseStockMapper = sqlSession.getMapper(DcBaseStockMapper.class);
DcBaseStock dcBaseStock = dcBaseStockMapper.selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("948259717")
.andBailunSkuEqualTo("949299201")
.andWarehouseCodeEqualTo("GZBLWH")
.example());
......
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