Commit 23a87c6c authored by 鲁鸿波's avatar 鲁鸿波

隐患台账单位查询,导出bug修改

parent c95f6655
...@@ -183,7 +183,7 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa ...@@ -183,7 +183,7 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa
Page<TSafeHazardOrgDTO> resultPage = new Page<>(page, limit); Page<TSafeHazardOrgDTO> resultPage = new Page<>(page, limit);
String orgId = param.getOrgId(); String orgId = param.getOrgId();
if (StringUtils.isBlank(orgId)) { if (StringUtils.isBlank(param.getOrgId())) {
orgId = ContextUtils.getLoginUser().getOrgId(); orgId = ContextUtils.getLoginUser().getOrgId();
}else { }else {
// 按逗号分割 orgIds 字符串 // 按逗号分割 orgIds 字符串
...@@ -193,11 +193,18 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa ...@@ -193,11 +193,18 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa
} }
List<String> orgIds = new ArrayList<>(); List<String> orgIds = new ArrayList<>();
String finalOrgId = orgId; String finalOrgId = orgId;
if (param.getCondOrgIdList() != null && param.getCondOrgIdList().size() > 0) { /*if (param.getCondOrgIdList() != null && param.getCondOrgIdList().size() > 0) {
orgIds = param.getCondOrgIdList(); orgIds = param.getCondOrgIdList();
}else { }else {
orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.like(SysOrg.PARENT_IDS, finalOrgId).or().eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort")) orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.like(SysOrg.PARENT_IDS, finalOrgId).or().eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort"))
.stream().map(SysOrg::getOrgId).collect(Collectors.toList()); .stream().map(SysOrg::getOrgId).collect(Collectors.toList());
}*/
if (StringUtils.isBlank(param.getOrgId())) {
orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.like(SysOrg.PARENT_IDS, finalOrgId).or().eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort"))
.stream().map(SysOrg::getOrgId).collect(Collectors.toList());
}else{
orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort"))
.stream().map(SysOrg::getOrgId).collect(Collectors.toList());
} }
if (param.getIds() == null) { if (param.getIds() == null) {
param.setCondOrgIdList(orgIds); param.setCondOrgIdList(orgIds);
...@@ -808,7 +815,7 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa ...@@ -808,7 +815,7 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa
@Override @Override
public Boolean exportEntity(TSafeHazardOrgParam param, HttpServletResponse response) { public Boolean exportEntity(TSafeHazardOrgParam param, HttpServletResponse response) {
try { try {
String orgId = param.getOrgId(); /*String orgId = param.getOrgId();
if (StringUtils.isBlank(orgId)) { if (StringUtils.isBlank(orgId)) {
orgId = ContextUtils.getLoginUser().getOrgId(); orgId = ContextUtils.getLoginUser().getOrgId();
} }
...@@ -827,7 +834,35 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa ...@@ -827,7 +834,35 @@ public class TSafeHazardOrgServiceImpl extends SuperServiceImpl<TSafeHazardOrgDa
orgIds.add(finalOrgId); orgIds.add(finalOrgId);
} }
} }
}*/
BaseResponse<BaseResponseList<TSafeHazardOrgDTO>> baseResponse = new BaseResponse<>();
Long page = StringHelper.isEmpty(param.getPage()) ? BizConstants.PAGE : Long.valueOf(param.getPage());
Long limit = StringHelper.isEmpty(param.getLimit()) ? BizConstants.LIMIT : Long.valueOf(param.getLimit());
Page<TSafeHazardOrgDTO> resultPage = new Page<>(page, limit);
String orgId = param.getOrgId();
if (StringUtils.isBlank(param.getOrgId())) {
orgId = ContextUtils.getLoginUser().getOrgId();
}else {
// 按逗号分割 orgIds 字符串
String[] ids = orgId.split(",");
// 获取数组中的最后一个元素
orgId = ids[ids.length - 1];
} }
List<String> orgIds = new ArrayList<>();
String finalOrgId = orgId;
if (StringUtils.isBlank(param.getOrgId())) {
orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.like(SysOrg.PARENT_IDS, finalOrgId).or().eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort"))
.stream().map(SysOrg::getOrgId).collect(Collectors.toList());
}else{
orgIds = sysOrgService.list(new QueryWrapper<SysOrg>().and(sysOrgQueryWrapper -> sysOrgQueryWrapper.eq(SysOrg.ORG_ID, finalOrgId)).ne(SysOrg.STATUS, BizConstants.STATUS_DELETE).eq(SysOrg.IS_DEPT, 0).orderByAsc("tree_sort"))
.stream().map(SysOrg::getOrgId).collect(Collectors.toList());
}
if (param.getIds() == null) {
param.setCondOrgIdList(orgIds);
}
param.setCondOrgIdList(orgIds); param.setCondOrgIdList(orgIds);
List<TSafeHazardExportVO> tSafeHazardExportVOS = exportBuild(param); List<TSafeHazardExportVO> tSafeHazardExportVOS = exportBuild(param);
logger.info("**************************************写入模板*****************************"); logger.info("**************************************写入模板*****************************");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment