|
@@ -6,6 +6,7 @@ import cn.cslg.report.common.model.vo.ReportVO;
|
|
|
import cn.cslg.report.common.model.vo.SystemDictVO;
|
|
|
import cn.cslg.report.common.utils.*;
|
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
|
+import cn.cslg.report.common.utils.SecurityUtils.SecurityUtils;
|
|
|
import cn.cslg.report.common.utils.auth.checkAuth;
|
|
|
import cn.cslg.report.entity.Personnel;
|
|
|
import cn.cslg.report.entity.Report;
|
|
@@ -116,7 +117,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
Integer id =loginUtils.getId();
|
|
|
List<Integer> departIds =outInterfaceService.getDutyDepartsFromPCS(id);
|
|
|
LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (reportVO.getName() != null && reportVO.getName() != "") {
|
|
|
+ queryWrapper.ne(Report::getId,0);
|
|
|
+ if (reportVO.getName() != null) {
|
|
|
queryWrapper.like(Report::getName, reportVO.getName());
|
|
|
}
|
|
|
if (reportVO.getReportId() != null) {
|
|
@@ -125,22 +127,15 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
if (reportVO.getSignPatentNo() != null && reportVO.getSignPatentNo() != "") {
|
|
|
queryWrapper.like(Report::getSignPatentNo, reportVO.getSignPatentNo());
|
|
|
}
|
|
|
-
|
|
|
//分页
|
|
|
if (reportVO.getSize() != null && reportVO.getCurrent() != null) {
|
|
|
- queryWrapper.and(QueryWrapper -> {
|
|
|
- QueryWrapper.eq(Report::getCreatePersonId, id)
|
|
|
- .or().eq(Report::getPersonId, id);
|
|
|
- if(departIds.size()!=0){
|
|
|
- QueryWrapper.or().in(Report::getDepartmentId,departIds);
|
|
|
- }
|
|
|
- });
|
|
|
- queryWrapper.orderByDesc(Report::getId);
|
|
|
+ SecurityUtils.startDataScope("/pcs/report/query");
|
|
|
List<Report> reports = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper).getRecords();
|
|
|
reports = this.reportData(reports);
|
|
|
long count = this.count(queryWrapper);
|
|
|
return Response.success(reports, DataUtils.setPageColumn(reportVO.getSize(), reportVO.getCurrent(), Math.toIntExact(count)));
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
queryWrapper.orderByDesc(Report::getId);
|
|
|
List<Report> reports = this.list(queryWrapper);
|
|
|
reports = this.reportData(reports);
|