| | |
| | | |
| | | |
| | | @Override |
| | | public List<QualityQualifiedAnalysisDto> rawMaterialDetection(Integer type) { |
| | | public QualityQualifiedAnalysisDto rawMaterialDetection(Integer type) { |
| | | return commonDetection(type, 0); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityQualifiedAnalysisDto> processDetection(Integer type) { |
| | | public QualityQualifiedAnalysisDto processDetection(Integer type) { |
| | | return commonDetection(type, 1); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityQualifiedAnalysisDto> factoryDetection(Integer type) { |
| | | public QualityQualifiedAnalysisDto factoryDetection(Integer type) { |
| | | return commonDetection(type, 2); |
| | | } |
| | | |
| | | private List<QualityQualifiedAnalysisDto> commonDetection(Integer type, Integer inspectType) { |
| | | private QualityQualifiedAnalysisDto commonDetection(Integer type, Integer inspectType) { |
| | | |
| | | LocalDate[] range = calcDateRange(type); |
| | | LocalDate startDate = range[0]; |
| | |
| | | return new LocalDate[]{startDate, endDate}; |
| | | } |
| | | |
| | | private List<QualityQualifiedAnalysisDto> buildQualifiedAnalysis(List<QualityInspect> list) { |
| | | private QualityQualifiedAnalysisDto buildQualifiedAnalysis(List<QualityInspect> list) { |
| | | List<QualityQualifiedAnalysisDto> result = new ArrayList<>(); |
| | | QualityQualifiedAnalysisDto dto = new QualityQualifiedAnalysisDto(); |
| | | |
| | |
| | | dto.setUnqualifiedCount(0); |
| | | dto.setQualifiedRate(BigDecimal.ZERO.setScale(2)); |
| | | dto.setUnqualifiedRate(BigDecimal.ZERO.setScale(2)); |
| | | result.add(dto); |
| | | return result; |
| | | return dto; |
| | | } |
| | | |
| | | BigDecimal qualifiedCount = BigDecimal.ZERO; |
| | |
| | | if (totalCount.compareTo(BigDecimal.ZERO) == 0) { |
| | | dto.setQualifiedRate(BigDecimal.ZERO.setScale(2)); |
| | | dto.setUnqualifiedRate(BigDecimal.ZERO.setScale(2)); |
| | | result.add(dto); |
| | | return result; |
| | | return dto; |
| | | } |
| | | |
| | | BigDecimal hundred = BigDecimal.valueOf(100); |
| | |
| | | .multiply(hundred) |
| | | .setScale(2, RoundingMode.HALF_UP)); |
| | | |
| | | result.add(dto); |
| | | return result; |
| | | return dto; |
| | | } |
| | | |
| | | @Override |
| | |
| | | // 组装明细 |
| | | NonComplianceWarningDto.Item child = new NonComplianceWarningDto.Item(); |
| | | // child.setProductTitle(item.getProductName()); |
| | | child.setProductTitle(parent.getProductName()); |
| | | child.setParentProductTitle(parent.getProductName()); |
| | | child.setProductTitle(item.getProductName()); |
| | | child.setDescription(item.getDefectivePhenomena()); |
| | | child.setDate(formatDate(item.getCheckTime())); |
| | | children.add(child); |