zss
2023-08-21 82fbcce60ae86965441ae045df1f864d10005d35
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java
@@ -7,10 +7,9 @@
import com.yuanchu.limslaboratory.pojo.Report;
import com.yuanchu.limslaboratory.pojo.vo.ReportVo;
import com.yuanchu.limslaboratory.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
 * <p>
@@ -35,5 +34,40 @@
        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 "删除成功!";
    }
}