package com.xintong.visualinspection.controller.gettway;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xintong.system.err.BusinessException;
import com.xintong.visualinspection.bean.AreaInfo;
import com.xintong.visualinspection.bean.FwqCheckTask;
import com.xintong.visualinspection.bean.User;
import com.xintong.visualinspection.controller.BaseController;
import com.xintong.visualinspection.dao.master.UserDao;
import com.xintong.visualinspection.service.AreaInfoService_F;
import com.xintong.visualinspection.service.TaskService_F;
import com.xintong.visualinspection.service.UserService;
import com.xintong.visualinspection.util.AuthorUtil;
import com.xintong.visualinspection.util.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.*;

@RestController
@RequestMapping("/f/area")
public class AreaInfoController_F extends BaseController {

    @Reference(version = "1.0.0",
            application = "${dubbo.application.id}",
            registry = "${dubbo.registry.address}")
    private AreaInfoService_F areaInfoService_f;

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/getall")
    public String getall(HttpServletRequest request,@RequestBody AreaInfo areaInfo){
        Object ss = areaInfoService_f.getAllArea(areaInfo);
        Map<String,Object> u = new HashMap<String,Object>();

        User us = new User();
        us.setOrganid(29);
        List<Integer> pos = new ArrayList<>();
        pos.add(2);
        us.setPosition_ids(pos);
        u.put("checkusers",userService.getUsers(us));
        u.put("areas",ss);
        return super.returnSuccessResult(u);
    }





}
