package com.tofly.ghrq_route.module.planPointRepair.service;

import android.content.Context;

import com.alibaba.fastjson.JSONObject;
import com.tofly.ghrq_route.base.URLResponseCode;
import com.tofly.ghrq_route.module.planPointRepair.controller.PointRepairCallBack;
import com.tofly.ghrq_route.module.planPointRepair.domain.MaintainAdjustParam;
import com.tofly.ghrq_route.module.planPointRepair.domain.MaintainCommonParam;
import com.tofly.ghrq_route.module.planPointRepair.domain.PlanPointRepair;
import com.tofly.ghrq_route.module.sqlite.DBDaoHelper;
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/6/5.
 */

public class PointRepairServiceImplOffline implements IPointRepairService {
    private Context mContext;
    private DBDaoHelper dbDaoHelper;

    public PointRepairServiceImplOffline(Context context){
        mContext = context;
        dbDaoHelper = DBDaoHelper.getInstance();
    }

    @Override
    public void addPointRepair(final String token, final PlanPointRepair pointRepair, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getPointRepairList(final String token, final int pageindex, final int pagesize, final PointRepairCallBack repairCallBack) {
        //Http post请求
    }

    @Override
    public void removePointRepair(final String token, final String repairid, boolean ischild, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void updatePointRepair(final String token, final PlanPointRepair pointRepair, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getPointRepairInfo(final String token, final String point_id, final String plan_id, final PointRepairCallBack repairCallBack) {
        PlanPointRepair repairBean = dbDaoHelper.getLocalRepairInfo(point_id);
        repairCallBack.onGetPointRepairInfo(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", repairBean);
    }

    @Override
    public void addPointChildRepair(final String token, final String child_plan_id, final PlanPointRepair pointRepair, final List<TroublePictureBean> photos, final PointRepairCallBack repairCallBack) {

    }

    /*调压设备巡检录入*/
    @Override
    public void addAdjustPressDeviceChildRepair(final Context context, final PlanPointRepair pointRepair, final List<TroublePictureBean> photos, boolean isUpdate, final PointRepairCallBack repairCallBack) {

    }

    /*阀门设备巡检录入*/
    @Override
    public void addCommonDeviceRepairRecord(final Context context, final PlanPointRepair pointRepair, final List<TroublePictureBean> photos, boolean isUpdate, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getPointChildRepairList(final String token, final String child_plan_id, final PlanPointRepair pointRepair, final int pageindex, final int pagesize, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getAdjustDeviceChildRepairList(final Context context, String user_id, final String plan_id, final String point_id, final int pageindex, final int pagesize, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getCommonDeviceChildRepairList(final Context context, String user_id, final String plan_id, final String point_id, final int pageindex, final int pagesize, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getAdjustDeviceSettingList(Context context, int pageindex, int pagesize, PointRepairCallBack repairCallBack) {
        int total = 0;
        List<MaintainAdjustParam> deviceSettings = dbDaoHelper.getAdjustDeviceSettings();
        if (deviceSettings != null)
            total = deviceSettings.size();
        repairCallBack.onGetAdjustDeviceSettingList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", deviceSettings, total);
    }

    @Override
    public void getCommonDeviceSettingList(Context context, int pageindex, int pagesize, PointRepairCallBack repairCallBack) {
        int total = 0;
        List<MaintainCommonParam> deviceSettings = dbDaoHelper.getCommonDeviceSettings();
        if (deviceSettings != null)
            total = deviceSettings.size();
        repairCallBack.onGetCommonDeviceSettingList(true, URLResponseCode.ErrorCode.SUCCESS_OFFLINE, "", deviceSettings, total);
    }

    @Override
    public void getRepairNFCInfo(final String token, final String rfid, final int device_type_id, final PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getRouteDeviceTypeList(Context context, String typeIds, int pageindex, int pagesize, PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getDeviceRouteParamList(Context context, String deviceId, int pageindex, int pagesize, PointRepairCallBack repairCallBack) {

    }

    @Override
    public void uploadDeviceRouteRecord(Context context, JSONObject jsonObject, List<TroublePictureBean> pictures, List<TroubleAudioBean> audioBeans, boolean isUpdate, PointRepairCallBack repairCallBack) {

    }

    @Override
    public void getDeviceRouteRecordList(Context context, String plan_id, String point_id, int pageindex, int pagesize, PointRepairCallBack repairCallBack) {

    }
}
