|
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.teachcloud.common.bean.dto.OrgDto;
|
|
import com.qmth.teachcloud.common.bean.dto.OrgDto;
|
|
-import com.qmth.teachcloud.common.bean.dto.UserExportDto;
|
|
|
|
import com.qmth.teachcloud.common.bean.dto.excel.SysOrgImportDto;
|
|
import com.qmth.teachcloud.common.bean.dto.excel.SysOrgImportDto;
|
|
import com.qmth.teachcloud.common.bean.params.UserSaveParams;
|
|
import com.qmth.teachcloud.common.bean.params.UserSaveParams;
|
|
import com.qmth.teachcloud.common.bean.result.SysUserResult;
|
|
import com.qmth.teachcloud.common.bean.result.SysUserResult;
|
|
@@ -445,35 +444,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void exportData(boolean withoutPrintingRoom) {
|
|
|
|
- Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
- List<SysUserResult> sysUserResultList = sysUserService.findSysUserResultList();
|
|
|
|
-
|
|
|
|
- List<OrgDto> orgList = this.listOrgAll(schoolId);
|
|
|
|
- if (withoutPrintingRoom) {
|
|
|
|
- orgList = orgList.stream().filter(e -> !OrgTypeEnum.PRINTING_HOUSE.name().equals(e.getType())).collect(Collectors.toList());
|
|
|
|
- }
|
|
|
|
- Map<Long, OrgDto> map = orgList.stream().collect(Collectors.toMap(OrgDto::getId, Function.identity(), (dto1, dto2) -> dto1));
|
|
|
|
-
|
|
|
|
- Iterator<Long> iterator = map.keySet().iterator();
|
|
|
|
- Set<Long> deleteKeys = new HashSet<>();
|
|
|
|
- while (iterator.hasNext()) {
|
|
|
|
- Long parentId = iterator.next();
|
|
|
|
- if (map.get(parentId).getParentId() != null) {
|
|
|
|
- if (Objects.nonNull(map.get(map.get(parentId).getParentId()))) {
|
|
|
|
- map.get(map.get(parentId).getParentId()).getChildren().add(map.get(parentId));
|
|
|
|
- deleteKeys.add(parentId);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for (Long key : deleteKeys) {
|
|
|
|
- map.remove(key);
|
|
|
|
- }
|
|
|
|
- List<OrgDto> orgDtos = new ArrayList<>(map.values());
|
|
|
|
- // todo 机构导出 未完成
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void exportOrgData(HttpServletResponse response, boolean withoutPrintingRoom) throws Exception {
|
|
public void exportOrgData(HttpServletResponse response, boolean withoutPrintingRoom) throws Exception {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|