法规清单--删除添加权限
This commit is contained in:
+8
-4
@@ -128,8 +128,10 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
|||||||
@AutoLog(value = "项目库-法规清单表-通过id删除")
|
@AutoLog(value = "项目库-法规清单表-通过id删除")
|
||||||
@ApiOperation(value="项目库-法规清单表-通过id删除", notes="项目库-法规清单表-通过id删除")
|
@ApiOperation(value="项目库-法规清单表-通过id删除", notes="项目库-法规清单表-通过id删除")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
public Result<?> delete(@RequestParam(name="id",required=true) String id,
|
||||||
projectLawsInventoryEOService.deleteById(id);
|
@RequestParam(name="projectLibraryId",required=true) String projectLibraryId,
|
||||||
|
@RequestParam(name="cut",required=true) String cut) {
|
||||||
|
projectLawsInventoryEOService.deleteById(id,projectLibraryId,cut);
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +144,10 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
|||||||
@AutoLog(value = "项目库-法规清单表-批量删除")
|
@AutoLog(value = "项目库-法规清单表-批量删除")
|
||||||
@ApiOperation(value="项目库-法规清单表-批量删除", notes="项目库-法规清单表-批量删除")
|
@ApiOperation(value="项目库-法规清单表-批量删除", notes="项目库-法规清单表-批量删除")
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids,
|
||||||
this.projectLawsInventoryEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
@RequestParam(name="projectLibraryId",required=true) String projectLibraryId,
|
||||||
|
@RequestParam(name="cut",required=true) String cut) {
|
||||||
|
this.projectLawsInventoryEOService.deleteByIds(Arrays.asList(ids.split(",")),projectLibraryId,cut);
|
||||||
return Result.OK("批量删除成功!");
|
return Result.OK("批量删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -39,7 +39,7 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteById(String id);
|
void deleteById(String id,String projectLibraryId,String cut);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
@@ -47,7 +47,7 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
|||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteByIds(List<String> ids);
|
void deleteByIds(List<String> ids,String projectLibraryId,String cut);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
|
|||||||
+20
-2
@@ -226,7 +226,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteById(String id) {
|
public void deleteById(String id,String projectLibraryId,String cut) {
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
int isProjectRole = checkUserRole(projectLibraryId, currentUser.getId(),"");
|
||||||
|
if(!ProjectRoleEnum.STUDIO_ENGINEER.getValue().equals(String.valueOf(isProjectRole))){
|
||||||
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
|
throw new JeroBootException("该用户没有删除权限");
|
||||||
|
}else{
|
||||||
|
throw new JeroBootException("The user has no deletion permission");
|
||||||
|
}
|
||||||
|
}
|
||||||
removeById(id);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +246,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteByIds(List<String> ids,String projectLibraryId,String cut) {
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
int isProjectRole = checkUserRole(projectLibraryId, currentUser.getId(),"");
|
||||||
|
if(!ProjectRoleEnum.STUDIO_ENGINEER.getValue().equals(String.valueOf(isProjectRole))){
|
||||||
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
|
throw new JeroBootException("该用户没有删除权限");
|
||||||
|
}else{
|
||||||
|
throw new JeroBootException("The user has no deletion permission");
|
||||||
|
}
|
||||||
|
}
|
||||||
removeByIds(ids);
|
removeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user