| | |
| | | return result; |
| | | } |
| | | |
| | | // 工程号生成:每次导入都生成新的工程号(使用数据库自增序号,避免重复) |
| | | final String engineerId = engineeringSequenceService.generateAndSaveEngineeringId(new Date()); |
| | | // 工程号生成:每次导入都生成新的工程号(先只生成,不保存到数据库,等到MES调用成功后再保存) |
| | | final String engineerId = engineeringSequenceService.generateEngineeringId(new Date()); |
| | | final String filmsIdDefault = firstValue(excelRows, "filmsId", "白玻"); |
| | | final double thicknessDefault = parseDouble(firstValue(excelRows, "thickness"), 0d); |
| | | |
| | |
| | | Map<String, Integer> rawSequenceMap = new HashMap<>(); |
| | | for (Map<String, Object> row : excelRows) { |
| | | double width = parseDouble(row.get("width"), 0d); |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double height = parseDouble(row.get("length"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal); |
| | | String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal); |
| | | String key = width + "_" + height + "_" + thickness + "_" + filmsId; |
| | |
| | | String productName = str(row.get("productName")); |
| | | String customerName = str(row.get("customerName")); |
| | | double width = parseDouble(row.get("width"), 0d); |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double height = parseDouble(row.get("length"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal); |
| | | |
| | | // 计算 rawSequence |
| | |
| | | Map<String, Map<String, Object>> rawGlassMap = new HashMap<>(); |
| | | for (Map<String, Object> row : excelRows) { |
| | | double width = parseDouble(row.get("width"), 0d); |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double height = parseDouble(row.get("length"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal); |
| | | String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal); |
| | | String key = width + "_" + height + "_" + thickness + "_" + filmsId; |
| | |
| | | Object qtyObj = row.getOrDefault("quantity", 1); |
| | | int qty = parseDouble(qtyObj, 1) > 0 ? (int) parseDouble(qtyObj, 1) : 1; |
| | | double width = parseDouble(row.get("width"), 0d); |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double height = parseDouble(row.get("length"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal); |
| | | String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal); |
| | | String productName = str(row.get("productName")); |
| | |
| | | if (qty <= 0) qty = 1; |
| | | |
| | | double width = parseDouble(row.get("width"), 0d); |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double length = parseDouble(row.get("length"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), 0d); |
| | | |
| | | // 与导入规则保持一致:glassId 前加工程号前缀,数量>1时追加序号 |
| | |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | glassInfo.setGlassId(finalGlassId); |
| | | glassInfo.setEngineeringId(engineeringId.trim()); |
| | | glassInfo.setGlassLength((int) Math.round(height)); |
| | | glassInfo.setGlassLength((int) Math.round(length)); |
| | | glassInfo.setGlassWidth((int) Math.round(width)); |
| | | glassInfo.setGlassThickness(BigDecimal.valueOf(thickness)); |
| | | glassInfo.setStatus(GlassInfo.Status.ACTIVE); |