소스 검색

excel导出优化

shenhao 3 년 전
부모
커밋
3f25cf2319
21개의 변경된 파일1557개의 추가작업 그리고 462개의 파일을 삭제
  1. 7 0
      pom.xml
  2. 1 1
      src/main/java/com/ssj/api/controller/ApiWxController.java
  3. 2 2
      src/main/java/com/ssj/dao/weixin/zuoyb/dao/ZuoybKnowHowDetailsSortDao.java
  4. 2 0
      src/main/java/com/ssj/dao/weixin/zuoyb/dao/ZuoybQueryDao.java
  5. 62 9
      src/main/java/com/ssj/dao/weixin/zuoyb/dao/impl/ZuoybQueryDaoImpl.java
  6. 8 0
      src/main/java/com/ssj/framework/basic/utils/DateHelper.java
  7. 3 3
      src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java
  8. 4 1
      src/main/java/com/ssj/service/weixin/zuoyb/service/ZuoybKnowHowDetailsSortService.java
  9. 8 2
      src/main/java/com/ssj/service/weixin/zuoyb/service/impl/ZuoybKnowHowDetailsSortServiceImpl.java
  10. 184 426
      src/main/java/com/ssj/sys/controller/SysZuoybController.java
  11. 452 0
      src/main/java/com/ssj/sys/model/HowDetailExportVO.java
  12. 161 0
      src/main/java/com/ssj/sys/model/HowExportVO.java
  13. 319 0
      src/main/java/com/ssj/sys/model/HowKdlExportVO.java
  14. 39 0
      src/main/java/com/ssj/sys/model/RowRangeDto.java
  15. 48 0
      src/main/java/com/ssj/sys/utils/BizMergeStrategy.java
  16. 182 0
      src/main/java/com/ssj/sys/utils/ExcelMergeUtil.java
  17. 2 0
      src/main/resources/templates/sys/appinfo/appinfoAdd.html
  18. 2 0
      src/main/resources/templates/sys/appinfo/appinfoList.html
  19. 5 4
      src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionAdd.html
  20. 0 2
      src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionList.html
  21. 66 12
      src/main/resources/templates/sys/zuoyb/knowHowList.html

+ 7 - 0
pom.xml

@@ -168,6 +168,13 @@
             <version>2.8.5</version>
         </dependency>
 
+        <!--easyexcel -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.0.5</version>
+        </dependency>
+
 
         <dependency>
             <groupId>io.swagger</groupId>

+ 1 - 1
src/main/java/com/ssj/api/controller/ApiWxController.java

