From 157433fa9161c65c0dc3318209dba288dee97375 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 20 Aug 2022 23:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E9=85=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SystemFoundationSettingsServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SystemFoundationSettingsServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SystemFoundationSettingsServiceImpl.java index c1326def..73820f74 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SystemFoundationSettingsServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SystemFoundationSettingsServiceImpl.java @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON; import com.skyeye.common.client.ExecuteFeignClient; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.MapUtil; import com.skyeye.common.util.ToolUtil; import com.skyeye.eve.dao.SystemFoundationSettingsDao; import com.skyeye.eve.rest.flowable.order.SysOrderService; @@ -18,6 +19,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.HashMap; @@ -77,7 +79,7 @@ public class SystemFoundationSettingsServiceImpl implements SystemFoundationSett @Override public Map getSystemFoundationSettings() { Map map = systemFoundationSettingsDao.querySystemFoundationSettingsList(); - if (map == null || map.isEmpty()) { + if (CollectionUtils.isEmpty(map)) { map = getBaseSettings(); systemFoundationSettingsDao.insertSystemFoundationSettings(map); } @@ -109,21 +111,20 @@ public class SystemFoundationSettingsServiceImpl implements SystemFoundationSett */ private void judgeAndInitDefault(Map map) { // 企业假期类型以及扣薪信息 - if (!map.containsKey("holidaysTypeJson") || ToolUtil.isBlank(map.get("holidaysTypeJson").toString())) { + if (MapUtil.checkKeyIsNull(map, "holidaysTypeJson")) { map.put("holidaysTypeJson", new ArrayList<>()); } // 年假信息 - if (!map.containsKey("yearHolidaysMation") || ToolUtil.isBlank(map.get("yearHolidaysMation").toString())) { + if (MapUtil.checkKeyIsNull(map, "yearHolidaysMation")) { map.put("yearHolidaysMation", new ArrayList<>()); } // 异常考勤制度管理信息 - if (!map.containsKey("abnormalMation") || ToolUtil.isBlank(map.get("abnormalMation").toString())) { + if (MapUtil.checkKeyIsNull(map, "abnormalMation")) { map.put("abnormalMation", new ArrayList<>()); } // ERP单据审核的一些设置 - if (!map.containsKey("erpExamineBasicDesign") || ToolUtil.isBlank(map.get("erpExamineBasicDesign").toString())) { - List> beans = - ExecuteFeignClient.get(() -> sysOrderService.querySysOrderConstants()).getRows(); + if (MapUtil.checkKeyIsNull(map, "erpExamineBasicDesign")) { + List> beans = ExecuteFeignClient.get(() -> sysOrderService.querySysOrderConstants()).getRows(); map.put("erpExamineBasicDesign", JSON.toJSONString(beans)); } }