MES:自检工序生成成品条码保存的materialid修改
master
xs 1 month ago
parent 13c42f6da3
commit bb9851443b

@ -349,8 +349,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Long saleOrderId = productPlan.getSaleOrderId(); Long saleOrderId = productPlan.getSaleOrderId();
String saleOrderCode = productPlan.getSaleorderCode(); String saleOrderCode = productPlan.getSaleorderCode();
Long materialId = null;//在生产计划的materialid是根据saletype保存如果是外部销售则保存productorder中的materialid如果是内部生产则保存prpductorder中的producematerialid Long materialId = productPlan.getMaterialId();;//在生产计划的materialid是根据saletype保存如果是外部销售则保存productorder中的materialid如果是内部生产则保存prpductorder中的producematerialid
//五楼自检工序根据原材料条码生成成品条码 //五楼自检工序根据原材料条码生成成品条码
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) && if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
@ -408,9 +407,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
+ ",原材料条码派工单号:" + rawBarcodeProductPlan.getDispatchCode()); + ",原材料条码派工单号:" + rawBarcodeProductPlan.getDispatchCode());
} }
materialId = rawBarcode.getMaterialId();
mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());//重新绑定托盘号 mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());//重新绑定托盘号
mesBaseBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING); mesBaseBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
@ -436,7 +432,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail); mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
} else { } else {
materialId = productPlan.getMaterialId();
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId()); MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId());
mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE) mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)

@ -154,6 +154,7 @@ public class MesImportImpl implements IMesImportService {
/** /**
* BOMexcel * BOMexcel
* *
*
* @param file * @param file
* @param updateSupport * @param updateSupport
* @param operName * @param operName
@ -271,6 +272,7 @@ public class MesImportImpl implements IMesImportService {
/** /**
* BOMexcel * BOMexcel
*
* @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) {
@ -343,7 +355,7 @@ public class MesImportImpl implements IMesImportService {
} }
Row rowC = sheet.getRow(i); Row rowC = sheet.getRow(i);
Cell numberCell = rowC.getCell(0); Cell numberCell = rowC.getCell(0);
if (StringUtils.isNull(numberCell) || numberCell.getCellType() != NUMERIC) { if (StringUtils.isNull(numberCell) || numberCell.getCellType() != NUMERIC) {
break; break;
} }
Cell materialCodeCell = rowC.getCell(1); Cell materialCodeCell = rowC.getCell(1);
@ -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());
} }

Loading…
Cancel
Save