mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-30 00:32:26 +08:00
jeecgboot3.4.2版本发布
This commit is contained in:
@ -2,6 +2,7 @@ package org.jeecg.common.system.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
@ -549,4 +550,36 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
@GetMapping("/sys/api/getTemplateContent")
|
||||
String getTemplateContent(@RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 新增数据日志
|
||||
* @param dataLogDto
|
||||
*/
|
||||
@PostMapping("/sys/api/saveDataLog")
|
||||
void saveDataLog(DataLogDTO dataLogDto);
|
||||
|
||||
/**
|
||||
* 添加文件到知识库
|
||||
* @param sysFilesModel
|
||||
*/
|
||||
@PostMapping("/sys/api/addSysFiles")
|
||||
void addSysFiles(SysFilesModel sysFilesModel);
|
||||
|
||||
/**
|
||||
* 通过文件路径获取文件id
|
||||
* @param fileId
|
||||
*/
|
||||
@GetMapping("/sys/api/getFileUrl")
|
||||
String getFileUrl(@RequestParam(name="fileId") String fileId);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/updateAvatar")
|
||||
void updateAvatar(@RequestBody LoginUser loginUser);
|
||||
|
||||
@GetMapping("/sendAppChatSocket")
|
||||
void sendAppChatSocket(@RequestParam(name="userId") String userId);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package org.jeecg.common.system.api.fallback;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
@ -287,6 +288,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDataLog(DataLogDTO dataLogDto) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEmailMsg(String email,String title,String content) {
|
||||
|
||||
@ -326,4 +332,23 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addSysFiles(SysFilesModel sysFilesModel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileUrl(String fileId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(LoginUser loginUser) { }
|
||||
|
||||
@Override
|
||||
public void sendAppChatSocket(String userId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.common.system.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
@ -50,6 +51,21 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
String parseTemplateByCode(TemplateDTO templateDTO);
|
||||
|
||||
//update-begin---author:taoyan ---date:20220705 for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
|
||||
/**
|
||||
* 发送模板消息【新,支持自定义推送类型】
|
||||
* @param message
|
||||
*/
|
||||
void sendTemplateMessage(MessageDTO message);
|
||||
|
||||
/**
|
||||
* 根据模板编码获取模板内容【新,支持自定义推送类型】
|
||||
* @param templateCode
|
||||
* @return
|
||||
*/
|
||||
String getTemplateContent(String templateCode);
|
||||
//update-begin---author:taoyan ---date:20220705 for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
|
||||
|
||||
/**
|
||||
* 6根据用户id查询用户信息
|
||||
* @param id
|
||||
@ -339,16 +355,32 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 发送模板消息
|
||||
* @param message
|
||||
* 新增数据日志
|
||||
* @param dataLogDto
|
||||
*/
|
||||
void sendTemplateMessage(MessageDTO message);
|
||||
void saveDataLog(DataLogDTO dataLogDto);
|
||||
|
||||
/**
|
||||
* 根据模板编码获取模板内容
|
||||
* @param templateCode
|
||||
* @return
|
||||
* 添加文件到知识库
|
||||
* @param sysFilesModel
|
||||
*/
|
||||
String getTemplateContent(String templateCode);
|
||||
void addSysFiles(SysFilesModel sysFilesModel);
|
||||
|
||||
/**
|
||||
* 通过文件路径获取文件id
|
||||
* @param fileId
|
||||
*/
|
||||
String getFileUrl(String fileId);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
*/
|
||||
void updateAvatar(LoginUser loginUser);
|
||||
|
||||
/**
|
||||
* 向app端 websocket推送聊天刷新消息
|
||||
* @param userId
|
||||
*/
|
||||
void sendAppChatSocket(String userId);
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ import java.nio.charset.StandardCharsets;
|
||||
* <p>
|
||||
* 解决JAR发布需要手工配置代码生成器模板问题
|
||||
* http://doc.jeecg.com/2043922
|
||||
* @author zhang
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@ -58,7 +59,7 @@ public class CodeTemplateInitListener implements ApplicationListener<Application
|
||||
continue;
|
||||
}
|
||||
if (!FileUtil.exist(createFilePath)) {
|
||||
log.debug("create file codeTemplate = " + createFilePath);
|
||||
log.info("create file codeTemplate = " + createFilePath);
|
||||
FileUtil.writeString(IOUtils.toString(url, StandardCharsets.UTF_8), createFilePath, "UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.modules.api.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
@ -660,4 +661,40 @@ public class SystemApiController {
|
||||
return this.sysBaseApi.getTemplateContent(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据日志
|
||||
* @param dataLogDto
|
||||
*/
|
||||
@PostMapping("/saveDataLog")
|
||||
public void saveDataLog(@RequestBody DataLogDTO dataLogDto){
|
||||
this.sysBaseApi.saveDataLog(dataLogDto);
|
||||
}
|
||||
|
||||
@PostMapping("/addSysFiles")
|
||||
public void addSysFiles(@RequestBody SysFilesModel sysFilesModel){this.sysBaseApi.addSysFiles(sysFilesModel);}
|
||||
|
||||
@GetMapping("/getFileUrl")
|
||||
public String getFileUrl(@RequestParam(name="fileId") String fileId){
|
||||
return this.sysBaseApi.getFileUrl(fileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/updateAvatar")
|
||||
public void updateAvatar(@RequestBody LoginUser loginUser){
|
||||
this.sysBaseApi.updateAvatar(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向app端 websocket推送聊天刷新消息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sendAppChatSocket")
|
||||
public void sendAppChatSocket(@RequestParam(name="userId") String userId){
|
||||
this.sysBaseApi.sendAppChatSocket(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
package org.jeecg.modules.message.websocket;
|
||||
package org.jeecg.modules.message.controller;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.WebsocketConst;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -0,0 +1,128 @@
|
||||
package org.jeecg.modules.message.enums;
|
||||
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.system.annotation.EnumDict;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用于消息数据查询【vue3】
|
||||
* 新版系统通知查询条件
|
||||
* @Author taoYan
|
||||
* @Date 2022/8/19 20:41
|
||||
**/
|
||||
@EnumDict("rangeDate")
|
||||
public enum RangeDateEnum {
|
||||
|
||||
JT("jt", "今天"),
|
||||
ZT("zt", "昨天"),
|
||||
QT("qt", "前天"),
|
||||
BZ("bz","本周"),
|
||||
SZ("sz", "上周"),
|
||||
BY("by", "本月"),
|
||||
SY("sy", "上月"),
|
||||
ZDY("zdy", "自定义日期");
|
||||
|
||||
String key;
|
||||
|
||||
String title;
|
||||
|
||||
RangeDateEnum(String key, String title){
|
||||
this.key = key;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @return
|
||||
*/
|
||||
public static List<DictModel> getDictList(){
|
||||
List<DictModel> list = new ArrayList<>();
|
||||
DictModel dictModel = null;
|
||||
for(RangeDateEnum e: RangeDateEnum.values()){
|
||||
dictModel = new DictModel();
|
||||
dictModel.setValue(e.key);
|
||||
dictModel.setText(e.title);
|
||||
list.add(dictModel);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key 获取范围时间值
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public static Date[] getRangeArray(String key){
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
Calendar calendar2 = Calendar.getInstance();
|
||||
Date[] array = new Date[2];
|
||||
boolean flag = false;
|
||||
if(JT.key.equals(key)){
|
||||
//今天
|
||||
} else if(ZT.key.equals(key)){
|
||||
//昨天
|
||||
calendar1.add(Calendar.DAY_OF_YEAR, -1);
|
||||
calendar2.add(Calendar.DAY_OF_YEAR, -1);
|
||||
} else if(QT.key.equals(key)){
|
||||
//前天
|
||||
calendar1.add(Calendar.DAY_OF_YEAR, -2);
|
||||
calendar2.add(Calendar.DAY_OF_YEAR, -2);
|
||||
} else if(BZ.key.equals(key)){
|
||||
//本周
|
||||
calendar1.set(Calendar.DAY_OF_WEEK, 2);
|
||||
|
||||
calendar2.add(Calendar.WEEK_OF_MONTH,1);
|
||||
calendar2.add(Calendar.DAY_OF_WEEK,-1);
|
||||
} else if(SZ.key.equals(key)){
|
||||
//本周一减一周
|
||||
calendar1.set(Calendar.DAY_OF_WEEK, 2);
|
||||
calendar1.add(Calendar.WEEK_OF_MONTH, -1);
|
||||
|
||||
// 本周一减一天
|
||||
calendar2.set(Calendar.DAY_OF_WEEK, 2);
|
||||
calendar2.add(Calendar.DAY_OF_WEEK,-1);
|
||||
} else if(BY.key.equals(key)){
|
||||
//本月
|
||||
calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
||||
|
||||
calendar2.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar2.add(Calendar.MONTH, 1);
|
||||
calendar2.add(Calendar.DAY_OF_MONTH, -1);
|
||||
} else if(SY.key.equals(key)){
|
||||
//本月第一天减一月
|
||||
calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar1.add(Calendar.MONTH, -1);
|
||||
|
||||
//本月第一天减一天
|
||||
calendar2.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar2.add(Calendar.DAY_OF_MONTH, -1);
|
||||
}else{
|
||||
flag = true;
|
||||
}
|
||||
if(flag){
|
||||
return null;
|
||||
}
|
||||
// 开始时间00:00:00 结束时间23:59:59
|
||||
calendar1.set(Calendar.HOUR, 0);
|
||||
calendar1.set(Calendar.MINUTE, 0);
|
||||
calendar1.set(Calendar.SECOND, 0);
|
||||
calendar1.set(Calendar.MILLISECOND, 0);
|
||||
calendar2.set(Calendar.HOUR, 23);
|
||||
calendar2.set(Calendar.MINUTE, 59);
|
||||
calendar2.set(Calendar.SECOND, 59);
|
||||
calendar2.set(Calendar.MILLISECOND, 999);
|
||||
array[0] = calendar1.getTime();
|
||||
array[1] = calendar2.getTime();
|
||||
return array;
|
||||
}
|
||||
|
||||
public String getKey(){
|
||||
return this.key;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package org.jeecg.modules.message.enums;
|
||||
|
||||
import org.jeecg.common.system.annotation.EnumDict;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息跳转【vue3】
|
||||
* @Author taoYan
|
||||
* @Date 2022/8/19 20:41
|
||||
**/
|
||||
@EnumDict("messageHref")
|
||||
public enum Vue3MessageHrefEnum {
|
||||
|
||||
/**
|
||||
* 流程催办
|
||||
*/
|
||||
BPM("bpm", "/task/myHandleTaskInfo"),
|
||||
|
||||
/**
|
||||
* 节点通知
|
||||
*/
|
||||
BPM_TASK("bpm_task", "/task/myHandleTaskInfo"),
|
||||
|
||||
/**
|
||||
* 邮件消息
|
||||
*/
|
||||
EMAIL("email", "/eoa/email");
|
||||
|
||||
String busType;
|
||||
|
||||
String path;
|
||||
|
||||
Vue3MessageHrefEnum(String busType, String path) {
|
||||
this.busType = busType;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getBusType() {
|
||||
return busType;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @return
|
||||
*/
|
||||
public static List<DictModel> getDictList(){
|
||||
List<DictModel> list = new ArrayList<>();
|
||||
DictModel dictModel = null;
|
||||
for(Vue3MessageHrefEnum e: Vue3MessageHrefEnum.values()){
|
||||
dictModel = new DictModel();
|
||||
dictModel.setValue(e.getBusType());
|
||||
dictModel.setText(e.getPath());
|
||||
list.add(dictModel);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,7 +10,7 @@ public interface ISendMsgHandle {
|
||||
|
||||
/**
|
||||
* 发送信息
|
||||
* @param esReceiver 发送人
|
||||
* @param esReceiver 接受人
|
||||
* @param esTitle 标题
|
||||
* @param esContent 内容
|
||||
*/
|
||||
|
||||
@ -76,12 +76,15 @@ public class EmailSendMsgHandle implements ISendMsgHandle {
|
||||
List<SysUser> list = sysUserMapper.selectList(query);
|
||||
String content = messageDTO.getContent();
|
||||
String title = messageDTO.getTitle();
|
||||
String realNameExp = "{REALNAME}";
|
||||
for(SysUser user: list){
|
||||
String email = user.getEmail();
|
||||
if(email==null || "".equals(email)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(content.indexOf(realNameExp)>0){
|
||||
content = content.replace(realNameExp, user.getRealname());
|
||||
}
|
||||
if(content.indexOf(CommonConstant.LOGIN_TOKEN)>0){
|
||||
String token = getToken(user);
|
||||
try {
|
||||
|
||||
@ -8,6 +8,7 @@ import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.message.enums.Vue3MessageHrefEnum;
|
||||
import org.jeecg.modules.message.handle.ISendMsgHandle;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
@ -89,6 +90,7 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
|
||||
Object taskId = data.get(CommonConstant.NOTICE_MSG_BUS_ID);
|
||||
if(taskId!=null){
|
||||
announcement.setBusId(taskId.toString());
|
||||
announcement.setBusType(Vue3MessageHrefEnum.BPM_TASK.getBusType());
|
||||
}
|
||||
}
|
||||
announcement.setTitile(title);
|
||||
|
||||
@ -17,7 +17,7 @@ public interface IOssFileService extends IService<OssFile> {
|
||||
* @param multipartFile
|
||||
* @throws IOException
|
||||
*/
|
||||
void upload(MultipartFile multipartFile) throws IOException;
|
||||
void upload(MultipartFile multipartFile) throws Exception;
|
||||
|
||||
/**
|
||||
* oss文件删除
|
||||
|
||||
@ -19,7 +19,7 @@ import java.io.IOException;
|
||||
public class OssFileServiceImpl extends ServiceImpl<OssFileMapper, OssFile> implements IOssFileService {
|
||||
|
||||
@Override
|
||||
public void upload(MultipartFile multipartFile) throws IOException {
|
||||
public void upload(MultipartFile multipartFile) throws Exception {
|
||||
String fileName = multipartFile.getOriginalFilename();
|
||||
fileName = CommonUtils.getFileName(fileName);
|
||||
OssFile ossFile = new OssFile();
|
||||
|
||||
@ -280,4 +280,5 @@ public class QuartzJobController {
|
||||
}
|
||||
return Result.ok("执行成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -16,9 +17,11 @@ import org.jeecg.common.constant.WebsocketConst;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.message.enums.RangeDateEnum;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncementSend;
|
||||
@ -45,10 +48,8 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.jeecg.common.constant.CommonConstant.ANNOUNCEMENT_SEND_STATUS_1;
|
||||
|
||||
@ -70,9 +71,9 @@ public class SysAnnouncementController {
|
||||
@Resource
|
||||
private WebSocket webSocket;
|
||||
@Autowired
|
||||
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
|
||||
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
|
||||
@Autowired
|
||||
ThirdAppDingtalkServiceImpl dingtalkService;
|
||||
ThirdAppDingtalkServiceImpl dingtalkService;
|
||||
@Autowired
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
@ -506,4 +507,47 @@ public class SysAnnouncementController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【vue3用】 消息列表查询
|
||||
* @param fromUser
|
||||
* @param beginDate
|
||||
* @param endDate
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/vue3List", method = RequestMethod.GET)
|
||||
public Result<List<SysAnnouncement>> vue3List(@RequestParam(name="fromUser", required = false) String fromUser,
|
||||
@RequestParam(name="starFlag", required = false) String starFlag,
|
||||
@RequestParam(name="rangeDateKey", required = false) String rangeDateKey,
|
||||
@RequestParam(name="beginDate", required = false) String beginDate, @RequestParam(name="endDate", required = false) String endDate,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
// 后台获取开始时间/结束时间
|
||||
Date bd=null, ed=null;
|
||||
if(RangeDateEnum.ZDY.getKey().equals(rangeDateKey)){
|
||||
if(oConvertUtils.isNotEmpty(beginDate)){
|
||||
bd = DateUtils.parseDatetime(beginDate);
|
||||
}
|
||||
if(oConvertUtils.isNotEmpty(endDate)){
|
||||
ed = DateUtils.parseDatetime(endDate);
|
||||
}
|
||||
}else{
|
||||
Date[] arr = RangeDateEnum.getRangeArray(rangeDateKey);
|
||||
if(arr!=null){
|
||||
bd = arr[0];
|
||||
ed = arr[1];
|
||||
}
|
||||
}
|
||||
List<SysAnnouncement> ls = this.sysAnnouncementService.querySysMessageList(pageSize, pageNo, fromUser, starFlag, bd, ed);
|
||||
//查询出来的消息全部设置为已读
|
||||
if(ls!=null && ls.size()>0){
|
||||
String readed = "1";
|
||||
List<String> annoceIdList = ls.stream().filter(item->!readed.equals(item.getReadFlag())).map(item->item.getId()).collect(Collectors.toList());
|
||||
if(annoceIdList!=null && annoceIdList.size()>0){
|
||||
sysAnnouncementService.updateReaded(annoceIdList);
|
||||
}
|
||||
}
|
||||
return Result.ok(ls);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ public class SysAnnouncementSendController {
|
||||
boolean ok = sysAnnouncementSendService.updateById(sysAnnouncementSend);
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("修改成功!");
|
||||
result.success("操作成功!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,4 +253,16 @@ public class SysAnnouncementSendController {
|
||||
result.setMessage("全部已读");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据消息发送记录ID获取消息内容
|
||||
* @param sendId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getOne")
|
||||
public Result<AnnouncementSendModel> getOne(@RequestParam(name="sendId",required=true) String sendId) {
|
||||
AnnouncementSendModel model = sysAnnouncementSendService.getOne(sendId);
|
||||
return Result.ok(model);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysDataLog;
|
||||
@ -37,6 +38,7 @@ public class SysDataLogController {
|
||||
public Result<IPage<SysDataLog>> queryPageList(SysDataLog dataLog,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
|
||||
Result<IPage<SysDataLog>> result = new Result<IPage<SysDataLog>>();
|
||||
dataLog.setType(CommonConstant.DATA_LOG_TYPE_JSON);
|
||||
QueryWrapper<SysDataLog> queryWrapper = QueryGenerator.initQueryWrapper(dataLog, req.getParameterMap());
|
||||
Page<SysDataLog> page = new Page<SysDataLog>(pageNo, pageSize);
|
||||
IPage<SysDataLog> pageList = service.page(page, queryWrapper);
|
||||
@ -85,6 +87,15 @@ public class SysDataLogController {
|
||||
QueryWrapper<SysDataLog> queryWrapper = new QueryWrapper<SysDataLog>();
|
||||
queryWrapper.eq("data_table", dataTable);
|
||||
queryWrapper.eq("data_id", dataId);
|
||||
//update-begin-author:taoyan date:2022-7-26 for: 新增查询条件-type
|
||||
String type = req.getParameter("type");
|
||||
if (oConvertUtils.isNotEmpty(type)) {
|
||||
queryWrapper.eq("type", type);
|
||||
}
|
||||
// 按时间倒序排
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
//update-end-author:taoyan date:2022-7-26 for:新增查询条件-type
|
||||
|
||||
List<SysDataLog> list = service.list(queryWrapper);
|
||||
if(list==null||list.size()<=0) {
|
||||
result.error500("未找到版本信息");
|
||||
|
||||
@ -304,6 +304,8 @@ public class SysDictController {
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 根据表名——显示字段-存储字段 pid 加载树形数据
|
||||
* @param hasChildField 是否叶子节点字段
|
||||
* @param converIsLeafVal 是否需要系统转换 是否叶子节点的值 (0标识不转换、1标准系统自动转换)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
||||
@ -312,6 +314,7 @@ public class SysDictController {
|
||||
@RequestParam(name="text") String text,
|
||||
@RequestParam(name="code") String code,
|
||||
@RequestParam(name="hasChildField") String hasChildField,
|
||||
@RequestParam(name="converIsLeafVal",defaultValue ="1") int converIsLeafVal,
|
||||
@RequestParam(name="condition") String condition,
|
||||
@RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
@ -322,7 +325,7 @@ public class SysDictController {
|
||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||
String dictCode = tbname+","+text+","+code+","+condition;
|
||||
SqlInjectionUtil.filterContent(dictCode);
|
||||
List<TreeSelectModel> ls = sysDictService.queryTreeList(query,tbname, text, code, pidField, pid,hasChildField);
|
||||
List<TreeSelectModel> ls = sysDictService.queryTreeList(query,tbname, text, code, pidField, pid,hasChildField,converIsLeafVal);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
|
||||
@ -78,16 +78,32 @@ public class SysPermissionController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionTree>> list() {
|
||||
public Result<List<SysPermissionTree>> list(SysPermission sysPermission, HttpServletRequest req) {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<List<SysPermissionTree>> result = new Result<>();
|
||||
try {
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
|
||||
//支持通过菜单名字,模糊查询
|
||||
if(oConvertUtils.isNotEmpty(sysPermission.getName())){
|
||||
query.like(SysPermission::getName, sysPermission.getName());
|
||||
}
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
List<SysPermissionTree> treeList = new ArrayList<>();
|
||||
getTreeList(treeList, list, null);
|
||||
|
||||
//如果有菜单名查询条件,则平铺数据 不做上下级
|
||||
if(oConvertUtils.isNotEmpty(sysPermission.getName())){
|
||||
if(list!=null && list.size()>0){
|
||||
treeList = list.stream().map(e -> {
|
||||
e.setLeaf(true);
|
||||
return new SysPermissionTree(e);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}else{
|
||||
getTreeList(treeList, list, null);
|
||||
}
|
||||
result.setResult(treeList);
|
||||
result.setSuccess(true);
|
||||
log.info("======获取全部菜单数据=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
@ -33,7 +33,7 @@ public class SysUploadController {
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping(value = "/uploadMinio")
|
||||
public Result<?> uploadMinio(HttpServletRequest request) {
|
||||
public Result<?> uploadMinio(HttpServletRequest request) throws Exception {
|
||||
Result<?> result = new Result<>();
|
||||
String bizPath = request.getParameter("biz");
|
||||
|
||||
|
||||
@ -146,5 +146,20 @@ public class SysAnnouncement implements Serializable {
|
||||
/**
|
||||
* 钉钉task_id,用于撤回消息
|
||||
*/
|
||||
private java.lang.String dtTaskId;
|
||||
private String dtTaskId;
|
||||
|
||||
/**
|
||||
* 阅读状态 1表示已经阅读
|
||||
*/
|
||||
private transient String readFlag;
|
||||
|
||||
/**
|
||||
* 标星状态 1表示标星
|
||||
*/
|
||||
private transient String starFlag;
|
||||
|
||||
/**
|
||||
* 发送记录ID
|
||||
*/
|
||||
private transient String sendId;
|
||||
}
|
||||
|
||||
@ -45,4 +45,9 @@ public class SysAnnouncementSend implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否标星 当值为1是标星消息
|
||||
*/
|
||||
private String starFlag;
|
||||
}
|
||||
|
||||
@ -72,4 +72,12 @@ public class SysDataLog implements Serializable {
|
||||
* 版本号
|
||||
*/
|
||||
private String dataVersion;
|
||||
|
||||
|
||||
//update-begin-author:taoyan date:2022-7-26 for: 用于表单评论记录日志 区分数据
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
//update-end-author:taoyan date:2022-7-26 for: 用于表单评论记录日志 区分数据
|
||||
}
|
||||
|
||||
@ -53,11 +53,11 @@ public class SysThirdAccount {
|
||||
@Excel(name = "真实姓名", width = 15)
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
private java.lang.String realname;
|
||||
/**真实姓名*/
|
||||
@Excel(name = "真实姓名", width = 15)
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
/**第三方用户uuid*/
|
||||
@Excel(name = "第三方用户uuid", width = 15)
|
||||
@ApiModelProperty(value = "第三方用户uuid")
|
||||
private java.lang.String thirdUserUuid;
|
||||
/**真实姓名*/
|
||||
/**第三方用户账号*/
|
||||
@Excel(name = "第三方用户账号", width = 15)
|
||||
@ApiModelProperty(value = "第三方用户账号")
|
||||
private java.lang.String thirdUserId;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -25,4 +26,14 @@ public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
|
||||
*/
|
||||
List<SysAnnouncement> querySysCementListByUserId(Page<SysAnnouncement> page, @Param("userId")String userId,@Param("msgCategory")String msgCategory);
|
||||
|
||||
/**
|
||||
* 分页查询消息列表
|
||||
* @param page
|
||||
* @param userId
|
||||
* @param fromUser
|
||||
* @param beginDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
List<SysAnnouncement> queryMessageList(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("fromUser")String fromUser, @Param("starFlag")String starFlag, @Param("beginDate")Date beginDate, @Param("endDate")Date endDate);
|
||||
}
|
||||
|
||||
@ -32,4 +32,16 @@ public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSen
|
||||
*/
|
||||
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
||||
|
||||
/**
|
||||
* 获取一条记录
|
||||
* @param sendId
|
||||
* @return
|
||||
*/
|
||||
AnnouncementSendModel getOne(@Param("sendId") String sendId);
|
||||
|
||||
|
||||
/**
|
||||
* 修改为已读消息
|
||||
*/
|
||||
void updateReaded(@Param("userId") String userId, @Param("annoceIdList") List<String> annoceIdList);
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<TreeSelectModel> queryTreeList(@Param("query") Map<String, String> query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField);
|
||||
List<TreeSelectModel> queryTreeList(@Param("query") Map<String, String> query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField,@Param("converIsLeafVal") int converIsLeafVal);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
||||
@ -25,14 +25,6 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
* @return
|
||||
*/
|
||||
public List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
|
||||
|
||||
/**
|
||||
* 切换vue3菜单
|
||||
*/
|
||||
@Update("alter table sys_permission rename to sys_permission_v2")
|
||||
public void backupVue2Menu();
|
||||
@Update("alter table sys_permission_v3 rename to sys_permission")
|
||||
public void changeVue3Menu();
|
||||
|
||||
/**
|
||||
* 根据用户查询用户权限
|
||||
@ -49,6 +41,14 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
*/
|
||||
@Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
|
||||
public int setMenuLeaf(@Param("id") String id,@Param("leaf") int leaf);
|
||||
|
||||
/**
|
||||
* 切换vue3菜单
|
||||
*/
|
||||
@Update("alter table sys_permission rename to sys_permission_v2")
|
||||
public void backupVue2Menu();
|
||||
@Update("alter table sys_permission_v3 rename to sys_permission")
|
||||
public void changeVue3Menu();
|
||||
|
||||
/**
|
||||
* 获取模糊匹配规则的数据权限URL
|
||||
@ -67,5 +67,10 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
public int queryCountByUsername(@Param("username") String username, @Param("permission") SysPermission sysPermission);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门权限数据
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
List<SysPermission> queryDepartPermissionList(@Param("departId") String departId);
|
||||
}
|
||||
|
||||
@ -38,4 +38,13 @@ public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> queryDepartUserPageList(Page<SysUser> page, @Param("orgCode") String orgCode, @Param("username") String username, @Param("realname") String realname);
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param page
|
||||
* @param orgCode
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserInformation(Page<SysUser> page, @Param("orgCode") String orgCode, @Param("keyword") String keyword,@Param("userId") String userId);
|
||||
}
|
||||
|
||||
@ -25,6 +25,10 @@
|
||||
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
||||
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
||||
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
||||
|
||||
<result column="read_flag" property="readFlag" jdbcType="VARCHAR"/>
|
||||
<result column="star_flag" property="starFlag" jdbcType="VARCHAR"/>
|
||||
<result column="send_id" property="sendId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@ -37,4 +41,31 @@
|
||||
order by create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询消息记录 -->
|
||||
<select id="queryMessageList" resultMap="SysAnnouncement">
|
||||
select a.*,
|
||||
b.read_flag,
|
||||
b.star_flag,
|
||||
b.id as send_id
|
||||
from sys_announcement a
|
||||
join sys_announcement_send b on b.annt_id = a.id
|
||||
where a.send_status = '1' and a.del_flag = '0' and b.user_id = #{userId}
|
||||
<if test="fromUser!=null and fromUser!=''">
|
||||
and a.sender = #{fromUser}
|
||||
</if>
|
||||
|
||||
<if test="beginDate!=null">
|
||||
and a.create_time >= #{beginDate}
|
||||
</if>
|
||||
<if test="endDate!=null">
|
||||
and a.create_time <= #{endDate}
|
||||
</if>
|
||||
|
||||
<if test="starFlag!=null and starFlag!=''">
|
||||
and b.star_flag = #{starFlag}
|
||||
</if>
|
||||
order by b.read_flag ASC,a.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -13,6 +13,7 @@
|
||||
<result column="msg_category" property="msgCategory" jdbcType="VARCHAR"/>
|
||||
<result column="send_time" property="sendTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
||||
<result column="bus_type" property="busType" jdbcType="VARCHAR"/>
|
||||
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
||||
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
@ -35,6 +36,7 @@
|
||||
sa.msg_category,
|
||||
sa.send_time as send_time,
|
||||
sa.bus_id as bus_id,
|
||||
sa.bus_type as bus_type,
|
||||
sa.open_type as open_type,
|
||||
sa.open_page as open_page,
|
||||
sa.msg_abstract
|
||||
@ -64,4 +66,42 @@
|
||||
order by sas.read_flag,sa.send_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 查询一条消息 -->
|
||||
<select id="getOne" parameterType="String" resultMap="AnnouncementSendModel">
|
||||
select
|
||||
sas.id,
|
||||
sas.annt_id,
|
||||
sas.user_id,
|
||||
sas.read_flag,
|
||||
sa.titile as titile,
|
||||
sa.msg_content as msg_content,
|
||||
sa.sender as sender,
|
||||
sa.priority as priority,
|
||||
sa.msg_category,
|
||||
sa.send_time as send_time,
|
||||
sa.bus_id as bus_id,
|
||||
sa.open_type as open_type,
|
||||
sa.open_page as open_page,
|
||||
sa.msg_abstract
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.send_status = '1'
|
||||
and sa.del_flag = '0'
|
||||
and sas.id = #{sendId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 修改为已读消息 -->
|
||||
<update id="updateReaded">
|
||||
update sys_announcement_send set read_flag = '1'
|
||||
where user_id = #{userId}
|
||||
and annt_id in
|
||||
<foreach collection="annoceIdList" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -128,7 +128,14 @@
|
||||
${code} as "key",
|
||||
<!-- udapte-begin-author:taoyan date:20211115 for: 自定义树控件只显示父节点,子节点无法展开 (此处还原不可再改) /issues/I4HZAL -->
|
||||
<if test="hasChildField != null and hasChildField != ''">
|
||||
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
||||
<choose>
|
||||
<when test="converIsLeafVal!=null and converIsLeafVal==1">
|
||||
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
||||
</when>
|
||||
<otherwise>
|
||||
${hasChildField} as isLeaf,
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<!-- udapte-end-author:taoyan date:20211115 for: 自定义树控件只显示父节点,子节点无法展开 (此处还原不可再改) /issues/I4HZAL -->
|
||||
${pidField} as parentId
|
||||
|
||||
@ -103,6 +103,15 @@
|
||||
</if>
|
||||
) temp
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询部门权限数据 -->
|
||||
<select id="queryDepartPermissionList" parameterType="String" resultType="org.jeecg.modules.system.entity.SysPermission">
|
||||
SELECT * FROM sys_permission
|
||||
where del_flag = 0
|
||||
and id in (
|
||||
select permission_id from sys_depart_permission where depart_id = #{departId}
|
||||
)
|
||||
order by sort_no ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -27,7 +27,7 @@
|
||||
join sys_user_depart b on b.user_id = a.id
|
||||
join sys_depart c on b.dep_id = c.id
|
||||
<bind name="bindOrgCode" value="orgCode+'%'"/>
|
||||
where a.del_flag = 0 and a.status = 1 and c.org_code like #{bindOrgCode}
|
||||
where a.del_flag = 0 and a.status = 1 and c.org_code like #{bindOrgCode} and a.username!='_reserve_user_external'
|
||||
<if test="username!=null and username!=''">
|
||||
<bind name="bindUsername" value="'%'+username+'%'"/>
|
||||
and a.username like #{bindUsername}
|
||||
@ -37,4 +37,21 @@
|
||||
and a.realname like #{bindRealname}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--获取用户信息(聊天专用)-->
|
||||
<select id="getUserInformation" resultType="org.jeecg.modules.system.entity.SysUser">
|
||||
select DISTINCT a.* from sys_user a
|
||||
left join sys_user_depart b on b.user_id = a.id
|
||||
left join sys_depart c on b.dep_id = c.id
|
||||
<bind name="bindOrgCode" value="orgCode+'%'"/>
|
||||
where
|
||||
a.del_flag = 0 and a.status = 1
|
||||
and c.org_code like #{bindOrgCode}
|
||||
and a.username!='_reserve_user_external'
|
||||
and a.id !=#{userId}
|
||||
<if test="keyword!=null and keyword!=''">
|
||||
<bind name="bindKeyword" value="'%'+keyword+'%'"/>
|
||||
and (a.username like #{bindKeyword} or a.realname like #{bindKeyword})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -14,7 +14,9 @@ public class TreeSelectModel implements Serializable {
|
||||
private String key;
|
||||
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 是否叶子节点
|
||||
*/
|
||||
private boolean isLeaf;
|
||||
|
||||
private String icon;
|
||||
|
||||
@ -31,4 +31,11 @@ public interface ISysAnnouncementSendService extends IService<SysAnnouncementSen
|
||||
*/
|
||||
public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
|
||||
|
||||
/**
|
||||
* 根据消息发送记录ID获取消息内容
|
||||
* @return
|
||||
*/
|
||||
AnnouncementSendModel getOne(String sendId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package org.jeecg.modules.system.service;
|
||||
|
||||
import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 系统通告表
|
||||
@ -40,7 +42,24 @@ public interface ISysAnnouncementService extends IService<SysAnnouncement> {
|
||||
* @param msgCategory 消息类型
|
||||
* @return Page<SysAnnouncement>
|
||||
*/
|
||||
public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page,String userId,String msgCategory);
|
||||
public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page, String userId, String msgCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 补全当前登录用户的消息阅读记录
|
||||
*/
|
||||
void completeAnnouncementSendInfo();
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询当前登录用户的消息, 并且标记哪些是未读消息
|
||||
*/
|
||||
List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, Date beginDate, Date endDate);
|
||||
|
||||
/**
|
||||
* 修改为已读消息
|
||||
*/
|
||||
void updateReaded(List<String> annoceIdList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField);
|
||||
List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField,int converIsLeafVal);
|
||||
|
||||
/**
|
||||
* 真实删除
|
||||
|
||||
@ -18,9 +18,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @since 2018-12-21
|
||||
*/
|
||||
public interface ISysPermissionService extends IService<SysPermission> {
|
||||
/**
|
||||
* 切换vue3菜单
|
||||
*/
|
||||
/**
|
||||
* 切换vue3菜单
|
||||
*/
|
||||
public void switchVue3Menu();
|
||||
|
||||
/**
|
||||
@ -93,4 +93,11 @@ public interface ISysPermissionService extends IService<SysPermission> {
|
||||
* @return
|
||||
*/
|
||||
public boolean hasPermission(String username, String url);
|
||||
|
||||
/**
|
||||
* 查询部门权限数据
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
List<SysPermission> queryDepartPermissionList(String departId);
|
||||
}
|
||||
|
||||
@ -55,4 +55,13 @@ public interface ISysUserDepartService extends IService<SysUserDepart> {
|
||||
*/
|
||||
IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo,String id);
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param departId
|
||||
* @param keyword
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserInformation(String departId, String keyword, Integer pageSize, Integer pageNo);
|
||||
}
|
||||
|
||||
@ -36,4 +36,9 @@ public class SysAnnouncementSendServiceImpl extends ServiceImpl<SysAnnouncementS
|
||||
return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnnouncementSendModel getOne(String sendId) {
|
||||
return sysAnnouncementSendMapper.getOne(sendId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncementSend;
|
||||
@ -17,9 +16,11 @@ import org.jeecg.modules.system.service.ISysAnnouncementService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 系统通告表
|
||||
@ -28,6 +29,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMapper, SysAnnouncement> implements ISysAnnouncementService {
|
||||
|
||||
@Resource
|
||||
@ -126,4 +128,61 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completeAnnouncementSendInfo() {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
// 1.将系统消息补充到用户通告阅读标记表中
|
||||
LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>();
|
||||
//全部人员
|
||||
querySaWrapper.eq(SysAnnouncement::getMsgType, CommonConstant.MSG_TYPE_ALL);
|
||||
//未删除
|
||||
querySaWrapper.eq(SysAnnouncement::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
//已发布
|
||||
querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND);
|
||||
//新注册用户不看结束通知
|
||||
querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime());
|
||||
//update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理--------------------
|
||||
querySaWrapper.notInSql(SysAnnouncement::getId,"select annt_id from sys_announcement_send where user_id='"+userId+"'");
|
||||
//update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理--------------------
|
||||
List<SysAnnouncement> announcements = this.list(querySaWrapper);
|
||||
if(announcements.size()>0) {
|
||||
for(int i=0;i<announcements.size();i++) {
|
||||
//update-begin--Author:wangshuai Date:20200803 for: 通知公告消息重复LOWCOD-759--------------------
|
||||
//因为websocket没有判断是否存在这个用户,要是判断会出现问题,故在此判断逻辑
|
||||
LambdaQueryWrapper<SysAnnouncementSend> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysAnnouncementSend::getAnntId,announcements.get(i).getId());
|
||||
query.eq(SysAnnouncementSend::getUserId,userId);
|
||||
SysAnnouncementSend one = sysAnnouncementSendMapper.selectOne(query);
|
||||
if(null==one){
|
||||
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
|
||||
announcementSend.setAnntId(announcements.get(i).getId());
|
||||
announcementSend.setUserId(userId);
|
||||
announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
|
||||
sysAnnouncementSendMapper.insert(announcementSend);
|
||||
log.info("announcementSend.toString()",announcementSend.toString());
|
||||
}
|
||||
//update-end--Author:wangshuai Date:20200803 for: 通知公告消息重复LOWCOD-759------------
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, Date beginDate, Date endDate) {
|
||||
//1. 补全send表的数据
|
||||
completeAnnouncementSendInfo();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Page<SysAnnouncement> page = new Page<SysAnnouncement>(pageNo,pageSize);
|
||||
// 2. 查询消息数据
|
||||
List<SysAnnouncement> list = baseMapper.queryMessageList(page, sysUser.getId(), fromUser, starFlag, beginDate, endDate);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReaded(List<String> annoceIdList) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
sysAnnouncementSendMapper.updateReaded(sysUser.getId(), annoceIdList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.google.common.base.Joiner;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.aspect.UrlMatchEnum;
|
||||
@ -22,6 +23,7 @@ import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.jeecg.common.util.HTMLUtils;
|
||||
import org.jeecg.common.util.SysAnnmentTypeEnum;
|
||||
import org.jeecg.common.util.YouBianCodeUtil;
|
||||
import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
|
||||
@ -101,6 +103,10 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
ISysCategoryService sysCategoryService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysDataLogService sysDataLogService;
|
||||
@Autowired
|
||||
private ISysFilesService sysFilesService;
|
||||
|
||||
@Override
|
||||
//@SensitiveDecode
|
||||
@ -1191,10 +1197,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
//update-begin-author:taoyan date:2022-7-9 for: 将模板解析代码移至消息发送, 而不是调用的地方
|
||||
String templateCode = message.getTemplateCode();
|
||||
if(oConvertUtils.isNotEmpty(templateCode)){
|
||||
String content = getTemplateContent(templateCode);
|
||||
SysMessageTemplate templateEntity = getTemplateEntity(templateCode);
|
||||
boolean isMarkdown = CommonConstant.MSG_TEMPLATE_TYPE_MD.equals(templateEntity.getTemplateType());
|
||||
String content = templateEntity.getTemplateContent();
|
||||
if(oConvertUtils.isNotEmpty(content) && null!=message.getData()){
|
||||
content = FreemarkerParseFactory.parseTemplateContent(content, message.getData());
|
||||
content = FreemarkerParseFactory.parseTemplateContent(content, message.getData(), isMarkdown);
|
||||
}
|
||||
message.setIsMarkdown(isMarkdown);
|
||||
message.setContent(content);
|
||||
}
|
||||
if(oConvertUtils.isEmpty(message.getContent())){
|
||||
@ -1202,8 +1211,16 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
//update-end-author:taoyan date:2022-7-9 for: 将模板解析代码移至消息发送, 而不是调用的地方
|
||||
if(MessageTypeEnum.XT.getType().equals(messageType)){
|
||||
if (message.isMarkdown()) {
|
||||
// 系统消息要解析Markdown
|
||||
message.setContent(HTMLUtils.parseMarkdown(message.getContent()));
|
||||
}
|
||||
systemSendMsgHandle.sendMessage(message);
|
||||
}else if(MessageTypeEnum.YJ.getType().equals(messageType)){
|
||||
if (message.isMarkdown()) {
|
||||
// 邮件消息要解析Markdown
|
||||
message.setContent(HTMLUtils.parseMarkdown(message.getContent()));
|
||||
}
|
||||
emailSendMsgHandle.sendMessage(message);
|
||||
}else if(MessageTypeEnum.DD.getType().equals(messageType)){
|
||||
ddSendMsgHandle.sendMessage(message);
|
||||
@ -1220,6 +1237,64 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
return list.get(0).getTemplateContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板内容,解析markdown
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public SysMessageTemplate getTemplateEntity(String code) {
|
||||
List<SysMessageTemplate> list = sysMessageTemplateService.selectByCode(code);
|
||||
if (list == null || list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
//-------------------------------------流程节点发送模板消息-----------------------------------------------
|
||||
|
||||
@Override
|
||||
public void saveDataLog(DataLogDTO dataLogDto) {
|
||||
SysDataLog entity = new SysDataLog();
|
||||
entity.setDataTable(dataLogDto.getTableName());
|
||||
entity.setDataId(dataLogDto.getDataId());
|
||||
entity.setDataContent(dataLogDto.getContent());
|
||||
entity.setType(dataLogDto.getType());
|
||||
entity.setDataVersion("1");
|
||||
sysDataLogService.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSysFiles(SysFilesModel sysFilesModel) {
|
||||
SysFiles sysFiles = new SysFiles();
|
||||
BeanUtils.copyProperties(sysFilesModel,sysFiles);
|
||||
String defaultValue = "0";
|
||||
sysFiles.setIzStar(defaultValue);
|
||||
sysFiles.setIzFolder(defaultValue);
|
||||
sysFiles.setIzRootFolder(defaultValue);
|
||||
sysFiles.setDelFlag(defaultValue);
|
||||
sysFilesService.save(sysFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileUrl(String fileId) {
|
||||
SysFiles sysFiles = sysFilesService.getById(fileId);
|
||||
return sysFiles.getUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(LoginUser loginUser) {
|
||||
SysUser sysUser = new SysUser();
|
||||
BeanUtils.copyProperties(loginUser, sysUser);
|
||||
sysUserService.updateById(sysUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendAppChatSocket(String userId) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.MSG_CHAT);
|
||||
obj.put(WebsocketConst.MSG_USER_ID, userId);
|
||||
webSocket.sendMessage(userId, obj.toJSONString());
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -138,8 +139,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
if (sysDepart.getParentId() == null) {
|
||||
sysDepart.setParentId("");
|
||||
}
|
||||
String s = UUID.randomUUID().toString().replace("-", "");
|
||||
sysDepart.setId(s);
|
||||
//String s = UUID.randomUUID().toString().replace("-", "");
|
||||
sysDepart.setId(IdWorker.getIdStr(sysDepart));
|
||||
// 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
|
||||
// 获取父级ID
|
||||
String parentId = sysDepart.getParentId();
|
||||
|
||||
@ -311,17 +311,33 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
sqlWhere = " and ";
|
||||
}
|
||||
// update-end-author:sunjianlei date:20220112 for: 【JTC-631】判断如果 table 携带了 where 条件,那么就使用 and 查询,防止报错
|
||||
if(oConvertUtils.isNotEmpty(keyword)){
|
||||
// 判断是否是多选
|
||||
if (keyword.contains(SymbolConstant.COMMA)) {
|
||||
//update-begin--author:scott--date:20220105--for:JTC-529【表单设计器】 编辑页面报错,in参数采用双引号导致 ----
|
||||
String inKeywords = "'" + String.join("','", keyword.split(",")) + "'";
|
||||
//update-end--author:scott--date:20220105--for:JTC-529【表单设计器】 编辑页面报错,in参数采用双引号导致----
|
||||
keywordSql = "(" + text + " in (" + inKeywords + ") or " + code + " in (" + inKeywords + "))";
|
||||
} else {
|
||||
keywordSql = "("+text + " like '%"+keyword+"%' or "+ code + " like '%"+keyword+"%')";
|
||||
|
||||
//update-begin-author:taoyan date:2022-8-15 for: 下拉搜索组件 支持传入排序信息 查询排序
|
||||
String orderField = "", orderType = "";
|
||||
if (oConvertUtils.isNotEmpty(keyword)) {
|
||||
// 关键字里面如果写入了 排序信息 xxxxx[orderby:create_time,desc]
|
||||
String orderKey = "[orderby";
|
||||
if (keyword.indexOf(orderKey) >= 0 && keyword.endsWith("]")) {
|
||||
String orderInfo = keyword.substring(keyword.indexOf(orderKey) + orderKey.length() + 1, keyword.length() - 1);
|
||||
keyword = keyword.substring(0, keyword.indexOf(orderKey));
|
||||
String[] orderInfoArray = orderInfo.split(SymbolConstant.COMMA);
|
||||
orderField = orderInfoArray[0];
|
||||
orderType = orderInfoArray[1];
|
||||
}
|
||||
|
||||
if (oConvertUtils.isNotEmpty(keyword)) {
|
||||
// 判断是否是多选
|
||||
if (keyword.contains(SymbolConstant.COMMA)) {
|
||||
//update-begin--author:scott--date:20220105--for:JTC-529【表单设计器】 编辑页面报错,in参数采用双引号导致 ----
|
||||
String inKeywords = "'" + String.join("','", keyword.split(",")) + "'";
|
||||
//update-end--author:scott--date:20220105--for:JTC-529【表单设计器】 编辑页面报错,in参数采用双引号导致----
|
||||
keywordSql = "(" + text + " in (" + inKeywords + ") or " + code + " in (" + inKeywords + "))";
|
||||
} else {
|
||||
keywordSql = "("+text + " like '%"+keyword+"%' or "+ code + " like '%"+keyword+"%')";
|
||||
}
|
||||
}
|
||||
}
|
||||
//update-end-author:taoyan date:2022-8-15 for: 下拉搜索组件 支持传入排序信息 查询排序
|
||||
if(oConvertUtils.isNotEmpty(condition) && oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + condition + " and " + keywordSql;
|
||||
}else if(oConvertUtils.isNotEmpty(condition)){
|
||||
@ -329,6 +345,12 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
}else if(oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + keywordSql;
|
||||
}
|
||||
//update-begin-author:taoyan date:2022-8-15 for: 下拉搜索组件 支持传入排序信息 查询排序
|
||||
// 增加排序逻辑
|
||||
if (oConvertUtils.isNotEmpty(orderField)) {
|
||||
filterSql += " order by " + orderField + " " + orderType;
|
||||
}
|
||||
//update-end-author:taoyan date:2022-8-15 for: 下拉搜索组件 支持传入排序信息 查询排序
|
||||
return filterSql;
|
||||
}
|
||||
@Override
|
||||
@ -339,8 +361,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField) {
|
||||
return baseMapper.queryTreeList(query, table, text, code, pidField, pid, hasChildField);
|
||||
public List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField,int converIsLeafVal) {
|
||||
return baseMapper.queryTreeList(query, table, text, code, pidField, pid, hasChildField,converIsLeafVal);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -398,6 +420,14 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
//字典表
|
||||
ls = this.queryDictItemsByCode(dictCode);
|
||||
}
|
||||
//update-begin-author:taoyan date:2022-8-30 for: 字典获取可以获取枚举类的数据
|
||||
if (ls == null || ls.size() == 0) {
|
||||
Map<String, List<DictModel>> map = ResourceUtil.getEnumDictData();
|
||||
if (map.containsKey(dictCode)) {
|
||||
return map.get(dictCode);
|
||||
}
|
||||
}
|
||||
//update-end-author:taoyan date:2022-8-30 for: 字典获取可以获取枚举类的数据
|
||||
return ls;
|
||||
}
|
||||
|
||||
|
||||
@ -55,17 +55,17 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
@Resource
|
||||
private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
|
||||
|
||||
@Override
|
||||
public List<TreeModel> queryListByParentId(String parentId) {
|
||||
return sysPermissionMapper.queryListByParentId(parentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switchVue3Menu() {
|
||||
sysPermissionMapper.backupVue2Menu();
|
||||
sysPermissionMapper.changeVue3Menu();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TreeModel> queryListByParentId(String parentId) {
|
||||
return sysPermissionMapper.queryListByParentId(parentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 真实删除
|
||||
*/
|
||||
@ -272,4 +272,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPermission> queryDepartPermissionList(String departId) {
|
||||
return sysPermissionMapper.queryDepartPermissionList(departId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
@ -57,7 +59,7 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
}
|
||||
queryDep.in(SysDepart::getId, depIdList);
|
||||
List<SysDepart> depList = sysDepartService.list(queryDep);
|
||||
//[jeecg-boot/issues/3906] 逻辑判断有问题
|
||||
//jeecg-boot/issues/3906
|
||||
if(depList != null && depList.size() > 0) {
|
||||
for(SysDepart depart : depList) {
|
||||
depIdModelList.add(new DepartIdModel().convertByUserDepart(depart));
|
||||
@ -139,7 +141,10 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
query.eq(SysUser::getId, id);
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220608 for:[VUEN-1238]邮箱回复时,发送到显示的为用户id------------
|
||||
pageList = sysUserMapper.selectPage(page, query);
|
||||
//update-begin---author:wangshuai ---date:20220902 for:[VUEN-2121]临时用户不能直接显示------------
|
||||
query.ne(SysUser::getUsername,"_reserve_user_external");
|
||||
//update-end---author:wangshuai ---date:20220902 for:[VUEN-2121]临时用户不能直接显示------------
|
||||
pageList = sysUserMapper.selectPage(page, query);
|
||||
}else{
|
||||
// 有部门ID 需要走自定义sql
|
||||
SysDepart sysDepart = sysDepartService.getById(departId);
|
||||
@ -166,6 +171,31 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SysUser> getUserInformation(String departId, String keyword, Integer pageSize, Integer pageNo) {
|
||||
IPage<SysUser> pageList = null;
|
||||
// 部门ID不存在 直接查询用户表即可
|
||||
Page<SysUser> page = new Page<>(pageNo, pageSize);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(oConvertUtils.isEmpty(departId)){
|
||||
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysUser::getStatus,Integer.parseInt(CommonConstant.STATUS_1));
|
||||
query.ne(SysUser::getUsername,"_reserve_user_external");
|
||||
//排除自己
|
||||
query.ne(SysUser::getId,sysUser.getId());
|
||||
//这个语法可以将or用括号包起来,避免数据查不到
|
||||
query.and((wrapper) -> wrapper.like(SysUser::getUsername, keyword).or().like(SysUser::getRealname,keyword));
|
||||
pageList = sysUserMapper.selectPage(page, query);
|
||||
}else{
|
||||
// 有部门ID 需要走自定义sql
|
||||
SysDepart sysDepart = sysDepartService.getById(departId);
|
||||
//update-begin---author:wangshuai ---date:20220908 for:部门排除自己------------
|
||||
pageList = this.baseMapper.getUserInformation(page, sysDepart.getOrgCode(), keyword,sysUser.getId());
|
||||
//update-end---author:wangshuai ---date:20220908 for:部门排除自己--------------
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级SpringBoot2.6.6,不允许循环依赖
|
||||
* @param userIds
|
||||
|
||||
@ -12,6 +12,7 @@ import com.jeecg.dingtalk.api.department.JdtDepartmentAPI;
|
||||
import com.jeecg.dingtalk.api.department.vo.Department;
|
||||
import com.jeecg.dingtalk.api.message.JdtMessageAPI;
|
||||
import com.jeecg.dingtalk.api.message.vo.ActionCardMessage;
|
||||
import com.jeecg.dingtalk.api.message.vo.MarkdownMessage;
|
||||
import com.jeecg.dingtalk.api.message.vo.Message;
|
||||
import com.jeecg.dingtalk.api.message.vo.TextMessage;
|
||||
import com.jeecg.dingtalk.api.oauth2.JdtOauth2API;
|
||||
@ -739,13 +740,49 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
*/
|
||||
@Override
|
||||
public boolean sendMessage(MessageDTO message, boolean verifyConfig) {
|
||||
Response<String> response = this.sendMessageResponse(message, verifyConfig);
|
||||
Response<String> response;
|
||||
if (message.isMarkdown()) {
|
||||
response = this.sendMarkdownResponse(message, verifyConfig);
|
||||
} else {
|
||||
response = this.sendMessageResponse(message, verifyConfig);
|
||||
}
|
||||
if (response != null) {
|
||||
return response.isSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送Markdown消息
|
||||
* @param message
|
||||
* @param verifyConfig
|
||||
* @return
|
||||
*/
|
||||
public Response<String> sendMarkdownResponse(MessageDTO message, boolean verifyConfig) {
|
||||
if (verifyConfig && !thirdAppConfig.isDingtalkEnabled()) {
|
||||
return null;
|
||||
}
|
||||
String accessToken = this.getAccessToken();
|
||||
if (accessToken == null) {
|
||||
return null;
|
||||
}
|
||||
// 封装钉钉消息
|
||||
String title = message.getTitle();
|
||||
String content = message.getContent();
|
||||
int agentId = thirdAppConfig.getDingtalk().getAgentIdInt();
|
||||
Message<MarkdownMessage> mdMessage = new Message<>(agentId, new MarkdownMessage(title, content));
|
||||
if (message.getToAll()) {
|
||||
mdMessage.setTo_all_user(true);
|
||||
} else {
|
||||
String[] toUsers = message.getToUser().split(",");
|
||||
// 通过第三方账号表查询出第三方userId
|
||||
List<SysThirdAccount> thirdAccountList = sysThirdAccountService.listThirdUserIdByUsername(toUsers, THIRD_TYPE);
|
||||
List<String> dtUserIds = thirdAccountList.stream().map(SysThirdAccount::getThirdUserId).collect(Collectors.toList());
|
||||
mdMessage.setUserid_list(dtUserIds);
|
||||
}
|
||||
return JdtMessageAPI.sendMarkdownMessage(mdMessage, accessToken);
|
||||
}
|
||||
|
||||
public Response<String> sendMessageResponse(MessageDTO message, boolean verifyConfig) {
|
||||
if (verifyConfig && !thirdAppConfig.isDingtalkEnabled()) {
|
||||
return null;
|
||||
|
||||
@ -9,10 +9,7 @@ import com.jeecg.qywx.api.department.JwDepartmentAPI;
|
||||
import com.jeecg.qywx.api.department.vo.DepartMsgResponse;
|
||||
import com.jeecg.qywx.api.department.vo.Department;
|
||||
import com.jeecg.qywx.api.message.JwMessageAPI;
|
||||
import com.jeecg.qywx.api.message.vo.Text;
|
||||
import com.jeecg.qywx.api.message.vo.TextCard;
|
||||
import com.jeecg.qywx.api.message.vo.TextCardEntity;
|
||||
import com.jeecg.qywx.api.message.vo.TextEntity;
|
||||
import com.jeecg.qywx.api.message.vo.*;
|
||||
import com.jeecg.qywx.api.user.JwUserAPI;
|
||||
import com.jeecg.qywx.api.user.vo.User;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -747,7 +744,12 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
|
||||
@Override
|
||||
public boolean sendMessage(MessageDTO message, boolean verifyConfig) {
|
||||
JSONObject response = this.sendMessageResponse(message, verifyConfig);
|
||||
JSONObject response;
|
||||
if (message.isMarkdown()) {
|
||||
response = this.sendMarkdownResponse(message, verifyConfig);
|
||||
} else {
|
||||
response = this.sendMessageResponse(message, verifyConfig);
|
||||
}
|
||||
if (response != null) {
|
||||
return response.getIntValue("errcode") == 0;
|
||||
}
|
||||
@ -772,6 +774,23 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
return JwMessageAPI.sendTextMessage(text, accessToken);
|
||||
}
|
||||
|
||||
public JSONObject sendMarkdownResponse(MessageDTO message, boolean verifyConfig) {
|
||||
if (verifyConfig && !thirdAppConfig.isWechatEnterpriseEnabled()) {
|
||||
return null;
|
||||
}
|
||||
String accessToken = this.getAppAccessToken();
|
||||
if (accessToken == null) {
|
||||
return null;
|
||||
}
|
||||
Markdown markdown = new Markdown();
|
||||
markdown.setTouser(this.getTouser(message.getToUser(), message.getToAll()));
|
||||
MarkdownEntity entity = new MarkdownEntity();
|
||||
entity.setContent(message.getContent());
|
||||
markdown.setMarkdown(entity);
|
||||
markdown.setAgentid(thirdAppConfig.getWechatEnterprise().getAgentIdInt());
|
||||
return JwMessageAPI.sendMarkdownMessage(markdown, accessToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送文本卡片消息(SysAnnouncement定制)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user