Commit 1e08387d by liyanlin

fix

parent 47ab580d
......@@ -1224,8 +1224,8 @@ public class AutoTurnoverJob extends PointJob {
}
//拿调拨单流水
if (transfer > 0) {
//拿调拨单流水 原逻辑 if(transfer > 0)
if (false) {
List<DcBaseTransferVerify> dcBaseTransferVerifyList;
try {
DcBaseTransferVerifyMapper dcBaseTransferVerifyMapper = SessionUtil.getSession().getMapper(DcBaseTransferVerifyMapper.class);
......@@ -1292,12 +1292,23 @@ public class AutoTurnoverJob extends PointJob {
.example());
Map<LocalDate, List<DcBaseTransExpectarrivaltime>> map = dcBaseTransExpectarrivaltimeList.stream().collect(Collectors.groupingBy(item -> item.getExpectarrivaltime().toLocalDate()));
map.forEach((localDate, dcBaseTransExpectarrivaltimes) -> {
int interval = between(recordTime, localDate).getDays();
int index = Math.max(interval, 0);
forecastInboundRelationList.set(index, forecastInboundRelationList.get(index) + "*" + dcBaseTransExpectarrivaltimes.stream().map(dcBaseTransExpectarrivaltime -> Constant.TRANSFER_SIGN + dcBaseTransExpectarrivaltime.getTransferOrderId() + "_" + dcBaseTransExpectarrivaltime.getCount()).collect(Collectors.joining("*")));
forecastTransferInboundList.set(index, forecastTransferInboundList.get(index) + dcBaseTransExpectarrivaltimes.stream().mapToInt(DcBaseTransExpectarrivaltime::getCount).sum());
forecastInboundRelationList.set(index,
forecastInboundRelationList.get(index) +
"*" +
dcBaseTransExpectarrivaltimes
.stream()
.map(dcBaseTransExpectarrivaltime -> Constant.TRANSFER_SIGN + dcBaseTransExpectarrivaltime.getTransferOrderId() + "_" + dcBaseTransExpectarrivaltime.getCount()).collect(Collectors.joining("*")));
forecastTransferInboundList.set(index, forecastTransferInboundList.get(index)
+ dcBaseTransExpectarrivaltimes
.stream()
.mapToInt(DcBaseTransExpectarrivaltime::getCount)
.sum());
forecastInboundList.set(index, forecastPurchaseInboundList.get(index) + forecastTransferInboundList.get(index));
});
......@@ -1468,7 +1479,9 @@ public class AutoTurnoverJob extends PointJob {
*/
DcAutoStockUpRangeMapper dcAutoStockUpRangeMapper = SessionUtil.getSession().getMapper(DcAutoStockUpRangeMapper.class);
DcAutoStockUpRange dcAutoStockUpRange = dcAutoStockUpRangeMapper.selectOneByExample(DcAutoStockUpRangeExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku).andWarehouseCodeEqualTo(warehouseCode).example());
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>>() {
});
BigDecimal weightingAvgSales = calculateWeightingAvgSales(historyThirtySalesList);
......@@ -1537,6 +1550,7 @@ public class AutoTurnoverJob extends PointJob {
});
if (dcAutoConfigSafeInventory != null) {
weightingAvgSales = calculateWeightingAvgSales(dcAutoConfigSafeInventory.getWeightingCoefficientSeven(), dcAutoConfigSafeInventory.getWeightingCoefficientFourteen(), dcAutoConfigSafeInventory.getWeightingCoefficientThirty(), historyThirtySalesList);
dcAutoTurnover.setDailyWeightedSales(weightingAvgSales);
//type11 乘倍数
weightingAvgSales = weightingAvgSales.multiply(dcAutoConfigSafeInventory.getParam()).setScale(3, RoundingMode.HALF_EVEN);
......
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