diff --git a/src/main/java/com/xkrs/controller/DataDictController.java b/src/main/java/com/xkrs/controller/DataDictController.java index e842041..341d2cd 100644 --- a/src/main/java/com/xkrs/controller/DataDictController.java +++ b/src/main/java/com/xkrs/controller/DataDictController.java @@ -53,7 +53,8 @@ public class DataDictController { * @return */ @GetMapping("/selectDataDict") - public String selectDataDict(@RequestParam("inspectionItemName") String inspectionItemName, @RequestParam("inspectionItemCode") String inspectionItemCode) { + public String selectDataDict(@RequestParam("inspectionItemName") String inspectionItemName, + @RequestParam("inspectionItemCode") String inspectionItemCode) { Locale locale = LocaleContextHolder.getLocale(); List dataDict = dataDictQuery.selectDataDict(inspectionItemName, inspectionItemCode); if (dataDict == null || dataDict.size() == 0) { diff --git a/src/main/java/com/xkrs/controller/DataSourceController.java b/src/main/java/com/xkrs/controller/DataSourceController.java index 7381f85..2963a15 100644 --- a/src/main/java/com/xkrs/controller/DataSourceController.java +++ b/src/main/java/com/xkrs/controller/DataSourceController.java @@ -45,11 +45,12 @@ public class DataSourceController { /** * 查询某一产品的测量信息 * - * @param lotNo 批次号 - * @param machineNo 机器号 - * @param materialNo 物料号 - * @param modelNo 模具号 - * @param partNo 零件号 + * @param lotNo 批次号 + * @param machineNo 机器号 + * @param materialNo 物料号 + * @param modelNo 模具号 + * @param machineTypeNo 机种号 + * @param craftItemName 工艺项目名称 * @return */ @GetMapping("/selectDataSource") @@ -57,9 +58,10 @@ public class DataSourceController { @RequestParam(required = false, value = "machineNo") String machineNo, @RequestParam(required = false, value = "materialNo") String materialNo, @RequestParam(required = false, value = "modelNo") String modelNo, - @RequestParam(required = false, value = "partNo") String partNo) { + @RequestParam(required = false, value = "machineTypeNo") String machineTypeNo, + @RequestParam(required = false, value = "craftItemName") String craftItemName) { Locale locale = LocaleContextHolder.getLocale(); - List dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, partNo); + List dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); if (dataSources == null || dataSources.size() == 0) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale); } diff --git a/src/main/java/com/xkrs/controller/FileController.java b/src/main/java/com/xkrs/controller/FileController.java index 2e1ca5e..36f5e1b 100644 --- a/src/main/java/com/xkrs/controller/FileController.java +++ b/src/main/java/com/xkrs/controller/FileController.java @@ -58,9 +58,15 @@ public class FileController { @PostMapping("/updateFileUploadPath") @Transactional(rollbackOn = Exception.class) public String updateFileUploadPath(@RequestBody FileUpdateQo fileUpdateQo, @RequestParam("fileExcel") MultipartFile fileExcel) throws IOException { + String lotNo = fileUpdateQo.getLotNo(); + String machineNo = fileUpdateQo.getMachineNo(); + String materialNo = fileUpdateQo.getMaterialNo(); + String modelNo = fileUpdateQo.getModelNo(); + String machineTypeNo = fileUpdateQo.getMachineTypeNo(); + String craftItemName = fileUpdateQo.getCraftItemName(); Locale locale = LocaleContextHolder.getLocale(); - String file = ExcelUploadUtil.memoryFile(fileExcel,1); - fileDao.updateFileUploadPath(fileUpdateQo.getLotNo(), fileUpdateQo.getMachineNo(), fileUpdateQo.getMaterialNo(), fileUpdateQo.getModelNo(), fileUpdateQo.getPartNo(), file); + String file = ExcelUploadUtil.memoryFile(fileExcel, 1); + fileDao.updateFileUploadPath(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName, file); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); } diff --git a/src/main/java/com/xkrs/controller/PictureController.java b/src/main/java/com/xkrs/controller/PictureController.java index b179102..2fce3fd 100644 --- a/src/main/java/com/xkrs/controller/PictureController.java +++ b/src/main/java/com/xkrs/controller/PictureController.java @@ -44,13 +44,14 @@ public class PictureController { * 查询图片 */ @GetMapping("/selectPicture") - public String selectPicture(@RequestParam("lotNo") String lotNo, - @RequestParam("machineNo") String machineNo, - @RequestParam("materialNo") String materialNo, - @RequestParam("modelNo") String modelNo, - @RequestParam("partNo") String partNo) { + public String selectPicture(@RequestParam(required = false, value = "lotNo") String lotNo, + @RequestParam(required = false, value = "machineNo") String machineNo, + @RequestParam(required = false, value = "materialNo") String materialNo, + @RequestParam(required = false, value = "modelNo") String modelNo, + @RequestParam(required = false, value = "machineTypeNo") String machineTypeNo, + @RequestParam(required = false, value = "craftItemName") String craftItemName) { Locale locale = LocaleContextHolder.getLocale(); - List pictureEntities = pictureQuery.selectPicture(lotNo, machineNo, materialNo, modelNo, partNo); + List pictureEntities = pictureQuery.selectPicture(lotNo, machineNo, materialNo, modelNo, machineTypeNo,craftItemName); if (pictureEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该零件的图片!", locale); } diff --git a/src/main/java/com/xkrs/controller/SpecController.java b/src/main/java/com/xkrs/controller/SpecController.java index b441fba..37165b2 100644 --- a/src/main/java/com/xkrs/controller/SpecController.java +++ b/src/main/java/com/xkrs/controller/SpecController.java @@ -41,10 +41,11 @@ public class SpecController { * 查询规格信息 */ @GetMapping("/selectSpec") - public String selectSpec(@RequestParam(required = false, value = "partNo") String partNo, - @RequestParam(required = false, value = "inspectionItemCode") String inspectionItemCode) { + public String selectSpec(@RequestParam(required = false, value = "machineTypeNo") String machineTypeNo, + @RequestParam(required = false, value = "inspectionItemCode") String inspectionItemCode, + @RequestParam(required = false, value = "craftItemName") String craftItemName) { Locale locale = LocaleContextHolder.getLocale(); - List specEntities = specQuery.selectSpec(partNo, inspectionItemCode); + List specEntities = specQuery.selectSpec(machineTypeNo, inspectionItemCode, craftItemName); if (specEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该零件的规格信息!", locale); } diff --git a/src/main/java/com/xkrs/dao/FileDao.java b/src/main/java/com/xkrs/dao/FileDao.java index 66d73c6..eef603f 100644 --- a/src/main/java/com/xkrs/dao/FileDao.java +++ b/src/main/java/com/xkrs/dao/FileDao.java @@ -19,15 +19,16 @@ public interface FileDao extends JpaRepository, JpaSpecificati /** * 查询文件信息 * - * @param lotNo 批次号 - * @param machineNo 机器号 - * @param materialNo 物料号 - * @param modelNo 模具号 - * @param partNo 零件号 + * @param lotNo 批次号 + * @param machineNo 机器号 + * @param materialNo 物料号 + * @param modelNo 模具号 + * @param machineTypeNo 机种号 + * @param craftItemName 工艺项目名称 * @return */ - @Query(value = "SELECT * FROM qc_inspection_file WHERE lot_no = ? AND machine_no = ? AND material_no = ? AND model_no = ? AND part_no = ? ", nativeQuery = true) - Optional selectFile(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); + @Query(value = "SELECT * FROM qc_inspection_file WHERE lot_no = ? AND machine_no = ? AND material_no = ? AND model_no = ? AND machine_type_no = ? AND craft_item_name = ? ", nativeQuery = true) + Optional selectFile(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName); /** * 修改模板上传信息 @@ -36,12 +37,13 @@ public interface FileDao extends JpaRepository, JpaSpecificati * @param machineNo 机器号 * @param materialNo 物料号 * @param modelNo 模具号 - * @param partNo 零件号 + * @param machineTypeNo 机种号 + * @param craftItemName 工艺项目名称 * @param fileUploadPath 模板路径 */ @Modifying(clearAutomatically = true) - @Query(value = "UPDATE qc_inspection_file SET file_upload_path = ?6 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND part_no = ?5 ", nativeQuery = true) - void updateFileUploadPath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String fileUploadPath); + @Query(value = "UPDATE qc_inspection_file SET file_upload_path = ?7 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND machine_type_no = ?5 AND craft_item_name = ?6 ", nativeQuery = true) + void updateFileUploadPath(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName, String fileUploadPath); /** * 修改文件下载信息 @@ -50,12 +52,13 @@ public interface FileDao extends JpaRepository, JpaSpecificati * @param machineNo 机器号 * @param materialNo 物料号 * @param modelNo 模具号 - * @param partNo 零件号 + * @param machineTypeNo 机种号 + * @param craftItemName 工艺项目名称 * @param fileDownloadPath 文件下载路径 */ @Modifying(clearAutomatically = true) - @Query(value = "UPDATE qc_inspection_file SET file_download_path = ?6 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND part_no = ?5 ", nativeQuery = true) - void updateFileDownloadPath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String fileDownloadPath); + @Query(value = "UPDATE qc_inspection_file SET file_download_path = ?7 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND machine_type_no = ?5 AND craft_item_name = ?6 ", nativeQuery = true) + void updateFileDownloadPath(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName, String fileDownloadPath); } diff --git a/src/main/java/com/xkrs/dao/PictureDao.java b/src/main/java/com/xkrs/dao/PictureDao.java index 56f8661..7102728 100644 --- a/src/main/java/com/xkrs/dao/PictureDao.java +++ b/src/main/java/com/xkrs/dao/PictureDao.java @@ -3,7 +3,6 @@ package com.xkrs.dao; import com.xkrs.model.entity.PictureEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Component; @@ -19,27 +18,15 @@ public interface PictureDao extends JpaRepository, JpaSpeci /** * 查询图片信息 * - * @param lotNo 批次号 - * @param machineNo 机器号 - * @param materialNo 物料号 - * @param modelNo 模具号 - * @param partNo 零件号 + * @param lotNo 批次号 + * @param machineNo 机器号 + * @param materialNo 物料号 + * @param modelNo 模具号 + * @param machineTypeNo 机种号 + * @param craftItemName 工艺项目名称 * @return */ - @Query(value = "SELECT * FROM qc_inspection_picture WHERE lot_no = ? AND machine_no = ? AND material_no = ? AND model_no = ? AND part_no = ? ", nativeQuery = true) - Optional selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); + @Query(value = "SELECT * FROM qc_inspection_picture WHERE lot_no = ? AND machine_no = ? AND material_no = ? AND model_no = ? AND machine_type_no = ? AND craft_item_name = ? ", nativeQuery = true) + Optional selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName); - /** - * 修改图片路径信息 - * - * @param lotNo 批次号 - * @param machineNo 机器号 - * @param materialNo 物料号 - * @param modelNo 模具号 - * @param partNo 零件号 - * @param picturePath 图片路径 - */ - @Modifying(clearAutomatically = true) - @Query(value = "UPDATE qc_inspection_picture SET picture_path = ?6 where lot_no = ?1 and machine_no = ?2 and material_no = ?3 and model_no = ?4 and part_no = ?5", nativeQuery = true) - void updatePicturePath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String picturePath); } diff --git a/src/main/java/com/xkrs/model/entity/FileEntity.java b/src/main/java/com/xkrs/model/entity/FileEntity.java index 5f81038..d2965f3 100644 --- a/src/main/java/com/xkrs/model/entity/FileEntity.java +++ b/src/main/java/com/xkrs/model/entity/FileEntity.java @@ -47,6 +47,13 @@ public class FileEntity { @Column(length = 85, columnDefinition = "varchar(85)") private String machineTypeNo; + /** + * 工艺项目名称 + */ + @Column(length = 85, columnDefinition = "varchar(85)") + private String craftItemName; + + /** * 上传模板的路径 */ @@ -110,6 +117,14 @@ public class FileEntity { this.machineTypeNo = machineTypeNo; } + public String getCraftItemName() { + return craftItemName; + } + + public void setCraftItemName(String craftItemName) { + this.craftItemName = craftItemName; + } + public String getFileUploadPath() { return fileUploadPath; } @@ -135,6 +150,7 @@ public class FileEntity { ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", machineTypeNo='" + machineTypeNo + '\'' + + ", craftItemName='" + craftItemName + '\'' + ", fileUploadPath='" + fileUploadPath + '\'' + ", fileDownloadPath='" + fileDownloadPath + '\'' + '}'; diff --git a/src/main/java/com/xkrs/model/qo/FileQo.java b/src/main/java/com/xkrs/model/qo/FileQo.java index 7f9e7d1..da63156 100644 --- a/src/main/java/com/xkrs/model/qo/FileQo.java +++ b/src/main/java/com/xkrs/model/qo/FileQo.java @@ -40,6 +40,12 @@ public class FileQo { @NotBlank(message = "{FileEntity.machineTypeNo.blank}", groups = {FileQoInsert.class}) private String machineTypeNo; + /** + * 工艺项目名称 + */ + @NotBlank(message = "{FileEntity.craftItemName.blank}", groups = {FileQoInsert.class}) + private String craftItemName; + /** * 上传模板的路径 */ @@ -89,6 +95,14 @@ public class FileQo { this.machineTypeNo = machineTypeNo; } + public String getCraftItemName() { + return craftItemName; + } + + public void setCraftItemName(String craftItemName) { + this.craftItemName = craftItemName; + } + public String getFileUploadPath() { return fileUploadPath; } diff --git a/src/main/java/com/xkrs/model/qo/FileUpdateQo.java b/src/main/java/com/xkrs/model/qo/FileUpdateQo.java index 6a9840a..6ee00c9 100644 --- a/src/main/java/com/xkrs/model/qo/FileUpdateQo.java +++ b/src/main/java/com/xkrs/model/qo/FileUpdateQo.java @@ -1,6 +1,7 @@ package com.xkrs.model.qo; +import com.xkrs.model.validation.FileQoInsert; import com.xkrs.model.validation.FileUpdateQoUpdate; import javax.validation.constraints.NotBlank; @@ -41,6 +42,12 @@ public class FileUpdateQo { @NotBlank(message = "{FileEntity.machineTypeNo.blank}", groups = {FileUpdateQoUpdate.class}) private String machineTypeNo; + /** + * 工艺项目名称 + */ + @NotBlank(message = "{FileEntity.craftItemName.blank}", groups = {FileQoInsert.class}) + private String craftItemName; + public FileUpdateQo() { } @@ -83,4 +90,12 @@ public class FileUpdateQo { public void setMachineTypeNo(String machineTypeNo) { this.machineTypeNo = machineTypeNo; } + + public String getCraftItemName() { + return craftItemName; + } + + public void setCraftItemName(String craftItemName) { + this.craftItemName = craftItemName; + } } diff --git a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java index 9507998..4b2d1ca 100644 --- a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java @@ -47,7 +47,8 @@ public class DataSourceServiceImpl implements DataSourceService { dataSource.setMachineNo(dataSourceQo.getMachineNo()); dataSource.setMaterialNo(dataSourceQo.getMaterialNo()); dataSource.setModelNo(dataSourceQo.getModelNo()); - dataSource.setPartNo(dataSourceQo.getPartNo()); + dataSource.setMachineTypeNo(dataSourceQo.getMachineTypeNo()); + dataSource.setCraftItemName(dataSourceQo.getCraftItemName()); dataSource.setInspectionItemCode(dataSourceQo.getInspectionItemCode()); dataSource.setInspectValue(dataSourceQo.getInspectValue()); dataSourceDao.save(dataSource); diff --git a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java index 2f877c0..5488a3a 100644 --- a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java @@ -42,8 +42,14 @@ public class FileServiceImpl implements FileService { */ @Override public String insertFileExcel(FileQo fileQo, MultipartFile fileExcel) throws IOException { + String lotNo = fileQo.getLotNo(); + String machineNo = fileQo.getMachineNo(); + String materialNo = fileQo.getMaterialNo(); + String modelNo = fileQo.getModelNo(); + String machineTypeNo = fileQo.getMachineTypeNo(); + String craftItemName = fileQo.getCraftItemName(); Locale locale = LocaleContextHolder.getLocale(); - Optional fileEntity = fileDao.selectFile(fileQo.getLotNo(), fileQo.getMachineNo(), fileQo.getMaterialNo(), fileQo.getModelNo(), fileQo.getPartNo()); + Optional fileEntity = fileDao.selectFile(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); if (fileEntity.isPresent()) { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "已存在该产品的模板!", locale); } @@ -56,7 +62,7 @@ public class FileServiceImpl implements FileService { fileEntity1.setMachineNo(fileQo.getMachineNo()); fileEntity1.setMaterialNo(fileQo.getMaterialNo()); fileEntity1.setModelNo(fileQo.getModelNo()); - fileEntity1.setPartNo(fileQo.getPartNo()); + fileEntity1.setMachineTypeNo(fileQo.getMachineTypeNo()); fileEntity1.setFileUploadPath(file); fileDao.save(fileEntity1); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); @@ -71,13 +77,19 @@ public class FileServiceImpl implements FileService { @Transactional(rollbackOn = Exception.class) @Override public String exportExcel(FileQo fileQo) throws IOException, InvalidFormatException { + String lotNo = fileQo.getLotNo(); + String machineNo = fileQo.getMachineNo(); + String materialNo = fileQo.getMaterialNo(); + String modelNo = fileQo.getModelNo(); + String machineTypeNo = fileQo.getMachineTypeNo(); + String craftItemName = fileQo.getCraftItemName(); Locale locale = LocaleContextHolder.getLocale(); - Optional fileEntity = fileDao.selectFile(fileQo.getLotNo(), fileQo.getMachineNo(), fileQo.getMaterialNo(), fileQo.getModelNo(), fileQo.getPartNo()); + Optional fileEntity = fileDao.selectFile(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); if (fileEntity.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的模板,请添加!", locale); } String fileUploadPath = fileEntity.get().getFileUploadPath(); - List dataSources = dataSourceQuery.selectDataSource(fileQo.getLotNo(), fileQo.getMachineNo(), fileQo.getMaterialNo(), fileQo.getModelNo(), fileQo.getPartNo()); + List dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); if (dataSources == null || dataSources.size() == 0) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的信息!", locale); } @@ -86,7 +98,7 @@ public class FileServiceImpl implements FileService { map.put(dataSource.getInspectionItemCode(), dataSource.getInspectValue()); } String fill = ExportExcel.exportToProveExcel(map, fileUploadPath); - fileDao.updateFileDownloadPath(fileQo.getLotNo(), fileQo.getMachineNo(), fileQo.getMaterialNo(), fileQo.getModelNo(), fileQo.getPartNo(), fill); + fileDao.updateFileDownloadPath(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName, fill); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, fill, locale); } } diff --git a/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java b/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java index c992243..7e162ba 100644 --- a/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java @@ -30,8 +30,9 @@ public class PictureServiceImpl implements PictureService { String machineNo = pictureQo.getMachineNo(); String materialNo = pictureQo.getMaterialNo(); String modelNo = pictureQo.getModelNo(); - String partNo = pictureQo.getPartNo(); - Optional pictureEntity2 = pictureDao.selectPicture(lotNo, machineNo, materialNo, modelNo, partNo); + String machineTypeNo = pictureQo.getMachineTypeNo(); + String craftItemName = pictureQo.getCraftItemName(); + Optional pictureEntity2 = pictureDao.selectPicture(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); if (pictureEntity2.isPresent()) { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "请勿重复添加!", locale); } @@ -41,7 +42,8 @@ public class PictureServiceImpl implements PictureService { pictureEntity1.setMachineNo(machineNo); pictureEntity1.setMaterialNo(materialNo); pictureEntity1.setModelNo(modelNo); - pictureEntity1.setPartNo(partNo); + pictureEntity1.setMachineTypeNo(machineTypeNo); + pictureEntity1.setCraftItemName(craftItemName); pictureEntity1.setPicturePath(file); pictureDao.save(pictureEntity1); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); diff --git a/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java b/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java index 7c5322a..ccac25e 100644 --- a/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java @@ -27,13 +27,14 @@ public class SpecServiceImpl implements SpecService { @Override public String insertSpec(SpecQo specQo) { Locale locale = LocaleContextHolder.getLocale(); - List specEntities = specQuery.selectSpec(specQo.getPartNo(), specQo.getInspectionItemCode()); + List specEntities = specQuery.selectSpec(specQo.getMachineTypeNo(), specQo.getInspectionItemCode(),specQo.getCraftItemName()); if (!specEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "已存在该测量规格!", locale); } SpecEntity specEntity1 = new SpecEntity(); - specEntity1.setPartNo(specQo.getPartNo()); + specEntity1.setMachineTypeNo(specQo.getMachineTypeNo()); specEntity1.setInspectionItemCode(specQo.getInspectionItemCode()); + specEntity1.setCraftItemName(specQo.getCraftItemName()); specEntity1.setMax(specQo.getMax()); specEntity1.setMean(specQo.getMean()); specEntity1.setMin(specQo.getMin()); diff --git a/src/main/java/com/xkrs/util/DataDictQuery.java b/src/main/java/com/xkrs/util/DataDictQuery.java index 4e5a544..5d8e4a5 100644 --- a/src/main/java/com/xkrs/util/DataDictQuery.java +++ b/src/main/java/com/xkrs/util/DataDictQuery.java @@ -6,10 +6,7 @@ import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/xkrs/util/DataSourceQuery.java b/src/main/java/com/xkrs/util/DataSourceQuery.java index eea61ed..18f5e4c 100644 --- a/src/main/java/com/xkrs/util/DataSourceQuery.java +++ b/src/main/java/com/xkrs/util/DataSourceQuery.java @@ -26,7 +26,7 @@ public class DataSourceQuery { * * @return */ - public List selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String partNo) { + public List selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) { Specification specification = (root, criteriaQuery, criteriaBuilder) -> { List list = new ArrayList<>(); if (!TextUtils.isEmpty(lotNo)) { @@ -41,8 +41,11 @@ public class DataSourceQuery { if (!TextUtils.isEmpty(modelNo)) { list.add(criteriaBuilder.equal(root.get("modelNo").as(String.class), modelNo)); } - if (!TextUtils.isEmpty(partNo)) { - list.add(criteriaBuilder.equal(root.get("partNo").as(String.class), partNo)); + if (!TextUtils.isEmpty(machineTypeNo)) { + list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo)); + } + if (!TextUtils.isEmpty(craftItemName)) { + list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName)); } Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates)); diff --git a/src/main/java/com/xkrs/util/ExcelUploadUtil.java b/src/main/java/com/xkrs/util/ExcelUploadUtil.java index d2c1bc8..7f4afb7 100644 --- a/src/main/java/com/xkrs/util/ExcelUploadUtil.java +++ b/src/main/java/com/xkrs/util/ExcelUploadUtil.java @@ -44,13 +44,13 @@ public class ExcelUploadUtil { String newName = UUID.randomUUID().toString() + suffix; //将图片保存到本地/usr/etc/images/Folder -// File file = new File("/Users/liuchengqian/Desktop/DaJiang/"); - File file = new File("/home/sxy/server/industrial_measurement" + subDir); + File file = new File("/Users/liuchengqian/Desktop/DaJiang/" + subDir); +// File file = new File("/home/sxy/server/industrial_measurement" + subDir); if (!file.exists()) { file.mkdirs(); } -// String path = "/Users/liuchengqian/Desktop/DaJiang/"+newName; - String path = "/home/sxy/server/industrial_measurement" + subDir + newName; + String path = "/Users/liuchengqian/Desktop/DaJiang/" + subDir + newName; +// String path = "/home/sxy/server/industrial_measurement" + subDir + newName; String uploadsImage = uploadPath + newName; //实现上传 fileInput.transferTo(new File(path)); diff --git a/src/main/java/com/xkrs/util/PictureQuery.java b/src/main/java/com/xkrs/util/PictureQuery.java index 79dc2e2..cd7ab46 100644 --- a/src/main/java/com/xkrs/util/PictureQuery.java +++ b/src/main/java/com/xkrs/util/PictureQuery.java @@ -26,7 +26,7 @@ public class PictureQuery { * * @return */ - public List selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String partNo) { + public List selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) { Specification specification = (root, criteriaQuery, criteriaBuilder) -> { List list = new ArrayList<>(); if (!TextUtils.isEmpty(lotNo)) { @@ -41,8 +41,11 @@ public class PictureQuery { if (!TextUtils.isEmpty(modelNo)) { list.add(criteriaBuilder.equal(root.get("modelNo").as(String.class), modelNo)); } - if (!TextUtils.isEmpty(partNo)) { - list.add(criteriaBuilder.equal(root.get("partNo").as(String.class), partNo)); + if (!TextUtils.isEmpty(machineTypeNo)) { + list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo)); + } + if (!TextUtils.isEmpty(craftItemName)) { + list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName)); } Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates)); diff --git a/src/main/java/com/xkrs/util/SpecQuery.java b/src/main/java/com/xkrs/util/SpecQuery.java index 17ae43f..d744a90 100644 --- a/src/main/java/com/xkrs/util/SpecQuery.java +++ b/src/main/java/com/xkrs/util/SpecQuery.java @@ -26,15 +26,18 @@ public class SpecQuery { * * @return */ - public List selectSpec(String partNo, String inspectionItemCode) { + public List selectSpec(String machineTypeNo, String inspectionItemCode, String craftItemName) { Specification specification = (root, criteriaQuery, criteriaBuilder) -> { List list = new ArrayList<>(); - if (!TextUtils.isEmpty(partNo)) { - list.add(criteriaBuilder.equal(root.get("partNo").as(String.class), partNo)); + if (!TextUtils.isEmpty(machineTypeNo)) { + list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo)); } if (!TextUtils.isEmpty(inspectionItemCode)) { list.add(criteriaBuilder.equal(root.get("inspectionItemCode").as(String.class), inspectionItemCode)); } + if (!TextUtils.isEmpty(craftItemName)) { + list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName)); + } Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates)); };