From c3907c14c644960adc6b954b0770b2c8c77170c3 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 2 Jan 2024 09:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=9D=AF=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/quality/ChartSeriesDTO.java | 31 +++++++++ .../controller/QcProCheckController.java | 10 ++- .../controller/QcStaticTableController.java | 22 +++++++ .../com/op/quality/domain/QcProCheck.java | 37 +++++++++++ .../op/quality/mapper/QcProCheckMapper.java | 3 + .../service/IQcStaticTableService.java | 2 + .../op/quality/service/QcProCheckService.java | 4 ++ .../service/impl/QcProCheckServiceImpl.java | 33 ++++++++++ .../impl/QcStaticTableServiceImpl.java | 6 ++ .../mapper/quality/QcProCheckMapper.xml | 65 +++++++++++++++++++ 10 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/ChartSeriesDTO.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/ChartSeriesDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/ChartSeriesDTO.java new file mode 100644 index 00000000..24e016d7 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/quality/ChartSeriesDTO.java @@ -0,0 +1,31 @@ +package com.op.system.api.domain.quality; + +import java.util.List; + +/** + * + *echart 图标实体 + * @author zxl + * @date 2023-07-18 + */ +public class ChartSeriesDTO { + + private List yAxisData; + private List series; + + public List getyAxisData() { + return yAxisData; + } + + public void setyAxisData(List yAxisData) { + this.yAxisData = yAxisData; + } + + public List getSeries() { + return series; + } + + public void setSeries(List series) { + this.series = series; + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProCheckController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProCheckController.java index ad10e2bd..95e70087 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProCheckController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcProCheckController.java @@ -9,6 +9,8 @@ import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.quality.domain.QcProCheck; import com.op.quality.service.QcProCheckService; +import com.op.system.api.domain.quality.ChartDTO; +import com.op.system.api.domain.quality.ChartSeriesDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -30,7 +32,13 @@ public class QcProCheckController extends BaseController { @GetMapping("/list") public List list(QcProCheck qcProCheck) { List qcProChecks = qcProCheckService.selectQcCheckList(qcProCheck); - return qcProCheckService.selectQcCheckList(qcProCheck); + return qcProChecks; + } + + @GetMapping("/getHfChartData") + public ChartSeriesDTO getHfChartData(QcProCheck qcProCheck) { + ChartSeriesDTO dto = qcProCheckService.getHfChartData(qcProCheck); + return dto; } @Log(title = "白坯合格统计", businessType = BusinessType.EXPORT) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java index 47328712..058b964f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java @@ -226,4 +226,26 @@ public class QcStaticTableController extends BaseController { public List getWorkcenterList(FactoryDto factoryDto) { return qcStaticTableService.getWorkcenterList(factoryDto); } + + /** + * 巡检记录报表 + */ + @RequiresPermissions("quality:qcTableXJ:list") + @GetMapping("/getXJCheckTableList") + public List getXJCheckTableList(QcStaticTable qcStaticTable) { + if(StringUtils.isNotBlank(qcStaticTable.getSupplierCode())){ + List codes = Arrays.asList(qcStaticTable.getSupplierCode().split(",")); + qcStaticTable.setSupplierCodes(codes); + } + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcStaticTable.getYearMonth())){ + LocalDate date = LocalDate.now(); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM"); + String ymStr = dtf.format(date); + qcStaticTable.setYearMonth(ymStr);//end + } + startPage(); + List list = qcStaticTableService.getXJCheckTableList(qcStaticTable); + return list; + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcProCheck.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcProCheck.java index 9458ce00..d45b3ba0 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcProCheck.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcProCheck.java @@ -83,6 +83,43 @@ public class QcProCheck extends BaseEntity { @Excel(name = "合格率") private String passRate; + private String chartType; + private String quality; + private String okQuality; + private String shiftId; + + public String getShiftId() { + return shiftId; + } + + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public String getOkQuality() { + return okQuality; + } + + public void setOkQuality(String okQuality) { + this.okQuality = okQuality; + } + + public String getQuality() { + return quality; + } + + public void setQuality(String quality) { + this.quality = quality; + } + + public String getChartType() { + return chartType; + } + + public void setChartType(String chartType) { + this.chartType = chartType; + } + public String getAcceptanceNumber() { return acceptanceNumber; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java index f3963e23..eb3afc24 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java @@ -39,4 +39,7 @@ public interface QcProCheckMapper { List getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome); List getQcProCheckList(QcProCheck qcProCheck); + + List getHFnames(QcProCheck qcProCheck); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java index e722ca1e..eaed1b39 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java @@ -29,4 +29,6 @@ public interface IQcStaticTableService { public Map getProduceChartDataYM(QcStaticTable qcStaticTable); List getWorkcenterList(FactoryDto factoryDto); + + List getXJCheckTableList(QcStaticTable qcStaticTable); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java index 8619fd2b..8c7b7c6c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java @@ -7,6 +7,8 @@ import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcProCheck; import com.op.system.api.domain.SysDictData; +import com.op.system.api.domain.quality.ChartDTO; +import com.op.system.api.domain.quality.ChartSeriesDTO; import java.util.List; @@ -39,4 +41,6 @@ public interface QcProCheckService { List getQcUnitList(SysDictData sysDictData); List selectQcCheckList(QcProCheck qcProCheck); + + ChartSeriesDTO getHfChartData(QcProCheck qcProCheck); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index daee7bf0..b8c739f9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -14,6 +14,8 @@ import com.op.quality.mapper.QcCheckTaskIncomeMapper; import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.service.QcProCheckService; import com.op.system.api.domain.SysDictData; +import com.op.system.api.domain.quality.ChartDTO; +import com.op.system.api.domain.quality.ChartSeriesDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -151,4 +153,35 @@ public class QcProCheckServiceImpl implements QcProCheckService { return qcProCheckMapper.getQcProCheckList(qcProCheck); } + @Override + @DS("#header.poolName") + public ChartSeriesDTO getHfChartData(QcProCheck qcProCheck) { + ChartSeriesDTO dto = new ChartSeriesDTO(); + List checkList = null; + List yData = new ArrayList<>(); + List sers = new ArrayList<>(); + checkList = qcProCheckMapper.getHFnames(qcProCheck); + ChartDTO chartDTO = new ChartDTO(); + chartDTO.setName("合格"); + List data = new ArrayList<>(); + + ChartDTO chartDTO0 = new ChartDTO(); + chartDTO0.setName("不合格"); + List data0 = new ArrayList<>(); + for(QcProCheck check:checkList){ + yData.add(check.getMachineName()); + data.add(Double.parseDouble(check.getOkQuality())); + data0.add(Double.parseDouble(check.getQuality())-Double.parseDouble(check.getOkQuality())); + } + chartDTO.setData(data); + chartDTO0.setData(data0); + sers.add(chartDTO); + sers.add(chartDTO0); + + dto.setyAxisData(yData); + dto.setSeries(sers); + + return dto; + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index a1f9e4d8..6b888201 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -136,5 +136,11 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return qcStaticTableMapper.getWorkcenterList(factoryDto); } + /**巡检**/ + @Override + public List getXJCheckTableList(QcStaticTable qcStaticTable) { + return null; + } + } diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml index 6aadc642..de5b8fa8 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml @@ -286,5 +286,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY q1.machine_code +