iqc报表修改条件
This commit is contained in:
parent
95925bc2fd
commit
f2cb1c996e
|
|
@ -22,6 +22,7 @@ public class QmdReportManagementControllerService {
|
|||
|
||||
private final IQmsInspectionStandardService inspectionStandardService;
|
||||
private final IQmsInspectionStandardItemService inspectionStandardItemService;
|
||||
private final IQmsQcMaterialService qcMaterialService;
|
||||
private final IQmsPdiDetectionRulesService pdiDetectionRulesService;
|
||||
private final IQmsPdiDetectionRulesStatusItemService pdiStatusItemService;
|
||||
private final IQmsPdiComponentAnagementService pdiComponentService;
|
||||
|
|
@ -33,8 +34,13 @@ public class QmdReportManagementControllerService {
|
|||
* IQC报表查询
|
||||
*/
|
||||
public List<QmdReportManagementVO.IqcReportItemVO> searchIqc(QmdReportManagementQO.IqcReportQO request) {
|
||||
List<Long> materialIds = getIqcMaterialIds(request.getMaterialNo());
|
||||
if (CollectionUtil.isEmpty(materialIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
QmsInspectionStandard currentStandard = inspectionStandardService.lambdaQuery()
|
||||
.eq(QmsInspectionStandard::getMaterialId, request.getMaterialId())
|
||||
.in(QmsInspectionStandard::getMaterialId, materialIds)
|
||||
.eq(QmsInspectionStandard::getVersion, request.getVersion())
|
||||
.last("LIMIT 1")
|
||||
.one();
|
||||
|
|
@ -51,7 +57,7 @@ public class QmdReportManagementControllerService {
|
|||
}
|
||||
|
||||
List<QmsInspectionStandard> allStandards = inspectionStandardService.lambdaQuery()
|
||||
.eq(QmsInspectionStandard::getMaterialId, request.getMaterialId())
|
||||
.in(QmsInspectionStandard::getMaterialId, materialIds)
|
||||
.list();
|
||||
Map<Long, String> versionMap = allStandards.stream()
|
||||
.collect(Collectors.toMap(QmsInspectionStandard::getId, QmsInspectionStandard::getVersion, (a, b) -> a));
|
||||
|
|
@ -84,9 +90,14 @@ public class QmdReportManagementControllerService {
|
|||
* IQC版本号查询
|
||||
*/
|
||||
public List<String> searchIqcVersions(QmdReportManagementQO.IqcVersionQO request) {
|
||||
List<Long> materialIds = getIqcMaterialIds(request.getMaterialNo());
|
||||
if (CollectionUtil.isEmpty(materialIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return inspectionStandardService.lambdaQuery()
|
||||
.select(QmsInspectionStandard::getVersion)
|
||||
.eq(QmsInspectionStandard::getMaterialId, request.getMaterialId())
|
||||
.in(QmsInspectionStandard::getMaterialId, materialIds)
|
||||
.list()
|
||||
.stream()
|
||||
.map(QmsInspectionStandard::getVersion)
|
||||
|
|
@ -251,6 +262,17 @@ public class QmdReportManagementControllerService {
|
|||
.toList();
|
||||
}
|
||||
|
||||
private List<Long> getIqcMaterialIds(String materialNo) {
|
||||
return qcMaterialService.lambdaQuery()
|
||||
.select(QmsQcMaterial::getId)
|
||||
.eq(QmsQcMaterial::getMaterialNo, materialNo)
|
||||
.list()
|
||||
.stream()
|
||||
.map(QmsQcMaterial::getId)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
|
||||
private Map<Long, QmsPdiComponentAnagement> getPdiComponentMap(List<QmsPdiDetectionRulesStatusItem> items) {
|
||||
Set<Long> componentIds = items.stream()
|
||||
.map(QmsPdiDetectionRulesStatusItem::getComponentsId)
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ public class QmdReportManagementQO {
|
|||
public static class IqcReportQO {
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
* 物料编号
|
||||
*/
|
||||
@JsonAlias("material_id")
|
||||
@NotNull(message = "物料ID不能为空")
|
||||
private Long materialId;
|
||||
@JsonAlias("material_no")
|
||||
@NotBlank(message = "物料编号不能为空")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
|
|
@ -31,11 +31,11 @@ public class QmdReportManagementQO {
|
|||
public static class IqcVersionQO {
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
* 物料编号
|
||||
*/
|
||||
@JsonAlias("material_id")
|
||||
@NotNull(message = "物料ID不能为空")
|
||||
private Long materialId;
|
||||
@JsonAlias("material_no")
|
||||
@NotBlank(message = "物料编号不能为空")
|
||||
private String materialNo;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
|
|||
Loading…
Reference in New Issue