|
|
@ -706,6 +706,7 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
for (RoutingComponentVo operation : operations) { |
|
|
for (RoutingComponentVo operation : operations) { |
|
|
// 获取各个值 |
|
|
// 获取各个值 |
|
|
int scale = 6; // 保留的小数位数 |
|
|
int scale = 6; // 保留的小数位数 |
|
|
|
|
|
int scale2 = 10; // 保留的小数位数 |
|
|
BigDecimal machCycleTime = BigDecimal.ZERO; // 机器处理时间 |
|
|
BigDecimal machCycleTime = BigDecimal.ZERO; // 机器处理时间 |
|
|
BigDecimal refSpeed = operation.getRefSpeed(); // 速度 |
|
|
BigDecimal refSpeed = operation.getRefSpeed(); // 速度 |
|
|
BigDecimal refTime = operation.getRefTime(); // 时间 |
|
|
BigDecimal refTime = operation.getRefTime(); // 时间 |
|
|
@ -724,7 +725,7 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
// 速度 x 时间 x 效率 |
|
|
// 速度 x 时间 x 效率 |
|
|
BigDecimal product = refSpeed.multiply(refTime).multiply(refEfficiency); |
|
|
BigDecimal product = refSpeed.multiply(refTime).multiply(refEfficiency); |
|
|
// 1 / 速度 x 时间 x 效率 |
|
|
// 1 / 速度 x 时间 x 效率 |
|
|
BigDecimal intermediateResult = BigDecimal.ONE.divide(product, scale, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
BigDecimal intermediateResult = BigDecimal.ONE.divide(product, scale2, RoundingMode.HALF_UP); |
|
|
// 最终结果 |
|
|
// 最终结果 |
|
|
machCycleTime = intermediateResult.divide(numValue, scale, RoundingMode.HALF_UP); |
|
|
machCycleTime = intermediateResult.divide(numValue, scale, RoundingMode.HALF_UP); |
|
|
} |
|
|
} |
|
|
@ -768,7 +769,7 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
} |
|
|
} |
|
|
if (!collect1.isEmpty() && !collect2.isEmpty()) { |
|
|
if (!collect1.isEmpty() && !collect2.isEmpty()) { |
|
|
// 1000/pitch |
|
|
// 1000/pitch |
|
|
BigDecimal numValue1 = BigDecimal.valueOf(1000).divide(BigDecimal.valueOf(collect1.get(0).getNumValue()), scale, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
BigDecimal numValue1 = BigDecimal.valueOf(1000).divide(BigDecimal.valueOf(collect1.get(0).getNumValue()), scale2, RoundingMode.HALF_UP); |
|
|
// 列数 属性的值 |
|
|
// 列数 属性的值 |
|
|
BigDecimal numValue2 = BigDecimal.valueOf(collect2.get(0).getNumValue()); |
|
|
BigDecimal numValue2 = BigDecimal.valueOf(collect2.get(0).getNumValue()); |
|
|
// 1 / (速度 x 时间 x 效率 x (1000/pitch) x 列数) |
|
|
// 1 / (速度 x 时间 x 效率 x (1000/pitch) x 列数) |
|
|
@ -779,7 +780,7 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
} else if ("Packaging".equals(operation.getOperationName())) { |
|
|
} else if ("Packaging".equals(operation.getOperationName())) { |
|
|
// 1 / (日产量 / 8小时 / 17) x 1000 |
|
|
// 1 / (日产量 / 8小时 / 17) x 1000 |
|
|
// 日产量 / 8小时 / 17 |
|
|
// 日产量 / 8小时 / 17 |
|
|
BigDecimal product = BigDecimal.ONE.divide(refDailyProduction.divide(BigDecimal.valueOf(8), scale, RoundingMode.HALF_UP).divide(BigDecimal.valueOf(17), scale, RoundingMode.HALF_UP).multiply(refEfficiency), scale, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
BigDecimal product = BigDecimal.ONE.divide(refDailyProduction.divide(BigDecimal.valueOf(8), scale2, RoundingMode.HALF_UP).divide(BigDecimal.valueOf(17), scale2, RoundingMode.HALF_UP).multiply(refEfficiency), scale, RoundingMode.HALF_UP); |
|
|
// 最终结果 |
|
|
// 最终结果 |
|
|
machCycleTime = product.multiply(BigDecimal.valueOf(1000)); |
|
|
machCycleTime = product.multiply(BigDecimal.valueOf(1000)); |
|
|
} |
|
|
} |
|
|
|