package com.fs.user.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.user.domain.param.FsUserComplaintParam;
import com.fs.user.domain.vo.FsUserComplaintVo;
import org.springframework.stereotype.Service;
import com.fs.user.mapper.FsUserComplaintMapper;
import com.fs.user.domain.FsUserComplaint;
import com.fs.user.service.IFsUserComplaintService;

/**
 * 用户投诉Service业务层处理
 *
 * @author fs
 * @date 2025-08-27
 */
@Service
public class FsUserComplaintServiceImpl extends ServiceImpl<FsUserComplaintMapper, FsUserComplaint> implements IFsUserComplaintService {

    /**
     * 查询用户投诉
     *
     * @param id 用户投诉主键
     * @return 用户投诉
     */
    @Override
    public FsUserComplaintVo selectFsUserComplaintVoById(Long id)
    {
        return baseMapper.selectFsUserComplaintVoById(id);
    }

    /**
     * 查询用户投诉列表
     *
     * @param fsUserComplaint 用户投诉
     * @return 用户投诉
     */
    @Override
    public List<FsUserComplaint> selectFsUserComplaintList(FsUserComplaint fsUserComplaint)
    {
        return baseMapper.selectFsUserComplaintList(fsUserComplaint);
    }

    /**
     * 查询用户投诉列表
     *
     * @param param 用户投诉
     * @return 用户投诉
     */
    @Override
    public List<FsUserComplaintVo> selectFsUserComplaintVoList(FsUserComplaintParam param)
    {
        return baseMapper.selectFsUserComplaintVoList(param);
    }

    /**
     * 新增用户投诉
     *
     * @param fsUserComplaint 用户投诉
     * @return 结果
     */
    @Override
    public int insertFsUserComplaint(FsUserComplaint fsUserComplaint)
    {
        fsUserComplaint.setIsHandleStore(0);
        fsUserComplaint.setIsHandlePlatform(0);
        fsUserComplaint.setIsReadUser(0);
        fsUserComplaint.setIsReadStore(1);
        fsUserComplaint.setIsReadPlatform(1);
        fsUserComplaint.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertFsUserComplaint(fsUserComplaint);
    }

    /**
     * 修改用户投诉
     *
     * @param fsUserComplaint 用户投诉
     * @return 结果
     */
    @Override
    public int updateFsUserComplaint(FsUserComplaint fsUserComplaint)
    {
        fsUserComplaint.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateFsUserComplaint(fsUserComplaint);
    }

    /**
     * 批量删除用户投诉
     *
     * @param ids 需要删除的用户投诉主键
     * @return 结果
     */
    @Override
    public int deleteFsUserComplaintByIds(Long[] ids)
    {
        return baseMapper.deleteFsUserComplaintByIds(ids);
    }

    /**
     * 删除用户投诉信息
     *
     * @param id 用户投诉主键
     * @return 结果
     */
    @Override
    public int deleteFsUserComplaintById(Long id)
    {
        return baseMapper.deleteFsUserComplaintById(id);
    }
}
