package com.tuoheng.admin.service.accident;

import com.tuoheng.admin.entity.Accident;
import com.tuoheng.admin.mapper.AccidentMapper;
import com.tuoheng.admin.query.AccidentQuery;
import com.tuoheng.admin.request.accident.*;
import com.tuoheng.admin.service.accident.ignore.AccidentIgnoreService;
import com.tuoheng.admin.service.accident.query.*;
import com.tuoheng.admin.service.accident.reoprt.ReportAccidentService;
import com.tuoheng.admin.service.accident.reoprt.ReportNoAccidentService;
import com.tuoheng.admin.service.accident.verify.AccidentVerifyCompletedService;
import com.tuoheng.admin.service.accident.verify.AccidentVerifyService;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ChengWang
 * @Date 2023/3/2
 */
@Service
@Slf4j
public class AccidentServiceImpl extends BaseServiceImpl<AccidentMapper, Accident> implements IAccidentService {

    @Autowired
    private QueryAccidentCardPageListService queryAccidentCardPageListService;

    @Autowired
    private QueryAccidentCardListService queryAccidentCardListService;

    @Autowired
    private QueryAccidentPageListService queryAccidentPageListService;

    @Autowired
    private QueryAccidentByIdService queryAccidentByIdService;

    @Autowired
    private QueryAccidentDetailsService queryAccidentDetailsService;

    @Autowired
    private AccidentNoticeService accidentNoticeService;

    @Autowired
    private AccidentTipsService accidentTipsService;

    @Autowired
    private TimeAxisService timeAxisService;

    @Autowired
    private AccidentVerifyService accidentVerifyService;

    @Autowired
    private AccidentVerifyCompletedService accidentVerifyCompletedService;

    @Autowired
    private ReportAccidentService reportAccidentService;

    @Autowired
    private ReportNoAccidentService reportNoAccidentService;

    @Autowired
    private AccidentIgnoreService accidentIgnoreService;

    @Override
    public JsonResult getAccidentCardPageList(QueryAccidentCardPageListRequest request) {
        return queryAccidentCardPageListService.getPageList(request);
    }

    @Override
    public JsonResult getAccidentCardList(QueryAccidentCardListRequest request) {
        return queryAccidentCardListService.getList(request);
    }

    @Override
    public JsonResult getAccidentInfo(String id) {
        return queryAccidentByIdService.getInfoById(id);
    }

    @Override
    public JsonResult index(AccidentQuery query) {
        return queryAccidentPageListService.index(query);
    }

    @Override
    public JsonResult accidentDetails(String id) {
        return queryAccidentDetailsService.accidentDetailsById(id);
    }

    @Override
    public JsonResult notice() {
        return accidentNoticeService.notice();
    }

    @Override
    public JsonResult getTips(String accidentId) {
        return accidentTipsService.getTips(accidentId);
    }

    @Override
    public JsonResult getTimeAxis(String accidentId) {
        return timeAxisService.getTimeAxis(accidentId);
    }

    /**
     * 事故核实
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult verify(AccidentVerifyRequest request) {
        return accidentVerifyService.verify(request);
    }

    /**
     * 事故核实完成
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult verifyCompleted(AccidentVerifyCompletedRequest request) {
        return accidentVerifyCompletedService.verifyCompleted(request);
    }

    /**
     * 事故上报
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult report(ReportAccidentRequest request) {
        return reportAccidentService.report(request);
    }

    /**
     * 无事故
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult noAccident(ReportNoAccidentRequest request) {
        return reportNoAccidentService.report(request);
    }

    /**
     * 忽略
     *
     * @param id
     * @return
     */
    @Override
    public JsonResult ignore(String id) {
        return accidentIgnoreService.ignore(id);
    }
}
