From c467370d8741bc05ca7c22d4253c58ac0a979ef5 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期二, 09 六月 2026 09:46:25 +0800
Subject: [PATCH] 功能优化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 45 +++++++++++++++++++++++++++++++++------------
1 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index 20883ce..1fd3684 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.DataSyncConfig;
+import com.doumee.core.dingTalk.DingTalk;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.*;
@@ -34,16 +35,20 @@
import com.doumee.service.business.third.model.response.TmsOrderInfoResponse;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
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 javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
import java.util.*;
import java.util.Date;
+import java.util.concurrent.Executor;
import java.util.stream.Collectors;
/**
@@ -55,6 +60,9 @@
@Slf4j
public class HkSyncPushServiceImpl extends HkSyncBaseServiceImpl {
+ @Autowired
+ @Qualifier("asyncExecutor")
+ private Executor asyncExecutor;
@Autowired
private InoutDayCountMapper inoutDayCountMapper;
@Autowired
@@ -113,6 +121,8 @@
private WarningRuleMapper warningRuleMapper;
@Autowired
private WarningPushMapper warningPushMapper;
+ @Autowired
+ private DingTalk dingTalk;
/**
* 娴峰悍闂ㄧ浜嬩欢鎺ㄩ��
@@ -528,7 +538,7 @@
warningPush.setStatus(Constants.ZERO);
warningPush.setPushType(Constants.ZERO);
warningPush.setRegion( warningEvent.getRegion());
- if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
+ if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)) {
warningPush.setMemberIds(
StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
);
@@ -536,10 +546,21 @@
);
}
if(Constants.equalsInteger(warningRule.getMemberNotice(),Constants.ONE)){
- // Boolean 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);
+ 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()));
+// }
+ 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)){
+ for (String ddUserId:ddUserIdList) {
+ impl.getJDYData(warningEvent,ddUserId,
+ systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_ENTRY_ID).getCode()
+ );
+ }
+ }
}
impl.sendDeviceNotice(warningRule);
warningPushMapper.insert(warningPush);
@@ -571,6 +592,10 @@
return null;
}
+
+
+
+
/**
* 閫氱煡鐢典俊鎺ュ彛锛堢宀椾簨浠讹級
* @param list
@@ -578,9 +603,7 @@
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());
@@ -644,11 +667,9 @@
log.error("========閫氱煡鍏朵粬涓夋柟鍦板潃绂诲矖浜嬩欢宸叉帹閫侊紝缁撴灉:"+s+"\n"+response);
}
}
- }
- });
- t1.start();
+ });
}catch (Exception e){
- e.printStackTrace();
+ log.error("dealNoticeTelecomEvent寮傚父", e);
}
}
--
Gitblit v1.9.3