合并分支 'dev_third_stage' 到 'dev_2nd_period_test'
Dev third stage 查看合并请求 laws-nio/laws-weilai!226
This commit is contained in:
+3
-3
@@ -158,11 +158,11 @@ public class CommonController {
|
||||
// bizPath = "";
|
||||
// }
|
||||
}
|
||||
if(file.getOriginalFilename().length()>70){
|
||||
if(file.getOriginalFilename().length()>100){
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("文件名长度不能超过70位,请检查!");
|
||||
throw new JeroBootException("文件名长度不能超过100位,请检查!");
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
throw new JeroBootException("File name length cannot exceed 70 characters, please check!");
|
||||
throw new JeroBootException("File name length cannot exceed 100 characters, please check!");
|
||||
}
|
||||
}
|
||||
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
|
||||
|
||||
+2
@@ -4,6 +4,8 @@ public enum RoleEnum {
|
||||
ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2),
|
||||
MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3),
|
||||
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
|
||||
ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5),
|
||||
ENGINEER("工程师","engineer","engineer","1534020318437208065",6),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+13
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.system.vo.SysUserCacheInfo;
|
||||
import com.jero.modules.system.entity.PPEmployee;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
@@ -276,4 +277,16 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
boolean isAdministrator();
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否是工程接口人角色
|
||||
* @return
|
||||
*/
|
||||
boolean isEngineeringInterfacePerson(LoginUser currentUser);
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否是工程师角色
|
||||
* @return
|
||||
*/
|
||||
boolean isEngineer(LoginUser currentUser);
|
||||
}
|
||||
|
||||
+42
@@ -614,4 +614,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEngineeringInterfacePerson(LoginUser currentUser) {
|
||||
boolean result = false;
|
||||
RoleEnum engineeringInterfacePerson = RoleEnum.ENGINEERING_INTERFACE_PERSON;
|
||||
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(userRole.getRoleId(),engineeringInterfacePerson.getId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEngineer(LoginUser currentUser) {
|
||||
boolean result = false;
|
||||
RoleEnum engineer = RoleEnum.ENGINEER;
|
||||
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(userRole.getRoleId(),engineer.getId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user