package com.zcloud.personnel.positioning.service;

import com.zcloud.personnel.positioning.api.AlarmRecordServiceI;
import com.zcloud.personnel.positioning.command.AlarmRecordAddExe;
import com.zcloud.personnel.positioning.command.AlarmRecordRemoveExe;
import com.zcloud.personnel.positioning.command.AlarmRecordUpdateExe;
import com.zcloud.personnel.positioning.command.query.AlarmRecordQueryExe;
import com.zcloud.personnel.positioning.dto.AlarmRecordAddCmd;
import com.zcloud.personnel.positioning.dto.AlarmRecordBiAlarmTypeQry;
import com.zcloud.personnel.positioning.dto.AlarmRecordBiQry;
import com.zcloud.personnel.positioning.dto.AlarmRecordPageQry;
import com.zcloud.personnel.positioning.dto.AlarmRecordUpdateCmd;
import com.zcloud.personnel.positioning.dto.clientobject.AlarmRecordCO;
import com.zcloud.personnel.positioning.dto.clientobject.AlarmTypeStatCO;
import com.zcloud.personnel.positioning.dto.clientobject.OptionCO;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-app
 *
 * @Author fangjiakai
 * @Date 2026-07-07
 */
@Service
@AllArgsConstructor
public class AlarmRecordServiceImpl implements AlarmRecordServiceI {
    private final AlarmRecordAddExe alarmRecordAddExe;
    private final AlarmRecordUpdateExe alarmRecordUpdateExe;
    private final AlarmRecordRemoveExe alarmRecordRemoveExe;
    private final AlarmRecordQueryExe alarmRecordQueryExe;

    @Override
    public PageResponse<AlarmRecordCO> listPage(AlarmRecordPageQry qry) {
        return alarmRecordQueryExe.execute(qry);
    }

    @Override
    public List<AlarmRecordCO> listBiAlarm(AlarmRecordBiQry qry) {
        return alarmRecordQueryExe.listBiAlarm(qry);
    }

    @Override
    public List<AlarmTypeStatCO> listBiAlarmType(AlarmRecordBiAlarmTypeQry qry) {
        return alarmRecordQueryExe.listBiAlarmType(qry);
    }

    @Override
    public List<AlarmRecordCO> listAll() {
        return alarmRecordQueryExe.listAll();
    }

    @Override
    public AlarmRecordCO queryById(Long id) {
        return alarmRecordQueryExe.queryById(id);
    }

    @Override
    public List<OptionCO> listCompanyOptions() {
        return alarmRecordQueryExe.listCompanyOptions();
    }

    @Override
    public List<OptionCO> listAlarmTypeOptions() {
        return alarmRecordQueryExe.listAlarmTypeOptions();
    }

    @Override
    public SingleResponse<AlarmRecordCO> add(AlarmRecordAddCmd cmd) {
        alarmRecordAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(AlarmRecordUpdateCmd cmd) {
        alarmRecordUpdateExe.execute(cmd);
    }

    @Override
    public void remove(Long id) {
        alarmRecordRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        alarmRecordRemoveExe.execute(ids);
    }
}
