|
@@ -9,6 +9,7 @@ import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
|
|
import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
|
|
import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
|
|
import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
|
|
|
|
+import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
import cn.com.qmth.examcloud.commons.util.JsonUtil;
|
|
import cn.com.qmth.examcloud.commons.util.JsonUtil;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.commons.util.RegExpUtil;
|
|
import cn.com.qmth.examcloud.commons.util.RegExpUtil;
|
|
@@ -455,6 +456,24 @@ public class OrgController extends ControllerSupport {
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // @Naked
|
|
|
|
+ @GetMapping("/sub/org/export")
|
|
|
|
+ @ApiOperation(value = "导出学习中心(Excel)")
|
|
|
|
+ public void subOrgExport(@RequestParam Long rootOrgId) throws Exception {
|
|
|
|
+ List<OrgEntity> list = orgRepo.findByParentId(rootOrgId);
|
|
|
|
+ List<Object[]> lines = new ArrayList<>();
|
|
|
|
+ for (OrgEntity info : list) {
|
|
|
|
+ lines.add(new Object[]{info.getCode(), info.getName(), info.getContacts(), info.getTelephone()});
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String filePath = systemConfig.getTempDataDir() + File.separator + System.currentTimeMillis() + ".xlsx";
|
|
|
|
+ File file = new File(filePath);
|
|
|
|
+ ExcelWriter.write(new String[]{"机构名称", "机构代码", "联系人", "联系电话"},
|
|
|
|
+ new Class[]{String.class, String.class, String.class, String.class}, lines, new File(filePath));
|
|
|
|
+ exportFile("学习中心列表.xlsx", file);
|
|
|
|
+ FileUtils.deleteQuietly(file);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 方法注释
|
|
* 方法注释
|
|
*
|
|
*
|