package com.fs.his.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsStoreOrderLogsMapper;
import com.fs.his.domain.FsStoreOrderLogs;
import com.fs.his.service.IFsStoreOrderLogsService;

/**
 * 订单操作记录Service业务层处理
 *
 * @author fs
 * @date 2023-08-11
 */
@Service
public class FsStoreOrderLogsServiceImpl implements IFsStoreOrderLogsService
{
    @Autowired
    private FsStoreOrderLogsMapper fsStoreOrderLogsMapper;

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

    /**
     * 查询订单操作记录列表
     *
     * @param fsStoreOrderLogs 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<FsStoreOrderLogs> selectFsStoreOrderLogsList(FsStoreOrderLogs fsStoreOrderLogs)
    {
        return fsStoreOrderLogsMapper.selectFsStoreOrderLogsList(fsStoreOrderLogs);
    }

    /**
     * 新增订单操作记录
     *
     * @param fsStoreOrderLogs 订单操作记录
     * @return 结果
     */
    @Override
    public int insertFsStoreOrderLogs(FsStoreOrderLogs fsStoreOrderLogs)
    {
        return fsStoreOrderLogsMapper.insertFsStoreOrderLogs(fsStoreOrderLogs);
    }

    /**
     * 修改订单操作记录
     *
     * @param fsStoreOrderLogs 订单操作记录
     * @return 结果
     */
    @Override
    public int updateFsStoreOrderLogs(FsStoreOrderLogs fsStoreOrderLogs)
    {
        return fsStoreOrderLogsMapper.updateFsStoreOrderLogs(fsStoreOrderLogs);
    }

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

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

    @Override
    public int create(Long orderId, String type, String msg) {
        FsStoreOrderLogs logs=new FsStoreOrderLogs();
        logs.setOrderId(orderId);
        logs.setChangeType(type);
        logs.setChangeMessage(msg);
        logs.setCreateTime(new Date());
        return fsStoreOrderLogsMapper.insertFsStoreOrderLogs(logs);
    }
}
