diff --git a/src/main/java/com/xkrs/controller/DataDictController.java b/src/main/java/com/xkrs/controller/DataDictController.java index f1df2d8..d4943c1 100644 --- a/src/main/java/com/xkrs/controller/DataDictController.java +++ b/src/main/java/com/xkrs/controller/DataDictController.java @@ -81,7 +81,7 @@ public class DataDictController { @Transactional(rollbackOn = Exception.class) public String updateDict(@RequestBody DataDictUpdateQo dataDictUpdateQo){ Locale locale = LocaleContextHolder.getLocale(); - dataDictDao.updateDict(dataDictUpdateQo.getId(),dataDictUpdateQo.getDictChineseName()); + dataDictDao.updateDict(dataDictUpdateQo.getId(),dataDictUpdateQo.getInspectionItemName()); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"修改成功!",locale); } } diff --git a/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java b/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java index f463eba..a81276b 100644 --- a/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java +++ b/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java @@ -14,7 +14,7 @@ public class DataDictUpdateQo { private Integer id; /** - * 中文名称 + * 质检项名称 */ @NotBlank(message = "{DataDict.inspectionItemName.blank}", groups = {DataDictUpdateQoUpdate.class}) private String inspectionItemName; diff --git a/src/main/java/com/xkrs/model/qo/DataSourceQo.java b/src/main/java/com/xkrs/model/qo/DataSourceQo.java index 6e34209..7c42c7f 100644 --- a/src/main/java/com/xkrs/model/qo/DataSourceQo.java +++ b/src/main/java/com/xkrs/model/qo/DataSourceQo.java @@ -1,9 +1,7 @@ package com.xkrs.model.qo; -import com.xkrs.model.validation.DataDictQoInsert; import com.xkrs.model.validation.DataSourceQoInsert; -import javax.persistence.Column; import javax.validation.constraints.NotBlank; /** @@ -11,100 +9,105 @@ import javax.validation.constraints.NotBlank; * @Date: 2022/1/19 16:37 */ public class DataSourceQo { - /** - * 机种号 - */ - @NotBlank(message = "{DataSource.dataModelNumber.blank}",groups={DataSourceQoInsert.class}) - private String dataModelNumber; /** * 批次号 */ - @NotBlank(message = "{DataSource.dataBatchNumber.blank}",groups={DataSourceQoInsert.class}) - private String dataBatchNumber; + @NotBlank(message = "{DataSource.lotNo.blank}", groups = {DataSourceQoInsert.class}) + private String lotNo; /** * 机器号 */ - @NotBlank(message = "{DataSource.dataMachineCode.blank}",groups={DataSourceQoInsert.class}) - private String dataMachineCode; + @NotBlank(message = "{DataSource.machineNo.blank}", groups = {DataSourceQoInsert.class}) + private String machineNo; /** - * 模具 + * 物料号 */ - @NotBlank(message = "{DataSource.productNumber.blank}",groups={DataSourceQoInsert.class}) - private String productNumber; + @NotBlank(message = "{DataSource.materialNo.blank}", groups = {DataSourceQoInsert.class}) + private String materialNo; /** - * 材料 + * 模具号 */ - private String material; + @NotBlank(message = "{DataSource.modelNo.blank}", groups = {DataSourceQoInsert.class}) + private String modelNo; /** - * 变量值 + * 零件号 */ - @NotBlank(message = "{DataSource.dataName.blank}",groups={DataSourceQoInsert.class}) - private String dataName; + @NotBlank(message = "{DataSource.partNo.blank}", groups = {DataSourceQoInsert.class}) + private String partNo; /** - * 监测的数值 + * 检验项代码 */ - @NotBlank(message = "{DataSource.numericalValue.blank}",groups={DataSourceQoInsert.class}) - private String numericalValue; + @NotBlank(message = "{DataSource.inspectionItemCode.blank}", groups = {DataSourceQoInsert.class}) + private String inspectionItemCode; - public String getDataModelNumber() { - return dataModelNumber; + /** + * 检验数值 + */ + @NotBlank(message = "{DataSource.inspectValue.blank}", groups = {DataSourceQoInsert.class}) + private String inspectValue; + + public DataSourceQo() { } - public void setDataModelNumber(String dataModelNumber) { - this.dataModelNumber = dataModelNumber; + public String getLotNo() { + return lotNo; } - public String getDataBatchNumber() { - return dataBatchNumber; + public void setLotNo(String lotNo) { + this.lotNo = lotNo; } - public void setDataBatchNumber(String dataBatchNumber) { - this.dataBatchNumber = dataBatchNumber; + public String getMachineNo() { + return machineNo; } - public String getDataMachineCode() { - return dataMachineCode; + public void setMachineNo(String machineNo) { + this.machineNo = machineNo; } - public void setDataMachineCode(String dataMachineCode) { - this.dataMachineCode = dataMachineCode; + public String getMaterialNo() { + return materialNo; } - public String getProductNumber() { - return productNumber; + public void setMaterialNo(String materialNo) { + this.materialNo = materialNo; } - public String getMaterial() { - return material; + public String getModelNo() { + return modelNo; } - public void setMaterial(String material) { - this.material = material; + public void setModelNo(String modelNo) { + this.modelNo = modelNo; } - public void setProductNumber(String productNumber) { - this.productNumber = productNumber; + public String getPartNo() { + return partNo; } - public String getDataName() { - return dataName; + public void setPartNo(String partNo) { + this.partNo = partNo; } - public void setDataName(String dataName) { - this.dataName = dataName; + public String getInspectionItemCode() { + return inspectionItemCode; } - public String getNumericalValue() { - return numericalValue; + public void setInspectionItemCode(String inspectionItemCode) { + this.inspectionItemCode = inspectionItemCode; } - public void setNumericalValue(String numericalValue) { - this.numericalValue = numericalValue; + public String getInspectValue() { + return inspectValue; + } + + public void setInspectValue(String inspectValue) { + this.inspectValue = inspectValue; } } diff --git a/src/main/java/com/xkrs/model/qo/FileQo.java b/src/main/java/com/xkrs/model/qo/FileQo.java index 88da44b..f1676d1 100644 --- a/src/main/java/com/xkrs/model/qo/FileQo.java +++ b/src/main/java/com/xkrs/model/qo/FileQo.java @@ -1,6 +1,7 @@ package com.xkrs.model.qo; import com.xkrs.model.validation.FileQoInsert; + import javax.validation.constraints.NotBlank; /** @@ -9,66 +10,83 @@ import javax.validation.constraints.NotBlank; */ public class FileQo { - /** - * 机种号 - */ - @NotBlank(message = "{FileEntity.fileModelNumber.blank}",groups={FileQoInsert.class}) - private String fileModelNumber; - /** * 批次号 */ - @NotBlank(message = "{FileEntity.fileBatchNumber.blank}",groups={FileQoInsert.class}) - private String fileBatchNumber; + @NotBlank(message = "{FileEntity.lotNo.blank}", groups = {FileQoInsert.class}) + private String lotNo; /** * 机器号 */ - @NotBlank(message = "{FileEntity.fileMachineCode.blank}",groups={FileQoInsert.class}) - private String fileMachineCode; + @NotBlank(message = "{FileEntity.machineNo.blank}", groups = {FileQoInsert.class}) + private String machineNo; /** - * 产品编号 + * 物料号 */ - @NotBlank(message = "{FileEntity.fileProductNumber.blank}",groups={FileQoInsert.class}) - private String fileProductNumber; + @NotBlank(message = "{FileEntity.materialNo.blank}", groups = {FileQoInsert.class}) + private String materialNo; + + /** + * 模具号 + */ + @NotBlank(message = "{FileEntity.modelNo.blank}", groups = {FileQoInsert.class}) + private String modelNo; + + /** + * 零件号 + */ + @NotBlank(message = "{FileEntity.partNo.blank}", groups = {FileQoInsert.class}) + private String partNo; /** * 上传模板的路径 */ - @NotBlank(message = "{FileEntity.fileUploadPath.blank}",groups={FileQoInsert.class}) + @NotBlank(message = "{FileEntity.fileUploadPath.blank}", groups = {FileQoInsert.class}) private String fileUploadPath; - public String getFileModelNumber() { - return fileModelNumber; + public FileQo() { } - public void setFileModelNumber(String fileModelNumber) { - this.fileModelNumber = fileModelNumber; + public String getLotNo() { + return lotNo; } - public String getFileBatchNumber() { - return fileBatchNumber; + public void setLotNo(String lotNo) { + this.lotNo = lotNo; } - public void setFileBatchNumber(String fileBatchNumber) { - this.fileBatchNumber = fileBatchNumber; + public String getMachineNo() { + return machineNo; } - public String getFileMachineCode() { - return fileMachineCode; + public void setMachineNo(String machineNo) { + this.machineNo = machineNo; } - public void setFileMachineCode(String fileMachineCode) { - this.fileMachineCode = fileMachineCode; + public String getMaterialNo() { + return materialNo; } - public String getFileProductNumber() { - return fileProductNumber; + public void setMaterialNo(String materialNo) { + this.materialNo = materialNo; } - public void setFileProductNumber(String fileProductNumber) { - this.fileProductNumber = fileProductNumber; + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getPartNo() { + return partNo; + } + + public void setPartNo(String partNo) { + this.partNo = partNo; } public String getFileUploadPath() { diff --git a/src/main/java/com/xkrs/model/qo/FileUpdateQo.java b/src/main/java/com/xkrs/model/qo/FileUpdateQo.java index 9a33ca4..d681616 100644 --- a/src/main/java/com/xkrs/model/qo/FileUpdateQo.java +++ b/src/main/java/com/xkrs/model/qo/FileUpdateQo.java @@ -11,59 +11,76 @@ import javax.validation.constraints.NotBlank; */ public class FileUpdateQo { - /** - * 机种号 - */ - @NotBlank(message = "{FileEntity.fileModelNumber.blank}",groups={FileUpdateQoUpdate.class}) - private String fileModelNumber; - /** * 批次号 */ - @NotBlank(message = "{FileEntity.fileBatchNumber.blank}",groups={FileUpdateQoUpdate.class}) - private String fileBatchNumber; + @NotBlank(message = "{FileEntity.lotNo.blank}", groups = {FileUpdateQoUpdate.class}) + private String lotNo; /** * 机器号 */ - @NotBlank(message = "{FileEntity.fileMachineCode.blank}",groups={FileUpdateQoUpdate.class}) - private String fileMachineCode; + @NotBlank(message = "{FileEntity.machineNo.blank}", groups = {FileUpdateQoUpdate.class}) + private String machineNo; /** - * 产品编号 + * 物料号 */ - @NotBlank(message = "{FileEntity.fileProductNumber.blank}",groups={FileUpdateQoUpdate.class}) - private String fileProductNumber; + @NotBlank(message = "{FileEntity.materialNo.blank}", groups = {FileUpdateQoUpdate.class}) + private String materialNo; - public String getFileModelNumber() { - return fileModelNumber; + /** + * 模具号 + */ + @NotBlank(message = "{FileEntity.modelNo.blank}", groups = {FileUpdateQoUpdate.class}) + private String modelNo; + + /** + * 零件号 + */ + @NotBlank(message = "{FileEntity.partNo.blank}", groups = {FileUpdateQoUpdate.class}) + private String partNo; + + public FileUpdateQo() { } - public void setFileModelNumber(String fileModelNumber) { - this.fileModelNumber = fileModelNumber; + public String getLotNo() { + return lotNo; } - public String getFileBatchNumber() { - return fileBatchNumber; + public void setLotNo(String lotNo) { + this.lotNo = lotNo; } - public void setFileBatchNumber(String fileBatchNumber) { - this.fileBatchNumber = fileBatchNumber; + public String getMachineNo() { + return machineNo; } - public String getFileMachineCode() { - return fileMachineCode; + public void setMachineNo(String machineNo) { + this.machineNo = machineNo; } - public void setFileMachineCode(String fileMachineCode) { - this.fileMachineCode = fileMachineCode; + public String getMaterialNo() { + return materialNo; } - public String getFileProductNumber() { - return fileProductNumber; + public void setMaterialNo(String materialNo) { + this.materialNo = materialNo; } - public void setFileProductNumber(String fileProductNumber) { - this.fileProductNumber = fileProductNumber; + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getPartNo() { + return partNo; + } + + public void setPartNo(String partNo) { + this.partNo = partNo; } } diff --git a/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java b/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java index 6f22910..6d50b88 100644 --- a/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java @@ -25,6 +25,7 @@ public class DataDictServiceImpl implements DataDictService { /** * 添加字典数据 + * * @param dataDictQo * @return */ @@ -37,14 +38,14 @@ public class DataDictServiceImpl implements DataDictService { return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT,"该产品变量已存在,请勿重复添加!",locale); }*/ //DataDict byDictEnglishName = dataDictDao.findByDictEnglishName(dataDictQo.getDictEnglishName()); - DataDict englishName = dataDictDao.findByDictEnglishName(dataDictQo.getDictEnglishName()); - if(englishName != null){ - return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT,"该产品变量已存在,请勿重复添加!",locale); + DataDict englishName = dataDictDao.findByDictEnglishName(dataDictQo.getInspectionItemCode()); + if (englishName != null) { + return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "该产品变量已存在,请勿重复添加!", locale); } DataDict dataDict = new DataDict(); - dataDict.setDictChineseName(dataDictQo.getDictChineseName()); - dataDict.setDictEnglishName(dataDictQo.getDictEnglishName()); + dataDict.setInspectionItemName(dataDictQo.getInspectionItemName()); + dataDict.setInspectionItemCode(dataDictQo.getInspectionItemCode()); dataDictDao.save(dataDict); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功!",locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); } } diff --git a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java index f17a4d2..b776468 100644 --- a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java @@ -36,23 +36,18 @@ public class DataSourceServiceImpl implements DataSourceService { @Override public String insertDataSource(DataSourceQo dataSourceQo) { Locale locale = LocaleContextHolder.getLocale(); - DataDict byDictEnglishName = dataDictDao.findByDictEnglishName(dataSourceQo.getDataName()); + DataDict byDictEnglishName = dataDictDao.findByDictEnglishName(dataSourceQo.getInspectionItemCode()); if(byDictEnglishName == null){ - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"不存在该字典类型!",locale); } - /*DataSource byDataName = dataSourceDao.findByDataName(dataSourceQo.getDataName()); - if(byDataName != null){ - return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT,"该字典类型数据已添加,请勿重复添加!",locale); - }*/ DataSource dataSource = new DataSource(); - dataSource.setDataModelNumber(dataSourceQo.getDataModelNumber()); - dataSource.setDataBatchNumber(dataSourceQo.getDataBatchNumber()); - dataSource.setDataMachineCode(dataSourceQo.getDataMachineCode()); - dataSource.setProductNumber(dataSourceQo.getProductNumber()); - dataSource.setMaterial(dataSourceQo.getMaterial()); - dataSource.setDataName(dataSourceQo.getDataName()); - dataSource.setNumericalValue(dataSourceQo.getNumericalValue()); + dataSource.setLotNo(dataSourceQo.getLotNo()); + dataSource.setMachineNo(dataSourceQo.getMachineNo()); + dataSource.setMaterialNo(dataSourceQo.getMaterialNo()); + dataSource.setModelNo(dataSourceQo.getModelNo()); + dataSource.setPartNo(dataSourceQo.getPartNo()); + dataSource.setInspectionItemCode(dataSourceQo.getInspectionItemCode()); + dataSource.setInspectValue(dataSourceQo.getInspectValue()); dataSourceDao.save(dataSource); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功!",locale); } diff --git a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java index f6705d3..a47f2d0 100644 --- a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java @@ -58,12 +58,12 @@ public class FileServiceImpl implements FileService { } String file = ExcelUploadUtil.memoryFile(fileExcel); FileEntity fileEntity1 = new FileEntity(); - fileEntity1.setFileModelNumber(fileQo.getFileModelNumber()); - fileEntity1.setFileBatchNumber(fileQo.getFileBatchNumber()); - fileEntity1.setFileMachineCode(fileQo.getFileMachineCode()); - fileEntity1.setFileProductNumber(fileQo.getFileProductNumber()); + fileEntity1.setLotNo(fileQo.getLotNo()); + fileEntity1.setMachineNo(fileQo.getMachineNo()); + fileEntity1.setMaterialNo(fileQo.getMaterialNo()); + fileEntity1.setModelNo(fileQo.getModelNo()); + fileEntity1.setPartNo(fileQo.getPartNo()); fileEntity1.setFileUploadPath(file); - fileDao.save(fileEntity1); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功!",locale); } @@ -86,7 +86,7 @@ public class FileServiceImpl implements FileService { if(maps == null || maps.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时没有该产品的信息!",locale); } - Map map = new HashMap(); + Map map = new HashMap<>(); for(Map stringMap : maps){ map.put(stringMap.get("dataname"),stringMap.get("numericalvalue")); }