diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/controller/DocumentSplitController.java b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/controller/DocumentSplitController.java
index e4622e9d..32c7701a 100644
--- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/controller/DocumentSplitController.java
+++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/controller/DocumentSplitController.java
@@ -496,6 +496,7 @@ public class DocumentSplitController {
@ApiOperation(value = "标准拆分详情-查询所有拆分错误的标准")
@GetMapping("/fixAllBadSplit")
public Result fixAllBadSplit() {
- return Result.OK(MessageUtils.getMessage(ResultCommon.OK), documentSplitService.fixAllBadSplit());
+ documentSplitService.fixAllBadSplit();
+ return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
}
diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/IDocumentSplitService.java b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/IDocumentSplitService.java
index 6bf6f35d..4f79606b 100644
--- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/IDocumentSplitService.java
+++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/IDocumentSplitService.java
@@ -246,5 +246,5 @@ public interface IDocumentSplitService extends IService {
*/
void deleteBatchTitle(String ids);
- String fixAllBadSplit();
+ void fixAllBadSplit();
}
diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java
index c55dbf21..c944f4c9 100644
--- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java
+++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java
@@ -106,6 +106,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@@ -158,6 +159,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl data) {
- if (CollectionUtils.isEmpty(data)){
+ if (CollectionUtils.isEmpty(data)) {
return;
}
// 获取标准信息
@@ -238,7 +240,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl authorList = data.stream().map(DocumentSplitInfo::getAuthor).distinct().collect(Collectors.toList());
List createByList = data.stream().map(DocumentSplitInfo::getCreateBy).distinct().collect(Collectors.toList());
List sysUserList = new ArrayList<>();
- if (!CollectionUtils.isEmpty(authorList) || !CollectionUtils.isEmpty(createByList)){
+ if (!CollectionUtils.isEmpty(authorList) || !CollectionUtils.isEmpty(createByList)) {
sysUserList = sysUserService.list(
new LambdaQueryWrapper()
.in(!CollectionUtils.isEmpty(authorList), SysUser::getId, authorList)
@@ -247,16 +249,16 @@ public class DocumentSplitServiceImpl extends ServiceImpl first = sysUserList.stream()
.filter(v -> v.getUsername().equals(documentSplitInfo.getCreateBy())).findFirst();
first.ifPresent(v -> documentSplitInfo.setCreateBy(v.getId()));
@@ -272,7 +274,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl optionalSysUser = sysUserList.stream()
.filter(v -> v.getId().equals(documentSplitInfo.getAuthor())).findFirst();
optionalSysUser.ifPresent(v -> {
- if (!"云平台".equals(documentSplitInfo.getAuthor())){
+ if (!"云平台".equals(documentSplitInfo.getAuthor())) {
documentSplitInfo.setAuthor(v.calcNameWorkNo());
}
});
@@ -295,9 +297,9 @@ public class DocumentSplitServiceImpl extends ServiceImpl updateWrapper = new LambdaUpdateWrapper<>();
List ids;
// 获取id集合
- if (StringUtils.isNotBlank(documentSplitInfo.getIds())){
+ if (StringUtils.isNotBlank(documentSplitInfo.getIds())) {
ids = Arrays.asList(documentSplitInfo.getIds().split(","));
- }else {
+ } else {
List documentSplitInfos = queryByList(documentSplitInfo);
ids = documentSplitInfos.stream().map(DocumentSplitInfo::getId).collect(Collectors.toList());
}
@@ -314,23 +316,24 @@ public class DocumentSplitServiceImpl extends ServiceImpl ids) {
// 登陆人信息
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
- if (sysUser.getRoleIds().contains("admin")){
+ if (sysUser.getRoleIds().contains("admin")) {
return;
}
List sarFileSplitInfoEOS = sarFileSplitInfoService.listByIds(ids);
for (SarFileSplitInfoEO sarFileSplitInfoEO : sarFileSplitInfoEOS) {
String createBy = sarFileSplitInfoEO.getCreateBy();
String author = sarFileSplitInfoEO.getAuthor();
- if (!sysUser.getUsername().equals(createBy) || !sysUser.getId().equals(author)){
- if(LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
+ if (!sysUser.getUsername().equals(createBy) || !sysUser.getId().equals(author)) {
+ if (LanguageEnum.CN.getValue().equals(MessageUtils.getLanguage().getValue())) {
throw new JeroBootException("只能删除有操作权限的数据!");
- }else{
+ } else {
throw new JeroBootException("You can delete only the data that you have permission to operate!");
}
}
@@ -343,7 +346,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl parameter, String selectCondition, List fieldListSelect) {
StringBuilder sb = new StringBuilder(selectCondition);
- if (parameter.containsKey("column")){
+ if (parameter.containsKey("column")) {
sb.append(" order by ");
String column = (String) parameter.get("column");
String order = (String) parameter.get("order");
@@ -385,15 +388,15 @@ public class DocumentSplitServiceImpl extends ServiceImpl lawsTag = fieldListSelect.stream().filter(o -> column.equals(o.getDbFieldName())).findFirst();
lawsTag.ifPresent(l -> {
// 多日期特殊处理
- if (LawsFieldTypeEnum.DATE_MANY.getValue().equals(l.getFieldShowType())){
+ if (LawsFieldTypeEnum.DATE_MANY.getValue().equals(l.getFieldShowType())) {
sb.append(DocumentSplitCommon.STR_TO_DATE_BEGIN + "substring_index(")
.append(l.getDbFieldName()).append(", ',', -1)").append(",'%Y-%m-%d')");
- }else {
+ } else {
sb.append(column);
}
});
sb.append(" ").append(order);
- }else {
+ } else {
// 默认排序
sb.append(" order by display_seq asc, sort_number is null, sort_number asc");
}
@@ -430,10 +433,10 @@ public class DocumentSplitServiceImpl extends ServiceImpl map : records) {
for (LawsTag lawsTag : lawsTags) {
String dbFieldName = lawsTag.getDbFieldName();
- if (map.containsKey(dbFieldName)){
+ if (map.containsKey(dbFieldName)) {
// 字典查找
SysDict sysDict = sysDictService.getById(lawsTag.getDictId());
- if (!Objects.isNull(sysDict)){
+ if (!Objects.isNull(sysDict)) {
setDicText(map, dbFieldName, sysDict);
}
}
@@ -445,13 +448,13 @@ public class DocumentSplitServiceImpl extends ServiceImpl map) {
// 零部件翻译
- if (map.containsKey("applicable_components")){
+ if (map.containsKey("applicable_components")) {
String applicableComponents = (String) map.get("applicable_components");
List partNames = partNameService.queryEcho(applicableComponents);
map.put("applicable_components_dictText", partNames.stream().map(PartName::getName).collect(Collectors.joining(",")));
}
// 属性标识翻译
- if (map.containsKey("property_tag")){
+ if (map.containsKey("property_tag")) {
String propertyTag = (String) map.get("property_tag");
List lawsLabelDatabases = lawsLabelDatabaseService.queryByCodes(propertyTag);
map.put("property_tag_dictText", lawsLabelDatabases.stream().map(LawsLabelDatabase::getName).collect(Collectors.joining(",")));
@@ -464,7 +467,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl list = sysDictItemService.list(queryWrapper);
- if(!list.isEmpty()){
+ if (!list.isEmpty()) {
List itemTextList = list.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
map.put(dbFieldName + DocumentSplitCommon.DIC_TEXT, String.join(",", itemTextList));
}
@@ -481,10 +484,10 @@ public class DocumentSplitServiceImpl extends ServiceImpl roleIdList = Arrays.asList(sysUser.getRoleIds().split(","));
Collection intersection = CollectionUtils.intersection(adminRoleCodeList, roleIdList);
- if (!intersection.isEmpty()){
+ if (!intersection.isEmpty()) {
// 有权限
return;
}
@@ -505,9 +508,9 @@ public class DocumentSplitServiceImpl extends ServiceImpl()
.eq(LawsEnterpriseStandard::getStandardNumber, sarFileSplitInfoEO.getSerialNumber()));
- if (!Objects.isNull(lawsEnterpriseStandard)){
+ if (!Objects.isNull(lawsEnterpriseStandard)) {
String id = lawsEnterpriseStandard.getId();
- if (StringUtils.isBlank(sarFileSplitInfoEO.getStandardId())){
+ if (StringUtils.isBlank(sarFileSplitInfoEO.getStandardId())) {
sarFileSplitInfoEO.setStandardId(id);
}
// 登陆人所在部门
@@ -530,13 +533,13 @@ public class DocumentSplitServiceImpl extends ServiceImpl tempAuthDeptList = enterpriseStandardAuthDeptService.list(tempAuthDeptWrapper);
- if (!tempAuthDeptList.isEmpty()){
+ if (!tempAuthDeptList.isEmpty()) {
// 有权限
return;
}
tempAuthDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
List authDeptExpireDateList = enterpriseStandardAuthDeptService.list(tempAuthDeptWrapper);
- if (!authDeptExpireDateList.isEmpty()){
+ if (!authDeptExpireDateList.isEmpty()) {
// 有权限
return;
}
@@ -564,7 +567,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl articlesList = JSON.parseArray(JSON.toJSONString(parameter.get(INTERPRETATION_ARTICLES_LIST)), SarFileSplitItemsValEO.class);
parameter.remove(INTERPRETATION_ARTICLES_LIST);
parameter.putIfAbsent(INTERPRETATION_ARTICLES, "");
- parameter.forEach((k, v) ->{
+ parameter.forEach((k, v) -> {
// 条文内容拼接
- if (ITEM_CONTENT.equals(k)){
+ if (ITEM_CONTENT.equals(k)) {
v = itemContentJoin(valList, (String) parameter.get(ID));
}
// 条文解读
- if (INTERPRETATION_ARTICLES.equals(k)){
+ if (INTERPRETATION_ARTICLES.equals(k)) {
v = articlesJoin(articlesList, (String) parameter.get(ID));
}
// 修改字段
String updateValue = getUpdateValue(finalFieldList, k, (String) v);
- if (StringUtils.isNotBlank(updateValue)){
+ if (StringUtils.isNotBlank(updateValue)) {
updateSet.append(updateValue).append(",");
}
});
@@ -655,7 +658,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl parameter) {
- if (parameter!= null){
- parameter.forEach((k, v) ->{
- if (Objects.isNull(v)){
+ if (parameter != null) {
+ parameter.forEach((k, v) -> {
+ if (Objects.isNull(v)) {
parameter.put(k, "");
}
});
@@ -683,9 +686,9 @@ public class DocumentSplitServiceImpl extends ServiceImpl").append(sarFileSplitItemsValEO.getItemContent()).append("
");
sarFileSplitItemsValEO.setId(UUIDUtils.randomUUID20());
sarFileSplitItemsValEO.setItemId(itemId);
@@ -703,13 +706,13 @@ public class DocumentSplitServiceImpl extends ServiceImpl valList, String itemId) {
StringBuilder valContent = new StringBuilder();
- if (!Objects.isNull(valList) && !valList.isEmpty()){
+ if (!Objects.isNull(valList) && !valList.isEmpty()) {
int index = 0;
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for (SarFileSplitItemsValEO sarFileSplitItemsValEO : valList) {
// 条文内容拼接
if (DocumentSplitCommon.TEXT.equals(sarFileSplitItemsValEO.getType())) {
- if (StringUtils.isNotBlank(sarFileSplitItemsValEO.getItemContent())){
+ if (StringUtils.isNotBlank(sarFileSplitItemsValEO.getItemContent())) {
sarFileSplitItemsValEO.setItemContent(sarFileSplitItemsValEO.getItemContent()
.replace("<", "<").replace(">", ">"));
}
@@ -743,10 +746,10 @@ public class DocumentSplitServiceImpl extends ServiceImpl sql = new AtomicReference<>("");
lawsTag.ifPresent(l -> {
// 构建修改字段
- if (LawsFieldTypeEnum.DATE_MANY.getValue().equals(l.getFieldShowType())){
+ if (LawsFieldTypeEnum.DATE_MANY.getValue().equals(l.getFieldShowType())) {
// 多日期
sql.set(new DateManyConditionImpl().buildUpdate(l.getDbFieldName(), v));
- }else {
+ } else {
sql.set(new UniversalImpl().buildUpdate(l.getDbFieldName(), v));
}
});
@@ -775,12 +778,12 @@ public class DocumentSplitServiceImpl extends ServiceImpl {
// 条文解读
- if (INTERPRETATION_ARTICLES.equals(k)){
+ if (INTERPRETATION_ARTICLES.equals(k)) {
v = articlesJoin(articlesList, (String) parameter.get(ID));
}
// 修改字段
String updateValue = getUpdateValue(finalFieldList, k, (String) v);
- if (StringUtils.isNotBlank(updateValue)){
+ if (StringUtils.isNotBlank(updateValue)) {
updateSet.append(updateValue).append(",");
}
});
@@ -790,11 +793,11 @@ public class DocumentSplitServiceImpl extends ServiceImpl list = Arrays.asList(ids.split(","));
updateCondition = "id in ('" + String.join("','", list) + "')";
- }else {
+ } else {
String infoId = (String) parameter.get(INFO_ID);
updateCondition = "info_id = " + "'" + infoId + "'";
}
@@ -803,7 +806,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl otherIds = listMap.stream().map(v -> (String)v.get(ID)).collect(Collectors.toList());
+ List otherIds = listMap.stream().map(v -> (String) v.get(ID)).collect(Collectors.toList());
// 删除旧数据
lawsDocumentSplitMapper.deleteBatchIds(otherIds);
@@ -859,14 +862,14 @@ public class DocumentSplitServiceImpl extends ServiceImpl lawsDocumentSplits = documentSplitMapper.queryLawsDocumentSplitInIds(Collections.singletonList((String) firstData.get(ID)));
List menuIds = documentSplitMapper.queryLawsDocumentSplitGroupByMenuId(lawsDocumentSplits.get(0).getInfoId());
- if (CollectionUtils.isNotEmpty(menuIds)){
+ if (CollectionUtils.isNotEmpty(menuIds)) {
menuIdList = menuIdList.stream().filter(v -> !menuIds.contains(v)).collect(Collectors.toList());
}
- if (!menuIdList.isEmpty()){
+ if (!menuIdList.isEmpty()) {
// 删除旧数据
documentSplitMapper.sarFileSplitMenuDeleteByIdList(menuIdList);
}
@@ -882,7 +885,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl sarFileSplitItemsValEOS = documentSplitMapper.queryItemsValByItemId((String) firstData.get(ID), "");
// 第一条数据信息的最大的排序字段值
Optional sarFileSplitItemsValEOOptional = sarFileSplitItemsValEOS.stream().sorted(Comparator.comparing(v -> Integer.valueOf(String.valueOf(v.getDisplaySeq())))).findFirst();
- sarFileSplitItemsValEOOptional.ifPresent(v ->{
+ sarFileSplitItemsValEOOptional.ifPresent(v -> {
// 排序字段
Integer displaySeq = v.getDisplaySeq();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -895,7 +898,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl parameter) {
- if (parameter.containsKey(IDS)){
+ if (parameter.containsKey(IDS)) {
String ids = (String) parameter.get(IDS);
String[] list = ids.split(",");
for (String id : list) {
@@ -981,14 +984,14 @@ public class DocumentSplitServiceImpl extends ServiceImpl queryItemsValList(String itemId) {
List sarFileSplitItemsValEOS = documentSplitMapper.queryItemsValByItemId(itemId, "");
- if (!Objects.isNull(sarFileSplitItemsValEOS) && !sarFileSplitItemsValEOS.isEmpty()){
+ if (!Objects.isNull(sarFileSplitItemsValEOS) && !sarFileSplitItemsValEOS.isEmpty()) {
for (SarFileSplitItemsValEO sarFileSplitItemsValEO : sarFileSplitItemsValEOS) {
String imgPath = sarFileSplitItemsValEO.getItemContent();
if (DocumentSplitCommon.IMG.equals(sarFileSplitItemsValEO.getType()) && org.apache.commons.lang.StringUtils.isNotEmpty(imgPath)) {
String imgName = imgPath.substring(imgPath.lastIndexOf("/") + 1);
sarFileSplitItemsValEO.setImgName(imgName);
}
- if (DocumentSplitCommon.TEXT.equals(sarFileSplitItemsValEO.getType()) && org.apache.commons.lang.StringUtils.isNotEmpty(imgPath)){
+ if (DocumentSplitCommon.TEXT.equals(sarFileSplitItemsValEO.getType()) && org.apache.commons.lang.StringUtils.isNotEmpty(imgPath)) {
sarFileSplitItemsValEO.setItemContent(HtmlUtils.htmlUnescape(sarFileSplitItemsValEO.getItemContent()));
}
}
@@ -1009,7 +1012,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl documentSplitInfos = queryByList(documentSplitInfo);
lawsDocumentSplitView.setDocumentSplitInfo(documentSplitInfos.get(0));
- if (parameter.containsKey("item_content")){
+ if (parameter.containsKey("item_content")) {
itemContent = true;
}
// 文档拆分详情
@@ -1151,14 +1153,14 @@ public class DocumentSplitServiceImpl extends ServiceImpl menuId = documentSplitDetailByList.stream()
.map(v -> String.valueOf(v.get("menu_id"))).distinct()
.collect(Collectors.toList());
splitMenuEOPage.setIdList(menuId);
List sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryByList(splitMenuEOPage);
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS);
- }else {
+ } else {
List sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryByList(splitMenuEOPage);
// 不需要总目录层级
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS.get(0).getChildren());
@@ -1166,6 +1168,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl processProjectAssessGetList(String ids) {
List processProjectAssessTermList = new ArrayList<>();
@@ -1230,7 +1233,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl parameter, boolean b) {
long l = System.currentTimeMillis();
String id = (String) parameter.get(ID);
- if (b){
+ if (b) {
// 水平越权
isHorizontalOverstep(id);
}
@@ -1240,7 +1243,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl().lambda()
.eq(SarFileSplitInfoEO::getPublishBeforeId, id));
- if (!Objects.isNull(sarFileSplitInfoEO)){
+ if (!Objects.isNull(sarFileSplitInfoEO)) {
// 删除旧发布数据
sarFileSplitInfoService.deleteById(sarFileSplitInfoEO.getId());
}
@@ -1304,7 +1307,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl keyList = new ArrayList<>(map.keySet());
- List valueList = map.values().stream().map(o ->(String.valueOf(o))).collect(Collectors.toList());
+ List valueList = map.values().stream().map(o -> (String.valueOf(o))).collect(Collectors.toList());
String insertField = String.join(",", keyList);
documentSplitMapper.insertLawsDocumentSplit(insertField, valueList);
}
@@ -1317,12 +1320,12 @@ public class DocumentSplitServiceImpl extends ServiceImpl allvItemsValList) {
int size = allvItemsValList.size();
- int count = (int)Math.ceil((double) size / NUMBER);
+ int count = (int) Math.ceil((double) size / NUMBER);
for (int i = 1; i <= count; i++) {
List list = allvItemsValList.stream()
.skip((long) (Math.max(i, 1) - 1) * NUMBER)
@@ -1348,7 +1351,7 @@ public class DocumentSplitServiceImpl extends ServiceImpl parameter, HttpServletRequest request, HttpServletResponse response) {
- try (Workbook workbook = new XSSFWorkbook()){
+ try (Workbook workbook = new XSSFWorkbook()) {
// 文档拆分详情数据
List