diff --git a/common/src/main/java/com/jeesite/common/codec/DesUtils.java b/common/src/main/java/com/jeesite/common/codec/DesUtils.java index af8ac279..8749cbcf 100644 --- a/common/src/main/java/com/jeesite/common/codec/DesUtils.java +++ b/common/src/main/java/com/jeesite/common/codec/DesUtils.java @@ -74,15 +74,15 @@ public class DesUtils { String encData = ""; List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; int firstLength = 0, secondLength = 0, thirdLength = 0; - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { firstKeyBt = getKeyBytes(firstKey); firstLength = firstKeyBt.size(); } - if (secondKey != null && !secondKey.equals("")) { + if (secondKey != null && !"".equals(secondKey)) { secondKeyBt = getKeyBytes(secondKey); secondLength = secondKeyBt.size(); } - if (thirdKey != null && !thirdKey.equals("")) { + if (thirdKey != null && !"".equals(thirdKey)) { thirdKeyBt = getKeyBytes(thirdKey); thirdLength = thirdKeyBt.size(); } @@ -91,7 +91,7 @@ public class DesUtils { if (leng < 4) { int[] bt = strToBt(data); int[] encByte = null; - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(firstKey)) { int[] tempBt; int x, y, z; tempBt = bt; @@ -106,7 +106,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) { int[] tempBt; int x, y; tempBt = bt; @@ -118,7 +118,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { int[] tempBt; int x = 0; tempBt = bt; @@ -138,7 +138,7 @@ public class DesUtils { String tempData = data.substring(i * 4 + 0, i * 4 + 4); int[] tempByte = strToBt(tempData); int[] encByte = null; - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) { int[] tempBt; int x, y, z; tempBt = tempByte; @@ -153,7 +153,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) { int[] tempBt; int x, y; tempBt = tempByte; @@ -165,7 +165,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { int[] tempBt; int x; tempBt = tempByte; @@ -182,7 +182,7 @@ public class DesUtils { String remainderData = data.substring(iterator * 4 + 0, leng); int[] tempByte = strToBt(remainderData); int[] encByte = null; - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) { int[] tempBt; int x, y, z; tempBt = tempByte; @@ -197,7 +197,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) { int[] tempBt; int x, y; tempBt = tempByte; @@ -209,7 +209,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { int[] tempBt; int x; tempBt = tempByte; @@ -237,15 +237,15 @@ public class DesUtils { String decStr = ""; List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; int firstLength = 0, secondLength = 0, thirdLength = 0; - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { firstKeyBt = getKeyBytes(firstKey); firstLength = firstKeyBt.size(); } - if (secondKey != null && !secondKey.equals("")) { + if (secondKey != null && !"".equals(secondKey)) { secondKeyBt = getKeyBytes(secondKey); secondLength = secondKeyBt.size(); } - if (thirdKey != null && !thirdKey.equals("")) { + if (thirdKey != null && !"".equals(thirdKey)) { thirdKeyBt = getKeyBytes(thirdKey); thirdLength = thirdKeyBt.size(); } @@ -261,7 +261,7 @@ public class DesUtils { intByte[j] = Integer.parseInt(strByte.substring(j, j + 1)); } int[] decByte = null; - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) { int[] tempBt; int x, y, z; tempBt = intByte; @@ -276,7 +276,7 @@ public class DesUtils { } decByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { + if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) { int[] tempBt; int x, y, z; tempBt = intByte; @@ -288,7 +288,7 @@ public class DesUtils { } decByte = tempBt; } else { - if (firstKey != null && !firstKey.equals("")) { + if (firstKey != null && !"".equals(firstKey)) { int[] tempBt; int x, y, z; tempBt = intByte; @@ -382,37 +382,37 @@ public class DesUtils { */ public String bt4ToHex(String binary) { String hex = ""; - if (binary.equalsIgnoreCase("0000")) { + if ("0000".equalsIgnoreCase(binary)) { hex = "0"; - } else if (binary.equalsIgnoreCase("0001")) { + } else if ("0001".equalsIgnoreCase(binary)) { hex = "1"; - } else if (binary.equalsIgnoreCase("0010")) { + } else if ("0010".equalsIgnoreCase(binary)) { hex = "2"; - } else if (binary.equalsIgnoreCase("0011")) { + } else if ("0011".equalsIgnoreCase(binary)) { hex = "3"; - } else if (binary.equalsIgnoreCase("0100")) { + } else if ("0100".equalsIgnoreCase(binary)) { hex = "4"; - } else if (binary.equalsIgnoreCase("0101")) { + } else if ("0101".equalsIgnoreCase(binary)) { hex = "5"; - } else if (binary.equalsIgnoreCase("0110")) { + } else if ("0110".equalsIgnoreCase(binary)) { hex = "6"; - } else if (binary.equalsIgnoreCase("0111")) { + } else if ("0111".equalsIgnoreCase(binary)) { hex = "7"; - } else if (binary.equalsIgnoreCase("1000")) { + } else if ("1000".equalsIgnoreCase(binary)) { hex = "8"; - } else if (binary.equalsIgnoreCase("1001")) { + } else if ("1001".equalsIgnoreCase(binary)) { hex = "9"; - } else if (binary.equalsIgnoreCase("1010")) { + } else if ("1010".equalsIgnoreCase(binary)) { hex = "A"; - } else if (binary.equalsIgnoreCase("1011")) { + } else if ("1011".equalsIgnoreCase(binary)) { hex = "B"; - } else if (binary.equalsIgnoreCase("1100")) { + } else if ("1100".equalsIgnoreCase(binary)) { hex = "C"; - } else if (binary.equalsIgnoreCase("1101")) { + } else if ("1101".equalsIgnoreCase(binary)) { hex = "D"; - } else if (binary.equalsIgnoreCase("1110")) { + } else if ("1110".equalsIgnoreCase(binary)) { hex = "E"; - } else if (binary.equalsIgnoreCase("1111")) { + } else if ("1111".equalsIgnoreCase(binary)) { hex = "F"; } @@ -426,51 +426,51 @@ public class DesUtils { */ public String hexToBt4(String hex) { String binary = ""; - if (hex.equalsIgnoreCase("0")) { + if ("0".equalsIgnoreCase(hex)) { binary = "0000"; - } else if (hex.equalsIgnoreCase("1")) { + } else if ("1".equalsIgnoreCase(hex)) { binary = "0001"; } - if (hex.equalsIgnoreCase("2")) { + if ("2".equalsIgnoreCase(hex)) { binary = "0010"; } - if (hex.equalsIgnoreCase("3")) { + if ("3".equalsIgnoreCase(hex)) { binary = "0011"; } - if (hex.equalsIgnoreCase("4")) { + if ("4".equalsIgnoreCase(hex)) { binary = "0100"; } - if (hex.equalsIgnoreCase("5")) { + if ("5".equalsIgnoreCase(hex)) { binary = "0101"; } - if (hex.equalsIgnoreCase("6")) { + if ("6".equalsIgnoreCase(hex)) { binary = "0110"; } - if (hex.equalsIgnoreCase("7")) { + if ("7".equalsIgnoreCase(hex)) { binary = "0111"; } - if (hex.equalsIgnoreCase("8")) { + if ("8".equalsIgnoreCase(hex)) { binary = "1000"; } - if (hex.equalsIgnoreCase("9")) { + if ("9".equalsIgnoreCase(hex)) { binary = "1001"; } - if (hex.equalsIgnoreCase("A")) { + if ("A".equalsIgnoreCase(hex)) { binary = "1010"; } - if (hex.equalsIgnoreCase("B")) { + if ("B".equalsIgnoreCase(hex)) { binary = "1011"; } - if (hex.equalsIgnoreCase("C")) { + if ("C".equalsIgnoreCase(hex)) { binary = "1100"; } - if (hex.equalsIgnoreCase("D")) { + if ("D".equalsIgnoreCase(hex)) { binary = "1101"; } - if (hex.equalsIgnoreCase("E")) { + if ("E".equalsIgnoreCase(hex)) { binary = "1110"; } - if (hex.equalsIgnoreCase("F")) { + if ("F".equalsIgnoreCase(hex)) { binary = "1111"; } return binary; diff --git a/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java b/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java index b21ba7d0..331cfe3f 100644 --- a/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java +++ b/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java @@ -247,7 +247,8 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils { private static ThreadLocal fstConfiguration = new NamedThreadLocal("FSTConfiguration") { - public FSTConfiguration initialValue() { + @Override + public FSTConfiguration initialValue() { return FSTConfiguration.createDefaultConfiguration(); } }; diff --git a/common/src/main/java/com/jeesite/common/lang/WorkDayUtils.java b/common/src/main/java/com/jeesite/common/lang/WorkDayUtils.java index 1a2821ba..ccc513c4 100644 --- a/common/src/main/java/com/jeesite/common/lang/WorkDayUtils.java +++ b/common/src/main/java/com/jeesite/common/lang/WorkDayUtils.java @@ -76,7 +76,7 @@ public class WorkDayUtils { * @return */ public String getChineseWeek(Calendar date) { - final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; + final String[] dayNames = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; int dayOfWeek = date.get(Calendar.DAY_OF_WEEK); // System.out.println(dayNames[dayOfWeek - 1]); return dayNames[dayOfWeek - 1]; diff --git a/common/src/main/java/com/jeesite/common/media/VideoUtils.java b/common/src/main/java/com/jeesite/common/media/VideoUtils.java index 12f48e08..944c41d3 100644 --- a/common/src/main/java/com/jeesite/common/media/VideoUtils.java +++ b/common/src/main/java/com/jeesite/common/media/VideoUtils.java @@ -170,7 +170,7 @@ public class VideoUtils { command.add(getFfmpegFile()); command.add("-i"); command.add(inputFile); - if ((imgFileExtension.toLowerCase()).equals("gif")) { + if ("gif".equals(imgFileExtension.toLowerCase())) { command.add("-vframes"); command.add("30"); command.add("-f"); diff --git a/common/src/main/java/com/jeesite/common/text/DiffMatchPatch.java b/common/src/main/java/com/jeesite/common/text/DiffMatchPatch.java index 79454b7d..f30f953f 100644 --- a/common/src/main/java/com/jeesite/common/text/DiffMatchPatch.java +++ b/common/src/main/java/com/jeesite/common/text/DiffMatchPatch.java @@ -2227,7 +2227,7 @@ public class DiffMatchPatch { if (m.group(2).length() == 0) { patch.start1--; patch.length1 = 1; - } else if (m.group(2).equals("0")) { + } else if ("0".equals(m.group(2))) { patch.length1 = 0; } else { patch.start1--; @@ -2238,7 +2238,7 @@ public class DiffMatchPatch { if (m.group(4).length() == 0) { patch.start2--; patch.length2 = 1; - } else if (m.group(4).equals("0")) { + } else if ("0".equals(m.group(4))) { patch.length2 = 0; } else { patch.start2--; diff --git a/common/src/main/java/com/jeesite/common/text/PinyinUtils.java b/common/src/main/java/com/jeesite/common/text/PinyinUtils.java index eb0938e8..6b504ef8 100644 --- a/common/src/main/java/com/jeesite/common/text/PinyinUtils.java +++ b/common/src/main/java/com/jeesite/common/text/PinyinUtils.java @@ -123,7 +123,7 @@ public class PinyinUtils { if (input == null){ return null; } - char c[] = input.toCharArray(); + char[] c = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (c[i] == ' ') { c[i] = '\u3000'; @@ -143,7 +143,7 @@ public class PinyinUtils { if (input == null){ return null; } - char c[] = input.toCharArray(); + char[] c = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (c[i] == '\u3000') { c[i] = ' '; diff --git a/common/src/main/java/com/jeesite/common/utils/IdcardUtils.java b/common/src/main/java/com/jeesite/common/utils/IdcardUtils.java index 3c15cf67..9c84fd79 100644 --- a/common/src/main/java/com/jeesite/common/utils/IdcardUtils.java +++ b/common/src/main/java/com/jeesite/common/utils/IdcardUtils.java @@ -24,17 +24,17 @@ public class IdcardUtils extends StringUtils { public static final int CHINA_ID_MAX_LENGTH = 18; /** 省、直辖市代码表 */ - public static final String cityCode[] = { "11", "12", "13", "14", "15", + public static final String[] cityCode = { "11", "12", "13", "14", "15", "21", "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", "63", "64", "65", "71", "81", "82", "91" }; /** 每位加权因子 */ - public static final int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, + public static final int[] power = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 }; /** 第18位校检码 */ - public static final String verifyCode[] = { "1", "0", "X", "9", "8", "7", + public static final String[] verifyCode = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" }; /** 最低年限 */ public static final int MIN = 1930; @@ -177,7 +177,7 @@ public class IdcardUtils extends StringUtils { } String[] cardval = validateIdCard10(card); if (cardval != null) { - if (cardval[2].equals("true")) { + if ("true".equals(cardval[2])) { return true; } } @@ -276,10 +276,10 @@ public class IdcardUtils extends StringUtils { info[0] = "台湾"; System.out.println("11111"); String char2 = idCard.substring(1, 2); - if (char2.equals("1")) { + if ("1".equals(char2)) { info[1] = "M"; System.out.println("MMMMMMM"); - } else if (char2.equals("2")) { + } else if ("2".equals(char2)) { info[1] = "F"; System.out.println("FFFFFFF"); } else { @@ -361,7 +361,7 @@ public class IdcardUtils extends StringUtils { sum = sum + Integer.valueOf(c + "") * iflag; iflag--; } - if (end.toUpperCase().equals("A")) { + if ("A".equals(end.toUpperCase())) { sum = sum + 10; } else { sum = sum + Integer.valueOf(end); diff --git a/common/src/main/java/com/jeesite/common/utils/excel/ExcelReader.java b/common/src/main/java/com/jeesite/common/utils/excel/ExcelReader.java index 47dcd25a..1d71108c 100644 --- a/common/src/main/java/com/jeesite/common/utils/excel/ExcelReader.java +++ b/common/src/main/java/com/jeesite/common/utils/excel/ExcelReader.java @@ -168,7 +168,7 @@ public abstract class ExcelReader extends DefaultHandler { // 将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符 } else if ("v".equals(name)) { String value = lastContents.trim(); - value = value.equals("") ? " " : value; + value = "".equals(value) ? " " : value; try { // 日期格式处理 if (dateFlag) { @@ -188,7 +188,7 @@ public abstract class ExcelReader extends DefaultHandler { curCol++; } else { // 如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法 - if (name.equals("row")) { + if ("row".equals(name)) { getRows(sheetIndex + 1, curRow, rowList); rowList.clear(); curRow++; diff --git a/common/src/main/java/com/jeesite/common/utils/excel/fieldtype/MoneyType.java b/common/src/main/java/com/jeesite/common/utils/excel/fieldtype/MoneyType.java index 07adf9f0..07b05f4d 100644 --- a/common/src/main/java/com/jeesite/common/utils/excel/fieldtype/MoneyType.java +++ b/common/src/main/java/com/jeesite/common/utils/excel/fieldtype/MoneyType.java @@ -23,21 +23,24 @@ public class MoneyType implements FieldType { /** * 获取对象值(导入) */ - public Object getValue(String val) { + @Override + public Object getValue(String val) { return val == null ? StringUtils.EMPTY : StringUtils.replace(val, ",", StringUtils.EMPTY); } /** * 获取对象值(导出) */ - public String setValue(Object val) { + @Override + public String setValue(Object val) { return val == null ? StringUtils.EMPTY : nf.format(val); } /** * 获取对象值格式(导出) */ - public String getDataFormat() { + @Override + public String getDataFormat() { return "0.00"; } diff --git a/common/src/main/java/com/jeesite/common/utils/word/BookMark.java b/common/src/main/java/com/jeesite/common/utils/word/BookMark.java index d46228c9..9ad23de4 100644 --- a/common/src/main/java/com/jeesite/common/utils/word/BookMark.java +++ b/common/src/main/java/com/jeesite/common/utils/word/BookMark.java @@ -464,7 +464,7 @@ public class BookMark { // Get the first node and catch it's reference for return if // the first child node is a style node (w:rPr). childNode = parentNode.getFirstChild(); - if (childNode != null && childNode.getNodeName().equals("w:rPr")) { + if (childNode != null && "w:rPr".equals(childNode.getNodeName())) { styleNode = childNode; } else { // If the first node was not a style node and there are other diff --git a/modules/core/src/main/java/com/jeesite/common/shiro/realm/AuthorizingRealm.java b/modules/core/src/main/java/com/jeesite/common/shiro/realm/AuthorizingRealm.java index 77a72693..58e458f6 100644 --- a/modules/core/src/main/java/com/jeesite/common/shiro/realm/AuthorizingRealm.java +++ b/modules/core/src/main/java/com/jeesite/common/shiro/realm/AuthorizingRealm.java @@ -72,7 +72,8 @@ public class AuthorizingRealm extends BaseAuthorizingRealm { * @param plainPassword 明文密码 * @return 16位salt密钥 + 40位hash密码 */ - public String encryptPassword(String plainPassword) { + @Override + public String encryptPassword(String plainPassword) { String plain = EncodeUtils.decodeHtml(plainPassword); byte[] salt = Sha1Utils.genSalt(SALT_SIZE); byte[] hashPassword = Sha1Utils.sha1(plain.getBytes(), salt, HASH_INTERATIONS); @@ -85,6 +86,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm { * @param password 密文密码 * @return 验证成功返回true */ + @Override public boolean validatePassword(String plainPassword, String password) { try{ String plain = EncodeUtils.decodeHtml(plainPassword); diff --git a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/AreaType.java b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/AreaType.java index a9532d50..9ba3613d 100644 --- a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/AreaType.java +++ b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/AreaType.java @@ -4,12 +4,12 @@ */ package com.jeesite.common.utils.excel.fieldtype; -import java.util.List; - import com.jeesite.common.lang.StringUtils; import com.jeesite.modules.sys.entity.Area; import com.jeesite.modules.sys.utils.AreaUtils; +import java.util.List; + /** * 字段类型转换 * @author ThinkGem @@ -27,7 +27,8 @@ public class AreaType implements FieldType { /** * 获取对象值(导入) */ - public Object getValue(String val) { + @Override + public Object getValue(String val) { for (Area e : list){ if (StringUtils.trimToEmpty(val).equals(e.getAreaName())){ return e; @@ -39,6 +40,7 @@ public class AreaType implements FieldType { /** * 获取对象值(导出) */ + @Override public String setValue(Object val) { if (val != null && ((Area)val).getAreaName() != null){ return ((Area)val).getAreaName(); diff --git a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/CompanyType.java b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/CompanyType.java index 9ac98810..6c211203 100644 --- a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/CompanyType.java +++ b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/CompanyType.java @@ -27,6 +27,7 @@ public class CompanyType implements FieldType { /** * 获取对象值(导入) */ + @Override public Object getValue(String val) { for (Company e : list){ if (StringUtils.trimToEmpty(val).equals(e.getCompanyName())){ @@ -39,6 +40,7 @@ public class CompanyType implements FieldType { /** * 设置对象值(导出) */ + @Override public String setValue(Object val) { if (val != null && ((Company)val).getCompanyName() != null){ return ((Company)val).getCompanyName(); diff --git a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/OfficeType.java b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/OfficeType.java index b48ec72a..0c8080f5 100644 --- a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/OfficeType.java +++ b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/OfficeType.java @@ -27,7 +27,8 @@ public class OfficeType implements FieldType { /** * 获取对象值(导入) */ - public Object getValue(String val) { + @Override + public Object getValue(String val) { for (Office e : list){ if (StringUtils.trimToEmpty(val).equals(e.getOfficeName())){ return e; @@ -39,7 +40,8 @@ public class OfficeType implements FieldType { /** * 设置对象值(导出) */ - public String setValue(Object val) { + @Override + public String setValue(Object val) { if (val != null && ((Office)val).getOfficeName() != null){ return ((Office)val).getOfficeName(); } diff --git a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/PostListType.java b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/PostListType.java index 16504531..1e45bb7f 100644 --- a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/PostListType.java +++ b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/PostListType.java @@ -31,7 +31,8 @@ public class PostListType implements FieldType { /** * 获取对象值(导入) */ - public Object getValue(String val) { + @Override + public Object getValue(String val) { List list = new ArrayList(); for (String s : StringUtils.split(val, ",")) { for (Post e : postList) { @@ -46,7 +47,8 @@ public class PostListType implements FieldType { /** * 设置对象值(导出) */ - public String setValue(Object val) { + @Override + public String setValue(Object val) { if (val != null) { @SuppressWarnings("unchecked") List postList = (List) val; diff --git a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/RoleListType.java b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/RoleListType.java index 64860c60..8c9963ca 100644 --- a/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/RoleListType.java +++ b/modules/core/src/main/java/com/jeesite/common/utils/excel/fieldtype/RoleListType.java @@ -31,7 +31,8 @@ public class RoleListType implements FieldType { /** * 获取对象值(导入) */ - public Object getValue(String val) { + @Override + public Object getValue(String val) { List list = new ArrayList(); for (String s : StringUtils.split(val, ",")) { for (Role e : roleList) { @@ -46,7 +47,8 @@ public class RoleListType implements FieldType { /** * 设置对象值(导出) */ - public String setValue(Object val) { + @Override + public String setValue(Object val) { if (val != null) { @SuppressWarnings("unchecked") List roleList = (List) val; diff --git a/modules/core/src/main/java/com/jeesite/modules/msg/service/MsgInnerService.java b/modules/core/src/main/java/com/jeesite/modules/msg/service/MsgInnerService.java index 77bd077d..c6d6da83 100644 --- a/modules/core/src/main/java/com/jeesite/modules/msg/service/MsgInnerService.java +++ b/modules/core/src/main/java/com/jeesite/modules/msg/service/MsgInnerService.java @@ -4,18 +4,6 @@ */ package com.jeesite.modules.msg.service; -import java.util.Date; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -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; @@ -28,17 +16,22 @@ 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.entity.content.*; 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; - import io.netty.util.concurrent.DefaultThreadFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** * 内部消息Service @@ -192,16 +185,12 @@ public class MsgInnerService extends CrudService { } } }); - ListUtils.pageList(recordList, 100, new MethodCallback() { - @SuppressWarnings("unchecked") - public Object execute(Object... objs) { - return msgInnerRecordDao.insertBatch((List)objs[0]); - } - }); + msgInnerRecordDao.insertBatch(recordList, null); // 手动触发消息推送任务 if (Global.TRUE.equals(Global.getProperty("msg.realtime.enabled"))){ msgPushThreadPool.submit(new Runnable() { - public void run() { + @Override + public void run() { try{ MsgPushUtils.getMsgPushTask().execute(); }catch(Exception ex){ diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java index dc491e5a..dad375ba 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java @@ -4,16 +4,6 @@ */ package com.jeesite.modules.sys.service.support; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - import com.jeesite.common.config.Global; import com.jeesite.common.entity.Page; import com.jeesite.common.idgen.IdGen; @@ -33,6 +23,14 @@ import com.jeesite.modules.sys.service.EmployeeService; import com.jeesite.modules.sys.service.UserService; import com.jeesite.modules.sys.utils.EmpUtils; import com.jeesite.modules.sys.utils.UserUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.PostConstruct; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import java.util.List; /** * 员工管理Service @@ -54,7 +52,7 @@ public class EmpUserServiceSupport extends CrudService */ @PostConstruct private void corpModelValid() throws Exception{ - if (Global.isUseCorpModel() != Global.getPropertyToBoolean("user.useCorpModel", "false")){ + if (!Global.isUseCorpModel().equals(Global.getPropertyToBoolean("user.useCorpModel", "false"))){ throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式,似乎你的当前版本不是JeeSite专业版。\n"); } } @@ -93,6 +91,7 @@ public class EmpUserServiceSupport extends CrudService /** * 查询全部用户,仅返回基本信息 */ + @Override public List findUserList(EmpUser empUser){ return dao.findUserList(empUser); } @@ -100,6 +99,7 @@ public class EmpUserServiceSupport extends CrudService /** * 根据部门编码查询用户,仅返回基本信息 */ + @Override public List findUserListByOfficeCodes(EmpUser empUser){ return dao.findUserListByOfficeCodes(empUser); } @@ -107,6 +107,7 @@ public class EmpUserServiceSupport extends CrudService /** * 根据角色编码查询用户,仅返回基本信息 */ + @Override public List findUserListByRoleCodes(EmpUser empUser){ return dao.findUserListByRoleCodes(empUser); } @@ -114,6 +115,7 @@ public class EmpUserServiceSupport extends CrudService /** * 根据岗位编码查询用户,仅返回基本信息 */ + @Override public List findUserListByPostCodes(EmpUser empUser){ return dao.findUserListByPostCodes(empUser); } @@ -169,6 +171,7 @@ public class EmpUserServiceSupport extends CrudService * @param file 导入的用户数据文件 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 */ + @Override @Transactional public String importData(MultipartFile file, Boolean isUpdateSupport) { if (file == null){ diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmployeeServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmployeeServiceSupport.java index ad5c0069..62de8fa1 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmployeeServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmployeeServiceSupport.java @@ -95,7 +95,8 @@ public class EmployeeServiceSupport extends CrudService /** * 查询当前员工关联的岗位信息 */ - public List findEmployeePostList(Employee employee){ + @Override + public List findEmployeePostList(Employee employee){ EmployeePost employeePost = new EmployeePost(); employeePost.setEmpCode(employee.getEmpCode()); return employeePostDao.findList(employeePost); @@ -104,6 +105,7 @@ public class EmployeeServiceSupport extends CrudService /** * 查询当前员工关联的附属机构信息 */ + @Override public List findEmployeeOfficeList(Employee employee){ EmployeeOffice employeeOffice = new EmployeeOffice(); employeeOffice.setEmpCode(employee.getEmpCode()); diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/LogServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/LogServiceSupport.java index cab32573..de665e62 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/LogServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/LogServiceSupport.java @@ -43,7 +43,8 @@ public class LogServiceSupport extends CrudService /** * 不使用数据库事务,执行插入日志 */ - @Transactional//(propagation=Propagation.NOT_SUPPORTED) + @Override + @Transactional//(propagation=Propagation.NOT_SUPPORTED) public void insertLog(Log entity) { DataSourceHolder.setJdbcTransaction(false); dao.insert(entity); diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/OfficeServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/OfficeServiceSupport.java index c59ae250..0f617bdc 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/OfficeServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/OfficeServiceSupport.java @@ -82,7 +82,8 @@ public class OfficeServiceSupport extends TreeService * @param file 导入的机构数据文件 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 */ - @Transactional + @Override + @Transactional public String importData(MultipartFile file, Boolean isUpdateSupport) { if (file == null){ throw new ServiceException(text("请选择导入的数据文件!")); diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/PostServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/PostServiceSupport.java index 03984f81..1a540a5d 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/PostServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/PostServiceSupport.java @@ -31,7 +31,8 @@ public class PostServiceSupport extends CrudService /** * 根据名称查询岗位 */ - public Post getByPostName(Post post) { + @Override + public Post getByPostName(Post post) { Post where = new Post(); where.setPostName(post.getPostName()); return dao.getByEntity(where);