|
|
|
@ -2,7 +2,6 @@ package com.dsideal.QingLong.Zbdc.Controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.compress.ZipWriter;
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dsideal.QingLong.Base.Model.BaseModel;
|
|
|
|
|
import com.dsideal.QingLong.Bean.TZbdcTree;
|
|
|
|
@ -28,7 +27,6 @@ import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@ -36,6 +34,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
|
|
|
|
|
private final ZbdcModel zm = new ZbdcModel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取当前登录人员所在学校的学校基本信息,支持查询每个年份,默认是当前年份
|
|
|
|
|
*
|
|
|
|
@ -653,6 +652,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:查询基础信息
|
|
|
|
|
*/
|
|
|
|
@ -683,6 +683,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
//导出
|
|
|
|
|
String excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xlsx";
|
|
|
|
|
ExcelExportUtil.exportByTemplate(list.getList(), template, excelFile);
|
|
|
|
|
//提供下载
|
|
|
|
|
renderFile(new File(excelFile), "基础信息.xlsx");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -909,13 +910,13 @@ public class ZbdcController extends Controller {
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"page", "limit"})
|
|
|
|
|
public void listSchool(int year, String area_id,int check_type_id, int school_type_id, String keyword, int page, int limit) {
|
|
|
|
|
public void listSchool(int year, String area_id, int check_type_id, int school_type_id, String keyword, int page, int limit) {
|
|
|
|
|
if (year == 0) year = DateTime.now().year();//如果没有传入获取的年份,那么就是系统的默认当前年份
|
|
|
|
|
if (StrKit.isBlank(keyword)) keyword = "";
|
|
|
|
|
//上报单位ID
|
|
|
|
|
String bureau_id = SessionKit.get(getRequest(), getResponse(), "bureau_id");
|
|
|
|
|
|
|
|
|
|
Page<Record> list = zm.listSchool(year, area_id,check_type_id, bureau_id, school_type_id, keyword, page, limit);
|
|
|
|
|
Page<Record> list = zm.listSchool(year, area_id, check_type_id, bureau_id, school_type_id, keyword, page, limit);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1078,18 +1079,22 @@ public class ZbdcController extends Controller {
|
|
|
|
|
//1、基础信息
|
|
|
|
|
Page<Record> p1 = zm.getQueryBaseInfo(null, 0, year, null, 1, 99999, bureau_id);
|
|
|
|
|
String template = excelPath + "Query_BaseInfo.xlsx";
|
|
|
|
|
//修改一下模板
|
|
|
|
|
String template_tmp = zm.CleanTemplate(template, bureau_id);
|
|
|
|
|
//导出
|
|
|
|
|
String excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xlsx";
|
|
|
|
|
ExcelExportUtil.exportByTemplate(p1.getList(), template, excelFile);
|
|
|
|
|
ExcelExportUtil.exportByTemplate(p1.getList(), template_tmp, excelFile);
|
|
|
|
|
_map.put(excelFile, "基础信息.xlsx");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2、常规装备
|
|
|
|
|
Page<Record> p2 = zm.getQueryCgzb(null, 0, year, null, 1, 99999, bureau_id);
|
|
|
|
|
template = excelPath + "Query_Cgzb.xlsx";
|
|
|
|
|
//修改一下模板
|
|
|
|
|
template_tmp = zm.CleanTemplate(template, bureau_id);
|
|
|
|
|
//导出
|
|
|
|
|
excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xlsx";
|
|
|
|
|
ExcelExportUtil.exportByTemplate(p2.getList(), template, excelFile);
|
|
|
|
|
ExcelExportUtil.exportByTemplate(p2.getList(), template_tmp, excelFile);
|
|
|
|
|
_map.put(excelFile, "常规装备.xlsx");
|
|
|
|
|
|
|
|
|
|
//3、仪器设备
|
|
|
|
@ -1110,6 +1115,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
//导出
|
|
|
|
|
excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xlsx";
|
|
|
|
|
ExcelExportUtil.exportByTemplate(p4.getList(), template, excelFile);
|
|
|
|
|
|
|
|
|
|
_map.put(excelFile, "信息化设备/" + dcb_name + ".xlsx");
|
|
|
|
|
}
|
|
|
|
|
// 使用 ZipWriter 创建 ZIP 包并添加文件,同时更改文件名称
|
|
|
|
|