去除积木报表
This commit is contained in:
		
							parent
							
								
									04fe930bbc
								
							
						
					
					
						commit
						81bf4b2959
					
				|  | @ -29,32 +29,6 @@ | |||
| 			<groupId>org.jeecgframework</groupId> | ||||
| 			<artifactId>weixin4j</artifactId> | ||||
| 		</dependency> | ||||
| 		<!-- 积木报表 --> | ||||
| 		<dependency> | ||||
| 			<groupId>org.jeecgframework.jimureport</groupId> | ||||
| 			<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> | ||||
| 			<exclusions> | ||||
| 				<exclusion> | ||||
| 					<groupId>com.github.jsqlparser</groupId> | ||||
| 					<artifactId>jsqlparser</artifactId> | ||||
| 				</exclusion> | ||||
| 			</exclusions> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<groupId>org.jeecgframework.jimureport</groupId> | ||||
| 			<artifactId>jimureport-nosql-starter</artifactId> | ||||
| 		</dependency> | ||||
| 		<!-- 积木BI --> | ||||
| 		<dependency> | ||||
| 			<groupId>org.jeecgframework.jimureport</groupId> | ||||
| 			<artifactId>jimubi-spring-boot3-starter</artifactId> | ||||
| 			<exclusions> | ||||
| 				<exclusion> | ||||
| 					<groupId>com.github.jsqlparser</groupId> | ||||
| 					<artifactId>jsqlparser</artifactId> | ||||
| 				</exclusion> | ||||
| 			</exclusions> | ||||
| 		</dependency> | ||||
| 		<!-- AI大模型管理 --> | ||||
| 		<dependency> | ||||
| 			<groupId>org.jeecgframework.boot</groupId> | ||||
|  |  | |||
|  | @ -1,124 +0,0 @@ | |||
| package org.jeecg.config.jimureport; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 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 org.springframework.util.CollectionUtils; | ||||
| 
 | ||||
