|
@@ -66,7 +66,7 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
notifyConfigMapper.insert(notifyConfig);
|
|
notifyConfigMapper.insert(notifyConfig);
|
|
|
// 开始新增detail
|
|
// 开始新增detail
|
|
|
if (createReqVO.getNotifyConfigDetailRespVOList() != null && !createReqVO.getNotifyConfigDetailRespVOList().isEmpty()) {
|
|
if (createReqVO.getNotifyConfigDetailRespVOList() != null && !createReqVO.getNotifyConfigDetailRespVOList().isEmpty()) {
|
|
|
- createReqVO.getNotifyConfigDetailRespVOList().forEach( item -> item.setConfigId(notifyConfig.getId()));
|
|
|
|
|
|
|
+ createReqVO.getNotifyConfigDetailRespVOList().forEach(item -> item.setConfigId(notifyConfig.getId()));
|
|
|
notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(createReqVO.getNotifyConfigDetailRespVOList(), NotifyConfigDetailDO.class));
|
|
notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(createReqVO.getNotifyConfigDetailRespVOList(), NotifyConfigDetailDO.class));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -81,18 +81,18 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
notifyConfigMapper.updateById(updateObj);
|
|
notifyConfigMapper.updateById(updateObj);
|
|
|
// 开始新增detail
|
|
// 开始新增detail
|
|
|
if (updateReqVO.getNotifyConfigDetailRespVOList() != null && !updateReqVO.getNotifyConfigDetailRespVOList().isEmpty()) {
|
|
if (updateReqVO.getNotifyConfigDetailRespVOList() != null && !updateReqVO.getNotifyConfigDetailRespVOList().isEmpty()) {
|
|
|
- updateReqVO.getNotifyConfigDetailRespVOList().forEach( item -> item.setConfigId(updateObj.getId()));
|
|
|
|
|
|
|
+ updateReqVO.getNotifyConfigDetailRespVOList().forEach(item -> item.setConfigId(updateObj.getId()));
|
|
|
notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(updateReqVO.getNotifyConfigDetailRespVOList(), NotifyConfigDetailDO.class));
|
|
notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(updateReqVO.getNotifyConfigDetailRespVOList(), NotifyConfigDetailDO.class));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void deleteNotifyConfigListByIds(List<Long> ids) {
|
|
|
|
|
|
|
+ public void deleteNotifyConfigListByIds(List<Long> ids) {
|
|
|
// 删除
|
|
// 删除
|
|
|
notifyConfigMapper.physicalDeleteByIds(ids);
|
|
notifyConfigMapper.physicalDeleteByIds(ids);
|
|
|
// 删除isc_notify_config_detail
|
|
// 删除isc_notify_config_detail
|
|
|
List<NotifyConfigDetailDO> notifyConfigDetailDOS = notifyConfigDetailService.list(Wrappers.<NotifyConfigDetailDO>lambdaQuery()
|
|
List<NotifyConfigDetailDO> notifyConfigDetailDOS = notifyConfigDetailService.list(Wrappers.<NotifyConfigDetailDO>lambdaQuery()
|
|
|
- .eq(NotifyConfigDetailDO::getConfigId, ids));
|
|
|
|
|
|
|
+ .in(NotifyConfigDetailDO::getConfigId, ids));
|
|
|
if (!notifyConfigDetailDOS.isEmpty()) {
|
|
if (!notifyConfigDetailDOS.isEmpty()) {
|
|
|
List<Long> idList = notifyConfigDetailDOS.stream().map(NotifyConfigDetailDO::getId).toList();
|
|
List<Long> idList = notifyConfigDetailDOS.stream().map(NotifyConfigDetailDO::getId).toList();
|
|
|
notifyConfigDetailService.deleteNotifyConfigDetailListByIds(idList);
|
|
notifyConfigDetailService.deleteNotifyConfigDetailListByIds(idList);
|
|
@@ -153,11 +153,12 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提前发送的消息
|
|
* 提前发送的消息
|
|
|
- * @param notifyConfigId 通知规则id
|
|
|
|
|
- * @param ticketId 作业id
|
|
|
|
|
- * @param shouldSendTime 应该发送时间
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param notifyConfigId 通知规则id
|
|
|
|
|
+ * @param ticketId 作业id
|
|
|
|
|
+ * @param shouldSendTime 应该发送时间
|
|
|
* @param secondsToSubtract 提前的时间
|
|
* @param secondsToSubtract 提前的时间
|
|
|
- * @param templateParams 参数模板
|
|
|
|
|
|
|
+ * @param templateParams 参数模板
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
private Boolean beforeSend(Long notifyConfigId, Long ticketId, LocalDateTime shouldSendTime, Integer secondsToSubtract, Map<String, Object> templateParams) {
|
|
private Boolean beforeSend(Long notifyConfigId, Long ticketId, LocalDateTime shouldSendTime, Integer secondsToSubtract, Map<String, Object> templateParams) {
|
|
@@ -230,12 +231,13 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 立刻发送的消息
|
|
* 立刻发送的消息
|
|
|
|
|
+ *
|
|
|
* @param notifyConfigId 通知规则id
|
|
* @param notifyConfigId 通知规则id
|
|
|
- * @param ticketId 作业id
|
|
|
|
|
|
|
+ * @param ticketId 作业id
|
|
|
* @param templateParams 参数模板
|
|
* @param templateParams 参数模板
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private Boolean immediatelySend(Long notifyConfigId, Long ticketId , Map<String, Object> templateParams) {
|
|
|
|
|
|
|
+ private Boolean immediatelySend(Long notifyConfigId, Long ticketId, Map<String, Object> templateParams) {
|
|
|
// 查询规则详情-启用的
|
|
// 查询规则详情-启用的
|
|
|
List<NotifyConfigDetailDO> notifyConfigDetailDOS = notifyConfigDetailService.list(Wrappers.<NotifyConfigDetailDO>lambdaQuery()
|
|
List<NotifyConfigDetailDO> notifyConfigDetailDOS = notifyConfigDetailService.list(Wrappers.<NotifyConfigDetailDO>lambdaQuery()
|
|
|
.eq(NotifyConfigDetailDO::getConfigId, notifyConfigId)
|
|
.eq(NotifyConfigDetailDO::getConfigId, notifyConfigId)
|
|
@@ -291,11 +293,12 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 推迟发送的消息
|
|
* 推迟发送的消息
|
|
|
- * @param notifyConfigId 通知规则id
|
|
|
|
|
- * @param ticketId 作业id
|
|
|
|
|
- * @param shouldSendTime 应该发送时间
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param notifyConfigId 通知规则id
|
|
|
|
|
+ * @param ticketId 作业id
|
|
|
|
|
+ * @param shouldSendTime 应该发送时间
|
|
|
* @param secondsToSubtract 推迟的时间
|
|
* @param secondsToSubtract 推迟的时间
|
|
|
- * @param templateParams 参数模板
|
|
|
|
|
|
|
+ * @param templateParams 参数模板
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
private Boolean delaySend(Long notifyConfigId, Long ticketId, LocalDateTime shouldSendTime, Integer secondsToSubtract, Map<String, Object> templateParams) {
|
|
private Boolean delaySend(Long notifyConfigId, Long ticketId, LocalDateTime shouldSendTime, Integer secondsToSubtract, Map<String, Object> templateParams) {
|