package com.fs.hisStore.utils;

import com.fs.hisStore.domain.SysOperLogScrm;
import com.fs.hisStore.service.IFsHisStoreAuditLogScrmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
public class StoreAuditLogUtil {

    @Autowired
    private IFsHisStoreAuditLogScrmService hisStoreAuditLogService;

    public void addBatchAuditList(List<Long> mainIds, String reason, String attachImage) {
        hisStoreAuditLogService.addBatchAudit(mainIds, reason, attachImage);
    }
    public void addBatchAuditArray(Long[] mainIds, String reason, String attachImage) {
        //将数组转为List
        List<Long> mainIdList = Arrays.asList(mainIds);
        hisStoreAuditLogService.addBatchAudit(mainIdList, reason, attachImage);
    }

    public void addAudit(Long mainId, String reason, String attachImage) {
        hisStoreAuditLogService.addAudit(mainId, reason, attachImage);
    }

    public void addOperLog(Long mainId) {
        hisStoreAuditLogService.addAudit(mainId, null, null);
    }

    public void generateOperId() {
        hisStoreAuditLogService.generateOperId();
    }

    public List<SysOperLogScrm> selectOperLogByMainId(Long mainId) {
        return hisStoreAuditLogService.selectOperLogByMainId(mainId);
    }


}
