package com.ruoyi.web.project.controller;

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

/**
 * @version : V1.0
 * @ClassName: ProjectUserinfoController
 * @Description: 项目人员信息
 * @Auther: JiangYuQi
 * @Date: 2020/7/7 18:03
 */
@RestController
@RequestMapping("/wechat/projectuserinfo")
public class ProjectUserinfoController extends BaseController {

    @Autowired
    ISurProjectUserinfoService surProjectUserinfoService;

    /**
     * 根据项目查询项目人员信息
     * @param surProjectUserinfo
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(SurProjectUserinfo surProjectUserinfo){
        return success(surProjectUserinfoService.selectProjectUnitUser(surProjectUserinfo));
    }

    /**
     * 查询项目整改人，复检人，抄送人
     * @param projectId
     * @param loginName
     * @return
     */
    @GetMapping("/queryAllProjectUserByParams")
    public AjaxResult queryAllProjectUserByParams(@RequestParam Long projectId, String loginName){
        return success(surProjectUserinfoService.queryAllProjectUserInfo(projectId,loginName));
    }
}
