格式化代码

This commit is contained in:
yangjun 2025-12-22 14:51:40 +08:00
parent ee0c483125
commit 444517fa74
119 changed files with 429 additions and 503 deletions

View File

@ -9,7 +9,7 @@ public interface ISysConfigApi {
* @param key * @param key
* @return * @return
*/ */
public Object querySysConfigByKey(String key); Object querySysConfigByKey(String key);
void asyncApi(SysConfigEntity entity); void asyncApi(SysConfigEntity entity);

View File

@ -50,11 +50,7 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
//支付是否可用 //支付是否可用
com.alibaba.fastjson.JSONObject sysParams = sysConfigApi.getByKey("wechat_pay_enabled"); com.alibaba.fastjson.JSONObject sysParams = sysConfigApi.getByKey("wechat_pay_enabled");
Boolean wechatPayEnabled = sysParams.getBoolean("configValue"); Boolean wechatPayEnabled = sysParams.getBoolean("configValue");
if (!wechatPayEnabled) { result.setWechatPayEnabled(wechatPayEnabled);
result.setWechatPayEnabled(false);
} else {
result.setWechatPayEnabled(true);
}
return result; return result;
} }

View File

@ -146,7 +146,7 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
// 跳过序列化ID和不需要的字段 // 跳过序列化ID和不需要的字段
if (field.getName().equals("serialVersionUID") || if (field.getName().equals("serialVersionUID") ||
field.isAnnotationPresent(TableField.class) && field.isAnnotationPresent(TableField.class) &&
field.getAnnotation(TableField.class).exist() == false) { !field.getAnnotation(TableField.class).exist()) {
continue; continue;
} }

View File

