| | |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | Assert.notNull(productStructureDto.getUnitQuantity(), "单位产出所需数量不存在"); |
| | | if (productStructureDto.getMaterialType().equals("0")) { |
| | | quantity = quantity.multiply(productStructureDto.getUnitQuantity()); |
| | | // 第一道工序 |
| | | BigDecimal result = quantity; |
| | | // if(i == 0){ |
| | | // result = quantity.divide(productStructureDto.getUnitQuantity(), 2, RoundingMode.HALF_UP); |
| | | // } |
| | | resultMap.put(productStructureDto.getProcessId(),result ); |
| | | } else { |
| | | if(Optional.ofNullable(productStructureDto.getProcessName()).orElse("").contains("包装")){ |
| | | resultMap.put(productStructureDto.getProcessId(), quantity); |
| | | } else { |
| | | resultMap.put(productStructureDto.getProcessId(), originalQuantity.multiply(productStructureDto.getUnitQuantity())); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return resultMap; |
| | | } |
| | | |