|
@@ -14,6 +14,7 @@ import com.jeeplus.core.excel.ExcelOptions;
|
|
import com.jeeplus.core.excel.ExportMode;
|
|
import com.jeeplus.core.excel.ExportMode;
|
|
import com.jeeplus.core.excel.utils.EasyPoiUtil;
|
|
import com.jeeplus.core.excel.utils.EasyPoiUtil;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
|
+import com.jeeplus.sys.service.dto.RoleDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
@@ -89,9 +90,19 @@ public class ProjectController {
|
|
public ResponseEntity<IPage<Project>> data(Project project, Page<Project> page) throws Exception {
|
|
public ResponseEntity<IPage<Project>> data(Project project, Page<Project> page) throws Exception {
|
|
QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( project, Project.class );
|
|
QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( project, Project.class );
|
|
IPage<Project> result = projectService.selectPage (page,queryWrapper);
|
|
IPage<Project> result = projectService.selectPage (page,queryWrapper);
|
|
|
|
+ UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
+ Boolean bmzrRoleFlag = false;
|
|
|
|
+ if(null != currentUserDTO.getRoleDTOList() && currentUserDTO.getRoleDTOList().size()>0){
|
|
|
|
+ for (RoleDTO roleDTO : currentUserDTO.getRoleDTOList()) {
|
|
|
|
+ if("bmzr".equals(roleDTO.getEnName())){
|
|
|
|
+ bmzrRoleFlag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
List<Project> list = result.getRecords();
|
|
List<Project> list = result.getRecords();
|
|
for (Project info: list) {
|
|
for (Project info: list) {
|
|
- if(info.getProjectHeadId().equals(UserUtils.getCurrentUserDTO().getId())){
|
|
|
|
|
|
+ if(info.getProjectHeadId().equals(currentUserDTO.getId()) || bmzrRoleFlag){
|
|
info.setPermissionFlag(true);
|
|
info.setPermissionFlag(true);
|
|
}else{
|
|
}else{
|
|
info.setPermissionFlag(false);
|
|
info.setPermissionFlag(false);
|
|
@@ -157,7 +168,7 @@ public class ProjectController {
|
|
|
|
|
|
//判断一下文号是否存在
|
|
//判断一下文号是否存在
|
|
if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
|
|
if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
|
|
- if(ObjectUtil.isNotEmpty(projectService.selectByDocumentNum(projectDTO.getDocumentNum()))){
|
|
|
|
|
|
+ if(ObjectUtil.isNotEmpty(projectService.selectByDocumentNum(projectDTO))){
|
|
return ResponseEntity.badRequest().body("不可使用已存在的文号");
|
|
return ResponseEntity.badRequest().body("不可使用已存在的文号");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -173,7 +184,7 @@ public class ProjectController {
|
|
|
|
|
|
//判断一下文号是否存在
|
|
//判断一下文号是否存在
|
|
if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
|
|
if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
|
|
- Project userProjects = projectService.selectByDocumentNum(projectDTO.getDocumentNum());
|
|
|
|
|
|
+ Project userProjects = projectService.selectByDocumentNum(projectDTO);
|
|
if(ObjectUtil.isNotEmpty(userProjects)){
|
|
if(ObjectUtil.isNotEmpty(userProjects)){
|
|
if(!projectDTO.getId().equals(userProjects.getId())){
|
|
if(!projectDTO.getId().equals(userProjects.getId())){
|
|
return ResponseEntity.badRequest().body("不可使用已存在的文号");
|
|
return ResponseEntity.badRequest().body("不可使用已存在的文号");
|
|
@@ -373,7 +384,7 @@ public class ProjectController {
|
|
|
|
|
|
//文号的问题
|
|
//文号的问题
|
|
if(StrUtil.isNotEmpty(project.getDocumentNum())) {
|
|
if(StrUtil.isNotEmpty(project.getDocumentNum())) {
|
|
- Project userProject = projectService.selectByDocumentNum(project.getDocumentNum());
|
|
|
|
|
|
+ Project userProject = projectService.selectByDocumentNum(project);
|
|
if(ObjectUtil.isNotEmpty(userProject)){
|
|
if(ObjectUtil.isNotEmpty(userProject)){
|
|
return "文件中存在已在档的文号";
|
|
return "文件中存在已在档的文号";
|
|
}
|
|
}
|