package com.bonus.sgzb.common.log.service;

import com.bonus.sgzb.base.api.domain.BmStorageLog;
import com.bonus.sgzb.system.api.domain.BmNumLogs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.bonus.sgzb.common.core.constant.SecurityConstants;
import com.bonus.sgzb.system.api.RemoteLogService;
import com.bonus.sgzb.system.api.domain.SysOperLog;

import java.util.List;

/**
 * 异步调用日志服务
 * 
 * @author ruoyi
 */
@Service
public class AsyncLogService
{
    @Autowired
    private RemoteLogService remoteLogService;

    /**
     * 保存系统日志记录
     */
    @Async
    public void saveSysLog(SysOperLog sysOperLog) throws Exception
    {
        remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
    }

    /**
     * 保存物资日志记录
     */
    @Async
    public void saveNumLog(BmNumLogs bmNumLogsLog) throws Exception {
        remoteLogService.saveNumberLog(bmNumLogsLog, SecurityConstants.INNER);
    }

    @Async
    public void batchInsert(List<BmStorageLog> bmStorageLogList) throws Exception {
        remoteLogService.batchInsert(bmStorageLogList, SecurityConstants.INNER);
    }
}
