package com.gkhy.exam.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.exam.common.api.CommonResult; import com.gkhy.exam.common.domain.entity.SysUser; import com.gkhy.exam.system.domain.SupplierSurePerformance; import com.gkhy.exam.system.mapper.SupplierSurePerformanceMapper; import com.gkhy.exam.system.mapper.SysUserMapper; import com.gkhy.exam.system.service.SupplierSurePerformanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class SupplierSurePerformanceServiceImpl extends ServiceImpl implements SupplierSurePerformanceService { @Autowired private SupplierSurePerformanceMapper supplierSurePerformanceMapper; @Autowired private SysUserMapper sysUserMapper; @Override public CommonResult selectPerformanceList(Integer supplierSureId) { SupplierSurePerformance supplierSurePerformance = supplierSurePerformanceMapper.selectPerformanceList(supplierSureId); String reviewUsers = supplierSurePerformance.getReviewUsers(); if (reviewUsers!=null){ String[] split = reviewUsers.split(","); StringBuffer stringBuffer = new StringBuffer(); for (String fileData : split) { SysUser sysUser = sysUserMapper.selectById(fileData); stringBuffer.append(sysUser.getName()).append(","); } if (stringBuffer.length()>0){ String string = stringBuffer.substring(0, stringBuffer.length() - 1).toString(); supplierSurePerformance.setReviewNames(string); } } return CommonResult.success(supplierSurePerformance); } @Override public CommonResult updatePerformance(SupplierSurePerformance performance) { supplierSurePerformanceMapper.updateById(performance); return CommonResult.success(); } }