package com.fs.live.service.impl;

import java.util.Collections;
import java.util.Date;
import java.util.List;

import com.fs.store.domain.FsStoreOrderStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.live.mapper.LiveOrderLogsMapper;
import com.fs.live.domain.LiveOrderLogs;
import com.fs.live.service.ILiveOrderLogsService;

/**
 * 订单操作记录Service业务层处理
 *
 * @author fs
 * @date 2025-07-08
 */
@Service
public class LiveOrderLogsServiceImpl implements ILiveOrderLogsService {
    @Autowired
    private LiveOrderLogsMapper baseMapper;

    /**
     * 查询订单操作记录
     *
     * @param logsId 订单操作记录主键
     * @return 订单操作记录
     */
    @Override
    public LiveOrderLogs selectLiveOrderLogsByLogsId(String logsId)
    {
        return baseMapper.selectLiveOrderLogsByLogsId(logsId);
    }

    /**
     * 查询订单操作记录列表
     *
     * @param liveOrderLogs 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<LiveOrderLogs> selectLiveOrderLogsList(LiveOrderLogs liveOrderLogs)
    {
        return baseMapper.selectLiveOrderLogsList(liveOrderLogs);
    }

    /**
     * 新增订单操作记录
     *
     * @param liveOrderLogs 订单操作记录
     * @return 结果
     */
    @Override
    public int insertLiveOrderLogs(LiveOrderLogs liveOrderLogs)
    {
        return baseMapper.insertLiveOrderLogs(liveOrderLogs);
    }

    /**
     * 修改订单操作记录
     *
     * @param liveOrderLogs 订单操作记录
     * @return 结果
     */
    @Override
    public int updateLiveOrderLogs(LiveOrderLogs liveOrderLogs)
    {
        return baseMapper.updateLiveOrderLogs(liveOrderLogs);
    }

    /**
     * 批量删除订单操作记录
     *
     * @param logsIds 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderLogsByLogsIds(String[] logsIds)
    {
        return baseMapper.deleteLiveOrderLogsByLogsIds(logsIds);
    }

    /**
     * 删除订单操作记录信息
     *
     * @param logsId 订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderLogsByLogsId(String logsId)
    {
        return baseMapper.deleteLiveOrderLogsByLogsId(logsId);
    }

    @Override
    public int create(Long orderId, String value, String desc) {
        LiveOrderLogs liveOrderLogs = new LiveOrderLogs();
        liveOrderLogs.setOrderId(String.valueOf(orderId));
        liveOrderLogs.setChangeType(value);
        liveOrderLogs.setChangeMessage(desc);
        liveOrderLogs.setChangeTime(new Date());
        return baseMapper.insertLiveOrderLogs(liveOrderLogs);
    }

    @Override
    public List<LiveOrderLogs> selectLiveOrderLogsByOrderId(Long orderId) {
        return baseMapper.selectLiveOrderLogsByOrderId(orderId);
    }
}
