2.1.3 大屏版本发布

This commit is contained in:
zhangdaihao
2019-12-25 13:14:08 +08:00
parent a85f3688b6
commit 131cdc87c9
183 changed files with 52336 additions and 202 deletions

View File

@ -12,4 +12,13 @@ public interface CommonSendStatus {
public static final String PUBLISHED_STATUS_1 = "1"; //已发布
public static final String REVOKE_STATUS_2 = "2"; //撤销
/**流程催办——系统通知消息模板*/
public static final String TZMB_BPM_CUIBAN = "bpm_cuiban";
/**标准模板—系统消息通知*/
public static final String TZMB_SYS_TS_NOTE = "sys_ts_note";
/**流程超时提醒——系统通知消息模板*/
public static final String TZMB_BPM_CHAOSHI_TIP = "bpm_chaoshi_tip";
}

View File

@ -64,9 +64,22 @@ public class JeecgBootExceptionHandler {
* @return
*/
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public Result<?> HttpRequestMethodNotSupportedException(Exception e){
log.error(e.getMessage(), e);
return Result.error("没有权限,请联系管理员授权");
public Result<?> HttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e){
StringBuffer sb = new StringBuffer();
sb.append("不支持");
sb.append(e.getMethod());
sb.append("请求方法,");
sb.append("支持以下");
String [] methods = e.getSupportedMethods();
if(methods!=null){
for(String str:methods){
sb.append(str);
sb.append("");
}
}
log.error(sb.toString(), e);
//return Result.error("没有权限,请联系管理员授权");
return Result.error(405,sb.toString());
}
/**

View File

@ -10,6 +10,11 @@ import com.alibaba.fastjson.JSONObject;
*/
public interface IFillRuleHandler {
/**
* @param params 页面配置固定参数
* @param formData 动态表单参数
* @return
*/
public Object execute(JSONObject params, JSONObject formData);
}

View File

@ -2,6 +2,7 @@ package org.jeecg.common.system.api;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.jeecg.common.system.vo.ComboModel;
import org.jeecg.common.system.vo.DictModel;
@ -99,7 +100,37 @@ public interface ISysBaseAPI {
* @param msgContent 消息内容
*/
public void sendSysAnnouncement(String fromUser,String toUser,String title, String msgContent);
/**
* 发送系统消息
* @param fromUser 发送人(用户登录账户)
* @param toUser 发送给(用户登录账户)
* @param title 通知标题
* @param map 模板参数
* @param templateCode 模板编码
*/
public void sendSysAnnouncement(String fromUser, String toUser,String title, Map<String, String> map, String templateCode);
/**
* 通过消息中心模板,生成推送内容
*
* @param templateCode 模板编码
* @param map 模板参数
* @return
*/
public String parseTemplateByCode(String templateCode, Map<String, String> map);
/**
* 发送系统消息
* @param fromUser 发送人(用户登录账户)
* @param toUser 发送给(用户登录账户)
* @param title 消息主题
* @param msgContent 消息内容
* @param setMsgCategory 消息类型 1:消息2:系统消息
*/
public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory);
/**
* 查询表字典 支持过滤数据
* @param table

View File

@ -23,6 +23,13 @@ public enum MatchTypeEnum {
return value;
}
public static MatchTypeEnum getByValue(Object value) {
if (oConvertUtils.isEmpty(value)) {
return null;
}
return getByValue(value.toString());
}
public static MatchTypeEnum getByValue(String value) {
if (oConvertUtils.isEmpty(value)) {
return null;

View File

@ -17,11 +17,14 @@ import java.util.regex.Pattern;
import org.apache.commons.beanutils.PropertyUtils;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.DataBaseConstant;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.util.JeecgDataAutorUtils;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.SysPermissionDataRuleModel;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecgframework.core.util.ApplicationContextUtil;
import org.springframework.util.NumberUtils;
import com.alibaba.fastjson.JSON;
@ -31,7 +34,6 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class QueryGenerator {
public static final String SQL_RULES_COLUMN = "SQL_RULES_COLUMN";
private static final String BEGIN = "_begin";
@ -315,7 +317,7 @@ public class QueryGenerator {
}
private static void addQueryByRule(QueryWrapper<?> queryWrapper,String name,String type,String value,QueryRuleEnum rule) throws ParseException {
if(!"".equals(value)) {
if(oConvertUtils.isNotEmpty(value)) {
Object temp;
switch (type) {
case "class java.lang.Integer":
@ -380,7 +382,7 @@ public class QueryGenerator {
* @param value 查询条件值
*/
private static void addEasyQuery(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) {
if (value == null || rule == null) {
if (value == null || rule == null || oConvertUtils.isEmpty(value)) {
return;
}
name = oConvertUtils.camelToUnderline(name);
@ -590,7 +592,11 @@ public class QueryGenerator {
str = str.substring(1);
}
if(isString) {
return " '"+str+"' ";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return " N'"+str+"' ";
}else{
return " '"+str+"' ";
}
}else {
return value.toString();
}
@ -601,7 +607,11 @@ public class QueryGenerator {
String temp[] = value.toString().split(",");
String res="";
for (String string : temp) {
res+=",'"+string+"'";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
res+=",N'"+string+"'";
}else{
res+=",'"+string+"'";
}
}
return "("+res.substring(1)+")";
}else {
@ -612,16 +622,36 @@ public class QueryGenerator {
private static String getLikeConditionValue(Object value) {
String str = value.toString().trim();
if(str.startsWith("*") && str.endsWith("*")) {
return "'%"+str.substring(1,str.length()-1)+"%'";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return "N'%"+str.substring(1,str.length()-1)+"%'";
}else{
return "'%"+str.substring(1,str.length()-1)+"%'";
}
}else if(str.startsWith("*")) {
return "'%"+str.substring(1)+"'";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return "N'%"+str.substring(1)+"'";
}else{
return "'%"+str.substring(1)+"'";
}
}else if(str.endsWith("*")) {
return "'"+str.substring(0,str.length()-1)+"%'";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return "N'"+str.substring(0,str.length()-1)+"%'";
}else{
return "'"+str.substring(0,str.length()-1)+"%'";
}
}else {
if(str.indexOf("%")>=0) {
return str;
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return "N"+str;
}else{
return str;
}
}else {
return "'%"+str+"%'";
if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
return "N'%"+str+"%'";
}else{
return "'%"+str+"%'";
}
}
}
}
@ -695,5 +725,25 @@ public class QueryGenerator {
}
}
}
/** 当前系统数据库类型 */
private static String DB_TYPE;
/**
* 获取系统数据库类型
*/
private static String getDbType(){
if(oConvertUtils.isNotEmpty(DB_TYPE)){
return DB_TYPE;
}
try {
ISysBaseAPI sysBaseAPI = ApplicationContextUtil.getContext().getBean(ISysBaseAPI.class);
DB_TYPE = sysBaseAPI.getDatabaseType();
return DB_TYPE;
} catch (Exception e) {
e.printStackTrace();
}
return DB_TYPE;
}
}

View File

@ -0,0 +1,29 @@
package org.jeecg.common.util;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.util.HtmlUtils;
/**
* HTML 工具类
*/
public class HTMLUtils {
/**
* 获取HTML内的文本不包含标签
*
* @param html HTML 代码
*/
public static String getInnerText(String html) {
if (StringUtils.isNotBlank(html)) {
//去掉 html 的标签
String content = html.replaceAll("</?[^>]+>", "");
// 将多个空格合并成一个空格
content = content.replaceAll("(&nbsp;)+", "&nbsp;");
// 反向转义字符
content = HtmlUtils.htmlUnescape(content);
return content.trim();
}
return "";
}
}