提交 d230d0c0 authored 作者: 000516's avatar 000516

质检报告分页查询,添加料号模糊搜索条件

......@@ -40,20 +40,21 @@ public class ZzProQualityQueryController {
// 判断当前角色数据权限,当前部门或全部部门
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<SysRole> roles = sysUser.getRoles();
if (!sysUser.isAdmin()) {
if (CollectionUtils.isEmpty(roles)) {
throw new CheckedException(ECode.ROLE_ERROR);
}
Optional<SysRole> first = roles.stream().filter(role -> RoleConstants.PRODUCT_QUALITY_CHECK.equals(role.getRoleKey())).findFirst();
if (first.isPresent()){
if (first.isPresent()) {
SysRole sysRole = first.get();
String dataScope = sysRole.getDataScope();
// 判断数据范围
if (RoleConstants.DATA_SCOPE_DEPT.equals(dataScope)){
if (RoleConstants.DATA_SCOPE_DEPT.equals(dataScope)) {
Long deptId = sysUser.getDeptId();
vo.setDeptId(deptId);
}
}
}
return zzProQualityQueryService.page(vo);
}
}
......@@ -91,6 +91,9 @@ public class ZzProductQualityDaoImpl implements IZzProductQualityDao {
if (StringUtils.isNotBlank(wq.getManufacturersNameLike())){
qw.like(ZzProductQuality::getManufacturersName, wq.getManufacturersNameLike());
}
if (StringUtils.isNotBlank(wq.getManufactureBatchNoLike())){
qw.like(ZzProductQuality::getManufactureBatchNo, wq.getManufactureBatchNoLike());
}
qw.orderByDesc(ZzProductQuality::getCreateTime,ZzProductQuality::getShipDate);
return qw;
}
......
......@@ -18,7 +18,11 @@ public class ZzProductQualityWq {
private Date shipDate;
private Long deptId;
/**
* 工厂
* 工厂模糊查询
*/
private String manufacturersNameLike;
/**
* 料号模糊查询
*/
private String manufactureBatchNoLike;
}
......@@ -54,6 +54,7 @@ public class ZzProductQualityVo {
private String updateBy;
private String manufacturersNameLike;
private String manufactureBatchNoLike;
/**
* 料号/品名 模糊查询
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论