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