推送飞书跳转
This commit is contained in:
+56
-29
@@ -13,7 +13,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.constant.enums.*;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.IsMustEnum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.es.JeroElasticsearchTemplate;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryRuleEnum;
|
||||
@@ -47,7 +51,11 @@ import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
||||
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
||||
import com.jero.modules.system.entity.*;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysCategoryTreeVO;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
@@ -61,8 +69,20 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
|
||||
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.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -74,15 +94,31 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.yaml.snakeyaml.util.UriEncoder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -384,7 +420,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//搜索中心输入框
|
||||
fieldList = fieldList.stream()
|
||||
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowSearch()))
|
||||
&& (FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType()) || FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType())))
|
||||
&& (FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType()) //输入框(字符串)
|
||||
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType())//输入框(数字)
|
||||
|| FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())//人员选择
|
||||
|| FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())//标准选择
|
||||
|| FieldTypeEnum.TEXT.getValue().equals(e.getFieldShowType())//文本框
|
||||
|| FieldTypeEnum.TEXT_LINK.getValue().equals(e.getFieldShowType())//输入框(链接)
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
//搜索中心下拉,树形,日期等字段
|
||||
@@ -395,7 +437,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|| FieldTypeEnum.DATE_SINGLE.getValue().equals(e.getFieldShowType())//日期单选
|
||||
|| FieldTypeEnum.DATE_MORE.getValue().equals(e.getFieldShowType())//日期多选
|
||||
|| FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType())//树形
|
||||
|| FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())//人员选择
|
||||
// || FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())//人员选择
|
||||
// || FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
@@ -1560,25 +1602,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
}
|
||||
//标准选择字段
|
||||
// List<OnlCgformField> standardOnlCgformFieldList = fieldList.stream()
|
||||
// .filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||
// if(standardOnlCgformFieldList.size() != 0){
|
||||
// List<String> collect = standardOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
// List<String> standardList = new ArrayList<>();
|
||||
// for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
// String key = entry.getKey();
|
||||
// if(collect.contains(key)){
|
||||
// standardList.add(key);
|
||||
// }
|
||||
// }
|
||||
// if(standardList.size() != 0){
|
||||
// for (String standard : standardList) {
|
||||
// map.put(standard, map.get(standard+"_id"));
|
||||
// map.remove(standard+"_id");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//代替标准不为空,需要向被替代标准的法规工程师发送站内通知和飞书信息,提醒内容:"新标准编号"已实施,请注意更新“替代标准编号”状态
|
||||
map.remove("cut");
|
||||
//获取搜索中心字段
|
||||
@@ -4493,7 +4517,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> hrefList = new ArrayList<>();
|
||||
for (Map<String, Object> map : mapList) {
|
||||
serialNumberList.add((String) map.get("serial_number"));
|
||||
String url = backUrl + "/docManage/library/detail?id=" + (String) map.get("id");
|
||||
String url = backUrl + "/docManage/library/detail?id=" + (String) map.get("id")+
|
||||
"&title=" + (String) map.get("title") +
|
||||
"&serial_number=" + (String) map.get("serial_number");
|
||||
|
||||
String href = "<a href='/docManage/library/detail?id=" + (String) map.get("id") +
|
||||
"&title=" + (String) map.get("title") +
|
||||
@@ -4513,6 +4539,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//飞书
|
||||
try {
|
||||
for (String s : urlList) {
|
||||
String encode = UriEncoder.encode(s);
|
||||
List<String> list = new ArrayList<>();
|
||||
mapList.stream().forEach(e->{
|
||||
if(s.contains((String)e.get("id"))){
|
||||
@@ -4521,7 +4548,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
});
|
||||
String contentTemp = sysUser.getUsername() + " pushed " + StringUtils.join(list, ",") + " to you, Please pay attention to check.";
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), s);
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("飞书推送失败");
|
||||
|
||||
+5
-1
@@ -126,7 +126,11 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
//输入框字段
|
||||
List<OnlCgformField> inputOnlCgformFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.TEXT_STRING.getValue().equals(e.getFieldShowType())
|
||||
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType()))
|
||||
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(e.getFieldShowType())
|
||||
|| FieldTypeEnum.PERSON.getValue().equals(e.getFieldShowType())//人员选择
|
||||
|| FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())//标准选择
|
||||
|| FieldTypeEnum.TEXT.getValue().equals(e.getFieldShowType())//文本框
|
||||
|| FieldTypeEnum.TEXT_LINK.getValue().equals(e.getFieldShowType()))//输入框(链接)
|
||||
.collect(Collectors.toList());
|
||||
List<String> inputFieldList = inputOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
inputFieldList.add("file_text");
|
||||
|
||||
Reference in New Issue
Block a user