Browse Source

12.19 Part Import

print/logistic/save
yuejiayang 1 year ago
parent
commit
085cd16054
  1. 30
      src/main/java/com/gaotao/modules/part/service/impl/PartServiceImpl.java

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

@ -300,25 +300,41 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, Part> implements Pa
task.setQtyPerRoll(BigDecimal.valueOf(row.getCell(3).getNumericCellValue())); task.setQtyPerRoll(BigDecimal.valueOf(row.getCell(3).getNumericCellValue()));
task.setRollsPerCarton(BigDecimal.valueOf(1)); task.setRollsPerCarton(BigDecimal.valueOf(1));
task.setPackingWeight(BigDecimal.valueOf(row.getCell(6).getNumericCellValue())); // 包装重量
Integer weightUmId = null;
if (getStringCellValue(row, 7) != null && !getStringCellValue(row, 7).equals("")) {
if (row.getCell(6) == null) {
task.setPackingWeight(null); // 包装重量
} else {
task.setPackingWeight(BigDecimal.valueOf(row.getCell(6).getNumericCellValue())); // 包装重量
}
Integer weightUmId =null;
if (row.getCell(7) == null) {
task.setWeightUmId(null); // 重量单位
}
else if (getStringCellValue(row, 7) != null && !getStringCellValue(row, 7).equals("")) {
weightUmId = partMapper.selectUmId(getStringCellValue(row, 7)); weightUmId = partMapper.selectUmId(getStringCellValue(row, 7));
if (weightUmId == null) { if (weightUmId == null) {
throw new RuntimeException("Weight UM does not exist!(line:" + j + ")"); throw new RuntimeException("Weight UM does not exist!(line:" + j + ")");
} }
task.setWeightUmId(weightUmId); // 重量单位
} }
task.setWeightUmId(weightUmId); // 重量单位
task.setMoldCode(getStringCellValue(row, 8)); // 模具编码
if (row.getCell(8) == null) {
task.setMoldCode(null); // 模具编码
} else {
task.setMoldCode(getStringCellValue(row, 8)); // 模具编码
}
// try { // try {
// row.getCell(7).getStringCellValue(); // RevNo // row.getCell(7).getStringCellValue(); // RevNo
// } catch (Exception e) { // } catch (Exception e) {
// throw new RuntimeException("The Part RevNo format is incorrect and should be text type!"); // throw new RuntimeException("The Part RevNo format is incorrect and should be text type!");
// } // }
task.setRev(getStringCellValue(row, 9));// RevNo
if (row.getCell(9) == null) {
task.setRev(null);// RevNo
}else {
task.setRev(getStringCellValue(row, 9));// RevNo
}
if (row.getCell(10) == null || getStringCellValue(row, 10).equals("")) { if (row.getCell(10) == null || getStringCellValue(row, 10).equals("")) {
task.setTradingMark("N"); // 商标 task.setTradingMark("N"); // 商标

Loading…
Cancel
Save