@@ -122,7 +122,7 @@ public class ApiWxController extends BaseController {
                             if (merchant.getPosType() == 2) {
                                 merchantMealService.saveMerchantMeal(merchant.getId(), 5, libOrderDetails.getType(), libOrderDetails.getNumber(), 0, unitPrice, libOrderDetails.getPrice().doubleValue(), libOrderDetails.getStartActiveTime(), libOrderDetails.getActiveTime(),orderNo);
                             } else { //3
-                                String endActiveTime = DateHelper.format(DateHelper.getMonthDate(DateHelper.parseDate(libOrderDetails.getActiveTime(), "yyyy-MM-dd"), libOrderDetails.getNumber()), "yyyy-MM-dd");
+                                String endActiveTime = DateHelper.format(DateHelper.getYesToday(DateHelper.getMonthDate(DateHelper.parseDate(libOrderDetails.getActiveTime(), "yyyy-MM-dd"), libOrderDetails.getNumber()),-1), "yyyy-MM-dd");
                                 merchantMealService.saveMerchantMealSC(merchant.getId(), 5, libOrderDetails.getType(), libOrderDetails.getActiveTime(), endActiveTime, unitPrice, libOrderDetails.getPrice().doubleValue(), null,orderNo);
                             }
 

+ 2 - 2
src/main/java/com/ssj/dao/weixin/zuoyb/dao/ZuoybKnowHowDetailsSortDao.java

@@ -83,9 +83,9 @@ public interface ZuoybKnowHowDetailsSortDao extends JpaRepository<ZuoybKnowHowDe
 	@Modifying
     void updateAliasByStatAndName(String howId, int stat, String name);
 
-	@Query(nativeQuery = true, value = "update zyb_know_how_details_sort set  alias=?3 where  how_details_id=?1 and stat = ?2")
+	@Query(nativeQuery = true, value = "update zyb_know_how_details_sort set  alias=?3,module=?4,two_module=?5,jxmb=?6,ydsl=?7,memorize=?8,understanding=?9,apply=?10 where  how_details_id=?1 and stat = ?2")
 	@Modifying
-	void updateAliasByStatAndNameAndDetailId(String howDetailId, int stat, String name);
+	void updateAliasByStatAndNameAndDetailId(String howDetailId, int stat, String s, String module, String twoModule, String jxmb, String name, Integer memorize, Integer understanding, Integer apply);
 
 	@Query(nativeQuery = true, value = "update zyb_know_how_details_sort set  alias=?3 where  how_details_kd_id=?1 and stat = ?2")
 	@Modifying

+ 2 - 0
src/main/java/com/ssj/dao/weixin/zuoyb/dao/ZuoybQueryDao.java

@@ -9,6 +9,7 @@ import com.ssj.service.kmt.dto.KnowHowDTO;
 import com.ssj.service.kmt.dto.KnowHowDetailsDTO;
 import com.ssj.service.kmt.dto.TestPointDTO;
 import com.ssj.service.kmt.request.KnowledgeRequest;
+import com.ssj.sys.model.HowExportVO;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 
@@ -333,4 +334,5 @@ public interface ZuoybQueryDao {
 
 	List<TbLibJoin> findAllCity(Map map);
 
+    Page<HowExportVO> getZuoybKnowHowPage(Map<String, Object> params, Pageable initPage);
 }

+ 62 - 9
src/main/java/com/ssj/dao/weixin/zuoyb/dao/impl/ZuoybQueryDaoImpl.java

@@ -13,6 +13,7 @@ import com.ssj.service.kmt.dto.KnowHowDTO;
 import com.ssj.service.kmt.dto.KnowHowDetailsDTO;
 import com.ssj.service.kmt.dto.TestPointDTO;
 import com.ssj.service.kmt.request.KnowledgeRequest;
+import com.ssj.sys.model.HowExportVO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -1190,17 +1191,17 @@ public class ZuoybQueryDaoImpl  implements ZuoybQueryDao{
 		}
 		selSQL.append(" SELECT t.course_name,t.id, ");
 		if(j==0){
-			selSQL.append("t.`name`,t.num,t.module, date_format(t.`create_time`,'%Y-%m-%d %H:%i') as  t_create_time, ");
+			selSQL.append("t.`name`,t.num,t.module, date_format(t.`create_time`,'%Y-%m-%d %H:%i') as  create_time, ");
 		}else{
-			selSQL.append(" s1.alias as `name`,s1.num,s1.module, date_format(s1.`create_time`,'%Y-%m-%d %H:%i') as  t_create_time, ");
+			selSQL.append(" s1.alias as `name`,s1.num,s1.module, date_format(s1.`create_time`,'%Y-%m-%d %H:%i') as  create_time, ");
 		}
 
-        selSQL.append(" t11.before_name,t11.after_name,t11.type,t11.is_hot, t11.module as t11_module, t11.img,");
+        selSQL.append(" t11.before_name,t11.after_name,t11.type,t11.is_hot as hot, t11.module as detail_module, t11.img,");
         selSQL.append(" t11.`name` as detail_name,t11.memorize,t11.understanding,t11.apply,t11.duration,t11.id as detail_id,t11.two_module, t11.attr_type ,   \n");
         selSQL.append(" t11.jxmb,t11.zdbx,t11.ydsl, t11.num as detail_num ,date_format(t11.`create_time`,'%Y-%m-%d %H:%i') as  detail_create_time, ");
-        selSQL.append(" s.id as s_id ,s.semester,s.type as s_type,s.grade,s.num as s_num,s.grade_num ,s.alias ,date_format(s.`create_time`,'%Y-%m-%d %H:%i') as  s_create_time , ");
+        selSQL.append(" s.id as detail_sort_id ,s.semester,s.type as sort_type,s.grade,s.num as sort_num,s.grade_num ,s.alias as detail_sort_name,date_format(s.`create_time`,'%Y-%m-%d %H:%i') as  sort_create_time , ");
 
-		selSQL.append(" s.jxmb as s_jxmb,s.zdbx as s_zdbx,s.ydsl as s_ydsl,s.module as s_module ,s.two_module as s_two_module,s.memorize as s_memorize ,s.understanding as s_understanding ,s.apply as s_apply ,s.attr_type as s_attr_type ");
+		selSQL.append(" s.jxmb as sort_jxmb,s.zdbx as sort_zdbx,s.ydsl as sort_ydsl,s.module as sort_module ,s.two_module as sort_two_module,s.memorize as sort_memorize ,s.understanding as sort_understanding ,s.apply as sort_apply ,s.attr_type as sort_attr_type ");
         selSQL.append("from   zyb_know_how_details t11 \n");
         selSQL.append("left join zyb_know_how t on t.id = t11.how_id\n");
         selSQL.append(" JOIN zyb_know_how_details_sort s on s.how_details_id = t11.id  and s.stat =2 ");
@@ -1255,12 +1256,12 @@ public class ZuoybQueryDaoImpl  implements ZuoybQueryDao{
 		}
 		selSQL.append("SELECT t.course_name,  t.id, ");
 		if(j>0){
-			selSQL.append(" s1.alias as `name`,s1.num,s1.module, date_format(s1.`create_time`,'%Y-%m-%d %H:%i') as  t_create_time, ");
+			selSQL.append(" s1.alias as `name`,s1.num,s1.module, date_format(s1.`create_time`,'%Y-%m-%d %H:%i') as  create_time, ");
 			selSQL.append(" s2.alias as detail_name,t11.memorize,t11.understanding,t11.apply,t11.duration,t11.id as detail_id,s2.two_module,  ");
 			selSQL.append(" s2.jxmb,s2.zdbx,s2.ydsl, s2.num as detail_num ,date_format(s2.`create_time`,'%Y-%m-%d %H:%i') as  detail_create_time,  ");
 
 		}else{
-			selSQL.append(" t.`name`,t.num,t.module, date_format(t.`create_time`,'%Y-%m-%d %H:%i') as  t_create_time,  ");
+			selSQL.append(" t.`name`,t.num,t.module, date_format(t.`create_time`,'%Y-%m-%d %H:%i') as  create_time,  ");
 
 			selSQL.append(" t11.before_name,t11.after_name,t11.type,t11.is_hot, t11.module as t11_module, t11.img,");
 			selSQL.append(" t11.`name` as detail_name,t11.memorize,t11.understanding,t11.apply,t11.duration,t11.id as detail_id,t11.two_module,  ");
@@ -1270,8 +1271,8 @@ public class ZuoybQueryDaoImpl  implements ZuoybQueryDao{
 
 
 
-        selSQL.append(" s.id as s_id ,s.semester,s.type as s_type,s.grade,s.num as s_num,s.grade_num ,s.alias , date_format(s.`create_time`,'%Y-%m-%d %H:%i') as  s_create_time , ");
-        selSQL.append(" d.id as d_id ,d.`name` as d_name ,d.num as d_num ,d.ydsl as d_ydsl ,d.img as d_img ,d.label as d_label,     d.`level` as d_level ,date_format(d.`create_time`,'%Y-%m-%d %H:%i') as  d_create_time  ");
+        selSQL.append(" s.id as sort_id ,s.semester,s.type as sort_type,s.grade,s.num as sort_num,s.grade_num ,s.alias as sort_name, date_format(s.`create_time`,'%Y-%m-%d %H:%i') as  sort_create_time , ");
+        selSQL.append(" d.id as kd_id ,d.`name` as kd_name ,d.num as kd_num ,d.ydsl as kd_ydsl ,d.img as kd_img ,d.label as kd_label,     d.`level` as kd_level ,date_format(d.`create_time`,'%Y-%m-%d %H:%i') as  kd_create_time  ");
         selSQL.append("from   zyb_know_how_details_kd  d  JOIN  zyb_know_how_details t11   on d.how_details_id = t11.id   ");
         selSQL.append("left join zyb_know_how t on t.id = t11.how_id  ");
         selSQL.append("LEFT JOIN zyb_know_how_details_sort s on s.how_details_kd_id = d.id   and s.stat =3 ");
@@ -1668,4 +1669,56 @@ public class ZuoybQueryDaoImpl  implements ZuoybQueryDao{
 		}
 		return dao.findList(selSQL.toString(),queryParams.toArray(),TbLibJoin.class);
 	}
+
+	@Override
+	public Page<HowExportVO> getZuoybKnowHowPage(Map<String, Object> params, Pageable initPage) {
+		StringBuilder selSQL = new StringBuilder();
+		List<Object> queryParams = new ArrayList<Object>();
+
+		selSQL.append("SELECT t.`id`, t.`course_name`, date_format(t.create_time,'%Y-%m-%d %H:%i') as  `create_time` , t.`lib_id`,t.`name`, t.`num`, t.`module`, t.`is_zt`  ");
+		selSQL.append(" ,s.id as how_sort_id ,s.type as how_type,s.grade ,s.grade_num ,s.semester,s.num as how_num ,s.alias ,date_format(s.create_time,'%Y-%m-%d %H:%i')  as how_create_time ");
+		selSQL.append("from  zyb_know_how t \n");
+		selSQL.append("LEFT JOIN zyb_know_how_details_sort s on s.how_id = t.id  and s.stat =1 ");
+		selSQL.append("where t.lib_id = ? \n");
+		queryParams.add(params.get("EQ_libId"));
+		int j=0;
+		Object courseName = params.get("EQ_courseName");
+		if(courseName != null && !courseName.equals("")){
+			selSQL.append("and t.course_name = ? \n");
+			queryParams.add(courseName);
+
+		}
+		if(params.get("EQ_grade") != null && !params.get("EQ_grade").equals("")){
+			selSQL.append("and s.grade_num = ? \n");
+			queryParams.add(params.get("EQ_grade"));
+		}
+		if(params.get("banben") != null && !params.get("banben").equals("")){
+			selSQL.append("and s.type = ? \n");
+			queryParams.add(params.get("banben"));
+			j++;
+
+		}
+		if(params.get("isZt") != null && !params.get("isZt").equals("")){
+			selSQL.append("and t.is_zt = ? \n");
+			queryParams.add(params.get("isZt"));
+			j++;
+
+		}
+		if(params.get("semester") != null && !params.get("semester").equals("")){
+			selSQL.append("and s.semester = ? \n");
+			queryParams.add(params.get("semester"));
+		}
+		if(params.get("LIKE_name") != null && !params.get("LIKE_name").equals("")){
+			selSQL.append("and  ( t.name  LIKE  CONCAT(CONCAT('%',?,'%'))  or  s.alias  LIKE  CONCAT(CONCAT('%',?,'%'))  ) \n");
+			queryParams.add(params.get("LIKE_name"));
+			queryParams.add(params.get("LIKE_name"));
+		}
+		if(j>0){
+			selSQL.append("order by t.course_name,s.num ,t.create_time , t.num ");
+		}else{
+			selSQL.append("order by t.course_name,t.num ,t.create_time , s.num ");
+
+		}
+		return dao.findPage(selSQL.toString(),queryParams.toArray(),initPage,HowExportVO.class);
+	}
 }

+ 8 - 0
src/main/java/com/ssj/framework/basic/utils/DateHelper.java

@@ -548,6 +548,14 @@ public class DateHelper {
         return cal.getTime();
     }
 
+    public static Date getYesToday(Date date, int days) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DAY_OF_MONTH, days);
+        date = calendar.getTime();
+        return date;
+    }
+
     public static Date getYearDate(Date smdate, int year) {
         Calendar cal = Calendar.getInstance();
         cal.setTime(smdate);

+ 3 - 3
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java

@@ -157,7 +157,7 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 			if(StringUtils.isNotEmpty(startActiveTime) && StringUtils.isNotEmpty(activeTime) && !activeTime.equals(startActiveTime)) {
 				Integer month=DateHelper.getDifferMonth(DateHelper.parseDate(startActiveTime, "yyyy-MM-dd"),DateHelper.parseDate(activeTime, "yyyy-MM-dd"));
 				Date startTime=DateHelper.parseDate(startActiveTime, "yyyy-MM-dd");
-				Date endTime=DateHelper.getMonthDate(startTime,1);
+				Date endTime=DateHelper.getYesToday(DateHelper.getMonthDate(startTime,1),-1) ;
 				for (int i =1; i <=month; i++) {
 					MerchantMeal meal=new MerchantMeal();
 					meal.setMerchantId(merchantId);
@@ -182,7 +182,7 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 			
 			//端口商户的处理,
 			Date signTime=mealOrder.getActiveTime();
-			Date endSignTime=DateHelper.getMonthDate(signTime,1);
+			Date endSignTime=DateHelper.getYesToday(DateHelper.getMonthDate(signTime,1),-1);
 			MerchantMeal nextMerchantMeal=dao.findMerchantMealByServiceMaxEnd(merchantId, signTime);
 			if(nextMerchantMeal!=null) {
 				endSignTime=nextMerchantMeal.getEndSignTime();
@@ -282,7 +282,7 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 			mrchantMealOrderService.save(mealOrder);
 
 			Date signTime=DateHelper.parseDate(startActiveTime, "yyyy-MM-dd");
-			Date endSignTime=DateHelper.getMonthDate(signTime,1);
+			Date endSignTime=DateHelper.getYesToday(DateHelper.getMonthDate(signTime,1),-1);
 			MerchantMeal nextMerchantMeal=dao.findMerchantMealByServiceMaxEnd(merchantId, signTime);
 			if(nextMerchantMeal!=null) {
 				endSignTime=nextMerchantMeal.getEndSignTime();

+ 4 - 1
src/main/java/com/ssj/service/weixin/zuoyb/service/ZuoybKnowHowDetailsSortService.java

@@ -2,6 +2,7 @@ package com.ssj.service.weixin.zuoyb.service;
 
 import com.ssj.bean.weixin.zyb.domain.ZuoybKnowHowDetailsSort;
 import com.ssj.framework.core.common.service.BaseService;
+import com.ssj.sys.model.HowExportVO;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 
@@ -88,7 +89,9 @@ public interface ZuoybKnowHowDetailsSortService extends BaseService<ZuoybKnowHow
 	 */
     void updateAliasByStatAndName(String howId, int stat, String name);
 
-	void updateAliasByStatAndNameAndDetailId(String id, int i, String name);
+	void updateAliasByStatAndNameAndDetailId(String id, int i, String name, String module, String twoModule, String jxmb, String ydsl, Integer memorize, Integer understanding, Integer apply);
 
 	void updateAliasByStatAndNameAndKdId(String id, int i, String name);
+
+    Page<HowExportVO> getZuoybKnowHowPage(Map<String, Object> params, Pageable initPage);
 }

+ 8 - 2
src/main/java/com/ssj/service/weixin/zuoyb/service/impl/ZuoybKnowHowDetailsSortServiceImpl.java

@@ -8,6 +8,7 @@ import com.ssj.framework.core.persistence.DynamicSpecifications;
 import com.ssj.framework.core.persistence.SearchFilter;
 import com.ssj.mapper.knowledge.KmtKnowledgeMapper;
 import com.ssj.service.weixin.zuoyb.service.ZuoybKnowHowDetailsSortService;
+import com.ssj.sys.model.HowExportVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
@@ -144,12 +145,17 @@ public class ZuoybKnowHowDetailsSortServiceImpl extends BaseServiceImpl<ZuoybKno
 	}
 
 	@Override
-	public void updateAliasByStatAndNameAndDetailId(String howDetailId, int stat, String name) {
-		zuoybKnowHowDetailsSortDao.updateAliasByStatAndNameAndDetailId(howDetailId,stat,name);
+	public void updateAliasByStatAndNameAndDetailId(String howDetailId, int stat, String name, String module, String twoModule, String jxmb, String ydsl, Integer memorize, Integer understanding, Integer apply) {
+		zuoybKnowHowDetailsSortDao.updateAliasByStatAndNameAndDetailId(howDetailId,stat,name,module,twoModule,jxmb,ydsl,memorize,understanding,apply);
 	}
 
 	@Override
 	public void updateAliasByStatAndNameAndKdId(String kdId, int stat, String name) {
 		zuoybKnowHowDetailsSortDao.updateAliasByStatAndNameAndKdId(kdId,stat,name);
 	}
+
+	@Override
+	public Page<HowExportVO> getZuoybKnowHowPage(Map<String, Object> params, Pageable initPage) {
+		return queryDao.getZuoybKnowHowPage(params,initPage);
+	}
 }

+ 184 - 426
src/main/java/com/ssj/sys/controller/SysZuoybController.java

@@ -1,6 +1,11 @@
 package com.ssj.sys.controller;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.util.MapUtils;
+import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.ssj.bean.common.framework.core.domain.Response;
 import com.ssj.bean.sys.sort.domain.Sort;
 import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
@@ -13,10 +18,17 @@ import com.ssj.framework.core.util.SystemResourceLocator;
 import com.ssj.service.sys.sort.service.SortService;
 import com.ssj.service.weixin.library.service.ILibJoinService;
 import com.ssj.service.weixin.zuoyb.service.*;
+import com.ssj.sys.model.HowDetailExportVO;
+import com.ssj.sys.model.HowExportVO;
+import com.ssj.sys.model.HowKdlExportVO;
+import com.ssj.sys.model.RowRangeDto;
+import com.ssj.sys.utils.BizMergeStrategy;
+import com.ssj.sys.utils.ExcelMergeUtil;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -26,12 +38,10 @@ import org.springframework.core.io.ClassPathResource;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort.Direction;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 
@@ -41,6 +51,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.net.URLEncoder;
 import java.util.*;
 
 /**
@@ -769,7 +780,7 @@ public class SysZuoybController extends BaseController {
 							  @RequestParam(required = false, defaultValue = "10") int pageSize,
 							  @RequestParam(required = false, defaultValue = "1") int pageNo,
 							  @RequestParam(required = false, defaultValue = "SSJ") String EQ_libId)
-			throws Exception {
+			 {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("EQ_libId", EQ_libId);
 		params.put("LIKE_name",request.getParameter("LIKE_name")==null?"":request.getParameter("LIKE_name"));
@@ -786,7 +797,7 @@ public class SysZuoybController extends BaseController {
 
 		Page<Map<String, Object>> page= zuoybKnowHowService.getZuoybKnowHow(params, initPage(pageNo,pageSize));
 		SplitPage sp = new SplitPage();
-		sp.setAction(request.getRequestURI().toString());
+		sp.setAction(request.getRequestURI());
 		sp.setPageNo(pageNo);
 		sp.setPageSize(pageSize);
 		sp.setParams(params);
@@ -1362,7 +1373,8 @@ public class SysZuoybController extends BaseController {
 				});
 			}else{
 				//修改sort表的alias
-				zuoybKnowHowDetailsSortService.updateAliasByStatAndNameAndDetailId(how.getId(),2,how.getName());
+				zuoybKnowHowDetailsSortService.updateAliasByStatAndNameAndDetailId(
+						how.getId(),2,how.getName(),how.getModule(),how.getTwoModule(),how.getJxmb(),how.getYdsl(),how.getMemorize(),how.getUnderstanding(),how.getApply());
 			}
 
 		}else{
@@ -2267,16 +2279,14 @@ public class SysZuoybController extends BaseController {
 	@RequestMapping(value = "/exportHowExcel", method = RequestMethod.POST)
 	@ResponseBody
 	public void exportHowExcel(HttpServletRequest request, HttpServletResponse response,
-							   @RequestParam(required = false, defaultValue = "SSJ") String EQ_libId,
-							   String EQ_courseName,
-							   String LIKE_name,
-							   String EQ_grade,
-							   Integer semester,
-							   Integer banben
+							   @RequestParam(required = false, defaultValue = "SSJ") String EQ_libId
 
-	) throws Exception {
-		Map<String, Object> params = new HashMap<String, Object>();
+	) throws IOException{
 
+		Map<String, Object> params = new HashMap<String, Object>();
+		String EQ_courseName = request.getParameter("EQ_courseName")==null?"":request.getParameter("EQ_courseName");
+		String EQ_grade = request.getParameter("EQ_grade")==null?"":request.getParameter("EQ_grade");
+		String semester = request.getParameter("semester")==null?"":request.getParameter("semester");
 		StringBuffer fileName =new StringBuffer("单元");
 		if(EQ_courseName != null){
 			fileName.append(EQ_courseName);
@@ -2285,108 +2295,78 @@ public class SysZuoybController extends BaseController {
 			fileName.append(EQ_grade+"年级");
 		}
 		if(semester != null && !"".equals(semester)){
-			fileName.append(semester==1?"上学期":"下学期");
+			fileName.append(semester.equals("1")?"上学期":"下学期");
 		}
-
+		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
 		params.put("EQ_libId", EQ_libId);
-		params.put("LIKE_name", LIKE_name);
-		params.put("banben", banben);
-		ServletOutputStream os = null;
-		try {
-			os = response.getOutputStream(); // 获得输出流
-			response.reset(); // 清空输出流
-
-			String  filesName = new String(fileName.toString().getBytes("gb2312"), "ISO8859-1") +".xlsx";
-			int rownum = 1; // 添加的起始行
-
-
+		params.put("LIKE_name",request.getParameter("LIKE_name")==null?"":request.getParameter("LIKE_name"));
+		params.put("EQ_grade",request.getParameter("EQ_grade")==null?"":request.getParameter("EQ_grade"));//年级
+		params.put("EQ_courseName",request.getParameter("EQ_courseName")==null?"":request.getParameter("EQ_courseName"));
+		params.put("semester",request.getParameter("semester")==null?"":request.getParameter("semester"));//学期
+		params.put("banben",request.getParameter("banben")==null?"":request.getParameter("banben"));//版本
+		params.put("beginDate", request.getParameter("beginDate")==null? "":request.getParameter("beginDate"));
+		params.put("endDate", request.getParameter("endDate")==null? "":request.getParameter("endDate"));
+		params.put("LIKE_id", request.getParameter("LIKE_id")==null?"":request.getParameter("LIKE_id"));
+		params.put("isZt", request.getParameter("isZt")==null?"":request.getParameter("isZt"));
 
-			ClassPathResource classPathResource = new ClassPathResource("/excel/report/report13.xlsx");
-			XSSFWorkbook workbook = new XSSFWorkbook(classPathResource.getInputStream());
-			response.setHeader("Content-disposition", "attachment; filename=" + filesName); // 设定输出文件头
-			// response.setContentType("application/msexcel"); //定义输出类型
-			response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+		// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
+		ExcelWriter excelWriter = null;
+		try {
+			int pageSize = 100;
+			int pageNo = 10000;
+			response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
 			response.setCharacterEncoding("utf-8");
-			XSSFSheet sheet = workbook.getSheetAt(0); // 读取第一个工作簿
-			XSSFRow row;
-			XSSFCell cell = null;
-			XSSFCellStyle style = this.getxStyle(workbook);
-			List<Map<String, Object>>  list=zuoybKnowHowDetailsSortService.getKonwVersion(EQ_libId, EQ_courseName, EQ_grade, banben, semester, LIKE_name);
-			int endRow = rownum;
-			int startRow = rownum;
-
-			int idnum =6;
-			for (int i = 0; i < list.size(); i++) {
-				row = sheet.createRow(rownum);
-				int j = 0;
-				myCreateCellx(j++, list.get(i).get("course_name")!=null?list.get(i).get("course_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("name")!=null?list.get(i).get("name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("id").toString(), row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("num")!=null?list.get(i).get("num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("module")!=null?list.get(i).get("module").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("create_time")!=null?list.get(i).get("create_time").toString():"", row, cell, style); // 列1
-
-
-
-				myCreateCellx(j++, list.get(i).get("s_id")!=null?list.get(i).get("s_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("alias")!=null?list.get(i).get("alias").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("semester")!=null?list.get(i).get("semester").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_num")!=null?list.get(i).get("s_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("grade_num")!=null?list.get(i).get("grade_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_type")!=null?list.get(i).get("s_type").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_create_time")!=null?list.get(i).get("s_create_time").toString():"", row, cell, style); // 列1
-				if (i > 0) {
-
-
-
-					if (list.get(i).get("id").toString().equals(list.get(i - 1).get("id").toString())) {
-						endRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (startRow != endRow) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-						startRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						endRow = rownum;// 合并结束行同合并开始行
-					}
-
-
-
-
-
-
-				}
-				rownum++;
-			}
-			workbook.write(os);
+			// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
+
+			String  filesName = URLEncoder.encode(fileName.toString(), "UTF-8").replaceAll("\\+", "%20");
+			response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filesName + ".xlsx");
+			Page<HowExportVO> page= zuoybKnowHowDetailsSortService.getZuoybKnowHowPage(params,initPage(1,100000));
+			//合并策略map
+			Map<String, List<RowRangeDto>> strategyMap = ExcelMergeUtil.addMerStrategy(page.getContent());
+			EasyExcel.write(response.getOutputStream(), HowExportVO.class)
+					//注册合并策略
+					.registerWriteHandler(new BizMergeStrategy(strategyMap))
+					.sheet("单元版本").doWrite(page.getContent());
+
+//			// 这里需要设置不关闭流
+//			excelWriter = EasyExcel.write(response.getOutputStream(), HowExportVO.class).build();
+//			WriteSheet writeSheet = EasyExcel.writerSheet("单元版本").build();
+//			for(int i=1;i<pageNo;i++){
+//				Page<HowExportVO> page= zuoybKnowHowDetailsSortService.getZuoybKnowHowPage(params,initPage(i,pageSize));
+//				if(!page.hasContent()){
+//					break;
+//
+//				}
+//				excelWriter.write(page.getContent(),writeSheet);
+//			}
 		} catch (Exception e) {
-			e.printStackTrace();
-		}finally{
-			if(os != null){
-				try {
-					os.flush();
-					os.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
+			response.reset();
+			response.setContentType("application/json");
+			response.setCharacterEncoding("utf-8");
+			Map<String, String> map = MapUtils.newHashMap();
+			map.put("status", "failure");
+			map.put("message", "下载文件失败" + e.getMessage());
+			response.getWriter().println(JSON.toJSONString(map));
+		}finally {
+			// 千万别忘记finish 会帮忙关闭流
+			if (excelWriter != null) {
+				excelWriter.finish();
 			}
+			//设置结束标记
+			request.getSession().setAttribute("endFlag", "1");
 		}
 	}
+
+	private List<HowDetailExportVO> howExportData(List<Map<String,Object>> list){
+		List<HowDetailExportVO> reList = new ArrayList<>();
+		if(!list.isEmpty()){
+			list.forEach(m->{
+				String jsonStr = JSONObject.toJSONString(m);
+				reList.add(JSONObject.parseObject(jsonStr, HowDetailExportVO.class));
+			});
+		}
+		return reList;
+	}
 	@RequestMapping(value = "/exportHowDetailsExcel", method = RequestMethod.POST)
 	@ResponseBody
 	public void exportHowDetailsExcel(HttpServletRequest request, HttpServletResponse response,
@@ -2399,7 +2379,7 @@ public class SysZuoybController extends BaseController {
 
 	) throws Exception {
 		Map<String, Object> params = new HashMap<String, Object>();
-
+		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
 		StringBuffer fileName =new StringBuffer("知识点");
 		if(EQ_courseName != null){
 			fileName.append(EQ_courseName);
@@ -2414,164 +2394,64 @@ public class SysZuoybController extends BaseController {
 		params.put("EQ_libId", EQ_libId);
 		params.put("LIKE_name", LIKE_name);
 		params.put("banben", banben);
-		ServletOutputStream os = null;
-		try {
-			os = response.getOutputStream(); // 获得输出流
-			response.reset(); // 清空输出流
-
-			String  filesName = new String(fileName.toString().getBytes("gb2312"), "ISO8859-1") +".xlsx";
-			int rownum = 1; // 添加的起始行
-
-
-
-			ClassPathResource classPathResource = new ClassPathResource("/excel/report/report14.xlsx");
-			XSSFWorkbook workbook = new XSSFWorkbook(classPathResource.getInputStream());
-
-			response.setHeader("Content-disposition", "attachment; filename=" + filesName); // 设定输出文件头
-			// response.setContentType("application/msexcel"); //定义输出类型
-			response.setContentType("application/vnd.ms-excel;charset=UTF-8");
-			response.setCharacterEncoding("utf-8");
-			XSSFSheet sheet = workbook.getSheetAt(0); // 读取第一个工作簿
-			XSSFRow row;
-			XSSFCell cell = null;
-			XSSFCellStyle style = this.getxStyle(workbook);
+        ExcelWriter excelWriter = null;
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
+
+            String  filesName = URLEncoder.encode(fileName.toString(), "UTF-8").replaceAll("\\+", "%20");
+            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filesName + ".xlsx");
 			List<Map<String, Object>>  list=zuoybKnowHowDetailsSortService.getKonwDetailVersion(EQ_libId, EQ_courseName, EQ_grade, banben, semester, LIKE_name);
-			int endRow = rownum;
-			int startRow = rownum;
-
-			int idnum =6;
-			int detailnum =23;
-			int detailStartRow =rownum ;
-			int detailEndRow = rownum;
-			for (int i = 0; i < list.size(); i++) {
-				row = sheet.createRow(rownum);
-				int j = 0;
-				myCreateCellx(j++, list.get(i).get("course_name")!=null?list.get(i).get("course_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("name")!=null?list.get(i).get("name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("id").toString(), row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("num")!=null?list.get(i).get("num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("module")!=null?list.get(i).get("module").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("t_create_time")!=null?list.get(i).get("t_create_time").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("detail_name")!=null?list.get(i).get("detail_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_id")!=null?list.get(i).get("detail_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("t11_module")!=null?list.get(i).get("t11_module").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("jxmb")!=null?list.get(i).get("jxmb").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("zdbx")!=null?list.get(i).get("zdbx").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("ydsl")!=null?list.get(i).get("ydsl").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("img")!=null?list.get(i).get("img").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("two_module")!=null?list.get(i).get("two_module").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("before_name")!=null?list.get(i).get("before_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("after_name")!=null?list.get(i).get("after_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("type")!=null?list.get(i).get("type").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("is_hot")!=null?list.get(i).get("is_hot").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("memorize")!=null?list.get(i).get("memorize").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("understanding")!=null?list.get(i).get("understanding").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("apply")!=null?list.get(i).get("apply").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("duration")!=null?list.get(i).get("duration").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("attr_type")!=null?list.get(i).get("attr_type").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_num")!=null?list.get(i).get("detail_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_create_time")!=null?list.get(i).get("detail_create_time").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("s_id")!=null?list.get(i).get("s_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("alias")!=null?list.get(i).get("alias").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("semester")!=null?list.get(i).get("semester").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_num")!=null?list.get(i).get("s_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("grade_num")!=null?list.get(i).get("grade_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_type")!=null?list.get(i).get("s_type").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("s_module")!=null?list.get(i).get("s_module").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_two_module")!=null?list.get(i).get("s_two_module").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_jxmb")!=null?list.get(i).get("s_jxmb").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_zdbx")!=null?list.get(i).get("s_zdbx").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_ydsl")!=null?list.get(i).get("s_ydsl").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_memorize")!=null?list.get(i).get("s_memorize").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_understanding")!=null?list.get(i).get("s_understanding").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_apply")!=null?list.get(i).get("s_apply").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("s_attr_type")!=null?list.get(i).get("s_attr_type").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_create_time")!=null?list.get(i).get("s_create_time").toString():"", row, cell, style); // 列1
-				if (i > 0) {
-
-					if (list.get(i).get("detail_id")!=null&&list.get(i).get("detail_id").toString().equals(list.get(i - 1).get("detail_id").toString())) {
-						detailEndRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = idnum; a < detailnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(detailStartRow, // first
-										detailEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (detailStartRow != detailEndRow) {
-							for (int a = idnum; a < detailnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(detailStartRow, // first
-										detailEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-						detailStartRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						detailEndRow = rownum;// 合并结束行同合并开始行
-					}
-
-
-					if (list.get(i).get("id").toString().equals(list.get(i - 1).get("id").toString())) {
-						endRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (startRow != endRow) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-						startRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						endRow = rownum;// 合并结束行同合并开始行
-					}
-
-
-
-
 
-
-				}
-				rownum++;
-			}
-			workbook.write(os);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}finally{
-			if(os != null){
-				try {
-					os.flush();
-					os.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-			}
+			List<HowDetailExportVO> dataList = howExportData(list);
+			//合并策略map
+            Map<String, List<RowRangeDto>> strategyMap = ExcelMergeUtil.addDetailMerStrategy(dataList);
+            EasyExcel.write(response.getOutputStream(), HowDetailExportVO.class)
+                    //注册合并策略
+                    .registerWriteHandler(new BizMergeStrategy(strategyMap))
+                    .sheet("单元版本").doWrite(dataList);
+
+//			// 这里需要设置不关闭流
+//			excelWriter = EasyExcel.write(response.getOutputStream(), HowExportVO.class).build();
+//			WriteSheet writeSheet = EasyExcel.writerSheet("单元版本").build();
+//			for(int i=1;i<pageNo;i++){
+//				Page<HowExportVO> page= zuoybKnowHowDetailsSortService.getZuoybKnowHowPage(params,initPage(i,pageSize));
+//				if(!page.hasContent()){
+//					break;
+//
+//				}
+//				excelWriter.write(page.getContent(),writeSheet);
+//			}
+        } catch (Exception e) {
+            response.reset();
+            response.setContentType("application/json");
+            response.setCharacterEncoding("utf-8");
+            Map<String, String> map = MapUtils.newHashMap();
+            map.put("status", "failure");
+            map.put("message", "下载文件失败" + e.getMessage());
+            response.getWriter().println(JSON.toJSONString(map));
+        }finally {
+            // 千万别忘记finish 会帮忙关闭流
+            if (excelWriter != null) {
+                excelWriter.finish();
+            }
+			//设置结束标记
+			request.getSession().setAttribute("endFlag", "1");
+        }
+	}
+
+	private List<HowKdlExportVO> kdExportData(List<Map<String,Object>> list){
+		List<HowKdlExportVO> reList = new ArrayList<>();
+		if(!list.isEmpty()){
+			list.forEach(m->{
+				String jsonStr = JSONObject.toJSONString(m);
+				reList.add(JSONObject.parseObject(jsonStr, HowKdlExportVO.class));
+			});
 		}
+		return reList;
 	}
+
 	@RequestMapping(value = "/exportHowDetailsKdExcel", method = RequestMethod.POST)
 	@ResponseBody
 	public void exportHowDetailsKdExcel(HttpServletRequest request, HttpServletResponse response,
@@ -2584,7 +2464,7 @@ public class SysZuoybController extends BaseController {
 
 	) throws Exception {
 		Map<String, Object> params = new HashMap<String, Object>();
-
+		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
 		StringBuffer fileName =new StringBuffer("考点");
 		if(EQ_courseName != null){
 			fileName.append(EQ_courseName);
@@ -2599,174 +2479,40 @@ public class SysZuoybController extends BaseController {
 		params.put("EQ_libId", EQ_libId);
 		params.put("LIKE_name", LIKE_name);
 		params.put("banben", banben);
-		ServletOutputStream os = null;
-		try {
-			os = response.getOutputStream(); // 获得输出流
-			response.reset(); // 清空输出流
-
-			String  filesName = new String(fileName.toString().getBytes("gb2312"), "ISO8859-1") +".xlsx";
-			int rownum = 1; // 添加的起始行
 
-			ClassPathResource classPathResource = new ClassPathResource("/excel/report/report15.xlsx");
-			XSSFWorkbook workbook = new XSSFWorkbook(classPathResource.getInputStream());
-			response.setHeader("Content-disposition", "attachment; filename=" + filesName); // 设定输出文件头
-			// response.setContentType("application/msexcel"); //定义输出类型
-			response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+		ExcelWriter excelWriter = null;
+		try {
+			response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
 			response.setCharacterEncoding("utf-8");
-			XSSFSheet sheet = workbook.getSheetAt(0); // 读取第一个工作簿
-			XSSFRow row;
-			XSSFCell cell = null;
-			XSSFCellStyle style = this.getxStyle(workbook);
-			List<Map<String, Object>>  list=zuoybKnowHowDetailsSortService.getKonwDetailKdVersion(EQ_libId, EQ_courseName, EQ_grade, banben, semester, LIKE_name);
-			int endRow = rownum;
-			int startRow = rownum;
-
-			int idnum =5;
-			int detailStartRow =rownum ;
-			int detailEndRow = rownum;
-			int detailnum =12;
-			int kdnum =19;
-			int kdStartRow =rownum ;
-			int kdEndRow = rownum;
-			for (int i = 0; i < list.size(); i++) {
-				row = sheet.createRow(rownum);
-				int j = 0;
-				myCreateCellx(j++, list.get(i).get("course_name")!=null?list.get(i).get("course_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("name")!=null?list.get(i).get("name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("id").toString(), row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("num")!=null?list.get(i).get("num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("t_create_time")!=null?list.get(i).get("t_create_time").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("detail_name")!=null?list.get(i).get("detail_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_id")!=null?list.get(i).get("detail_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("t11_module")!=null?list.get(i).get("t11_module").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("jxmb")!=null?list.get(i).get("jxmb").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("zdbx")!=null?list.get(i).get("zdbx").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("ydsl")!=null?list.get(i).get("ydsl").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_num")!=null?list.get(i).get("detail_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("detail_create_time")!=null?list.get(i).get("detail_create_time").toString():"", row, cell, style); // 列1
-
-				myCreateCellx(j++, list.get(i).get("d_id")!=null?list.get(i).get("d_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_name")!=null?list.get(i).get("d_name").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_ydsl")!=null?list.get(i).get("d_ydsl").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_img")!=null?list.get(i).get("d_img").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_num")!=null?list.get(i).get("d_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_label")!=null?list.get(i).get("d_label").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_level")!=null?list.get(i).get("d_level").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("d_create_time")!=null?list.get(i).get("d_create_time").toString():"", row, cell, style); // 列1
-
-
-
-				myCreateCellx(j++, list.get(i).get("s_id")!=null?list.get(i).get("s_id").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("alias")!=null?list.get(i).get("alias").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("semester")!=null?list.get(i).get("semester").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_num")!=null?list.get(i).get("s_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("grade_num")!=null?list.get(i).get("grade_num").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_type")!=null?list.get(i).get("s_type").toString():"", row, cell, style); // 列1
-				myCreateCellx(j++, list.get(i).get("s_create_time")!=null?list.get(i).get("s_create_time").toString():"", row, cell, style); // 列1
-				if (i > 0) {
-
-					if (list.get(i).get("detail_id")!=null&&list.get(i).get("detail_id").toString().equals(list.get(i - 1).get("detail_id").toString())) {
-						detailEndRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = idnum; a < detailnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(detailStartRow, // first
-										detailEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (detailStartRow != detailEndRow) {
-							for (int a = idnum; a < detailnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(detailStartRow, // first
-										detailEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-						detailStartRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						detailEndRow = rownum;// 合并结束行同合并开始行
-					}
-					if (list.get(i).get("d_id")!=null&&list.get(i).get("d_id").toString().equals(list.get(i - 1).get("d_id").toString())) {
-						kdEndRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = detailnum; a < kdnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(kdStartRow, // first
-										kdEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (kdStartRow != kdEndRow) {
-							for (int a = detailnum; a < kdnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(kdStartRow, // first
-										kdEndRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-						kdStartRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						kdEndRow = rownum;// 合并结束行同合并开始行
-					}
-
-
-					if (list.get(i).get("id").toString().equals(list.get(i - 1).get("id").toString())) {
-						endRow++;// 则合并结束行号+1
-						if (i == list.size() - 1) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-
-					} else {
-						if (startRow != endRow) {
-							for (int a = 0; a < idnum; a++) {
-								sheet.addMergedRegion(new CellRangeAddress(startRow, // first
-										endRow, // last row (0-based)
-										a, // first column (0-based)
-										a // last column (0-based)
-								));// 合并单元格
-							}
-						}
-						startRow = rownum;// 为下次合并做准备,把合并开始行号赋值为下一行开始号
-						endRow = rownum;// 合并结束行同合并开始行
-					}
-
-
-
-
+			// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
 
+			String  filesName = URLEncoder.encode(fileName.toString(), "UTF-8").replaceAll("\\+", "%20");
+			response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filesName + ".xlsx");
+			List<Map<String, Object>>  list=zuoybKnowHowDetailsSortService.getKonwDetailKdVersion(EQ_libId, EQ_courseName, EQ_grade, banben, semester, LIKE_name);
 
-				}
-				rownum++;
-			}
-			workbook.write(os);
+			List<HowKdlExportVO> dataList = kdExportData(list);
+			//合并策略map
+			Map<String, List<RowRangeDto>> strategyMap = ExcelMergeUtil.addKdMerStrategy(dataList);
+			EasyExcel.write(response.getOutputStream(), HowKdlExportVO.class)
+					//注册合并策略
+					.registerWriteHandler(new BizMergeStrategy(strategyMap))
+					.sheet("单元版本").doWrite(dataList);
 		} catch (Exception e) {
 			e.printStackTrace();
-		}finally{
-			if(os != null){
-				try {
-					os.flush();
-					os.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
+			response.reset();
+			response.setContentType("application/json");
+			response.setCharacterEncoding("utf-8");
+			Map<String, String> map = MapUtils.newHashMap();
+			map.put("status", "failure");
+			map.put("message", "下载文件失败" + e.getMessage());
+			response.getWriter().println(JSON.toJSONString(map));
+		}finally {
+			// 千万别忘记finish 会帮忙关闭流
+			if (excelWriter != null) {
+				excelWriter.finish();
 			}
+			//设置结束标记
+			request.getSession().setAttribute("endFlag", "1");
 		}
 	}
 
@@ -2813,4 +2559,16 @@ public class SysZuoybController extends BaseController {
 		cell.setCellValue(new XSSFRichTextString(value));
 		cell.setCellStyle(style);
 	}
+
+	@RequestMapping(value = "/getEndFlag", method = RequestMethod.POST)
+	@ResponseBody
+	private Response getEndFlag(HttpServletRequest request, HttpServletResponse response){
+		Response responseEntity = new Response();
+		//获取结束标记*/
+		Object flag = request.getSession().getAttribute("endFlag");
+		Map<String,Object> data = new HashMap<>();
+		data.put("flag",flag);
+		responseEntity.success(data);
+		return  responseEntity;
+	}
 }

+ 452 - 0
src/main/java/com/ssj/sys/model/HowDetailExportVO.java

@@ -0,0 +1,452 @@
+package com.ssj.sys.model;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className HowExportVO
+ * @description 知识点导出VO
+ * @date 2021/12/8
+ */
+@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
+@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,verticalAlignment =  VerticalAlignmentEnum.CENTER)
+@ColumnWidth(20)
+public class HowDetailExportVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 科目	单元	单元ID	单元序号	模块	创建时间	单元版本ID	单元版本别名	学期	排序	年级	版本	创建时间
+     * 科目	单元	单元ID	单元序号	模块	添加时间
+     * 知识点	知识点ID	一级模块	教学目标	重难点标识	要点梳理	要点梳理图片	二级模块
+     * 前知识点	后知识点	题目类型	重点章节	识记	理解	运用	时长(分钟)	知识点属性	知识点排序	添加时间
+     * 知识点版本id	知识点版本名称	学期	排序	年级	版本	一级模块	二级模块	教学目标	重难点标识
+     * 要点梳理	识记	理解	运用	知识点属性	添加时间
+     */
+    @ExcelProperty(value="科目",index = 0)
+    private String courseName;
+    @ExcelProperty(value="单元",index = 1)
+    private String name;
+    @ExcelProperty(value="单元ID",index = 2)
+    private String id;
+    @ExcelProperty(value="单元序号",index = 3)
+    private String num;
+    @ExcelProperty(value="模块",index = 4)
+    private String module;
+    @ExcelProperty(value="添加时间",index = 5)
+    private String createTime;
+
+    @ExcelProperty(value="知识点",index = 6)
+    private String detailId;
+    @ExcelProperty(value="知识点ID",index = 7)
+    private String detailName;
+    @ExcelProperty(value="一级模块",index = 8)
+    private String detailModule;
+    @ExcelProperty(value="教学目标",index = 9)
+    private String jxmb;
+    @ExcelProperty(value="重难点标识",index = 10)
+    private String zdbx;
+    @ExcelProperty(value="要点梳理",index = 11)
+    private String ydsl;
+    @ExcelProperty(value="要点梳理图片",index = 12)
+    private String img;
+    @ExcelProperty(value="二级模块",index = 13)
+    private String twoModule;
+
+    /**
+     *  * 前知识点	后知识点	题目类型	重点章节	识记	理解	运用	时长(分钟)	知识点属性	知识点排序	添加时间
+     *
+     */
+    @ExcelProperty(value = "前知识点",index=14)
+    private String beforeName;
+    @ExcelProperty(value = "后知识点",index=15)
+    private String afterName;
+    @ExcelProperty(value = "题目类型",index=16)
+    private String type;
+    @ExcelProperty(value = "重点章节",index=17)
+    private String hot;
+    @ExcelProperty(value = "识记",index=18)
+    private String memorize;
+    @ExcelProperty(value = "理解",index=19)
+    private String understanding;
+    @ExcelProperty(value = "运用",index=20)
+    private String apply;
+    @ExcelProperty(value = "时长(分钟)",index=21)
+    private String duration;
+    @ExcelProperty(value = "知识点属性",index=22)
+    private String attrType;
+    @ExcelProperty(value = "知识点排序",index=23)
+    private String detailNum;
+    @ExcelProperty(value = "添加时间",index=24)
+    private String detailCreateTime;
+    /**
+     * *      * 知识点版本id	知识点版本名称	学期	排序	年级	版本	一级模块	二级模块	教学目标	重难点标识
+     *      *      * 要点梳理	识记	理解	运用	知识点属性	添加时间
+     */
+    @ExcelProperty(value = "知识点版本id",index=25)
+    private String detailSortId;
+    @ExcelProperty(value = "知识点版本名称",index=26)
+    private String detailSortName;
+    @ExcelProperty(value = "学期",index=27)
+    private String semester;
+    @ExcelProperty(value = "排序",index=28)
+    private String detailSortNum;
+    @ExcelProperty(value = "年级",index=29)
+    private String gradeNum;
+    @ExcelProperty(value = "版本",index=30)
+    private String sortType;
+    @ExcelProperty(value = "一级模块",index=31)
+    private String sortModule;
+    @ExcelProperty(value = "二级模块",index=32)
+    private String sortTowModule;
+    @ExcelProperty(value = "教学目标",index=33)
+    private String sortJxmb;
+    @ExcelProperty(value = "重难点标识",index=34)
+    private String sortZdbx;
+    @ExcelProperty(value = "要点梳理",index=35)
+    private String sortYdsl;
+    @ExcelProperty(value = "识记",index=36)
+    private String sortMemorize;
+    @ExcelProperty(value = "理解",index=37)
+    private String sortUnderstanding;
+    @ExcelProperty(value = "运用",index=38)
+    private String sortApply;
+    @ExcelProperty(value = "知识点属性",index=39)
+    private String sortAttrType;
+    @ExcelProperty(value = "添加时间",index=40)
+    private String sortCreateTime;
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public String getModule() {
+        return module;
+    }
+
+    public void setModule(String module) {
+        this.module = module;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getDetailId() {
+        return detailId;
+    }
+
+    public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+
+    public String getDetailName() {
+        return detailName;
+    }
+
+    public void setDetailName(String detailName) {
+        this.detailName = detailName;
+    }
+
+    public String getDetailModule() {
+        return detailModule;
+    }
+
+    public void setDetailModule(String detailModule) {
+        this.detailModule = detailModule;
+    }
+
+    public String getJxmb() {
+        return jxmb;
+    }
+
+    public void setJxmb(String jxmb) {
+        this.jxmb = jxmb;
+    }
+
+    public String getZdbx() {
+        return zdbx;
+    }
+
+    public void setZdbx(String zdbx) {
+        this.zdbx = zdbx;
+    }
+
+    public String getYdsl() {
+        return ydsl;
+    }
+
+    public void setYdsl(String ydsl) {
+        this.ydsl = ydsl;
+    }
+
+    public String getImg() {
+        return img;
+    }
+
+    public void setImg(String img) {
+        this.img = img;
+    }
+
+    public String getTwoModule() {
+        return twoModule;
+    }
+
+    public void setTwoModule(String twoModule) {
+        this.twoModule = twoModule;
+    }
+
+    public String getBeforeName() {
+        return beforeName;
+    }
+
+    public void setBeforeName(String beforeName) {
+        this.beforeName = beforeName;
+    }
+
+    public String getAfterName() {
+        return afterName;
+    }
+
+    public void setAfterName(String afterName) {
+        this.afterName = afterName;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getHot() {
+        return hot;
+    }
+
+    public void setHot(String isHot) {
+        this.hot = isHot;
+    }
+
+    public String getMemorize() {
+        return memorize;
+    }
+
+    public void setMemorize(String memorize) {
+        this.memorize = memorize;
+    }
+
+    public String getUnderstanding() {
+        return understanding;
+    }
+
+    public void setUnderstanding(String understanding) {
+        this.understanding = understanding;
+    }
+
+    public String getApply() {
+        return apply;
+    }
+
+    public void setApply(String apply) {
+        this.apply = apply;
+    }
+
+    public String getDuration() {
+        return duration;
+    }
+
+    public void setDuration(String duration) {
+        this.duration = duration;
+    }
+
+    public String getAttrType() {
+        return attrType;
+    }
+
+    public void setAttrType(String attrType) {
+        this.attrType = attrType;
+    }
+
+    public String getDetailNum() {
+        return detailNum;
+    }
+
+    public void setDetailNum(String detailNum) {
+        this.detailNum = detailNum;
+    }
+
+    public String getDetailCreateTime() {
+        return detailCreateTime;
+    }
+
+    public void setDetailCreateTime(String detailCreateTime) {
+        this.detailCreateTime = detailCreateTime;
+    }
+
+    public String getDetailSortId() {
+        return detailSortId;
+    }
+
+    public void setDetailSortId(String detailSortId) {
+        this.detailSortId = detailSortId;
+    }
+
+    public String getDetailSortName() {
+        return detailSortName;
+    }
+
+    public void setDetailSortName(String detailSortName) {
+        this.detailSortName = detailSortName;
+    }
+
+    public String getSemester() {
+        return semester;
+    }
+
+    public void setSemester(String semester) {
+        this.semester = semester;
+    }
+
+    public String getDetailSortNum() {
+        return detailSortNum;
+    }
+
+    public void setDetailSortNum(String detailSortNum) {
+        this.detailSortNum = detailSortNum;
+    }
+
+    public String getGradeNum() {
+        return gradeNum;
+    }
+
+    public void setGradeNum(String gradeNum) {
+        this.gradeNum = gradeNum;
+    }
+
+    public String getSortType() {
+        return sortType;
+    }
+
+    public void setSortType(String sortType) {
+        this.sortType = sortType;
+    }
+
+    public String getSortModule() {
+        return sortModule;
+    }
+
+    public void setSortModule(String sortModule) {
+        this.sortModule = sortModule;
+    }
+
+    public String getSortTowModule() {
+        return sortTowModule;
+    }
+
+    public void setSortTowModule(String sortTowModule) {
+        this.sortTowModule = sortTowModule;
+    }
+
+    public String getSortJxmb() {
+        return sortJxmb;
+    }
+
+    public void setSortJxmb(String sortJxmb) {
+        this.sortJxmb = sortJxmb;
+    }
+
+    public String getSortZdbx() {
+        return sortZdbx;
+    }
+
+    public void setSortZdbx(String sortZdbx) {
+        this.sortZdbx = sortZdbx;
+    }
+
+    public String getSortYdsl() {
+        return sortYdsl;
+    }
+
+    public void setSortYdsl(String sortYdsl) {
+        this.sortYdsl = sortYdsl;
+    }
+
+    public String getSortMemorize() {
+        return sortMemorize;
+    }
+
+    public void setSortMemorize(String sortMemorize) {
+        this.sortMemorize = sortMemorize;
+    }
+
+    public String getSortUnderstanding() {
+        return sortUnderstanding;
+    }
+
+    public void setSortUnderstanding(String sortUnderstanding) {
+        this.sortUnderstanding = sortUnderstanding;
+    }
+
+    public String getSortApply() {
+        return sortApply;
+    }
+
+    public void setSortApply(String sortApply) {
+        this.sortApply = sortApply;
+    }
+
+    public String getSortAttrType() {
+        return sortAttrType;
+    }
+
+    public void setSortAttrType(String sortAttrType) {
+        this.sortAttrType = sortAttrType;
+    }
+
+    public String getSortCreateTime() {
+        return sortCreateTime;
+    }
+
+    public void setSortCreateTime(String sortCreateTime) {
+        this.sortCreateTime = sortCreateTime;
+    }
+}

+ 161 - 0
src/main/java/com/ssj/sys/model/HowExportVO.java

@@ -0,0 +1,161 @@
+package com.ssj.sys.model;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+import groovy.transform.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className HowExportVO
+ * @description 知识点导出VO
+ * @date 2021/12/8
+ */
+@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
+@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,verticalAlignment =  VerticalAlignmentEnum.CENTER)
+@ColumnWidth(20)
+public class HowExportVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 科目	单元	单元ID	单元序号	模块	创建时间	单元版本ID	单元版本别名	学期	排序	年级	版本	创建时间
+     */
+    @ExcelProperty(value="科目",index = 0)
+    private String courseName;
+    @ExcelProperty(value="单元",index = 1)
+    private String name;
+    @ExcelProperty(value="单元ID",index = 2)
+    private String id;
+    @ExcelProperty(value="单元序号",index = 3)
+    private String num;
+    @ExcelProperty(value="模块",index = 4)
+    private String module;
+    @ExcelProperty(value="创建时间",index = 5)
+    private String createTime;
+
+    @ExcelProperty(value="单元版本ID",index = 6)
+    private String howSortId;
+    @ExcelProperty(value="单元版本别名",index = 7)
+    private String alias;
+    @ExcelProperty(value="学期",index = 8)
+    private String semester;
+    @ExcelProperty(value="排序",index = 9)
+    private String howNum;
+    @ExcelProperty(value="年级",index = 10)
+    private String gradeNum;
+    @ExcelProperty(value="版本",index = 11)
+    private String howType;
+    @ExcelProperty(value="创建时间",index = 12)
+    private String howCreateTime;
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public String getModule() {
+        return module;
+    }
+
+    public void setModule(String module) {
+        this.module = module;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+
+    public String getAlias() {
+        return alias;
+    }
+
+    public void setAlias(String alias) {
+        this.alias = alias;
+    }
+
+    public String getSemester() {
+        return semester;
+    }
+
+    public void setSemester(String semester) {
+        this.semester = semester;
+    }
+
+
+    public String getGradeNum() {
+        return gradeNum;
+    }
+
+    public void setGradeNum(String gradeNum) {
+        this.gradeNum = gradeNum;
+    }
+
+    public String getHowSortId() {
+        return howSortId;
+    }
+
+    public void setHowSortId(String howSortId) {
+        this.howSortId = howSortId;
+    }
+
+    public String getHowNum() {
+        return howNum;
+    }
+
+    public void setHowNum(String howNum) {
+        this.howNum = howNum;
+    }
+
+    public String getHowType() {
+        return howType;
+    }
+
+    public void setHowType(String howType) {
+        this.howType = howType;
+    }
+
+    public String getHowCreateTime() {
+        return howCreateTime;
+    }
+
+    public void setHowCreateTime(String howCreateTime) {
+        this.howCreateTime = howCreateTime;
+    }
+}

