From a92b6f6175b1401071e5fb3bd9fab8a2a3b72011 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 01 九月 2023 14:34:28 +0800
Subject: [PATCH] version
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java
index 2673b2c..f65dcc2 100644
--- a/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java
+++ b/inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ReportServiceImpl.java
@@ -1,14 +1,20 @@
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>
@@ -21,8 +27,11 @@
@Service
public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportService {
- @Autowired
+ @Resource
private ReportMapper reportMapper;
+
+ @Resource
+ private EnterpriseMapper enterpriseMapper;
/**
* 鏌ヨ妫�楠屾姤鍛�
@@ -33,5 +42,51 @@
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 "鍒犻櫎鎴愬姛!";
+ }
+
+ @Override
+ public Map<String, Object> getReportContext(String code) {
+ return reportMapper.getReportContext(code);
+ }
+
+ @Override
+ public Enterprise getEnterprise() {
+ return enterpriseMapper.selectOne(new QueryWrapper<Enterprise>());
+ }
+
+
}
--
Gitblit v1.9.3