This commit is contained in:
thinkgem
2022-06-21 09:27:05 +08:00
parent a4f9c5332c
commit 8951a3f07f
22 changed files with 133 additions and 120 deletions

View File

@@ -72,7 +72,8 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
* @param plainPassword 明文密码
* @return 16位salt密钥 + 40位hash密码
*/
public String encryptPassword(String plainPassword) {
@Override
public String encryptPassword(String plainPassword) {
String plain = EncodeUtils.decodeHtml(plainPassword);
byte[] salt = Sha1Utils.genSalt(SALT_SIZE);
byte[] hashPassword = Sha1Utils.sha1(plain.getBytes(), salt, HASH_INTERATIONS);
@@ -85,6 +86,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
* @param password 密文密码
* @return 验证成功返回true
*/
@Override
public boolean validatePassword(String plainPassword, String password) {
try{
String plain = EncodeUtils.decodeHtml(plainPassword);

View File

@@ -4,12 +4,12 @@
*/
package com.jeesite.common.utils.excel.fieldtype;
import java.util.List;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.sys.entity.Area;
import com.jeesite.modules.sys.utils.AreaUtils;
import java.util.List;
/**
* 字段类型转换
* @author ThinkGem
@@ -27,7 +27,8 @@ public class AreaType implements FieldType {
/**
* 获取对象值(导入)
*/
public Object getValue(String val) {
@Override
public Object getValue(String val) {
for (Area e : list){
if (StringUtils.trimToEmpty(val).equals(e.getAreaName())){
return e;
@@ -39,6 +40,7 @@ public class AreaType implements FieldType {
/**
* 获取对象值(导出)
*/
@Override
public String setValue(Object val) {
if (val != null && ((Area)val).getAreaName() != null){
return ((Area)val).getAreaName();

View File

@@ -27,6 +27,7 @@ public class CompanyType implements FieldType {
/**
* 获取对象值(导入)
*/
@Override
public Object getValue(String val) {
for (Company e : list){
if (StringUtils.trimToEmpty(val).equals(e.getCompanyName())){
@@ -39,6 +40,7 @@ public class CompanyType implements FieldType {
/**
* 设置对象值(导出)
*/
@Override
public String setValue(Object val) {
if (val != null && ((Company)val).getCompanyName() != null){
return ((Company)val).getCompanyName();

View File

@@ -27,7 +27,8 @@ public class OfficeType implements FieldType {
/**
* 获取对象值(导入)
*/
public Object getValue(String val) {
@Override
public Object getValue(String val) {
for (Office e : list){
if (StringUtils.trimToEmpty(val).equals(e.getOfficeName())){
return e;
@@ -39,7 +40,8 @@ public class OfficeType implements FieldType {
/**
* 设置对象值(导出)
*/
public String setValue(Object val) {
@Override
public String setValue(Object val) {
if (val != null && ((Office)val).getOfficeName() != null){
return ((Office)val).getOfficeName();
}

View File

@@ -31,7 +31,8 @@ public class PostListType implements FieldType {
/**
* 获取对象值(导入)
*/
public Object getValue(String val) {
@Override
public Object getValue(String val) {
List<String> list = new ArrayList<String>();
for (String s : StringUtils.split(val, ",")) {
for (Post e : postList) {
@@ -46,7 +47,8 @@ public class PostListType implements FieldType {
/**
* 设置对象值(导出)
*/
public String setValue(Object val) {
@Override
public String setValue(Object val) {
if (val != null) {
@SuppressWarnings("unchecked")
List<Post> postList = (List<Post>) val;

View File

@@ -31,7 +31,8 @@ public class RoleListType implements FieldType {
/**
* 获取对象值(导入)
*/
public Object getValue(String val) {
@Override
public Object getValue(String val) {
List<String> list = new ArrayList<String>();
for (String s : StringUtils.split(val, ",")) {
for (Role e : roleList) {
@@ -46,7 +47,8 @@ public class RoleListType implements FieldType {
/**
* 设置对象值(导出)
*/
public String setValue(Object val) {
@Override
public String setValue(Object val) {
if (val != null) {
@SuppressWarnings("unchecked")
List<Role> roleList = (List<Role>) val;

View File

@@ -4,18 +4,6 @@
*/
package com.jeesite.modules.msg.service;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeesite.common.callback.MethodCallback;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
@@ -28,17 +16,22 @@ import com.jeesite.modules.msg.dao.MsgInnerRecordDao;
import com.jeesite.modules.msg.entity.MsgInner;
import com.jeesite.modules.msg.entity.MsgInnerRecord;
import com.jeesite.modules.msg.entity.MsgPush;
import com.jeesite.modules.msg.entity.content.AppMsgContent;
import com.jeesite.modules.msg.entity.content.BaseMsgContent;
import com.jeesite.modules.msg.entity.content.EmailMsgContent;
import com.jeesite.modules.msg.entity.content.PcMsgContent;
import com.jeesite.modules.msg.entity.content.SmsMsgContent;
import com.jeesite.modules.msg.entity.content.*;
import com.jeesite.modules.msg.utils.MsgPushUtils;
import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.EmpUserService;
import io.netty.util.concurrent.DefaultThreadFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* 内部消息Service
@@ -192,16 +185,12 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
}
}
});
ListUtils.pageList(recordList, 100, new MethodCallback() {
@SuppressWarnings("unchecked")
public Object execute(Object... objs) {
return msgInnerRecordDao.insertBatch((List<MsgInnerRecord>)objs[0]);
}
});
msgInnerRecordDao.insertBatch(recordList, null);
// 手动触发消息推送任务
if (Global.TRUE.equals(Global.getProperty("msg.realtime.enabled"))){
msgPushThreadPool.submit(new Runnable() {
public void run() {
@Override
public void run() {
try{
MsgPushUtils.getMsgPushTask().execute();
}catch(Exception ex){

View File

@@ -4,16 +4,6 @@
*/
package com.jeesite.modules.sys.service.support;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.idgen.IdGen;
@@ -33,6 +23,14 @@ import com.jeesite.modules.sys.service.EmployeeService;
import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.EmpUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.util.List;
/**
* 员工管理Service
@@ -54,7 +52,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
*/
@PostConstruct
private void corpModelValid() throws Exception{
if (Global.isUseCorpModel() != Global.getPropertyToBoolean("user.useCorpModel", "false")){
if (!Global.isUseCorpModel().equals(Global.getPropertyToBoolean("user.useCorpModel", "false"))){
throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式似乎你的当前版本不是JeeSite专业版。\n");
}
}
@@ -93,6 +91,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
/**
* 查询全部用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserList(EmpUser empUser){
return dao.findUserList(empUser);
}
@@ -100,6 +99,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
/**
* 根据部门编码查询用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){
return dao.findUserListByOfficeCodes(empUser);
}
@@ -107,6 +107,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
/**
* 根据角色编码查询用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser){
return dao.findUserListByRoleCodes(empUser);
}
@@ -114,6 +115,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
/**
* 根据岗位编码查询用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserListByPostCodes(EmpUser empUser){
return dao.findUserListByPostCodes(empUser);
}
@@ -169,6 +171,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
* @param file 导入的用户数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/
@Override
@Transactional
public String importData(MultipartFile file, Boolean isUpdateSupport) {
if (file == null){

View File

@@ -95,7 +95,8 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
/**
* 查询当前员工关联的岗位信息
*/
public List<EmployeePost> findEmployeePostList(Employee employee){
@Override
public List<EmployeePost> findEmployeePostList(Employee employee){
EmployeePost employeePost = new EmployeePost();
employeePost.setEmpCode(employee.getEmpCode());
return employeePostDao.findList(employeePost);
@@ -104,6 +105,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
/**
* 查询当前员工关联的附属机构信息
*/
@Override
public List<EmployeeOffice> findEmployeeOfficeList(Employee employee){
EmployeeOffice employeeOffice = new EmployeeOffice();
employeeOffice.setEmpCode(employee.getEmpCode());

View File

@@ -43,7 +43,8 @@ public class LogServiceSupport extends CrudService<LogDao, Log>
/**
* 不使用数据库事务,执行插入日志
*/
@Transactional//(propagation=Propagation.NOT_SUPPORTED)
@Override
@Transactional//(propagation=Propagation.NOT_SUPPORTED)
public void insertLog(Log entity) {
DataSourceHolder.setJdbcTransaction(false);
dao.insert(entity);

View File

@@ -82,7 +82,8 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
* @param file 导入的机构数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/
@Transactional
@Override
@Transactional
public String importData(MultipartFile file, Boolean isUpdateSupport) {
if (file == null){
throw new ServiceException(text("请选择导入的数据文件!"));

View File

@@ -31,7 +31,8 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
/**
* 根据名称查询岗位
*/
public Post getByPostName(Post post) {
@Override
public Post getByPostName(Post post) {
Post where = new Post();
where.setPostName(post.getPostName());
return dao.getByEntity(where);