add 增加标协会议时,同步到会员系统
This commit is contained in:
+5
@@ -299,4 +299,9 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
List<SysDepartTreeModel> listSonDepartsByDepId(String departId);
|
||||
|
||||
/**
|
||||
* 根据文件id获取文件名称
|
||||
*/
|
||||
String findFileNameByFileId(String fileId);
|
||||
|
||||
}
|
||||
|
||||
@@ -140,4 +140,31 @@ public class Result<T> implements Serializable {
|
||||
@JsonIgnore
|
||||
private String onlTable;
|
||||
|
||||
public static final String OPERATING_SUCCESS = "操作成功!";
|
||||
|
||||
public static final String SELECT_SUCCESS = "查询成功!";
|
||||
|
||||
public static final String ADD_SUCCESS = "新增成功!";
|
||||
|
||||
public static final String EDIT_SUCCESS = "编辑成功!";
|
||||
|
||||
public static final String DELETE_SUCCESS = "删除成功!";
|
||||
|
||||
public static final String UPLOAD_SUCCESS = "上传成功!";
|
||||
|
||||
public static final String EXPORT_SUCCESS = "导出成功!";
|
||||
|
||||
public static final String IMPORT_SUCCESS = "导入成功!";
|
||||
|
||||
public static final String DOWNLOAD_SUCCESS = "下载成功!";
|
||||
|
||||
public static final String SYSTEM_IS_BUSY = "系统繁忙!";
|
||||
|
||||
public static final String OPERATING_ERROR = "操作失败!";
|
||||
|
||||
public static final String NULL_ID = "请核实主键是否存在!";
|
||||
|
||||
public static final String NULL_NAME = "请核实名称是否存在!";
|
||||
|
||||
public static final String NULL_DATA = "请核实数据是否存在!";
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import com.jero.common.util.superSearch.ConstantUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 断言工具类
|
||||
*
|
||||
* @author 张星星
|
||||
* @date 2021-01-09
|
||||
*/
|
||||
@Slf4j
|
||||
public class Assert {
|
||||
|
||||
private Assert() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 正数11位,小数2位,长度14位 11111111111.22
|
||||
*
|
||||
* @param s 待检查金额
|
||||
*/
|
||||
public static boolean checkMoney(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.MONEY);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 15位、18位、20位数字和大写英文字母
|
||||
*
|
||||
* @param s 待检查税号
|
||||
*/
|
||||
public static boolean checkTax(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.TAX);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s 待检查邮编
|
||||
*/
|
||||
public static boolean checkPostCode(String s) {
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.POSTCODE);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查邮箱
|
||||
*
|
||||
* @param s 待检查邮箱
|
||||
*/
|
||||
public static boolean isEmail(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.EMAIL_REGEX);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 口令长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类中至少3类
|
||||
*
|
||||
* @param s 密码
|
||||
*/
|
||||
public static boolean checkPassword(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.PASSWORD);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查网址
|
||||
*
|
||||
* @param s 待检查网址
|
||||
*/
|
||||
public static boolean iswebsit(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.WEBSITE);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查字符串是手机号
|
||||
*
|
||||
* @param s 待检查手机号
|
||||
*/
|
||||
public static boolean isTel(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.TEL_PHONE);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 例:022-12354678
|
||||
*
|
||||
* @param s 座机
|
||||
*/
|
||||
public static boolean checkZUOJI(String s) {
|
||||
|
||||
Pattern pattern = Pattern.compile(ConstantUtils.ZUOJI);
|
||||
Matcher matcher = pattern.matcher(s);
|
||||
if (!matcher.find()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 该方法有问题_暂时先不要使用
|
||||
* @param strParameter 字符串
|
||||
* @param limitLength 限制长度
|
||||
* @return
|
||||
*/
|
||||
// public static boolean valiDataStrByLength(String strParameter, int limitLength) {
|
||||
// int temp_int = 0;
|
||||
// byte[] b = strParameter.getBytes();
|
||||
// for (int i = 0; i < b.length; i++) {
|
||||
// if (b[i] >= 0) {
|
||||
// temp_int = temp_int + 1;
|
||||
// } else {
|
||||
// temp_int = temp_int + 2;
|
||||
// i++;
|
||||
// }
|
||||
// }
|
||||
// if (temp_int > limitLength) {
|
||||
// return false;
|
||||
// } else {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
|
||||
import com.jero.common.system.base.entity.JeroEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangHK
|
||||
* @ClassName:BaseUtil
|
||||
* @Company: 天津柒柒普惠服务外包有限公司
|
||||
* @Date: 2019-12-21 11:17
|
||||
* @Description:
|
||||
*/
|
||||
public class BaseUtil {
|
||||
/**
|
||||
* 新增封装
|
||||
* @param object 任意继承JeroEntity的对象
|
||||
* @param userId token解析得到的id
|
||||
*/
|
||||
public static void create(Object object, String userId){
|
||||
//要被封装的对象
|
||||
JeroEntity jeroEntity = (JeroEntity) object;
|
||||
//封装创建人
|
||||
jeroEntity.setCreateBy(userId);
|
||||
//封装创建时间
|
||||
jeroEntity.setCreateTime(new Date());
|
||||
//封装修改人
|
||||
jeroEntity.setUpdateBy(userId);
|
||||
//封装修改时间
|
||||
jeroEntity.setUpdateTime(new Date());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改封装
|
||||
* @param db 查询数据库得到的对象
|
||||
* @param object 任意继承JeroEntity的对象
|
||||
* @param userId token解析得到的id
|
||||
*/
|
||||
public static void update(Object db,Object object, String userId){
|
||||
JeroEntity baseDb = (JeroEntity) db;//查询数据库得到的对象
|
||||
JeroEntity jeroEntity = (JeroEntity) object;//要被封装的对象
|
||||
jeroEntity.setCreateBy(baseDb.getCreateBy());//封装创建人
|
||||
jeroEntity.setCreateTime(baseDb.getCreateTime());//封装创建时间
|
||||
jeroEntity.setUpdateBy(userId);//封装修改人
|
||||
jeroEntity.setUpdateTime(new Date());//封装修改时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除封装
|
||||
* @param object 任意继承JeroEntity的对象
|
||||
* @param userId token解析得到的id
|
||||
*/
|
||||
public static void delete(Object object, String userId) {
|
||||
JeroEntity jeroEntity = (JeroEntity) object;//要被封装的对象
|
||||
jeroEntity.setUpdateBy(userId);//封装修改人
|
||||
jeroEntity.setUpdateTime(new Date());//封装修改时间
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 去除文件名结尾时间戳工具类
|
||||
*
|
||||
* @author liJiaRao
|
||||
* @date 2021-06-17 10:32
|
||||
*/
|
||||
public class FileNameSeparateUtil {
|
||||
/**
|
||||
* 除文件名结尾时间戳
|
||||
*
|
||||
* @param fileName 带时间戳的文件名
|
||||
* @return 文件名
|
||||
*/
|
||||
public static String removeTimeStamp(String fileName) {
|
||||
String str = fileName;
|
||||
if (StringUtils.isNotBlank(fileName) && fileName.contains("_")) {
|
||||
int lastIndexOf = fileName.lastIndexOf("_");
|
||||
if (lastIndexOf != -1) {
|
||||
str = fileName.substring(0, fileName.lastIndexOf("_")) + fileName.substring(fileName.lastIndexOf("."));
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,7 +1,9 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import com.jero.common.api.CommonAPI;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
@@ -124,5 +126,15 @@ public class TokenUtils {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过token获取User
|
||||
*/
|
||||
public static LoginUser getUserByToken() {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//判断Entity是否存在
|
||||
if (user == null) {
|
||||
throw new JeroBootException("登录超时,请重新登录!");
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* 特殊符号替换
|
||||
*/
|
||||
public class charReplaceUtil {
|
||||
|
||||
public static String charReplace(String character) {
|
||||
if (StringUtils.isNotBlank(character)){
|
||||
character=character.replace("*", "\\*")
|
||||
.replace("%", "\\%")
|
||||
.replaceAll("_", "\\\\_");
|
||||
|
||||
}
|
||||
return character;
|
||||
}
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.jero.common.util.superSearch;
|
||||
|
||||
/**
|
||||
* 常量
|
||||
*
|
||||
* @author 张星星
|
||||
* @date 2021-01-09
|
||||
*/
|
||||
public class ConstantUtils {
|
||||
|
||||
private ConstantUtils() {
|
||||
|
||||
}
|
||||
|
||||
//检查金额
|
||||
public static final String EMAIL_REGEX = "^[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w]" +
|
||||
"(?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?$";
|
||||
|
||||
//金额
|
||||
public static final String MONEY = "^[1-9](\\d{1,10})?(\\.\\d{1,2})$|^0\\.([1-9](\\d{0,1})|\\d[1-9])$|^[1-9]\\d{0,10}$|^0$";
|
||||
|
||||
//税号
|
||||
public static final String TAX = "^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$";
|
||||
|
||||
//邮编
|
||||
public static final String POSTCODE = "^[0-9]\\d{5}$";
|
||||
|
||||
//密码 口令长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类中至少3类
|
||||
public static final String PASSWORD = "^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[~!@#$%^&*()_+`\\-={}:\";'<>?,./]).{8,30}$";
|
||||
|
||||
//网址
|
||||
public static final String WEBSITE = "^((https|http|ftp|rtsp|mms)?:\\/\\/)[^\\s]+";
|
||||
// public static final String WEBSITE = "^([hH][tT]{2}[pP]:/*|[hH][tT]{2}[pP][sS]:/*|[fF][tT][pP]:/*)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\\\/])+(\\\\?{0,1}(([A-Za-z0-9-~]+\\\\={0,1})([A-Za-z0-9-~]*)\\\\&{0,1})*)$";
|
||||
|
||||
//检查字符串是手机号
|
||||
public static final String TEL_PHONE = "^[1][3,4,5,6,7,8,9][0-9]{9}$";
|
||||
// public static final String TEL_PHONE = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$";
|
||||
|
||||
//座机号
|
||||
public static final String ZUOJI = "^0\\d{2,3}-?\\d{7,8}$";
|
||||
// public static final String ZUOJI = "^\\d{3}-\\d{7,8}|\\d{4}-\\d{7,8}$";
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user