diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/entity/SarFileSplitItemsVal.java b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/entity/SarFileSplitItemsVal.java index 849c9bc5..5d37916b 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/entity/SarFileSplitItemsVal.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/entity/SarFileSplitItemsVal.java @@ -40,11 +40,6 @@ public class SarFileSplitItemsVal implements Serializable { */ @ApiModelProperty("条目内容") private String itemContent; - /** - * 译文 - */ - @ApiModelProperty("译文") - private String translation; /** * 排序 */ diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/mapper/xml/DocumentSplitMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/mapper/xml/DocumentSplitMapper.xml index 41223719..015e7106 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/mapper/xml/DocumentSplitMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/mapper/xml/DocumentSplitMapper.xml @@ -40,10 +40,10 @@ - insert into sar_file_split_items_val(id, sys_org_code, item_id, type, item_content, translation, display_seq, valid_flag, img_name, index_item, creation_time, modify_user, modify_time, creation_user) + insert into sar_file_split_items_val(id, sys_org_code, item_id, type, item_content, display_seq, valid_flag, img_name, index_item, creation_time, modify_user, modify_time, creation_user) values - (#{entity.id}, #{entity.sysOrgCode}, #{entity.itemId}, #{entity.type}, #{entity.itemContent}, #{entity.translation}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.imgName}, #{entity.indexItem}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime}, #{entity.creationUser}) + (#{entity.id}, #{entity.sysOrgCode}, #{entity.itemId}, #{entity.type}, #{entity.itemContent}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.imgName}, #{entity.indexItem}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime}, #{entity.creationUser}) @@ -139,7 +139,7 @@ - select id, sys_org_code, item_id, type, item_content, translation, display_seq, valid_flag, + select id, sys_org_code, item_id, type, item_content, display_seq, valid_flag, img_name, index_item, creation_time, modify_user, modify_time, creation_user from sar_file_split_items_val where valid_flag = 0 and item_id = #{itemId} diff --git a/laws-modules/src/main/java/com/jero/modules/split/entity/SarFileSplitItemsValEO.java b/laws-modules/src/main/java/com/jero/modules/split/entity/SarFileSplitItemsValEO.java index 5a22bb90..fc0ef843 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/entity/SarFileSplitItemsValEO.java +++ b/laws-modules/src/main/java/com/jero/modules/split/entity/SarFileSplitItemsValEO.java @@ -39,11 +39,6 @@ public class SarFileSplitItemsValEO implements Serializable { */ @ApiModelProperty("条文内容") private String itemContent; - /** - * 译文 - */ - @ApiModelProperty("译文") - private String translation; /** * 有效标识 */ diff --git a/laws-modules/src/main/java/com/jero/modules/split/mapper/xml/SarFileSplitItemsValEOMapper.xml b/laws-modules/src/main/java/com/jero/modules/split/mapper/xml/SarFileSplitItemsValEOMapper.xml index 940722c8..a4fec6fc 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/mapper/xml/SarFileSplitItemsValEOMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/split/mapper/xml/SarFileSplitItemsValEOMapper.xml @@ -7,7 +7,6 @@ - @@ -20,7 +19,7 @@ - id, type, item_id, item_content, translation, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq,img_name,index_item + id, type, item_id, item_content, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq,img_name,index_item @@ -78,7 +77,7 @@ SELECT SEQ_SAR_FILE_SPLIT_ITEMS_VAL.NEXTVAL FROM DUAL --> insert into SAR_FILE_SPLIT_ITEMS_VAL() - values (#{id, jdbcType=VARCHAR}, #{type, jdbcType=VARCHAR}, #{itemId, jdbcType=VARCHAR}, #{itemContent, jdbcType=CLOB}, #{translation, jdbcType=CLOB}, #{validFlag, jdbcType=INTEGER}, #{creationUser, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{displaySeq, jdbcType=INTEGER}) + values (#{id, jdbcType=VARCHAR}, #{type, jdbcType=VARCHAR}, #{itemId, jdbcType=VARCHAR}, #{itemContent, jdbcType=CLOB}, #{validFlag, jdbcType=INTEGER}, #{creationUser, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{displaySeq, jdbcType=INTEGER}) @@ -92,7 +91,6 @@ type, item_id, item_content, - translation, valid_flag, creation_user, creation_time, @@ -107,7 +105,6 @@ #{type, jdbcType=VARCHAR}, #{itemId, jdbcType=VARCHAR}, #{itemContent, jdbcType=CLOB}, - #{translation}, #{validFlag, jdbcType=INTEGER}, #{creationUser, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, @@ -125,7 +122,6 @@ set type = #{type}, item_id = #{itemId}, item_content = #{itemContent}, - translation = #{translation}, valid_flag = #{validFlag}, creation_user = #{creationUser}, creation_time = #{creationTime}, @@ -148,9 +144,6 @@ item_content = #{itemContent}, - - translation = #{translation}, - valid_flag = #{validFlag}, @@ -233,7 +226,7 @@ insert into SAR_FILE_SPLIT_ITEMS_VAL - (id, type, item_id, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq, img_name, item_content, translation, index_item) + (id, type, item_id, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq, img_name, item_content, index_item) values ( #{item.id, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR}, @@ -243,7 +236,6 @@ #{item.modifyUser, jdbcType=VARCHAR}, #{item.displaySeq, jdbcType=INTEGER}, #{item.imgName, jdbcType=INTEGER}, #{item.itemContent, jdbcType=CLOB}, - #{item.translation}, #{item.indexItem, jdbcType=INTEGER}) @@ -324,7 +316,6 @@ item_id, type, item_content, - translation, display_seq, valid_flag, img_name, diff --git a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java index e192a147..b92a2f4c 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java @@ -1436,9 +1436,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl addItemValList = new ArrayList<>(); if (addItemsEOList != null && !addItemsEOList.isEmpty()) { Map oldItems = addItemsEOList.get(addItemsEOList.size()-1); @@ -1450,6 +1447,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl) oldItems.get("itemValEOList"); String itemContent = oldItems.get("item_content").toString() + importDto.get("item_content").toString(); oldItems.put("item_content", itemContent); + String[] valArr = importDto.get("item_content").toString().split("\n"); if (valArr != null && valArr.length > 0) { for (int i=0;i nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]); if (nowfilelist != null && !nowfilelist.isEmpty()) { String url = nowfilelist.get(0).getPath(); MultipartFile multipartFile = createMfileByPath(url); + String state = "0"; +// String fileSuffix = url.substring(url.lastIndexOf(".")); +// String fileTypeStr = ".doc,.DOC,.docx,.DOCX,.xls, .XLS,.xlsx,.XLSX,.pdf,.PDF"; +// if (fileTypeStr.contains(fileSuffix)) { +// state = "1"; +// } +// OSSFile oSSFile = ossFileService.uploadLocalForSplit(multipartFile, "",state,null); +// if(oSSFile!=null){ +// oSSFile = ossFileService.getById(oSSFile.getId()); isText = false; + +//// BASE64Encoder base64Encoder = new BASE64Encoder(); +//// String encode = base64Encoder.encode(oSSFile.getUrl().getBytes(StandardCharsets.UTF_8)); +// String path = oSSFile.getUrl(); +//// String path = imgpath + oSSFile.getUrl().substring(oSSFile.getUrl().lastIndexOf(File.separator)+1); +//// String imgCon = ""; +// valEO.setType("IMG"); +//// valEO.setItemContent(imgCon); +// valEO.setItemContent(path); +// +// String imageName = UUIDUtils.randomUUID10() + multipartFile.getName(); +// String filepathandname = uploadCospath + "/" + imageName; try { +// String paths = splitUrl+imageName; +// MinioUtil.uploadByte(bytev, filepathandname); String upload = ObsBootUtil.upload(multipartFile, "temp"); OSSFile ossFile = new OSSFile(); ossFile.setId(String.valueOf(SnowflakeUtils.snowflake())); @@ -1484,20 +1498,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl translationfilelist = FileUnZip.readFileByFilename(filepath, translationArr[i]); - if (CollectionUtil.isNotEmpty(translationfilelist)) { - String urlTranslation = translationfilelist.get(0).getPath(); - MultipartFile multipartFileTranslation = createMfileByPath(urlTranslation); - String uploadTranslation = ObsBootUtil.upload(multipartFileTranslation, "temp"); - OSSFile ossFileTranslation = new OSSFile(); - ossFileTranslation.setId(String.valueOf(SnowflakeUtils.snowflake())); - ossFileTranslation.setFileName(multipartFileTranslation.getName()); - ossFileTranslation.setUrl(uploadTranslation); - ossFileService.save(ossFileTranslation); - valEO.setTranslation(splitUrl+uploadTranslation.replace("temp\\", "")); - } - } } catch (Exception e) { e.printStackTrace(); } @@ -1506,9 +1506,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl 0) { for (int i = 0; i < valArr.length; i++) { SarFileSplitItemsValEO valEO = new SarFileSplitItemsValEO(); @@ -1528,20 +1526,36 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]); if (nowfilelist != null && !nowfilelist.isEmpty()) { String url = nowfilelist.get(0).getPath(); MultipartFile multipartFile = createMfileByPath(url); + String state = "0"; +// String fileSuffix = url.substring(url.lastIndexOf(".")); +// String fileTypeStr = ".doc,.DOC,.docx,.DOCX,.xls, .XLS,.xlsx,.XLSX,.pdf,.PDF"; +// if (fileTypeStr.contains(fileSuffix)) { +// state = "1"; +// } +// OSSFile oSSFile = ossFileService.uploadLocalOfCos(multipartFile, "", state,null); +// OSSFile oSSFile = ossFileService.uploadLocalForSplit(multipartFile, "",state,null); +// oSSFile = ossFileService.getById(oSSFile.getId()); +// if (oSSFile != null) { +// oSSFile = ossFileService.getById(oSSFile.getId()); isText = false; + +//// BASE64Encoder base64Encoder = new BASE64Encoder(); +//// String encode = base64Encoder.encode(oSSFile.getUrl().getBytes(StandardCharsets.UTF_8)); +// String path = oSSFile.getUrl(); +//// String path = imgpath + oSSFile.getUrl().substring(oSSFile.getUrl().lastIndexOf(File.separator)+1); +//// String imgCon = ""; +// valEO.setType("IMG"); +//// valEO.setItemContent(imgCon); +// valEO.setItemContent(path); +// } try { +// String paths = splitUrl+imageName; +// MinioUtil.uploadByte(bytev, filepathandname); String upload = ObsBootUtil.upload(multipartFile, "temp"); OSSFile ossFile = new OSSFile(); ossFile.setId(String.valueOf(SnowflakeUtils.snowflake())); @@ -1550,20 +1564,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl translationfilelist = FileUnZip.readFileByFilename(filepath, translationArr[i]); - if (CollectionUtil.isNotEmpty(translationfilelist)) { - String urlTranslation = translationfilelist.get(0).getPath(); - MultipartFile multipartFileTranslation = createMfileByPath(urlTranslation); - String uploadTranslation = ObsBootUtil.upload(multipartFileTranslation, "temp"); - OSSFile ossFileTranslation = new OSSFile(); - ossFileTranslation.setId(String.valueOf(SnowflakeUtils.snowflake())); - ossFileTranslation.setFileName(multipartFileTranslation.getName()); - ossFileTranslation.setUrl(uploadTranslation); - ossFileService.save(ossFileTranslation); - valEO.setTranslation(splitUrl+uploadTranslation.replace("temp\\", "")); - } - } } catch (Exception e) { e.printStackTrace(); } @@ -1571,9 +1571,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl 0) { for (int i = 0; i < valArr.length; i++) { SarFileSplitItemsValEO valEO = new SarFileSplitItemsValEO(); @@ -1596,20 +1594,30 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]); if (nowfilelist != null && !nowfilelist.isEmpty()) { String url = nowfilelist.get(0).getPath(); MultipartFile multipartFile = createMfileByPath(url); + String state = "0"; +// OSSFile oSSFile = ossFileService.uploadLocalOfCos(multipartFile, "", state,null); +// OSSFile oSSFile = ossFileService.uploadLocalForSplit(multipartFile, "",state,null); +//// oSSFile = ossFileService.getById(oSSFile.getId()); +// if (oSSFile != null) { isText = false; + +//// BASE64Encoder base64Encoder = new BASE64Encoder(); +//// String encode = base64Encoder.encode(oSSFile.getUrl().getBytes(StandardCharsets.UTF_8)); +// String path = oSSFile.getUrl(); +//// String path = imgpath + oSSFile.getUrl().substring(oSSFile.getUrl().lastIndexOf(File.separator)+1); +//// String imgCon = ""; +// valEO.setType("IMG"); +//// valEO.setItemContent(imgCon); +// valEO.setItemContent(path); +// } try { +// String paths = splitUrl+imageName; +// MinioUtil.uploadByte(bytev, filepathandname); String upload = ObsBootUtil.upload(multipartFile, "temp"); OSSFile ossFile = new OSSFile(); ossFile.setId(String.valueOf(SnowflakeUtils.snowflake())); @@ -1618,20 +1626,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl translationfilelist = FileUnZip.readFileByFilename(filepath, translationArr[i]); - if (CollectionUtil.isNotEmpty(translationfilelist)) { - String urlTranslation = translationfilelist.get(0).getPath(); - MultipartFile multipartFileTranslation = createMfileByPath(urlTranslation); - String uploadTranslation = ObsBootUtil.upload(multipartFileTranslation, "temp"); - OSSFile ossFileTranslation = new OSSFile(); - ossFileTranslation.setId(String.valueOf(SnowflakeUtils.snowflake())); - ossFileTranslation.setFileName(multipartFileTranslation.getName()); - ossFileTranslation.setUrl(uploadTranslation); - ossFileService.save(ossFileTranslation); - valEO.setTranslation(splitUrl+uploadTranslation.replace("temp\\", "")); - } - } } catch (Exception e) { e.printStackTrace(); } @@ -1639,9 +1633,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl itemNumList = new ArrayList<>(); + for(SarFileSplitItemsEO sarFileSplitItemsEO : addItemsEOList){ + String[] str = sarFileSplitItemsEO.getItemsNum().split("."); + if(str.length == finalLevelNum){ + itemNumList.add(sarFileSplitItemsEO); + } + }*/ + // 2022-03-31 注释 +// List itemNumList = addItemsEOList.stream() +// .filter(e->e.getItemsNum().split("\\.").length == finalLevelNum || e.getItemsNum().contains("附录")) +// .collect(Collectors.toList()); //构造目录树 HashMap menuAndItemMap = new HashMap<>(); +// if(CollectionUtils.isNotEmpty(itemNumList)) { List> itemsEOList = new ArrayList<>(addItemsEOList); List treeList = buildTree(itemsEOList, treeListDisplay, menuId); @@ -1678,6 +1699,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl itemsEO : addItemsEOList) { if(menuAndItemMap.get(itemsEO.get("id")) != null) { @@ -2926,34 +2950,20 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl getValList = (List) sarFileSplitItemsEO.get("itemValEOList"); String itemConditions = ""; - String itemConditionsTranslation = ""; int ind = 1; if (getValList != null && !getValList.isEmpty()) { for (SarFileSplitItemsValEO valEO : getValList) { - String type = valEO.getType(); - String itemContent = valEO.getItemContent(); - String translation = valEO.getTranslation(); // 当前段内容 String valContent = ""; - String valContentTranslation = ""; - if ("TEXT".equals(type)) { - valContent += "

" + itemContent + "

"; - if (StringUtils.isNotBlank(translation)){ - valContentTranslation += "

" + translation + "

"; - } - } else if ("IMG".equals(type)) { - valContent += ""; - if (StringUtils.isNotBlank(translation)){ - valContentTranslation += ""; - } - } else if ("TABLE".equals(type)) { - valContent += itemContent; - if (StringUtils.isNotBlank(translation)){ - valContentTranslation += translation; - } + if ("TEXT".equals(valEO.getType())) { + valContent += "

" + valEO.getItemContent() + "

"; + } else if ("IMG".equals(valEO.getType())) { + valContent += ""; +// valContent += valEO.getItemContent(); + } else if ("TABLE".equals(valEO.getType())) { + valContent += valEO.getItemContent(); } itemConditions += valContent; - itemConditionsTranslation += valContentTranslation; // val表信息 valEO.setId(UUIDUtils.randomUUID20()); // valEO.setItemId(itemsId); @@ -2968,7 +2978,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl