飞书消息

This commit is contained in:
zhn
2022-06-06 11:02:55 +08:00
parent e5f47ba041
commit add38b8f82
3 changed files with 40 additions and 3 deletions
@@ -483,4 +483,15 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
List<OSSFileForDocumentLibrary> fileInfos = bussDocumentLibraryEOService.getFileInfos(id);
return Result.OK(fileInfos);
}
/**
* 根据id查询编号和标题
* @param id
* @return
*/
@ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
@GetMapping(value = "/getTitle")
public Result<?> getTitle(String id,String cut) {
String title = bussDocumentLibraryEOService.getTitle(id, cut);
return Result.OK(title);
}
}
@@ -218,4 +218,6 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
IPage getPageDummy(Map<String, Object> parameter);
void isModifyForOcrAndSplit(Map<String, Object> parameter);
String getTitle(String id,String cut);
}
@@ -3023,10 +3023,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
//飞书
try {
String hrefTemp = "<a href='/docManage/library/detail?id=" + id +
"'" + " target='_blank'>" + serialNumber + "</a>";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String replace = sbStr.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
String contentInfo = "In the " + category + serialNumber+" you subscribed to, "+sysUser.getUsername()+" changed the " + replace.toString();
String url = backUrl + "/isps/userAnnouncement";
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfo, MessageTypeEnum.READ.getName(), url);
String contentInfoFei = "In the " + category + serialNumber+" you subscribed to, "+sysUser.getUsername()+" changed the " + replace;
String contentInfo = "In the " + category + hrefTemp+" you subscribed to, "+sysUser.getUsername()+" changed the " + sbStr;
String content = "In the "+serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
String encodeContent = UriEncoder.encode(content);
String encodeContentInfo = UriEncoder.encode(contentInfo);
String url = backUrl + "/system/MessageDetails?msgContent="+encodeContent+"&sendTime="+sdf.format(new Date())+"&msgContentInfo="+encodeContentInfo;
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
} catch (IOException e) {
log.error("文档新增飞书消息推送失败");
}
@@ -5507,6 +5514,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
}
//高级搜索条件拼接
private String sqlJoint(List<QueryConditionVO> queryConditionVOList){
@@ -5593,4 +5601,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
return value;
}
@Override
public String getTitle(String id,String cut) {
LambdaQueryWrapper<BussDocumentLibraryEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(BussDocumentLibraryEO::getId,id);
List<Map<String, Object>> mapList = this.listMaps();
String title = "";
if(mapList.size() != 0){
if(CutEnum.CN.getValue().equals(cut)){
title = mapList.get(0).get("serial_number") + ""+ mapList.get(0).get("title") + "";
}else{
title = mapList.get(0).get("") + ""+ mapList.get(0).get("title_en") + "";
}
}
return title;
}
}