Browse Source

2025/7/9

master
Aoi_Tori 6 months ago
parent
commit
2c4f6d4d48
  1. 35
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  2. 18
      src/main/java/com/spring/modules/sampleManagement/data/PlmTechnicalSpecificationSheetData.java
  3. 8
      src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

35
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -58,6 +58,7 @@ import com.spring.modules.test.vo.TestInformationVo;
import ifs.fnd.ap.APException;
import ifs.fnd.ap.Server;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -626,7 +627,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
partRevision.setEngRevision("1");
partInformationMapper.saveRevision(partRevision);
// 新增物料的属性
if (!data.getPartItemList().isEmpty()) {
if (data.getPartItemList() != null &&!data.getPartItemList().isEmpty()) {
savePartItemInfo(data);
}
// 创建该物料的bom默认版本
@ -3366,7 +3367,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
throw new RuntimeException("请维护编码生成规则(TransNoControl)!");
}
task.setPartNo(no + "A01"); // 物料编码
task.setBuNo(row.getCell(0).getStringCellValue()); // BU
/* task.setBuNo(row.getCell(0).getStringCellValue()); // BU
task.setPartDesc(row.getCell(1).getStringCellValue()); // 物料描述
task.setCustomerPartNo(row.getCell(2).getStringCellValue()); // 客户料号
task.setPartType(row.getCell(3).getStringCellValue()); // 零件类型
@ -3376,7 +3377,14 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
task.setCodeNo("");
} else {
task.setCodeNo(row.getCell(6).getStringCellValue());
}
}*/
task.setBuNo(getCellValueAsString(row.getCell(0)));
task.setPartDesc(getCellValueAsString(row.getCell(1)));
task.setCustomerPartNo(getCellValueAsString(row.getCell(2)));
task.setPartType(getCellValueAsString(row.getCell(3)));
task.setProductGroupId4(getCellValueAsString(row.getCell(4)));
task.setUmId(getCellValueAsString(row.getCell(5)));
task.setCodeNo(getCellValueAsString(row.getCell(6)));
task.setUomForWeightNet("kg");
task.setUomForVolumeNet("m3");
task.setActive("Y");
@ -3406,6 +3414,27 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
}
}
private static String getCellValueAsString(Cell cell) {
if (cell == null) {
return "";
}
switch (cell.getCellType()) {
case STRING:
return cell.getStringCellValue().trim();
case NUMERIC:
return String.valueOf(cell.getNumericCellValue()).replace(".0", "");
case BOOLEAN:
return String.valueOf(cell.getBooleanCellValue());
case FORMULA:
return cell.getCellFormula();
case BLANK:
return "";
default:
return "";
}
}
/**
* 查询文件ID
* @param data

18
src/main/java/com/spring/modules/sampleManagement/data/PlmTechnicalSpecificationSheetData.java

@ -91,6 +91,24 @@ public class PlmTechnicalSpecificationSheetData extends PlmTechnicalSpecificatio
private String p2cTolerance;
private String slittingTolerance;
private String directCustomer;
private String radius;
private String sheet;
public String getRadius() {
return radius;
}
public void setRadius(String radius) {
this.radius = radius;
}
public String getSheet() {
return sheet;
}
public void setSheet(String sheet) {
this.sheet = sheet;
}
public String getLabelLength() {
return labelLength;

8
src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

@ -384,7 +384,9 @@
a.p2c_tolerance,
a.dimension_tolerance,
a.slitting_tolerance,
a.url_file
a.url_file,
a.radius,
a.sheet
FROM plm_technical_specification_sheet a
left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
@ -2756,7 +2758,9 @@
dimension_tolerance = #{dimensionTolerance},
slitting_tolerance = #{slittingTolerance},
label_length = #{labelLength},
label_width = #{labelWidth}
label_width = #{labelWidth},
radius = #{radius},
sheet = #{sheet}
where site = #{site} and code_no = #{codeNo}
</update>

Loading…
Cancel
Save