|
|
|
@ -161,13 +161,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
//检查物料
|
|
|
|
|
part = checkPartByPartNo(model.getPartNo(), model.getOrganizeCode());
|
|
|
|
|
//20250517-46981 电子化检验 NC判定 虚结构不可录入
|
|
|
|
|
DdlPackBean productVersionPackBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack("虚零件", "description", productVersionPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(part.getPartNo(), "partNo", productVersionPackBean);
|
|
|
|
|
int count = productVersionRepository.findByHqlWhereCount(productVersionPackBean);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】物料号为虚零件,请检查数据", part.getPartNo()));
|
|
|
|
|
}
|
|
|
|
|
checkPartIsImaginaryStructure(model.getOrganizeCode(), model.getPartNo());
|
|
|
|
|
|
|
|
|
|
//获取NC-零件检测-单据
|
|
|
|
|
if(!Objects.isNull(model.getId())){
|
|
|
|
@ -1082,13 +1076,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//20250517-46981 电子化检验 NC判定 虚结构不可录入
|
|
|
|
|
DdlPackBean productVersionPackBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack("虚零件", "description", productVersionPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(part.getPartNo(), "partNo", productVersionPackBean);
|
|
|
|
|
int count = productVersionRepository.findByHqlWhereCount(productVersionPackBean);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
throw new ImppBusiException(String.format("【%s】此条码对应【%s】物料号为虚零件,请检查数据", produceSn.getProductSn(), produceSn.getPartNo()));
|
|
|
|
|
}
|
|
|
|
|
checkPartIsImaginaryStructure(org, part.getPartNo());
|
|
|
|
|
|
|
|
|
|
return part;
|
|
|
|
|
}
|
|
|
|
@ -1420,4 +1408,15 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
detail.setSystemSyncStatus(CommonEnumUtil.FALSE);
|
|
|
|
|
detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkPartIsImaginaryStructure(String organizeCode, String partNo) {
|
|
|
|
|
DdlPackBean productVersionPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack("虚零件", "description", productVersionPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, "partNo", productVersionPackBean);
|
|
|
|
|
int count = productVersionRepository.findByHqlWhereCount(productVersionPackBean);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
throw new ImppBusiException(String.format("物料号【%s】为虚零件,请检查数据", partNo));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|