From ba9216c14aee3f1020ec5ee18b77ce30fc7a66f0 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 8 Jan 2024 14:00:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=89=AF=E7=8E=87=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QcStaticTableController.java | 23 +++++++++++++++ .../com/op/quality/domain/QcStaticTable.java | 28 +++++++++++++------ .../quality/mapper/QcStaticTableMapper.java | 6 ++++ .../service/IQcStaticTableService.java | 2 ++ .../impl/QcStaticTableServiceImpl.java | 17 +++++++++++ .../mapper/quality/QcStaticTableMapper.xml | 16 +++++++++++ 6 files changed, 84 insertions(+), 8 deletions(-) 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 81c22991..8fb6c60d 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 @@ -11,6 +11,7 @@ import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; import com.op.common.core.utils.DateUtils; +import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckType; import com.op.system.api.domain.quality.ChartDTO; import com.op.system.api.domain.quality.ChartSeriesDTO; @@ -233,6 +234,12 @@ public class QcStaticTableController extends BaseController { public List getCheckTypeList(@PathVariable("typeCode") String typeCode) { return qcStaticTableService.getCheckTypeList(typeCode); } + + @GetMapping("/getSupplierList/{typeCode}") + public List getSupplierList(@PathVariable("typeCode") String typeCode) { + return qcStaticTableService.getSupplierList(typeCode); + } + /** * 巡检记录报表 */ @@ -290,4 +297,20 @@ public class QcStaticTableController extends BaseController { return getDataTable(list); } + @PostMapping("/exportProduceAnalysis") + public void exportProduceAnalysis(HttpServletResponse response, QcStaticTable qcStaticTable) { + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcStaticTable.getYmArrayStart())){ + LocalDate date = LocalDate.now(); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String ymStr = dtf.format(date); + qcStaticTable.setYmArrayStart(ymStr); + qcStaticTable.setYmArrayEnd(ymStr); + } + + List list = qcStaticTableService.getQmsRateTable(qcStaticTable); + ExcelUtil util = new ExcelUtil(QcStaticTable.class); + util.exportExcel(response, list, "质检不良统计"); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java index a230152f..cade73b8 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java @@ -21,10 +21,10 @@ public class QcStaticTable extends BaseEntity { private String supplierId; - @Excel(name = "供应商编号") + @Excel(name = "单位编码") private String supplierCode; - @Excel(name = "供应商名称") + @Excel(name = "单位名称") private String supplierName; private List supplierCodes; @@ -36,19 +36,34 @@ public class QcStaticTable extends BaseEntity { private int noOkBatchs; private int nums; private int okNums; - private int noOkNums; + private String typeCode; private String checkResult; private String noOkBatchRate; - private String noOkNumRate; + private String ymArrayStart; private String ymArrayEnd; private List legendData; private List xAxis; private List series; + @Excel(name = "订单编码") + private String orderNo; + @Excel(name = "批次") + private String incomeBatchNo; + @Excel(name = "产品编码") private String materialCode; + @Excel(name = "产品名称") private String materialName; + @Excel(name = "数量") + private String quality; + @Excel(name = "单位") + private String unit; + @Excel(name = "抽样数量") private String sampleQuality; + @Excel(name = "不良数量") + private int noOkNums; + @Excel(name = "不良比例") + private String noOkNumRate; private BigDecimal aNoOkquality; private BigDecimal bNoOkquality; private BigDecimal cNoOkquality; @@ -59,10 +74,7 @@ public class QcStaticTable extends BaseEntity { private String recordId; private String checkNo; - private String orderNo; - private String incomeBatchNo; - private String quality; - private String unit; + @JsonFormat(pattern = "yyyy-MM-dd") private Date incomeTime; private String checkManCode; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java index 17afffb6..7d4cbc8b 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java @@ -56,4 +56,10 @@ public interface QcStaticTableMapper { List getQmsRateTable(QcStaticTable qcStaticTable); List getCheckTypeList(String typeCode); + + List getSupplier(); + + List getLocList(); + + List getWorkcenter(); } 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 17196687..d60c07e3 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 @@ -41,4 +41,6 @@ public interface IQcStaticTableService { List getQmsRateTable(QcStaticTable qcStaticTable); List getCheckTypeList(String typeCode); + + List getSupplierList(String typeCode); } 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 7d9de927..e01b9448 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 @@ -354,6 +354,23 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return qcStaticTableMapper.getCheckTypeList(typeCode); } + @Override + @DS("#header.poolName") + public List getSupplierList(String typeCode) { + List dtos = null; + if("produce".equals(typeCode)){ + //工作中心 + dtos = qcStaticTableMapper.getWorkcenter(); + }else if("product".equals(typeCode)){ + //仓库 + dtos = qcStaticTableMapper.getLocList(); + }else if("material".equals(typeCode)){ + //供应商 + dtos = qcStaticTableMapper.getSupplier(); + } + return dtos; + } + private List getHourProductionTitle(QcStaticTable qcStaticTable) { // 返回的日期集合 diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index ce0a96b8..6379bb68 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -212,4 +212,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from qc_check_type where del_flag = '0' and type_code= #{typeCode} + + +