Commit ac7b77a7 by huluobin

# update

parent 46093596
......@@ -30,7 +30,7 @@ public interface DcAutoSalesForecastStageConfigMapper extends BaseMapper<DcAutoS
*/
DcAutoSalesForecastStageConfig selectMatchStage(@Param("bailunSku") String bailunSku,
@Param("warehouseCode") String warehouseCode,
@Param("firstOrderDays") Integer firstOrderDays,
@Param("firstOrderDays") Long firstOrderDays,
@Param("avgOrderCount30") BigDecimal avgOrderCount30);
......
......@@ -5,8 +5,8 @@
<configuration>
<!--<properties resource="db-tj.properties"/>-->
<properties resource="db-dev.properties"/>
<!-- <properties resource="db-prod.properties"/>-->
<!-- <properties resource="db-dev.properties"/>-->
<properties resource="db-prod.properties"/>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
......
......@@ -369,19 +369,29 @@ public class AutoTurnoverJob extends PointJob {
* forecastSalesList
* forecastShortSupplyList
*/
//预测采购入库
List<Integer> forecastPurchaseInboundList = new ArrayList<>(autoForecastDay);
//预测调拨入库
List<Integer> forecastTransferInboundList = new ArrayList<>(autoForecastDay);
//预测库存
List<BigDecimal> forecastInventoryList = new ArrayList<>(autoForecastDay);
//预测入库
List<Integer> forecastInboundList = new ArrayList<>(autoForecastDay);
//预测入库释义
List<String> forecastInboundRelationList = new ArrayList<>(autoForecastDay);
//预测销量
List<BigDecimal> forecastSalesList = new ArrayList<>(autoForecastDay);
//预测销量释义
List<String> forecastSalesExplainList = new ArrayList<>(forecastSalesList.size());
//七天实际断货+预测断货
List<BigDecimal> forecastShortSupplyList = new ArrayList<>(autoForecastDay);
//预测采购建议
List<BigDecimal> forecastPurchaseAdvisedList = new ArrayList<>(autoForecastDay);
//moq数
List<BigDecimal> moqPurchaseAdvisedList = new ArrayList<>(autoForecastDay);
Map<String, BigDecimal> saveDaysMap = new HashMap<>();
initForecastList(forecastInboundRelationList, forecastInventoryList, forecastPurchaseInboundList, forecastTransferInboundList, forecastInboundList, forecastSalesList, forecastShortSupplyList, autoForecastDay, forecastSalesExplainList);
/*
......@@ -969,14 +979,14 @@ public class AutoTurnoverJob extends PointJob {
//冗余或缺货天数索引
int index = -1;
//
for (int i = 0; i <= turnoverDays; i++) {
if (forecastShortSupplyList.get(i).setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) >= 0) {
days++;
if (index < 0) {
index = i;
}
if (i - 1 == turnoverDays) { //如果是最后一天
if (i + 1 == turnoverDays) { //如果是最后一天
handleForecastFluctuation(2, forecastFluctuationList, recordTime, days, index);
days = 0;
index = -1;
......
......@@ -19,6 +19,8 @@ import java.time.LocalTime;
import java.time.Period;
import java.util.*;
import static java.time.temporal.ChronoUnit.DAYS;
/**
* <p>
*
......@@ -47,7 +49,7 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
DcBaseOmsSku orderFirstCreateTime = dcAutoSalesForecastStageConfigMapper.firsOrder(dcAutoTurnover.getBailunSku(), dcAutoTurnover.getWarehouseCode());
Integer day = Optional.ofNullable(orderFirstCreateTime).map(var -> Period.between(var.getCreateTime().toLocalDate(), LocalDateTime.now().toLocalDate()).getDays()).orElse(null);
Long day = Optional.ofNullable(orderFirstCreateTime).map(item -> DAYS.between(item.getCreateTime().toLocalDate(), LocalDate.now())).orElse(null);
BigDecimal avgOrderCount30 = dcAutoSalesForecastStageConfigMapper.avgOrderCount30(dcAutoTurnover.getBailunSku(), dcAutoTurnover.getWarehouseCode());
......@@ -169,7 +171,7 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
DcAutoSalesForecastConfigMapper dcAutoSalesForecastConfigMapper = session.getMapper(DcAutoSalesForecastConfigMapper.class);
DcBaseOmsSku orderFirstCreateTime = dcAutoSalesForecastStageConfigMapper.firsOrder(dcAutoTurnover.getBailunSku(), dcAutoTurnover.getWarehouseCode());
Integer day = Optional.ofNullable(orderFirstCreateTime).map(var -> Period.between(var.getCreateTime().toLocalDate(), LocalDateTime.now().toLocalDate()).getDays()).orElse(null);
Long day = Optional.ofNullable(orderFirstCreateTime).map(item -> DAYS.between(item.getCreateTime().toLocalDate(), LocalDate.now())).orElse(null);
BigDecimal avgOrderCount30 = dcAutoSalesForecastStageConfigMapper.avgOrderCount30(dcAutoTurnover.getBailunSku(), dcAutoTurnover.getWarehouseCode());
......
......@@ -258,7 +258,7 @@ public class AutoTurnoverTest {
public void testXX2() {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("949980008")
.andBailunSkuEqualTo("951265201")
.andWarehouseCodeEqualTo("GZBLWH")
.example());
try {
......
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