+ 319 - 0
src/main/java/com/ssj/sys/model/HowKdlExportVO.java

@@ -0,0 +1,319 @@
+package com.ssj.sys.model;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className HowExportVO
+ * @description 知识点导出VO
+ * @date 2021/12/8
+ */
+@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
+@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,verticalAlignment =  VerticalAlignmentEnum.CENTER)
+@ColumnWidth(20)
+public class HowKdlExportVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 科目	单元	单元ID	单元序号	添加时间
+     * 知识点	知识点ID	一级模块	教学目标	重难点标识	要点梳理	知识点排序	添加时间
+
+     */
+    @ExcelProperty(value="科目",index = 0)
+    private String courseName;
+    @ExcelProperty(value="单元",index = 1)
+    private String name;
+    @ExcelProperty(value="单元ID",index = 2)
+    private String id;
+    @ExcelProperty(value="单元序号",index = 3)
+    private String num;
+    @ExcelProperty(value="添加时间",index = 5)
+    private String createTime;
+
+    @ExcelProperty(value="知识点",index = 6)
+    private String detailName;
+    @ExcelProperty(value="知识点ID",index = 7)
+    private String detailId;
+    @ExcelProperty(value="一级模块",index = 8)
+    private String detailModule;
+    @ExcelProperty(value="教学目标",index = 9)
+    private String jxmb;
+    @ExcelProperty(value="重难点标识",index = 10)
+    private String zdbx;
+    @ExcelProperty(value="要点梳理",index = 11)
+    private String ydsl;
+    @ExcelProperty(value = "知识点排序",index=12)
+    private String detailNum;
+    @ExcelProperty(value = "添加时间",index=13)
+    private String detailCreateTime;
+    /**
+     * *     * 考点ID	考点内容	要点梳理	要点梳理图片	考点排序	标签	级别	添加时间
+     */
+    @ExcelProperty(value = "考点ID",index=14)
+    private String kdId;
+    @ExcelProperty(value = "考点内容",index=15)
+    private String kdName;
+    @ExcelProperty(value = "要点梳理",index=16)
+    private String kdYdsl;
+    @ExcelProperty(value = "要点梳理图片",index=17)
+    private String kdImg;
+    @ExcelProperty(value = "考点排序",index=18)
+    private String kdNum;
+    @ExcelProperty(value = "标签",index=19)
+    private String kdLable;
+    @ExcelProperty(value = "级别",index=20)
+    private String kdLevel;
+    @ExcelProperty(value = "添加时间",index=21)
+    private String kdCreateTime;
+
+    /**
+     * 考点版本ID	考点版本别名	学期	排序	年级	版本	添加时间
+     *
+     */
+    @ExcelProperty(value = "考点版本ID",index=22)
+    private String sortId;
+    @ExcelProperty(value = "考点版本别名",index=23)
+    private String sortName;
+    @ExcelProperty(value = "学期",index=24)
+    private String semester;
+    @ExcelProperty(value = "排序",index=25)
+    private String sortNum;
+    @ExcelProperty(value = "年级",index=26)
+    private String gradeNum;
+    @ExcelProperty(value = "版本",index=27)
+    private String sortType;
+    @ExcelProperty(value = "添加时间",index=28)
+    private String sortCreateTime;
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getDetailId() {
+        return detailId;
+    }
+
+    public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+
+    public String getDetailName() {
+        return detailName;
+    }
+
+    public void setDetailName(String detailName) {
+        this.detailName = detailName;
+    }
+
+    public String getDetailModule() {
+        return detailModule;
+    }
+
+    public void setDetailModule(String detailModule) {
+        this.detailModule = detailModule;
+    }
+
+    public String getJxmb() {
+        return jxmb;
+    }
+
+    public void setJxmb(String jxmb) {
+        this.jxmb = jxmb;
+    }
+
+    public String getZdbx() {
+        return zdbx;
+    }
+
+    public void setZdbx(String zdbx) {
+        this.zdbx = zdbx;
+    }
+
+    public String getYdsl() {
+        return ydsl;
+    }
+
+    public void setYdsl(String ydsl) {
+        this.ydsl = ydsl;
+    }
+
+    public String getDetailNum() {
+        return detailNum;
+    }
+
+    public void setDetailNum(String detailNum) {
+        this.detailNum = detailNum;
+    }
+
+    public String getDetailCreateTime() {
+        return detailCreateTime;
+    }
+
+    public void setDetailCreateTime(String detailCreateTime) {
+        this.detailCreateTime = detailCreateTime;
+    }
+
+    public String getKdId() {
+        return kdId;
+    }
+
+    public void setKdId(String kdId) {
+        this.kdId = kdId;
+    }
+
+    public String getKdName() {
+        return kdName;
+    }
+
+    public void setKdName(String kdName) {
+        this.kdName = kdName;
+    }
+
+    public String getKdYdsl() {
+        return kdYdsl;
+    }
+
+    public void setKdYdsl(String kdYdsl) {
+        this.kdYdsl = kdYdsl;
+    }
+
+    public String getKdImg() {
+        return kdImg;
+    }
+
+    public void setKdImg(String kdImg) {
+        this.kdImg = kdImg;
+    }
+
+    public String getKdNum() {
+        return kdNum;
+    }
+
+    public void setKdNum(String kdNum) {
+        this.kdNum = kdNum;
+    }
+
+    public String getKdLable() {
+        return kdLable;
+    }
+
+    public void setKdLable(String kdLable) {
+        this.kdLable = kdLable;
+    }
+
+    public String getKdLevel() {
+        return kdLevel;
+    }
+
+    public void setKdLevel(String kdLevel) {
+        this.kdLevel = kdLevel;
+    }
+
+    public String getKdCreateTime() {
+        return kdCreateTime;
+    }
+
+    public void setKdCreateTime(String kdCreateTime) {
+        this.kdCreateTime = kdCreateTime;
+    }
+
+    public String getSortId() {
+        return sortId;
+    }
+
+    public void setSortId(String sortId) {
+        this.sortId = sortId;
+    }
+
+    public String getSortName() {
+        return sortName;
+    }
+
+    public void setSortName(String sortName) {
+        this.sortName = sortName;
+    }
+
+    public String getSemester() {
+        return semester;
+    }
+
+    public void setSemester(String semester) {
+        this.semester = semester;
+    }
+
+    public String getSortNum() {
+        return sortNum;
+    }
+
+    public void setSortNum(String sortNum) {
+        this.sortNum = sortNum;
+    }
+
+    public String getGradeNum() {
+        return gradeNum;
+    }
+
+    public void setGradeNum(String gradeNum) {
+        this.gradeNum = gradeNum;
+    }
+
+    public String getSortType() {
+        return sortType;
+    }
+
+    public void setSortType(String sortType) {
+        this.sortType = sortType;
+    }
+
+    public String getSortCreateTime() {
+        return sortCreateTime;
+    }
+
+    public void setSortCreateTime(String sortCreateTime) {
+        this.sortCreateTime = sortCreateTime;
+    }
+}

