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

import com.ankaibei.workFlow.webadmin.ankaibei.entity.CostInfoEntity;
import com.ankaibei.workFlow.webadmin.ankaibei.service.CostInfoService;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.CostInfoVo;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.ResMsg;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.UserInfoVo;
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/26 14:45
 */
@Service
public class CostInFoServiceApi implements CostInFoApi {

    @Autowired
    private CostInfoService costInfoService;


    @Override
    public ResMsg findCostInfoAll(CostInfoVo costInfoVo) {
        CostInfoEntity costInfoEntity = this.copyProperties(costInfoVo, CostInfoEntity.class);

        return costInfoService.findCostInfoAll(costInfoEntity, costInfoVo.getPageIndex(), costInfoVo.getPageSize());
    }

    @Override
    public boolean deleteCostInfo(List<CostInfoVo> costInfoVoVos) {
        List<CostInfoEntity> costInfoEntities = this.copyProperties(costInfoVoVos, CostInfoEntity.class);
        return costInfoService.deleteCostInfo(costInfoEntities);
    }

    @Override
    public ResMsg updateCostInfo(CostInfoVo costInfoVo) {
        CostInfoEntity costInfoEntity = this.copyProperties(costInfoVo, CostInfoEntity.class);

        return costInfoService.updateCostInfo(costInfoEntity);
    }

    @Override
    public ResMsg findCostInfoDetails(CostInfoVo costInfoVo) {
        CostInfoEntity costInfoEntity = this.copyProperties(costInfoVo, CostInfoEntity.class);

        return costInfoService.findCostInfoDetails(costInfoEntity);
    }

    @Override
    public ResMsg findProjectAuditList(String id, UserInfoVo userInfoVo) {

        return costInfoService.findProjectAuditList(id, userInfoVo);
    }

}
