飞书消息--预警信息分享
This commit is contained in:
+37
-26
@@ -18,6 +18,7 @@ import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
@@ -55,6 +56,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -554,41 +556,50 @@ public class LawsWarnService {
|
||||
for (String s : urlList) {
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
String encode = UriEncoder.encode(s);
|
||||
List<String> list = new ArrayList<>();
|
||||
String contentInfoFei = sysUser.getUsername() +" shared Regulation Early Warning infomation with you.";
|
||||
String contentInfoFeiCn = sysUser.getUsername() +"向您分享了法规预警信息.";
|
||||
List<String> userIdListNew = userIdList;
|
||||
mapList.stream().forEach(e->{
|
||||
if(s.contains((String)e.get("id"))){
|
||||
String serialNumber = StringUtils.valueOf(e.get("serial_number"));
|
||||
//封装飞书消息实体类
|
||||
setFeishuMsgVo(sysUser, sdf, feishuMsgVo, encode, e, serialNumber);
|
||||
// setFeishuMsgVo(sysUser, sdf, feishuMsgVo, encode, e, serialNumber);
|
||||
|
||||
String timeContent = "";
|
||||
if("1".equals(flag)){
|
||||
String value = StringUtils.valueOf(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"));
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
if(value.contains(" ")){
|
||||
value = value.split(" ")[0];
|
||||
}
|
||||
timeContent =" to you as the implementation date of the new model is " +value;
|
||||
}
|
||||
}else if("2".equals(flag)){
|
||||
String value = StringUtils.valueOf(e.get("implement_time"));
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
if(value.contains(" ")){
|
||||
value = value.split(" ")[0];
|
||||
}
|
||||
timeContent =" to you as the implementation date of vehicle production is " +value;
|
||||
}
|
||||
String documentTitleCn = ""; //文档标题
|
||||
String documentTitleEn = ""; //文档标题
|
||||
String newTypeExecutionDate = ""; //新车型实施日期
|
||||
String newVehicleExecutionDate = ""; //在产车实施日期
|
||||
|
||||
if(ObjectUtils.isNotEmpty(e.get("title"))){
|
||||
documentTitleCn = String.valueOf(e.get("title"));
|
||||
}
|
||||
list.add(serialNumber + timeContent);
|
||||
if(ObjectUtils.isNotEmpty(e.get("title_en"))){
|
||||
documentTitleEn = String.valueOf(e.get("title_en"));
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){
|
||||
newTypeExecutionDate = sdf.format(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"));
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(e.get("implement_time"))){
|
||||
newVehicleExecutionDate = sdf.format(e.get("implement_time"));
|
||||
}
|
||||
|
||||
//飞书消息(模板-20230410)
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentInfoFeiCn",contentInfoFeiCn);
|
||||
params.put("contentInfoFeiEn",contentInfoFei);
|
||||
params.put("userIdList",userIdListNew);
|
||||
params.put("back_url",encode);
|
||||
params.put("titleCn", " "+documentTitleCn);
|
||||
params.put("titleEn"," "+documentTitleEn);
|
||||
params.put("regulationNo"," "+serialNumber);
|
||||
params.put("newTypeExecutionDate"," "+newTypeExecutionDate);
|
||||
params.put("newVehicleExecutionDate"," "+newVehicleExecutionDate);
|
||||
iFeishuService.sendMessageLawsWarn(TemplateInfoEnum2.LAWS_WARN.getValue(),params);
|
||||
}
|
||||
});
|
||||
iFeishuService.sendCardMsgWarn(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
|
||||
|
||||
// String contentTemp = sysUser.getUsername() + " has pushed " + StringUtils.join(list, ",") + ", Please be reminded to check it out.";
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
|
||||
// iFeishuService.sendCardMsgWarn(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bussDocumentLibraryEOService.sendWebsocket(documentIds, documentIds);
|
||||
|
||||
Reference in New Issue
Block a user