+ 39 - 0
src/main/java/com/ssj/sys/model/RowRangeDto.java

@@ -0,0 +1,39 @@
+package com.ssj.sys.model;
+
+import groovy.transform.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className RowRangeDto
+ * @description rangeDto
+ * @date 2021/12/21
+ */
+public class RowRangeDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+        private int start;
+        private int end;
+
+    public  RowRangeDto(int start,int end){
+        this.start = start;
+        this.end = end;
+    }
+
+    public int getStart() {
+        return start;
+    }
+
+    public void setStart(int start) {
+        this.start = start;
+    }
+
+    public int getEnd() {
+        return end;
+    }
+
+    public void setEnd(int end) {
+        this.end = end;
+    }
+}

+ 48 - 0
src/main/java/com/ssj/sys/utils/BizMergeStrategy.java

@@ -0,0 +1,48 @@
+package com.ssj.sys.utils;
+
+import com.alibaba.excel.metadata.Head;
+import com.alibaba.excel.write.merge.AbstractMergeStrategy;
+import com.ssj.sys.model.RowRangeDto;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.util.CellRangeAddress;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sh
+ * @className BizMergeStrategy
+ * @description BizMergeStrategy
+ * @date 2021/12/21
+ */
+public class BizMergeStrategy extends AbstractMergeStrategy {
+
+    private Map<String, List<RowRangeDto>> strategyMap;
+    private Sheet sheet;
+
+    public BizMergeStrategy(Map<String, List<RowRangeDto>> strategyMap) {
+        this.strategyMap = strategyMap;
+    }
+
+    @Override
+    protected void merge(org.apache.poi.ss.usermodel.Sheet sheet, Cell cell, Head head, Integer integer) {
+        this.sheet = sheet;
+        if (cell.getRowIndex() == 1 && cell.getColumnIndex() == 0) {
+            /**
+             * 保证每个cell被合并一次,如果不加上面的判断,因为是一个cell一个cell操作的,
+             * 例如合并A2:A3,当cell为A2时,合并A2,A3,但是当cell为A3时,又是合并A2,A3,
+             * 但此时A2,A3已经是合并的单元格了
+             */
+            for (Map.Entry<String, List<RowRangeDto>> entry : strategyMap.entrySet()) {
+                Integer columnIndex = Integer.valueOf(entry.getKey());
+                entry.getValue().forEach(rowRange -> {
+                    //添加一个合并请求
+                    sheet.addMergedRegionUnsafe(new CellRangeAddress(rowRange.getStart(),
+                            rowRange.getEnd(), columnIndex, columnIndex));
+                });
+            }
+        }
+    }
+}
+

