feat(fire-check): 添加点检记录权限控制和菜单路径过滤功能
parent
9183745576
commit
4adca5f634
|
|
@ -10,6 +10,7 @@ import com.zcloud.fire.check.dto.clientobject.*;
|
|||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ public class AppFireCheckListController {
|
|||
|
||||
@ApiOperation(value = "点检记录首页-点检表查询")
|
||||
@PostMapping("/getCheckListRecord")
|
||||
@PreAuthorize("@pms.hasAnyPermission('dwjcjl')")
|
||||
public PageResponse<FireCheckListCO> getCheckListRecord(@RequestBody CheckListRecordPageQry qry) {
|
||||
return fireCheckListService.getCheckListRecord(qry);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,5 +47,7 @@ public class CheckListRecordPageQry extends PageQuery {
|
|||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
private String menuPath;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||
@DataScopes({
|
||||
@DataScope(method = "listPage", menuPerms = ""),
|
||||
@DataScope(method = "checkListRecordList", menuPerms = ""),
|
||||
@DataScope(method = "getCheckListRecord", menuPerms = ""),
|
||||
})
|
||||
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> getCheckListRecord(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE);
|
||||
IPage<FireCheckListDO> getCheckListRecord(IPage<FireCheckListDO> iPage, Map<String, Object> params, DateTimeE dateTimeE, String menuPerms);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,15 +159,19 @@ public class FireCheckListRepositoryImpl extends BaseRepositoryImpl<FireCheckLis
|
|||
} else {
|
||||
if(!corpInfoRepository.isSupper()){
|
||||
params.put("corpinfoId", AuthContext.getTenantId());
|
||||
if(!CorpInfoE.isCorp()){
|
||||
/* if(!CorpInfoE.isCorp()){
|
||||
//是个人,只能查询自己的清单
|
||||
params.put("userId", AuthContext.getUserId());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
FireCheckListE fireCheckListE = new FireCheckListE();
|
||||
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());
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue