package com.ann.demo.service.impl;

import com.ann.demo.entity.interfaceEntity.MessageLog;
import com.ann.demo.repository.MessageRepository;
import com.ann.demo.service.MessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Date 2019/7/9 10:24
 * @Created by  ljx
 */
@Service
public class MessageServiceImpl implements MessageService {

    static final Logger logger = LoggerFactory.getLogger(MessageServiceImpl.class);

    @Autowired
    MessageRepository messageRepository;

    @Override
    public void save(MessageLog log) {
        //打日志信息
        try {
            messageRepository.save(log);
            //-------------------------打出来的日志 需改善
        } catch (Exception e) {
            logger.error("出错咯！保存消息内容错误信息:" + e);
        }
    }

    public String getArchiveMasterId(String inpNo,String visitId,String patientId) {
        return  messageRepository.getArchiveMasterId(inpNo, visitId,patientId);
    }

    public String getArchiveMasterId(String inpNo,String patientId) {
        return  messageRepository.getArchiveMasterId(inpNo,patientId);
    }

}
