46824 客退电子化检验,NC处理拆解需按照pisces功能按工序退回

dev_temp_xw_202505150000_46824
jason 2 months ago
parent 958edd3435
commit 57fa03f81f

@ -783,8 +783,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean);
if (!StringUtils.isEmpty(inputModel.getWorkCellCode())) {
DdlPreparedPack.getNumEqualPack(inputModel.getWorkCenterCode(), "workCenterCode", packBean);
DdlPreparedPack.getNumEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean);
DdlPreparedPack.getStringEqualPack(inputModel.getWorkCenterCode(), "workCenterCode", packBean);
DdlPreparedPack.getStringEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean);
}
DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
@ -1416,19 +1416,22 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
detail.setSystemSyncDatetime(MesPcnExtConstWords.EMPTY);
}
private Integer getWorkCellType(String organizeCode, String workCenterCode, String workCellCode) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", packBean);
DdlPreparedPack.getNumNOEqualPack(workCellCode, "workCellCode", packBean);
DdlPreparedPack.getStringEqualPack(workCellCode, "workCellCode", packBean);
MesWorkCell workCell = workCellRDao.getByProperty(packBean);
MesExtEnumUtil.MES_PART_INSPECTION_TYPE type = null;
if (workCell != null) {
if (workCell.getType() == null) {
MesPcnException.throwFlowException(String.format("工位【%s】未维护工位类型请检查数据", workCellCode));
}
if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.PRODUCT_CELL.getValue()) {
type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK;
} else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_TYPE.GP12_CELL.getValue()) {
type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.GP12_CHECK;
} else {
MesPcnException.throwFlowException(String.format("工位【%s】维护了不支持的工位类型请检查数据", workCellCode));
}
}
return type != null ? type.getValue() : null;
@ -1453,23 +1456,25 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
Map<Integer, List<MesPartInspection>> typeMapInspection = inspectionList.stream().collect(Collectors.groupingBy(MesPartInspection::getInspectionType));
if (mesPart.getSlcGateQty() != null) {
List<MesPartInspection> inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK.getValue());
List<MesPartInspection> inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.GP12_CHECK.getValue());
final int checkCount = inspections == null ? 0 : inspections.size();
if (mesPart.getSlcGateQty() == 1) {
if (checkCount == 0) {
MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为1至少需要一次GP12检验", partNo);
MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为1至少需要一次GP12检验", partNo));
}
} else if (mesPart.getSlcGateQty() == 2) {
Set<String> opUser = inspections != null ? inspections.stream().map(MesPartInspection::getCreateUser).collect(Collectors.toSet()) : new HashSet<>();
if (opUser.size() != 2) {
MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为2需要2次不同创建人的GP12检验", partNo);
MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为2需要2次不同创建人的GP12检验", partNo));
}
}
} else if (mesPart.getOlGateQty() != null) {
}
if (mesPart.getOlGateQty() != null) {
List<MesPartInspection> inspections = typeMapInspection.get(MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK.getValue());
final int checkCount = inspections == null ? 0 : inspections.size();
if (mesPart.getSlcGateQty() == 1 && checkCount == 0) {
MesPcnException.throwFlowException("物料【%s】的SLC GATE 数量为1至少需要一次在线检验", partNo);
MesPcnException.throwFlowException(String.format("物料【%s】的SLC GATE 数量为1至少需要一次在线检验", partNo));
}
}
}

Loading…
Cancel
Save