From a0089d2b047c67708274a546aa478d8014667e25 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 25 Feb 2022 19:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=BA=93--=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OnlCgformCollectionController.java | 1 + .../BussDocumentLibraryEOServiceImpl.java | 159 ++++++++++++------ 2 files changed, 105 insertions(+), 55 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java index a646eb742..32821a5f0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java @@ -1,5 +1,6 @@ package com.jero.modules.collection.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 730e69a13..be5f23925 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -32,11 +32,15 @@ import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFRichTextString; +import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -1126,11 +1130,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl map,HttpServletResponse response, HttpServletRequest request) { OutputStream os = null; - OutputStream excelOS = null; HSSFWorkbook workbook = new HSSFWorkbook(); String fileOriName = "导入模板"; String filePath = uploadpath + "/" + fileOriName; try{ + List list = getWorkbookTitle((String) map.get("cut")); //创建临时文件夹 File nowFile = new File(filePath); if (nowFile.exists()){ @@ -1138,46 +1142,48 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl getWorkbookTitle(String cut){ List> addForm = getAddForm(ModuleEnum.DOCUMENT_LIBRARY.getValue(), cut); StringBuilder sb = new StringBuilder(); - List multipleList = new LinkedList<>(); - List singleList = new LinkedList<>(); - List fileList = new LinkedList<>(); + List pullMoreList = new LinkedList<>();//多选字段 + List pullSingleList = new LinkedList<>();//单选字段 + List fileList = new LinkedList<>();//文件字段 + List textNumberList = new LinkedList<>();//数字输入框字段 + List textStringList = new LinkedList<>();//字符串输入框字段 + List dateSingleList = new LinkedList<>();//单选日期字段 + List dateMoreList = new LinkedList<>();//多选日期字段 + List standardList = new LinkedList<>();//标准选择字段 for (Map map : addForm) { if("0".equals(map.get("field_must_input"))){ sb.append("*" + map.get("db_field_txt")+","); }else{ sb.append(map.get("db_field_txt")+","); } + String fieldShowType = "field_show_type"; //多选字段 -// if(FieldTypeEnum.PULL_MORE.getValue().equals(map.get("field_show_type"))){ -// multipleList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.PULL_SINGLE.getValue().equals(map.get("field_show_type"))){ -// //单选字段 -// singleList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.FILE.getValue().equals(map.get("field_show_type"))){ -// //文件字段 -// fileList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.0000.getValue().equals(map.get("field_show_type"))){ -// //数字输入框字段 -// fileList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.0000.getValue().equals(map.get("field_show_type"))){ -// //汉字输入框字段 -// fileList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.0000.getValue().equals(map.get("field_show_type"))){ -// //单选日期字段 -// fileList.add((String) map.get("db_field_txt")); -// }else if(FieldTypeEnum.000.getValue().equals(map.get("field_show_type"))){ -// //多选日期字段 -// fileList.add((String) map.get("db_field_txt")); -// } + if(FieldTypeEnum.PULL_MORE.getValue().equals(map.get(fieldShowType))){ + pullMoreList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.PULL_SINGLE.getValue().equals(map.get(fieldShowType))){ + //单选字段 + pullSingleList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.FILE.getValue().equals(map.get(fieldShowType))){ + //文件字段 + fileList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.TEXT_NUMBER.getValue().equals(map.get(fieldShowType))){ + //数字输入框字段 + textNumberList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.TEXT_STRING.getValue().equals(map.get(fieldShowType))){ + //字符串输入框字段 + textStringList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.DATE_SINGLE.getValue().equals(map.get(fieldShowType))){ + //单选日期字段 + dateSingleList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.DATE_MORE.getValue().equals(map.get(fieldShowType))){ + //多选日期字段 + dateMoreList.add((String) map.get("db_field_txt")); + }else if(FieldTypeEnum.STANDARD.getValue().equals(map.get(fieldShowType))){ + //标准选择字段 + standardList.add((String) map.get("db_field_txt")); + } } String title = sb.substring(0, sb.length() - 1); //第二行 StringBuilder sbTwo = new StringBuilder(); - sbTwo.append("填写说明\n"+"1.所有带*号的字段必须填写"); + sbTwo.append("填写说明\n"+"1.所有带*号的字段必须填写\n"); + int count = 2; + if(pullSingleList.size() != 0){ + //单选 + String pullSingle = StringUtils.join(pullSingleList,",")+"字段是单选属性,必须和系统中的对应字段选项相匹配\n"; + sbTwo.append(count ++ +"."+pullSingle); + } - return null; + if(pullMoreList.size() != 0){ + //多选 + String pullMore = StringUtils.join(pullMoreList,",")+"字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n"; + sbTwo.append(count ++ +"."+pullMore); + } + if(dateSingleList.size() != 0){ + //单选日期 + String dateSingle = StringUtils.join(dateSingleList,",")+"字段为日期,必须精确到日\n"; + sbTwo.append(count ++ +"."+dateSingle); + } + if(textStringList.size() != 0){ + //输入框 + String textString = StringUtils.join(textStringList,",")+"字段为文本,填写文本内容\n"; + sbTwo.append(count ++ +"."+textString); + } + if(standardList.size() != 0){ + //标准选择 + String standard = StringUtils.join(standardList,",")+"字段为标准号,填写多个时采用英文或中文逗号分割\n"; + sbTwo.append(count ++ +"."+standard); + } + if(fileList.size() != 0){ + //文件 + String file = StringUtils.join(fileList,",")+"字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n"; + sbTwo.append(count ++ +"."+file); + } + List list = new LinkedList<>(); + list.add(title); + list.add(sbTwo.toString()); + list.add(count+""); + return list; }