|
|
|
@ -3,6 +3,7 @@ package com.dsideal.QingLong.YunXiao.Controller;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.QingLong.Render.ImageRender;
|
|
|
|
|
import com.dsideal.QingLong.Util.AsposeUtil;
|
|
|
|
|
import com.dsideal.QingLong.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.QingLong.YunXiao.Model.YunXiaoModel;
|
|
|
|
|
import com.dsideal.QingLong.YunXiao.Util.YunXiaoExportExcelUtil;
|
|
|
|
@ -11,6 +12,7 @@ import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.core.Controller;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
|
|
|
|
@ -107,40 +109,55 @@ public class YunXiaoController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
// http://10.10.21.20:9000/QingLong/yx/LessonConstructionExportExcel
|
|
|
|
|
@Before(GET.class)
|
|
|
|
|
public void LessonConstructionExportExcel() {
|
|
|
|
|
public void LessonConstructionExportExcel() throws Exception {
|
|
|
|
|
List<Record> list1 = ym.LessonConstructionInfoByStageSubject();
|
|
|
|
|
List<Record> list2 = ym.LessonConstructionInfoByStageSubjectBook();
|
|
|
|
|
List<Record> list3 = ym.previewRank();
|
|
|
|
|
|
|
|
|
|
YunXiaoExportExcelUtil exporter = new YunXiaoExportExcelUtil();
|
|
|
|
|
//获取系统临时目录
|
|
|
|
|
String tmpDir = System.getProperty("java.io.tmpdir");
|
|
|
|
|
//使用guid生成一个临时文件名,然后拼接到tmpDir后面,生成完整的临时文件路径
|
|
|
|
|
String tmpFile = tmpDir + UUID.randomUUID() + ".xlsx";
|
|
|
|
|
if (!new File(CommonUtil.webUploadPath).exists()) {
|
|
|
|
|
//创建目录
|
|
|
|
|
new File(CommonUtil.webUploadPath).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
String fileName = UUID.randomUUID() + ".xlsx";
|
|
|
|
|
String tmpFile = CommonUtil.webUploadPath + fileName;
|
|
|
|
|
exporter.LessonConstructionExportExcel(tmpFile, list1, list2, list3);
|
|
|
|
|
//提供下载
|
|
|
|
|
renderFile(new File(tmpFile), "课程建设情况报表.xlsx");
|
|
|
|
|
|
|
|
|
|
//提供文件路径
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", true);
|
|
|
|
|
kv.set("message", "生成成功!");
|
|
|
|
|
kv.set("url", "/QingLong/upload/" + fileName);
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 区域、学校提供课程的统计情况
|
|
|
|
|
*/
|
|
|
|
|
// http://10.10.21.20:9000/QingLong/yx/LessonConstructionInfoByXzqhSchool
|
|
|
|
|
// http://10.10.21.20:9000/QingLong/yx/LessonConstructionInfoByXzqhSchool?type_id=1
|
|
|
|
|
@Before(GET.class)
|
|
|
|
|
public void LessonConstructionInfoByXzqhSchool() {
|
|
|
|
|
public void LessonConstructionInfoByXzqhSchool(int type_id) throws Exception {
|
|
|
|
|
List<Record> list1 = ym.LessonConstructionInfoByXzqh();
|
|
|
|
|
List<Record> list2 = ym.LessonConstructionInfoByXzqhStage();
|
|
|
|
|
List<Record> list3 = ym.LessonConstructionInfoByXzqhSchool();
|
|
|
|
|
List<Record> list4 = ym.LessonConstructionInfo();
|
|
|
|
|
|
|
|
|
|
YunXiaoExportExcelUtil exporter = new YunXiaoExportExcelUtil();
|
|
|
|
|
//获取系统临时目录
|
|
|
|
|
String tmpDir = System.getProperty("java.io.tmpdir");
|
|
|
|
|
//使用guid生成一个临时文件名,然后拼接到tmpDir后面,生成完整的临时文件路径
|
|
|
|
|
String tmpFile = tmpDir + UUID.randomUUID() + ".xlsx";
|
|
|
|
|
if (!new File(CommonUtil.webUploadPath).exists()) {
|
|
|
|
|
//创建目录
|
|
|
|
|
new File(CommonUtil.webUploadPath).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
String fileName = UUID.randomUUID() + ".xlsx";
|
|
|
|
|
String tmpFile = CommonUtil.webUploadPath + fileName;
|
|
|
|
|
exporter.LessonConstructionInfoByXzqhSchool(tmpFile, list1, list2, list3, list4);
|
|
|
|
|
//提供下载
|
|
|
|
|
renderFile(new File(tmpFile), "【区域+学校】课程建设情况报表.xlsx");
|
|
|
|
|
//提供文件路径
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", true);
|
|
|
|
|
kv.set("message", "生成成功!");
|
|
|
|
|
kv.set("url", "/QingLong/upload/" + fileName);
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|