From dfc7627430edeb7f0d66de1e0fae4f795cc8e68e Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 14 Oct 2024 22:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=97=E6=8E=A7=E6=96=87=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QcStaticTableController.java | 16 +++++ .../java/com/op/quality/domain/QcCPKInfo.java | 26 ++++++++ .../quality/domain/QcCheckReportIncome.java | 10 ++- .../op/quality/domain/QcCheckTaskProduce.java | 9 +++ .../com/op/quality/mapper/QMSFileMapper.java | 2 + .../quality/mapper/QcStaticTableMapper.java | 3 + .../service/IQcStaticTableService.java | 3 + .../impl/QcCheckReportIncomeServiceImpl.java | 8 +-- .../QcCheckReportInventoryServiceImpl.java | 8 +-- .../impl/QcCheckReportProduceServiceImpl.java | 16 ++--- .../impl/QcCheckReportProductServiceImpl.java | 8 +-- .../impl/QcCheckTaskIncomeServiceImpl.java | 1 + .../impl/QcStaticTableServiceImpl.java | 64 +++++++++++++++++++ .../mapper/quality/QMSFileMapper.xml | 3 + .../mapper/quality/QcStaticTableMapper.xml | 48 ++++++++++++++ 15 files changed, 204 insertions(+), 21 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 fb981286..ba6bd288 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 @@ -651,4 +651,20 @@ public class QcStaticTableController extends BaseController { } } } + /** + * cpk分析--表头 + **/ + @GetMapping("/getTableCPKTitle") + @Log(title = "CPK分析报表-表头", businessType = BusinessType.QUERY) + public QcCPKInfo getTableCPKTitle(QcCPKInfo qcCPKInfo) { + return qcStaticTableService.getTableCPKTitle(qcCPKInfo); + } + /** + * cpk分析--表体 + **/ + @GetMapping("/getTableCPKList") + @Log(title = "CPK分析报表-表格数据", businessType = BusinessType.QUERY) + public List getTableCPKList(QcCPKInfo qcCPKInfo) { + return qcStaticTableService.getTableCPKList(qcCPKInfo); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCPKInfo.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCPKInfo.java index 93b6e41e..cf450777 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCPKInfo.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCPKInfo.java @@ -36,7 +36,33 @@ public class QcCPKInfo extends BaseEntity { private String ruleName; private String actualValue; List mxData; + private String tableType;// + private BigDecimal upperDiff; + private BigDecimal downDiff; + public BigDecimal getUpperDiff() { + return upperDiff; + } + + public void setUpperDiff(BigDecimal upperDiff) { + this.upperDiff = upperDiff; + } + + public BigDecimal getDownDiff() { + return downDiff; + } + + public void setDownDiff(BigDecimal downDiff) { + this.downDiff = downDiff; + } + + public String getTableType() { + return tableType; + } + + public void setTableType(String tableType) { + this.tableType = tableType; + } public String getIncomeTime() { return incomeTime; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckReportIncome.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckReportIncome.java index 28cd1eef..51793467 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckReportIncome.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckReportIncome.java @@ -188,11 +188,19 @@ public class QcCheckReportIncome extends BaseEntity { private String shiftId; private String orderType; private String standardNo; - + private String fileNo; private String jgy; private String cxzz; private String pgy; + public String getFileNo() { + return fileNo; + } + + public void setFileNo(String fileNo) { + this.fileNo = fileNo; + } + public String getCxzz() { return cxzz; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskProduce.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskProduce.java index 4def1a49..e6786c81 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskProduce.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskProduce.java @@ -24,6 +24,7 @@ public class QcCheckTaskProduce extends BaseEntity { */ private String recordId; private String standardNo; + private String fileNo; /** * 检验任务编号 */ @@ -216,6 +217,14 @@ public class QcCheckTaskProduce extends BaseEntity { this.standardNo = standardNo; } + public String getFileNo() { + return fileNo; + } + + public void setFileNo(String fileNo) { + this.fileNo = fileNo; + } + public String getBz() { return bz; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QMSFileMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QMSFileMapper.java index 4e79ee5f..cdc92e96 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QMSFileMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QMSFileMapper.java @@ -19,4 +19,6 @@ public interface QMSFileMapper { int insertBaseFileBatch(@Param("baseFiles") List baseFiles); List getBaseFileBatch(String recordId); + + void clearBaseFileBatch(String recordId); } 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 fed33553..04b9232d 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 @@ -107,4 +107,7 @@ public interface QcStaticTableMapper { String getActualValues(QcCPKInfo qcCPKInfo); List getDlMxList(QcCPKInfo qcCPKInfo); + List getDLData(QcStaticTable qcStaticTable); + + List getCpkTypeList(QcCPKInfo qcCPKInfo); } 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 eefb20b0..76e6db17 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 @@ -72,4 +72,7 @@ public interface IQcStaticTableService { QcCPKInfo getDLTableMXTitle(QcCPKInfo qcCPKInfo); List getDLTableMXList(QcCPKInfo qcCPKInfo); + + QcCPKInfo getTableCPKTitle(QcCPKInfo qcCPKInfo); + List getTableCPKList(QcCPKInfo qcCPKInfo); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java index b1de4b2c..f835ecf5 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java @@ -53,10 +53,10 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi @DS("#header.poolName") public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); - //查找受控文件--standardNo - String standardNo = qcCheckReportIncomeMapper.getStandardNo(dto); - if(StringUtils.isNotBlank(standardNo)){ - dto.setStandardNo(standardNo); + //查找受控文件--fileNo + String fileNo = qcCheckReportIncomeMapper.getStandardNo(dto); + if(StringUtils.isNotBlank(fileNo)){ + dto.setFileNo(fileNo); } return dto; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportInventoryServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportInventoryServiceImpl.java index ff52d576..5209da32 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportInventoryServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportInventoryServiceImpl.java @@ -53,10 +53,10 @@ public class QcCheckReportInventoryServiceImpl implements IQcCheckReportInventor @DS("#header.poolName") public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); - //查找受控文件--standardNo - String standardNo = qcCheckReportIncomeMapper.getStandardNo(dto); - if(StringUtils.isNotBlank(standardNo)){ - dto.setStandardNo(standardNo); + //查找受控文件--fileNo + String fileNo = qcCheckReportIncomeMapper.getStandardNo(dto); + if(com.op.common.core.utils.StringUtils.isNotBlank(fileNo)){ + dto.setFileNo(fileNo); } return dto; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java index c877986a..4fae765c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java @@ -59,10 +59,10 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer @DS("#header.poolName") public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); - //查找受控文件--standardNo - String standardNo = qcCheckReportIncomeMapper.getStandardNo(dto); - if(StringUtils.isNotBlank(standardNo)){ - dto.setStandardNo(standardNo); + //查找受控文件--fileNo + String fileNo = qcCheckReportIncomeMapper.getStandardNo(dto); + if(com.op.common.core.utils.StringUtils.isNotBlank(fileNo)){ + dto.setFileNo(fileNo); } return dto; } @@ -215,7 +215,7 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer public QcCheckTaskProduce getProduceReportXJ(QcCheckTaskProduce qcCheckTaskProduce) { QcCheckTaskProduce produce = qcCheckReportIncomeMapper.getTopInfo(qcCheckTaskProduce); - //查找受控文件--standardNo + //查找受控文件--fileNo QcCheckReportIncome dto0 = new QcCheckReportIncome(); String dateFormat = "yyyy-MM-dd"; @@ -233,9 +233,9 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer } dto0.setCheckType("checkTypeSCXJ"); - String standardNo = qcCheckReportIncomeMapper.getStandardNo(dto0); - if(StringUtils.isNotBlank(standardNo)){ - produce.setStandardNo(standardNo); + String fileNo = qcCheckReportIncomeMapper.getStandardNo(dto0); + if(StringUtils.isNotBlank(fileNo)){ + produce.setFileNo(fileNo); } //批次号去重 diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java index 62cd790c..8ae39563 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java @@ -52,10 +52,10 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer @DS("#header.poolName") public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { QcCheckReportIncome dto = qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); - //查找受控文件--standardNo - String standardNo = qcCheckReportIncomeMapper.getStandardNo(dto); - if(StringUtils.isNotBlank(standardNo)){ - dto.setStandardNo(standardNo); + //查找受控文件--fileNo + String fileNo = qcCheckReportIncomeMapper.getStandardNo(dto); + if(com.op.common.core.utils.StringUtils.isNotBlank(fileNo)){ + dto.setFileNo(fileNo); } //汇总批次号 List batchs = qcCheckReportIncomeMapper.getBatchsByTaskId(recordId); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 3cbb1174..25ad4c9a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -929,6 +929,7 @@ public class QcCheckTaskIncomeServiceImpl implements sampleQuality = sampleQuality.add(new BigDecimal(detail.getSampleQuality()==null?"0":detail.getSampleQuality())); //上传附件 if (StringUtils.isNotEmpty(detail.getFileListStr())) { + qmsFileMapper.clearBaseFileBatch(detail.getRecordId());//清理 String[] ids = detail.getFileListStr().split(","); List files = new ArrayList<>(); BaseFileData file = null; 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 9a7ca4b6..33fa2c0a 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 @@ -236,6 +236,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { //List myObjectList = convertList(mapData); return mapData; } + @Override @DS("#header.poolName") public QcCPKInfo getDLTableMXTitle(QcCPKInfo qcCPKInfo) { @@ -1246,7 +1247,70 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { // // return myObjectList; // } + /***********CPK分析报表**********/ + @Override + @DS("#header.poolName") + public QcCPKInfo getTableCPKTitle(QcCPKInfo qcCPKInfo) { + QcCPKInfo dto = new QcCPKInfo(); + List colName1 = null; + if("week".equals(qcCPKInfo.getTableType())){//周报 + + }else{//月报 + colName1 = this.getMonthByMonth(qcCPKInfo.getYmArrayStart(),qcCPKInfo.getYmArrayEnd()); + } + + dto.setTitleCol1(colName1); + return dto; + } + @Override + @DS("#header.poolName") + public List getTableCPKList(QcCPKInfo qcCPKInfo) { + List colNameArray = null; + if("week".equals(qcCPKInfo.getTableType())){//周报 + }else{//月报 + colNameArray = this.getMonthByMonth(qcCPKInfo.getYmArrayStart(),qcCPKInfo.getYmArrayEnd()); + } + List mapData = new ArrayList(); + //列表数据 + //主列 + List cpkTypeList = qcStaticTableMapper.getCpkTypeList(qcCPKInfo); + //数据列 + List dxData = qcStaticTableMapper.getDlMxList(qcCPKInfo); + + HashMap dmap = null; + for(QcCPKInfo cpkInfo:dxData){ +// dmap = new HashMap(); +// double USL = dto.getUpperDiff().doubleValue(); +// double LSL = dto.getDownDiff().doubleValue(); +// double cpk = calculateCpk(data,USL,LSL); +// BigDecimal cpkVal = new BigDecimal(Double.toString(cpk)).setScale(2, BigDecimal.ROUND_HALF_UP); +// for(int m=0;m myObjectList = convertList(mapData); + return mapData; + } + + //获取指定范围内得月份输出格式yyyy-mm + private List getMonthByMonth(String startM,String endM){ + YearMonth start = YearMonth.of(Integer.parseInt(startM.split("-")[0]), Integer.parseInt(startM.split("-")[1])); + YearMonth end = YearMonth.of(Integer.parseInt(endM.split("-")[0]), Integer.parseInt(endM.split("-")[1])); + + List months = new ArrayList<>(); + YearMonth current = start; + + while (!current.isAfter(end)) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + months.add(current.format(formatter)); + current = current.plusMonths(1); + } + return months; + } public static void main(String args[]){ String ymd = "1、0.4016"; System.out.println(ymd.substring(2)); diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QMSFileMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QMSFileMapper.xml index 56228977..0eff6146 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QMSFileMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QMSFileMapper.xml @@ -39,6 +39,9 @@ ) + + delete from base_file where source_id = #{sourceId} + + + + +