| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.EnterpriseMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ReportMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Enterprise; |
| | | 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; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private ReportMapper reportMapper; |
| | | |
| | | @Resource |
| | | private EnterpriseMapper enterpriseMapper; |
| | | |
| | | /** |
| | | * 查询检验报告 |
| | | * @return |
| | |
| | | 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, Integer result) { |
| | | Report report = new Report(); |
| | | report.setId(id); |
| | | report.setApprover(name); |
| | | report.setCheckTime(new Date()); |
| | | report.setStatus(result); |
| | | reportMapper.updateById(report); |
| | | return "审核成功!"; |
| | | } |
| | | |
| | | @Override |
| | | public String delreport(Integer id) { |
| | | Report report = new Report(); |
| | | report.setId(id); |
| | | report.setState(0); |
| | | reportMapper.updateById(report); |
| | | return "删除成功!"; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getReportContext(String code) { |
| | | Map<String, Object> reportContext = reportMapper.getReportContext(code); |
| | | System.out.println("========================"); |
| | | System.out.println(reportContext); |
| | | return reportContext; |
| | | } |
| | | |
| | | @Override |
| | | public Enterprise getEnterprise() { |
| | | return enterpriseMapper.selectOne(new QueryWrapper<Enterprise>()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |