From 73d62b484cbfcd504d405bed357cd4e1b1f27419 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Wed, 12 Jun 2024 18:49:38 +0800 Subject: [PATCH] =?UTF-8?q?3.7.0=20=E5=A4=A7=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83=EF=BC=88=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JimuDragExternalServiceImpl.java | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/jimureport/JimuDragExternalServiceImpl.java diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/jimureport/JimuDragExternalServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/jimureport/JimuDragExternalServiceImpl.java new file mode 100644 index 00000000..33223b43 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/jimureport/JimuDragExternalServiceImpl.java @@ -0,0 +1,102 @@ +package org.jeecg.config.jimureport; + +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.dto.LogDTO; +import org.jeecg.common.system.api.ISysBaseAPI; +import org.jeecg.common.system.vo.DictModel; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.base.service.BaseCommonService; +import org.jeecg.modules.drag.service.IOnlDragExternalService; +import org.jeecg.modules.drag.vo.DragDictModel; +import org.jeecg.modules.drag.vo.DragLogDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description: 字典处理 + * @Author: lsq + * @Date:2023-01-09 + * @Version:V1.0 + */ +@Slf4j +@Service("onlDragExternalServiceImpl") +public class JimuDragExternalServiceImpl implements IOnlDragExternalService { + + @Autowired + @Lazy + private BaseCommonService baseCommonService; + + @Autowired + @Lazy + private ISysBaseAPI sysBaseApi; + /** + * 根据多个字典code查询多个字典项 + * @param codeList + * @return key = dictCode ; value=对应的字典项 + */ + @Override + public Map> getManyDictItems(List codeList) { + Map> manyDragDictItems = new HashMap<>(); + Map> dictItemsMap = sysBaseApi.getManyDictItems(codeList); + dictItemsMap.forEach((k,v)->{ + List dictItems = new ArrayList<>(); + v.forEach(dictItem->{ + DragDictModel dictModel = new DragDictModel(); + BeanUtils.copyProperties(dictItem,dictModel); + dictItems.add(dictModel); + }); + manyDragDictItems.put(k,dictItems); + }); + return manyDragDictItems; + } + + /** + * + * @param dictCode + * @return + */ + @Override + public List getDictItems(String dictCode) { + List dictItems = new ArrayList<>(); + if(oConvertUtils.isNotEmpty(dictCode)){ + List dictItemsList = sysBaseApi.getDictItems(dictCode); + dictItemsList.forEach(dictItem->{ + DragDictModel dictModel = new DragDictModel(); + BeanUtils.copyProperties(dictItem,dictModel); + dictItems.add(dictModel); + }); + } + return dictItems; + } + + /** + * 添加日志 + * @param dragLogDTO + */ + @Override + public void addLog(DragLogDTO dragLogDTO) { + if(oConvertUtils.isNotEmpty(dragLogDTO)){ + LogDTO dto = new LogDTO(); + BeanUtils.copyProperties(dragLogDTO,dto); + baseCommonService.addLog(dto); + } + } + + /** + * 保存日志 + * @param logMsg + * @param logType + * @param operateType + */ + @Override + public void addLog(String logMsg, int logType, int operateType) { + baseCommonService.addLog(logMsg,logType,operateType); + } +} \ No newline at end of file