From 738c21b07c6c616117007726e02171fdf5e5e146 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 24 Jan 2024 17:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E5=8A=A0=E8=BD=BD=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quality/mapper/QcStaticTableMapper.java | 2 + .../impl/QcStaticTableServiceImpl.java | 246 +++++++++--------- .../mapper/quality/QcStaticTableMapper.xml | 25 ++ 3 files changed, 150 insertions(+), 123 deletions(-) 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 7d4cbc8b..dc900527 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 @@ -62,4 +62,6 @@ public interface QcStaticTableMapper { List getLocList(); List getWorkcenter(); + @MapKey("recordId") + Map picsMap(QcStaticTable qcStaticTable); } 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 88661d28..afd6424c 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 @@ -166,202 +166,202 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { public List getXJCheckTableDetail(QcStaticTable qcStaticTable) { List projects = qcStaticTableMapper.getXJProjects(qcStaticTable); Map detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable); + Map picsMap = qcStaticTableMapper.picsMap(qcStaticTable); for(QcStaticTable project:projects){ - this.getDataFromMap(detailMap,project); + this.getDataFromMap(detailMap,project,picsMap); } - return projects; } - private void getDataFromMap(Map detailMap,QcStaticTable project){ + private void getDataFromMap(Map detailMap,QcStaticTable project,Map picsMap){ String keystr = project.getProjectId()+"08"; QcStaticTable detail = detailMap.get(keystr); - if(detail!=null&&StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn080090(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn080090(project.getColumn080090()+","+picurls); - } - }else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn080090(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if (StringUtils.isNotBlank(detail.getRemark())) { + project.setColumn080090(detail.getRemark()); + } else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) { + project.setColumn080090(detail.getStatus().equals("Y") ? "✓" : "✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn080090(project.getColumn080090()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn080090("-"); } keystr = project.getProjectId()+"09"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn090100(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn090100(project.getColumn090100()+","+picurls); - } - }else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn090100(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null){ + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn090100(detail.getRemark()); + }else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn090100(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn090100(project.getColumn090100()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn090100("-"); } keystr = project.getProjectId()+"10"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn100110(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn100110(project.getColumn100110()+","+picurls); - } - }else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn100110(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null){ + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn100110(detail.getRemark()); + }else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn100110(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn100110(project.getColumn100110()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn100110("-"); } keystr = project.getProjectId()+"11"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn110120(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn110120(project.getColumn110120()+","+picurls); - } - }else if(detail!=null&&detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn110120(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null){ + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn110120(detail.getRemark()); + }else if(detail!=null&&detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn110120(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn110120(project.getColumn110120()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn110120("-"); } keystr = project.getProjectId()+"12"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn123133(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn123133(project.getColumn123133()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn123133(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if (StringUtils.isNotBlank(detail.getRemark())) { + project.setColumn123133(detail.getRemark()); + } else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) { + project.setColumn123133(detail.getStatus().equals("Y") ? "✓" : "✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn123133(project.getColumn123133()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn123133("-"); } keystr = project.getProjectId()+"13"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn133143(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn133143(project.getColumn133143()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn133143(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null){ + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn133143(detail.getRemark()); + }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn133143(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn133143(project.getColumn133143()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn133143("-"); } keystr = project.getProjectId()+"14"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn143153(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn143153(project.getColumn143153()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn143153(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if (StringUtils.isNotBlank(detail.getRemark())) { + project.setColumn143153(detail.getRemark()); + } else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) { + project.setColumn143153(detail.getStatus().equals("Y") ? "✓" : "✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn143153(project.getColumn143153()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn143153("-"); } keystr = project.getProjectId()+"15"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn153163(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn153163(project.getColumn153163()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn153163(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if (StringUtils.isNotBlank(detail.getRemark())) { + project.setColumn153163(detail.getRemark()); + } else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) { + project.setColumn153163(detail.getStatus().equals("Y") ? "✓" : "✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn153163(project.getColumn153163()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn153163("-"); } keystr = project.getProjectId()+"16"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn163173(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn163173(project.getColumn163173()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn163173(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn163173(detail.getRemark()); + }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn163173(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn163173(project.getColumn163173()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn163173("-"); } keystr = project.getProjectId()+"18"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn180190(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn180190(project.getColumn180190()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn180190(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn180190(detail.getRemark()); + }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn180190(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn180190(project.getColumn180190()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn180190("-"); } keystr = project.getProjectId()+"19"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn190200(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn190200(project.getColumn190200()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn190200(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn190200(detail.getRemark()); + }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn190200(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn190200(project.getColumn190200()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn190200("-"); } keystr = project.getProjectId()+"20"; detail = detailMap.get(keystr); - if(detail!=null && StringUtils.isNotBlank(detail.getRemark())){ - project.setColumn200210(detail.getRemark()); - List files = qmsFileMapper.getBaseFileBatch(detail.getRecordId()); - if (!CollectionUtils.isEmpty(files)) { - List pics = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList()); - String picurls = pics.stream().collect(Collectors.joining(",")); - project.setColumn200210(project.getColumn200210()+","+picurls); - } - }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ - project.setColumn200210(detail.getStatus().equals("Y")?"✓":"✘"); + if(detail!=null) { + if(StringUtils.isNotBlank(detail.getRemark())){ + project.setColumn200210(detail.getRemark()); + }else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){ + project.setColumn200210(detail.getStatus().equals("Y")?"✓":"✘"); + } + QcStaticTable urlDTO = picsMap.get(detail.getRecordId()); + if(urlDTO!=null){ + project.setColumn200210(project.getColumn200210()+","+urlDTO.getProjectId());//projectId存的照片路径 + } }else{ project.setColumn200210("-"); } 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 8cd539fb..1e5aca00 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 @@ -230,4 +230,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" factory_code supplierCode from sys_factory where f_type = 'c' +