|
|
|
@ -31,7 +31,6 @@ import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.statement.StatementQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.statement.StatementQueryParam; |
|
|
|
import com.biutag.supervision.pojo.request.reportProject.ReportProjectDeleteRequest; |
|
|
|
import com.biutag.supervision.pojo.request.reportProject.ReportProjectDeleteRequest; |
|
|
|
import com.biutag.supervision.pojo.vo.DepartTree; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowExcelVo; |
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowExcelVo; |
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; |
|
|
|
import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; |
|
|
|
@ -259,11 +258,6 @@ public class ReportProjectController { |
|
|
|
@PostMapping("/pageConditionVo") |
|
|
|
@PostMapping("/pageConditionVo") |
|
|
|
public Result<Page<ConditionVo>> pageConditionVo(@RequestBody StatementQueryParam queryParam){ |
|
|
|
public Result<Page<ConditionVo>> pageConditionVo(@RequestBody StatementQueryParam queryParam){ |
|
|
|
QueryWrapper<ReportProject> wrapper=new QueryWrapper<>(); |
|
|
|
QueryWrapper<ReportProject> wrapper=new QueryWrapper<>(); |
|
|
|
List<SupDepart> departs = departService.list(new LambdaQueryWrapper<SupDepart>() |
|
|
|
|
|
|
|
.orderByAsc(SupDepart::getOrderNo)); |
|
|
|
|
|
|
|
List<DepartTree> departTree = departService.buildTreeAll(departs); |
|
|
|
|
|
|
|
Map<String, SupDepart> departMap = departs.stream() |
|
|
|
|
|
|
|
.collect(Collectors.toMap(SupDepart::getId, depart -> depart)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrapper.eq(StrUtil.isNotBlank(queryParam.getNode()),"p.node",queryParam.getNode()) |
|
|
|
wrapper.eq(StrUtil.isNotBlank(queryParam.getNode()),"p.node",queryParam.getNode()) |
|
|
|
.like(StrUtil.isNotBlank(queryParam.getReportName()),"p.report_name",queryParam.getReportName()) |
|
|
|
.like(StrUtil.isNotBlank(queryParam.getReportName()),"p.report_name",queryParam.getReportName()) |
|
|
|
@ -284,10 +278,10 @@ public class ReportProjectController { |
|
|
|
} |
|
|
|
} |
|
|
|
if (StrUtil.isNotBlank(queryParam.getAuditUnitId())) { |
|
|
|
if (StrUtil.isNotBlank(queryParam.getAuditUnitId())) { |
|
|
|
// 获取选择的审计单位及其所有子部门的ID
|
|
|
|
// 获取选择的审计单位及其所有子部门的ID
|
|
|
|
wrapper.in("p.audit_unit_id", departService.getAllNodeIds(queryParam.getAuditUnitId(), departTree)); |
|
|
|
wrapper.in("p.audit_unit_id", departService.getAllNodeIds(queryParam.getAuditUnitId())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StrUtil.isNotBlank(queryParam.getProjectUnitId())){ |
|
|
|
if (StrUtil.isNotBlank(queryParam.getProjectUnitId())){ |
|
|
|
wrapper.in("p.project_unit_id", departService.getAllNodeIds(queryParam.getProjectUnitId(), departTree)); |
|
|
|
wrapper.in("p.project_unit_id", departService.getAllNodeIds(queryParam.getProjectUnitId())); |
|
|
|
} |
|
|
|
} |
|
|
|
wrapper.groupBy("p.id"); |
|
|
|
wrapper.groupBy("p.id"); |
|
|
|
wrapper.eq("p.delete_flag", DeleteStatusEnum.NO.getCode()); |
|
|
|
wrapper.eq("p.delete_flag", DeleteStatusEnum.NO.getCode()); |
|
|
|
@ -297,12 +291,12 @@ public class ReportProjectController { |
|
|
|
boolean superAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); |
|
|
|
boolean superAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); |
|
|
|
boolean firstAuth = superAuth || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); |
|
|
|
boolean firstAuth = superAuth || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); |
|
|
|
List<String> userAuthOrgIds = firstAuth |
|
|
|
List<String> userAuthOrgIds = firstAuth |
|
|
|
? departService.getAllNodeIds(ROOTID, departTree) |
|
|
|
? departService.getAllNodeIds(ROOTID) |
|
|
|
: (user.getAuthDepartIds().isEmpty() ? departService.getAllNodeIds(user.getDepartId(), departTree) : departService.getAllNodeIds(user.getAuthDepartIds(), departTree)); |
|
|
|
: (user.getAuthDepartIds().isEmpty() ? departService.getAllNodeIds(user.getDepartId()) : departService.getAllNodeIds(user.getAuthDepartIds())); |
|
|
|
if (!superAuth) { |
|
|
|
if (!superAuth) { |
|
|
|
wrapper.and(p -> p.in("p.audit_unit_id", userAuthOrgIds).or().in("p.project_unit_id", userAuthOrgIds)); |
|
|
|
wrapper.and(p -> p.in("p.audit_unit_id", userAuthOrgIds).or().in("p.project_unit_id", userAuthOrgIds)); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> dszdOrgIds = departService.getAllNodeIds(AppConstants.DSZD, departTree); |
|
|
|
List<String> dszdOrgIds = departService.getAllNodeIds(AppConstants.DSZD); |
|
|
|
// 页面鉴权
|
|
|
|
// 页面鉴权
|
|
|
|
Map<String, Consumer<QueryWrapper<ReportProject>>> authStrategy = Map.of( |
|
|
|
Map<String, Consumer<QueryWrapper<ReportProject>>> authStrategy = Map.of( |
|
|
|
// “审计单位”为督审支队的项目
|
|
|
|
// “审计单位”为督审支队的项目
|
|
|
|
@ -325,30 +319,25 @@ public class ReportProjectController { |
|
|
|
|
|
|
|
|
|
|
|
Page<ConditionVo> conditionPage = reportProjectService.getConditionPage(new Page<>(queryParam.getCurrent(), queryParam.getSize()), wrapper); |
|
|
|
Page<ConditionVo> conditionPage = reportProjectService.getConditionPage(new Page<>(queryParam.getCurrent(), queryParam.getSize()), wrapper); |
|
|
|
conditionPage.getRecords().forEach(s->{ |
|
|
|
conditionPage.getRecords().forEach(s->{ |
|
|
|
s.setAuditUnitStr(getConditionUnitStr(departMap, s.getAuditUnitId(), |
|
|
|
SupDepart auditById = departService.getById(s.getAuditUnitId()); |
|
|
|
StrUtil.blankToDefault(s.getAuditUnitStr(), s.getAuditUnit()))); |
|
|
|
SupDepart projectById = departService.getById(s.getProjectUnitId()); |
|
|
|
s.setProjectUnitStr(getConditionUnitStr(departMap, s.getProjectUnitId(), |
|
|
|
if (3==(auditById.getLevel())){ |
|
|
|
StrUtil.blankToDefault(s.getProjectUnitStr(), s.getProjectUnit()))); |
|
|
|
SupDepart byPId = departService.getById(auditById.getPid()); |
|
|
|
|
|
|
|
s.setAuditUnitStr(byPId.getShortName() +"/" + auditById.getShortName()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
s.setAuditUnitStr(auditById.getShortName() +"/"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (3==projectById.getLevel()){ |
|
|
|
|
|
|
|
SupDepart byPId = departService.getById(projectById.getPid()); |
|
|
|
|
|
|
|
s.setProjectUnitStr(byPId.getShortName() +"/" + projectById.getShortName()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
s.setProjectUnitStr(projectById.getShortName() +"/"); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return Result.success(conditionPage); |
|
|
|
return Result.success(conditionPage); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getConditionUnitStr(Map<String, SupDepart> departMap, String departId, String fallbackName) { |
|
|
|
|
|
|
|
SupDepart depart = departMap.get(departId); |
|
|
|
|
|
|
|
if (depart == null) { |
|
|
|
|
|
|
|
return StrUtil.blankToDefault(fallbackName, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Integer.valueOf(3).equals(depart.getLevel())) { |
|
|
|
|
|
|
|
SupDepart parent = departMap.get(depart.getPid()); |
|
|
|
|
|
|
|
if (parent == null) { |
|
|
|
|
|
|
|
return StrUtil.blankToDefault(fallbackName, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return parent.getShortName() + "/" + depart.getShortName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return depart.getShortName() + "/"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//审计情况表导出
|
|
|
|
//审计情况表导出
|
|
|
|
@PostMapping("/excelConditionVo") |
|
|
|
@PostMapping("/excelConditionVo") |
|
|
|
public void excelConditionVo(@RequestBody StatementQueryParam queryParam, HttpServletResponse response) throws Exception { |
|
|
|
public void excelConditionVo(@RequestBody StatementQueryParam queryParam, HttpServletResponse response) throws Exception { |
|
|
|
|