|
|
@ -17,14 +17,12 @@ import com.ccsens.carbasics.bean.vo.message.UpdateStatusVo; |
|
|
|
import com.ccsens.carbasics.persist.dao.*; |
|
|
|
import com.ccsens.carbasics.service.IFirstAidService; |
|
|
|
import com.ccsens.carbasics.util.Constant; |
|
|
|
import com.ccsens.carbasics.util.DefaultCodeError; |
|
|
|
import com.ccsens.util.JacksonUtil; |
|
|
|
import com.ccsens.util.RedisUtil; |
|
|
|
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.config.RabbitMQConfig; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.amqp.core.AmqpTemplate; |
|
|
@ -119,8 +117,9 @@ public class QcpButtonReceive { |
|
|
|
equipmentStatus.setEquipmentStatus((byte) 0); |
|
|
|
equipmentStatus.setFirstAidId(firstAid.getId()); |
|
|
|
equipmentStatus.setTime(System.currentTimeMillis()); |
|
|
|
equipmentStatusDao.insertSelective(equipmentStatus); |
|
|
|
} |
|
|
|
sendDoctor(firstAid.getId(), firstAid.getName(), firstAid.getHospitalId()); |
|
|
|
sendDoctor(firstAid.getId(), firstAid.getName(), firstAid.getHospitalId(), (byte) 1); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -156,7 +155,7 @@ public class QcpButtonReceive { |
|
|
|
String name = firstAid.getName(); |
|
|
|
Long time = param.getTime(); |
|
|
|
sendEquipmentStart(firstAidId, hospitalId, name, time); |
|
|
|
sendDoctor(firstAidId, firstAid.getName(), firstAid.getHospitalId()); |
|
|
|
sendDoctor(firstAidId, firstAid.getName(), firstAid.getHospitalId(), (byte) 2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -251,14 +250,14 @@ public class QcpButtonReceive { |
|
|
|
saveEquipmentStatus.setFirstAidId(param.getFirstAidId()); |
|
|
|
equipmentStatusDao.insertSelective(saveEquipmentStatus); |
|
|
|
|
|
|
|
sendDoctor(param.getFirstAidId(), firstAid.getName(), firstAid.getHospitalId()); |
|
|
|
sendDoctor(param.getFirstAidId(), firstAid.getName(), firstAid.getHospitalId(), (byte) 3); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 通知医院的所有成员病例进度 |
|
|
|
* @param firstAidId 病例 |
|
|
|
*/ |
|
|
|
private void sendDoctor(Long firstAidId, String firstAidName, Long organizationId) throws Exception { |
|
|
|
private void sendDoctor(Long firstAidId, String firstAidName, Long organizationId,Byte type) throws Exception { |
|
|
|
// 查询医院所有成员
|
|
|
|
List<Long> userIds = organizationMemberDao.queryUserIdsByOrganizationId(organizationId); |
|
|
|
// 查询当前未完成的状态
|
|
|
@ -272,17 +271,22 @@ public class QcpButtonReceive { |
|
|
|
// 封装对象
|
|
|
|
ButtonStartVo.Data data = new ButtonStartVo.Data(); |
|
|
|
data.setName(firstAidName); |
|
|
|
data.setContent(inform.getEquipmentStatus() == Constant.Equipment.ID_CARD_IDENTIFY_STATUS ? firstAidName : firstAidName + inform.getContent()); |
|
|
|
data.setContent(inform.getEquipmentStatus().equals(Constant.Equipment.ID_CARD_IDENTIFY_STATUS) ? firstAidName : firstAidName + inform.getContent()); |
|
|
|
data.setFirstAidId(firstAidId); |
|
|
|
data.setTotalCountdown(inform.getTotalCountdown()); |
|
|
|
data.setRealCountdown(System.currentTimeMillis() - inform.getTime()); |
|
|
|
if (type.equals((byte)1)){ |
|
|
|
data.setTotalCountdown(null); |
|
|
|
data.setRealCountdown(null); |
|
|
|
}else { |
|
|
|
data.setTotalCountdown(inform.getTotalCountdown()); |
|
|
|
data.setRealCountdown(System.currentTimeMillis() - inform.getTime()); |
|
|
|
} |
|
|
|
data.setTime(inform.getTime()); |
|
|
|
ButtonStartVo buttonStartVo = new ButtonStartVo(); |
|
|
|
buttonStartVo.setData(data); |
|
|
|
MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User); |
|
|
|
messageRule.setAckRule(MessageRule.AckRule.NONE); |
|
|
|
messageRule.setOfflineDiscard((byte) 1); |
|
|
|
InMessage inMessage = InMessage.newToUserMessage(null, userIdSet, null, messageRule, ""); |
|
|
|
InMessage inMessage = InMessage.newToUserMessage(null, userIdSet, null, messageRule, JacksonUtil.beanToJson(buttonStartVo)); |
|
|
|
log.info("发送消息:{}", inMessage); |
|
|
|
//发送消息
|
|
|
|
amqpTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME,JacksonUtil.beanToJson(inMessage)); |
|
|
|