diff --git a/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java b/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java index 18b6556..9f9d80f 100644 --- a/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java +++ b/src/main/java/com/xkrs/controller/QcInspectionItemDictController.java @@ -46,14 +46,14 @@ public class QcInspectionItemDictController { /** * 动态多条件查询字典信息 * - * @param dictChineseName - * @param dictEnglishName + * @param inspectionItemCode + * @param inspectionItemName * @return */ @GetMapping("/selectDataDict") - public String selectDataDict(@RequestParam("dictChineseName") String dictChineseName, @RequestParam("dictEnglishName") String dictEnglishName) { + public String selectDataDict(@RequestParam("inspectionItemCode") String inspectionItemCode, @RequestParam("inspectionItemName") String inspectionItemName) { Locale locale = LocaleContextHolder.getLocale(); - List qcInspectionItemDict = query.selectDataDict(dictChineseName, dictEnglishName); + List qcInspectionItemDict = query.selectDataDict(inspectionItemCode, inspectionItemName); if (qcInspectionItemDict == null || qcInspectionItemDict.size() == 0) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有该型号类型的字典信息!", locale); } diff --git a/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java index 181f155..d7237e6 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionDataSourceServiceImpl.java @@ -37,13 +37,6 @@ public class QcInspectionDataSourceServiceImpl implements QcInspectionDataSource @Override public String insertDataSource(QcInspectionDataSourceQo inspectionDataSourceQo) { Locale locale = LocaleContextHolder.getLocale(); - String lotNo = inspectionDataSourceQo.getLotNo(); - String machineNo = inspectionDataSourceQo.getMachineNo(); - String materialNo = inspectionDataSourceQo.getMaterialNo(); - String modelNo = inspectionDataSourceQo.getModelNo(); - String partNo = inspectionDataSourceQo.getPartNo(); - String inspectionItemCode = inspectionDataSourceQo.getInspectionItemCode(); - String inspectValue = inspectionDataSourceQo.getInspectValue(); QcInspectionItemDict byInspectionItemCode = inspectionItemDictDao.findByInspectionItemCode(inspectionDataSourceQo.getInspectionItemCode()); if (byInspectionItemCode == null) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该字典类型!", locale); @@ -52,13 +45,13 @@ public class QcInspectionDataSourceServiceImpl implements QcInspectionDataSource if (inspectionDataSourceQo.getId() > 0) { qcInspectionDataSource.setId(inspectionDataSourceQo.getId()); } - qcInspectionDataSource.setLotNo(lotNo); - qcInspectionDataSource.setMachineNo(machineNo); - qcInspectionDataSource.setMaterialNo(materialNo); - qcInspectionDataSource.setModelNo(modelNo); - qcInspectionDataSource.setPartNo(partNo); - qcInspectionDataSource.setInspectionItemCode(inspectionItemCode); - qcInspectionDataSource.setInspectValue(inspectValue); + 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); 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 9af3a31..dc31eb6 100644 --- a/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcInspectionFileServiceImpl.java @@ -64,9 +64,7 @@ public class QcInspectionFileServiceImpl implements QcInspectionFileService { } String file = ExcelUploadUtil.memoryFile(fileExcel); QcInspectionFile fileEntity = new QcInspectionFile(); - if (inspectionFileQo.getId() > 0) { - fileEntity.setId(inspectionFileQo.getId()); - } + fileEntity.setId(inspectionFileQo.getId()); fileEntity.setLotNo(lotNo); fileEntity.setMachineNo(machineNo); fileEntity.setMaterialNo(materialNo); diff --git a/src/main/java/com/xkrs/util/Query.java b/src/main/java/com/xkrs/util/Query.java index f0c12e1..610d3c5 100644 --- a/src/main/java/com/xkrs/util/Query.java +++ b/src/main/java/com/xkrs/util/Query.java @@ -28,16 +28,16 @@ public class Query { * * @return */ - public List selectDataDict(String dictChineseName, String dictEnglishName) { + public List selectDataDict(String inspectionItemCode, String inspectionItemName) { Specification specification = new Specification() { @Override public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) { List list = new ArrayList<>(); - if (dictChineseName != null && !"".equals(dictChineseName)) { - list.add(criteriaBuilder.equal(root.get("dictChineseName").as(String.class), dictChineseName)); + if (inspectionItemCode != null && !"".equals(inspectionItemCode)) { + list.add(criteriaBuilder.equal(root.get("inspectionItemCode").as(String.class), inspectionItemCode)); } - if (dictEnglishName != null && !"".equals(dictEnglishName)) { - list.add(criteriaBuilder.equal(root.get("dictEnglishName").as(String.class), dictEnglishName)); + if (inspectionItemName != null && !"".equals(inspectionItemName)) { + list.add(criteriaBuilder.equal(root.get("inspectionItemName").as(String.class), inspectionItemName)); } Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates));