|
|
@ -154,6 +154,7 @@ public class MesImportImpl implements IMesImportService {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 物料BOM信息excel导入
|
|
|
|
* 物料BOM信息excel导入
|
|
|
|
* 接口作废
|
|
|
|
* 接口作废
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param file
|
|
|
|
* @param file
|
|
|
|
* @param updateSupport
|
|
|
|
* @param updateSupport
|
|
|
|
* @param operName
|
|
|
|
* @param operName
|
|
|
@ -271,6 +272,7 @@ public class MesImportImpl implements IMesImportService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 提资单BOM信息excel导入
|
|
|
|
* 提资单BOM信息excel导入
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param file
|
|
|
|
* @param file
|
|
|
|
* @param updateSupport
|
|
|
|
* @param updateSupport
|
|
|
|
* @param operName
|
|
|
|
* @param operName
|
|
|
@ -297,7 +299,17 @@ public class MesImportImpl implements IMesImportService {
|
|
|
|
if (StringUtils.isNull(cellT)) {
|
|
|
|
if (StringUtils.isNull(cellT)) {
|
|
|
|
throw new ServiceException("Excel格式错误!");
|
|
|
|
throw new ServiceException("Excel格式错误!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String productBom = cellT.getStringCellValue();
|
|
|
|
|
|
|
|
|
|
|
|
String productBom = null;
|
|
|
|
|
|
|
|
switch (cellT.getCellType()) {
|
|
|
|
|
|
|
|
case STRING:
|
|
|
|
|
|
|
|
productBom = cellT.getStringCellValue();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
throw new ServiceException("Excel格式错误:请设置成文本格式");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
productBom = productBom.replaceAll("(.*?)", "");
|
|
|
|
productBom = productBom.replaceAll("(.*?)", "");
|
|
|
|
MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom);
|
|
|
|
MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom);
|
|
|
|
if (productMaterial == null) {
|
|
|
|
if (productMaterial == null) {
|
|
|
@ -368,7 +380,7 @@ public class MesImportImpl implements IMesImportService {
|
|
|
|
materialBom.setActiveFlag("1");
|
|
|
|
materialBom.setActiveFlag("1");
|
|
|
|
materialBom.setStandardAmount(BigDecimal.valueOf(amountCell.getNumericCellValue()));
|
|
|
|
materialBom.setStandardAmount(BigDecimal.valueOf(amountCell.getNumericCellValue()));
|
|
|
|
materialBom.setErpMaterialId(materialInfo.getErpId());
|
|
|
|
materialBom.setErpMaterialId(materialInfo.getErpId());
|
|
|
|
if (brandCell != null){
|
|
|
|
if (brandCell != null) {
|
|
|
|
materialBom.setBrand(brandCell.getStringCellValue());
|
|
|
|
materialBom.setBrand(brandCell.getStringCellValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bomList.add(materialBom);
|
|
|
|
bomList.add(materialBom);
|
|
|
@ -378,7 +390,7 @@ public class MesImportImpl implements IMesImportService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (failureMsg.length() != 0){
|
|
|
|
if (failureMsg.length() != 0) {
|
|
|
|
failureMsg.append("MES中未同步该物料信息!");
|
|
|
|
failureMsg.append("MES中未同步该物料信息!");
|
|
|
|
throw new ServiceException(failureMsg.toString());
|
|
|
|
throw new ServiceException(failureMsg.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|