|
@@ -33,6 +33,9 @@ import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping
|
|
@@ -132,6 +135,8 @@ public class ExportController extends BaseController {
|
|
|
private MusicEnlightenmentQuestionnaireService musicEnlightenmentQuestionnaireService;
|
|
|
@Autowired
|
|
|
private MusicGroupService musicGroupService;
|
|
|
+ @Autowired
|
|
|
+ private SysTenantConfigService sysTenantConfigService;
|
|
|
|
|
|
@ApiOperation(value = "获取可导出字段")
|
|
|
@RequestMapping("export/getFields")
|
|
@@ -1961,6 +1966,16 @@ public class ExportController extends BaseController {
|
|
|
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 failed("没有可导出的数据");
|
|
|
+ }
|
|
|
+ params.put("courseStartTimeError",courseStartTimeError);
|
|
|
+ params.put("courseEndTimeError",courseEndTimeError);
|
|
|
+ }
|
|
|
int count = scheduleService.endCountCourseSchedules(params);
|
|
|
if (count <= 0) {
|
|
|
return failed("没有可导出的数据");
|
|
@@ -1969,7 +1984,14 @@ public class ExportController extends BaseController {
|
|
|
return failed("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
}
|
|
|
ManagerDownload managerDownload = exportService.saveManagerDownload(ExportTypeEnum.COURSE_SCHEDULE,sysUser.getId());
|
|
|
- exportService.superFindCourseSchedules(queryInfo, managerDownload);
|
|
|
+ ExecutorService executor = Executors.newCachedThreadPool();
|
|
|
+ CompletableFuture.runAsync(()->{
|
|
|
+ try {
|
|
|
+ exportService.superFindCourseSchedules(queryInfo, managerDownload);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ },executor);
|
|
|
HttpResponseResult<Object> succeed = succeed();
|
|
|
succeed.setMsg(managerDownload.getName() + "导出申请已提交,请到【报表中心-下载列表查看】");
|
|
|
return succeed;
|