+ 182 - 0
src/main/java/com/ssj/sys/utils/ExcelMergeUtil.java

@@ -0,0 +1,182 @@
+package com.ssj.sys.utils;
+
+import com.ssj.sys.model.HowDetailExportVO;
+import com.ssj.sys.model.HowExportVO;
+import com.ssj.sys.model.HowKdlExportVO;
+import com.ssj.sys.model.RowRangeDto;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sh
+ * @className ExcelMergeUtil
+ * @description TODO
+ * @date 2021/12/21
+ */
+public class ExcelMergeUtil {
+
+        /**
+         * @Author: TheBigBlue
+         * @Description: 添加合并策略
+         * @Date: 2020/3/16
+         * @Param:
+         * @return:
+         **/
+        public static Map<String, List<RowRangeDto>> addMerStrategy(List<HowExportVO> excelDtoList) {
+            Map<String, List<RowRangeDto>> strategyMap = new HashMap<>();
+            HowExportVO preExcelDto = null;
+            for (int i = 0; i < excelDtoList.size(); i++) {
+                HowExportVO currDto = excelDtoList.get(i);
+                if (preExcelDto != null) {
+                    //从第二行开始判断是否需要合并
+                    if (currDto.getId().equals(preExcelDto.getId())) {
+                        //如果坐席人员一样,则可合并坐席人员一列
+                        fillStrategyMap(strategyMap, "0", i);
+                        fillStrategyMap(strategyMap, "1", i);
+                        fillStrategyMap(strategyMap, "2", i);
+                        fillStrategyMap(strategyMap, "3", i);
+                        fillStrategyMap(strategyMap, "4", i);
+                        fillStrategyMap(strategyMap, "5", i);
+                    }
+                }
+                preExcelDto = currDto;
+            }
+            return strategyMap;
+        }
+        /**
+         * @Author: TheBigBlue
+         * @Description: 添加合并策略
+         * @Date: 2020/3/16
+         * @Param:
+         * @return:
+         **/
+        public static Map<String, List<RowRangeDto>> addDetailMerStrategy(List<HowDetailExportVO> excelDtoList) {
+            Map<String, List<RowRangeDto>> strategyMap = new HashMap<>();
+            HowDetailExportVO preExcelDto = null;
+            for (int i = 0; i < excelDtoList.size(); i++) {
+                HowDetailExportVO currDto = excelDtoList.get(i);
+                if (preExcelDto != null) {
+                    //从第二行开始判断是否需要合并
+                    if (currDto.getId().equals(preExcelDto.getId())) {
+                        //如果坐席人员一样,则可合并坐席人员一列
+                        fillStrategyMap(strategyMap, "0", i);
+                        fillStrategyMap(strategyMap, "1", i);
+                        fillStrategyMap(strategyMap, "2", i);
+                        fillStrategyMap(strategyMap, "3", i);
+                        fillStrategyMap(strategyMap, "4", i);
+                        fillStrategyMap(strategyMap, "5", i);
+                    }
+                    if(currDto.getDetailId().equals(preExcelDto.getDetailId())){
+                        fillStrategyMap(strategyMap,"6",i);
+                        fillStrategyMap(strategyMap,"7",i);
+                        fillStrategyMap(strategyMap,"8",i);
+                        fillStrategyMap(strategyMap,"9",i);
+                        fillStrategyMap(strategyMap,"10",i);
+                        fillStrategyMap(strategyMap,"11",i);
+                        fillStrategyMap(strategyMap,"12",i);
+                        fillStrategyMap(strategyMap,"13",i);
+                        fillStrategyMap(strategyMap,"14",i);
+                        fillStrategyMap(strategyMap,"15",i);
+                        fillStrategyMap(strategyMap,"16",i);
+                        fillStrategyMap(strategyMap,"17",i);
+                        fillStrategyMap(strategyMap,"18",i);
+                        fillStrategyMap(strategyMap,"19",i);
+                        fillStrategyMap(strategyMap,"20",i);
+                        fillStrategyMap(strategyMap,"21",i);
+                        fillStrategyMap(strategyMap,"22",i);
+                        fillStrategyMap(strategyMap,"23",i);
+                        fillStrategyMap(strategyMap,"24",i);
+                    }
+                }
+                preExcelDto = currDto;
+            }
+            return strategyMap;
+        }
+        /**
+         * @Author: TheBigBlue
+         * @Description: 添加合并策略
+         * @Date: 2020/3/16
+         * @Param:
+         * @return:
+         **/
+        public static Map<String, List<RowRangeDto>> addKdMerStrategy(List<HowKdlExportVO> excelDtoList) {
+            Map<String, List<RowRangeDto>> strategyMap = new HashMap<>();
+            HowKdlExportVO preExcelDto = null;
+            for (int i = 0; i < excelDtoList.size(); i++) {
+                HowKdlExportVO currDto = excelDtoList.get(i);
+                if (preExcelDto != null) {
+                    //从第二行开始判断是否需要合并
+                    if (currDto.getDetailId().equals(preExcelDto.getDetailId())) {
+                        //如果坐席人员一样,则可合并坐席人员一列
+                        fillStrategyMap(strategyMap, "0", i);
+                        fillStrategyMap(strategyMap, "1", i);
+                        fillStrategyMap(strategyMap, "2", i);
+                        fillStrategyMap(strategyMap, "3", i);
+                        fillStrategyMap(strategyMap, "4", i);
+                        fillStrategyMap(strategyMap, "5", i);
+                    }
+                    if(currDto.getKdId().equals(preExcelDto.getKdId())){
+                        fillStrategyMap(strategyMap,"6",i);
+                        fillStrategyMap(strategyMap,"7",i);
+                        fillStrategyMap(strategyMap,"8",i);
+                        fillStrategyMap(strategyMap,"9",i);
+                        fillStrategyMap(strategyMap,"10",i);
+                        fillStrategyMap(strategyMap,"11",i);
+                        fillStrategyMap(strategyMap,"12",i);
+                        fillStrategyMap(strategyMap,"13",i);
+                    }
+                    if(currDto.getKdId().equals(preExcelDto.getKdId())){
+                        fillStrategyMap(strategyMap,"6",i);
+                        fillStrategyMap(strategyMap,"7",i);
+                        fillStrategyMap(strategyMap,"8",i);
+                        fillStrategyMap(strategyMap,"9",i);
+                        fillStrategyMap(strategyMap,"10",i);
+                        fillStrategyMap(strategyMap,"11",i);
+                        fillStrategyMap(strategyMap,"12",i);
+                        fillStrategyMap(strategyMap,"13",i);
+                        fillStrategyMap(strategyMap,"14",i);
+                        fillStrategyMap(strategyMap,"15",i);
+                        fillStrategyMap(strategyMap,"16",i);
+                        fillStrategyMap(strategyMap,"17",i);
+                        fillStrategyMap(strategyMap,"18",i);
+                        fillStrategyMap(strategyMap,"19",i);
+                        fillStrategyMap(strategyMap,"20",i);
+                        fillStrategyMap(strategyMap,"21",i);
+                        fillStrategyMap(strategyMap,"22",i);
+                        fillStrategyMap(strategyMap,"23",i);
+                        fillStrategyMap(strategyMap,"24",i);
+                    }
+                }
+                preExcelDto = currDto;
+            }
+            return strategyMap;
+        }
+
+        /**
+         * @Author: TheBigBlue
+         * @Description: 新增或修改合并策略map
+         * @Date: 2020/3/16
+         * @Param:
+         * @return:
+         **/
+        private static void fillStrategyMap(Map<String, List<RowRangeDto>> strategyMap, String key, int index) {
+            List<RowRangeDto> rowRangeDtoList = strategyMap.get(key) == null ? new ArrayList<>() : strategyMap.get(key);
+            boolean flag = false;
+            for (RowRangeDto dto : rowRangeDtoList) {
+                //分段list中是否有end索引是上一行索引的,如果有,则索引+1
+                if (dto.getEnd() == index) {
+                    dto.setEnd(index + 1);
+                    flag = true;
+                }
+            }
+            //如果没有,则新增分段
+            if (!flag) {
+                rowRangeDtoList.add(new RowRangeDto(index, index + 1));
+            }
+            strategyMap.put(key, rowRangeDtoList);
+        }
+
+    }

