feat(fire-check): 添加点检记录权限控制和菜单路径过滤功能

main
zhaokai 2026-02-26 15:31:09 +08:00
parent 9183745576
commit 4adca5f634
4 changed files with 13 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import com.zcloud.fire.check.dto.clientobject.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -59,6 +60,7 @@ public class AppFireCheckListController {
@ApiOperation(value = "点检记录首页-点检表查询") @ApiOperation(value = "点检记录首页-点检表查询")
@PostMapping("/getCheckListRecord") @PostMapping("/getCheckListRecord")
@PreAuthorize("@pms.hasAnyPermission('dwjcjl')")
public PageResponse<FireCheckListCO> getCheckListRecord(@RequestBody CheckListRecordPageQry qry) { public PageResponse<FireCheckListCO> getCheckListRecord(@RequestBody CheckListRecordPageQry qry) {
return fireCheckListService.getCheckListRecord(qry); return fireCheckListService.getCheckListRecord(qry);
} }

View File

@ -47,5 +47,7 @@ public class CheckListRecordPageQry extends PageQuery {
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private String endTime; private String endTime;
private String menuPath;
} }

View File

@ -24,6 +24,7 @@ import java.util.Map;
@DataScopes({ @DataScopes({
@DataScope(method = "listPage", menuPerms = ""), @DataScope(method = "listPage", menuPerms = ""),
@DataScope(method = "checkListRecordList", menuPerms = ""), @DataScope(method = "checkListRecordList", menuPerms = ""),
@DataScope(method = "getCheckListRecord", menuPerms = ""),
}) })
public interface FireCheckListMapper extends BaseMapper<FireCheckListDO> { public interface FireCheckListMapper extends BaseMapper<FireCheckListDO> {
@ -43,6 +44,6 @@ public interface FireCheckListMapper extends BaseMapper<FireCheckListDO> {
IPage<FireCheckListDO> checkListRecordList(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE, String menuPerms); IPage<FireCheckListDO> checkListRecordList(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE, String menuPerms);
IPage<FireCheckListDO> getCheckListRecord(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE); IPage<FireCheckListDO> getCheckListRecord(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE, String menuPerms);
} }

View File

@ -159,15 +159,19 @@ public class FireCheckListRepositoryImpl extends BaseRepositoryImpl<FireCheckLis
} else { } else {
if(!corpInfoRepository.isSupper()){ if(!corpInfoRepository.isSupper()){
params.put("corpinfoId", AuthContext.getTenantId()); params.put("corpinfoId", AuthContext.getTenantId());
if(!CorpInfoE.isCorp()){ /* if(!CorpInfoE.isCorp()){
//是个人,只能查询自己的清单 //是个人,只能查询自己的清单
params.put("userId", AuthContext.getUserId()); params.put("userId", AuthContext.getUserId());
} }*/
} }
} }
FireCheckListE fireCheckListE = new FireCheckListE(); FireCheckListE fireCheckListE = new FireCheckListE();
DateTimeE dateTimeE = fireCheckListE.getCheckRecordInterval(null); DateTimeE dateTimeE = fireCheckListE.getCheckRecordInterval(null);
IPage<FireCheckListDO> result = fireCheckListMapper.getCheckListRecord(iPage, params,dateTimeE); String menuPerms = "";
if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))){
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
}
IPage<FireCheckListDO> result = fireCheckListMapper.getCheckListRecord(iPage, params,dateTimeE,menuPerms);
return PageHelper.pageToResponse(result, result.getRecords()); return PageHelper.pageToResponse(result, result.getRecords());
} }