修复tab页查询

This commit is contained in:
qimingjin 2021-05-03 20:21:41 +08:00
parent 3dea06e072
commit 8dead25f39
4 changed files with 15 additions and 63 deletions

View File

@ -296,7 +296,7 @@
/*用户管理-新增-选择部门树*/
function selectDeptTree() {
var treeId = $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "1" : $("#treeId").val();
var url = ctx + "system/dept/selectDeptTree/" + deptId;
var options = {
title: '选择部门',

View File

@ -3,8 +3,7 @@ package com.snow.framework.web.message;
import com.snow.common.utils.StringUtils;
import com.snow.framework.web.domain.common.MessageEventDTO;
import com.snow.framework.web.message.consumer.SysMarkReadedStrategy;
import com.snow.framework.web.message.producer.SysSendEmailStrategy;
import com.snow.framework.web.message.producer.SysSendVisitLogStrategy;
import com.snow.framework.web.message.producer.SendMessageCenterStrategy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
@ -34,14 +33,12 @@ public class MessageEventHandler implements ApplicationListener<MessageEventDTO>
messageEventContext.setMessageEventTypeStrategy(new TaskTodoStrategy());
break;
case "SEND_EMAIL":
messageEventContext.setMessageEventTypeStrategy(new SysSendEmailStrategy());
case "SEND_VISIT_LOG":
messageEventContext.setMessageEventTypeStrategy(new SendMessageCenterStrategy());
break;
case "MARK_READED":
messageEventContext.setMessageEventTypeStrategy(new SysMarkReadedStrategy());
break;
case "SEND_VISIT_LOG":
messageEventContext.setMessageEventTypeStrategy(new SysSendVisitLogStrategy());
break;
default:
@ -50,4 +47,5 @@ public class MessageEventHandler implements ApplicationListener<MessageEventDTO>
//执行
messageEventContext.messageHandle(messageEvent);
}
}

View File

@ -1,36 +1,31 @@
package com.snow.framework.web.message.producer;
import cn.hutool.core.bean.BeanUtil;
import com.snow.common.enums.MessageEventType;
import com.snow.common.utils.spring.SpringUtils;
import com.snow.framework.web.domain.common.MessageEventDTO;
import com.snow.framework.web.message.MessageEventStrategy;
import com.snow.system.domain.SysMessageTransition;
import com.snow.system.service.ISysMessageTransitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Set;
/**
* @program: snow
* @description
* @author: 没用的阿吉
* @create: 2021-04-17 12:46
**/
* 发送消息到消息中心策略
*/
@Component
public class SysSendVisitLogStrategy implements MessageEventStrategy {
@Autowired
public class SendMessageCenterStrategy implements MessageEventStrategy {
@Resource
private ISysMessageTransitionService messageTransitionService= SpringUtils.getBean(ISysMessageTransitionService.class);
@Override
public void messageHandle(MessageEventDTO messageEvent) {
public void messageHandle(MessageEventDTO messageEventDTO) {
SysMessageTransition sysMessageTransition=new SysMessageTransition();
BeanUtil.copyProperties(messageEvent,sysMessageTransition);
sysMessageTransition.setMessageType(MessageEventType.SEND_VISIT_LOG.getCode());
BeanUtil.copyProperties(messageEventDTO,sysMessageTransition);
sysMessageTransition.setMessageType(messageEventDTO.getMessageEventType().getCode());
Set<String> consumerId = messageEvent.getConsumerIds();
Set<String> consumerId = messageEventDTO.getConsumerIds();
consumerId.forEach(t->{
sysMessageTransition.setConsumerId(t);
messageTransitionService.insertSysMessageTransition(sysMessageTransition);

View File

@ -1,41 +0,0 @@
package com.snow.framework.web.message.producer;
import cn.hutool.core.bean.BeanUtil;
import com.snow.common.enums.MessageEventType;
import com.snow.common.utils.spring.SpringUtils;
import com.snow.framework.web.domain.common.MessageEventDTO;
import com.snow.framework.web.message.MessageEventStrategy;
import com.snow.system.domain.SysMessageTransition;
import com.snow.system.service.ISysMessageTransitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Set;
/**
* @program: snow
* @description 系统发送邮件
* @author: 没用的阿吉
* @create: 2021-03-30 14:11
**/
@Component
public class SysSendEmailStrategy implements MessageEventStrategy {
@Autowired
private ISysMessageTransitionService messageTransitionService=SpringUtils.getBean(ISysMessageTransitionService.class);
@Override
public void messageHandle(MessageEventDTO messageEvent) {
SysMessageTransition sysMessageTransition=new SysMessageTransition();
BeanUtil.copyProperties(messageEvent,sysMessageTransition);
sysMessageTransition.setMessageType(MessageEventType.SEND_EMAIL.getCode());
Set<String> consumerId = messageEvent.getConsumerIds();
consumerId.forEach(t->{
sysMessageTransition.setConsumerId(t);
messageTransitionService.insertSysMessageTransition(sysMessageTransition);
});
}
}