mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-02 08:35:25 +08:00
v3.9.1 后台代码
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
package org.jeecg.common.airag.api;
|
||||
|
||||
import org.jeecg.common.airag.api.fallback.AiragBaseApiFallback;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* airag baseAPI
|
||||
*
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "airagBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = AiragBaseApiFallback.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.airag.llm.service.impl.AiragBaseApiImpl")
|
||||
public interface IAiragBaseApi {
|
||||
|
||||
/**
|
||||
* 知识库写入文本文档
|
||||
*
|
||||
* @param knowledgeId 知识库ID
|
||||
* @param title 文档标题
|
||||
* @param content 文档内容
|
||||
* @return 新增的文档ID
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@PostMapping("/airag/api/knowledgeWriteTextDocument")
|
||||
String knowledgeWriteTextDocument(
|
||||
@RequestParam("knowledgeId") String knowledgeId,
|
||||
@RequestParam("title") String title,
|
||||
@RequestParam("content") String content
|
||||
);
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package org.jeecg.common.airag.api.factory;
|
||||
|
||||
import org.jeecg.common.airag.api.IAiragBaseApi;
|
||||
import org.jeecg.common.airag.api.fallback.AiragBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AiragBaseApiFallbackFactory implements FallbackFactory<IAiragBaseApi> {
|
||||
|
||||
@Override
|
||||
public IAiragBaseApi create(Throwable cause) {
|
||||
AiragBaseApiFallback fallback = new AiragBaseApiFallback();
|
||||
fallback.setCause(cause);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package org.jeecg.common.airag.api.fallback;
|
||||
|
||||
import lombok.Setter;
|
||||
import org.jeecg.common.airag.api.IAiragBaseApi;
|
||||
|
||||
public class AiragBaseApiFallback implements IAiragBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public String knowledgeWriteTextDocument(String knowledgeId, String title, String content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,6 +18,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -872,6 +873,18 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@PostMapping(value = "/sys/api/runAiragFlow")
|
||||
Object runAiragFlow(@RequestBody AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 流式运行AIRag流程
|
||||
* for [QQYUN-13634]在baseapi里面封装方法,方便其他模块调用
|
||||
*
|
||||
* @param airagFlowDTO
|
||||
* @return 流程执行结果,可能是String或者Map
|
||||
* @author chenrui
|
||||
* @date 2025/9/2 11:43
|
||||
*/
|
||||
@PostMapping(value = "/sys/api/runAiragFlowStream")
|
||||
SseEmitter runAiragFlowStream(@RequestBody AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 根据部门code或部门id获取部门名称(当前和上级部门)
|
||||
*
|
||||
|
||||
@ -12,6 +12,7 @@ import org.jeecg.common.constant.enums.DySmsEnum;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -506,6 +507,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uniPushMsgToUser(PushMessageDTO pushMessageDTO) {
|
||||
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package org.jeecg.common.airag.api;
|
||||
|
||||
/**
|
||||
* airag baseAPI
|
||||
*
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
public interface IAiragBaseApi {
|
||||
|
||||
/**
|
||||
* 知识库写入文本文档
|
||||
*
|
||||
* @param knowledgeId 知识库ID
|
||||
* @param title 文档标题
|
||||
* @param content 文档内容
|
||||
* @return 新增的文档ID
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
String knowledgeWriteTextDocument(String knowledgeId, String title, String content);
|
||||
|
||||
}
|
||||
@ -11,6 +11,7 @@ import org.jeecg.common.constant.enums.DySmsEnum;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -618,6 +619,17 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
Object runAiragFlow(AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 流式运行AIRag流程
|
||||
* for [QQYUN-13634]在baseapi里面封装方法,方便其他模块调用
|
||||
*
|
||||
* @param airagFlowDTO
|
||||
* @return 流程执行结果,可能是String或者Map
|
||||
* @author chenrui
|
||||
* @date 2025/9/2 11:43
|
||||
*/
|
||||
SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 根据部门code或部门id获取部门名称(当前和上级部门)
|
||||
*
|
||||
|
||||
@ -2,10 +2,13 @@ package org.jeecg.config.jimureport;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
|
||||
import org.jeecg.modules.jmreport.common.vo.JmDictModel;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -13,9 +16,8 @@ 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;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
|
||||
@ -36,7 +38,11 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
|
||||
|
||||
@Override
|
||||
public String getToken(HttpServletRequest request) {
|
||||
try {
|
||||
return TokenUtils.getTokenByRequest(request);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -104,4 +110,21 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
|
||||
}
|
||||
return userPermissions.toArray(new String[0]);
|
||||
}
|
||||
|
||||
//TODO 待升级积木报表依赖版本后启用
|
||||
// @Override
|
||||
public List<JmDictModel> getDictItems(String dictCode) {
|
||||
List<JmDictModel> dictItems = new ArrayList<>();
|
||||
if(oConvertUtils.isNotEmpty(dictCode)){
|
||||
List<DictModel> dictItemsList = sysBaseApi.getDictItems(dictCode);
|
||||
dictItemsList.forEach(dictItem->{
|
||||
JmDictModel dictModel = new JmDictModel();
|
||||
dictModel.setText(dictItem.getText());
|
||||
dictModel.setValue(dictItem.getValue());
|
||||
dictModel.setDictCode(dictCode);
|
||||
dictItems.add(dictModel);
|
||||
});
|
||||
}
|
||||
return dictItems;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,9 +35,6 @@ import java.util.Map;
|
||||
@Component
|
||||
public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
|
||||
@Autowired
|
||||
SysUserController sysUserController;
|
||||
|
||||
@Autowired
|
||||
SysUserMapper userMapper;
|
||||
|
||||
@ -82,7 +79,7 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
"\n\n - 你应该提前判断用户的输入是否合法,比如用户名是否符合规范,手机号和邮箱是否正确等." +
|
||||
"\n\n - 提前使用用户名查询用户是否存在,如果存在则不能添加." +
|
||||
"\n\n - 添加成功后返回成功消息,如果失败则返回失败原因." +
|
||||
"\n\n - 用户名,邮箱,手机号均要求唯一,提前通过查询用户工具确认唯一性." )
|
||||
"\n\n - 用户名,手机号均要求唯一,提前通过查询用户工具确认唯一性." )
|
||||
.parameters(
|
||||
JsonObjectSchema.builder()
|
||||
.addStringProperty("username", "用户名,必填,只允许使用字母、数字、下划线,且必须以字母开头,唯一")
|
||||
@ -90,7 +87,7 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
.addStringProperty("realname", "真实姓名,必填")
|
||||
//.addStringProperty("email", "邮箱,必填,唯一")
|
||||
.addStringProperty("phone", "手机号,必填,唯一")
|
||||
.required("username","password","realname","workNo","email","phone")
|
||||
.required("username","password","realname","phone")
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
@ -122,6 +119,7 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
msg = "添加用户成功";
|
||||
// 用户变更,触发同步工作流
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg = "添加用户失败";
|
||||
}
|
||||
return msg;
|
||||
@ -203,10 +201,10 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
qw.like("role_code", sysRole.getRoleCode());
|
||||
}
|
||||
// 未删除
|
||||
List<org.jeecg.modules.system.entity.SysRole> roles = sysRoleService.list(qw);
|
||||
List<SysRole> roles = sysRoleService.list(qw);
|
||||
// 仅返回核心字段
|
||||
JSONArray arr = new JSONArray();
|
||||
for (org.jeecg.modules.system.entity.SysRole r : roles) {
|
||||
for (SysRole r : roles) {
|
||||
JSONObject o = new JSONObject();
|
||||
o.put("id", r.getId());
|
||||
o.put("roleName", r.getRoleName());
|
||||
@ -240,10 +238,10 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
JSONObject args = JSONObject.parseObject(toolExecutionRequest.arguments());
|
||||
String userId = args.getString("userId");
|
||||
String roleIdsStr = args.getString("roleIds");
|
||||
if (org.apache.commons.lang3.StringUtils.isAnyBlank(userId, roleIdsStr)) {
|
||||
if (StringUtils.isAnyBlank(userId, roleIdsStr)) {
|
||||
return "参数缺失:userId 或 roleIds";
|
||||
}
|
||||
org.jeecg.modules.system.entity.SysUser user = sysUserService.getById(userId);
|
||||
SysUser user = sysUserService.getById(userId);
|
||||
if (user == null) {
|
||||
return "用户不存在:" + userId;
|
||||
}
|
||||
@ -252,9 +250,9 @@ public class JeecgBizToolsProvider implements JeecgToolsProvider {
|
||||
for (String roleId : roleIds) {
|
||||
roleId = roleId.trim();
|
||||
if (roleId.isEmpty()) continue;
|
||||
org.jeecg.modules.system.entity.SysRole role = sysRoleService.getById(roleId);
|
||||
SysRole role = sysRoleService.getById(roleId);
|
||||
if (role == null) { invalid++; continue; }
|
||||
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<org.jeecg.modules.system.entity.SysUserRole> q = new com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<>();
|
||||
QueryWrapper<org.jeecg.modules.system.entity.SysUserRole> q = new QueryWrapper<>();
|
||||
q.eq("role_id", roleId).eq("user_id", userId);
|
||||
org.jeecg.modules.system.entity.SysUserRole one = sysUserRoleService.getOne(q);
|
||||
if (one == null) {
|
||||
|
||||
@ -16,6 +16,7 @@ import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -1080,6 +1081,19 @@ public class SystemApiController {
|
||||
return sysBaseApi.runAiragFlow(airagFlowDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流式运行AIRag流程
|
||||
* for [QQYUN-13634]在baseapi里面封装方法,方便其他模块调用
|
||||
*
|
||||
* @param airagFlowDTO
|
||||
* @return 流程执行结果,可能是String或者Map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/runAiragFlowStream")
|
||||
SseEmitter runAiragFlowStream(@RequestBody AiragFlowDTO airagFlowDTO) {
|
||||
return sysBaseApi.runAiragFlowStream(airagFlowDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门code或部门id获取部门名称(当前和上级部门)
|
||||
*
|
||||
|
||||
@ -580,7 +580,11 @@ public class SysAnnouncementController {
|
||||
// 判断是否传递了Token,并且Token有效,如果传了就不做查看限制,直接返回
|
||||
// 如果Token无效,就做查看限制:只能查看已发布的
|
||||
if (tokenOk || ANNOUNCEMENT_SEND_STATUS_1.equals(announcement.getSendStatus())) {
|
||||
modelAndView.addObject("data", announcement);
|
||||
LoginUser user = sysBaseApi.getUserByName(announcement.getSender());
|
||||
if(oConvertUtils.isNotEmpty(user)){
|
||||
announcement.setSender(user.getRealname());
|
||||
}
|
||||
modelAndView.addObject("data", announcement);
|
||||
modelAndView.setViewName("announcement/showContent");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@ -87,10 +87,10 @@ public class SysLogController extends JeecgController<SysLog, ISysLogService> {
|
||||
//TODO 一个强大的功能,前端传一个字段字符串,后台只返回这些字符串对应的字段
|
||||
//创建时间/创建人的赋值
|
||||
IPage<SysLog> pageList = sysLogService.page(page, queryWrapper);
|
||||
// log.info("查询当前页:"+pageList.getCurrent());
|
||||
// log.info("查询当前页数量:"+pageList.getSize());
|
||||
// log.info("查询结果数量:"+pageList.getRecords().size());
|
||||
// log.info("数据总数:"+pageList.getTotal());
|
||||
log.debug("查询当前页:"+pageList.getCurrent());
|
||||
log.debug("查询当前页数量:"+pageList.getSize());
|
||||
log.debug("查询结果数量:"+pageList.getRecords().size());
|
||||
log.debug("数据总数:"+pageList.getTotal());
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
|
||||
@ -264,6 +264,8 @@ public class SysTenantController {
|
||||
@SignatureCheck
|
||||
@RequestMapping(value = "/queryById", method = RequestMethod.GET)
|
||||
public Result<SysTenant> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
log.info("【敏感接口】查询租户信息,租户ID:{}", id);
|
||||
|
||||
Result<SysTenant> result = new Result<SysTenant>();
|
||||
if(oConvertUtils.isEmpty(id)){
|
||||
result.error500("参数为空!");
|
||||
@ -410,6 +412,7 @@ public class SysTenantController {
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
@SignatureCheck
|
||||
@PutMapping("/invitationUserJoin")
|
||||
@RequiresPermissions("system:tenant:invitation:user")
|
||||
public Result<String> invitationUserJoin(@RequestParam("ids") String ids,@RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "username", required = false) String username){
|
||||
@ -509,26 +512,27 @@ public class SysTenantController {
|
||||
return result;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 加入租户通过门牌号【低代码应用专用接口】
|
||||
// * @param sysTenant
|
||||
// */
|
||||
// @PostMapping("/joinTenantByHouseNumber")
|
||||
// public Result<Integer> joinTenantByHouseNumber(@RequestBody SysTenant sysTenant){
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// Integer tenantId = sysTenantService.joinTenantByHouseNumber(sysTenant, sysUser.getId());
|
||||
// Result<Integer> result = new Result<>();
|
||||
// if(tenantId != 0){
|
||||
// result.setMessage("申请加入组织成功");
|
||||
// result.setSuccess(true);
|
||||
// result.setResult(tenantId);
|
||||
// return result;
|
||||
// }else{
|
||||
// result.setMessage("该门牌号不存在");
|
||||
// result.setSuccess(false);
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* 申请加入租户通过门牌号【低代码应用专用接口】
|
||||
* @param sysTenant
|
||||
*/
|
||||
@SignatureCheck
|
||||
@PostMapping("/joinTenantByHouseNumber")
|
||||
public Result<Integer> joinTenantByHouseNumber(@RequestBody SysTenant sysTenant){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Integer tenantId = sysTenantService.joinTenantByHouseNumber(sysTenant, sysUser.getId());
|
||||
Result<Integer> result = new Result<>();
|
||||
if(tenantId != 0){
|
||||
result.setMessage("申请加入组织成功");
|
||||
result.setSuccess(true);
|
||||
result.setResult(tenantId);
|
||||
return result;
|
||||
}else{
|
||||
result.setMessage("该门牌号不存在");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取租户用户数据(vue3用户租户页面)【低代码应用专用接口】
|
||||
@ -575,10 +579,12 @@ public class SysTenantController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 【敲敲云管理员】 同意申请者加入租户
|
||||
*
|
||||
* 更新用户租户关系状态【低代码应用专用接口】
|
||||
*/
|
||||
@PutMapping("/updateUserTenantStatus")
|
||||
//@RequiresPermissions("system:tenant:updateUserTenantStatus")
|
||||
@RequiresPermissions("system:tenant:updateUserTenantStatus")
|
||||
public Result<String> updateUserTenantStatus(@RequestBody SysUserTenant userTenant) {
|
||||
String tenantId = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(tenantId)) {
|
||||
@ -588,6 +594,22 @@ public class SysTenantController {
|
||||
return Result.ok("更新用户租户状态成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意或者拒绝用户加入(敲敲云专用)
|
||||
* @param userTenant
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/agreeOrRejectUserJoin")
|
||||
public Result<String> agreeOrRejectUserJoin(@RequestBody SysUserTenant userTenant) {
|
||||
String tenantId = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(tenantId)) {
|
||||
return Result.error("未找到当前租户信息");
|
||||
}
|
||||
sysTenantPackService.izHaveManageUserAuth(tenantId);
|
||||
relationService.updateUserTenantStatus(userTenant.getUserId(), tenantId, userTenant.getStatus());
|
||||
return Result.ok("更新用户租户状态成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销租户【低代码应用专用接口】
|
||||
*
|
||||
@ -714,8 +736,9 @@ public class SysTenantController {
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/invitationUser")
|
||||
@SignatureCheck
|
||||
@RequiresPermissions("system:tenant:invitation:user")
|
||||
@PostMapping("/invitationUser")
|
||||
public Result<String> invitationUser(@RequestParam(name="phone") String phone,
|
||||
@RequestParam(name="departId",defaultValue = "") String departId){
|
||||
return sysTenantService.invitationUser(phone,departId);
|
||||
@ -914,43 +937,44 @@ public class SysTenantController {
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 同意或拒绝加入租户
|
||||
// */
|
||||
// @PutMapping("/agreeOrRefuseJoinTenant")
|
||||
// public Result<String> agreeOrRefuseJoinTenant(@RequestParam("tenantId") Integer tenantId,
|
||||
// @RequestParam("status") String status){
|
||||
// //是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// String userId = sysUser.getId();
|
||||
// SysTenant tenant = sysTenantService.getById(tenantId);
|
||||
// if(null == tenant){
|
||||
// return Result.error("不存在该组织");
|
||||
// }
|
||||
// SysUserTenant sysUserTenant = relationService.getUserTenantByTenantId(userId, tenantId);
|
||||
// if (null == sysUserTenant) {
|
||||
// return Result.error("该用户不存在该组织中,无权修改");
|
||||
// }
|
||||
// String content = "";
|
||||
// SysUser user = new SysUser();
|
||||
// user.setUsername(sysUserTenant.getCreateBy());
|
||||
// String realname = oConvertUtils.getString(sysUser.getRealname(),sysUser.getUsername());
|
||||
// //成功加入
|
||||
// if(CommonConstant.USER_TENANT_NORMAL.equals(status)){
|
||||
// //修改租户状态
|
||||
// relationService.agreeJoinTenant(userId,tenantId);
|
||||
// content = content + realname + "已同意您发送的加入 " + tenant.getName() + " 的邀请";
|
||||
// sysTenantService.sendMsgForAgreeAndRefuseJoin(user, content);
|
||||
// return Result.OK("您已同意该组织的邀请");
|
||||
// }else if(CommonConstant.USER_TENANT_REFUSE.equals(status)){
|
||||
// //直接删除关系表即可
|
||||
// relationService.refuseJoinTenant(userId,tenantId);
|
||||
// content = content + realname + "拒绝了您发送的加入 " + tenant.getName() + " 的邀请";
|
||||
// sysTenantService.sendMsgForAgreeAndRefuseJoin(user, content);
|
||||
// return Result.OK("您已成功拒绝该组织的邀请");
|
||||
// }
|
||||
// return Result.error("类型不匹配,禁止修改数据");
|
||||
// }
|
||||
/** 【被邀请人使用】
|
||||
* 同意或拒绝加入租户
|
||||
*/
|
||||
@SignatureCheck
|
||||
@PutMapping("/agreeOrRefuseJoinTenant")
|
||||
public Result<String> agreeOrRefuseJoinTenant(@RequestParam("tenantId") Integer tenantId,
|
||||
@RequestParam("status") String status){
|
||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
SysTenant tenant = sysTenantService.getById(tenantId);
|
||||
if(null == tenant){
|
||||
return Result.error("不存在该组织");
|
||||
}
|
||||
SysUserTenant sysUserTenant = relationService.getUserTenantByTenantId(userId, tenantId);
|
||||
if (null == sysUserTenant) {
|
||||
return Result.error("该用户不存在该组织中,无权修改");
|
||||
}
|
||||
String content = "";
|
||||
SysUser user = new SysUser();
|
||||
user.setUsername(sysUserTenant.getCreateBy());
|
||||
String realname = oConvertUtils.getString(sysUser.getRealname(),sysUser.getUsername());
|
||||
//成功加入
|
||||
if(CommonConstant.USER_TENANT_NORMAL.equals(status)){
|
||||
//修改租户状态
|
||||
relationService.agreeJoinTenant(userId,tenantId);
|
||||
content = content + realname + "已同意您发送的加入 " + tenant.getName() + " 的邀请";
|
||||
sysTenantService.sendMsgForAgreeAndRefuseJoin(user, content);
|
||||
return Result.OK("您已同意该组织的邀请");
|
||||
}else if(CommonConstant.USER_TENANT_REFUSE.equals(status)){
|
||||
//直接删除关系表即可
|
||||
relationService.refuseJoinTenant(userId,tenantId);
|
||||
content = content + realname + "拒绝了您发送的加入 " + tenant.getName() + " 的邀请";
|
||||
sysTenantService.sendMsgForAgreeAndRefuseJoin(user, content);
|
||||
return Result.OK("您已成功拒绝该组织的邀请");
|
||||
}
|
||||
return Result.error("类型不匹配,禁止修改数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 目前只给敲敲云租户下删除用户使用
|
||||
|
||||
@ -55,6 +55,7 @@ public class SysAnnouncement implements Serializable {
|
||||
* 发布人
|
||||
*/
|
||||
@Excel(name = "发布人", width = 15)
|
||||
@Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname")
|
||||
private java.lang.String sender;
|
||||
/**
|
||||
* 优先级(L低,M中,H高)
|
||||
|
||||
@ -29,4 +29,13 @@ public interface SysTenantPackMapper extends BaseMapper<SysTenantPack> {
|
||||
*/
|
||||
@Select("select id from sys_tenant_pack where tenant_id = #{tenantId} and (pack_code not in('superAdmin','accountAdmin','appAdmin') or pack_code is null) and iz_sysn = '1'")
|
||||
List<String> getPackIdByPackCodeAndTenantId(@Param("tenantId") Integer tenantId);
|
||||
|
||||
/**
|
||||
* 是否为拥有管理用户权限【accountAdmin,superAdmin】
|
||||
* @param tenantId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Select("select count(1) from sys_tenant_pack_user where user_id = #{userId} and tenant_id = #{tenantId} and pack_id in(select id from sys_tenant_pack where tenant_id = #{tenantId} and pack_type = 'custom' and pack_code in('accountAdmin','superAdmin'))")
|
||||
long izHaveManageUserAuth(@Param("tenantId") String tenantId,@Param("userId") String userId);
|
||||
}
|
||||
|
||||
@ -104,4 +104,11 @@ public interface ISysTenantPackService extends IService<SysTenantPack> {
|
||||
* @return
|
||||
*/
|
||||
List<SysTenantPack> getPackListByTenantId(String tenantId);
|
||||
|
||||
/**
|
||||
* 是否为拥有管理用户权限【accountAdmin,superAdmin】
|
||||
*
|
||||
* @param tenantId
|
||||
*/
|
||||
void izHaveManageUserAuth(String tenantId);
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ import org.springframework.util.PathMatcher;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.IOException;
|
||||
@ -639,6 +640,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
dingtalkService.sendActionCardMessage(announcement, mobileOpenUrl, true);
|
||||
// 企业微信通知
|
||||
wechatEnterpriseService.sendTextCardMessage(announcement, mobileOpenUrl, true);
|
||||
// Uniapp手机端消息推送
|
||||
PushMessageDTO pushMessageDTO = new PushMessageDTO();
|
||||
pushMessageDTO.setTitle(announcement.getTitile());
|
||||
pushMessageDTO.setContent(announcement.getMsgContent());
|
||||
pushMessageDTO.setPayload(new HashMap<>(message.getTemplateParam()));
|
||||
pushMessageDTO.setUsernames(Arrays.asList(toUser));
|
||||
this.uniPushMsgToUser(pushMessageDTO);
|
||||
} catch (Exception e) {
|
||||
log.error("同步发送第三方APP消息失败!", e);
|
||||
}
|
||||
@ -2112,6 +2120,14 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return o.getResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO) {
|
||||
if (oConvertUtils.isEmpty(airagFlowDTO.getFlowId())) {
|
||||
throw new JeecgBootException("流程ID不能为空");
|
||||
}
|
||||
return airagFlowService.runFlowStream(airagFlowDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* uniPush推送消息给APP用户
|
||||
* @param pushMessageDTO
|
||||
|
||||
@ -6,6 +6,7 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.constant.TenantConstant;
|
||||
import org.jeecg.common.exception.JeecgBootBizTipException;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
@ -478,4 +479,18 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否为拥有管理用户权限【accountAdmin,superAdmin】
|
||||
* @param tenantId
|
||||
*/
|
||||
@Override
|
||||
public void izHaveManageUserAuth(String tenantId) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
long count = sysTenantPackMapper.izHaveManageUserAuth(tenantId,sysUser.getId());
|
||||
if(count == 0){
|
||||
throw new JeecgBootBizTipException("你不是当前租户的组织账户管理员或超级管理员,无法进行此操作!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.UnavailableSecurityManagerException;
|
||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
|
||||
@ -121,7 +121,7 @@ spring:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
dynamic:
|
||||
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||
druid:
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
@ -186,6 +186,8 @@ mybatis-plus:
|
||||
minidao:
|
||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||
jeecg:
|
||||
# 自定义资源请求前缀(js、css等解决nginx转发问题)
|
||||
custom-resource-prefix-path:
|
||||
# AI集成
|
||||
ai-chat:
|
||||
enabled: true
|
||||
@ -195,6 +197,8 @@ jeecg:
|
||||
timeout: 60
|
||||
# AIRag向量库
|
||||
ai-rag:
|
||||
# AI流程敏感节点(stdio=命令行节点, sql=SQL节点)
|
||||
allow-sensitive-nodes: sql,stdio
|
||||
embed-store:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
|
||||
@ -182,6 +182,8 @@ mybatis-plus:
|
||||
minidao:
|
||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||
jeecg:
|
||||
# 自定义资源请求前缀(js、css等解决nginx转发问题)
|
||||
custom-resource-prefix-path:
|
||||
# AI集成
|
||||
ai-chat:
|
||||
enabled: true
|
||||
|
||||
@ -190,6 +190,8 @@ jeecg:
|
||||
timeout: 60
|
||||
# AIRag向量库
|
||||
ai-rag:
|
||||
# AI流程敏感节点(stdio=命令行节点, sql=SQL节点)
|
||||
allow-sensitive-nodes: sql,stdio
|
||||
embed-store:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
|
||||
@ -191,6 +191,8 @@ jeecg:
|
||||
timeout: 60
|
||||
# AIRag向量库
|
||||
ai-rag:
|
||||
# AI流程敏感节点(stdio=命令行节点, sql=SQL节点)
|
||||
allow-sensitive-nodes: sql,stdio
|
||||
embed-store:
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user