From 29b6ad4d66a837f5d59ac59d6816cae8cbbef164 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Thu, 7 Mar 2024 13:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agencycategory/impl/AgencyCategoryServiceImpl.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java index c342ddf1..c3af7a13 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/agencycategory/impl/AgencyCategoryServiceImpl.java @@ -1,6 +1,5 @@ package com.xinelu.manage.service.agencycategory.impl; -import com.xinelu.common.constant.Constants; import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; @@ -16,6 +15,7 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; @@ -29,8 +29,6 @@ import java.util.stream.Collectors; public class AgencyCategoryServiceImpl implements IAgencyCategoryService { @Resource private AgencyCategoryMapper agencyCategoryMapper; - @Resource - private GenerateSystemCodeUtil generateSystemCodeUtil; /** * 查询机构类别 @@ -62,12 +60,11 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService { */ @Override public int insertAgencyCategory(AgencyCategory agencyCategory) { - if (agencyCategory.getCategoryLevel().equals(1)) { + if (Objects.isNull(agencyCategory.getCategoryLevel()) || agencyCategory.getCategoryLevel().equals(1)) { agencyCategory.setParentCategoryId(null); } agencyCategory.setCreateTime(DateUtils.getNowDate()); agencyCategory.setCreateBy(SecurityUtils.getUsername()); - agencyCategory.setCategoryCode(Constants.CATEGORY_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CATEGORY_CODE)); return agencyCategoryMapper.insertAgencyCategory(agencyCategory); }