package com.ankaibei.workFlow.webadmin.ankaibei.api;

import com.ankaibei.workFlow.webadmin.ankaibei.entity.ProjectInfoEntity;
import com.ankaibei.workFlow.webadmin.ankaibei.service.ProjectInfoService;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.ProjectInfoVo;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.ResMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lwq
 * @version 1.0
 * @description:
 * @date 2022/9/14 11:11
 */
@Service
public class ProjectInfoServiceApi implements ProjectInfoApi {

    @Autowired
    private ProjectInfoService projectInfoService;

    @Override
    public ResMsg findProjectInfo(ProjectInfoVo projectInfoVo) {
        ProjectInfoEntity projectInfoEntity = this.copyProperties(projectInfoVo, ProjectInfoEntity.class);
        return projectInfoService.findProjectInfo(projectInfoVo.getPageIndex(), projectInfoVo.getPageSize(), projectInfoEntity);
    }

    @Override
    public ResMsg findProjectInfoAll(String projectName) {
        return projectInfoService.findProjectInfoAll(projectName);
    }

    @Override
    public ResMsg findProjectParticulars(ProjectInfoVo projectInfoVo) {
        ProjectInfoEntity projectInfoEntity = this.copyProperties(projectInfoVo, ProjectInfoEntity.class);
        return projectInfoService.findProjectParticulars(projectInfoEntity);
    }

    @Override
    public ResMsg addProject(ProjectInfoVo projectInfoVo) {
        ProjectInfoEntity projectInfoEntity = this.copyProperties(projectInfoVo, ProjectInfoEntity.class);
        return projectInfoService.addProject(projectInfoEntity);
    }

    @Override
    public ResMsg updateProject(ProjectInfoVo projectInfoVo) {
        ProjectInfoEntity projectInfoEntity = this.copyProperties(projectInfoVo, ProjectInfoEntity.class);
        return projectInfoService.updateProject(projectInfoEntity);
    }

    @Override
    public ResMsg findPrincipalProject(String userId) {

        return projectInfoService.findPrincipalProject(userId);
    }

    @Override
    public ResMsg findAccesoryInfo(ProjectInfoVo projectInfoVo) {
        ProjectInfoEntity projectInfoEntity = this.copyProperties(projectInfoVo, ProjectInfoEntity.class);
        return projectInfoService.findAccesoryInfo(projectInfoEntity);
    }

    @Override
    public ResMsg findProjectNumber() {

        return projectInfoService.findProjectNumber();
    }

    @Override
    public ResMsg substepOfProjectNum() {
        return projectInfoService.substepOfProjectNum();
    }

    @Override
    public ResMsg findLastMonthProjectNumber() {
        return projectInfoService.findLastMonthProjectNumber();
    }

    @Override
    public ResMsg substepOfProjectNumAtLastMonth() {
        return projectInfoService.substepOfProjectNumAtLastMonth();
    }

    @Override
    public ResMsg deleteProjects(List<ProjectInfoVo> projectInfoVos) {
        return projectInfoService.deleteProjects(projectInfoVos);
    }
}
