Merge branch 'v4.1_dev'
# Conflicts: # modules/core/src/main/resources/i18n/core/common/i18n_en.properties
This commit is contained in:
@@ -38,12 +38,8 @@ public class CasAuthenticationFilter extends org.apache.shiro.cas.CasFilter {
|
||||
// 登录成功后初始化授权信息并处理登录后的操作
|
||||
authorizingRealm.onLoginSuccess((LoginInfo)subject.getPrincipal(), (HttpServletRequest)request);
|
||||
|
||||
String url = request.getParameter("__url");
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
WebUtils.issueRedirect(request, response, url, null, true);
|
||||
} else {
|
||||
WebUtils.issueRedirect(request, response, getSuccessUrl(), null, true);
|
||||
}
|
||||
// AJAX不支持Redirect改用Forward
|
||||
request.getRequestDispatcher(getSuccessUrl()).forward(request, response);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,12 +51,8 @@ public class CasAuthenticationFilter extends org.apache.shiro.cas.CasFilter {
|
||||
Subject subject = getSubject(request, response);
|
||||
if (subject.isAuthenticated() || subject.isRemembered()) {
|
||||
try {
|
||||
String url = request.getParameter("__url");
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
WebUtils.issueRedirect(request, response, url, null, true);
|
||||
} else {
|
||||
WebUtils.issueRedirect(request, response, getSuccessUrl(), null, true);
|
||||
}
|
||||
// AJAX不支持Redirect改用Forward
|
||||
request.getRequestDispatcher(getSuccessUrl()).forward(request, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class FormAuthenticationFilter extends org.apache.shiro.web.filter.authc.
|
||||
}
|
||||
// 登录成功后,判断是否需要记住用户名
|
||||
if (WebUtils.isTrue(request, DEFAULT_REMEMBER_USERCODE_PARAM)) {
|
||||
rememberUserCodeCookie.setValue(EncodeUtils.xssFilter(username));
|
||||
rememberUserCodeCookie.setValue(EncodeUtils.encodeUrl(EncodeUtils.xssFilter(username)));
|
||||
rememberUserCodeCookie.saveTo((HttpServletRequest)request, (HttpServletResponse)response);
|
||||
} else {
|
||||
rememberUserCodeCookie.removeFrom((HttpServletRequest)request, (HttpServletResponse)response);
|
||||
@@ -235,19 +235,8 @@ public class FormAuthenticationFilter extends org.apache.shiro.web.filter.authc.
|
||||
// 登录成功后初始化授权信息并处理登录后的操作
|
||||
authorizingRealm.onLoginSuccess((LoginInfo)subject.getPrincipal(), (HttpServletRequest) request);
|
||||
|
||||
// 登录操作如果是Ajax操作,直接返回登录信息字符串。
|
||||
if (ServletUtils.isAjaxRequest((HttpServletRequest) request)) {
|
||||
request.getRequestDispatcher(getSuccessUrl()).forward(request, response); // AJAX不支持Redirect改用Forward
|
||||
}
|
||||
// 登录成功直接返回到首页
|
||||
else {
|
||||
String url = request.getParameter("__url");
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
WebUtils.issueRedirect(request, response, url, null, true);
|
||||
} else {
|
||||
WebUtils.issueRedirect(request, response, getSuccessUrl(), null, true);
|
||||
}
|
||||
}
|
||||
// AJAX不支持Redirect改用Forward
|
||||
request.getRequestDispatcher(getSuccessUrl()).forward(request, response);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ package com.jeesite.common.shiro.realm;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.codec.Sha1Utils;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
@@ -31,10 +29,10 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
|
||||
|
||||
public AuthorizingRealm() {
|
||||
super();
|
||||
// 设定密码校验的Hash算法与迭代次数
|
||||
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
|
||||
matcher.setHashIterations(HASH_INTERATIONS);
|
||||
this.setCredentialsMatcher(matcher);
|
||||
// // 设定密码校验的Hash算法与迭代次数(V4.1.4及以上版本不需要了,统一使用validatePassword验证密码)
|
||||
// HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
|
||||
// matcher.setHashIterations(HASH_INTERATIONS);
|
||||
// this.setCredentialsMatcher(matcher);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.dao;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInner;
|
||||
|
||||
/**
|
||||
* 内部消息DAO接口
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface MsgInnerDao extends CrudDao<MsgInner> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.dao;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
|
||||
/**
|
||||
* 内部消息发送记录表DAO接口
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface MsgInnerRecordDao extends CrudDao<MsgInnerRecord> {
|
||||
|
||||
/**
|
||||
* 根据消息编号和接受者用户名更新读取状态
|
||||
*/
|
||||
public long updateReadStatus(MsgInnerRecord msgInnerRecord);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
|
||||
/**
|
||||
* 内部消息Entity
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Table(name="${_prefix}sys_msg_inner", alias="a", columns={
|
||||
@Column(name="id", attrName="id", label="编号", isPK=true),
|
||||
@Column(name="msg_title", attrName="msgTitle", label="消息标题", queryType=QueryType.LIKE),
|
||||
@Column(name="content_level", attrName="contentLevel", label="内容等级", comment="内容等级(1普通 2一般 3紧急)"),
|
||||
@Column(name="content_type", attrName="contentType", label="内容类型", comment="内容类型(1公告 2新闻 3会议 4其它)"),
|
||||
@Column(name="msg_content", attrName="msgContent", label="消息内容"),
|
||||
@Column(name="receive_type", attrName="receiveType", label="接受者类型", comment="接受者类型(1用户 2部门 3角色 4岗位)"),
|
||||
@Column(name="receive_codes", attrName="receiveCodes", label="接受者字符串"),
|
||||
@Column(name="receive_names", attrName="receiveNames", label="接受者名称字符串", queryType=QueryType.LIKE),
|
||||
@Column(name="send_user_code", attrName="sendUserCode", label="发送者用户编码"),
|
||||
@Column(name="send_user_name", attrName="sendUserName", label="发送者用户姓名", queryType=QueryType.LIKE),
|
||||
@Column(name="send_date", attrName="sendDate", label="发送时间"),
|
||||
@Column(name="is_attac", attrName="isAttac", label="是否有附件"),
|
||||
@Column(name="notify_types", attrName="notifyTypes", label="通知类型", comment="通知类型(PC APP 短信 邮件 微信)多选"),
|
||||
@Column(includeEntity=DataEntity.class, comment="状态(0正常 1删除 4审核 5驳回 9草稿)"),
|
||||
}, orderBy="a.update_date DESC"
|
||||
)
|
||||
public class MsgInner extends DataEntity<MsgInner> {
|
||||
|
||||
// 接受者类型(0所有 1用户 2部门 3角色 4岗位)
|
||||
public static final String RECEIVE_TYPE_ALL = "0";
|
||||
public static final String RECEIVE_TYPE_USER = "1";
|
||||
public static final String RECEIVE_TYPE_OFFICE = "2";
|
||||
public static final String RECEIVE_TYPE_ROLE = "3";
|
||||
public static final String RECEIVE_TYPE_POST = "4";
|
||||
|
||||
// 内容级别(1普通 2一般 3紧急)
|
||||
public static final String CONTENT_LEVEL_1 = "1";
|
||||
public static final String CONTENT_LEVEL_2 = "2";
|
||||
public static final String CONTENT_LEVEL_3 = "3";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String msgTitle; // 消息标题
|
||||
private String contentLevel; // 内容等级(1普通 2一般 3紧急)
|
||||
private String contentType; // 内容类型(1公告 2新闻 3会议 4其它)
|
||||
private String msgContent; // 消息内容
|
||||
private String receiveType; // 接受者类型(1用户 2部门 3角色 4岗位)
|
||||
private String receiveCodes; // 接受者字符串
|
||||
private String receiveNames; // 接受者名称字符串
|
||||
private String sendUserCode; // 发送者用户编码
|
||||
private String sendUserName; // 发送者用户姓名
|
||||
private Date sendDate; // 发送时间
|
||||
private String isAttac; // 是否有附件
|
||||
private String notifyTypes; // 通知类型(PC APP 短信 邮件 微信)多选
|
||||
|
||||
private MsgInnerRecord record; // 消息记录状态
|
||||
|
||||
public MsgInner() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public MsgInner(String id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
@NotBlank(message="消息标题不能为空")
|
||||
@Length(min=0, max=200, message="消息标题长度不能超过 200 个字符")
|
||||
public String getMsgTitle() {
|
||||
return msgTitle;
|
||||
}
|
||||
|
||||
public void setMsgTitle(String msgTitle) {
|
||||
this.msgTitle = msgTitle;
|
||||
}
|
||||
|
||||
@NotBlank(message="内容级别不能为空")
|
||||
@Length(min=0, max=1, message="内容级别长度不能超过 1 个字符")
|
||||
public String getContentLevel() {
|
||||
return contentLevel;
|
||||
}
|
||||
|
||||
public void setContentLevel(String contentLevel) {
|
||||
this.contentLevel = contentLevel;
|
||||
}
|
||||
|
||||
@Length(min=0, max=1, message="内容类型长度不能超过 1 个字符")
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
@NotBlank(message="消息内容不能为空")
|
||||
public String getMsgContent() {
|
||||
return msgContent;
|
||||
}
|
||||
|
||||
public void setMsgContent(String msgContent) {
|
||||
this.msgContent = msgContent;
|
||||
}
|
||||
|
||||
@NotBlank(message="接受者类型不能为空")
|
||||
@Length(min=0, max=1, message="接受者类型长度不能超过 1 个字符")
|
||||
public String getReceiveType() {
|
||||
return receiveType;
|
||||
}
|
||||
|
||||
public void setReceiveType(String receiveType) {
|
||||
this.receiveType = receiveType;
|
||||
}
|
||||
|
||||
public String getReceiveCodes() {
|
||||
return receiveCodes;
|
||||
}
|
||||
|
||||
public void setReceiveCodes(String receiveCodes) {
|
||||
this.receiveCodes = receiveCodes;
|
||||
}
|
||||
|
||||
public String getReceiveNames() {
|
||||
return receiveNames;
|
||||
}
|
||||
|
||||
public void setReceiveNames(String receiveNames) {
|
||||
this.receiveNames = receiveNames;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="发送者用户编码长度不能超过 64 个字符")
|
||||
public String getSendUserCode() {
|
||||
return sendUserCode;
|
||||
}
|
||||
|
||||
public void setSendUserCode(String sendUserCode) {
|
||||
this.sendUserCode = sendUserCode;
|
||||
}
|
||||
|
||||
@Length(min=0, max=100, message="发送者用户姓名长度不能超过 100 个字符")
|
||||
public String getSendUserName() {
|
||||
return sendUserName;
|
||||
}
|
||||
|
||||
public void setSendUserName(String sendUserName) {
|
||||
this.sendUserName = sendUserName;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getSendDate() {
|
||||
return sendDate;
|
||||
}
|
||||
|
||||
public void setSendDate(Date sendDate) {
|
||||
this.sendDate = sendDate;
|
||||
}
|
||||
|
||||
public Date getSendDate_gte() {
|
||||
return sqlMap.getWhere().getValue("send_date", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void setSendDate_gte(Date sendDate) {
|
||||
sendDate = DateUtils.getOfDayFirst(sendDate);
|
||||
sqlMap.getWhere().and("send_date", QueryType.GTE, sendDate);
|
||||
}
|
||||
|
||||
public Date getSendDate_lte() {
|
||||
return sqlMap.getWhere().getValue("send_date", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void setSendDate_lte(Date sendDate) {
|
||||
sendDate = DateUtils.getOfDayLast(sendDate);
|
||||
sqlMap.getWhere().and("send_date", QueryType.LTE, sendDate);
|
||||
}
|
||||
|
||||
@Length(min=0, max=1, message="是否有附件长度不能超过 1 个字符")
|
||||
public String getIsAttac() {
|
||||
return isAttac;
|
||||
}
|
||||
|
||||
public void setIsAttac(String isAttac) {
|
||||
this.isAttac = isAttac;
|
||||
}
|
||||
|
||||
@Length(min=0, max=100, message="通知类型长度不能超过 100 个字符")
|
||||
public String getNotifyTypes() {
|
||||
return notifyTypes;
|
||||
}
|
||||
|
||||
public void setNotifyTypes(String notifyTypes) {
|
||||
this.notifyTypes = notifyTypes;
|
||||
}
|
||||
|
||||
public MsgInnerRecord getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void setRecord(MsgInnerRecord record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
|
||||
/**
|
||||
* 内部消息发送记录表Entity
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Table(name="${_prefix}sys_msg_inner_record", alias="a", columns={
|
||||
@Column(name="id", attrName="id", label="编号", isPK=true),
|
||||
@Column(name="msg_inner_id", attrName="msgInnerId", label="所属消息"),
|
||||
@Column(name="receive_user_code", attrName="receiveUserCode", label="接受者用户编码"),
|
||||
@Column(name="receive_user_name", attrName="receiveUserName", label="接受者用户姓名", queryType=QueryType.LIKE),
|
||||
@Column(name="read_status", attrName="readStatus", label="读取状态", comment="读取状态(0未送达 1已读 2未读)"),
|
||||
@Column(name="read_date", attrName="readDate", label="阅读时间"),
|
||||
@Column(name="is_star", attrName="isStar", label="是否标星"),
|
||||
}, orderBy="a.read_date ASC, a.id ASC"
|
||||
)
|
||||
public class MsgInnerRecord extends DataEntity<MsgInnerRecord> {
|
||||
|
||||
// 读取状态(0未送达 1已读 2未读)
|
||||
public static final String READ_STATUS_READ = "1";
|
||||
public static final String READ_STATUS_UNREAD = "2";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String msgInnerId; // 所属消息
|
||||
private String receiveUserCode; // 接受者用户编码
|
||||
private String receiveUserName; // 接受者用户姓名
|
||||
private String readStatus; // 读取状态(0未送达 1已读 2未读)
|
||||
private Date readDate; // 阅读时间
|
||||
private String isStar; // 是否标星
|
||||
|
||||
public MsgInnerRecord() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public MsgInnerRecord(String id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
@NotBlank(message="所属消息不能为空")
|
||||
@Length(min=0, max=64, message="所属消息长度不能超过 64 个字符")
|
||||
public String getMsgInnerId() {
|
||||
return msgInnerId;
|
||||
}
|
||||
|
||||
public void setMsgInnerId(String msgInnerId) {
|
||||
this.msgInnerId = msgInnerId;
|
||||
}
|
||||
|
||||
@Length(min=0, max=64, message="接受者用户编码长度不能超过 64 个字符")
|
||||
public String getReceiveUserCode() {
|
||||
return receiveUserCode;
|
||||
}
|
||||
|
||||
public void setReceiveUserCode(String receiveUserCode) {
|
||||
this.receiveUserCode = receiveUserCode;
|
||||
}
|
||||
|
||||
@NotBlank(message="接受者用户姓名不能为空")
|
||||
@Length(min=0, max=100, message="接受者用户姓名长度不能超过 100 个字符")
|
||||
public String getReceiveUserName() {
|
||||
return receiveUserName;
|
||||
}
|
||||
|
||||
public void setReceiveUserName(String receiveUserName) {
|
||||
this.receiveUserName = receiveUserName;
|
||||
}
|
||||
|
||||
@NotBlank(message="读取状态不能为空")
|
||||
@Length(min=0, max=1, message="读取状态长度不能超过 1 个字符")
|
||||
public String getReadStatus() {
|
||||
return readStatus;
|
||||
}
|
||||
|
||||
public void setReadStatus(String readStatus) {
|
||||
this.readStatus = readStatus;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getReadDate() {
|
||||
return readDate;
|
||||
}
|
||||
|
||||
public void setReadDate(Date readDate) {
|
||||
this.readDate = readDate;
|
||||
}
|
||||
|
||||
@Length(min=0, max=1, message="是否标星长度不能超过 1 个字符")
|
||||
public String getIsStar() {
|
||||
return isStar;
|
||||
}
|
||||
|
||||
public void setIsStar(String isStar) {
|
||||
this.isStar = isStar;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.send;
|
||||
|
||||
import org.apache.commons.mail.HtmlEmail;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.service.BaseService;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.entity.content.EmailMsgContent;
|
||||
import com.jeesite.modules.msg.send.MsgSendService;
|
||||
|
||||
/**
|
||||
* 电子邮件发送服务实现
|
||||
* @author ThinkGem
|
||||
* @version 2018年5月13日
|
||||
*/
|
||||
@Service
|
||||
public class EmailSendService extends BaseService implements MsgSendService{
|
||||
|
||||
@Override
|
||||
public void sendMessage(MsgPush msgPush) {
|
||||
try{
|
||||
String fromAddress = Global.getProperty("msg.email.fromAddress");
|
||||
String fromPassword = Global.getProperty("msg.email.fromPassword");
|
||||
String fromHostName = Global.getProperty("msg.email.fromHostName");
|
||||
Integer smtpPort = Global.getPropertyToInteger("msg.email.smtpPort", "25");
|
||||
String sslOnConnect = Global.getProperty("msg.email.sslOnConnect", "false");
|
||||
String sslSmtpPort = Global.getProperty("msg.email.sslSmtpPort", "465");
|
||||
|
||||
HtmlEmail htmlEmail = new HtmlEmail();
|
||||
htmlEmail.setCharset("utf-8");
|
||||
htmlEmail.setFrom(fromAddress);
|
||||
htmlEmail.setAuthentication(fromAddress, fromPassword);
|
||||
htmlEmail.setHostName(fromHostName);
|
||||
htmlEmail.setSmtpPort(smtpPort);
|
||||
if ("true".equals(sslOnConnect)) {
|
||||
htmlEmail.setSSLOnConnect(true);
|
||||
htmlEmail.setSslSmtpPort(sslSmtpPort);
|
||||
}
|
||||
htmlEmail.addTo(msgPush.getReceiveCode(), msgPush.getReceiveUserName());
|
||||
|
||||
// 内容
|
||||
EmailMsgContent content = msgPush.parseMsgContent(EmailMsgContent.class);
|
||||
htmlEmail.setSubject(content.getTitle());
|
||||
htmlEmail.setMsg(content.getContent());
|
||||
|
||||
// 抄送
|
||||
if (StringUtils.isNotBlank(content.getCc())) {
|
||||
for (String email : content.getCc().split(";")) {
|
||||
htmlEmail.addCc(email);
|
||||
}
|
||||
}
|
||||
// 密送
|
||||
if (StringUtils.isNotBlank(content.getBcc())) {
|
||||
for (String email : content.getBcc().split(";")) {
|
||||
htmlEmail.addBcc(email);
|
||||
}
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
String result = htmlEmail.send();
|
||||
|
||||
// 发送成功
|
||||
msgPush.setPushStatus(MsgPush.PUSH_STATUS_SUCCESS);
|
||||
msgPush.addPushReturnContent(result);
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.error("发送邮件失败! ", ex);
|
||||
msgPush.setPushStatus(MsgPush.PUSH_STATUS_FAIL);
|
||||
msgPush.addPushReturnContent(ExceptionUtils.getStackTraceAsString(ex));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.send;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.mapper.JsonMapper;
|
||||
import com.jeesite.common.msg.SmsUtils;
|
||||
import com.jeesite.common.service.BaseService;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.entity.content.SmsMsgContent;
|
||||
import com.jeesite.modules.msg.send.MsgSendService;
|
||||
|
||||
/**
|
||||
* 短信发送服务实现
|
||||
* @author ThinkGem
|
||||
* @version 2018年5月13日
|
||||
*/
|
||||
@Service
|
||||
public class SmsSendService extends BaseService implements MsgSendService{
|
||||
|
||||
@Override
|
||||
public void sendMessage(MsgPush msgPush) {
|
||||
try{
|
||||
// String url = Global.getProperty("msg.sms.url");
|
||||
// String data = Global.getProperty("msg.sms.data");
|
||||
// String prefix = Global.getProperty("msg.sms.prefix", "");
|
||||
// String suffix = Global.getProperty("msg.sms.suffix", "");
|
||||
// Connection conn = Jsoup.connect(url);
|
||||
// conn.postDataCharset("UTF-8");
|
||||
// conn.method(Method.POST);
|
||||
// for (String param : StringUtils.split(data, "&")){
|
||||
// String[] ss = StringUtils.split(param, "=");
|
||||
// if (ss.length == 1){
|
||||
// conn.data(ss[0], "");
|
||||
// }else if (ss.length == 2){
|
||||
// conn.data(ss[0], ss[1]);
|
||||
// }
|
||||
// }
|
||||
// // 手机号码
|
||||
// conn.data("mobile", msgPush.getReceiveCode());
|
||||
// // 短信内容
|
||||
// SmsMsgContent content = msgPush.parseMsgContent(SmsMsgContent.class);
|
||||
// conn.data("content", prefix + content.getContent() + suffix);
|
||||
// // 发送短信
|
||||
// String result = conn.execute().body();
|
||||
// String result = "{result:0,message:\"ok\"}"; // 模拟发送结果
|
||||
// Map<String, Object> map = JsonMapper.fromJson(result, Map.class);
|
||||
|
||||
// 发送短信
|
||||
SmsMsgContent content = msgPush.parseMsgContent(SmsMsgContent.class);
|
||||
String result = SmsUtils.send(content.getContent(), msgPush.getReceiveCode());
|
||||
Map<String, Object> map = JsonMapper.fromJson(result, Map.class);
|
||||
|
||||
// 发送成功
|
||||
if (ObjectUtils.toInteger(map.get("result")) == 0){
|
||||
msgPush.setPushStatus(MsgPush.PUSH_STATUS_SUCCESS);
|
||||
msgPush.addPushReturnContent(result);
|
||||
}
|
||||
// 发送失败
|
||||
else{
|
||||
throw new RuntimeException(result);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.error("发送短信失败! ", ex);
|
||||
msgPush.setPushDate(new Date());
|
||||
msgPush.setPushStatus(MsgPush.PUSH_STATUS_FAIL);
|
||||
msgPush.addPushReturnContent(ExceptionUtils.getStackTraceAsString(ex));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.callback.MethodCallback;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.common.web.http.ServletUtils;
|
||||
import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
import com.jeesite.modules.msg.dao.MsgInnerDao;
|
||||
import com.jeesite.modules.msg.dao.MsgInnerRecordDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInner;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.entity.content.AppMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.BaseMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.EmailMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.PcMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.SmsMsgContent;
|
||||
import com.jeesite.modules.msg.utils.MsgPushUtils;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.service.EmpUserService;
|
||||
|
||||
/**
|
||||
* 内部消息Service
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
|
||||
@Autowired
|
||||
private EmpUserService empUserService;
|
||||
@Autowired
|
||||
private MsgInnerRecordDao msgInnerRecordDao;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param msgInner
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MsgInner get(MsgInner msgInner) {
|
||||
return super.get(msgInner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param msgInner 查询条件
|
||||
* @param msgInner.page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<MsgInner> findPage(MsgInner msgInner) {
|
||||
return super.findPage(msgInner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消息记录数据
|
||||
*/
|
||||
public List<MsgInnerRecord> findRecordList(MsgInnerRecord msgInnerRecord){
|
||||
return msgInnerRecordDao.findList(msgInnerRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
public void save(MsgInner msgInner) {
|
||||
if (msgInner.getIsNewRecord()){
|
||||
User user = msgInner.getCurrentUser();
|
||||
msgInner.setSendUserCode(user.getUserCode());
|
||||
msgInner.setSendUserName(user.getUserName());
|
||||
// 没有设置状态,则默认新增后是草稿状态
|
||||
if (StringUtils.isBlank(msgInner.getStatus())){
|
||||
msgInner.setStatus(MsgInner.STATUS_DRAFT);
|
||||
}
|
||||
}
|
||||
msgInner.setSendDate(new Date());
|
||||
msgInner.setIsAttac(StringUtils.isNotBlank(ServletUtils.getParameter("msgInner_file"))?Global.YES:Global.NO);
|
||||
super.save(msgInner);
|
||||
// 保存上传附件
|
||||
FileUploadUtils.saveFileUpload(msgInner.getId(), "msgInner_file");
|
||||
// 发送内部消息
|
||||
if (MsgInner.STATUS_NORMAL.equals(msgInner.getStatus())){
|
||||
this.updateStatus(msgInner); // 更新状态
|
||||
List<EmpUser> empUserList = null;
|
||||
if (MsgInner.RECEIVE_TYPE_ALL.equals(msgInner.getReceiveType())){
|
||||
EmpUser empUser = new EmpUser();
|
||||
empUser.setCodes(new String[]{});
|
||||
empUserList = empUserService.findUserList(empUser);
|
||||
}else{
|
||||
String[] codes = StringUtils.split(msgInner.getReceiveCodes(), ",");
|
||||
String[] names = StringUtils.split(msgInner.getReceiveNames(), ",");
|
||||
if (codes != null && names != null && codes.length > 0 && codes.length == names.length){
|
||||
EmpUser empUser = new EmpUser();
|
||||
empUser.setCodes(codes);
|
||||
switch(msgInner.getReceiveType()){
|
||||
case MsgInner.RECEIVE_TYPE_USER:
|
||||
empUserList = ListUtils.newArrayList();
|
||||
for (int i=0; i<codes.length; i++){
|
||||
EmpUser e = new EmpUser();
|
||||
e.setUserCode(codes[i]);
|
||||
e.setUserName(names[i]);
|
||||
empUserList.add(e);
|
||||
}
|
||||
break;
|
||||
case MsgInner.RECEIVE_TYPE_OFFICE:
|
||||
empUserList = empUserService.findUserListByOfficeCodes(empUser);
|
||||
break;
|
||||
case MsgInner.RECEIVE_TYPE_ROLE:
|
||||
empUserList = empUserService.findUserListByRoleCodes(empUser);
|
||||
break;
|
||||
case MsgInner.RECEIVE_TYPE_POST:
|
||||
empUserList = empUserService.findUserListByPostCodes(empUser);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.saveMsgInnerRecord(msgInner, empUserList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存消息推送记录
|
||||
*/
|
||||
private void saveMsgInnerRecord(MsgInner msgInner, List<EmpUser> empUserList){
|
||||
if (empUserList == null || empUserList.size() <= 0){
|
||||
return;
|
||||
}
|
||||
String[] notifyTypes = StringUtils.split(msgInner.getNotifyTypes(), ",");
|
||||
List<MsgInnerRecord> recordList = ListUtils.newArrayList();
|
||||
empUserList.forEach(user -> {
|
||||
MsgInnerRecord r = new MsgInnerRecord();
|
||||
r.setMsgInnerId(msgInner.getId());
|
||||
r.setReceiveUserCode(user.getUserCode());
|
||||
r.setReceiveUserName(user.getUserName());
|
||||
r.setReadStatus(MsgInnerRecord.READ_STATUS_UNREAD);
|
||||
recordList.add(r);
|
||||
// 发送消息通知(消息推送)
|
||||
if (notifyTypes != null){
|
||||
for (String type : notifyTypes){
|
||||
BaseMsgContent msgContent = null;
|
||||
if (MsgPush.TYPE_PC.equals(type)){
|
||||
msgContent = new PcMsgContent();
|
||||
msgContent.setContent("你有一条内部消息,点击“详情”进行查阅。");
|
||||
((PcMsgContent)msgContent).addButton(new String[]{
|
||||
"详情", "/a/msg/msgInner/view?id="+msgInner.getId()});
|
||||
}else if (MsgPush.TYPE_APP.equals(type)){
|
||||
msgContent = new AppMsgContent();
|
||||
}else if (MsgPush.TYPE_SMS.equals(type)){
|
||||
msgContent = new SmsMsgContent();
|
||||
}else if (MsgPush.TYPE_EMAIL.equals(type)){
|
||||
msgContent = new EmailMsgContent();
|
||||
}
|
||||
if (msgContent != null){
|
||||
msgContent.setTitle(msgInner.getMsgTitle());
|
||||
if (msgContent.getContent() == null){
|
||||
msgContent.setContent("你有一条内部消息请查阅:"
|
||||
+ StringUtils.abbr(msgInner.getMsgTitle(), 30));
|
||||
}
|
||||
msgContent.setMsgPush(new MsgPush());
|
||||
msgContent.getMsgPush().setIsRealtimePush(false); // 关闭实时推送,改为手动推送
|
||||
MsgPushUtils.push(msgContent, msgInner.getId(),
|
||||
MsgInner.class.getSimpleName(), user.getUserCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
ListUtils.pageList(recordList, 100, new MethodCallback() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object execute(Object... objs) {
|
||||
msgInnerRecordDao.insertBatch((List<MsgInnerRecord>)objs[0]);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
// 手动触发消息推送任务
|
||||
if (Global.TRUE.equals(Global.getProperty("msg.realtime.enabled"))){
|
||||
new Thread(){
|
||||
public void run() {
|
||||
try{
|
||||
MsgPushUtils.getMsgPushTask().execute();
|
||||
}catch(Exception ex){
|
||||
logger.error("实时消息发送失败,推送服务配置不正确。", ex);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据消息编号和接受者用户名读取内部消息
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
public void readMsgInnerRecord(MsgInner msgInner){
|
||||
MsgInnerRecord msgInnerRecord = new MsgInnerRecord();
|
||||
msgInnerRecord.setMsgInnerId(msgInner.getId());
|
||||
msgInnerRecord.setReceiveUserCode(msgInner.getCurrentUser().getUserCode());
|
||||
msgInnerRecord.setReadStatus(MsgInnerRecord.READ_STATUS_READ);
|
||||
msgInnerRecord.setReadDate(new Date());
|
||||
msgInnerRecordDao.updateReadStatus(msgInnerRecord);
|
||||
// 将关联的内部消息通知更新为已读(消息推送)
|
||||
MsgPushUtils.readMsgByBiz(msgInner.getId(), MsgInner.class.getSimpleName(),
|
||||
msgInnerRecord.getReceiveUserCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(MsgInner msgInner) {
|
||||
super.updateStatus(msgInner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(MsgInner msgInner) {
|
||||
super.delete(msgInner);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.msg.web;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.msg.entity.MsgInner;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.service.MsgInnerService;
|
||||
|
||||
/**
|
||||
* 内部消息Controller
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/msg/msgInner")
|
||||
public class MsgInnerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MsgInnerService msgInnerService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public MsgInner get(String id, boolean isNewRecord) {
|
||||
return msgInnerService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(MsgInner msgInner, Model model) {
|
||||
model.addAttribute("msgInner", msgInner);
|
||||
return "modules/msg/msgInnerList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<MsgInner> listData(MsgInner msgInner, HttpServletRequest request, HttpServletResponse response) {
|
||||
msgInner.setPage(new Page<>(request, response));
|
||||
msgInner.setRecord(new MsgInnerRecord());
|
||||
msgInner.getRecord().setReceiveUserCode(msgInner.getCurrentUser().getUserCode());
|
||||
Page<MsgInner> page = msgInnerService.findPage(msgInner);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(MsgInner msgInner, Model model) {
|
||||
if (StringUtils.isBlank(msgInner.getNotifyTypes())){
|
||||
msgInner.setNotifyTypes(MsgPush.TYPE_PC);
|
||||
}
|
||||
if (StringUtils.isBlank(msgInner.getContentLevel())){
|
||||
msgInner.setContentLevel(MsgInner.CONTENT_LEVEL_1);
|
||||
}
|
||||
if (StringUtils.isBlank(msgInner.getReceiveType())){
|
||||
msgInner.setReceiveType(MsgInner.RECEIVE_TYPE_USER);
|
||||
}
|
||||
model.addAttribute("msgInner", msgInner);
|
||||
return "modules/msg/msgInnerForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:view")
|
||||
@RequestMapping(value = "view")
|
||||
public String view(MsgInner msgInner, Model model) {
|
||||
model.addAttribute("msgInner", msgInner);
|
||||
// 根据消息编号和接受者用户名读取内部消息
|
||||
msgInnerService.readMsgInnerRecord(msgInner);
|
||||
// 查询已读和未读用户列表数据
|
||||
MsgInnerRecord msgInnerRecord = new MsgInnerRecord();
|
||||
msgInnerRecord.setMsgInnerId(msgInner.getId());
|
||||
msgInnerRecord.setReadStatus(MsgInnerRecord.READ_STATUS_READ);
|
||||
model.addAttribute("readList", msgInnerService.findRecordList(msgInnerRecord));
|
||||
msgInnerRecord.setReadStatus(MsgInnerRecord.READ_STATUS_UNREAD);
|
||||
model.addAttribute("unReadList", msgInnerService.findRecordList(msgInnerRecord));
|
||||
return "modules/msg/msgInnerView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存消息
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated MsgInner msgInner, HttpServletRequest request) {
|
||||
MsgInner old = super.getWebDataBinderSource(request);
|
||||
if (old != null && MsgInner.STATUS_NORMAL.equals(old.getStatus())){
|
||||
return renderResult(Global.FALSE, "数据已发布,不允许修改!");
|
||||
}
|
||||
msgInnerService.save(msgInner);
|
||||
return renderResult(Global.TRUE, text("保存消息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*/
|
||||
@RequiresPermissions("msg:msgInner:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(MsgInner msgInner, HttpServletRequest request) {
|
||||
MsgInner old = super.getWebDataBinderSource(request);
|
||||
if (old != null && MsgInner.STATUS_NORMAL.equals(old.getStatus())){
|
||||
return renderResult(Global.FALSE, "数据已发布,不允许删除!");
|
||||
}
|
||||
msgInnerService.delete(msgInner);
|
||||
return renderResult(Global.TRUE, text("删除消息成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.datasource.DataSourceHolder;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
@@ -16,4 +18,24 @@ import com.jeesite.modules.sys.entity.EmpUser;
|
||||
@MyBatisDao(dataSourceName=DataSourceHolder.DEFAULT)
|
||||
public interface EmpUserDao extends CrudDao<EmpUser> {
|
||||
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserList(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -68,7 +68,9 @@ import com.jeesite.common.utils.excel.fieldtype.OfficeType;
|
||||
public class EmpUser extends User {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String[] codes; // 查询用
|
||||
|
||||
public EmpUser() {
|
||||
this(null);
|
||||
}
|
||||
@@ -103,5 +105,13 @@ public class EmpUser extends User {
|
||||
public void setEmployee(Employee employee){
|
||||
super.setRefObj(employee);
|
||||
}
|
||||
|
||||
public String[] getCodes() {
|
||||
return codes;
|
||||
}
|
||||
|
||||
public void setCodes(String[] codes) {
|
||||
this.codes = codes;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
@Column(name="post_name", attrName="postName", label="岗位名称"),
|
||||
@Column(name="post_type", attrName="postType", label="岗位分类", comment="岗位分类(高管、中层、基层)"),
|
||||
@Column(name="post_sort", attrName="postSort", label="岗位排序", comment="岗位排序(升序)"),
|
||||
}, orderBy="a.update_date DESC"
|
||||
}, orderBy="a.post_sort ASC"
|
||||
)
|
||||
public class Post extends DataEntity<Post> {
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -35,6 +37,26 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
|
||||
*/
|
||||
@Override
|
||||
public Page<EmpUser> findPage(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserList(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 保存用户员工
|
||||
|
||||
@@ -74,6 +74,34 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
return super.findPage(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserList(EmpUser empUser){
|
||||
return dao.findUserList(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){
|
||||
return dao.findUserListByOfficeCodes(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser){
|
||||
return dao.findUserListByRoleCodes(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser){
|
||||
return dao.findUserListByPostCodes(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存用户员工
|
||||
*/
|
||||
|
||||
@@ -252,10 +252,10 @@ public class LoginController extends BaseController{
|
||||
}
|
||||
}
|
||||
|
||||
// 获取登录成功页面
|
||||
String successUrl = Global.getProperty("shiro.successUrl");
|
||||
if (!StringUtils.contains(successUrl, "://")){
|
||||
successUrl = request.getContextPath() + successUrl;
|
||||
// 获取登录成功后跳转的页面
|
||||
String successUrl = request.getParameter("__url");
|
||||
if (StringUtils.isBlank(successUrl)){
|
||||
successUrl = Global.getProperty("shiro.successUrl");
|
||||
}
|
||||
|
||||
// 登录操作如果是Ajax操作,直接返回登录信息字符串。
|
||||
@@ -268,6 +268,9 @@ public class LoginController extends BaseController{
|
||||
model.addAttribute("message", text("sys.login.getInfo"));
|
||||
}
|
||||
model.addAttribute("sessionid", (String)session.getId());
|
||||
if (!StringUtils.contains(successUrl, "://")){
|
||||
successUrl = request.getContextPath() + successUrl;
|
||||
}
|
||||
model.addAttribute("__url", successUrl); // 告诉浏览器登录后跳转的页面
|
||||
return ServletUtils.renderObject(response, model);
|
||||
}
|
||||
@@ -301,6 +304,11 @@ public class LoginController extends BaseController{
|
||||
return null;
|
||||
}
|
||||
|
||||
// 非无类型用户,自动根据用户类型设置默认菜单的归属系统(个性化示例)
|
||||
//if (!User.USER_TYPE_NONE.equals(user.getUserType())){
|
||||
// session.setAttribute("sysCode", user.getUserType());
|
||||
//}
|
||||
|
||||
// 返回指定用户类型的首页视图
|
||||
String view = UserUtils.getUserTypeValue(user.getUserType(), "indexView");
|
||||
if(StringUtils.isNotBlank(view)){
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -17,8 +20,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Post;
|
||||
import com.jeesite.modules.sys.service.PostService;
|
||||
@@ -122,5 +128,29 @@ public class PostController extends BaseController {
|
||||
}
|
||||
return Global.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位树结构数据
|
||||
* @param isAll 是否显示所有机构(true:不进行权限过滤)
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData(String userType, String isShowCode, String ctrlPermi) {
|
||||
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||
Post where = new Post();
|
||||
where.setStatus(Post.STATUS_NORMAL);
|
||||
List<Post> list = postService.findList(where);
|
||||
list.forEach(e -> {
|
||||
Map<String, Object> map = MapUtils.newHashMap();
|
||||
map.put("id", e.getId());
|
||||
map.put("pId", "0");
|
||||
map.put("name", StringUtils.getTreeNodeName(isShowCode, e.getPostCode(), e.getPostName()));
|
||||
mapList.add(map);
|
||||
});
|
||||
return mapList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,6 +47,8 @@ jdbc:
|
||||
# JTA 分布式事务(v4.0.4+)
|
||||
jta:
|
||||
enabled: false
|
||||
# 事务超时时间,单位毫秒(3分钟)
|
||||
transactionTimeout: 180000
|
||||
|
||||
# 表名前缀
|
||||
tablePrefix: js_
|
||||
@@ -498,7 +500,14 @@ file:
|
||||
# application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,
|
||||
# application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
|
||||
# application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
|
||||
|
||||
# 是否开启分片上传
|
||||
chunked: false
|
||||
# 分片大小,单位字节(10M)
|
||||
chunkSize: 10485760
|
||||
# 最大上传线程数
|
||||
threads: 1
|
||||
|
||||
# 是否用文件流方式下载(支持断点续传)
|
||||
isFileStreamDown: true
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
-- 删除sys_file_entity表的file_md5唯一索引
|
||||
-- ALTER TABLE [${_prefix}sys_file_entity] DROP CONSTRAINT [UQ__${_prefix}sys_f__3BD63C9E32E0915F];
|
||||
|
||||
-- 增加文件信息字段(可存储图片大小)
|
||||
ALTER TABLE [${_prefix}sys_file_entity] ADD [file_meta] varchar(64) NULL;
|
||||
|
||||
-- 集群的实例名字
|
||||
ALTER TABLE [${_prefix}sys_job] ADD [instance_name] varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL;
|
||||
|
||||
-- 内部消息菜单
|
||||
INSERT INTO ${_prefix}sys_menu(menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1105443204287991808', '0', '0,', 9030, '0000009030,', '1', 0, '站内消息', '站内消息', '1', '/msg/msgInner/list', '', 'icon-speech', '', 'msg:msgInner', 40, '1', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 内部消息新增字典数据
|
||||
INSERT INTO ${_prefix}sys_dict_type(id, dict_name, dict_type, is_sys, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1105440848414543872', '消息状态', 'msg_inner_msg_status', '0', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
INSERT INTO ${_prefix}sys_dict_data(dict_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, dict_label, dict_value, dict_type, is_sys, description, css_style, css_class, status, create_by, create_date, update_by, update_date, remarks, corp_code, corp_name, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1106135527342673920', '0', '0,', 20, '0000000020,', '1', 0, '全部', '全部', '0', 'msg_inner_receiver_type', '1', '', '', '', '0', 'system', getdate(), 'system', getdate(), '', '0', 'JeeSite', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 取消内部消息部分字段必填选项
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [receive_codes] text NULL;
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [receive_names] text NULL;
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [send_user_code] varchar(64) NULL;
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [send_user_name] varchar(100) NULL;
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [send_date] datetime NULL;
|
||||
ALTER TABLE [${_prefix}sys_msg_inner] ALTER COLUMN [notify_types] varchar(100) NULL;
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
-- 删除sys_file_entity表的file_md5唯一索引
|
||||
ALTER TABLE `${_prefix}sys_file_entity`
|
||||
DROP INDEX `file_md5`,
|
||||
ADD INDEX `file_md5`(`file_md5`);
|
||||
|
||||
-- 增加文件信息字段(可存储图片大小)
|
||||
ALTER TABLE `${_prefix}sys_file_entity`
|
||||
ADD COLUMN `file_meta` varchar(255) NULL COMMENT '文件信息(JSON格式)' AFTER `file_size`;
|
||||
|
||||
-- 集群的实例名字
|
||||
ALTER TABLE `${_prefix}sys_job`
|
||||
ADD COLUMN `instance_name` varchar(64) NOT NULL DEFAULT 'JeeSiteScheduler' COMMENT '集群的实例名字' AFTER `concurrent`;
|
||||
|
||||
-- 内部消息菜单
|
||||
INSERT INTO `${_prefix}sys_menu`(`menu_code`, `parent_code`, `parent_codes`, `tree_sort`, `tree_sorts`, `tree_leaf`, `tree_level`, `tree_names`, `menu_name`, `menu_type`, `menu_href`, `menu_target`, `menu_icon`, `menu_color`, `permission`, `weight`, `is_show`, `sys_code`, `module_codes`, `status`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `extend_s1`, `extend_s2`, `extend_s3`, `extend_s4`, `extend_s5`, `extend_s6`, `extend_s7`, `extend_s8`, `extend_i1`, `extend_i2`, `extend_i3`, `extend_i4`, `extend_f1`, `extend_f2`, `extend_f3`, `extend_f4`, `extend_d1`, `extend_d2`, `extend_d3`, `extend_d4`)
|
||||
VALUES ('1105443204287991808', '0', '0,', 9030, '0000009030,', '1', 0, '站内消息', '站内消息', '1', '/msg/msgInner/list', '', 'icon-speech', '', 'msg:msgInner', 40, '1', 'default', 'core', '0', 'system', now(), 'system', now(), '', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 内部消息新增字典数据
|
||||
INSERT INTO `${_prefix}sys_dict_type`(`id`, `dict_name`, `dict_type`, `is_sys`, `status`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`)
|
||||
VALUES ('1105440848414543872', '消息状态', 'msg_inner_msg_status', '0', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO `${_prefix}sys_dict_data`(`dict_code`, `parent_code`, `parent_codes`, `tree_sort`, `tree_sorts`, `tree_leaf`, `tree_level`, `tree_names`, `dict_label`, `dict_value`, `dict_type`, `is_sys`, `description`, `css_style`, `css_class`, `status`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `corp_code`, `corp_name`, `extend_s1`, `extend_s2`, `extend_s3`, `extend_s4`, `extend_s5`, `extend_s6`, `extend_s7`, `extend_s8`, `extend_i1`, `extend_i2`, `extend_i3`, `extend_i4`, `extend_f1`, `extend_f2`, `extend_f3`, `extend_f4`, `extend_d1`, `extend_d2`, `extend_d3`, `extend_d4`)
|
||||
VALUES ('1106135527342673920', '0', '0,', 20, '0000000020,', '1', 0, '全部', '全部', '0', 'msg_inner_receiver_type', '1', '', '', '', '0', 'system', now(), 'system', now(), '', '0', 'JeeSite', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 取消内部消息部分字段必填选项
|
||||
ALTER TABLE `${_prefix}sys_msg_inner`
|
||||
MODIFY COLUMN `receive_codes` text NULL COMMENT '接受者字符串' AFTER `receive_type`,
|
||||
MODIFY COLUMN `receive_names` text NULL COMMENT '接受者名称字符串' AFTER `receive_codes`,
|
||||
MODIFY COLUMN `send_user_code` varchar(64) NULL COMMENT '发送者用户编码' AFTER `receive_names`,
|
||||
MODIFY COLUMN `send_user_name` varchar(100) NULL COMMENT '发送者用户姓名' AFTER `send_user_code`,
|
||||
MODIFY COLUMN `send_date` datetime(0) NULL COMMENT '发送时间' AFTER `send_user_name`,
|
||||
MODIFY COLUMN `notify_types` varchar(100) NULL COMMENT '通知类型(PC APP 短信 邮件 微信)多选' AFTER `is_attac`;
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
-- 删除sys_file_entity表的file_md5唯一索引
|
||||
-- ALTER TABLE ${_prefix}SYS_FILE_ENTITY DROP CONSTRAINT SYS_C0019398
|
||||
|
||||
-- 增加文件信息字段(可存储图片大小)
|
||||
ALTER TABLE ${_prefix}SYS_FILE_ENTITY
|
||||
ADD (file_meta VARCHAR2(64) NULL );
|
||||
COMMENT ON COLUMN ${_prefix}SYS_FILE_ENTITY.file_meta IS '文件信息(JSON格式)';
|
||||
|
||||
-- 集群的实例名字
|
||||
ALTER TABLE ${_prefix}SYS_JOB
|
||||
ADD (instance_name VARCHAR2(64) DEFAULT 'JeeSiteScheduler' NOT NULL );
|
||||
COMMENT ON COLUMN ${_prefix}SYS_JOB.instance_name IS '集群的实例名字';
|
||||
|
||||
-- 内部消息菜单
|
||||
INSERT INTO ${_prefix}sys_menu(menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1105443204287991808', '0', '0,', 9030, '0000009030,', '1', 0, '站内消息', '站内消息', '1', '/msg/msgInner/list', '', 'icon-speech', '', 'msg:msgInner', 40, '1', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 内部消息新增字典数据
|
||||
INSERT INTO ${_prefix}sys_dict_type(id, dict_name, dict_type, is_sys, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1105440848414543872', '消息状态', 'msg_inner_msg_status', '0', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
INSERT INTO ${_prefix}sys_dict_data(dict_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, dict_label, dict_value, dict_type, is_sys, description, css_style, css_class, status, create_by, create_date, update_by, update_date, remarks, corp_code, corp_name, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1106135527342673920', '0', '0,', 20, '0000000020,', '1', 0, '全部', '全部', '0', 'msg_inner_receiver_type', '1', '', '', '', '0', 'system', sysdate, 'system', sysdate, '', '0', 'JeeSite', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 取消内部消息部分字段必填选项
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (RECEIVE_CODES NULL );
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (RECEIVE_NAMES NULL );
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (SEND_USER_CODE NULL );
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (SEND_USER_NAME NULL );
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (SEND_DATE NULL );
|
||||
ALTER TABLE ${_prefix}SYS_MSG_INNER MODIFY (NOTIFY_TYPES NULL );
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
-- 删除sys_file_entity表的file_md5唯一索引
|
||||
ALTER TABLE ${_prefix}sys_file_entity
|
||||
DROP CONSTRAINT ${_prefix}sys_file_entity_file_md5_key;
|
||||
|
||||
-- 增加文件信息字段(可存储图片大小)
|
||||
ALTER TABLE ${_prefix}sys_file_entity
|
||||
ADD COLUMN file_meta varchar(255) NULL;
|
||||
COMMENT ON COLUMN ${_prefix}sys_file_entity.file_meta IS '文件信息(JSON格式)';
|
||||
|
||||
-- 集群的实例名字
|
||||
ALTER TABLE ${_prefix}sys_job
|
||||
ADD COLUMN instance_name varchar(255) NOT NULL DEFAULT 'JeeSiteScheduler';
|
||||
COMMENT ON COLUMN ${_prefix}sys_job.instance_name IS '集群的实例名字';
|
||||
|
||||
-- 内部消息菜单
|
||||
INSERT INTO ${_prefix}sys_menu(menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1105443204287991808', '0', '0,', 9030, '0000009030,', '1', 0, '站内消息', '站内消息', '1', '/msg/msgInner/list', '', 'icon-speech', '', 'msg:msgInner', 40, '1', 'default', 'core', '0', 'system', now(), 'system', now(), '', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 内部消息新增字典数据
|
||||
INSERT INTO ${_prefix}sys_dict_type(id, dict_name, dict_type, is_sys, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('1105440848414543872', '消息状态', 'msg_inner_msg_status', '0', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO ${_prefix}sys_dict_data(dict_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, dict_label, dict_value, dict_type, is_sys, description, css_style, css_class, status, create_by, create_date, update_by, update_date, remarks, corp_code, corp_name, extend_s1, extend_s2, extend_s3, extend_s4, extend_s5, extend_s6, extend_s7, extend_s8, extend_i1, extend_i2, extend_i3, extend_i4, extend_f1, extend_f2, extend_f3, extend_f4, extend_d1, extend_d2, extend_d3, extend_d4)
|
||||
VALUES ('1106135527342673920', '0', '0,', 20, '0000000020,', '1', 0, '全部', '全部', '0', 'msg_inner_receiver_type', '1', '', '', '', '0', 'system', now(), 'system', now(), '', '0', 'JeeSite', '', '', '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 取消内部消息部分字段必填选项
|
||||
ALTER TABLE ${_prefix}sys_msg_inner
|
||||
ALTER COLUMN receive_codes DROP NOT NULL,
|
||||
ALTER COLUMN receive_names DROP NOT NULL,
|
||||
ALTER COLUMN send_user_code DROP NOT NULL,
|
||||
ALTER COLUMN send_user_name DROP NOT NULL,
|
||||
ALTER COLUMN send_date DROP NOT NULL,
|
||||
ALTER COLUMN notify_types DROP NOT NULL;
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
4.1.0
|
||||
4.1.1
|
||||
4.1.2
|
||||
4.1.3
|
||||
4.1.3
|
||||
4.1.4
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# =========== 登录登出相关 ===========
|
||||
|
||||
sys.login.notLongIn=No login or login timeout.Please login again, thank you!
|
||||
@@ -59,7 +58,7 @@ sys.error.returnButton=Previous page
|
||||
|
||||
# =========== 文件上传相关 ===========
|
||||
|
||||
sys.file.uploadFileIsEmpty=This is a new file, please upload file!
|
||||
sys.file.uploadFileIsEmpty=No files to upload!
|
||||
sys.file.uploadValidNotBlank=File md5 and file name cannot be empty!
|
||||
sys.file.uploadValidImage=Can only upload images ({0})
|
||||
sys.file.uploadValidVideo=Can only upload video ({0})
|
||||
@@ -70,3 +69,4 @@ sys.file.uploadValidContent=File content format not allowed!
|
||||
sys.file.uploadSuccessSeconds=Seconds upload success , time {0}
|
||||
sys.file.uploadSuccess=Upload success {0}
|
||||
sys.file.downloadFileNotExist=File lost or non-existent!
|
||||
sys.file.chunkUploading=Uploading {0}/{1}
|
||||
|
||||
@@ -60,7 +60,7 @@ sys.error.returnButton=返回上一页
|
||||
|
||||
# =========== 文件上传相关 ===========
|
||||
|
||||
sys.file.uploadFileIsEmpty=没有找到上传的文件!
|
||||
sys.file.uploadFileIsEmpty=服务器上没有这个文件!
|
||||
sys.file.uploadValidNotBlank=文件校验码和文件名不能为空!
|
||||
sys.file.uploadValidImage=只能上传图片({0})
|
||||
sys.file.uploadValidVideo=只能上传视频({0})
|
||||
@@ -71,3 +71,4 @@ sys.file.uploadValidContent=文件内容格式不允许!
|
||||
sys.file.uploadSuccessSeconds=秒传成功,用时{0}
|
||||
sys.file.uploadSuccess=上传成功,用时{0}
|
||||
sys.file.downloadFileNotExist=文件已丢失或不存在!
|
||||
sys.file.chunkUploading=正在上传 {0}/{1}
|
||||
|
||||
@@ -103,11 +103,11 @@
|
||||
|
||||
您还未设置过密保问题,您可以根据登录密码设置新的密保问题及答案。=You have not set up the security problem, you can set up the new security problem and answer according to the login password.
|
||||
旧的密保问题及答案=Old secret questions and answers
|
||||
旧保密问题=Old secret questions
|
||||
旧保密问题答案=Old secret answers
|
||||
旧密保问题=Old secret questions
|
||||
旧密保问题答案=Old secret answers
|
||||
新的密保问题及答案=New secret questions and answers
|
||||
新保密问题=New secret questions
|
||||
新保密问题答案=New secret answers
|
||||
新密保问题=New secret questions
|
||||
新密保问题答案=New secret answers
|
||||
|
||||
# =========== 用户管理 ===========
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeesite.modules.msg.dao.MsgInnerDao">
|
||||
|
||||
<!-- 查询数据 -->
|
||||
<select id="findList" resultType="MsgInner">
|
||||
SELECT distinct ${sqlMap.column.toSql()}
|
||||
<if test="record != null and record.receiveUserCode != null and record.receiveUserCode != ''">,
|
||||
r.read_status AS "record.readStatus",
|
||||
r.read_date AS "record.readDate",
|
||||
r.is_star AS "record.isStar"
|
||||
</if>
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<if test="record != null and record.receiveUserCode != null and record.receiveUserCode != ''">
|
||||
LEFT JOIN ${_prefix}sys_msg_inner_record r ON r.msg_inner_id = a.id
|
||||
AND r.receive_user_code = #{record.receiveUserCode}
|
||||
</if>
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
<if test="record != null and record.receiveUserCode != null and record.receiveUserCode != ''">
|
||||
AND ((a.status = #{STATUS_NORMAL} AND r.receive_user_code = #{record.receiveUserCode})
|
||||
OR a.create_by = #{currentUser.userCode})
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeesite.modules.msg.dao.MsgInnerRecordDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="MsgInnerRecord">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
|
||||
<update id="updateReadStatus">
|
||||
UPDATE ${_prefix}sys_msg_inner_record SET
|
||||
read_status = #{readStatus},
|
||||
read_date = #{readDate}
|
||||
WHERE msg_inner_id = #{msgInnerId}
|
||||
AND receive_user_code = #{receiveUserCode}
|
||||
AND read_date is null
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -24,4 +24,81 @@
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select>
|
||||
|
||||
<sql id="userColumns">
|
||||
a.user_code as "userCode",
|
||||
a.user_name as "userName"
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部用户,仅返回基本信息 -->
|
||||
<select id="findUserList" resultType="EmpUser">
|
||||
SELECT
|
||||
<include refid="userColumns"/>
|
||||
FROM ${_prefix}sys_user a
|
||||
WHERE a.status = #{STATUS_NORMAL}
|
||||
AND a.user_type = #{USER_TYPE_EMPLOYEE}
|
||||
<if test="global.useCorpModel">
|
||||
AND a.corp_code = #{corpCode}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据部门编码查询用户,仅返回基本信息 -->
|
||||
<select id="findUserListByOfficeCodes" resultType="EmpUser">
|
||||
SELECT
|
||||
<include refid="userColumns"/>
|
||||
FROM ${_prefix}sys_user a
|
||||
JOIN ${_prefix}sys_employee e ON e.emp_code = a.ref_code
|
||||
JOIN ${_prefix}sys_office o ON o.office_code = e.office_code
|
||||
WHERE a.status = #{STATUS_NORMAL}
|
||||
AND a.user_type = #{USER_TYPE_EMPLOYEE}
|
||||
<if test="global.useCorpModel">
|
||||
AND a.corp_code = #{corpCode}
|
||||
</if>
|
||||
AND e.status = #{STATUS_NORMAL}
|
||||
AND o.status = #{STATUS_NORMAL}
|
||||
AND o.office_code IN
|
||||
<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 根据角色编码查询用户,仅返回基本信息 -->
|
||||
<select id="findUserListByRoleCodes" resultType="EmpUser">
|
||||
SELECT
|
||||
<include refid="userColumns"/>
|
||||
FROM ${_prefix}sys_user a
|
||||
JOIN ${_prefix}sys_user_role ur ON ur.user_code = a.user_code
|
||||
JOIN ${_prefix}sys_role r ON r.role_code = ur.role_code
|
||||
WHERE a.status = #{STATUS_NORMAL}
|
||||
AND a.user_type = #{USER_TYPE_EMPLOYEE}
|
||||
<if test="global.useCorpModel">
|
||||
AND a.corp_code = #{corpCode}
|
||||
</if>
|
||||
AND r.status = #{STATUS_NORMAL}
|
||||
AND r.role_code IN
|
||||
<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 根据岗位编码查询用户,仅返回基本信息 -->
|
||||
<select id="findUserListByPostCodes" resultType="EmpUser">
|
||||
SELECT
|
||||
<include refid="userColumns"/>
|
||||
FROM ${_prefix}sys_user a
|
||||
JOIN ${_prefix}sys_employee e ON e.emp_code = a.ref_code
|
||||
JOIN ${_prefix}sys_employee_post ep ON ep.emp_code = e.emp_code
|
||||
JOIN ${_prefix}sys_post p ON p.post_code = ep.post_code
|
||||
WHERE a.status = #{STATUS_NORMAL}
|
||||
AND a.user_type = #{USER_TYPE_EMPLOYEE}
|
||||
<if test="global.useCorpModel">
|
||||
AND a.corp_code = #{corpCode}
|
||||
</if>
|
||||
AND e.status = #{STATUS_NORMAL}
|
||||
AND p.status = #{STATUS_NORMAL}
|
||||
AND p.post_code IN
|
||||
<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -37,6 +37,9 @@
|
||||
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
|
||||
<setting name="jdbcTypeForNull" value="NULL"/>
|
||||
|
||||
<!-- 返回值为Map时,当返回空值字段时,仍然需要返回这个Key -->
|
||||
<setting name="callSettersOnNulls" value="true"/>
|
||||
|
||||
</settings>
|
||||
|
||||
<!-- 类型别名 -->
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
<% layout('/layouts/default.html', {title: '站内消息', libs: ['validate','fileupload','ueditor']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-speech"></i> ${text(msgInner.isNewRecord ? '发送消息' : '编辑消息')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<#form:form id="inputForm" model="${msgInner}" action="${ctx}/msg/msgInner/save" method="post" class="form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="form-unit">${text('基本信息')}</div>
|
||||
<#form:hidden path="id"/>
|
||||
<#form:hidden path="status"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required ">*</span> ${text('标题')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:input path="msgTitle" maxlength="200" class="form-control required text-ruler"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required ">*</span> ${text('等级')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:radio path="contentLevel" dictType="msg_inner_content_level" class="form-control required" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('类型')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:radio path="contentType" dictType="msg_inner_content_type" blankOption="true" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required ">*</span> ${text('内容')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:ueditor path="msgContent" rows="4" class="form-control required" simpleToolbars="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">${text('附件')}:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadFile" bizKey="${msgInner.id}" bizType="msgInner_file"
|
||||
uploadType="all" class="" readonly="false"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-unit">${text('接受者信息')}</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required ">*</span> ${text('接受者')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:radio path="receiveType" dictType="msg_inner_receiver_type" class="form-control required" />
|
||||
<#form:treeselect id="receive" title="${text('接受者选择')}"
|
||||
path="receiveCodes" labelPath="receiveNames"
|
||||
url="${ctx}/sys/office/treeData?isLoadUser=true"
|
||||
class=" required" allowClear="true" checkbox="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required ">*</span> ${text('通知')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:checkbox path="notifyTypes" dictType="sys_msg_type" class="form-control required" />
|
||||
<% if(__info_type == '0'){ %>(专业版功能)<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if(!msgInner.isNewRecord){ %>
|
||||
<div class="form-unit">${text('发送者信息')}</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('发送者')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="sendUserName" readonly="true" maxlength="100" class="form-control required"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('发送时间')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="sendDate" dataFormat="datetime" readonly="true" maxlength="20" class="form-control required"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<% if (hasPermi('msg:msgInner:edit')){ %>
|
||||
<% if (msgInner.status == null || msgInner.status == '9'){ %>
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit" onclick="$('#status').val(9)"><i class="fa fa-save"></i> ${text('保存草稿')}</button>
|
||||
<button type="submit" class="btn btn-sm btn-info" id="btnRelease" onclick="$('#status').val(0)"><i class="fa fa-send"></i> ${text('发布消息')}</button>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#form:form>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
$('#receiveType input').on('ifCreated ifChecked', function(event){
|
||||
if ($(this).is(':checked')){
|
||||
var url, val = $(this).val(); // 接受者类型(1用户 2部门 3角色 4岗位)
|
||||
if (val == '0'){
|
||||
$('#receiveDiv').hide();
|
||||
$('#receiveName').removeClass('required');
|
||||
}else{
|
||||
$('#receiveDiv').show();
|
||||
$('#receiveName').addClass('required');
|
||||
if (val == '1'){
|
||||
url = '${ctx}/sys/office/treeData?isLoadUser=true&isAll=true';
|
||||
}else if (val == '2'){
|
||||
url = '${ctx}/sys/office/treeData?isAll=true';
|
||||
}else if (val == '3'){
|
||||
url = '${ctx}/sys/role/treeData?isAll=true';
|
||||
}else if (val == '4'){
|
||||
url = '${ctx}/sys/post/treeData?isAll=true';
|
||||
}
|
||||
$('#receiveDiv').attr('data-url', url);
|
||||
}
|
||||
if (event.type != 'ifCreated'){
|
||||
$('#receiveCode,#receiveName').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#inputForm").validate({
|
||||
submitHandler: function(form){
|
||||
js.ajaxSubmitForm($(form), function(data){
|
||||
js.showMessage(data.message);
|
||||
if(data.result == Global.TRUE){
|
||||
js.closeCurrentTabPage(function(contentWindow){
|
||||
contentWindow.page();
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,107 @@
|
||||
<% layout('/layouts/default.html', {title: '站内消息', libs: ['dataGrid']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-speech"></i> ${text('站内消息')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||
<% if(hasPermi('msg:msgInner:edit')){ %>
|
||||
<a href="${ctx}/msg/msgInner/form" class="btn btn-default btnTool" title="${text('新增')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${msgInner}" action="${ctx}/msg/msgInner/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('标题')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="msgTitle" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('级别')}:</label>
|
||||
<div class="control-inline width-60">
|
||||
<#form:select path="contentLevel" dictType="msg_inner_content_level" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('类型')}:</label>
|
||||
<div class="control-inline width-60">
|
||||
<#form:select path="contentType" dictType="msg_inner_content_type" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('发送时间')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="sendDate_gte" readonly="true" maxlength="20" class="form-control Wdate-date"
|
||||
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false,onpicked:function(){sendDate_lte.click()}});"/>
|
||||
--
|
||||
<#form:input path="sendDate_lte" readonly="true" maxlength="20" class="form-control Wdate-date"
|
||||
dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('状态')}:</label>
|
||||
<div class="control-inline width-60">
|
||||
<#form:select path="status" dictType="msg_inner_msg_status" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
// 初始化DataGrid对象
|
||||
$('#dataGrid').dataGrid({
|
||||
searchForm: $("#searchForm"),
|
||||
columnModel: [
|
||||
{header:'${text("标题")}', name:'msgTitle', index:'a.msg_title', width:280, align:"left", frozen:true, formatter: function(val, obj, row, act){
|
||||
if(row.status == Global.STATUS_DRAFT){
|
||||
return '<a href="${ctx}/msg/msgInner/form?id='+row.id+'" class="btnList" data-title="${text("编辑消息")}">'
|
||||
+(val||row.id)+'</a>'+(row.isAttac==1?' <i class="fa fa-paperclip"></i>':'');
|
||||
}else{
|
||||
return '<a href="${ctx}/msg/msgInner/view?id='+row.id+'" class="btnList" data-title="${text("查看消息")}">'
|
||||
+(val||row.id)+'</a>'+(row.isAttac==1?' <i class="fa fa-paperclip"></i>':'');
|
||||
}
|
||||
}},
|
||||
{header:'${text("等级")}', name:'contentLevel', index:'a.content_level', width:80, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('msg_inner_content_level')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("类型")}', name:'contentType', index:'a.content_type', width:80, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('msg_inner_content_type')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("发送者")}', name:'sendUserName', index:'a.send_user_name', width:100, align:"center"},
|
||||
{header:'${text("发送时间")}', name:'sendDate', index:'a.send_date', width:150, align:"center"},
|
||||
// {header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
|
||||
{header:'${text("状态")}', name:'status', index:'a.status', width:80, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('msg_inner_msg_status')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
if(row.status == Global.STATUS_DRAFT){
|
||||
<% if(hasPermi('msg:msgInner:edit')){ %>
|
||||
actions.push('<a href="${ctx}/msg/msgInner/form?id='+row.id+'" class="btnList" title="${text("编辑消息")}"><i class="fa fa-pencil"></i></a> ');
|
||||
actions.push('<a href="${ctx}/msg/msgInner/delete?id='+row.id+'" class="btnList" title="${text("删除消息")}" data-confirm="${text("确认要删除该消息吗?")}"><i class="fa fa-trash-o"></i></a> ');
|
||||
<% } %>
|
||||
}else{
|
||||
actions.push('<a href="${ctx}/msg/msgInner/view?id='+row.id+'" class="btnList" title="${text("查看消息")}"><i class="fa fa-book"></i></a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,50 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. */ %>
|
||||
<% layout('/layouts/default.html', {title: '查看消息', libs: ['validate','fileupload']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border hide">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-envelope-letter"></i> ${text('查看消息')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body article-view">
|
||||
<h2 class="article-title">${msgInner.msgTitle}</h2>
|
||||
<div class="content-text">
|
||||
<!-- <blockquote>摘要:</blockquote> -->
|
||||
${msgInner.msgContent}
|
||||
<% if(msgInner.isAttac == @Global.YES){ %>
|
||||
<div class="form-group pt20">
|
||||
<#form:fileupload id="uploadFile" bizKey="${msgInner.id}" bizType="msgInner_file"
|
||||
uploadType="all" class="" readonly="true" preview="weboffice"/>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<ul class="content-info">
|
||||
<li><i class="fa fa-user"></i> 发送者:${msgInner.sendUserName}</li>
|
||||
<li><i class="fa fa-calendar"></i> 发送时间:${msgInner.sendDate, 'yyyy-MM-dd HH:mm'}</li>
|
||||
<li><i class="fa icon-envelope-letter"></i> 读取时间:${msgInner.sendDate, 'yyyy-MM-dd HH:mm'}</li>
|
||||
<li><i class="fa fa-bookmark-o"></i> 等级:${@DictUtils.getDictLabel('msg_inner_content_level', msgInner.contentLevel, '普通')}</li>
|
||||
<li><i class="fa fa-bookmark-o"></i> 类型:${@DictUtils.getDictLabel('msg_inner_content_type', msgInner.contentType, '其它')}</li>
|
||||
</ul>
|
||||
<% if (readList! != null && readList.~size > 0){ %>
|
||||
<div class="content-info">已读用户:<% for (e in readList){ %>
|
||||
<span class="label bg-green" title="${e.readDate,dateFormat='yyyy-MM-dd HH:mm:ss'}" data-code="${e.receiveUserName}">${e.receiveUserName}</span><% } %>
|
||||
</div><% } %>
|
||||
<% if (unReadList! != null && unReadList.~size > 0){ %>
|
||||
<div class="content-info">未读用户:<% for (e in unReadList){ %>
|
||||
<span class="label bg-yellow" data-code="${e.receiveUserName}">${e.receiveUserName}</span><% } %>
|
||||
</div><% } %>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -29,6 +29,7 @@
|
||||
<script>
|
||||
// 初始化布局
|
||||
$('body').layout({
|
||||
west__initClosed: false, // 是否默认关闭
|
||||
west__size: 180
|
||||
});
|
||||
// 主页框架
|
||||
@@ -37,7 +38,7 @@ var win = $("#mainFrame")[0].contentWindow;
|
||||
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
|
||||
callback:{onClick:function(event, treeId, treeNode){
|
||||
tree.expandNode(treeNode);
|
||||
win.$('input[type=reset]').click();
|
||||
win.$('button[type=reset]').click();
|
||||
win.$('#officeCode').val(treeNode.id);
|
||||
win.$('#officeName').val(treeNode.name);
|
||||
win.page();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if(@Global.getConfigToBoolean('user.useCorpModel', 'false') && user.superAdmin){ %>
|
||||
<li>
|
||||
<a href="javascript:" id="switchCorp">
|
||||
<i class="fa icon-home"></i> 当前租户:(${session.corpCode}) ${session.corpName}
|
||||
<i class="fa icon-home"></i> ${text('当前租户')}:(${session.corpCode}) ${session.corpName}
|
||||
</a>
|
||||
<div class="hide"><#form:treeselect id="switchCorpSelect" title="${text('租户切换')}" allowClear="false"
|
||||
url="${ctx}/sys/corpAdmin/treeData?isShowCode=true" callbackFuncName="switchCorpSelectCallback"/>
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="__url" value="${parameter.__url!}">
|
||||
<button type="submit" class="btn btn-primary btn-block btn-flat"
|
||||
id="btnSubmit" data-loading="${text('登录验证成功,正在进入...')}"
|
||||
data-login-valid="${text('正在验证登录,请稍后...')}">${text('立即登录')}</button>
|
||||
|
||||
Reference in New Issue
Block a user