+ 2 - 0
src/main/resources/templates/sys/appinfo/appinfoAdd.html

@@ -82,6 +82,8 @@
 						<option  value="13" th:selected="${entity.type==13}" >小蚁学堂(Android)</option>
 						<option  value="14" th:selected="${entity.type==14}" >小蚁学堂(iOS)</option>
 						<option  value="15" th:selected="${entity.type==15}" >小塾分组版(深圳)</option>
+						<option  value="16" th:selected="${entity.type==16}" >小塾教师HD</option>
+						<option  value="17" th:selected="${entity.type==17}" >小点斗HD</option>
 					</select>
 				</div>
 			</li>

+ 2 - 0
src/main/resources/templates/sys/appinfo/appinfoList.html

@@ -71,6 +71,8 @@
 				<span th:case="13">小蚁学堂(Android)</span>
 				<span th:case="14">小蚁学堂(iOS)</span>
 				<span th:case="15">小塾分组版(深圳)</span>
+				<span th:case="16">小塾教师HD</span>
+				<span th:case="17">小点斗HD</span>
 			</td>
 			<td>
 				<textarea readonly="readonly" rows="1">[[${item.updateContent}]]</textarea>

+ 5 - 4
src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionAdd.html

@@ -87,9 +87,10 @@
             </li>
             <li class="clearfix">
                 <input type="hidden" name="realQuestionPath" id="realQuestionPath" th:value="${entity.realQuestionPath}"/>
