Commit 336436bf by huluobin

# update

parent 819fd504
...@@ -1137,6 +1137,9 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1137,6 +1137,9 @@ public class AutoTurnoverJob extends PointJob {
return turnoverDays; return turnoverDays;
} }
private BigDecimal calculateWeightingAvgSales(List<BigDecimal> salesList) {
return this.calculateWeightingAvgSales(new BigDecimal("0.4"), new BigDecimal("0.4"), new BigDecimal("0.4"), salesList)
}
private BigDecimal calculateWeightingAvgSales(BigDecimal weightingCoefficientSeven, BigDecimal weightingCoefficientFourteen, BigDecimal weightingCoefficientThirty, List<BigDecimal> salesList) { private BigDecimal calculateWeightingAvgSales(BigDecimal weightingCoefficientSeven, BigDecimal weightingCoefficientFourteen, BigDecimal weightingCoefficientThirty, List<BigDecimal> salesList) {
List<BigDecimal> historySevenSalesList = new ArrayList<>(7); List<BigDecimal> historySevenSalesList = new ArrayList<>(7);
...@@ -1441,7 +1444,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1441,7 +1444,7 @@ public class AutoTurnoverJob extends PointJob {
weightingAvgSales = weightingAvgSales.multiply(dcAutoConfigSalesUpperLimit.getParam()).setScale(3, RoundingMode.HALF_EVEN); weightingAvgSales = weightingAvgSales.multiply(dcAutoConfigSalesUpperLimit.getParam()).setScale(3, RoundingMode.HALF_EVEN);
} else { } else {
//如果没有任何配置, 就留一个默认配置 //如果没有任何配置, 就留一个默认配置
weightingAvgSales = calculateWeightingAvgSales(BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.4), historyThirtySalesList); weightingAvgSales = calculateWeightingAvgSales(historyThirtySalesList);
} }
return weightingAvgSales; return weightingAvgSales;
} else { } else {
...@@ -1466,7 +1469,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1466,7 +1469,7 @@ public class AutoTurnoverJob extends PointJob {
if ((warehouseCode.equals(Constant.WAREHOUSE_JIT) && (turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_1) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_2) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_3))) || dcAutoStockUpRange != null || (warehouseCode.equals(Constant.WAREHOUSE_JIT1) && (turnoverSku.getBuyerName().equals(Constant.BUTER_JIT_5)))) { if ((warehouseCode.equals(Constant.WAREHOUSE_JIT) && (turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_1) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_2) || turnoverSku.getBuyerName().equals(Constant.BUYER_JIT_3))) || dcAutoStockUpRange != null || (warehouseCode.equals(Constant.WAREHOUSE_JIT1) && (turnoverSku.getBuyerName().equals(Constant.BUTER_JIT_5)))) {
List<BigDecimal> historyThirtySalesList = JSON.parseObject(dcAutoSales.getHistorySalesDetails(), new TypeReference<List<BigDecimal>>() { List<BigDecimal> historyThirtySalesList = JSON.parseObject(dcAutoSales.getHistorySalesDetails(), new TypeReference<List<BigDecimal>>() {
}); });
BigDecimal weightingAvgSales = calculateWeightingAvgSales(BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.4), historyThirtySalesList); BigDecimal weightingAvgSales = calculateWeightingAvgSales(historyThirtySalesList);
if (dcAutoStockUpRange == null && (warehouseCode.equals(Constant.WAREHOUSE_JIT1) && (turnoverSku.getBuyerName().equals(Constant.BUTER_JIT_5)))) { if (dcAutoStockUpRange == null && (warehouseCode.equals(Constant.WAREHOUSE_JIT1) && (turnoverSku.getBuyerName().equals(Constant.BUTER_JIT_5)))) {
dcAutoStockUpRange = new DcAutoStockUpRange(); dcAutoStockUpRange = new DcAutoStockUpRange();
dcAutoStockUpRange.setBailunSku(bailunSku); dcAutoStockUpRange.setBailunSku(bailunSku);
...@@ -1546,7 +1549,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1546,7 +1549,7 @@ public class AutoTurnoverJob extends PointJob {
} }
} else { } else {
//啥配置都没有就给个默认取值 //啥配置都没有就给个默认取值
weightingAvgSales = calculateWeightingAvgSales(BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.3), BigDecimal.valueOf(0.4), historyThirtySalesList); weightingAvgSales = calculateWeightingAvgSales(historyThirtySalesList);
dcAutoTurnover.setDailyWeightedSales(weightingAvgSales); dcAutoTurnover.setDailyWeightedSales(weightingAvgSales);
} }
} }
......
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