package com.tofly.ghrq_route.module.emergencyHandle.controller;

import android.content.Context;

import com.tofly.ghrq_route.module.emergencyHandle.domain.EmergencyHandleData;
import com.tofly.ghrq_route.module.emergencyHandle.service.EmergencyServiceImpl;
import com.tofly.ghrq_route.module.emergencyHandle.service.IEmergencyService;
import com.tofly.ghrq_route.module.trouble.domain.TroubleAudioBean;
import com.tofly.ghrq_route.module.trouble.domain.TroublePictureBean;

import java.util.List;

/**
 * Created by Amu on 2017/3/8.
 */

public class EmergencyController {
    /**
     * 是否在綫
     */
    boolean mbOnline;

    /**
     * Trouble接口实现对象
     */
    IEmergencyService emergencyService;

    public EmergencyController(){
        mbOnline = true;
        emergencyService = new EmergencyServiceImpl();
    }

    public EmergencyController(boolean online){
        mbOnline = online;
        emergencyService = new EmergencyServiceImpl();
    }

    /**
     * 获取应急调度列表
     */
    public void getEmergencyList(Context context, int select_state, int work_state, String keyword, int pageindex,
                                 int pagesize, final EmergencyCallBack emergencyCallBack) {
        emergencyService.getEmergencyList(context, select_state, work_state, keyword, pageindex, pagesize, emergencyCallBack);
    }


    /**
     * 获取应急调度详情
     */
    public void getEmergencyInfo(Context context, String emergency_id, final EmergencyCallBack emergencyCallBack) {
        emergencyService.getEmergencyInfo(context, emergency_id, emergencyCallBack);
    }

    /**
     *  应急上报
     */
    public void addEmergencyNew(Context context, EmergencyHandleData handleData, List<TroublePictureBean> photos,
                                      List<TroubleAudioBean> audios, List<TroubleAudioBean> files, final EmergencyCallBack emergencyCallBack) {
        emergencyService.addEmergencyNew(context, handleData, photos, audios, files, emergencyCallBack);
    }

    /**
     *  应急调度派工到位签到
     */
    public void emergencySignOver(Context context, String emergencyId, double lng, double lat, EmergencyCallBack emergencyCallBack) {
        emergencyService.emergencySignOver(context, emergencyId, lng, lat, emergencyCallBack);
    }

    /**
     *  应急调度派工处理
     */
    public void emergencyAssignHandle(Context context, EmergencyHandleData handleData, List<TroublePictureBean> signs, List<TroublePictureBean> photos,
                                      List<TroubleAudioBean> audios, List<TroubleAudioBean> files, final EmergencyCallBack emergencyCallBack) {
        emergencyService.emergencyAssignHandle(context, handleData, signs, photos, audios, files, emergencyCallBack);
    }

    /**
     *  调度中心抢修派工
     */
    public void emergencyScheduleAssign(Context context, EmergencyHandleData handleData, final EmergencyCallBack emergencyCallBack) {
        emergencyService.emergencyScheduleAssign(context, handleData, emergencyCallBack);
    }

    /**
     *  责任人抢修派工
     */
    public void emergencyRepairAssign(Context context, EmergencyHandleData handleData,  List<TroublePictureBean> photos,
                                      List<TroubleAudioBean> audios, List<TroubleAudioBean> files, final EmergencyCallBack emergencyCallBack) {
        emergencyService.emergencyRepairAssign(context, handleData, photos, audios, files, emergencyCallBack);
    }

    /**
     *  应急调度抢修处理
     */
    public void emergencyRepairHandle(Context context, EmergencyHandleData handleData, List<TroublePictureBean> photos,
                                      List<TroubleAudioBean> audios, List<TroubleAudioBean> files, final EmergencyCallBack emergencyCallBack) {
        emergencyService.emergencyRepairHandle(context, handleData, photos, audios, files, emergencyCallBack);
    }

}
