|
@@ -1531,48 +1531,6 @@ public class ExportServiceImpl implements ExportService {
|
|
|
return succeed;
|
|
|
}
|
|
|
|
|
|
- //终课表列表导出
|
|
|
- @Override
|
|
|
- public HttpResponseResult superFindCourseSchedules(Map<String, Object> info){
|
|
|
- EndCourseScheduleQueryInfo queryInfo = JSONObject.parseObject(JSONObject.toJSONString(info),EndCourseScheduleQueryInfo.class);
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null) {
|
|
|
- throw new BizException("用户信息获取失败");
|
|
|
- }
|
|
|
- queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- MapUtil.populateMap(params, queryInfo);
|
|
|
- Integer tenantId = TenantContextHolder.getTenantId();
|
|
|
- if(Objects.equals("COURSE_TIME_ERROR",queryInfo.getSearchType())){
|
|
|
- String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
|
|
|
- String courseEndTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_END_TIME_ERROR, tenantId);
|
|
|
- if(StringUtils.isEmpty(courseStartTimeError) || StringUtils.isEmpty(courseEndTimeError)){
|
|
|
- return BaseController.failed("没有可导出的数据");
|
|
|
- }
|
|
|
- params.put("courseStartTimeError",courseStartTimeError);
|
|
|
- params.put("courseEndTimeError",courseEndTimeError);
|
|
|
- }
|
|
|
- int count = scheduleService.endCountCourseSchedules(params);
|
|
|
- if (count <= 0) {
|
|
|
- return BaseController.failed("没有可导出的数据");
|
|
|
- }
|
|
|
- if (count > 50000) {
|
|
|
- return BaseController.failed("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
- }
|
|
|
- ManagerDownload managerDownload = saveManagerDownload(ExportTypeEnum.COURSE_SCHEDULE,sysUser.getId());
|
|
|
- ExecutorService executor = Executors.newCachedThreadPool();
|
|
|
- CompletableFuture.runAsync(()->{
|
|
|
- try {
|
|
|
- this.superFindCourseSchedules(queryInfo, managerDownload);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- },executor);
|
|
|
- HttpResponseResult<Object> succeed = BaseController.succeed();
|
|
|
- succeed.setMsg(managerDownload.getName() + "导出申请已提交,请到【报表中心-下载列表查看】");
|
|
|
- return succeed;
|
|
|
- }
|
|
|
-
|
|
|
//保存下载记录
|
|
|
@Override
|
|
|
public ManagerDownload saveManagerDownload(ExportTypeEnum exportTypeEnum, Integer userId){
|