|
|
@ -13,8 +13,13 @@ import com.ccsens.carbasics.persist.dao.FirstAidDao; |
|
|
|
import com.ccsens.carbasics.persist.dao.OrganizationMemberDao; |
|
|
|
import com.ccsens.carbasics.util.Constant; |
|
|
|
import com.ccsens.carbasics.util.DefaultCodeError; |
|
|
|
import com.ccsens.common.service.IMessageService; |
|
|
|
import com.ccsens.util.CodeError; |
|
|
|
import com.ccsens.util.bean.message.common.InMessage; |
|
|
|
import com.ccsens.util.bean.message.common.MessageConstant; |
|
|
|
import com.ccsens.util.bean.message.common.MessageRule; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
@ -22,7 +27,9 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.validation.constraints.NotNull; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
@ -42,6 +49,8 @@ public class EquipmentService implements IEquipmentService { |
|
|
|
@Resource |
|
|
|
private QcpButtonReceive qcpButtonReceive; |
|
|
|
@Resource |
|
|
|
private IMessageService messageService; |
|
|
|
@Resource |
|
|
|
private OrganizationMemberDao organizationMemberDao; |
|
|
|
|
|
|
|
|
|
|
@ -82,7 +91,7 @@ public class EquipmentService implements IEquipmentService { |
|
|
|
* 通知医院的所有成员病例进度 |
|
|
|
* @param firstAidId 病例 |
|
|
|
*/ |
|
|
|
private void sendDoctor(Long firstAidId, String firstAidName, Long organizationId){ |
|
|
|
private void sendDoctor(Long firstAidId, String firstAidName, Long organizationId) throws Exception { |
|
|
|
// 查询医院所有成员
|
|
|
|
List<Long> userIds = organizationMemberDao.queryUserIdsByOrganizationId(organizationId); |
|
|
|
// 查询当前未完成的状态
|
|
|
@ -91,7 +100,15 @@ public class EquipmentService implements IEquipmentService { |
|
|
|
if (inform == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Set<String> userIdSet = new HashSet<>(); |
|
|
|
userIds.forEach(userId -> userIdSet.add(userId + "")); |
|
|
|
// 封装对象
|
|
|
|
|
|
|
|
MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User); |
|
|
|
messageRule.setAckRule(MessageRule.AckRule.NONE); |
|
|
|
messageRule.setOfflineDiscard((byte) 1); |
|
|
|
InMessage inMessage = InMessage.newToUserMessage(null, userIdSet, null, messageRule, ""); |
|
|
|
log.info("发送消息:{}", inMessage); |
|
|
|
//发送消息
|
|
|
|
messageService.sendTo(inMessage); |
|
|
|
} |
|
|
|
} |
|
|
|