Browse Source

2024-11-13

java8
fengyuan_yang 1 year ago
parent
commit
addcd624af
  1. 7
      src/main/java/com/xujie/sys/modules/part/service/impl/RoutingManagementServiceImpl.java
  2. 1
      src/main/resources/mapper/pms/QcMapper.xml

7
src/main/java/com/xujie/sys/modules/part/service/impl/RoutingManagementServiceImpl.java

@ -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));
} }

1
src/main/resources/mapper/pms/QcMapper.xml

@ -3211,7 +3211,6 @@
inner JOIN so_routing AS c ON c.order_no = a.orderno AND a.itemno = c.item_no AND c.site = a.site inner JOIN so_routing AS c ON c.order_no = a.orderno AND a.itemno = c.item_no AND c.site = a.site
inner JOIN part AS J ON a.site = J.site AND a.part_no = J.part_no inner JOIN part AS J ON a.site = J.site AND a.part_no = J.part_no
inner JOIN shoporder AS t ON t.orderno = a.orderno AND a.site = t.site inner JOIN shoporder AS t ON t.orderno = a.orderno AND a.site = t.site
left join qc_ipqc_record as r on a.site = r.site and a.seqno = r.seq_no
WHERE WHERE
a.site = #{query.site} a.site = #{query.site}
<if test="query.status != null and query.status != ''"> <if test="query.status != null and query.status != ''">

Loading…
Cancel
Save