From c219f11b51903d5aeb4c7ca261df593597aa7fe2 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 16 四月 2024 17:59:54 +0800
Subject: [PATCH] 人员明细+报告编制的提交审核批准+能力范围的下拉数据字典

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java |   71 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
index a7294cf..4195719 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -1,6 +1,7 @@
 package com.yuanchu.mom.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -12,6 +13,7 @@
 import com.yuanchu.mom.dto.ReportPageDto;
 import com.yuanchu.mom.dto.SampleOrderDto;
 import com.yuanchu.mom.exception.ErrorException;
+import com.yuanchu.mom.mapper.UserMapper;
 import com.yuanchu.mom.pojo.InsReport;
 import com.yuanchu.mom.service.InsReportService;
 import com.yuanchu.mom.mapper.InsReportMapper;
@@ -24,6 +26,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -38,6 +41,9 @@
 
     @Resource
     private GetLook getLook;
+
+    @Resource
+    private UserMapper userMapper;
 
     @Resource
     private InsReportMapper insReportMapper;
@@ -79,6 +85,71 @@
     public int upReportUrl(Integer id) {
         return insReportMapper.update(null, Wrappers.<InsReport>lambdaUpdate().eq(InsReport::getId, id).set(InsReport::getUrlS, null));
     }
+
+    //鎻愪氦
+    @Override
+    public int writeReport(Integer id) {
+        InsReport insReport = insReportMapper.selectById(id);
+        insReport.setId(id);
+        insReport.setState(1);
+        insReport.setWriteUserId(getLook.selectPowerByMethodAndUserId(null).get("userId"));//鎻愪氦浜�
+        insReport.setWriteTime(LocalDateTime.now());//鎻愪氦鏃堕棿
+        //鑾峰彇鎻愪氦浜虹殑绛惧悕鍦板潃
+        String signatureUrl = userMapper.selectById(insReport.getWriteUserId()).getSignatureUrl();
+        //绯荤粺鐢熸垚鎶ュ憡鍦板潃
+        String url = insReport.getUrl();
+        //鎵嬪姩涓婁紶鎶ュ憡鍦板潃
+        String urlS = insReport.getUrlS();
+        return insReportMapper.updateById(insReport);
+    }
+
+    //瀹℃牳
+    @Override
+    public int examineReport(Integer id, Integer isExamine, String examineTell) {
+        InsReport insReport = insReportMapper.selectById(id);
+        insReport.setIsExamine(isExamine);
+        if (ObjectUtils.isNotEmpty(examineTell)) {
+            insReport.setExamineTell(examineTell);
+        }
+        insReport.setExamineUserId(getLook.selectPowerByMethodAndUserId(null).get("userId"));//瀹℃牳浜�
+        insReport.setExamineTime(LocalDateTime.now());//瀹℃牳鏃堕棿
+        if (isExamine==0){
+            //濡傛灉瀹℃牳涓嶉�氳繃
+            insReport.setState(0);//鎻愪氦鐘舵�佹敼涓哄緟鎻愪氦
+        }
+        //鑾峰彇瀹℃牳浜虹殑绛惧悕鍦板潃
+        String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl();
+        //绯荤粺鐢熸垚鎶ュ憡鍦板潃
+        String url = insReport.getUrl();
+        //鎵嬪姩涓婁紶鎶ュ憡鍦板潃
+        String urlS = insReport.getUrlS();
+
+        return insReportMapper.updateById(insReport);
+    }
+
+    //鎵瑰噯
+    @Override
+    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) {
+        InsReport insReport = insReportMapper.selectById(id);
+        insReport.setIsRatify(isRatify);
+        if (ObjectUtils.isNotEmpty(ratifyTell)) {
+            insReport.setRatifyTell(ratifyTell);
+        }
+        insReport.setRatifyUserId(getLook.selectPowerByMethodAndUserId(null).get("userId"));//鎵瑰噯浜�
+        insReport.setRatifyTime(LocalDateTime.now());//鎵瑰噯鏃堕棿
+        if (isRatify==0){
+            //濡傛灉鎵瑰噯涓嶉�氳繃
+            insReport.setState(0);//鎻愪氦鐘舵�佹敼涓哄緟鎻愪氦
+        }
+        //鑾峰彇瀹℃牳浜虹殑绛惧悕鍦板潃
+        String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl();
+        //绯荤粺鐢熸垚鎶ュ憡鍦板潃
+        String url = insReport.getUrl();
+        //鎵嬪姩涓婁紶鎶ュ憡鍦板潃
+        String urlS = insReport.getUrlS();
+
+        return insReportMapper.updateById(insReport);
+    }
 }
 
 

--
Gitblit v1.9.3