package com.ruoyi.web.project.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.project.service.WxIProjectInfoService;
import com.yanzhu.jh.project.service.ISurProjectUserinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @version : V1.0
 * @ClassName: ProjectProblemmodifyController
 * @Description: 项目问题修改
 * @Auther: JiangYuQi
 * @Date: 2020/7/7 18:03
 */
@RestController
@RequestMapping("/wechat/project")
public class ProjectController extends BaseController {

    @Autowired
    WxIProjectInfoService IProjectInfoService;

    /**
     * Methods
     * @describe 描述：查询项目的基本信息
     * @author 作者：Makalu
     * @date 时间：2020/7/8 9:16
     * @version 版本： V1.0
     * @param id：String
     * @return 返回值：
     * @throws Exception 异常：
     */
    @RequestMapping("/getProjectFoundation")
    public Map<String, Object> getProjectFoundation(@RequestParam String id) {
        return IProjectInfoService.getProjectBasicInfo(id);
    }

    /***
     * 查询下一级组织架构信息
     * @param param
     * @return
     */
    @RequestMapping("/selectDeptSubordinate")
    public Object selectDeptSubordinate(@RequestParam Map<String,Object> param){
        return IProjectInfoService.selectDeptSubordinate(param);
    }

    /**
     * @describe 根据公司获取项目的列表
     */
    @RequestMapping("/selectProjectByCompanyId")
    public Object selectProjectByCompanyId(@RequestParam Map<String,Object> map) {
        return IProjectInfoService.getProjectByDeptIdAndCompanyId(map);
    }

    /**
     * 获取建设单位
     * @param projectId
     * @return
     */
    @RequestMapping("/getProjectUnitList")
    public Object getProjectUnitList(String projectId){
        return IProjectInfoService.getProjectUnitList(projectId);
    }

    /***
     * 模糊查询出项目信息
     * @param map
     * @return
     */
    @RequestMapping("selectProjectInfoByName")
    public AjaxResult selectProjectInfoByName(@RequestParam Map<String,Object> map){
        return success(IProjectInfoService.getProjectByDeptIdAndCompanyId(map));
    }
}
