|
@@ -39,6 +39,7 @@ import com.lantone.security.enums.ReadTypeEnum;
|
|
|
import com.lantone.security.enums.ReceiveTypeEnum;
|
|
|
import com.lantone.security.enums.ReturnTypeEnum;
|
|
|
import com.lantone.security.service.MessageService;
|
|
|
+import org.apache.commons.collections.SetUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -168,7 +169,7 @@ public class NoticeManagementFacade {
|
|
|
SendToTopicDTO sendToTopicDTO = new SendToTopicDTO();
|
|
|
sendToTopicDTO.setMessage("+1");
|
|
|
sendToTopicDTO.setType("count");
|
|
|
- sendToTopicDTO.setTopic(userId+"");
|
|
|
+ sendToTopicDTO.setTopic(userId + "");
|
|
|
sendToTopics.add(sendToTopicDTO);
|
|
|
});
|
|
|
messageService.sendToTopic(sendToTopics);
|
|
@@ -187,14 +188,19 @@ public class NoticeManagementFacade {
|
|
|
Asserts.fail("当前管理员发送通知的组织集合为空,请联系管理员~");
|
|
|
}
|
|
|
//获取该医院的用户
|
|
|
- userIds.addAll(hospitalUserFacade.list(new QueryWrapper<HospitalUser>()
|
|
|
+ Set<Long> tempUsers = hospitalUserFacade.list(new QueryWrapper<HospitalUser>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("hospital_id", hospitals)).stream().map(HospitalUser::getUserId).collect(Collectors.toSet()));
|
|
|
-
|
|
|
+ .in("hospital_id", hospitals)).stream().map(HospitalUser::getUserId).collect(Collectors.toSet());
|
|
|
+ if (tempUsers != null && tempUsers.isEmpty()) {
|
|
|
+ userIds.addAll(tempUsers);
|
|
|
+ }
|
|
|
//获取医院的科室
|
|
|
- getUserByDepts(deptFacade.list(new QueryWrapper<Dept>()
|
|
|
+ List<Long> tempDepts = deptFacade.list(new QueryWrapper<Dept>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("hospital_id", hospitals)).stream().map(Dept::getId).collect(Collectors.toList()), userIds);
|
|
|
+ .in("hospital_id", hospitals)).stream().map(Dept::getId).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(tempDepts)) {
|
|
|
+ getUserByDepts(tempDepts, userIds);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|