From c7d1ea4e87d576804375080b924abfb6cd41a31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 23 Jul 2021 00:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=9A=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materialAttribute/MaterialAttributeService.java | 1 + .../materialCategory/MaterialCategoryService.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/materialAttribute/MaterialAttributeService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/materialAttribute/MaterialAttributeService.java index 7fcb755d..4b9f93d7 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/materialAttribute/MaterialAttributeService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/materialAttribute/MaterialAttributeService.java @@ -74,6 +74,7 @@ public class MaterialAttributeService { materialAttribute.setAttributeName(map.get(field)); for(MaterialAttribute ma: maList) { if(field.equals(ma.getAttributeField())){ + materialAttribute.setId(ma.getId()); materialAttribute.setAttributeName(ma.getAttributeName()); materialAttribute.setAttributeValue(ma.getAttributeValue()); } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java index 24917428..cd84a641 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java @@ -222,7 +222,15 @@ public class MaterialCategoryService { } public int checkIsNameExist(Long id, String name)throws Exception { - return 0; + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); } public List findById(Long id)throws Exception {