|
|
|
@ -810,17 +810,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
if (StringUtils.isEmpty(inputModel.getWorkCellCode())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int refundFlag = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
|
|
|
|
|
if (inputModel.getOptType() == 2) {
|
|
|
|
|
refundFlag = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据条码找最近一条单据
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean);
|
|
|
|
|
DdlPreparedPack.getStringNoEqualPack(inputModel.getWorkCellCode(), "workCellCode", packBean);
|
|
|
|
|
DdlPreparedPack.getStringNotBlanklPack("workCellCode", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue(), "ncStatus", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), "inspectionStatus", packBean);
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
|
|
|
|
MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean);
|
|
|
|
@ -1471,16 +1466,11 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
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 != null && workCell.getType() != null) {
|
|
|
|
|
if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_TYPE.PRODUCT_CELL.getValue()) {
|
|
|
|
|
type = MesExtEnumUtil.MES_PART_INSPECTION_TYPE.ONLINE_CHECK;
|
|
|
|
|
} else if (workCell.getType() == MesExtEnumUtil.MES_WORK_CELL_CHECK_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;
|
|
|
|
|