| 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<String, List<DragDictModel>> getManyDictItems(List<String> codeList, List<JSONObject> tableDictList) { | ||||
|         Map<String, List<DragDictModel>> manyDragDictItems  = new HashMap<>(); | ||||
|         if(!CollectionUtils.isEmpty(codeList)){ | ||||
|             Map<String, List<DictModel>> dictItemsMap = sysBaseApi.getManyDictItems(codeList); | ||||
|             dictItemsMap.forEach((k,v)->{ | ||||
|                 List<DragDictModel> dictItems  = new ArrayList<>(); | ||||
|                 v.forEach(dictItem->{ | ||||
|                     DragDictModel dictModel = new DragDictModel(); | ||||
|                     BeanUtils.copyProperties(dictItem,dictModel); | ||||
|                     dictItems.add(dictModel); | ||||
|                 }); | ||||
|                 manyDragDictItems.put(k,dictItems); | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         if(!CollectionUtils.isEmpty(tableDictList)){ | ||||
|             tableDictList.forEach(item->{ | ||||
|                 List<DragDictModel> dictItems  = new ArrayList<>(); | ||||
|                 JSONObject object = JSONObject.parseObject(item.toString()); | ||||
|                 String dictField = object.getString("dictField"); | ||||
|                 String dictTable = object.getString("dictTable"); | ||||
|                 String dictText = object.getString("dictText"); | ||||
|                 String fieldName = object.getString("fieldName"); | ||||
|                 List<DictModel> dictItemsList = sysBaseApi.queryTableDictItemsByCode(dictTable,dictText,dictField); | ||||
|                 dictItemsList.forEach(dictItem->{ | ||||
|                     DragDictModel dictModel = new DragDictModel(); | ||||
|                     BeanUtils.copyProperties(dictItem,dictModel); | ||||
|                     dictItems.add(dictModel); | ||||
|                 }); | ||||
|                 manyDragDictItems.put(fieldName,dictItems); | ||||
|             }); | ||||
|         } | ||||
|         return manyDragDictItems; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * | ||||
|      * @param dictCode | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public List<DragDictModel> getDictItems(String dictCode) { | ||||
|         List<DragDictModel> dictItems  = new ArrayList<>(); | ||||
|         if(oConvertUtils.isNotEmpty(dictCode)){ | ||||
|             List<DictModel> 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); | ||||
|     } | ||||
| } | ||||
|  | @ -1,107 +0,0 @@ | |||
| package org.jeecg.config.jimureport; | ||||
| 
 | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.jeecg.common.system.util.JwtUtil; | ||||
| import org.jeecg.common.system.vo.SysUserCacheInfo; | ||||
| import org.jeecg.common.util.RedisUtil; | ||||
| import org.jeecg.common.util.TokenUtils; | ||||
| import org.jeecg.modules.jmreport.api.JmReportTokenServiceI; | ||||
| import org.jeecg.modules.system.service.impl.SysBaseApiImpl; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.annotation.Lazy; | ||||
| import org.springframework.stereotype.Component; | ||||
| import org.springframework.util.CollectionUtils; | ||||
| 
 | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| /** | ||||
|  * 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制) | ||||
|  *  * 1.自定义获取登录token | ||||
|  *  * 2.自定义获取登录用户 | ||||
|  * @author: jeecg-boot | ||||
|  */ | ||||
| 
 | ||||
| 
 | ||||
| @Slf4j | ||||
| @Component | ||||
| public class JimuReportTokenService implements JmReportTokenServiceI { | ||||
|     @Autowired | ||||
|     private SysBaseApiImpl sysBaseApi; | ||||
|     @Autowired | ||||
|     @Lazy | ||||
|     private RedisUtil redisUtil; | ||||
| 
 | ||||
|     @Override | ||||
|     public String getToken(HttpServletRequest request) { | ||||
|         return TokenUtils.getTokenByRequest(request); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getUsername(String token) { | ||||
|         return JwtUtil.getUsername(token); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String[] getRoles(String token) { | ||||
|         String username = JwtUtil.getUsername(token); | ||||
|         Set roles = sysBaseApi.getUserRoleSet(username); | ||||
|         if(CollectionUtils.isEmpty(roles)){ | ||||
|             return null; | ||||
|         } | ||||
|         return (String[]) roles.toArray(new String[roles.size()]); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Boolean verifyToken(String token) { | ||||
|         return TokenUtils.verifyToken(token, sysBaseApi, redisUtil); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Map<String, Object> getUserInfo(String token) { | ||||
|         Map<String, Object> map = new HashMap(5); | ||||
|         String username = JwtUtil.getUsername(token); | ||||
|         //此处通过token只能拿到一个信息 用户账号  后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义 | ||||
|         SysUserCacheInfo userInfo = null; | ||||
|         try { | ||||
|             userInfo = sysBaseApi.getCacheUser(username); | ||||
|         } catch (Exception e) { | ||||
|             log.error("获取用户信息异常:"+ e.getMessage()); | ||||
|             return map; | ||||
|         } | ||||
|         //设置账号名 | ||||
|         map.put(SYS_USER_CODE, userInfo.getSysUserCode()); | ||||
|         //设置部门编码 | ||||
|         map.put(SYS_ORG_CODE, userInfo.getSysOrgCode()); | ||||
|         // 将所有信息存放至map 解析sql/api会根据map的键值解析 | ||||
|         return map; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 将jeecgboot平台的权限传递给积木报表 | ||||
|      * @param token | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public String[] getPermissions(String token) { | ||||
|         // 获取用户信息 | ||||
|         String username = JwtUtil.getUsername(token); | ||||
|         SysUserCacheInfo userInfo = null; | ||||
|         try { | ||||
|             userInfo = sysBaseApi.getCacheUser(username); | ||||
|         } catch (Exception e) { | ||||
|             log.error("获取用户信息异常:"+ e.getMessage()); | ||||
|         } | ||||
|         if(userInfo == null){ | ||||
|             return null; | ||||
|         } | ||||
|         // 查询权限 | ||||
|         Set<String> userPermissions = sysBaseApi.getUserPermissionSet(userInfo.getSysUserId()); | ||||
|         if(CollectionUtils.isEmpty(userPermissions)){ | ||||
|             return null; | ||||
|         } | ||||
|         return userPermissions.toArray(new String[0]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										54
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								pom.xml
									
									
									
									
									
								
							|  | @ -53,9 +53,6 @@ | |||
| 		<!-- 国产数据库驱动 --> | ||||
| 		<kingbase8.version>9.0.0</kingbase8.version> | ||||
| 		<dm8.version>8.1.1.49</dm8.version> | ||||
| 
 | ||||
| 		<!-- 积木报表--> | ||||
| 		<jimureport-spring-boot-starter.version>2.0.0</jimureport-spring-boot-starter.version> | ||||
| 		<minidao.version>1.10.11</minidao.version> | ||||
| 		<!-- 持久层 --> | ||||
| 		<mybatis-plus.version>3.5.12</mybatis-plus.version> | ||||
|  | @ -424,50 +421,7 @@ | |||
| 					</exclusion> | ||||
| 				</exclusions> | ||||
| 			</dependency> | ||||
| 			<!-- 积木报表--> | ||||
| 			<dependency> | ||||
| 				<groupId>org.jeecgframework.jimureport</groupId> | ||||
| 				<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> | ||||
| 				<version>${jimureport-spring-boot-starter.version}</version> | ||||
| 				<exclusions> | ||||
| 					<exclusion> | ||||
| 						<groupId>com.alibaba</groupId> | ||||
| 						<artifactId>fastjson</artifactId> | ||||
| 					</exclusion> | ||||
| 					<exclusion> | ||||
| 						<artifactId>commons-lang</artifactId> | ||||
| 						<groupId>commons-lang</groupId> | ||||
| 					</exclusion> | ||||
| 					<exclusion> | ||||
| 						<artifactId>checker-qual</artifactId> | ||||
| 						<groupId>org.checkerframework</groupId> | ||||
| 					</exclusion> | ||||
| 					<exclusion> | ||||
| 						<artifactId>autopoi-web</artifactId> | ||||
| 						<groupId>org.jeecgframework</groupId> | ||||
| 					</exclusion> | ||||
| 					<exclusion> | ||||
| 						<artifactId>druid</artifactId> | ||||
| 						<groupId>com.alibaba</groupId> | ||||
| 					</exclusion> | ||||
| 					<exclusion> | ||||
| 						<artifactId>jsqlparser</artifactId> | ||||
| 						<groupId>com.github.jsqlparser</groupId> | ||||
| 					</exclusion> | ||||
| 				</exclusions> | ||||
| 			</dependency> | ||||
| 			<dependency> | ||||
| 				<groupId>org.jeecgframework.jimureport</groupId> | ||||
| 				<artifactId>jimureport-nosql-starter</artifactId> | ||||
| 				<version>1.9.5.2</version> | ||||
| 				<exclusions> | ||||
| 					<exclusion> | ||||
| 						<groupId>org.apache.calcite</groupId> | ||||
| 						<artifactId>calcite-elasticsearch</artifactId> | ||||
| 					</exclusion> | ||||
| 				</exclusions> | ||||
| 			</dependency> | ||||
| 			<!-- minidao --> | ||||
| 						<!-- minidao --> | ||||
| 			<dependency> | ||||
| 				<groupId>org.jeecgframework.boot3</groupId> | ||||
| 				<artifactId>minidao-spring-boot-starter-jsqlparser-4.9</artifactId> | ||||
|  | @ -483,12 +437,6 @@ | |||
| 					</exclusion> | ||||
| 				</exclusions> | ||||
| 			</dependency> | ||||
|             <!-- 积木BI大屏和仪表盘 --> | ||||
|             <dependency> | ||||
|                 <groupId>org.jeecgframework.jimureport</groupId> | ||||
|                 <artifactId>jimubi-spring-boot3-starter</artifactId> | ||||
|                 <version>1.9.5</version> | ||||
|             </dependency> | ||||
| 			<!-- chatgpt --> | ||||
| 			<dependency> | ||||
| 				<groupId>org.jeecgframework.boot</groupId> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 panbaolin
						panbaolin