feat(mes): 调整OQC检验单客户端权限控制逻辑
- 修改MesQcOqcMapper查询逻辑,允许client_id为空的记录对所有有权限用户可见
- 当permittedClientIds为空时,设置wrapper条件为client_id为null
- 当permittedClientIds不为空时,支持client_id在指定范围或为null的记录
- 移除MesQcOqcSaveReqVO中clientId字段的@NotNull校验注解
- 更新数据传输对象描述,将客户ID标记为可选字段
- 移除前端表单中客户选择字段的必填校验规则
| | |
| | | |
| | | // ========== 客户 ========== |
| | | |
| | | @Schema(description = "客户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| | | @NotNull(message = "客户不能为空") |
| | | @Schema(description = "客户 ID,可为空", example = "10") |
| | | private Long clientId; |
| | | |
| | | // ========== 物料 ========== |
| | |
| | | .orderByDesc(MesQcOqcDO::getId); |
| | | if (permittedClientIds != null) { |
| | | if (CollUtil.isEmpty(permittedClientIds)) { |
| | | return PageResult.empty(); |
| | | wrapper.isNull(MesQcOqcDO::getClientId); |
| | | } else { |
| | | // 允许 client_id 为空的记录(未填客户的检验单对所有有权限用户可见) |
| | | wrapper.and(w -> w.in(MesQcOqcDO::getClientId, permittedClientIds) |
| | | .or().isNull(MesQcOqcDO::getClientId)); |
| | | } |
| | | wrapper.in(MesQcOqcDO::getClientId, permittedClientIds); |
| | | } |
| | | return selectPage(reqVO, wrapper); |
| | | } |