提交 c741d779 编写于 作者: JEECG低代码平台's avatar JEECG低代码平台

【严重问题】issues/I37PNL 微服务化后-cloud-demo项目导出无法和字典关联

上级 7f847c97
package org.jeecg.common.system.api; package org.jeecg.common.system.api;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.CommonAPI; import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.api.dto.OnlineAuthDTO; import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*; import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.system.vo.*; import org.jeecg.common.system.vo.*;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -80,12 +77,7 @@ public interface ISysBaseAPI extends CommonAPI { ...@@ -80,12 +77,7 @@ public interface ISysBaseAPI extends CommonAPI {
*/ */
List<String> getDepartNamesByUsername(String username); List<String> getDepartNamesByUsername(String username);
/**
* 10获取数据字典
* @param code
* @return
*/
public List<DictModel> queryDictItemsByCode(String code);
/** 11查询所有的父级字典,按照create_time排序 */ /** 11查询所有的父级字典,按照create_time排序 */
public List<DictModel> queryAllDict(); public List<DictModel> queryAllDict();
...@@ -96,14 +88,6 @@ public interface ISysBaseAPI extends CommonAPI { ...@@ -96,14 +88,6 @@ public interface ISysBaseAPI extends CommonAPI {
*/ */
public List<SysCategoryModel> queryAllDSysCategory(); public List<SysCategoryModel> queryAllDSysCategory();
/**
* 13获取表数据字典
* @param table
* @param text
* @param code
* @return
*/
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
/** /**
* 14查询所有部门 作为字典信息 id -->value,departName -->text * 14查询所有部门 作为字典信息 id -->value,departName -->text
......
package org.jeecg.common.api; package org.jeecg.common.api;
import org.jeecg.common.system.vo.DynamicDataSourceModel; import org.jeecg.common.system.vo.*;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.system.vo.SysPermissionDataRuleModel;
import org.jeecg.common.system.vo.SysUserCacheInfo;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -81,4 +78,20 @@ public interface CommonAPI { ...@@ -81,4 +78,20 @@ public interface CommonAPI {
*/ */
SysUserCacheInfo getCacheUser(String username); SysUserCacheInfo getCacheUser(String username);
/**
* 10获取数据字典
* @param code
* @return
*/
public List<DictModel> queryDictItemsByCode(String code);
/**
* 13获取表数据字典
* @param table
* @param text
* @param code
* @return
*/
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
} }
package org.jeecg.modules.system.service.impl; package org.jeecg.config;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.system.vo.DictModel; import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.mapper.SysDictMapper;
import org.jeecgframework.dict.service.AutoPoiDictServiceI; import org.jeecgframework.dict.service.AutoPoiDictServiceI;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/** /**
* 描述:AutoPoi Excel注解支持字典参数设置 * 描述:AutoPoi Excel注解支持字典参数设置
...@@ -25,9 +24,10 @@ import lombok.extern.slf4j.Slf4j; ...@@ -25,9 +24,10 @@ import lombok.extern.slf4j.Slf4j;
*/ */
@Slf4j @Slf4j
@Service @Service
public class AutoPoiDictService implements AutoPoiDictServiceI { public class AutoPoiDictConfig implements AutoPoiDictServiceI {
@Autowired @Lazy
private SysDictMapper sysDictMapper; @Resource
private CommonAPI commonAPI;
/** /**
* 通过字典查询easypoi,所需字典文本 * 通过字典查询easypoi,所需字典文本
...@@ -42,11 +42,11 @@ public class AutoPoiDictService implements AutoPoiDictServiceI { ...@@ -42,11 +42,11 @@ public class AutoPoiDictService implements AutoPoiDictServiceI {
List<DictModel> dictList = null; List<DictModel> dictList = null;
// step.1 如果没有字典表则使用系统字典表 // step.1 如果没有字典表则使用系统字典表
if (oConvertUtils.isEmpty(dicTable)) { if (oConvertUtils.isEmpty(dicTable)) {
dictList = sysDictMapper.queryDictItemsByCode(dicCode); dictList = commonAPI.queryDictItemsByCode(dicCode);
} else { } else {
try { try {
dicText = oConvertUtils.getString(dicText, dicCode); dicText = oConvertUtils.getString(dicText, dicCode);
dictList = sysDictMapper.queryTableDictItemsByCode(dicTable, dicText, dicCode); dictList = commonAPI.queryTableDictItemsByCode(dicTable, dicText, dicCode);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册