zss
2023-08-21 82fbcce60ae86965441ae045df1f864d10005d35
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.yuanchu.limslaboratory.service.impl;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.mapper.ReportMapper;
import com.yuanchu.limslaboratory.pojo.Report;
import com.yuanchu.limslaboratory.pojo.vo.ReportVo;
import com.yuanchu.limslaboratory.service.ReportService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
 
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2023-08-07
 */
@Service
public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportService {
 
    @Resource
    private ReportMapper reportMapper;
 
    /**
     * 查询检验报告
     * @return
     */
    @Override
    public IPage<ReportVo> selectAllReport(Page<Object> page, Integer status, String name) {
        return reportMapper.selectAllReport(page, status, name);
    }
 
    //提交
    @Override
    public String submit(Integer id) {
        Report report = new Report();
        report.setId(id);
        report.setStatus(1);
        reportMapper.updateById(report);
        return "提交成功!";
    }
 
    //审核
    @Override
    public String check(String name, Integer id, String result) {
        Report report = new Report();
        report.setId(id);
        report.setApprover(name);
        report.setCheckTime(new Date());
        if (result.equals("通过")){
            report.setStatus(2);
        }else if (result.equals("不通过")){
            report.setStatus(3);
        }
        reportMapper.updateById(report);
        return "审核成功!";
    }
 
    @Override
    public String delreport(Integer id) {
        Report report = new Report();
        report.setId(id);
        report.setState(0);
        reportMapper.updateById(report);
        return "删除成功!";
    }
 
}