| | |
| | | IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); |
| | | //查询零件属性 |
| | | IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery() |
| | | .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId())); |
| | | .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId()).last("limit 1")); |
| | | if (Objects.nonNull(ifsPartPropsRecord)) { |
| | | enterFactoryReport.setOuterColor(StringUtils.equals(ifsPartPropsRecord.getOuterColor(),"/")?ifsPartPropsRecord.getInsulationColor():ifsPartPropsRecord.getOuterColor()); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private static int getDecimalPlaces(String str) { |
| | | // 查找小数点位置 |
| | | int decimalPointIndex = str.lastIndexOf('.'); |
| | | |
| | | if (decimalPointIndex == -1) { |
| | | // 如果没有小数点,返回0位小数 |
| | | return 0; |
| | | private static int getDecimalPlaces(String str) { |
| | | // 使用正则匹配所有带小数点的数字,取最大小数位数 |
| | | java.util.regex.Matcher matcher = Pattern.compile("\\d+\\.(\\d+)").matcher(str); |
| | | int maxDecimalPlaces = 0; |
| | | while (matcher.find()) { |
| | | int places = matcher.group(1).length(); |
| | | if (places > maxDecimalPlaces) { |
| | | maxDecimalPlaces = places; |
| | | } |
| | | } |
| | | |
| | | // 计算小数点后的位数 |
| | | return str.length() - decimalPointIndex - 1; |
| | | return maxDecimalPlaces; |
| | | } |
| | | |
| | | /** |