| | |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | import com.yuanchu.limslaboratory.service.ReportService; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.utils.ServletUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ReportVo> selectAllReport(Page<Object> page, Integer status, String name) { |
| | | return reportMapper.selectAllReport(page, status, name); |
| | | public IPage<ReportVo> selectAllReport(Page<Object> page, Integer status, String name,boolean checked) { |
| | | Object obj = RedisUtil.get(ServletUtils.getRequest().getHeader("X-Token")); |
| | | Integer id=null; |
| | | if(checked&&!ObjectUtils.isEmpty(obj)){ |
| | | Map loginUser = (Map) obj; |
| | | id=Integer.parseInt(String.valueOf(loginUser.get("id"))); |
| | | } |
| | | return reportMapper.selectAllReport(page, status, name,id,checked); |
| | | } |
| | | |
| | | //提交 |
| | |
| | | |
| | | //审核 |
| | | @Override |
| | | public String check(String name, Integer id, String result) { |
| | | public String check(String name, Integer id, Integer 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); |
| | | } |
| | | report.setStatus(result); |
| | | reportMapper.updateById(report); |
| | | return "审核成功!"; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> getReportContext(String code) { |
| | | return reportMapper.getReportContext(code); |
| | | Map<String, Object> reportContext = reportMapper.getReportContext(code); |
| | | System.out.println("========================"); |
| | | System.out.println(reportContext); |
| | | return reportContext; |
| | | } |
| | | |
| | | @Override |