| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.concurrent.Executor; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Slf4j |
| | | public class HkSyncPushServiceImpl extends HkSyncBaseServiceImpl { |
| | | |
| | | @Autowired |
| | | @Qualifier("asyncExecutor") |
| | | private Executor asyncExecutor; |
| | | @Autowired |
| | | private InoutDayCountMapper inoutDayCountMapper; |
| | | @Autowired |
| | |
| | | } |
| | | if(Constants.equalsInteger(warningRule.getMemberNotice(),Constants.ONE)){ |
| | | Boolean noticeFlag = false; |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)) { |
| | | noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()), |
| | | StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","), |
| | | dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),warningConfig.getInfo())); |
| | | } |
| | | // if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)) { |
| | | // noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()), |
| | | // StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","), |
| | | // dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),warningConfig.getInfo())); |
| | | // } |
| | | warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO); |
| | | List<String> ddUserIdList = memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ddUserIdList)){ |
| | |
| | | private void dealNoticeTelecomEvent(EventBaseRequest param,EventBaseInfoRequest request ,List<WarningEvent> list) { |
| | | try { |
| | | log.error("========通知其他三方地址离岗事件开始:"+list.size()); |
| | | Thread t1=new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | asyncExecutor.execute(() -> { |
| | | // EventBaseRequest submitParam = new EventBaseRequest(); |
| | | // submitParam.setMethod(param.getMethod()); |
| | | // submitParam.setParams(new EventBaseParamRequest()); |
| | |
| | | log.error("========通知其他三方地址离岗事件已推送,结果:"+s+"\n"+response); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | t1.start(); |
| | | }); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.error("dealNoticeTelecomEvent异常", e); |
| | | } |
| | | } |
| | | |