Commit b9183dca by wutong

自动周转安全库存小于0.8就置0,0.8-1 之间就置1

parent ff312084
...@@ -1063,12 +1063,14 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1063,12 +1063,14 @@ public class AutoTurnoverJob extends PointJob {
dcAutoConfigSafeInventory = autoConfigSafeInventoryMapper.selectOneByExample(DcAutoConfigSafeInventoryExample.newAndCreateCriteria().andVariableCodeEqualTo("").andWarehouseCodeEqualTo(warehouseCode).andStatusEqualTo(1).andTypeEqualTo(3).example()); dcAutoConfigSafeInventory = autoConfigSafeInventoryMapper.selectOneByExample(DcAutoConfigSafeInventoryExample.newAndCreateCriteria().andVariableCodeEqualTo("").andWarehouseCodeEqualTo(warehouseCode).andStatusEqualTo(1).andTypeEqualTo(3).example());
if (dcAutoConfigSafeInventory != null) { if (dcAutoConfigSafeInventory != null) {
weightingAvgSales = caculateWeightingAvgSales(dcAutoConfigSafeInventory.getWeightingCoefficientSeven(), dcAutoConfigSafeInventory.getWeightingCoefficientFourteen(), dcAutoConfigSafeInventory.getWeightingCoefficientThirty(), historyThirtySalesList); weightingAvgSales = caculateWeightingAvgSales(dcAutoConfigSafeInventory.getWeightingCoefficientSeven(), dcAutoConfigSafeInventory.getWeightingCoefficientFourteen(), dcAutoConfigSafeInventory.getWeightingCoefficientThirty(), historyThirtySalesList);
//进来这里就存一份没乘倍数的加权日均销量 //进来这里就存一份没乘倍数的加权日均销量,小于0.8就置0 0.8-1 之间就置1
dcAutoTurnover.setDailyWeightedSales(weightingAvgSales); dcAutoTurnover.setDailyWeightedSales(weightingAvgSales);
if (weightingAvgSales.compareTo(BigDecimal.ONE) == 1) { if (weightingAvgSales.compareTo(BigDecimal.ONE) == 1) {
weightingAvgSales = weightingAvgSales.multiply(dcAutoConfigSafeInventory.getParam()).setScale(3, RoundingMode.HALF_EVEN); weightingAvgSales = weightingAvgSales.multiply(dcAutoConfigSafeInventory.getParam()).setScale(3, RoundingMode.HALF_EVEN);
} else { } else if (weightingAvgSales.compareTo(BigDecimal.valueOf(0.8)) >= 0){
weightingAvgSales = BigDecimal.ONE; weightingAvgSales = BigDecimal.ONE;
} else {
weightingAvgSales = BigDecimal.ZERO;
} }
} else { } else {
//啥配置都没有就给个默认取值 //啥配置都没有就给个默认取值
......
...@@ -117,5 +117,9 @@ public class AutoTurnoverTest { ...@@ -117,5 +117,9 @@ public class AutoTurnoverTest {
int interval = Period.between(recordTime.toLocalDate(), finalEstimatedArrivalTime.toLocalDate()).getDays(); int interval = Period.between(recordTime.toLocalDate(), finalEstimatedArrivalTime.toLocalDate()).getDays();
System.out.println(interval); System.out.println(interval);
} }
@Test
public void test66() {
}
} }
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