@ -28,6 +28,7 @@ import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -170,14 +171,13 @@ public class WeixinController {
String ticket = String.valueOf(jsonObject.get("ticket")); String ticket = String.valueOf(jsonObject.get("ticket"));
String nonceStr = UUID.randomUUID().toString(); String nonceStr = UUID.randomUUID().toString();
String timestamp = Long.toString(System.currentTimeMillis() / 1000); String timestamp = Long.toString(System.currentTimeMillis() / 1000);
String string1 = new StringBuilder("jsapi_ticket=").append(ticket) String string1 = "jsapi_ticket=" + ticket +
.append("&noncestr=") "&noncestr=" +
.append(nonceStr) nonceStr +
.append("&timestamp=") "&timestamp=" +
.append(timestamp) timestamp +
.append("&url=") "&url=" +
.append(firstUrl) firstUrl;// 得到签名
.toString();// 得到签名
String signature = encryptSHA(string1); String signature = encryptSHA(string1);
Map<String,String> map = new HashMap<String,String>(); Map<String,String> map = new HashMap<String,String>();
@ -194,7 +194,7 @@ public class WeixinController {
StringBuffer hexValue = new StringBuffer(); StringBuffer hexValue = new StringBuffer();
try { try {
MessageDigest sha = MessageDigest.getInstance("SHA-1"); MessageDigest sha = MessageDigest.getInstance("SHA-1");
byte[] byteArray = signStr.getBytes("UTF-8"); byte[] byteArray = signStr.getBytes(StandardCharsets.UTF_8);
byte[] md5Bytes = sha.digest(byteArray); byte[] md5Bytes = sha.digest(byteArray);
for (int i = 0; i < md5Bytes.length; i++) { for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff; int val = ((int) md5Bytes[i]) & 0xff;

View File

@ -5,7 +5,7 @@ import java.security.NoSuchAlgorithmException;
import java.util.Arrays; import java.util.Arrays;
public class SignUtil { public class SignUtil {
private static String token = "Blxc20250520"; private static final String token = "Blxc20250520";
/** /**
* 校验签名 * 校验签名
@ -26,14 +26,14 @@ public class SignUtil {
try { try {
MessageDigest md = MessageDigest.getInstance("SHA-1"); MessageDigest md = MessageDigest.getInstance("SHA-1");
//对接后的字符串进行sha1加密 //对接后的字符串进行sha1加密
byte[] digest = md.digest(content.toString().getBytes()); byte[] digest = md.digest(content.getBytes());
checktext = byteToStr(digest); checktext = byteToStr(digest);
} catch (NoSuchAlgorithmException e){ } catch (NoSuchAlgorithmException e){
e.printStackTrace(); e.printStackTrace();
} }
} }
//将加密后的字符串与signature进行对比 //将加密后的字符串与signature进行对比
return checktext !=null ? checktext.equals(signature.toUpperCase()) : false; return checktext != null && checktext.equals(signature.toUpperCase());
} }
/** /**

View File

@ -36,7 +36,7 @@ public class TemplateMessageSender {
dataJson.put(entry.getKey(), valueJson); dataJson.put(entry.getKey(), valueJson);
} }
json.put("data", dataJson); json.put("data", dataJson);
System.out.println("json----------------------------->"+json.toString()); System.out.println("json----------------------------->"+ json);
OkHttpClient client = new OkHttpClient(); OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(json.toString(), MediaType.get("application/json")); RequestBody body = RequestBody.create(json.toString(), MediaType.get("application/json"));

View File

@ -55,14 +55,14 @@ public interface CommonAPI {
* @param username * @param username
* @return * @return
*/ */
public LoginUser getUserByName(String username); LoginUser getUserByName(String username);
/** /**
* 5根据用户账号查询用户Id * 5根据用户账号查询用户Id
* @param username * @param username
* @return * @return
*/ */
public String getUserIdByName(String username); String getUserIdByName(String username);
/** /**
@ -105,14 +105,14 @@ public interface CommonAPI {
* @param code * @param code
* @return * @return
*/ */
public List<DictModel> queryDictItemsByCode(String code); List<DictModel> queryDictItemsByCode(String code);
/** /**
* 获取有效的数据字典项 * 获取有效的数据字典项
* @param code * @param code
* @return * @return
*/ */
public List<DictModel> queryEnableDictItemsByCode(String code); List<DictModel> queryEnableDictItemsByCode(String code);
/** /**
* 13获取表数据字典 * 13获取表数据字典

View File

@ -158,10 +158,7 @@ public class AutoLogAspect {
if(value!=null && value.toString().length()>length){ if(value!=null && value.toString().length()>length){
return false; return false;
} }
if(value instanceof MultipartFile){ return !(value instanceof MultipartFile);
return false;
}
return true;
} }
}; };
params = JSONObject.toJSONString(arguments, profilter); params = JSONObject.toJSONString(arguments, profilter);
@ -190,7 +187,7 @@ public class AutoLogAspect {
* @return * @return
*/ */
private String getOnlineLogContent(Object obj, String content){ private String getOnlineLogContent(Object obj, String content){
if (Result.class.isInstance(obj)){ if (obj instanceof Result){
Result res = (Result)obj; Result res = (Result)obj;
String msg = res.getMessage(); String msg = res.getMessage();
String tableName = res.getOnlTable(); String tableName = res.getOnlTable();

View File

@ -429,7 +429,7 @@ public class DictAspect {
//update-end--Author:scott -- Date:20210531 ----for !56 优化微服务应用下存在表字段需要字典翻译时加载缓慢问题----- //update-end--Author:scott -- Date:20210531 ----for !56 优化微服务应用下存在表字段需要字典翻译时加载缓慢问题-----
if (tmpValue != null) { if (tmpValue != null) {
if (!"".equals(textValue.toString())) { if (!"".contentEquals(textValue)) {
textValue.append(","); textValue.append(",");
} }
textValue.append(tmpValue); textValue.append(tmpValue);

View File

@ -29,11 +29,11 @@ public enum UrlMatchEnum {
/** /**
* Request 请求 URL前缀 * Request 请求 URL前缀
*/ */
private String url; private final String url;
/** /**
* 菜单路由 URL前缀 (对应菜单路径) * 菜单路由 URL前缀 (对应菜单路径)
*/ */
private String matchUrl; private final String matchUrl;
/** /**
* 根据req url 获取到菜单配置路径前端页面路由URL * 根据req url 获取到菜单配置路径前端页面路由URL

View File

@ -88,7 +88,7 @@ public interface CommonConstant {
Integer SC_JEECG_NO_AUTHZ=510; Integer SC_JEECG_NO_AUTHZ=510;
/** 登录用户Shiro权限缓存KEY前缀 */ /** 登录用户Shiro权限缓存KEY前缀 */
public static String PREFIX_USER_SHIRO_CACHE = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:"; String PREFIX_USER_SHIRO_CACHE = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:";
/** 登录用户Token令牌缓存KEY前缀 */ /** 登录用户Token令牌缓存KEY前缀 */
String PREFIX_USER_TOKEN = "prefix_user_token:"; String PREFIX_USER_TOKEN = "prefix_user_token:";
// /** Token缓存时间3600秒即一小时 */ // /** Token缓存时间3600秒即一小时 */
@ -585,17 +585,17 @@ public interface CommonConstant {
/** /**
* 报表允许设计开发的角色 * 报表允许设计开发的角色
*/ */
public static String[] allowDevRoles = new String[]{"lowdeveloper", "admin"}; String[] allowDevRoles = new String[]{"lowdeveloper", "admin"};
/** /**
* 对应积木报表的常量 * 对应积木报表的常量
* 数据隔离模式 按照创建人隔离 * 数据隔离模式 按照创建人隔离
*/ */
public static final String SAAS_MODE_CREATED = "created"; String SAAS_MODE_CREATED = "created";
/** /**
* 对应积木报表的常量 * 对应积木报表的常量
* 数据隔离模式 按照租户隔离 * 数据隔离模式 按照租户隔离
*/ */
public static final String SAAS_MODE_TENANT = "tenant"; String SAAS_MODE_TENANT = "tenant";
//update-end---author:scott ---date::2023-09-10 for积木报表常量---- //update-end---author:scott ---date::2023-09-10 for积木报表常量----
//update-begin---author:wangshuai---date:2024-04-07---for:修改手机号常量--- //update-begin---author:wangshuai---date:2024-04-07---for:修改手机号常量---

View File

@ -10,39 +10,39 @@ public interface CommonSendStatus {
/** /**
* 未发布 * 未发布
*/ */
public static final String UNPUBLISHED_STATUS_0 = "0"; String UNPUBLISHED_STATUS_0 = "0";
/** /**
* 已发布 * 已发布
*/ */
public static final String PUBLISHED_STATUS_1 = "1"; String PUBLISHED_STATUS_1 = "1";
/** /**
* 撤销 * 撤销
*/ */
public static final String REVOKE_STATUS_2 = "2"; String REVOKE_STATUS_2 = "2";
/** /**
* app端推送会话标识后缀 * app端推送会话标识后缀
*/ */
public static final String APP_SESSION_SUFFIX = "_app"; String APP_SESSION_SUFFIX = "_app";
/**-----【流程相关通知模板code】------------------------------------------------------------*/ /**-----【流程相关通知模板code】------------------------------------------------------------*/
/**流程催办——系统通知消息模板*/ /**流程催办——系统通知消息模板*/
public static final String TZMB_BPM_CUIBAN = "bpm_cuiban"; String TZMB_BPM_CUIBAN = "bpm_cuiban";
/**流程抄送——系统通知消息模板*/ /**流程抄送——系统通知消息模板*/
public static final String TZMB_BPM_CC = "bpm_cc"; String TZMB_BPM_CC = "bpm_cc";
/**流程催办——邮件通知消息模板*/ /**流程催办——邮件通知消息模板*/
public static final String TZMB_BPM_CUIBAN_EMAIL = "bpm_cuiban_email"; String TZMB_BPM_CUIBAN_EMAIL = "bpm_cuiban_email";
/**标准模板—系统消息通知*/ /**标准模板—系统消息通知*/
public static final String TZMB_SYS_TS_NOTE = "sys_ts_note"; String TZMB_SYS_TS_NOTE = "sys_ts_note";
/**流程超时提醒——系统通知消息模板*/ /**流程超时提醒——系统通知消息模板*/
public static final String TZMB_BPM_CHAOSHI_TIP = "bpm_chaoshi_tip"; String TZMB_BPM_CHAOSHI_TIP = "bpm_chaoshi_tip";
/**-----【流程相关通知模板code】-----------------------------------------------------------*/ /**-----【流程相关通知模板code】-----------------------------------------------------------*/
/** /**
* 系统通知拓展参数比如用于流程抄送和催办通知这里额外传递流程跳转页面所需要的路由参数 * 系统通知拓展参数比如用于流程抄送和催办通知这里额外传递流程跳转页面所需要的路由参数
*/ */
public static final String MSG_ABSTRACT_JSON = "msg_abstract"; String MSG_ABSTRACT_JSON = "msg_abstract";
} }

View File

@ -7,31 +7,31 @@ public interface DataBaseConstant {
//*********数据库类型**************************************** //*********数据库类型****************************************
/**MYSQL数据库*/ /**MYSQL数据库*/
public static final String DB_TYPE_MYSQL = "MYSQL"; String DB_TYPE_MYSQL = "MYSQL";
/** ORACLE*/ /** ORACLE*/
public static final String DB_TYPE_ORACLE = "ORACLE"; String DB_TYPE_ORACLE = "ORACLE";
/**达梦数据库*/ /**达梦数据库*/
public static final String DB_TYPE_DM = "DM"; String DB_TYPE_DM = "DM";
/**postgreSQL达梦数据库*/ /**postgreSQL达梦数据库*/
public static final String DB_TYPE_POSTGRESQL = "POSTGRESQL"; String DB_TYPE_POSTGRESQL = "POSTGRESQL";
/**人大金仓数据库*/ /**人大金仓数据库*/
public static final String DB_TYPE_KINGBASEES = "KINGBASEES"; String DB_TYPE_KINGBASEES = "KINGBASEES";
/**sqlserver数据库*/ /**sqlserver数据库*/
public static final String DB_TYPE_SQLSERVER = "SQLSERVER"; String DB_TYPE_SQLSERVER = "SQLSERVER";
/**mariadb 数据库*/ /**mariadb 数据库*/
public static final String DB_TYPE_MARIADB = "MARIADB"; String DB_TYPE_MARIADB = "MARIADB";
/**DB2 数据库*/ /**DB2 数据库*/
public static final String DB_TYPE_DB2 = "DB2"; String DB_TYPE_DB2 = "DB2";
/**HSQL 数据库*/ /**HSQL 数据库*/
public static final String DB_TYPE_HSQL = "HSQL"; String DB_TYPE_HSQL = "HSQL";
// // 数据库类型对应 database_type 字典 // // 数据库类型对应 database_type 字典
// public static final String DB_TYPE_MYSQL_NUM = "1"; // public static final String DB_TYPE_MYSQL_NUM = "1";
@ -45,79 +45,79 @@ public interface DataBaseConstant {
/** /**
* 数据-所属机构编码 * 数据-所属机构编码
*/ */
public static final String SYS_ORG_CODE = "sysOrgCode"; String SYS_ORG_CODE = "sysOrgCode";
/** /**
* 数据-所属机构编码 * 数据-所属机构编码
*/ */
public static final String SYS_ORG_CODE_TABLE = "sys_org_code"; String SYS_ORG_CODE_TABLE = "sys_org_code";
/** /**
* 数据-所属机构编码 * 数据-所属机构编码
*/ */
public static final String SYS_MULTI_ORG_CODE = "sysMultiOrgCode"; String SYS_MULTI_ORG_CODE = "sysMultiOrgCode";
/** /**
* 数据-所属机构编码 * 数据-所属机构编码
*/ */
public static final String SYS_MULTI_ORG_CODE_TABLE = "sys_multi_org_code"; String SYS_MULTI_ORG_CODE_TABLE = "sys_multi_org_code";
/** /**
* 数据-所属机构ID * 数据-所属机构ID
*/ */
public static final String SYS_ORG_ID = "sysOrgId"; String SYS_ORG_ID = "sysOrgId";
/** /**
* 数据-所属机构ID * 数据-所属机构ID
*/ */
public static final String SYS_ORG_ID_TABLE = "sys_org_id"; String SYS_ORG_ID_TABLE = "sys_org_id";
/** /**
* 数据-所属角色code多个逗号分割 * 数据-所属角色code多个逗号分割
*/ */
public static final String SYS_ROLE_CODE = "sysRoleCode"; String SYS_ROLE_CODE = "sysRoleCode";
/** /**
* 数据-所属角色code多个逗号分割 * 数据-所属角色code多个逗号分割
*/ */
public static final String SYS_ROLE_CODE_TABLE = "sys_role_code"; String SYS_ROLE_CODE_TABLE = "sys_role_code";
/** /**
* 数据-系统用户编码对应登录用户账号 * 数据-系统用户编码对应登录用户账号
*/ */
public static final String SYS_USER_CODE = "sysUserCode"; String SYS_USER_CODE = "sysUserCode";
/** /**
* 数据-系统用户编码对应登录用户账号 * 数据-系统用户编码对应登录用户账号
*/ */
public static final String SYS_USER_CODE_TABLE = "sys_user_code"; String SYS_USER_CODE_TABLE = "sys_user_code";
/** /**
* 登录用户ID * 登录用户ID
*/ */
public static final String SYS_USER_ID = "sysUserId"; String SYS_USER_ID = "sysUserId";
/** /**
* 登录用户ID * 登录用户ID
*/ */
public static final String SYS_USER_ID_TABLE = "sys_user_id"; String SYS_USER_ID_TABLE = "sys_user_id";
/** /**
* 登录用户真实姓名 * 登录用户真实姓名
*/ */
public static final String SYS_USER_NAME = "sysUserName"; String SYS_USER_NAME = "sysUserName";
/** /**
* 登录用户真实姓名 * 登录用户真实姓名
*/ */
public static final String SYS_USER_NAME_TABLE = "sys_user_name"; String SYS_USER_NAME_TABLE = "sys_user_name";
/** /**
* 系统日期"yyyy-MM-dd" * 系统日期"yyyy-MM-dd"
*/ */
public static final String SYS_DATE = "sysDate"; String SYS_DATE = "sysDate";
/** /**
* 系统日期"yyyy-MM-dd" * 系统日期"yyyy-MM-dd"
*/ */
public static final String SYS_DATE_TABLE = "sys_date"; String SYS_DATE_TABLE = "sys_date";
/** /**
* 系统时间"yyyy-MM-dd HH:mm" * 系统时间"yyyy-MM-dd HH:mm"
*/ */
public static final String SYS_TIME = "sysTime"; String SYS_TIME = "sysTime";
/** /**
* 系统时间"yyyy-MM-dd HH:mm" * 系统时间"yyyy-MM-dd HH:mm"
*/ */
public static final String SYS_TIME_TABLE = "sys_time"; String SYS_TIME_TABLE = "sys_time";
/** /**
* 数据-所属机构编码 * 数据-所属机构编码
*/ */
public static final String SYS_BASE_PATH = "sys_base_path"; String SYS_BASE_PATH = "sys_base_path";
//*********系统上下文变量**************************************** //*********系统上下文变量****************************************
@ -125,44 +125,44 @@ public interface DataBaseConstant {
/** /**
* 创建者登录名称 * 创建者登录名称
*/ */
public static final String CREATE_BY_TABLE = "create_by"; String CREATE_BY_TABLE = "create_by";
/** /**
* 创建者登录名称 * 创建者登录名称
*/ */
public static final String CREATE_BY = "createBy"; String CREATE_BY = "createBy";
/** /**
* 创建日期时间 * 创建日期时间
*/ */
public static final String CREATE_TIME_TABLE = "create_time"; String CREATE_TIME_TABLE = "create_time";
/** /**
* 创建日期时间 * 创建日期时间
*/ */
public static final String CREATE_TIME = "createTime"; String CREATE_TIME = "createTime";
/** /**
* 更新用户登录名称 * 更新用户登录名称
*/ */
public static final String UPDATE_BY_TABLE = "update_by"; String UPDATE_BY_TABLE = "update_by";
/** /**
* 更新用户登录名称 * 更新用户登录名称
*/ */
public static final String UPDATE_BY = "updateBy"; String UPDATE_BY = "updateBy";
/** /**
* 更新日期时间 * 更新日期时间
*/ */
public static final String UPDATE_TIME = "updateTime"; String UPDATE_TIME = "updateTime";
/** /**
* 更新日期时间 * 更新日期时间
*/ */
public static final String UPDATE_TIME_TABLE = "update_time"; String UPDATE_TIME_TABLE = "update_time";
/** /**
* 业务流程状态 * 业务流程状态
*/ */
public static final String BPM_STATUS = "bpmStatus"; String BPM_STATUS = "bpmStatus";
/** /**
* 业务流程状态 * 业务流程状态
*/ */
public static final String BPM_STATUS_TABLE = "bpm_status"; String BPM_STATUS_TABLE = "bpm_status";
//*********系统建表标准字段**************************************** //*********系统建表标准字段****************************************
/** /**

View File

@ -9,6 +9,7 @@ import org.springframework.stereotype.Component;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Scanner; import java.util.Scanner;
import java.util.Set; import java.util.Set;
@ -174,7 +175,7 @@ public class ProvinceCityArea {
Scanner scanner = null; Scanner scanner = null;
StringBuilder buffer = new StringBuilder(); StringBuilder buffer = new StringBuilder();
try { try {
scanner = new Scanner(file, "utf-8"); scanner = new Scanner(file, StandardCharsets.UTF_8);
while (scanner.hasNextLine()) { while (scanner.hasNextLine()) {
buffer.append(scanner.nextLine()); buffer.append(scanner.nextLine());
} }

View File

@ -9,8 +9,8 @@ public enum ClientTerminalTypeEnum {
H5("h5", "移动网页端"), H5("h5", "移动网页端"),
APP("app", "手机app端"); APP("app", "手机app端");
private String key; private final String key;
private String text; private final String text;
ClientTerminalTypeEnum(String value, String text) { ClientTerminalTypeEnum(String value, String text) {
this.key = value; this.key = value;

View File

@ -30,7 +30,7 @@ public enum DySmsEnum {
*/ */
private String keys; private String keys;
private DySmsEnum(String templateCode,String signName,String keys) { DySmsEnum(String templateCode, String signName, String keys) {
this.templateCode = templateCode; this.templateCode = templateCode;
this.signName = signName; this.signName = signName;
this.keys = keys; this.keys = keys;

View File

@ -32,7 +32,7 @@ public enum FileTypeEnum {
private String type; private String type;
private String value; private String value;
private String text; private String text;
private FileTypeEnum(String type,String value,String text){ FileTypeEnum(String type, String value, String text){
this.type = type; this.type = type;
this.value = value; this.value = value;
this.text = text; this.text = text;

View File

@ -14,5 +14,5 @@ public enum ModuleType {
/** /**
* online * online
*/ */
ONLINE; ONLINE
} }

View File

@ -49,7 +49,7 @@ public enum SensitiveEnum {
/** /**
* 公司开户银行联号 * 公司开户银行联号
*/ */
CNAPS_CODE; CNAPS_CODE
} }

View File

@ -67,7 +67,7 @@ public class SensitiveInfoUtil {
return obj; return obj;
} }
long startTime=System.currentTimeMillis(); long startTime=System.currentTimeMillis();
log.debug(" obj --> "+ obj.toString()); log.debug(" obj --> "+ obj);
// 判断是不是一个对象 // 判断是不是一个对象
Field[] fields = obj.getClass().getDeclaredFields(); Field[] fields = obj.getClass().getDeclaredFields();
@ -83,7 +83,7 @@ public class SensitiveInfoUtil {
continue; continue;
} }
SensitiveField sf = field.getAnnotation(SensitiveField.class); SensitiveField sf = field.getAnnotation(SensitiveField.class);
if(isEncode==true){ if(isEncode){
//加密 //加密
String value = SensitiveInfoUtil.getEncodeData(realValue, sf.type()); String value = SensitiveInfoUtil.getEncodeData(realValue, sf.type());
field.set(obj, value); field.set(obj, value);

View File

@ -387,7 +387,7 @@ public class JeecgElasticsearchTemplate {
data.remove("id"); data.remove("id");
bodySb.append(data.toJSONString()).append("\n"); bodySb.append(data.toJSONString()).append("\n");
} }
System.out.println("+-+-+-: bodySb.toString(): " + bodySb.toString()); System.out.println("+-+-+-: bodySb.toString(): " + bodySb);
HttpHeaders headers = RestUtil.getHeaderApplicationJson(); HttpHeaders headers = RestUtil.getHeaderApplicationJson();
RestUtil.request(url, HttpMethod.PUT, headers, null, bodySb, JSONObject.class); RestUtil.request(url, HttpMethod.PUT, headers, null, bodySb, JSONObject.class);
return true; return true;

View File

@ -16,7 +16,7 @@ public interface IFillRuleHandler {
* @param formData 动态表单参数 * @param formData 动态表单参数
* @return * @return
*/ */
public Object execute(JSONObject params, JSONObject formData); Object execute(JSONObject params, JSONObject formData);
} }

View File

@ -14,7 +14,7 @@ public enum MatchTypeEnum {
/**查询链接规则 OR*/ /**查询链接规则 OR*/
OR("OR"); OR("OR");
private String value; private final String value;
MatchTypeEnum(String value) { MatchTypeEnum(String value) {
this.value = value; this.value = value;
@ -36,7 +36,7 @@ public enum MatchTypeEnum {
return null; return null;
} }
for (MatchTypeEnum val : values()) { for (MatchTypeEnum val : values()) {
if (val.getValue().toLowerCase().equals(value.toLowerCase())) { if (val.getValue().equalsIgnoreCase(value)) {
return val; return val;
} }
} }

View File

@ -4,6 +4,7 @@ import java.beans.PropertyDescriptor;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -170,7 +171,7 @@ public class QueryGenerator {
//TODO 这种前后带逗号的支持分割后模糊查询(多选字段查询生效) 示例,1,3, //TODO 这种前后带逗号的支持分割后模糊查询(多选字段查询生效) 示例,1,3,
if (null != value && value.toString().startsWith(COMMA) && value.toString().endsWith(COMMA)) { if (null != value && value.toString().startsWith(COMMA) && value.toString().endsWith(COMMA)) {
String multiLikeval = value.toString().replace(",,", COMMA); String multiLikeval = value.toString().replace(",,", COMMA);
String[] vals = multiLikeval.substring(1, multiLikeval.length()).split(COMMA); String[] vals = multiLikeval.substring(1).split(COMMA);
final String field = oConvertUtils.camelToUnderline(column); final String field = oConvertUtils.camelToUnderline(column);
if(vals.length>1) { if(vals.length>1) {
queryWrapper.and(j -> { queryWrapper.and(j -> {
@ -345,7 +346,7 @@ public class QueryGenerator {
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType); MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
// update-begin--Author:sunjianlei Date:20200325 for高级查询的条件要用括号括起来防止和用户的其他条件冲突 ------- // update-begin--Author:sunjianlei Date:20200325 for高级查询的条件要用括号括起来防止和用户的其他条件冲突 -------
try { try {
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8"); superQueryParams = URLDecoder.decode(superQueryParams, StandardCharsets.UTF_8);
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class); List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
if (conditions == null || conditions.size() == 0) { if (conditions == null || conditions.size() == 0) {
return; return;
@ -369,7 +370,7 @@ public class QueryGenerator {
&& oConvertUtils.isNotEmpty(rule.getRule()) && oConvertUtils.isNotEmpty(rule.getRule())
&& oConvertUtils.isNotEmpty(rule.getVal())) { && oConvertUtils.isNotEmpty(rule.getVal())) {
log.debug("SuperQuery ==> " + rule.toString()); log.debug("SuperQuery ==> " + rule);
//update-begin-author:taoyan date:20201228 for: 高级查询 oracle 日期等于查询报错 //update-begin-author:taoyan date:20201228 for: 高级查询 oracle 日期等于查询报错
Object queryValue = rule.getVal(); Object queryValue = rule.getVal();
@ -423,8 +424,6 @@ public class QueryGenerator {
} }
//return andWrapper; //return andWrapper;
}); });
} catch (UnsupportedEncodingException e) {
log.error("--高级查询参数转码失败:" + superQueryParams, e);
} catch (Exception e) { } catch (Exception e) {
log.error("--高级查询拼接失败:" + e.getMessage()); log.error("--高级查询拼接失败:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -445,7 +444,7 @@ public class QueryGenerator {
if (value == null) { if (value == null) {
return QueryRuleEnum.EQ; return QueryRuleEnum.EQ;
} }
String val = (value + "").toString().trim(); String val = (value + "").trim();
if (val.length() == 0) { if (val.length() == 0) {
return QueryRuleEnum.EQ; return QueryRuleEnum.EQ;
} }
@ -524,7 +523,7 @@ public class QueryGenerator {
if (! (value instanceof String)){ if (! (value instanceof String)){
return value; return value;
} }
String val = (value + "").toString().trim(); String val = (value + "").trim();
//update-begin-author:taoyan date:20220302 for: 查询条件的值为等号=bug #3443 //update-begin-author:taoyan date:20220302 for: 查询条件的值为等号=bug #3443
if(QueryRuleEnum.EQ.getValue().equals(val)){ if(QueryRuleEnum.EQ.getValue().equals(val)){
return val; return val;
@ -930,7 +929,7 @@ public class QueryGenerator {
sb.append(sqlAnd+filedSql); sb.append(sqlAnd+filedSql);
} }
} }
log.info("query auth sql is:"+sb.toString()); log.info("query auth sql is:"+ sb);
return sb.toString(); return sb.toString();
} }

View File

@ -33,7 +33,7 @@ public class JeecgDataAutorUtils {
public static synchronized void installDataSearchConditon(HttpServletRequest request, List<SysPermissionDataRuleModel> dataRules) { public static synchronized void installDataSearchConditon(HttpServletRequest request, List<SysPermissionDataRuleModel> dataRules) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// 1.先从request获取MENU_DATA_AUTHOR_RULES如果存则获取到LIST // 1.先从request获取MENU_DATA_AUTHOR_RULES如果存则获取到LIST
List<SysPermissionDataRuleModel> list = (List<SysPermissionDataRuleModel>)loadDataSearchConditon(); List<SysPermissionDataRuleModel> list = loadDataSearchConditon();
if (list==null) { if (list==null) {
// 2.如果不存在则new一个list // 2.如果不存在则new一个list
list = new ArrayList<SysPermissionDataRuleModel>(); list = new ArrayList<SysPermissionDataRuleModel>();
@ -72,7 +72,7 @@ public class JeecgDataAutorUtils {
* @param sql * @param sql
*/ */
public static synchronized void installDataSearchConditon(HttpServletRequest request, String sql) { public static synchronized void installDataSearchConditon(HttpServletRequest request, String sql) {
String ruleSql = (String) loadDataSearchConditonSqlString(); String ruleSql = loadDataSearchConditonSqlString();
if (!StringUtils.hasText(ruleSql)) { if (!StringUtils.hasText(ruleSql)) {
request.setAttribute(MENU_DATA_AUTHOR_RULE_SQL,sql); request.setAttribute(MENU_DATA_AUTHOR_RULE_SQL,sql);
} }

View File

@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -62,7 +63,7 @@ public class JwtUtil {
os = httpServletResponse.getOutputStream(); os = httpServletResponse.getOutputStream();
httpServletResponse.setCharacterEncoding("UTF-8"); httpServletResponse.setCharacterEncoding("UTF-8");
httpServletResponse.setStatus(code); httpServletResponse.setStatus(code);
os.write(new ObjectMapper().writeValueAsString(jsonResult).getBytes("UTF-8")); os.write(new ObjectMapper().writeValueAsString(jsonResult).getBytes(StandardCharsets.UTF_8));
os.flush(); os.flush();
os.close(); os.close();
} catch (IOException e) { } catch (IOException e) {
@ -211,15 +212,15 @@ public class JwtUtil {
} }
//update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限查看自己拥有部门的权限中存在问题 #7288------------ //update-end---author:chenrui ---date:20250107 for[QQYUN-10785]数据权限查看自己拥有部门的权限中存在问题 #7288------------
//替换为当前系统时间(年月日) //替换为当前系统时间(年月日)
if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) { if (key.equals(DataBaseConstant.SYS_DATE)|| key.equalsIgnoreCase(DataBaseConstant.SYS_DATE_TABLE)) {
returnValue = DateUtils.formatDate(); returnValue = DateUtils.formatDate();
} }
//替换为当前系统时间年月日时分秒 //替换为当前系统时间年月日时分秒
else if (key.equals(DataBaseConstant.SYS_TIME)|| key.toLowerCase().equals(DataBaseConstant.SYS_TIME_TABLE)) { else if (key.equals(DataBaseConstant.SYS_TIME)|| key.equalsIgnoreCase(DataBaseConstant.SYS_TIME_TABLE)) {
returnValue = DateUtils.now(); returnValue = DateUtils.now();
} }
//流程状态默认值默认未发起 //流程状态默认值默认未发起
else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) { else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.equalsIgnoreCase(DataBaseConstant.BPM_STATUS_TABLE)) {
returnValue = "1"; returnValue = "1";
} }
@ -229,7 +230,7 @@ public class JwtUtil {
} }
//替换为系统登录用户帐号 //替换为系统登录用户帐号
if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_CODE_TABLE)) { if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.equalsIgnoreCase(DataBaseConstant.SYS_USER_CODE_TABLE)) {
if(user==null) { if(user==null) {
returnValue = sysUser.getUsername(); returnValue = sysUser.getUsername();
}else { }else {
@ -247,7 +248,7 @@ public class JwtUtil {
} }
//替换为系统登录用户真实名字 //替换为系统登录用户真实名字
else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_NAME_TABLE)) { else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.equalsIgnoreCase(DataBaseConstant.SYS_USER_NAME_TABLE)) {
if(user==null) { if(user==null) {
returnValue = sysUser.getRealname(); returnValue = sysUser.getRealname();
}else { }else {
@ -256,7 +257,7 @@ public class JwtUtil {
} }
//替换为系统用户登录所使用的机构编码 //替换为系统用户登录所使用的机构编码
else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) { else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.equalsIgnoreCase(DataBaseConstant.SYS_ORG_CODE_TABLE)) {
if(user==null) { if(user==null) {
returnValue = sysUser.getOrgCode(); returnValue = sysUser.getOrgCode();
}else { }else {
@ -274,7 +275,7 @@ public class JwtUtil {
} }
//替换为系统用户所拥有的所有机构编码 //替换为系统用户所拥有的所有机构编码
else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) { else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.equalsIgnoreCase(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) {
if(user==null){ if(user==null){
//TODO 暂时使用用户登录部门存在逻辑缺陷不是用户所拥有的部门 //TODO 暂时使用用户登录部门存在逻辑缺陷不是用户所拥有的部门
returnValue = sysUser.getOrgCode(); returnValue = sysUser.getOrgCode();
@ -316,7 +317,7 @@ public class JwtUtil {
} }
//update-begin-author:taoyan date:20210330 for:多租户ID作为系统变量 //update-begin-author:taoyan date:20210330 for:多租户ID作为系统变量
else if (key.equals(TenantConstant.TENANT_ID) || key.toLowerCase().equals(TenantConstant.TENANT_ID_TABLE)){ else if (key.equals(TenantConstant.TENANT_ID) || key.equalsIgnoreCase(TenantConstant.TENANT_ID_TABLE)){
try { try {
returnValue = SpringContextUtils.getHttpServletRequest().getHeader(CommonConstant.TENANT_ID); returnValue = SpringContextUtils.getHttpServletRequest().getHeader(CommonConstant.TENANT_ID);
} catch (Exception e) { } catch (Exception e) {

View File

@ -100,11 +100,11 @@ public class ResourceUtil {
} }
Map<String, List<DictModel>> map = new HashMap<>(); Map<String, List<DictModel>> map = new HashMap<>();
for (String code : enumDictData.keySet()) { for (String code : enumDictData.keySet()) {
if(dictCodeList.indexOf(code)>=0){ if(dictCodeList.contains(code)){
List<DictModel> dictItemList = enumDictData.get(code); List<DictModel> dictItemList = enumDictData.get(code);
for(DictModel dm: dictItemList){ for(DictModel dm: dictItemList){
String value = dm.getValue(); String value = dm.getValue();
if(keys.indexOf(value)>=0){ if(keys.contains(value)){
List<DictModel> list = new ArrayList<>(); List<DictModel> list = new ArrayList<>();
list.add(new DictModel(value, dm.getText())); list.add(new DictModel(value, dm.getText()));
map.put(code,list); map.put(code,list);

View File

@ -157,7 +157,7 @@ public class SqlConcatUtil {
} }
return "("+String.join("," ,res)+")"; return "("+String.join("," ,res)+")";
}else { }else {
return "("+value.toString()+")"; return "("+ value +")";
} }
//update-end-author:taoyan date:20210628 for: 查询条件如果输入,导致sql报错 //update-end-author:taoyan date:20210628 for: 查询条件如果输入,导致sql报错
} }

View File

@ -29,12 +29,12 @@ public class ComboModel implements Serializable {
public ComboModel(){ public ComboModel(){
}; }
public ComboModel(String id,String title,boolean checked,String username){ public ComboModel(String id,String title,boolean checked,String username){
this.id = id; this.id = id;
this.title = title; this.title = title;
this.checked = false; this.checked = false;
this.username = username; this.username = username;
}; }
} }

View File

@ -20,9 +20,8 @@ public class BrowserUtils {
* @return * @return
*/ */
public static boolean isIe(HttpServletRequest request) { public static boolean isIe(HttpServletRequest request) {
return (request.getHeader("USER-AGENT").toLowerCase().indexOf("msie") > 0 || request return request.getHeader("USER-AGENT").toLowerCase().indexOf("msie") > 0 || request
.getHeader("USER-AGENT").toLowerCase().indexOf("rv:11.0") > 0) ? true .getHeader("USER-AGENT").toLowerCase().indexOf("rv:11.0") > 0;
: false;
} }
/** /**
@ -96,7 +95,7 @@ public class BrowserUtils {
private static boolean getBrowserType(HttpServletRequest request, private static boolean getBrowserType(HttpServletRequest request,
String brosertype) { String brosertype) {
return request.getHeader("USER-AGENT").toLowerCase() return request.getHeader("USER-AGENT").toLowerCase()
.indexOf(brosertype) > 0 ? true : false; .indexOf(brosertype) > 0;
} }
private final static String IE11 = "rv:11.0"; private final static String IE11 = "rv:11.0";
@ -170,7 +169,7 @@ public class BrowserUtils {
} }
private static Map<String, String> langMap = new HashMap<String, String>(); private static final Map<String, String> langMap = new HashMap<String, String>();
private final static String ZH = "zh"; private final static String ZH = "zh";
private final static String ZH_CN = "zh-cn"; private final static String ZH_CN = "zh-cn";
@ -187,7 +186,7 @@ public class BrowserUtils {
public static String getBrowserLanguage(HttpServletRequest request) { public static String getBrowserLanguage(HttpServletRequest request) {
String browserLang = request.getLocale().getLanguage(); String browserLang = request.getLocale().getLanguage();
String browserLangCode = (String)langMap.get(browserLang); String browserLangCode = langMap.get(browserLang);
if(browserLangCode == null) if(browserLangCode == null)
{ {

View File

@ -44,13 +44,13 @@ public class CommonUtils {
/** /**
* 中文正则 * 中文正则
*/ */
private static Pattern ZHONGWEN_PATTERN = Pattern.compile("[\u4e00-\u9fa5]"); private static final Pattern ZHONGWEN_PATTERN = Pattern.compile("[\u4e00-\u9fa5]");
/** /**
* 文件名 正则字符串 * 文件名 正则字符串
* 文件名支持的字符串字母数字中文.-_() 除此之外的字符将被删除 * 文件名支持的字符串字母数字中文.-_() 除此之外的字符将被删除
*/ */
private static String FILE_NAME_REGEX = "[^A-Za-z\\.\\(\\)\\-\\_0-9\\u4e00-\\u9fa5]"; private static final String FILE_NAME_REGEX = "[^A-Za-z\\.\\(\\)\\-\\_0-9\\u4e00-\\u9fa5]";
public static String uploadOnlineImage(byte[] data,String basePath,String bizPath,String uploadType){ public static String uploadOnlineImage(byte[] data,String basePath,String bizPath,String uploadType){
String dbPath = null; String dbPath = null;
@ -119,10 +119,7 @@ public class CommonUtils {
return false; return false;
}else{ }else{
Matcher m = ZHONGWEN_PATTERN.matcher(str); Matcher m = ZHONGWEN_PATTERN.matcher(str);
if (m.find()) { return m.find();
return true;
}
return false;
} }
} }
@ -257,7 +254,7 @@ public class CommonUtils {
public static DataSourceProperty getDataSourceProperty(String sourceKey){ public static DataSourceProperty getDataSourceProperty(String sourceKey){
DynamicDataSourceProperties prop = SpringContextUtils.getApplicationContext().getBean(DynamicDataSourceProperties.class); DynamicDataSourceProperties prop = SpringContextUtils.getApplicationContext().getBean(DynamicDataSourceProperties.class);
Map<String, DataSourceProperty> map = prop.getDatasource(); Map<String, DataSourceProperty> map = prop.getDatasource();
DataSourceProperty db = (DataSourceProperty)map.get(sourceKey); DataSourceProperty db = map.get(sourceKey);
return db; return db;
} }
@ -273,7 +270,7 @@ public class CommonUtils {
} }
DynamicDataSourceProperties prop = SpringContextUtils.getApplicationContext().getBean(DynamicDataSourceProperties.class); DynamicDataSourceProperties prop = SpringContextUtils.getApplicationContext().getBean(DynamicDataSourceProperties.class);
Map<String, DataSourceProperty> map = prop.getDatasource(); Map<String, DataSourceProperty> map = prop.getDatasource();
DataSourceProperty db = (DataSourceProperty)map.get(sourceKey); DataSourceProperty db = map.get(sourceKey);
if(db==null){ if(db==null){
return null; return null;
} }

View File

@ -704,8 +704,7 @@ public class DateUtils extends PropertyEditorSupport {
throw new IllegalArgumentException("Could not parse date, date format is error "); throw new IllegalArgumentException("Could not parse date, date format is error ");
} }
} catch (ParseException ex) { } catch (ParseException ex) {
IllegalArgumentException iae = new IllegalArgumentException("Could not parse date: " + ex.getMessage()); IllegalArgumentException iae = new IllegalArgumentException("Could not parse date: " + ex.getMessage(), ex);
iae.initCause(ex);
throw iae; throw iae;
} }
} else { } else {

View File

@ -26,9 +26,9 @@ public class DySmsLimit {
// 一分钟内报警线最大短信数量超了进黑名单单一IP // 一分钟内报警线最大短信数量超了进黑名单单一IP
private static final int MAX_TOTAL_MESSAGE_PER_MINUTE = 20; private static final int MAX_TOTAL_MESSAGE_PER_MINUTE = 20;
private static ConcurrentHashMap<String, Long> ipLastRequestTime = new ConcurrentHashMap<>(); private static final ConcurrentHashMap<String, Long> ipLastRequestTime = new ConcurrentHashMap<>();
private static ConcurrentHashMap<String, Integer> ipRequestCount = new ConcurrentHashMap<>(); private static final ConcurrentHashMap<String, Integer> ipRequestCount = new ConcurrentHashMap<>();
private static ConcurrentHashMap<String, Boolean> ipBlacklist = new ConcurrentHashMap<>(); private static final ConcurrentHashMap<String, Boolean> ipBlacklist = new ConcurrentHashMap<>();
/** /**
* @param ip 请求发短信的IP地址 * @param ip 请求发短信的IP地址

View File

@ -9,6 +9,7 @@ import java.io.*;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.List; import java.util.List;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
@ -45,16 +46,12 @@ public class FileDownloadUtils {
response.setHeader("content-type", "application/octet-stream"); response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
// 下载文件能正常显示中文 // 下载文件能正常显示中文
try { response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8));
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
// 实现文件下载 // 实现文件下载
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
try (FileInputStream fis = new FileInputStream(file); try (FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);) { BufferedInputStream bis = new BufferedInputStream(fis)) {
OutputStream os = response.getOutputStream(); OutputStream os = response.getOutputStream();
int i = bis.read(buffer); int i = bis.read(buffer);
while (i != -1) { while (i != -1) {
@ -80,13 +77,13 @@ public class FileDownloadUtils {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/octet-stream"); response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downloadName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downloadName, StandardCharsets.UTF_8));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
log.info("开始压缩文件:" + filesPath); log.info("开始压缩文件:" + filesPath);
//设置压缩流直接写入response实现边压缩边下载 //设置压缩流直接写入response实现边压缩边下载
try (ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream())); try (ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
DataOutputStream os = new DataOutputStream(zipOut);) { DataOutputStream os = new DataOutputStream(zipOut)) {
//设置压缩方法 //设置压缩方法
zipOut.setMethod(ZipOutputStream.DEFLATED); zipOut.setMethod(ZipOutputStream.DEFLATED);
for (String filePath : filesPath) { for (String filePath : filesPath) {
@ -133,7 +130,7 @@ public class FileDownloadUtils {
// 确保目录存在 // 确保目录存在
File file = ensureDestFileDir(storePath); File file = ensureDestFileDir(storePath);
try (InputStream inStream = conn.getInputStream(); try (InputStream inStream = conn.getInputStream();
FileOutputStream fs = new FileOutputStream(file);) { FileOutputStream fs = new FileOutputStream(file)) {
int byteread; int byteread;
byte[] buffer = new byte[1204]; byte[] buffer = new byte[1204];
while ((byteread = inStream.read(buffer)) != -1) { while ((byteread = inStream.read(buffer)) != -1) {

View File

@ -20,7 +20,7 @@ import java.util.regex.Pattern;
* @Date 2019年01月14日 * @Date 2019年01月14日
*/ */
public class IpUtils { public class IpUtils {
private static Logger logger = LoggerFactory.getLogger(IpUtils.class); private static final Logger logger = LoggerFactory.getLogger(IpUtils.class);
/** /**
* 获取IP地址 * 获取IP地址

View File

@ -32,7 +32,7 @@ public class Md5Util {
public static String md5Encode(String origin, String charsetname) { public static String md5Encode(String origin, String charsetname) {
String resultString = null; String resultString = null;
try { try {
resultString = new String(origin); resultString = origin;
MessageDigest md = MessageDigest.getInstance("MD5"); MessageDigest md = MessageDigest.getInstance("MD5");
if (charsetname == null || "".equals(charsetname)) { if (charsetname == null || "".equals(charsetname)) {
resultString = byteArrayToHexString(md.digest(resultString.getBytes())); resultString = byteArrayToHexString(md.digest(resultString.getBytes()));

View File

@ -10,6 +10,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
/** /**
* minio文件上传工具类 * minio文件上传工具类
@ -169,7 +170,7 @@ public class MinioUtil {
.expiry(expires).method(Method.GET).build(); .expiry(expires).method(Method.GET).build();
//update-begin---author:liusq Date:20220121 for获取文件外链报错提示method不能为空导致文件下载和预览失败---- //update-begin---author:liusq Date:20220121 for获取文件外链报错提示method不能为空导致文件下载和预览失败----
String url = minioClient.getPresignedObjectUrl(objectArgs); String url = minioClient.getPresignedObjectUrl(objectArgs);
return URLDecoder.decode(url,"UTF-8"); return URLDecoder.decode(url, StandardCharsets.UTF_8);
}catch (Exception e){ }catch (Exception e){
log.info("文件路径获取失败" + e.getMessage()); log.info("文件路径获取失败" + e.getMessage());
} }

View File

@ -2,6 +2,8 @@ package org.jeecg.common.util;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;
import java.nio.charset.StandardCharsets;
/** /**
* @Author 张代浩 * @Author 张代浩
*/ */
@ -96,7 +98,7 @@ public class MyClassLoader extends ClassLoader {
中文及空格路径 中文及空格路径
-------------------------------------------------------------*/ -------------------------------------------------------------*/
try { try {
realPath = java.net.URLDecoder.decode(realPath, "utf-8"); realPath = java.net.URLDecoder.decode(realPath, StandardCharsets.UTF_8);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -1,5 +1,6 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import java.nio.charset.StandardCharsets;
import java.security.Key; import java.security.Key;
import java.security.SecureRandom; import java.security.SecureRandom;
import javax.crypto.Cipher; import javax.crypto.Cipher;
@ -100,7 +101,7 @@ public class PasswordUtil {
cipher.init(Cipher.ENCRYPT_MODE, key, parameterSpec); cipher.init(Cipher.ENCRYPT_MODE, key, parameterSpec);
//update-begin-author:sccott date:20180815 for:中文作为用户名时加密的密码windows和linux会得到不同的结果 gitee/issues/IZUD7 //update-begin-author:sccott date:20180815 for:中文作为用户名时加密的密码windows和linux会得到不同的结果 gitee/issues/IZUD7
encipheredData = cipher.doFinal(plaintext.getBytes("utf-8")); encipheredData = cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
//update-end-author:sccott date:20180815 for:中文作为用户名时加密的密码windows和linux会得到不同的结果 gitee/issues/IZUD7 //update-end-author:sccott date:20180815 for:中文作为用户名时加密的密码windows和linux会得到不同的结果 gitee/issues/IZUD7
} catch (Exception e) { } catch (Exception e) {
} }
@ -146,7 +147,7 @@ public class PasswordUtil {
* @return * @return
*/ */
public static String bytesToHexString(byte[] src) { public static String bytesToHexString(byte[] src) {
StringBuilder stringBuilder = new StringBuilder(""); StringBuilder stringBuilder = new StringBuilder();
if (src == null || src.length <= 0) { if (src == null || src.length <= 0) {
return null; return null;
} }

View File

@ -22,7 +22,7 @@ public class ReflectHelper {
/** /**
* 传过来的对象 * 传过来的对象
*/ */
private Object obj; private final Object obj;
/** /**
* 存放get方法 * 存放get方法
@ -85,7 +85,7 @@ public class ReflectHelper {
m.invoke(obj, object); m.invoke(obj, object);
return true; return true;
} catch (Exception ex) { } catch (Exception ex) {
log.info("invoke getter on " + property + " error: " + ex.toString()); log.info("invoke getter on " + property + " error: " + ex);
return false; return false;
} }
} }
@ -103,10 +103,10 @@ public class ReflectHelper {
/* /*
* 调用obj类的setter函数 * 调用obj类的setter函数
*/ */
value = m.invoke(obj, new Object[]{}); value = m.invoke(obj);
} catch (Exception ex) { } catch (Exception ex) {
log.info("invoke getter on " + property + " error: " + ex.toString()); log.info("invoke getter on " + property + " error: " + ex);
} }
} }
return value; return value;
@ -185,8 +185,8 @@ public class ReflectHelper {
try { try {
String firstLetter = fieldName.substring(0, 1).toUpperCase(); String firstLetter = fieldName.substring(0, 1).toUpperCase();
String getter = "get" + firstLetter + fieldName.substring(1); String getter = "get" + firstLetter + fieldName.substring(1);
Method method = o.getClass().getMethod(getter, new Class[]{}); Method method = o.getClass().getMethod(getter);
Object value = method.invoke(o, new Object[]{}); Object value = method.invoke(o);
return value; return value;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -282,9 +282,7 @@ public class ReflectHelper {
Field[] fields; Field[] fields;
do{ do{
fields = clazz.getDeclaredFields(); fields = clazz.getDeclaredFields();
for(int i = 0;i<fields.length;i++){ Collections.addAll(list, fields);
list.add(fields[i]);
}
clazz = clazz.getSuperclass(); clazz = clazz.getSuperclass();
}while(clazz!= Object.class&&clazz!=null); }while(clazz!= Object.class&&clazz!=null);
return list; return list;
@ -318,7 +316,7 @@ public class ReflectHelper {
if (field != null) { if (field != null) {
TableField tableField = field.getAnnotation(TableField.class); TableField tableField = field.getAnnotation(TableField.class);
if (tableField != null){ if (tableField != null){
if(tableField.exist() == false){ if(!tableField.exist()){
//如果设置了TableField false 这个字段不需要处理 //如果设置了TableField false 这个字段不需要处理
return null; return null;
}else{ }else{

View File

@ -24,15 +24,15 @@ public class SqlInjectionUtil {
/** /**
* online报表专用sql注入关键词 * online报表专用sql注入关键词
*/ */
private static String specialReportXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |alter |delete |grant |update |drop |master |truncate |declare |--"; private static final String specialReportXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |alter |delete |grant |update |drop |master |truncate |declare |--";
/** /**
* 字典专用sql注入关键词 * 字典专用sql注入关键词
*/ */
private static String specialDictSqlXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|+|--"; private static final String specialDictSqlXssStr = "exec |peformance_schema|information_schema|extractvalue|updatexml|geohash|gtid_subset|gtid_subtract|insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|+|--";
/** /**
* 完整匹配的key不需要考虑前空格 * 完整匹配的key不需要考虑前空格
*/ */
private static List<String> FULL_MATCHING_KEYWRODS = new ArrayList<>(); private static final List<String> FULL_MATCHING_KEYWRODS = new ArrayList<>();
static { static {
FULL_MATCHING_KEYWRODS.add(";"); FULL_MATCHING_KEYWRODS.add(";");
FULL_MATCHING_KEYWRODS.add("+"); FULL_MATCHING_KEYWRODS.add("+");
@ -127,8 +127,7 @@ public class SqlInjectionUtil {
throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value);
} }
} }
return; }
}
/** /**
* 判断是否存在SQL注入关键词字符串 * 判断是否存在SQL注入关键词字符串
@ -181,8 +180,7 @@ public class SqlInjectionUtil {
} }
filterContent(val, customXssString); filterContent(val, customXssString);
} }
return; }
}
/** /**
* 提醒不通用 * 提醒不通用
@ -218,8 +216,7 @@ public class SqlInjectionUtil {
throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value);
} }
} }
return; }
}
/** /**
* 提醒不通用 * 提醒不通用
@ -254,8 +251,7 @@ public class SqlInjectionUtil {
throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value);
} }
} }
return; }
}
/** /**
@ -286,7 +282,7 @@ public class SqlInjectionUtil {
* *
* @param table * @param table
*/ */
private static Pattern tableNamePattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_\\$]{0,63}$"); private static final Pattern tableNamePattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_\\$]{0,63}$");
public static String getSqlInjectTableName(String table) { public static String getSqlInjectTableName(String table) {
if(oConvertUtils.isEmpty(table)){ if(oConvertUtils.isEmpty(table)){
return table; return table;

View File

@ -18,9 +18,9 @@ public class UUIDGenerator {
*/ */
public static String generate() { public static String generate() {
return new StringBuilder(32).append(format(getIp())).append( return format(getIp()) +
format(getJvm())).append(format(getHiTime())).append( format(getJvm()) + format(getHiTime()) +
format(getLoTime())).append(format(getCount())).toString(); format(getLoTime()) + format(getCount());
} }

View File

@ -38,7 +38,7 @@ public class YouBianCodeUtil {
code = "A"+code; code = "A"+code;
} }
String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH); String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH);
String afterCode = code.substring(code.length() - 1 - NUM_LENGTH,code.length()); String afterCode = code.substring(code.length() - 1 - NUM_LENGTH);
char afterCodeZimu = afterCode.substring(0, 1).charAt(0); char afterCodeZimu = afterCode.substring(0, 1).charAt(0);
Integer afterCodeNum = Integer.parseInt(afterCode.substring(1)); Integer afterCodeNum = Integer.parseInt(afterCode.substring(1));
// org.jeecgframework.core.util.LogUtil.info(after_code); // org.jeecgframework.core.util.LogUtil.info(after_code);

View File

@ -16,7 +16,7 @@ import java.util.Map;
*/ */
public class DataSourceCachePool { public class DataSourceCachePool {
/** 数据源连接池缓存【本地 class缓存 - 不支持分布式】 */ /** 数据源连接池缓存【本地 class缓存 - 不支持分布式】 */
private static Map<String, DruidDataSource> dbSources = new HashMap<>(); private static final Map<String, DruidDataSource> dbSources = new HashMap<>();
private static RedisTemplate<String, Object> redisTemplate; private static RedisTemplate<String, Object> redisTemplate;
private static RedisTemplate<String, Object> getRedisTemplate() { private static RedisTemplate<String, Object> getRedisTemplate() {

View File

@ -40,7 +40,7 @@ public class FreemarkerParseFactory {
*/ */
private static final Configuration SQL_CONFIG = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS); private static final Configuration SQL_CONFIG = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
private static StringTemplateLoader stringTemplateLoader = new StringTemplateLoader(); private static final StringTemplateLoader stringTemplateLoader = new StringTemplateLoader();
/**使用内嵌的(?ms)打开单行和多行模式*/ /**使用内嵌的(?ms)打开单行和多行模式*/
private final static Pattern NOTES_PATTERN = Pattern private final static Pattern NOTES_PATTERN = Pattern
@ -78,7 +78,7 @@ public class FreemarkerParseFactory {
log.error(e.getMessage(), e.fillInStackTrace()); log.error(e.getMessage(), e.fillInStackTrace());
throw new Exception(e); throw new Exception(e);
} }
log.debug("----isExistTemplate----" + e.toString()); log.debug("----isExistTemplate----" + e);
//update-end--Author:scott Date:20180320 for解决问题 - 错误提示sql文件不存在实际问题是sql freemarker用法错误------ //update-end--Author:scott Date:20180320 for解决问题 - 错误提示sql文件不存在实际问题是sql freemarker用法错误------
return false; return false;
} }
@ -179,13 +179,13 @@ public class FreemarkerParseFactory {
int index = 0; int index = 0;
while ((index = StringUtils.indexOfIgnoreCase(sql, whereAnd, index)) != -1) { while ((index = StringUtils.indexOfIgnoreCase(sql, whereAnd, index)) != -1) {
sql = sql.substring(0, index + 5) sql = sql.substring(0, index + 5)
+ sql.substring(index + 9, sql.length()); + sql.substring(index + 9);
} }
// 去掉 , where 这样的问题 // 去掉 , where 这样的问题
index = 0; index = 0;
while ((index = StringUtils.indexOfIgnoreCase(sql, commaWhere, index)) != -1) { while ((index = StringUtils.indexOfIgnoreCase(sql, commaWhere, index)) != -1) {
sql = sql.substring(0, index) sql = sql.substring(0, index)
+ sql.substring(index + 1, sql.length()); + sql.substring(index + 1);
} }
// 去掉 最后是 ,这样的问题 // 去掉 最后是 ,这样的问题
if (sql.endsWith(SymbolConstant.COMMA) || sql.endsWith(commaSpace)) { if (sql.endsWith(SymbolConstant.COMMA) || sql.endsWith(commaSpace)) {

View File

@ -16,8 +16,8 @@ public class AesEncryptUtil {
/** /**
* 使用AES-128-CBC加密模式 key和iv可以相同 * 使用AES-128-CBC加密模式 key和iv可以相同
*/ */
private static String KEY = EncryptedString.key; private static final String KEY = EncryptedString.key;
private static String IV = EncryptedString.iv; private static final String IV = EncryptedString.iv;
/** /**
* 加密方法 * 加密方法

View File

@ -131,7 +131,7 @@ public class SsrfFileTypeFilter {
* @description 通过文件后缀名获取文件类型 * @description 通过文件后缀名获取文件类型
*/ */
private static String getFileTypeBySuffix(String fileName) { private static String getFileTypeBySuffix(String fileName) {
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); return fileName.substring(fileName.lastIndexOf(".") + 1);
} }

View File

@ -16,7 +16,9 @@ import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.math.RoundingMode;
import java.net.*; import java.net.*;
import java.nio.charset.StandardCharsets;
import java.sql.Date; import java.sql.Date;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -36,18 +38,12 @@ public class oConvertUtils {
if ("".equals(object)) { if ("".equals(object)) {
return (true); return (true);
} }
if (CommonConstant.STRING_NULL.equals(object)) { return CommonConstant.STRING_NULL.equals(object);
return (true); }
}
return (false);
}
public static boolean isNotEmpty(Object object) { public static boolean isNotEmpty(Object object) {
if (object != null && !"".equals(object) && !object.equals(CommonConstant.STRING_NULL)) { return object != null && !"".equals(object) && !object.equals(CommonConstant.STRING_NULL);
return (true); }
}
return (false);
}
/** /**
@ -62,7 +58,7 @@ public class oConvertUtils {
} }
try { try {
inStr = URLDecoder.decode(inStr, "UTF-8"); inStr = URLDecoder.decode(inStr, StandardCharsets.UTF_8);
} catch (Exception e) { } catch (Exception e) {
// 解决URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "自动" // 解决URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "自动"
//e.printStackTrace(); //e.printStackTrace();
@ -79,7 +75,7 @@ public class oConvertUtils {
public static String StrToUTF(String strIn, String sourceCode, String targetCode) { public static String StrToUTF(String strIn, String sourceCode, String targetCode) {
strIn = ""; strIn = "";
try { try {
strIn = new String(strIn.getBytes("ISO-8859-1"), "GBK"); strIn = new String(strIn.getBytes(StandardCharsets.ISO_8859_1), "GBK");
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
@ -222,7 +218,7 @@ public class oConvertUtils {
Integer[] result = new Integer[len]; Integer[] result = new Integer[len];
try { try {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
result[i] = new Integer(object[i].trim()); result[i] = Integer.valueOf(object[i].trim());
} }
return result; return result;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@ -287,7 +283,7 @@ public class oConvertUtils {
} }
public static long stringToLong(String str) { public static long stringToLong(String str) {
Long test = new Long(0); Long test = Long.valueOf(0);
try { try {
test = Long.valueOf(str); test = Long.valueOf(str);
} catch (Exception e) { } catch (Exception e) {
@ -778,11 +774,7 @@ public class oConvertUtils {
} }
} else { } else {
if (oldVal == null && newVal == null) { return oldVal == null && newVal == null;
return true;
} else {
return false;
}
} }
} }
@ -824,11 +816,7 @@ public class oConvertUtils {
Object[] newValArray = newVal.toArray(); Object[] newValArray = newVal.toArray();
return equalityOfArrays(oldValArray,newValArray); return equalityOfArrays(oldValArray,newValArray);
} else { } else {
if ((oldVal == null || oldVal.size() == 0) && (newVal == null || newVal.size() == 0)) { return (oldVal == null || oldVal.size() == 0) && (newVal == null || newVal.size() == 0);
return true;
} else {
return false;
}
} }
} }
@ -871,17 +859,13 @@ public class oConvertUtils {
* @param newVal * @param newVal
* @return * @return
*/ */
public static boolean equalityOfArrays(Object[] oldVal, Object newVal[]) { public static boolean equalityOfArrays(Object[] oldVal, Object[] newVal) {
if (oldVal != null && newVal != null) { if (oldVal != null && newVal != null) {
Arrays.sort(oldVal); Arrays.sort(oldVal);
Arrays.sort(newVal); Arrays.sort(newVal);
return Arrays.equals(oldVal, newVal); return Arrays.equals(oldVal, newVal);
} else { } else {
if ((oldVal == null || oldVal.length == 0) && (newVal == null || newVal.length == 0)) { return (oldVal == null || oldVal.length == 0) && (newVal == null || newVal.length == 0);
return true;
} else {
return false;
}
} }
} }
@ -915,7 +899,7 @@ public class oConvertUtils {
try { try {
//换个写法解决springboot读取jar包中文件的问题 //换个写法解决springboot读取jar包中文件的问题
InputStream stream = oConvertUtils.class.getClassLoader().getResourceAsStream(url.replace("classpath:", "")); InputStream stream = oConvertUtils.class.getClassLoader().getResourceAsStream(url.replace("classpath:", ""));
json = IOUtils.toString(stream,"UTF-8"); json = IOUtils.toString(stream, StandardCharsets.UTF_8);
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
} }
@ -996,7 +980,7 @@ public class oConvertUtils {
BigDecimal bigDecimal = new BigDecimal(uploadCount); BigDecimal bigDecimal = new BigDecimal(uploadCount);
//换算成MB //换算成MB
BigDecimal divide = bigDecimal.divide(new BigDecimal(1048576)); BigDecimal divide = bigDecimal.divide(new BigDecimal(1048576));
count = divide.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); count = divide.setScale(2, RoundingMode.HALF_UP).doubleValue();
return count; return count;
} }
return count; return count;

View File

@ -340,7 +340,7 @@ public class OssBootUtil {
} else { } else {
filePath = "https://" + bucketName + "." + endPoint + SymbolConstant.SINGLE_SLASH + fileUrl; filePath = "https://" + bucketName + "." + endPoint + SymbolConstant.SINGLE_SLASH + fileUrl;
} }
PutObjectResult result = ossClient.putObject(bucketName, fileUrl.toString(),stream); PutObjectResult result = ossClient.putObject(bucketName, fileUrl,stream);
// 设置权限(公开读) // 设置权限(公开读)
ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead); ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead);
if (result != null) { if (result != null) {

View File

@ -61,9 +61,9 @@ public abstract class AbstractQueryBlackListHandler {
if(list==null){ if(list==null){
return true; return true;
} }
log.info(" 获取sql信息 {} ", list.toString()); log.info(" 获取sql信息 {} ", list);
boolean flag = checkTableAndFieldsName(list); boolean flag = checkTableAndFieldsName(list);
if(flag == false){ if(!flag){
return false; return false;
} }
for (QueryTable table : list) { for (QueryTable table : list) {
@ -124,10 +124,7 @@ public abstract class AbstractQueryBlackListHandler {
*/ */
private boolean hasSpecialString(String name){ private boolean hasSpecialString(String name){
Matcher m = ILLEGAL_NAME_REG.matcher(name); Matcher m = ILLEGAL_NAME_REG.matcher(name);
if (m.find()) { return m.find();
return true;
}
return false;
} }

View File

@ -31,13 +31,13 @@ public class InjectionSyntaxObjectAnalyzer extends TablesNamesFinder {
private static final String DANGROUS_FUNCTIONS = "(sleep|benchmark|extractvalue|updatexml|ST_LatFromGeoHash|ST_LongFromGeoHash|GTID_SUBSET|GTID_SUBTRACT|floor|ST_Pointfromgeohash" private static final String DANGROUS_FUNCTIONS = "(sleep|benchmark|extractvalue|updatexml|ST_LatFromGeoHash|ST_LongFromGeoHash|GTID_SUBSET|GTID_SUBTRACT|floor|ST_Pointfromgeohash"
+ "|geometrycollection|multipoint|polygon|multipolygon|linestring|multilinestring)"; + "|geometrycollection|multipoint|polygon|multipolygon|linestring|multilinestring)";
private static ThreadLocal<Boolean> disableSubselect = new ThreadLocal<Boolean>() { private static final ThreadLocal<Boolean> disableSubselect = new ThreadLocal<Boolean>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return true; return true;
} }
}; };
private ConstAnalyzer constAnalyzer = new ConstAnalyzer(); private final ConstAnalyzer constAnalyzer = new ConstAnalyzer();
public InjectionSyntaxObjectAnalyzer() { public InjectionSyntaxObjectAnalyzer() {
super(); super();

View File

@ -2,7 +2,6 @@ package org.jeecg.common.util.sqlInjection;
import org.jeecg.common.exception.JeecgSqlInjectionException; import org.jeecg.common.exception.JeecgSqlInjectionException;
import org.jeecg.common.util.sqlInjection.parse.ParserSupport; import org.jeecg.common.util.sqlInjection.parse.ParserSupport;
;
/** /**
* SQL注入攻击分析器 * SQL注入攻击分析器

View File

@ -53,7 +53,7 @@ import net.sf.jsqlparser.statement.select.SubSelect;
*/ */
public class ConstAnalyzer implements ExpressionVisitor, ItemsListVisitor { public class ConstAnalyzer implements ExpressionVisitor, ItemsListVisitor {
private static ThreadLocal<Boolean> constFlag = new ThreadLocal<Boolean>() { private static final ThreadLocal<Boolean> constFlag = new ThreadLocal<Boolean>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return true; return true;

View File

@ -73,7 +73,7 @@ public class AutoPoiDictConfig implements AutoPoiDictServiceI {
} }
} }
if (dictReplaces != null && dictReplaces.size() != 0) { if (dictReplaces != null && dictReplaces.size() != 0) {
log.info("---AutoPoi--Get_DB_Dict------"+ dictReplaces.toString()); log.info("---AutoPoi--Get_DB_Dict------"+ dictReplaces);
return dictReplaces.toArray(new String[dictReplaces.size()]); return dictReplaces.toArray(new String[dictReplaces.size()]);
} }
return null; return null;

View File

@ -15,9 +15,6 @@ public class CorsFilterCondition implements Condition {
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Object object = context.getEnvironment().getProperty(CommonConstant.CLOUD_SERVER_KEY); Object object = context.getEnvironment().getProperty(CommonConstant.CLOUD_SERVER_KEY);
//如果没有服务注册发现的配置 说明是单体应用 则加载跨域配置 返回true //如果没有服务注册发现的配置 说明是单体应用 则加载跨域配置 返回true
if(object==null){ return object == null;
return true;
}
return false;
} }
} }

View File

@ -21,7 +21,7 @@ public class DruidWallConfigRegister implements SpringApplicationRunListener {
public SpringApplication application; public SpringApplication application;
private String[] args; private final String[] args;
/** /**

View File

@ -15,9 +15,6 @@ public class JeecgCloudCondition implements Condition {
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Object object = context.getEnvironment().getProperty(CommonConstant.CLOUD_SERVER_KEY); Object object = context.getEnvironment().getProperty(CommonConstant.CLOUD_SERVER_KEY);
//如果没有服务注册发现的配置 说明是单体应用 //如果没有服务注册发现的配置 说明是单体应用
if(object==null){ return object != null;
return false;
}
return true;
} }
} }

View File

@ -10,7 +10,7 @@ import org.apache.shiro.authc.AuthenticationToken;
public class JwtToken implements AuthenticationToken { public class JwtToken implements AuthenticationToken {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String token; private final String token;
public JwtToken(String token) { public JwtToken(String token) {
this.token = token; this.token = token;

View File

@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*; import java.io.*;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/** /**
* 保存过滤器里面的流 * 保存过滤器里面的流
@ -22,7 +23,7 @@ public class BodyReaderHttpServletRequestWrapper extends HttpServletRequestWrapp
super(request); super(request);
String sessionStream = getBodyString(request); String sessionStream = getBodyString(request);
body = sessionStream.getBytes(Charset.forName("UTF-8")); body = sessionStream.getBytes(StandardCharsets.UTF_8);
} }
/** /**
@ -35,7 +36,7 @@ public class BodyReaderHttpServletRequestWrapper extends HttpServletRequestWrapp
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try (InputStream inputStream = cloneInputStream(request.getInputStream()); try (InputStream inputStream = cloneInputStream(request.getInputStream());
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")))) { BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
String line; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
sb.append(line); sb.append(line);

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.SortedMap; import java.util.SortedMap;
@ -42,12 +43,12 @@ public class HttpUtils {
String pathVariable = request.getRequestURI().substring(request.getRequestURI().lastIndexOf("/") + 1); String pathVariable = request.getRequestURI().substring(request.getRequestURI().lastIndexOf("/") + 1);
if (pathVariable.contains(SymbolConstant.COMMA)) { if (pathVariable.contains(SymbolConstant.COMMA)) {
log.info(" pathVariable: {}",pathVariable); log.info(" pathVariable: {}",pathVariable);
String deString = URLDecoder.decode(pathVariable, "UTF-8"); String deString = URLDecoder.decode(pathVariable, StandardCharsets.UTF_8);
//https://www.52dianzi.com/category/article/37/565371.html //https://www.52dianzi.com/category/article/37/565371.html
if(deString.contains("%")){ if(deString.contains("%")){
try { try {
deString = URLDecoder.decode(deString, "UTF-8"); deString = URLDecoder.decode(deString, StandardCharsets.UTF_8);
log.info("存在%情况下,执行两次解码 — pathVariable decode: {}",deString); log.info("存在%情况下,执行两次解码 — pathVariable decode: {}",deString);
} catch (Exception e) { } catch (Exception e) {
//e.printStackTrace(); //e.printStackTrace();
@ -92,11 +93,11 @@ public class HttpUtils {
String pathVariable = url.substring(url.lastIndexOf("/") + 1); String pathVariable = url.substring(url.lastIndexOf("/") + 1);
if (pathVariable.contains(SymbolConstant.COMMA)) { if (pathVariable.contains(SymbolConstant.COMMA)) {
log.info(" pathVariable: {}",pathVariable); log.info(" pathVariable: {}",pathVariable);
String deString = URLDecoder.decode(pathVariable, "UTF-8"); String deString = URLDecoder.decode(pathVariable, StandardCharsets.UTF_8);
//https://www.52dianzi.com/category/article/37/565371.html //https://www.52dianzi.com/category/article/37/565371.html
if(deString.contains("%")){ if(deString.contains("%")){
deString = URLDecoder.decode(deString, "UTF-8"); deString = URLDecoder.decode(deString, StandardCharsets.UTF_8);
log.info("存在%情况下,执行两次解码 — pathVariable decode: {}",deString); log.info("存在%情况下,执行两次解码 — pathVariable decode: {}",deString);
} }
log.info(" pathVariable decode: {}",deString); log.info(" pathVariable decode: {}",deString);
@ -152,7 +153,7 @@ public class HttpUtils {
} }
String wholeStr = new String(body); String wholeStr = new String(body);
// 转化成json对象 // 转化成json对象
return JSONObject.parseObject(wholeStr.toString(), Map.class); return JSONObject.parseObject(wholeStr, Map.class);
} }
/** /**
@ -166,11 +167,7 @@ public class HttpUtils {
return result; return result;
} }
String param = ""; String param = "";
try { param = URLDecoder.decode(request.getQueryString(), StandardCharsets.UTF_8);
param = URLDecoder.decode(request.getQueryString(), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String[] params = param.split("&"); String[] params = param.split("&");
for (String s : params) { for (String s : params) {
int index = s.indexOf("="); int index = s.indexOf("=");
@ -194,11 +191,7 @@ public class HttpUtils {
return result; return result;
} }
String param = ""; String param = "";
try { param = URLDecoder.decode(queryString, StandardCharsets.UTF_8);
param = URLDecoder.decode(queryString, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String[] params = param.split("&"); String[] params = param.split("&");
for (String s : params) { for (String s : params) {
int index = s.indexOf("="); int index = s.indexOf("=");

View File

@ -11,6 +11,7 @@ import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.SortedMap; import java.util.SortedMap;
/** /**
@ -55,12 +56,7 @@ public class SignUtil {
if(oConvertUtils.isEmpty(signatureSecret) || signatureSecret.contains(curlyBracket)){ if(oConvertUtils.isEmpty(signatureSecret) || signatureSecret.contains(curlyBracket)){
throw new JeecgBootException("签名密钥 ${jeecg.signatureSecret} 缺少配置 "); throw new JeecgBootException("签名密钥 ${jeecg.signatureSecret} 缺少配置 ");
} }
try { //issues/I484RW2.4.6部署后下拉搜索框提示sign签名检验失败
//issues/I484RW2.4.6部署后下拉搜索框提示sign签名检验失败 return DigestUtils.md5DigestAsHex((paramsJsonStr + signatureSecret).getBytes(StandardCharsets.UTF_8)).toUpperCase();
return DigestUtils.md5DigestAsHex((paramsJsonStr + signatureSecret).getBytes("UTF-8")).toUpperCase();
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(),e);
return null;
}
} }
} }

View File

@ -162,7 +162,7 @@ public class DictUtils {
tmpValue = this.commonAPI.translateDict(code, k.trim()); tmpValue = this.commonAPI.translateDict(code, k.trim());
} }
if (tmpValue != null) { if (tmpValue != null) {
if (!"".equals(textValue.toString())) { if (!"".contentEquals(textValue)) {
textValue.append(","); textValue.append(",");
} }
textValue.append(tmpValue); textValue.append(tmpValue);

View File

@ -28,7 +28,7 @@ public class OpenAISSEEventSourceListener extends EventSourceListener {
private long tokens; private long tokens;
private SseEmitter sseEmitter; private final SseEmitter sseEmitter;
private String topicId; private String topicId;
/** /**

View File

@ -12,6 +12,7 @@ import javax.swing.filechooser.FileSystemView;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -191,7 +192,7 @@ public class MockController {
//json = FileUtils.re.readFileToString(jsonFile); //json = FileUtils.re.readFileToString(jsonFile);
//换个写法解决springboot读取jar包中文件的问题 //换个写法解决springboot读取jar包中文件的问题
InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", "")); InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", ""));
json = IOUtils.toString(stream,"UTF-8"); json = IOUtils.toString(stream, StandardCharsets.UTF_8);
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
} }

View File

@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
/** /**
@ -240,7 +241,7 @@ public class VxeMockController {
} else { } else {
System.out.println("-- 高级查询模式:" + matchType.getValue()); System.out.println("-- 高级查询模式:" + matchType.getValue());
} }
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8"); superQueryParams = URLDecoder.decode(superQueryParams, StandardCharsets.UTF_8);
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class); List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
if (conditions != null) { if (conditions != null) {
for (QueryCondition condition : conditions) { for (QueryCondition condition : conditions) {
@ -402,7 +403,7 @@ public class VxeMockController {
try { try {
InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", "")); InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
if (stream != null) { if (stream != null) {
String json = IOUtils.toString(stream, "UTF-8"); String json = IOUtils.toString(stream, StandardCharsets.UTF_8);
return JSON.parseArray(json); return JSON.parseArray(json);
} }
} catch (IOException e) { } catch (IOException e) {

View File

@ -47,12 +47,12 @@ public class VxeSocket {
* 因为一个用户可能打开多个页面多个页面就会有多个连接 * 因为一个用户可能打开多个页面多个页面就会有多个连接
* key是userIdvalue是Map对象子Map的key是pageIdvalue是VXESocket对象 * key是userIdvalue是Map对象子Map的key是pageIdvalue是VXESocket对象
*/ */
private static Map<String, Map<String, VxeSocket>> userPool = new HashMap<>(); private static final Map<String, Map<String, VxeSocket>> userPool = new HashMap<>();
/** /**
* 连接池包含所有WebSocket连接 * 连接池包含所有WebSocket连接
* key是socketIdvalue是VXESocket对象 * key是socketIdvalue是VXESocket对象
*/ */
private static Map<String, VxeSocket> socketPool = new HashMap<>(); private static final Map<String, VxeSocket> socketPool = new HashMap<>();
/** /**
* 获取某个用户所有的页面 * 获取某个用户所有的页面

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.test.controller;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -182,15 +183,11 @@ public class JoaDemoController {
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件 // Step.1 组装查询条件
QueryWrapper<JoaDemo> queryWrapper = null; QueryWrapper<JoaDemo> queryWrapper = null;
try { String paramsStr = request.getParameter("paramsStr");
String paramsStr = request.getParameter("paramsStr"); if (oConvertUtils.isNotEmpty(paramsStr)) {
if (oConvertUtils.isNotEmpty(paramsStr)) { String deString = URLDecoder.decode(paramsStr, StandardCharsets.UTF_8);
String deString = URLDecoder.decode(paramsStr, "UTF-8"); JoaDemo joaDemo = JSON.parseObject(deString, JoaDemo.class);
JoaDemo joaDemo = JSON.parseObject(deString, JoaDemo.class); queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, request.getParameterMap());
queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} }
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel

View File

@ -22,7 +22,7 @@ public interface JeecgDemoMapper extends BaseMapper<JeecgDemo> {
* @param name 姓名 * @param name 姓名
* @return demo集合 * @return demo集合
*/ */
public List<JeecgDemo> getDemoByName(@Param("name") String name); List<JeecgDemo> getDemoByName(@Param("name") String name);
/** /**
* 查询列表数据 直接传数据权限的sql进行数据过滤 * 查询列表数据 直接传数据权限的sql进行数据过滤
@ -30,14 +30,14 @@ public interface JeecgDemoMapper extends BaseMapper<JeecgDemo> {
* @param permissionSql * @param permissionSql
* @return * @return
*/ */
public IPage<JeecgDemo> queryListWithPermission(Page<JeecgDemo> page,@Param("permissionSql")String permissionSql); IPage<JeecgDemo> queryListWithPermission(Page<JeecgDemo> page, @Param("permissionSql") String permissionSql);
/** /**
* 根据前缀获取所有有效权限 * 根据前缀获取所有有效权限
* @param permsPrefix * @param permsPrefix
* @return * @return
*/ */
public List<String> queryAllAuth(@Param("permsPrefix")String permsPrefix); List<String> queryAllAuth(@Param("permsPrefix") String permsPrefix);
/** /**
* 查询用户已授权字段 * 查询用户已授权字段
@ -45,7 +45,7 @@ public interface JeecgDemoMapper extends BaseMapper<JeecgDemo> {
* @param permsPrefix * @param permsPrefix
* @return * @return
*/ */
public List<String> queryUserAuth(@Param("userId")String userId,@Param("permsPrefix")String permsPrefix); List<String> queryUserAuth(@Param("userId") String userId, @Param("permsPrefix") String permsPrefix);
/** /**

View File

@ -22,7 +22,7 @@ public interface JeecgOrderCustomerMapper extends BaseMapper<JeecgOrderCustomer>
* @return * @return
*/ */
@Delete("DELETE FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}") @Delete("DELETE FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
public boolean deleteCustomersByMainId(String mainId); boolean deleteCustomersByMainId(String mainId);
/** /**
* 通过主表订单外键查询客户 * 通过主表订单外键查询客户
@ -30,5 +30,5 @@ public interface JeecgOrderCustomerMapper extends BaseMapper<JeecgOrderCustomer>
* @return 订单客户集合 * @return 订单客户集合
*/ */
@Select("SELECT * FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}") @Select("SELECT * FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId); List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
} }

View File

@ -21,7 +21,7 @@ public interface JeecgOrderTicketMapper extends BaseMapper<JeecgOrderTicket> {
* @return * @return
*/ */
@Delete("DELETE FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}") @Delete("DELETE FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
public boolean deleteTicketsByMainId(String mainId); boolean deleteTicketsByMainId(String mainId);
/** /**
* 通过主表订单外键查询订单机票 * 通过主表订单外键查询订单机票
@ -29,5 +29,5 @@ public interface JeecgOrderTicketMapper extends BaseMapper<JeecgOrderTicket> {
* @return 返回订单机票集合 * @return 返回订单机票集合
*/ */
@Select("SELECT * FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}") @Select("SELECT * FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId); List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
} }

View File

@ -18,14 +18,14 @@ public interface IJeecgDemoService extends JeecgService<JeecgDemo> {
/** /**
* 测试事务 * 测试事务
*/ */
public void testTran(); void testTran();
/** /**
* 通过id过去demo数据先读缓存在读数据库 * 通过id过去demo数据先读缓存在读数据库
* @param id 数据库id * @param id 数据库id
* @return demo对象 * @return demo对象
*/ */
public JeecgDemo getByIdCacheable(String id); JeecgDemo getByIdCacheable(String id);
/** /**
* 查询列表数据 在service中获取数据权限sql信息 * 查询列表数据 在service中获取数据权限sql信息

View File

@ -16,13 +16,13 @@ public interface IJeecgDynamicDataService extends JeecgService<JeecgDemo> {
* 测试从header获取数据源 * 测试从header获取数据源
* @return * @return
*/ */
public List<JeecgDemo> selectSpelByHeader(); List<JeecgDemo> selectSpelByHeader();
/** /**
* 使用spel从参数获取 * 使用spel从参数获取
* @param dsName * @param dsName
* @return * @return
*/ */
public List<JeecgDemo> selectSpelByKey(String dsName); List<JeecgDemo> selectSpelByKey(String dsName);
} }

View File

@ -19,5 +19,5 @@ public interface IJeecgOrderCustomerService extends IService<JeecgOrderCustomer>
* @param mainId 订单id * @param mainId 订单id
* @return 订单顾客集合 * @return 订单顾客集合
*/ */
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId); List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
} }

View File

@ -24,7 +24,7 @@ public interface IJeecgOrderMainService extends IService<JeecgOrderMain> {
* @param jeecgOrderCustomerList 订单客户集合 * @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合 * @param jeecgOrderTicketList 订单机票集合
*/ */
public void saveMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList) ; void saveMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) ;
/** /**
* 修改一对多 * 修改一对多
@ -32,19 +32,19 @@ public interface IJeecgOrderMainService extends IService<JeecgOrderMain> {
* @param jeecgOrderCustomerList 订单客户集合 * @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合 * @param jeecgOrderTicketList 订单机票集合
*/ */
public void updateMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList); void updateMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList);
/** /**
* 删除一对多 * 删除一对多
* @param id 订单id * @param id 订单id
*/ */
public void delMain (String id); void delMain(String id);
/** /**
* 批量删除一对多 * 批量删除一对多
* @param idList 订单id集合 * @param idList 订单id集合
*/ */
public void delBatchMain (Collection<? extends Serializable> idList); void delBatchMain(Collection<? extends Serializable> idList);
/** /**
* 修改一对多 * 修改一对多
@ -52,5 +52,5 @@ public interface IJeecgOrderMainService extends IService<JeecgOrderMain> {
* @param jeecgOrderCustomerList 订单客户集合 * @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合 * @param jeecgOrderTicketList 订单机票集合
*/ */
public void updateCopyMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList); void updateCopyMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList);
} }

View File

@ -19,5 +19,5 @@ public interface IJeecgOrderTicketService extends IService<JeecgOrderTicket> {
* @param mainId 订单id * @param mainId 订单id
* @return 订单机票集合 * @return 订单机票集合
*/ */
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId); List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
} }

View File

@ -54,8 +54,7 @@ public class JeecgDemoServiceImpl extends ServiceImpl<JeecgDemoMapper, JeecgDemo
pp3.setAge(3333); pp3.setAge(3333);
pp3.setName("测试事务 小白兔 3"); pp3.setName("测试事务 小白兔 3");
jeecgDemoMapper.insert(pp3); jeecgDemoMapper.insert(pp3);
return ; }
}
/** /**

View File

@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
/** /**
@ -238,7 +239,7 @@ public class DlMockController {
} else { } else {
System.out.println("-- 高级查询模式:" + matchType.getValue()); System.out.println("-- 高级查询模式:" + matchType.getValue());
} }
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8"); superQueryParams = URLDecoder.decode(superQueryParams, StandardCharsets.UTF_8);
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class); List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
if (conditions != null) { if (conditions != null) {
for (QueryCondition condition : conditions) { for (QueryCondition condition : conditions) {
@ -400,7 +401,7 @@ public class DlMockController {
try { try {
InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", "")); InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
if (stream != null) { if (stream != null) {
String json = IOUtils.toString(stream, "UTF-8"); String json = IOUtils.toString(stream, StandardCharsets.UTF_8);
return JSON.parseArray(json); return JSON.parseArray(json);
} }
} catch (IOException e) { } catch (IOException e) {

View File

@ -22,9 +22,9 @@ public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
*/ */
boolean isUsed(String id); boolean isUsed(String id);
public void removeAllByDirectiveId(String directiveId); void removeAllByDirectiveId(String directiveId);
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds); List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds);
void insertAllRelation(List<DirectiveBodyTagRelation> relations); void insertAllRelation(List<DirectiveBodyTagRelation> relations);

View File

@ -22,9 +22,9 @@ public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTa
*/ */
boolean isUsed(String id); boolean isUsed(String id);
public void removeAllByDirectiveId(String directiveId); void removeAllByDirectiveId(String directiveId);
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds); List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds);
void insertAllRelation(List<DirectiveEmotionTagRelation> relations); void insertAllRelation(List<DirectiveEmotionTagRelation> relations);

View File

@ -148,21 +148,21 @@ public interface ISysBaseAPI extends CommonAPI {
* *
* @return List<DictModel> 字典集合 * @return List<DictModel> 字典集合
*/ */
public List<DictModel> queryAllDict(); List<DictModel> queryAllDict();
/** /**
* 12查询所有分类字典 * 12查询所有分类字典
* *
* @return * @return
*/ */
public List<SysCategoryModel> queryAllSysCategory(); List<SysCategoryModel> queryAllSysCategory();
/** /**
* 查询子集合 * 查询子集合
* *
* @return * @return
*/ */
public List<SysCategoryModel> queryCategoryByPid(String pid); List<SysCategoryModel> queryCategoryByPid(String pid);
/** /**
@ -170,7 +170,7 @@ public interface ISysBaseAPI extends CommonAPI {
* *
* @return * @return
*/ */
public List<DictModel> queryAllDepartBackDictModel(); List<DictModel> queryAllDepartBackDictModel();
/** /**
* 15根据业务类型及业务id修改消息已读 * 15根据业务类型及业务id修改消息已读
@ -178,7 +178,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param busType * @param busType
* @param busId * @param busId
*/ */
public void updateSysAnnounReadFlag(String busType, String busId); void updateSysAnnounReadFlag(String busType, String busId);
/** /**
* 16查询表字典 支持过滤数据 * 16查询表字典 支持过滤数据
@ -189,7 +189,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param filterSql * @param filterSql
* @return * @return
*/ */
public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql); List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);
/** /**
* 17查询指定table的 text code 获取字典包含text和value * 17查询指定table的 text code 获取字典包含text和value
@ -201,14 +201,14 @@ public interface ISysBaseAPI extends CommonAPI {
* @return * @return
*/ */
@Deprecated @Deprecated
public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray); List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);
/** /**
* 18查询所有用户 返回ComboModel * 18查询所有用户 返回ComboModel
* *
* @return * @return
*/ */
public List<ComboModel> queryAllUserBackCombo(); List<ComboModel> queryAllUserBackCombo();
/** /**
* 19分页查询用户 返回JSONObject * 19分页查询用户 返回JSONObject
@ -218,14 +218,14 @@ public interface ISysBaseAPI extends CommonAPI {
* @param pageSize 每页显示条数 * @param pageSize 每页显示条数
* @return * @return
*/ */
public JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize); JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize);
/** /**
* 20获取所有角色 * 20获取所有角色
* *
* @return * @return
*/ */
public List<ComboModel> queryAllRole(); List<ComboModel> queryAllRole();
/** /**
* 21获取所有角色 带参 * 21获取所有角色 带参
@ -233,7 +233,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param roleIds 默认选中角色 * @param roleIds 默认选中角色
* @return * @return
*/ */
public List<ComboModel> queryAllRole(String[] roleIds); List<ComboModel> queryAllRole(String[] roleIds);
/** /**
* 22通过用户账号查询角色Id集合 * 22通过用户账号查询角色Id集合
@ -241,7 +241,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param username * @param username
* @return * @return
*/ */
public List<String> getRoleIdsByUsername(String username); List<String> getRoleIdsByUsername(String username);
/** /**
* 23通过部门编号查询部门id * 23通过部门编号查询部门id
@ -249,14 +249,14 @@ public interface ISysBaseAPI extends CommonAPI {
* @param orgCode * @param orgCode
* @return * @return
*/ */
public String getDepartIdsByOrgCode(String orgCode); String getDepartIdsByOrgCode(String orgCode);
/** /**
* 24查询所有部门 * 24查询所有部门
* *
* @return * @return
*/ */
public List<SysDepartModel> getAllSysDepart(); List<SysDepartModel> getAllSysDepart();
/** /**
* 25查找父级部门 * 25查找父级部门
@ -272,7 +272,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param deptId * @param deptId
* @return * @return
*/ */
public List<String> getDeptHeadByDepId(String deptId); List<String> getDeptHeadByDepId(String deptId);
/** /**
* 27给指定用户发消息 * 27给指定用户发消息
@ -280,7 +280,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param userIds * @param userIds
* @param cmd * @param cmd
*/ */
public void sendWebSocketMsg(String[] userIds, String cmd); void sendWebSocketMsg(String[] userIds, String cmd);
/** /**
* 28根据id获取所有参与用户 * 28根据id获取所有参与用户
@ -288,7 +288,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param userIds 多个用户id * @param userIds 多个用户id
* @return * @return
*/ */
public List<UserAccountInfo> queryAllUserByIds(String[] userIds); List<UserAccountInfo> queryAllUserByIds(String[] userIds);
/** /**
* 29将会议签到信息推动到预览 * 29将会议签到信息推动到预览
@ -599,7 +599,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param orgCode 部门编码 * @param orgCode 部门编码
* @return * @return
*/ */
public List<String> getUserAccountsByDepCode(String orgCode); List<String> getUserAccountsByDepCode(String orgCode);
/** /**
* 检查查询sql的表和字段是否在白名单中 * 检查查询sql的表和字段是否在白名单中

View File

@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
/** /**
@ -98,7 +99,7 @@ public class DictTableWhiteListHandlerImpl implements IDictTableWhiteListHandler
} }
try { try {
// 针对转义字符进行解码 // 针对转义字符进行解码
dictCodeString = URLDecoder.decode(dictCodeString, "UTF-8"); dictCodeString = URLDecoder.decode(dictCodeString, StandardCharsets.UTF_8);
} catch (Exception e) { } catch (Exception e) {
log.warn(e.getMessage()); log.warn(e.getMessage());
//this.throwException("字典code解码失败可能是使用了非法字符请检查"); //this.throwException("字典code解码失败可能是使用了非法字符请检查");
@ -248,7 +249,7 @@ public class DictTableWhiteListHandlerImpl implements IDictTableWhiteListHandler
String tableName = arr[0].trim(); String tableName = arr[0].trim();
//20230814解决使用参数tableName=sys_user t&复测漏洞仍然存在 //20230814解决使用参数tableName=sys_user t&复测漏洞仍然存在
if (tableName.contains(".")) { if (tableName.contains(".")) {
tableName = tableName.substring(tableName.indexOf(".") + 1, tableName.length()).trim(); tableName = tableName.substring(tableName.indexOf(".") + 1).trim();
} }
if (tableName.contains(" ")) { if (tableName.contains(" ")) {
tableName = tableName.substring(0, tableName.indexOf(" ")).trim(); tableName = tableName.substring(0, tableName.indexOf(" ")).trim();

View File

@ -46,7 +46,7 @@ public class CodeTemplateInitListener implements ApplicationListener<Application
URL url = re.getURL(); URL url = re.getURL();
String filepath = url.getPath(); String filepath = url.getPath();
//System.out.println("native url= " + filepath); //System.out.println("native url= " + filepath);
filepath = java.net.URLDecoder.decode(filepath, "utf-8"); filepath = java.net.URLDecoder.decode(filepath, StandardCharsets.UTF_8);
//System.out.println("decode url= " + filepath); //System.out.println("decode url= " + filepath);
//2.在config下创建jeecg/code-template-online/*模板 //2.在config下创建jeecg/code-template-online/*模板

View File

@ -49,27 +49,25 @@ public class TenantPackUserLogAspect {
Integer tenantId = null; Integer tenantId = null;
//获取参数 //获取参数
Object[] args = joinPoint.getArgs(); Object[] args = joinPoint.getArgs();
if(args.length>0){ for (Object obj : args) {
for(Object obj: args){ if (obj instanceof SysTenantPack) {
if(obj instanceof SysTenantPack){ // logType=3 租户操作日志
// logType=3 租户操作日志 logType = CommonConstant.LOG_TYPE_3;
logType = CommonConstant.LOG_TYPE_3; SysTenantPack pack = (SysTenantPack) obj;
SysTenantPack pack = (SysTenantPack)obj; if (opType == 2) {
if(opType==2){ content = "创建了角色权限 " + pack.getPackName();
content = "创建了角色权限 "+ pack.getPackName();
}
tenantId = pack.getTenantId();
break;
}else if(obj instanceof SysTenantPackUser){
logType = CommonConstant.LOG_TYPE_3;
SysTenantPackUser packUser = (SysTenantPackUser)obj;
if(opType==2){
content = ""+packUser.getRealname()+" 添加到角色 "+ packUser.getPackName();
}else if(opType==4){
content = "移除了 "+packUser.getPackName()+" 成员 "+ packUser.getRealname();
}
tenantId = packUser.getTenantId();
} }
tenantId = pack.getTenantId();
break;
} else if (obj instanceof SysTenantPackUser) {
logType = CommonConstant.LOG_TYPE_3;
SysTenantPackUser packUser = (SysTenantPackUser) obj;
if (opType == 2) {
content = "" + packUser.getRealname() + " 添加到角色 " + packUser.getPackName();
} else if (opType == 4) {
content = "移除了 " + packUser.getPackName() + " 成员 " + packUser.getRealname();
}
tenantId = packUser.getTenantId();
} }
} }
if(logType!=null){ if(logType!=null){

View File

@ -577,7 +577,8 @@ public class SystemApiController {
@GetMapping("/sendEmailMsg") @GetMapping("/sendEmailMsg")
public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){ public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
this.sysBaseApi.sendEmailMsg(email,title,content); this.sysBaseApi.sendEmailMsg(email,title,content);
}; }
/** /**
* 41 获取公司下级部门和公司下所有用户信息 * 41 获取公司下级部门和公司下所有用户信息
* @param orgCode * @param orgCode

View File

@ -59,7 +59,7 @@ public class CasServiceUtil {
*/ */
private static String readResponse(HttpResponse response) throws IOException { private static String readResponse(HttpResponse response) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String result = new String(); String result = "";
String line; String line;
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
result += line; result += line;

View File

@ -138,7 +138,7 @@ public class QuartzJobController {
if (ids == null || "".equals(ids.trim())) { if (ids == null || "".equals(ids.trim())) {
return Result.error("参数不识别!"); return Result.error("参数不识别!");
} }
for (String id : Arrays.asList(ids.split(SymbolConstant.COMMA))) { for (String id : ids.split(SymbolConstant.COMMA)) {
QuartzJob job = quartzJobService.getById(id); QuartzJob job = quartzJobService.getById(id);
quartzJobService.deleteAndStopJob(job); quartzJobService.deleteAndStopJob(job);
} }

View File

@ -20,6 +20,6 @@ public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
* @param jobClassName 任务类名 * @param jobClassName 任务类名
* @return * @return
*/ */
public List<QuartzJob> findByJobClassName(@Param("jobClassName") String jobClassName); List<QuartzJob> findByJobClassName(@Param("jobClassName") String jobClassName);
} }

View File

@ -23,7 +23,7 @@ public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSen
* @param page * @param page
* @return * @return
*/ */
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel); List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page, @Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
/** /**
* 获取一条记录 * 获取一条记录

View File

@ -26,7 +26,7 @@ public interface SysCategoryMapper extends BaseMapper<SysCategory> {
* @param query * @param query
* @return * @return
*/ */
public List<TreeSelectModel> queryListByPid(@Param("pid") String pid,@Param("query") Map<String, String> query); List<TreeSelectModel> queryListByPid(@Param("pid") String pid, @Param("query") Map<String, String> query);
/** /**
* 通过code查询分类字典表 * 通过code查询分类字典表
@ -34,7 +34,7 @@ public interface SysCategoryMapper extends BaseMapper<SysCategory> {
* @return * @return
*/ */
@Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}") @Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
public String queryIdByCode(@Param("code") String code); String queryIdByCode(@Param("code") String code);
/** /**
* 获取分类字典最大的code * 获取分类字典最大的code

View File

@ -16,6 +16,6 @@ public interface SysDataLogMapper extends BaseMapper<SysDataLog>{
* @param dataId * @param dataId
* @return * @return
*/ */
public String queryMaxDataVer(@Param("tableName") String tableName,@Param("dataId") String dataId); String queryMaxDataVer(@Param("tableName") String tableName, @Param("dataId") String dataId);
} }

View File

@ -29,7 +29,7 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @param userId 用户id * @param userId 用户id
* @return List<SysDepart> * @return List<SysDepart>
*/ */
public List<SysDepart> queryUserDeparts(@Param("userId") String userId); List<SysDepart> queryUserDeparts(@Param("userId") String userId);
/** /**
* 根据用户名查询部门 * 根据用户名查询部门
@ -37,7 +37,7 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @param username * @param username
* @return * @return
*/ */
public List<SysDepart> queryDepartsByUsername(@Param("username") String username); List<SysDepart> queryDepartsByUsername(@Param("username") String username);
/** /**
* 根据用户名查询部门 * 根据用户名查询部门
@ -45,7 +45,7 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @param userId * @param userId
* @return * @return
*/ */
public List<String> queryDepartsByUserId(@Param("userId") String userId); List<String> queryDepartsByUserId(@Param("userId") String userId);
/** /**
* 通过部门编码获取部门id * 通过部门编码获取部门id
@ -53,14 +53,14 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @return String * @return String
*/ */
@Select("select id from sys_depart where org_code=#{orgCode}") @Select("select id from sys_depart where org_code=#{orgCode}")
public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode); String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
/** /**
* 通过部门id查询部门下的用户的账号 * 通过部门id查询部门下的用户的账号
* @param departIds 部门ID集合 * @param departIds 部门ID集合
* @return String * @return String
*/ */
public List<String> queryUserAccountByDepartIds(@Param("departIds") List<String> departIds); List<String> queryUserAccountByDepartIds(@Param("departIds") List<String> departIds);
/** /**
* 通过部门id 查询部门id,父id * 通过部门id 查询部门id,父id
@ -68,7 +68,7 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @return * @return
*/ */
@Select("select id,parent_id from sys_depart where id=#{departId}") @Select("select id,parent_id from sys_depart where id=#{departId}")
public SysDepart getParentDepartId(@Param("departId") String departId); SysDepart getParentDepartId(@Param("departId") String departId);
/** /**
* 根据部门Id查询,当前和下级所有部门IDS * 根据部门Id查询,当前和下级所有部门IDS

View File

@ -19,5 +19,5 @@ public interface SysDepartRoleMapper extends BaseMapper<SysDepartRole> {
* @param userId * @param userId
* @return * @return
*/ */
public List<SysDepartRole> queryDeptRoleByDeptAndUser(@Param("orgCode") String orgCode, @Param("userId") String userId); List<SysDepartRole> queryDeptRoleByDeptAndUser(@Param("orgCode") String orgCode, @Param("userId") String userId);
} }

View File

@ -22,5 +22,5 @@ public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
* @return * @return
*/ */
@Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc") @Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
public List<SysDictItem> selectItemsByMainId(String mainId); List<SysDictItem> selectItemsByMainId(String mainId);
} }

View File

@ -33,7 +33,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return * @return
*/ */
@Deprecated @Deprecated
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo); Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
/** /**
* 重复校验 sql语句 * 重复校验 sql语句
@ -41,14 +41,14 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return * @return
*/ */
@Deprecated @Deprecated
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo); Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
/** /**
* 通过字典code获取字典数据 * 通过字典code获取字典数据
* @param code 字典code * @param code 字典code
* @return List<DictModel> * @return List<DictModel>
*/ */
public List<DictModel> queryDictItemsByCode(@Param("code") String code); List<DictModel> queryDictItemsByCode(@Param("code") String code);
/** /**
* 查询有效的数据字典项 * 查询有效的数据字典项
@ -64,7 +64,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @param dictCodeList * @param dictCodeList
* @return * @return
*/ */
public List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList); List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList);
/** /**
* 通过字典code获取字典数据 * 通过字典code获取字典数据
@ -72,7 +72,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @param key * @param key
* @return * @return
*/ */
public String queryDictTextByKey(@Param("code") String code,@Param("key") String key); String queryDictTextByKey(@Param("code") String code, @Param("key") String key);
/** /**
* 可通过多个字典code查询翻译文本 * 可通过多个字典code查询翻译文本
@ -86,19 +86,19 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* 查询系统所有字典项 * 查询系统所有字典项
* @return * @return
*/ */
public List<DictModelMany> queryAllDictItems(List<Integer> tenantIdList); List<DictModelMany> queryAllDictItems(List<Integer> tenantIdList);
/** /**
* 查询所有部门 作为字典信息 id -->value,departName -->text * 查询所有部门 作为字典信息 id -->value,departName -->text
* @return * @return
*/ */
public List<DictModel> queryAllDepartBackDictModel(); List<DictModel> queryAllDepartBackDictModel();
/** /**
* 查询所有用户 作为字典信息 username -->value,realname -->text * 查询所有用户 作为字典信息 username -->value,realname -->text
* @return * @return
*/ */
public List<DictModel> queryAllUserBackDictModel(); List<DictModel> queryAllUserBackDictModel();
/** /**
* 根据表名显示字段名存储字段名 查询树 * 根据表名显示字段名存储字段名 查询树
@ -121,14 +121,14 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @param id * @param id
*/ */
@Select("delete from sys_dict where id = #{id}") @Select("delete from sys_dict where id = #{id}")
public void deleteOneById(@Param("id") String id); void deleteOneById(@Param("id") String id);
/** /**
* 查询被逻辑删除的数据 * 查询被逻辑删除的数据
* @return * @return
*/ */
@Select("select * from sys_dict where del_flag = 1 and tag = #{tag}") @Select("select * from sys_dict where del_flag = 1 and tag = #{tag}")
public List<SysDict> queryDeleteList(@Param("tag") String tag); List<SysDict> queryDeleteList(@Param("tag") String tag);
/** /**
* 修改状态值 * 修改状态值
@ -136,7 +136,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @param id * @param id
*/ */
@Update("update sys_dict set del_flag = #{flag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR}") @Update("update sys_dict set del_flag = #{flag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR}")
public void updateDictDelFlag(@Param("flag") int delFlag, @Param("id") String id); void updateDictDelFlag(@Param("flag") int delFlag, @Param("id") String id);
/** /**
@ -146,7 +146,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return * @return
*/ */
@Deprecated @Deprecated
public Page<DictModel> queryDictTablePageList(Page page, @Param("query") DictQuery query); Page<DictModel> queryDictTablePageList(Page page, @Param("query") DictQuery query);
/** /**

View File

@ -22,7 +22,7 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
/** /**
* 清空所有日志记录 * 清空所有日志记录
*/ */
public void removeAll(); void removeAll();
/** /**
* 获取系统总访问次数 * 获取系统总访问次数

View File

@ -23,6 +23,6 @@ public interface SysPermissionDataRuleMapper extends BaseMapper<SysPermissionDat
* @param permissionId * @param permissionId
* @return * @return
*/ */
public List<String> queryDataRuleIds(@Param("username") String username,@Param("permissionId") String permissionId); List<String> queryDataRuleIds(@Param("username") String username, @Param("permissionId") String permissionId);
} }

View File

@ -25,14 +25,14 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
* @param parentId * @param parentId
* @return * @return
*/ */
public List<TreeModel> queryListByParentId(@Param("parentId") String parentId); List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
/** /**
* 根据用户查询用户权限 * 根据用户查询用户权限
* @param userId 用户ID * @param userId 用户ID
* @return List<SysPermission> * @return List<SysPermission>
*/ */
public List<SysPermission> queryByUser(@Param("userId") String userId); List<SysPermission> queryByUser(@Param("userId") String userId);
/** /**
* 修改菜单状态字段 是否子节点 * 修改菜单状态字段 是否子节点
@ -41,22 +41,22 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
* @return int * @return int
*/ */
@Update("update sys_permission set is_leaf=#{leaf} where id = #{id}") @Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
public int setMenuLeaf(@Param("id") String id,@Param("leaf") int leaf); int setMenuLeaf(@Param("id") String id, @Param("leaf") int leaf);
/** /**
* 切换vue3菜单 * 切换vue3菜单
*/ */
@Update("alter table sys_permission rename to sys_permission_v2") @Update("alter table sys_permission rename to sys_permission_v2")
public void backupVue2Menu(); void backupVue2Menu();
@Update("alter table sys_permission_v3 rename to sys_permission") @Update("alter table sys_permission_v3 rename to sys_permission")
public void changeVue3Menu(); void changeVue3Menu();
/** /**
* 获取模糊匹配规则的数据权限URL * 获取模糊匹配规则的数据权限URL
* @return List<String> * @return List<String>
*/ */
@Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'") @Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
public List<String> queryPermissionUrlWithStar(); List<String> queryPermissionUrlWithStar();
/** /**
@ -65,7 +65,7 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
* @param username * @param username
* @return * @return
*/ */
public int queryCountByUsername(@Param("username") String username, @Param("permission") SysPermission sysPermission); int queryCountByUsername(@Param("username") String username, @Param("permission") SysPermission sysPermission);
/** /**

View File

@ -27,14 +27,14 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @param username * @param username
* @return * @return
*/ */
public SysUser getUserByName(@Param("username") String username); SysUser getUserByName(@Param("username") String username);
/** /**
* 通过用户账号查询用户Id * 通过用户账号查询用户Id
* @param username * @param username
* @return * @return
*/ */
public String getUserIdByName(@Param("username") String username); String getUserIdByName(@Param("username") String username);
/** /**
* 根据部门Id查询用户信息 * 根据部门Id查询用户信息
@ -90,7 +90,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @param phone * @param phone
* @return * @return
*/ */
public SysUser getUserByPhone(@Param("phone") String phone); SysUser getUserByPhone(@Param("phone") String phone);
/** /**
@ -98,7 +98,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @param email * @param email
* @return * @return
*/ */
public SysUser getUserByEmail(@Param("email")String email); SysUser getUserByEmail(@Param("email") String email);
/** /**
* 根据 orgCode 查询用户包括子部门下的用户 * 根据 orgCode 查询用户包括子部门下的用户

View File

@ -171,11 +171,7 @@ public class SysDepartTreeModel implements Serializable {
this.directorUserIds = sysDepart.getDirectorUserIds(); this.directorUserIds = sysDepart.getDirectorUserIds();
this.picUrl = sysDepart.getPicUrl(); this.picUrl = sysDepart.getPicUrl();
this.payableAmount = sysDepart.getPayableAmount(); this.payableAmount = sysDepart.getPayableAmount();
if (0 == sysDepart.getIzLeaf()) { this.isLeaf = 0 != sysDepart.getIzLeaf();
this.isLeaf = false;
} else {
this.isLeaf = true;
}
} }
public boolean getIsLeaf() { public boolean getIsLeaf() {

View File

@ -62,7 +62,7 @@ public class CategoryCodeRule implements IFillRuleHandler {
} else { } else {
//情况2 //情况2
//update-begin---author:wangshuai ---date:20230424 forissues/4846开启saas多租户功能后租户管理员在添加分类字典时报错------------ //update-begin---author:wangshuai ---date:20230424 forissues/4846开启saas多租户功能后租户管理员在添加分类字典时报错------------
SysCategory parent = (SysCategory) baseMapper.selectSysCategoryById(categoryPid); SysCategory parent = baseMapper.selectSysCategoryById(categoryPid);
//update-end---author:wangshuai ---date:20230424 forissues/4846开启saas多租户功能后租户管理员在添加分类字典时报错------------ //update-end---author:wangshuai ---date:20230424 forissues/4846开启saas多租户功能后租户管理员在添加分类字典时报错------------
categoryCode = YouBianCodeUtil.getSubYouBianCode(parent.getCode(), null); categoryCode = YouBianCodeUtil.getSubYouBianCode(parent.getCode(), null);
} }

Some files were not shown because too many files have changed in this diff Show More