-                <label class="upload-file">真题上传:</label>
-                <input type="file" id="upfile">
+                <label>真题上传:</label>
             </li>
+            <div id="upfile" class="easy-upload">
+            </div>
             <li>
                 <label>&nbsp;</label>
                 <button type="submit" class="btn">保存</button>
@@ -100,7 +101,7 @@
     <div id="dispaly-progress"></div>
 </div>
 </body>
-<script th:include="sys/common/fileUpload" th:remove="tag"></script>
+<script th:include="sys/common/fileUpload2" th:remove="tag"></script>
 <script type="text/javascript">
 
     $(function(){
@@ -153,9 +154,9 @@
 
         });
     }
-    var options = uploadOptions("upfile","真题上传");
 
     $(function(){
+        initEasyUpload("realQuestionPath","upfile","[[${sysUrl}]]/sys/termtrainQuestion/upload/",".PDF",200,1);
         options.fileTypeExts = "*.PDF";
         options.fileSizeLimit= '200MB';
         options.uploader= "[[${sysUrl}]]/sys/termtrainQuestion/upload";

+ 0 - 2
src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionList.html

@@ -42,7 +42,6 @@
     <table class="tablelist">
         <thead>
         <tr>
-            <th>真题类型</th>
             <th>科目</th>
             <th>年级</th>
             <th>版本</th>
@@ -57,7 +56,6 @@
         </thead>
         <tbody>
         <tr th:each="item:${list}" >
-            <td th:text="${item.type}" ></td>
             <td th:text="${item.courseName}" ></td>
             <td th:text="${item.grade}" ></td>
             <td th:text="${item.bookName}" ></td>

+ 66 - 12
src/main/resources/templates/sys/zuoyb/knowHowList.html

@@ -28,6 +28,7 @@
 <div class="rightinfo">
 	<form id="seachform" th:action="@{/sys/zuoyb/knowHowList.html}" method="post">
 	<input type="hidden" name="EQ_libId" th:value="${search.get('EQ_libId')}">
+	<input type="hidden" name="txtendflag" id="txtendflag">
 	<ul class="seachform">
 		<li>
 		<label>课程</label>
@@ -285,22 +286,75 @@ function updateById(id){
 
 
 $("#button").on('click',function(){
-	
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowExcel";
-	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
+	//
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowExcel";
+	// $("#seachform").submit();
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
+	startexport("[[${sysUrl}]]/sys/zuoyb/exportHowExcel")
 });
+var msg ;
+function startexport(url){
+	 msg = layer.msg('下载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '0px',time: 0});
+	// msg.show();
+	var seachform = document.querySelector("#seachform").innerHTML;
+	var form =$("<form></form>");
+	$(document.body).append(form);
+	form.attr("style","display:none");
+	form.attr("method","POST");
+	form.attr("target","");
+	form.attr("action",url);
+	form.append(seachform);
+	console.log(form)
+	form.submit();
+	form.remove();
+	// var formdata = new FormData(seachform);
+	// formdata.attr("method","POST");
+	// formdata.attr("action",url);
+	// formdata.submit();
+	// var request = new XMLHttpRequest();
+	// request.open("POST", url);
+	// request.send(formdata);
+	listenEnd();
+}
+
+
+function listenEnd() {//定时监听
+	var loop = setInterval(function() {
+		if ($("#txtendflag").val() == "1") {
+			clearInterval(loop);//停止定时任务
+			layer.close(msg);
+		} else {
+			getEndFlag();
+		}
+	}, 1000);//单位毫秒  注意:如果导出页面很慢时,建议循环时间段稍长一点
+}
+
+function getEndFlag() {
+	//请求session标记位
+	$.ajax({
+		type : 'post',
+		url : '[[${sysUrl}]]/sys/zuoyb/getEndFlag',
+		dataType : 'json',
+		success : function(data) {
+			$("#txtendflag").val(data.data.flag);
+		},
+		error : function(error) {
+			console.log('接口不通' + error);
+		}
+	})
+}
+
 $("#buttondetails").on('click',function(){
-	
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowDetailsExcel";
-	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
+	startexport("[[${sysUrl}]]/sys/zuoyb/exportHowDetailsExcel")
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowDetailsExcel";
+	// $("#seachform").submit();
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
 });
 $("#buttonkd").on('click',function(){
-	
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowDetailsKdExcel";
-	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
+	startexport("[[${sysUrl}]]/sys/zuoyb/exportHowDetailsKdExcel")
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/exportHowDetailsKdExcel";
+	// $("#seachform").submit();
+	// document.getElementById("seachform").action = "[[${sysUrl}]]/sys/zuoyb/knowHowList.html";
 });
 
 </script>