|
|
|
@ -209,6 +209,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
MesProduceSn produceSn = getProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getPartInspection())){
|
|
|
|
|
model.getPartInspection().setQmsSync(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
}
|
|
|
|
|
//零件检测详情为空,则代表本次校验为合格。
|
|
|
|
|
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
|
|
|
|
|
MesPartInspection partInspection;
|
|
|
|
@ -354,7 +357,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
//查询当前单据明细
|
|
|
|
|
List<MesPartInspectionDetail> resultDetailList = queryResultDetailList(model, org);
|
|
|
|
|
|
|
|
|
@ -387,23 +390,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
checkProduceSn(produceSn, model.getSn());
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
String defectTypeCode = MesEnumUtil.DEFECT_TYPE_CODE.DETERMIND.getValue();
|
|
|
|
|
|
|
|
|
|
String defectTypeCodeStr = configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE") == null ? "QX130" :configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据页面上选择的位置 查询位置,若不存在则提示 位置不存在,请检查数据
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(defectTypeCodeStr, "defectTypeCode", packBean);
|
|
|
|
|
MesDefectType defectType = defectTypeRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
|
|
model.getPartInspection().setDefectTypeCode(defectType.getDefectTypeCode());
|
|
|
|
|
model.getPartInspection().setDefectTypeId(defectType.getId());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
partInspectionDetailRepository.saveAll(resultDetailList);
|
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
|
|
|
|
|
|