|
|
@ -42,6 +42,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Description :
|
|
|
|
* @Description :
|
|
|
@ -136,7 +137,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
//获取NC-零件检测-单据
|
|
|
|
//获取NC-零件检测-单据
|
|
|
|
MesPartInspection partInspection = null;
|
|
|
|
MesPartInspection partInspection = null;
|
|
|
|
Integer sourceType;
|
|
|
|
Integer sourceType;
|
|
|
|
if (!StringUtils.isEmpty(model.getSn())) {
|
|
|
|
if (!StringUtils.isEmpty(model.getSn()) && StringUtils.isEmpty(model.getLotNo())) {
|
|
|
|
// 数据校验
|
|
|
|
// 数据校验
|
|
|
|
ValidatorBean.checkNotNull(model.getFrontBack(), "正反面不能为空");
|
|
|
|
ValidatorBean.checkNotNull(model.getFrontBack(), "正反面不能为空");
|
|
|
|
//检查条码
|
|
|
|
//检查条码
|
|
|
@ -164,8 +165,11 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
if(!Objects.isNull(model.getId())){
|
|
|
|
if(!Objects.isNull(model.getId())){
|
|
|
|
partInspection = getPartInspectionByPartAndLot(model, model.getOrganizeCode());
|
|
|
|
partInspection = getPartInspectionByPartAndLot(model, model.getOrganizeCode());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(model.getSn())) {
|
|
|
|
sourceType = MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue();
|
|
|
|
sourceType = MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.IMPORT.getValue();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
sourceType = MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//检查零件类型与图片对应关系
|
|
|
|
//检查零件类型与图片对应关系
|
|
|
@ -790,13 +794,15 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private MesPartInspection getPartInspectionByPartAndLot(MesPartInspectionInputModel inputModel, String org) {
|
|
|
|
private MesPartInspection getPartInspectionByPartAndLot(MesPartInspectionInputModel inputModel, String org) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer> list = Stream.of(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue(),MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.IMPORT.getValue()).collect(Collectors.toList());
|
|
|
|
//根据扫描的条码查询条码是否存在
|
|
|
|
//根据扫描的条码查询条码是否存在
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
DdlPreparedPack.getNumEqualPack(inputModel.getId(), "id", packBean);
|
|
|
|
DdlPreparedPack.getNumEqualPack(inputModel.getId(), "id", packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getPartNo(), "partNo", packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getPartNo(), "partNo", packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getLotNo(), "lotNo", packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getLotNo(), "lotNo", packBean);
|
|
|
|
DdlPreparedPack.getNegativeNumEqualPack(inputModel.getQty(), "qty", packBean);
|
|
|
|
DdlPreparedPack.getNegativeNumEqualPack(inputModel.getQty(), "qty", packBean);
|
|
|
|
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue(), "sourceType", packBean);
|
|
|
|
DdlPreparedPack.getInPackList(list, "sourceType", packBean);
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
|
|
|
|
MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean);
|
|
|
|
MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean);
|
|
|
|
|
|
|
|
|
|
|
|