“djh”
2 天以前 8c91afa9c1bbe5fae9d88cfd1e7243c376af69fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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<SupplierSurePerformanceMapper, SupplierSurePerformance> 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();
    }
}