From 9f17a97bbf724cd7c5afc45d0c35555f48e64434 Mon Sep 17 00:00:00 2001 From: qdxkrs Date: Mon, 28 Feb 2022 19:53:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/WordAndExcelApplication.java | 4 +++ .../QcInspectionDataSourceController.java | 6 ++--- .../QcInspectionItemDictController.java | 12 ++++----- .../QcInspectionSpecController.java | 4 +-- .../xkrs/dao/QcInspectionDataSourceDao.java | 6 ++--- .../com/xkrs/dao/QcInspectionFileDao.java | 6 ++--- .../com/xkrs/dao/QcInspectionItemDictDao.java | 8 +++--- .../com/xkrs/dao/QcInspectionPictureDao.java | 6 ++--- .../com/xkrs/dao/QcInspectionSpecDao.java | 6 ++--- ...java => QcInspectionDataSourceEntity.java} | 6 ++--- ...nFile.java => QcInspectionFileEntity.java} | 6 ++--- ...t.java => QcInspectionItemDictEntity.java} | 6 ++--- ...re.java => QcInspectionPictureEntity.java} | 6 ++--- ...nSpec.java => QcInspectionSpecEntity.java} | 6 ++--- .../QcInspectionDataSourceServiceImpl.java | 26 +++++++++---------- .../impl/QcInspectionFileServiceImpl.java | 24 ++++++++--------- .../impl/QcInspectionItemDictServiceImpl.java | 12 ++++----- .../impl/QcInspectionPictureServiceImpl.java | 4 +-- .../impl/QcInspectionSpecServiceImpl.java | 4 +-- src/main/java/com/xkrs/util/Query.java | 8 +++--- 20 files changed, 85 insertions(+), 81 deletions(-) rename src/main/java/com/xkrs/model/entity/{QcInspectionDataSource.java => QcInspectionDataSourceEntity.java} (84%) rename src/main/java/com/xkrs/model/entity/{QcInspectionFile.java => QcInspectionFileEntity.java} (85%) rename src/main/java/com/xkrs/model/entity/{QcInspectionItemDict.java => QcInspectionItemDictEntity.java} (89%) rename src/main/java/com/xkrs/model/entity/{QcInspectionPicture.java => QcInspectionPictureEntity.java} (84%) rename src/main/java/com/xkrs/model/entity/{QcInspectionSpec.java => QcInspectionSpecEntity.java} (96%) diff --git a/src/main/java/com/xkrs/WordAndExcelApplication.java b/src/main/java/com/xkrs/WordAndExcelApplication.java index faf59b4..d8eb26b 100644 --- a/src/main/java/com/xkrs/WordAndExcelApplication.java +++ b/src/main/java/com/xkrs/WordAndExcelApplication.java @@ -2,11 +2,15 @@ package com.xkrs; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; @SpringBootApplication //@ComponentScan(basePackages = {"com.xkrs.model.entity", "com.xkrs.controller", "com.xkrs.service"}) //@ComponentScan("com.xkrs.model.entity") +@Configuration +@EntityScan("com.xkrs.model.entity.*") public class WordAndExcelApplication { public static void main(String[] args) { diff --git a/src/main/java/com/xkrs/controller/QcInspectionDataSourceController.java b/src/main/java/com/xkrs/controller/QcInspectionDataSourceController.java index 995eaab..4683657 100644 --- a/src/main/java/com/xkrs/controller/QcInspectionDataSourceController.java +++ b/src/main/java/com/xkrs/controller/QcInspectionDataSourceController.java @@ -2,7 +2,7 @@ package com.xkrs.controller; import com.xkrs.dao.QcInspectionDataSourceDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionDataSource; +import com.xkrs.model.entity.QcInspectionDataSourceEntity; import com.xkrs.model.qo.QcInspectionDataSourceQo; import com.xkrs.service.QcInspectionDataSourceService; import org.springframework.context.i18n.LocaleContextHolder; @@ -53,7 +53,7 @@ public class QcInspectionDataSourceController { String modelNo = inspectionDataSourceQo.getModelNo(); String partNo = inspectionDataSourceQo.getPartNo(); Locale locale = LocaleContextHolder.getLocale(); - List inspectionDataSources = inspectionDataSourceDao.selectDataSource(lotNo, machineNo, materialNo, modelNo, partNo); + List inspectionDataSources = inspectionDataSourceDao.selectDataSource(lotNo, machineNo, materialNo, modelNo, partNo); if (inspectionDataSources == null || inspectionDataSources.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale); } @@ -68,7 +68,7 @@ public class QcInspectionDataSourceController { @GetMapping("/selectAllSource") public String selectAllSource() { Locale locale = LocaleContextHolder.getLocale(); - List dataSourceAll = inspectionDataSourceDao.findAll(); + List dataSourceAll = inspectionDataSourceDao.findAll(); if (dataSourceAll.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale); } diff --git a/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java b/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java index 9f9d80f..bec4b03 100644 --- a/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java +++ b/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java @@ -2,7 +2,7 @@ package com.xkrs.controller; import com.xkrs.dao.QcInspectionItemDictDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import com.xkrs.model.qo.QcInspectionItemDictQo; import com.xkrs.service.QcInspectionItemDictService; import com.xkrs.util.Query; @@ -53,11 +53,11 @@ public class QcInspectionItemDictController { @GetMapping("/selectDataDict") public String selectDataDict(@RequestParam("inspectionItemCode") String inspectionItemCode, @RequestParam("inspectionItemName") String inspectionItemName) { Locale locale = LocaleContextHolder.getLocale(); - List qcInspectionItemDict = query.selectDataDict(inspectionItemCode, inspectionItemName); - if (qcInspectionItemDict == null || qcInspectionItemDict.size() == 0) { + List qcInspectionItemDictEntity = query.selectDataDict(inspectionItemCode, inspectionItemName); + if (qcInspectionItemDictEntity == null || qcInspectionItemDictEntity.size() == 0) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有该型号类型的字典信息!", locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, qcInspectionItemDict, locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, qcInspectionItemDictEntity, locale); } /** @@ -69,8 +69,8 @@ public class QcInspectionItemDictController { @GetMapping("/selectDataDictById") public String selectDataDictById(@RequestParam("id") Integer id) { Locale locale = LocaleContextHolder.getLocale(); - QcInspectionItemDict qcInspectionItemDict = inspectionItemDictDao.findById(id); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, qcInspectionItemDict, locale); + QcInspectionItemDictEntity qcInspectionItemDictEntity = inspectionItemDictDao.findById(id); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, qcInspectionItemDictEntity, locale); } /** diff --git a/src/main/java/com/xkrs/controller/QcInspectionSpecController.java b/src/main/java/com/xkrs/controller/QcInspectionSpecController.java index 499b6ba..cbdadb2 100644 --- a/src/main/java/com/xkrs/controller/QcInspectionSpecController.java +++ b/src/main/java/com/xkrs/controller/QcInspectionSpecController.java @@ -2,7 +2,7 @@ package com.xkrs.controller; import com.xkrs.dao.QcInspectionSpecDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionSpec; +import com.xkrs.model.entity.QcInspectionSpecEntity; import com.xkrs.model.qo.QcInspectionSpecQo; import com.xkrs.service.QcInspectionSpecService; import org.springframework.context.i18n.LocaleContextHolder; @@ -45,7 +45,7 @@ public class QcInspectionSpecController { Locale locale = LocaleContextHolder.getLocale(); String partNo = inspectionSpecQo.getPartNo(); String inspectionItemCode = inspectionSpecQo.getInspectionItemCode(); - List inspectionSpecs = inspectionSpecDao.findByPartNoAndInspectionItemCode(partNo, inspectionItemCode); + List inspectionSpecs = inspectionSpecDao.findByPartNoAndInspectionItemCode(partNo, inspectionItemCode); if (inspectionSpecs == null || inspectionSpecs.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该零件的规格信息!", locale); } diff --git a/src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java b/src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java index eb42c45..52952b4 100644 --- a/src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java +++ b/src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java @@ -1,6 +1,6 @@ package com.xkrs.dao; -import com.xkrs.model.entity.QcInspectionDataSource; +import com.xkrs.model.entity.QcInspectionDataSourceEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; @@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository; import java.util.List; @Repository -public interface QcInspectionDataSourceDao extends JpaRepository, JpaSpecificationExecutor { +public interface QcInspectionDataSourceDao extends JpaRepository, JpaSpecificationExecutor { /** * 查询质检数据源 @@ -22,6 +22,6 @@ public interface QcInspectionDataSourceDao extends JpaRepository selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); + List selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); } \ No newline at end of file diff --git a/src/main/java/com/xkrs/dao/QcInspectionFileDao.java b/src/main/java/com/xkrs/dao/QcInspectionFileDao.java index b54fad6..294eced 100644 --- a/src/main/java/com/xkrs/dao/QcInspectionFileDao.java +++ b/src/main/java/com/xkrs/dao/QcInspectionFileDao.java @@ -1,6 +1,6 @@ package com.xkrs.dao; -import com.xkrs.model.entity.QcInspectionFile; +import com.xkrs.model.entity.QcInspectionFileEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; @@ -14,7 +14,7 @@ import java.util.List; * @Date: 2022/1/20 15:23 */ @Repository -public interface QcInspectionFileDao extends JpaRepository, JpaSpecificationExecutor { +public interface QcInspectionFileDao extends JpaRepository, JpaSpecificationExecutor { /** * 查询文件信息 @@ -27,7 +27,7 @@ public interface QcInspectionFileDao extends JpaRepository selectFile(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); + List selectFile(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); /** * 修改模板上传信息 diff --git a/src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java b/src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java index 8347df9..db3f3b6 100644 --- a/src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java +++ b/src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java @@ -1,6 +1,6 @@ package com.xkrs.dao; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; @@ -8,7 +8,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @Repository -public interface QcInspectionItemDictDao extends JpaRepository, JpaSpecificationExecutor { +public interface QcInspectionItemDictDao extends JpaRepository, JpaSpecificationExecutor { /** * 通过检验项代码查询字典表的数据 @@ -16,7 +16,7 @@ public interface QcInspectionItemDictDao extends JpaRepository, JpaSpecificationExecutor { +public interface QcInspectionPictureDao extends JpaRepository, JpaSpecificationExecutor { /** * 查询图片信息 @@ -23,7 +23,7 @@ public interface QcInspectionPictureDao extends JpaRepository selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); + List selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); /** * 修改图片路径信息 diff --git a/src/main/java/com/xkrs/dao/QcInspectionSpecDao.java b/src/main/java/com/xkrs/dao/QcInspectionSpecDao.java index 09ea292..1b06c6c 100644 --- a/src/main/java/com/xkrs/dao/QcInspectionSpecDao.java +++ b/src/main/java/com/xkrs/dao/QcInspectionSpecDao.java @@ -1,6 +1,6 @@ package com.xkrs.dao; -import com.xkrs.model.entity.QcInspectionSpec; +import com.xkrs.model.entity.QcInspectionSpecEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; import java.util.List; @Repository -public interface QcInspectionSpecDao extends JpaRepository, JpaSpecificationExecutor { +public interface QcInspectionSpecDao extends JpaRepository, JpaSpecificationExecutor { - List findByPartNoAndInspectionItemCode(String partNo, String inspectionItemCode); + List findByPartNoAndInspectionItemCode(String partNo, String inspectionItemCode); } diff --git a/src/main/java/com/xkrs/model/entity/QcInspectionDataSource.java b/src/main/java/com/xkrs/model/entity/QcInspectionDataSourceEntity.java similarity index 84% rename from src/main/java/com/xkrs/model/entity/QcInspectionDataSource.java rename to src/main/java/com/xkrs/model/entity/QcInspectionDataSourceEntity.java index d019d23..80f3a34 100644 --- a/src/main/java/com/xkrs/model/entity/QcInspectionDataSource.java +++ b/src/main/java/com/xkrs/model/entity/QcInspectionDataSourceEntity.java @@ -8,7 +8,7 @@ import java.io.Serializable; */ @Entity @Table(name = "qc_inspection_data_source") -public class QcInspectionDataSource implements Serializable { +public class QcInspectionDataSourceEntity implements Serializable { /** * 采集数据编号 @@ -59,7 +59,7 @@ public class QcInspectionDataSource implements Serializable { @Column(length = 85, columnDefinition = "varchar(85)") private String inspectValue; - public QcInspectionDataSource() { + public QcInspectionDataSourceEntity() { } public Integer getId() { @@ -128,6 +128,6 @@ public class QcInspectionDataSource implements Serializable { @Override public String toString() { - return "QcInspectionDataSource{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", inspectionItemCode='" + inspectionItemCode + '\'' + ", inspectValue='" + inspectValue + '\'' + '}'; + return "QcInspectionDataSourceEntity{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", inspectionItemCode='" + inspectionItemCode + '\'' + ", inspectValue='" + inspectValue + '\'' + '}'; } } diff --git a/src/main/java/com/xkrs/model/entity/QcInspectionFile.java b/src/main/java/com/xkrs/model/entity/QcInspectionFileEntity.java similarity index 85% rename from src/main/java/com/xkrs/model/entity/QcInspectionFile.java rename to src/main/java/com/xkrs/model/entity/QcInspectionFileEntity.java index f77f53a..f59d85b 100644 --- a/src/main/java/com/xkrs/model/entity/QcInspectionFile.java +++ b/src/main/java/com/xkrs/model/entity/QcInspectionFileEntity.java @@ -5,7 +5,7 @@ import java.io.Serializable; @Entity @Table(name = "file") -public class QcInspectionFile implements Serializable { +public class QcInspectionFileEntity implements Serializable { /** * 编号 @@ -56,7 +56,7 @@ public class QcInspectionFile implements Serializable { @Column(length = 85, columnDefinition = "varchar(85)") private String filePath; - public QcInspectionFile() { + public QcInspectionFileEntity() { } public Integer getId() { @@ -125,7 +125,7 @@ public class QcInspectionFile implements Serializable { @Override public String toString() { - return "QcInspectionFile{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", templatePath='" + templatePath + '\'' + ", filePath='" + filePath + '\'' + '}'; + return "QcInspectionFileEntity{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", templatePath='" + templatePath + '\'' + ", filePath='" + filePath + '\'' + '}'; } } diff --git a/src/main/java/com/xkrs/model/entity/QcInspectionItemDict.java b/src/main/java/com/xkrs/model/entity/QcInspectionItemDictEntity.java similarity index 89% rename from src/main/java/com/xkrs/model/entity/QcInspectionItemDict.java rename to src/main/java/com/xkrs/model/entity/QcInspectionItemDictEntity.java index fb84601..ddde6da 100644 --- a/src/main/java/com/xkrs/model/entity/QcInspectionItemDict.java +++ b/src/main/java/com/xkrs/model/entity/QcInspectionItemDictEntity.java @@ -17,7 +17,7 @@ import java.io.Serializable; */ @Entity @Table(name = "qc_inspection_item_dict") -public class QcInspectionItemDict implements Serializable { +public class QcInspectionItemDictEntity implements Serializable { /** * 索引 @@ -38,10 +38,10 @@ public class QcInspectionItemDict implements Serializable { @Column(length = 85, columnDefinition = "varchar(85)") private String inspectionItemName; - public QcInspectionItemDict() { + public QcInspectionItemDictEntity() { } - public QcInspectionItemDict(Integer id, String inspectionItemCode, String inspectionItemName) { + public QcInspectionItemDictEntity(Integer id, String inspectionItemCode, String inspectionItemName) { this.id = id; this.inspectionItemCode = inspectionItemCode; this.inspectionItemName = inspectionItemName; diff --git a/src/main/java/com/xkrs/model/entity/QcInspectionPicture.java b/src/main/java/com/xkrs/model/entity/QcInspectionPictureEntity.java similarity index 84% rename from src/main/java/com/xkrs/model/entity/QcInspectionPicture.java rename to src/main/java/com/xkrs/model/entity/QcInspectionPictureEntity.java index 9110b99..6d3d0c9 100644 --- a/src/main/java/com/xkrs/model/entity/QcInspectionPicture.java +++ b/src/main/java/com/xkrs/model/entity/QcInspectionPictureEntity.java @@ -8,7 +8,7 @@ import java.io.Serializable; */ @Entity @Table(name = "qc_inspection_picture") -public class QcInspectionPicture implements Serializable { +public class QcInspectionPictureEntity implements Serializable { /** * 编号 @@ -53,7 +53,7 @@ public class QcInspectionPicture implements Serializable { @Column(length = 85, columnDefinition = "varchar(85)") private String picturePath; - public QcInspectionPicture() { + public QcInspectionPictureEntity() { } public Integer getId() { @@ -114,7 +114,7 @@ public class QcInspectionPicture implements Serializable { @Override public String toString() { - return "QcInspectionPicture{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", picturePath='" + picturePath + '\'' + '}'; + return "QcInspectionPictureEntity{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", partNo='" + partNo + '\'' + ", picturePath='" + picturePath + '\'' + '}'; } } diff --git a/src/main/java/com/xkrs/model/entity/QcInspectionSpec.java b/src/main/java/com/xkrs/model/entity/QcInspectionSpecEntity.java similarity index 96% rename from src/main/java/com/xkrs/model/entity/QcInspectionSpec.java rename to src/main/java/com/xkrs/model/entity/QcInspectionSpecEntity.java index 0ba95de..0a32fce 100644 --- a/src/main/java/com/xkrs/model/entity/QcInspectionSpec.java +++ b/src/main/java/com/xkrs/model/entity/QcInspectionSpecEntity.java @@ -8,7 +8,7 @@ import java.io.Serializable; */ @Entity @Table(name = "qc_inspection_spec") -public class QcInspectionSpec implements Serializable { +public class QcInspectionSpecEntity implements Serializable { /** * 规格编号 @@ -71,7 +71,7 @@ public class QcInspectionSpec implements Serializable { @Column(length = 85, columnDefinition = "varchar(85)") private String remark; - public QcInspectionSpec() { + public QcInspectionSpecEntity() { } public Integer getId() { @@ -156,7 +156,7 @@ public class QcInspectionSpec implements Serializable { @Override public String toString() { - return "QcInspectionSpec{" + + return "QcInspectionSpecEntity{" + "id=" + id + ", partNo='" + partNo + '\'' + ", inspectionItemCode='" + inspectionItemCode + '\'' + diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java index d7237e6..d101eeb 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java @@ -3,8 +3,8 @@ package com.xkrs.service.impl; import com.xkrs.dao.QcInspectionDataSourceDao; import com.xkrs.dao.QcInspectionItemDictDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionDataSource; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionDataSourceEntity; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import com.xkrs.model.qo.QcInspectionDataSourceQo; import com.xkrs.service.QcInspectionDataSourceService; import org.springframework.context.i18n.LocaleContextHolder; @@ -37,22 +37,22 @@ public class QcInspectionDataSourceServiceImpl implements QcInspectionDataSource @Override public String insertDataSource(QcInspectionDataSourceQo inspectionDataSourceQo) { Locale locale = LocaleContextHolder.getLocale(); - QcInspectionItemDict byInspectionItemCode = inspectionItemDictDao.findByInspectionItemCode(inspectionDataSourceQo.getInspectionItemCode()); + QcInspectionItemDictEntity byInspectionItemCode = inspectionItemDictDao.findByInspectionItemCode(inspectionDataSourceQo.getInspectionItemCode()); if (byInspectionItemCode == null) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该字典类型!", locale); } - QcInspectionDataSource qcInspectionDataSource = new QcInspectionDataSource(); + QcInspectionDataSourceEntity qcInspectionDataSourceEntity = new QcInspectionDataSourceEntity(); if (inspectionDataSourceQo.getId() > 0) { - qcInspectionDataSource.setId(inspectionDataSourceQo.getId()); + qcInspectionDataSourceEntity.setId(inspectionDataSourceQo.getId()); } - qcInspectionDataSource.setLotNo(inspectionDataSourceQo.getLotNo()); - qcInspectionDataSource.setMachineNo(inspectionDataSourceQo.getMachineNo()); - qcInspectionDataSource.setMaterialNo(inspectionDataSourceQo.getMaterialNo()); - qcInspectionDataSource.setModelNo(inspectionDataSourceQo.getModelNo()); - qcInspectionDataSource.setPartNo(inspectionDataSourceQo.getPartNo()); - qcInspectionDataSource.setInspectionItemCode(inspectionDataSourceQo.getInspectionItemCode()); - qcInspectionDataSource.setInspectValue(inspectionDataSourceQo.getInspectValue()); - inspectionDataSourceDao.save(qcInspectionDataSource); + qcInspectionDataSourceEntity.setLotNo(inspectionDataSourceQo.getLotNo()); + qcInspectionDataSourceEntity.setMachineNo(inspectionDataSourceQo.getMachineNo()); + qcInspectionDataSourceEntity.setMaterialNo(inspectionDataSourceQo.getMaterialNo()); + qcInspectionDataSourceEntity.setModelNo(inspectionDataSourceQo.getModelNo()); + qcInspectionDataSourceEntity.setPartNo(inspectionDataSourceQo.getPartNo()); + qcInspectionDataSourceEntity.setInspectionItemCode(inspectionDataSourceQo.getInspectionItemCode()); + qcInspectionDataSourceEntity.setInspectValue(inspectionDataSourceQo.getInspectValue()); + inspectionDataSourceDao.save(qcInspectionDataSourceEntity); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); } } diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java index dc31eb6..f13a6cc 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java @@ -3,9 +3,9 @@ package com.xkrs.service.impl; import com.xkrs.dao.QcInspectionDataSourceDao; import com.xkrs.dao.QcInspectionFileDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionDataSource; -import com.xkrs.model.entity.QcInspectionFile; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionDataSourceEntity; +import com.xkrs.model.entity.QcInspectionFileEntity; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import com.xkrs.model.qo.QcInspectionFileQo; import com.xkrs.service.QcInspectionFileService; import com.xkrs.util.ExcelUploadUtil; @@ -36,7 +36,7 @@ public class QcInspectionFileServiceImpl implements QcInspectionFileService { private QcInspectionFileDao inspectionFileDao; @Resource - private QcInspectionItemDict inspectionItemDict; + private QcInspectionItemDictEntity inspectionItemDict; @Resource private QcInspectionDataSourceDao inspectionDataSourceDao; @@ -55,15 +55,15 @@ public class QcInspectionFileServiceImpl implements QcInspectionFileService { String modelNo = inspectionFileQo.getModelNo(); String partNo = inspectionFileQo.getPartNo(); Locale locale = LocaleContextHolder.getLocale(); - List qcInspectionFiles = inspectionFileDao.selectFile(lotNo, machineNo, materialNo, modelNo, partNo); - if (qcInspectionFiles != null || qcInspectionFiles.isEmpty()) { + List qcInspectionFileEntities = inspectionFileDao.selectFile(lotNo, machineNo, materialNo, modelNo, partNo); + if (qcInspectionFileEntities != null || qcInspectionFileEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "已存在该产品的模板!", locale); } if (fileExcel == null) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "模板不能为空!", locale); } String file = ExcelUploadUtil.memoryFile(fileExcel); - QcInspectionFile fileEntity = new QcInspectionFile(); + QcInspectionFileEntity fileEntity = new QcInspectionFileEntity(); fileEntity.setId(inspectionFileQo.getId()); fileEntity.setLotNo(lotNo); fileEntity.setMachineNo(machineNo); @@ -90,17 +90,17 @@ public class QcInspectionFileServiceImpl implements QcInspectionFileService { String modelNo = inspectionFileQo.getModelNo(); String partNo = inspectionFileQo.getPartNo(); Locale locale = LocaleContextHolder.getLocale(); - List qcInspectionFiles = inspectionFileDao.selectFile(lotNo, machineNo, materialNo, modelNo, partNo); - if (qcInspectionFiles == null || qcInspectionFiles.isEmpty()) { + List qcInspectionFileEntities = inspectionFileDao.selectFile(lotNo, machineNo, materialNo, modelNo, partNo); + if (qcInspectionFileEntities == null || qcInspectionFileEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的模板,请添加!", locale); } - String templatePath = qcInspectionFiles.get(0).getTemplatePath(); - List inspectionDataSources = inspectionDataSourceDao.selectDataSource(lotNo, machineNo, materialNo, modelNo, partNo); + String templatePath = qcInspectionFileEntities.get(0).getTemplatePath(); + List inspectionDataSources = inspectionDataSourceDao.selectDataSource(lotNo, machineNo, materialNo, modelNo, partNo); if (inspectionDataSources == null || inspectionDataSources.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的信息!", locale); } Map map = new HashMap<>(); - for (QcInspectionDataSource inspectionDataSource : inspectionDataSources) { + for (QcInspectionDataSourceEntity inspectionDataSource : inspectionDataSources) { map.put(inspectionDataSource.getInspectionItemCode(), inspectionDataSource.getInspectValue()); } String fill = ExportExcel.exportToProveExcel(map, templatePath); diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionItemDictServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionItemDictServiceImpl.java index 78ce3ca..5ac8138 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionItemDictServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionItemDictServiceImpl.java @@ -2,7 +2,7 @@ package com.xkrs.service.impl; import com.xkrs.dao.QcInspectionItemDictDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import com.xkrs.model.qo.QcInspectionItemDictQo; import com.xkrs.service.QcInspectionItemDictService; import org.springframework.context.i18n.LocaleContextHolder; @@ -32,14 +32,14 @@ public class QcInspectionItemDictServiceImpl implements QcInspectionItemDictServ @Override public String insertDataDict(QcInspectionItemDictQo inspectionItemDictQo) { Locale locale = LocaleContextHolder.getLocale(); - QcInspectionItemDict englishName = inspectionItemDictDao.findByInspectionItemCode(inspectionItemDictQo.getInspectionItemCode()); + QcInspectionItemDictEntity englishName = inspectionItemDictDao.findByInspectionItemCode(inspectionItemDictQo.getInspectionItemCode()); if (englishName != null) { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "该产品变量已存在,请勿重复添加!", locale); } - QcInspectionItemDict qcInspectionItemDict = new QcInspectionItemDict(); - qcInspectionItemDict.setInspectionItemName(inspectionItemDictQo.getInspectionItemName()); - qcInspectionItemDict.setInspectionItemCode(inspectionItemDictQo.getInspectionItemCode()); - inspectionItemDictDao.save(qcInspectionItemDict); + QcInspectionItemDictEntity qcInspectionItemDictEntity = new QcInspectionItemDictEntity(); + qcInspectionItemDictEntity.setInspectionItemName(inspectionItemDictQo.getInspectionItemName()); + qcInspectionItemDictEntity.setInspectionItemCode(inspectionItemDictQo.getInspectionItemCode()); + inspectionItemDictDao.save(qcInspectionItemDictEntity); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); } } diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionPictureServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionPictureServiceImpl.java index 074ae45..8d94c28 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionPictureServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionPictureServiceImpl.java @@ -2,7 +2,7 @@ package com.xkrs.service.impl; import com.xkrs.dao.QcInspectionPictureDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionPicture; +import com.xkrs.model.entity.QcInspectionPictureEntity; import com.xkrs.model.qo.QcInspectionPictureQo; import com.xkrs.service.QcInspectionPictureService; import com.xkrs.util.ExcelUploadUtil; @@ -26,7 +26,7 @@ public class QcInspectionPictureServiceImpl implements QcInspectionPictureServic public String insertPicture(QcInspectionPictureQo inspectionPictureQo, MultipartFile pictureFile) throws IOException { Locale locale = LocaleContextHolder.getLocale(); String file = ExcelUploadUtil.memoryFile(pictureFile); - QcInspectionPicture qcInspectionPicture = new QcInspectionPicture(); + QcInspectionPictureEntity qcInspectionPicture = new QcInspectionPictureEntity(); qcInspectionPicture.setId(inspectionPictureQo.getId()); qcInspectionPicture.setLotNo(inspectionPictureQo.getLotNo()); qcInspectionPicture.setMachineNo(inspectionPictureQo.getMachineNo()); diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionSpecServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionSpecServiceImpl.java index 4a429d3..27ae754 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionSpecServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionSpecServiceImpl.java @@ -3,7 +3,7 @@ package com.xkrs.service.impl; import com.xkrs.dao.QcInspectionItemDictDao; import com.xkrs.dao.QcInspectionSpecDao; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.model.entity.QcInspectionSpec; +import com.xkrs.model.entity.QcInspectionSpecEntity; import com.xkrs.model.qo.QcInspectionSpecQo; import com.xkrs.service.QcInspectionSpecService; import org.springframework.context.i18n.LocaleContextHolder; @@ -33,7 +33,7 @@ public class QcInspectionSpecServiceImpl implements QcInspectionSpecService { @Override public String insertSpec(QcInspectionSpecQo inspectionSpecQo) { Locale locale = LocaleContextHolder.getLocale(); - QcInspectionSpec inspectionSpec = new QcInspectionSpec(); + QcInspectionSpecEntity inspectionSpec = new QcInspectionSpecEntity(); if (inspectionSpecQo.getId() > 0) { inspectionSpec.setId(inspectionSpecQo.getId()); } diff --git a/src/main/java/com/xkrs/util/Query.java b/src/main/java/com/xkrs/util/Query.java index 610d3c5..86dff0d 100644 --- a/src/main/java/com/xkrs/util/Query.java +++ b/src/main/java/com/xkrs/util/Query.java @@ -1,7 +1,7 @@ package com.xkrs.util; import com.xkrs.dao.QcInspectionItemDictDao; -import com.xkrs.model.entity.QcInspectionItemDict; +import com.xkrs.model.entity.QcInspectionItemDictEntity; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -28,10 +28,10 @@ public class Query { * * @return */ - public List selectDataDict(String inspectionItemCode, String inspectionItemName) { - Specification specification = new Specification() { + public List selectDataDict(String inspectionItemCode, String inspectionItemName) { + Specification specification = new Specification() { @Override - public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) { + public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) { List list = new ArrayList<>(); if (inspectionItemCode != null && !"".equals(inspectionItemCode)) { list.add(criteriaBuilder.equal(root.get("inspectionItemCode").as(String.class), inspectionItemCode));