diff --git a/smtweb-framework/core/pom.xml b/smtweb-framework/core/pom.xml
index 1c29d60..f277f76 100644
--- a/smtweb-framework/core/pom.xml
+++ b/smtweb-framework/core/pom.xml
@@ -85,6 +85,11 @@
commons-lang3
3.12.0
+
+ org.dom4j
+ dom4j
+ RELEASE
+
org.apache.commons
diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/Consts.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/Consts.java
new file mode 100644
index 0000000..aeb9e8f
--- /dev/null
+++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/Consts.java
@@ -0,0 +1,21 @@
+package cc.smtweb.framework.core.util;
+
+public class Consts {
+ public static final String BLANK_STRING = " ";
+ public static final String NULL_STRING = "-";
+ public static final String TREE_ROOT_ID = "-1";
+ public static final String WORD_LINE_BREAK = "" + (char) 11;
+ public static final String CLASS_ROOT_ID = "GB000";
+ public static final String PERSON_TYPE_ROOT_ID = "GP000000";
+ public final static String LEVELCODE_SEPARATOR = "-";
+ public static final String DEF_PWD = "abc@123456"; //初始密码
+ public static final String fileOperator = System.getProperty("file.separator");
+
+ public static final String TOP_PARTY_ID = "1"; //顶级机构主键
+ public static final String TOP_PARTY_DEFAULT_CODE = "10000"; //顶级单位默认机构编码,初始化后可以到系统中进行修改;
+
+ public final static String DEF_SCHEMA = "sys";//默认的数据库名
+
+ public final static String FIELD_LAST_TIME = "last_time";//最后更新时间,字段名
+ public final static String FIELD_CREATE_PARTY = "create_party_id";//创建单位,字段名
+}
diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/DateUtil.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/DateUtil.java
index 46279e1..08667bd 100644
--- a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/DateUtil.java
+++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/DateUtil.java
@@ -794,6 +794,15 @@ public class DateUtil {
if (datetime == null) return null;
return new java.sql.Date(datetime.getTime());
}
+
+ //获取当前日期所处月,却掉了前置的0.
+ public static String nowMonth() {
+ String month = nowMonth2();
+ if (month.charAt(0) == '0') {
+ return String.valueOf(month.charAt(1));
+ }
+ return month;
+ }
/**
* 将字符串转换成Java.sql.Date,不能转换,这返回null
*
@@ -911,6 +920,52 @@ public class DateUtil {
calendar.setTime(new Date());
return getSeasonBegin(calendar);
}
+ public synchronized static java.sql.Date getAfterDate(Date dt, int days) {
+ if (dt == null) return null;
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTime(dt);
+ gc.add(GregorianCalendar.DATE, days);
+ return new java.sql.Date(gc.getTimeInMillis());
+ }
+
+ //获取季度结束年月,YYYYMM格式
+ public static String getSeasonEndYm() {
+ return getDateYm(getAfterDate(getNextSeasonBegin(), -1));
+ }
+
+ //获取年度开始年月,YYYYMM格式
+ public static String getYearBeginYm() {
+ return nowYear() + "01";
+ }
+
+ public static String getYearBeginYm(String ymPeriod) {
+ try {
+ return ymPeriod.substring(0, 4) + "01";
+ } catch (Exception e) {
+ return nowYear() + "01";
+ }
+ }
+
+ /**
+ * 获取今日日期串,不带分隔符
+ *
+ * @return 今日日期字符串 yyyyMMdd;
+ */
+ public static String nowDateString() {
+ return simpleDateFormat.get().format(nowTimestamp());
+ }
+ //获取年度结束年月,YYYYMM格式
+ public static String getYearEndYm() {
+ return nowYear() + "12";
+ }
+
+ public static String getYearEndYm(String ymPeriod) {
+ try {
+ return ymPeriod.substring(0, 4) + "12";
+ } catch (Exception e) {
+ return nowYear() + "12";
+ }
+ }
/**
* 得到本季度的第一天
*
@@ -979,9 +1034,97 @@ public class DateUtil {
return getAfterDays(getAfterMonth(getMonthFirstDay(), 1), -1);
}
+ /**
+ * 得到本季度最后一天
+ *
+ * @return
+ */
+ public static String getSeasonLastDay() {
+ String s = toStdDateString(getNextSeasonBegin());
+ return getAfterDays(s, -1);
+ }
+ //下个季度开始
+ public synchronized static Date getNextSeasonBegin() {
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(new Date());
+ return getNextSeasonBegin(calendar);
+ }
+
+ public synchronized static Date getNextSeasonBegin(Calendar now) {
+ int curYear = now.get(Calendar.YEAR);
+ int curMonth = now.get(Calendar.MONTH);
+ int seasonMonth = m_seasonBeginTable[curMonth] + 3;
+
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(Calendar.YEAR, curYear);
+ calendar.set(Calendar.MONTH, seasonMonth);
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 0);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+ calendar.set(Calendar.AM_PM, Calendar.AM);
+ return new Timestamp(calendar.getTime().getTime());
+ }
+
+ //获取季度开始年月,YYYYMM格式
+ public static String getSeasonBeginYm() {
+ return getDateYm(getSeasonBegin());
+ }
+ //获取年月,YYYYMM格式
+ public static String getNowYm() {
+ return getDateYm(nowTimestamp());
+ }
+ public static String getNextYear(String year, int add) {
+ if (PubUtil.isEmptyId(year)) return year;
+ int curYear = Integer.parseInt(year) - 1;
+ return curYear + "";
+ }
+ //获取上一月,YYYYMM格式
+ public static String getPrevYear(String year) {
+ return getNextYear(year, -1);
+ }
+ //获取上一月,YYYYMM格式
+ public static String getPrevYm(String period_id) {
+ return getNextYm(period_id, -1);
+ }
+ //获取下一月,YYYYMM格式
+ public static String getNextYm(String period_id) {
+ return getNextYm(period_id, 1);
+ }
+ //获取年月,YYYYMM格式
+ public static String getPrevYm() {
+ return getPrevYm(getNowYm());
+ }
+
+ //获取上一年 YYYY格式
+ public static String getPrevYear() {
+ return getPrevYear(nowYear());
+ }
+ //获取年月,YYYYMM格式
+ public static String getNextYm() {
+ return getNextYm(getNowYm());
+ }
+ public static String getNextYm(String period_id, int add) {
+ if (PubUtil.isEmptyId(period_id)) return period_id;
+ int curYear = Integer.parseInt(period_id.substring(0, 4));
+ int curMonth = Integer.parseInt(period_id.substring(4)) + add;
+ if (curMonth > 12) {
+ do {
+ curYear++;
+ curMonth -= 12;
+ } while (curMonth > 12);
+ } else if (curMonth <= 0) {
+ do {
+ curYear--;
+ curMonth += 12;
+ } while (curMonth <= 0);
+ }
+ return curYear + StringUtil.getRight("00" + curMonth, 2);
+ }
/**
* 得到当前日期所在周次的星期一
*
diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/EmojiFilter.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/EmojiFilter.java
new file mode 100644
index 0000000..9a2782b
--- /dev/null
+++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/EmojiFilter.java
@@ -0,0 +1,73 @@
+package cc.smtweb.framework.core.util;
+
+/**
+ * @Author: zhangyulong
+ * @Date: 2021/10/13 15:16
+ */
+
+public class EmojiFilter {
+
+ /**
+ * 过滤emoji 或者 其他非文字类型的字符
+ * @param source 需要过滤的字符串
+ * @return
+ */
+ public static String filterEmoji(String source) {
+ if(PubUtil.isEmpty(source)){
+ return "";
+ }
+ if (!containsEmoji(source)) {
+ return source;
+ }
+
+ StringBuilder buf = null;
+ int len = source.length();
+ for (int i = 0; i < len; i++) {
+ char codePoint = source.charAt(i);
+ if (notisEmojiCharacter(codePoint)) {
+ if (buf == null) {
+ buf = new StringBuilder(source.length());
+ }
+ buf.append(codePoint);
+ }
+ }
+
+ if (buf == null) {
+ return "";
+ } else {
+ if (buf.length() == len) {
+ buf = null;
+ return source;
+ } else {
+ return buf.toString();
+ }
+ }
+ }
+
+ /**
+ * 检测是否有emoji字符
+ * @param source 需要判断的字符串
+ * @return 一旦含有就抛出
+ */
+ public static boolean containsEmoji(String source) {
+ int len = source.length();
+ for (int i = 0; i < len; i++) {
+ char codePoint = source.charAt(i);
+ if (!notisEmojiCharacter(codePoint)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 非emoji表情字符判断
+ * @param codePoint
+ * @return
+ */
+ public static boolean notisEmojiCharacter(char codePoint) {
+ return (codePoint == 0x0) || (codePoint == 0x9) || (codePoint == 0xA) || (codePoint == 0xD)
+ || ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD))
+ || ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF));
+ }
+}
\ No newline at end of file
diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/ListSQLParaHelper.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/ListSQLParaHelper.java
new file mode 100644
index 0000000..1a1fcd9
--- /dev/null
+++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/ListSQLParaHelper.java
@@ -0,0 +1,780 @@
+package cc.smtweb.framework.core.util;
+
+import cc.smtweb.framework.core.common.AbstractEnum;
+import cc.smtweb.framework.core.common.IntEnum;
+import cc.smtweb.framework.core.common.StrEnum;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+
+/**
+ * 注意:where参数表示是否已经加入了where关键字
+ *
+ * @author : AKzz
+ * @version : $Revision:$
+ */
+@SuppressWarnings("UnusedDeclaration")
+public abstract class ListSQLParaHelper {
+
+
+ /**
+ * 补充SQL的字符串的==条件
+ *
+ * @param where_is_exist 是否已经加入了where关键字
+ */
+ public static boolean addSql_EQUALE_Expr(boolean where_is_exist, StringBuilder sql, List