diff --git a/src/main/java/neatlogic/module/deploy/job/callback/DeployJobNotifyCallbackHandler.java b/src/main/java/neatlogic/module/deploy/job/callback/DeployJobNotifyCallbackHandler.java
index 221fad76b28f934ce1d49d582c5ade037beb7191..932a5f0cc449dcb29550e9f148eef0a6fad5561d 100644
--- a/src/main/java/neatlogic/module/deploy/job/callback/DeployJobNotifyCallbackHandler.java
+++ b/src/main/java/neatlogic/module/deploy/job/callback/DeployJobNotifyCallbackHandler.java
@@ -15,12 +15,15 @@ along with this program. If not, see .*/
package neatlogic.module.deploy.job.callback;
import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.autoexec.constvalue.JobUserType;
import neatlogic.framework.autoexec.dao.mapper.AutoexecJobMapper;
import neatlogic.framework.autoexec.dto.job.AutoexecJobVo;
import neatlogic.framework.autoexec.job.callback.core.AutoexecJobCallbackBase;
import neatlogic.framework.cmdb.crossover.IAppSystemMapper;
import neatlogic.framework.cmdb.dto.resourcecenter.entity.AppModuleVo;
import neatlogic.framework.cmdb.dto.resourcecenter.entity.AppSystemVo;
+import neatlogic.framework.common.constvalue.GroupSearch;
+import neatlogic.framework.common.constvalue.SystemUser;
import neatlogic.framework.crossover.CrossoverServiceFactory;
import neatlogic.framework.deploy.constvalue.DeployJobNotifyTriggerType;
import neatlogic.framework.deploy.dto.job.DeployJobVo;
@@ -28,6 +31,7 @@ import neatlogic.framework.notify.crossover.INotifyServiceCrossoverService;
import neatlogic.framework.notify.dao.mapper.NotifyMapper;
import neatlogic.framework.notify.dto.InvokeNotifyPolicyConfigVo;
import neatlogic.framework.notify.dto.NotifyPolicyVo;
+import neatlogic.framework.notify.dto.NotifyReceiverVo;
import neatlogic.framework.transaction.util.TransactionUtil;
import neatlogic.framework.util.NotifyPolicyUtil;
import neatlogic.module.deploy.dao.mapper.DeployAppConfigMapper;
@@ -40,8 +44,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionStatus;
import javax.annotation.Resource;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
/**
* @author longrf
@@ -139,9 +142,14 @@ public class DeployJobNotifyCallbackHandler extends AutoexecJobCallbackBase {
return;
}
try {
+ Map> receiverMap = new HashMap<>();
+ if (!Objects.equals(jobInfo.getExecUser(), SystemUser.SYSTEM.getUserUuid())) {
+ receiverMap.computeIfAbsent(JobUserType.EXEC_USER.getValue(), k -> new ArrayList<>())
+ .add(new NotifyReceiverVo(GroupSearch.USER.getValue(), jobInfo.getExecUser()));
+ }
String notifyAuditMessage = jobInfo.getId() + "-" + jobInfo.getName();
NotifyPolicyUtil.execute(notifyPolicyVo.getHandler(), trigger, DeployJobMessageHandler.class
- , notifyPolicyVo, null, null, null
+ , notifyPolicyVo, null, null, receiverMap
, jobInfo, null, notifyAuditMessage);
} catch (Exception ex) {
logger.error("发布作业:" + jobInfo.getId() + "-" + jobInfo.getName() + "通知失败");
diff --git a/src/main/java/neatlogic/module/deploy/notify/handler/DeployJobNotifyPolicyHandler.java b/src/main/java/neatlogic/module/deploy/notify/handler/DeployJobNotifyPolicyHandler.java
index 31efc12b08806e501716d7fc363e3d1ec926e5d9..cc3a9bef11109ab736fe545730a21f85facd55be 100644
--- a/src/main/java/neatlogic/module/deploy/notify/handler/DeployJobNotifyPolicyHandler.java
+++ b/src/main/java/neatlogic/module/deploy/notify/handler/DeployJobNotifyPolicyHandler.java
@@ -14,7 +14,9 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .*/
package neatlogic.module.deploy.notify.handler;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.autoexec.constvalue.JobGroupSearch;
import neatlogic.framework.deploy.auth.DEPLOY_MODIFY;
import neatlogic.framework.deploy.constvalue.DeployJobNotifyParam;
import neatlogic.framework.deploy.constvalue.DeployJobNotifyTriggerType;
@@ -71,6 +73,8 @@ public class DeployJobNotifyPolicyHandler extends NotifyPolicyHandlerBase {
@Override
protected void myAuthorityConfig(JSONObject config) {
-
+ List groupList = JSON.parseArray(config.getJSONArray("groupList").toJSONString(), String.class);
+ groupList.add(JobGroupSearch.JOBUSERTYPE.getValue());
+ config.put("groupList", groupList);
}
}