|
|
|
@ -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;
|
|
|
|
|
|
|
|
|
@ -86,8 +88,8 @@ public class YunXiaoController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@EmptyInterface({"lesson_id","organization_name","teacher_name"})
|
|
|
|
|
public void saveLessonMatchSchoolName(String lesson_id, String organization_name,String teacher_name) {
|
|
|
|
|
@EmptyInterface({"lesson_id", "organization_name", "teacher_name"})
|
|
|
|
|
public void saveLessonMatchSchoolName(String lesson_id, String organization_name, String teacher_name) {
|
|
|
|
|
//1、获取标准名称的单位,它的单位代码,隶属的区县等信息
|
|
|
|
|
Record record = ym.getBzSchoolByName(organization_name);
|
|
|
|
|
if (record == null) {
|
|
|
|
@ -97,7 +99,7 @@ public class YunXiaoController extends Controller {
|
|
|
|
|
String organization_no = record.getStr("organization_no");
|
|
|
|
|
String gather_regionc = record.getStr("gather_regionc");
|
|
|
|
|
//2、将关系表中,课程id为lesson_id的单位名称修改为organization_name
|
|
|
|
|
ym.saveLessonMatchSchoolName(lesson_id, organization_name,teacher_name, organization_no, gather_regionc);
|
|
|
|
|
ym.saveLessonMatchSchoolName(lesson_id, organization_name, teacher_name, organization_no, gather_regionc);
|
|
|
|
|
renderJson(CommonUtil.returnMessageJson(true, "修改成功!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|