Browse Source

2025.06.11 part导入picture优化

master
jiayang yue 7 months ago
parent
commit
43df24fbe5
  1. 5
      src/main/java/com/gaotao/modules/part/service/impl/PartServiceImpl.java

5
src/main/java/com/gaotao/modules/part/service/impl/PartServiceImpl.java

@ -360,7 +360,8 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, Part> implements Pa
// 解析图片 // 解析图片
if (row.getCell(13) != null && !getStringCellValue(row, 13).isEmpty()) { if (row.getCell(13) != null && !getStringCellValue(row, 13).isEmpty()) {
String[] certificationNos = getStringCellValue(row, 13).split("-"); String[] certificationNos = getStringCellValue(row, 13).split("-");
for (String certificationNo : certificationNos) {
for (int i = 0; i < certificationNos.length; i++) {
String certificationNo = certificationNos[i].trim();
BasePicture basePicture = basePictureMap.get(certificationNo); BasePicture basePicture = basePictureMap.get(certificationNo);
if (basePicture == null) { if (basePicture == null) {
throw new RuntimeException("Invalid Certification No: " + certificationNo + " at line: " + j); throw new RuntimeException("Invalid Certification No: " + certificationNo + " at line: " + j);
@ -368,7 +369,7 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, Part> implements Pa
ExternalPartPicture picture = new ExternalPartPicture(); ExternalPartPicture picture = new ExternalPartPicture();
picture.setSite(data.getSite()); picture.setSite(data.getSite());
picture.setPartNo(part.getPartNo()); picture.setPartNo(part.getPartNo());
picture.setPictureNo(certificationNos.length);
picture.setPictureNo(i+1);
picture.setPictureDesc(basePicture.getPictureDesc()); picture.setPictureDesc(basePicture.getPictureDesc());
picture.setPictureUrl(basePicture.getPictureUrl()); picture.setPictureUrl(basePicture.getPictureUrl());
picture.setPictureFileName(basePicture.getPictureFileName()); picture.setPictureFileName(basePicture.getPictureFileName());

Loading…
Cancel
Save