package org.jeecg.modules.stm.rate.service.impl;

import org.jeecg.modules.stm.rate.entity.RateKeyitem;
import org.jeecg.modules.stm.rate.mapper.RateKeyitemMapper;
import org.jeecg.modules.stm.rate.service.IRateKeyitemService;
import org.jeecg.modules.stm.rate.vo.RateStdOptionVo;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 评估要素
 * @Author: jeecg-boot
 * @Date:   2023-09-21
 * @Version: V1.0
 */
@Service
public class RateKeyitemServiceImpl extends ServiceImpl<RateKeyitemMapper, RateKeyitem> implements IRateKeyitemService {

    @Override
    public List<RateStdOptionVo> rateKeyItemFileList(String rateKeyitemId) {
        List<RateStdOptionVo> data = new ArrayList<>();

        RateKeyitem rateKeyitem = this.getById(rateKeyitemId);
        String filestr=rateKeyitem.getFilenamestr();
        if(filestr!=null&&!filestr.equals("")){
            String fileary[]=filestr.split(",");
            for(int i=0;i<fileary.length;i++){
                RateStdOptionVo rateStdOptionVo = new RateStdOptionVo();
                rateStdOptionVo.setLabel(fileary[i]);
                data.add(rateStdOptionVo);
            }
        }



        return data;
    }

}
