From 8f0fea34594bb5da8c4fb804a7f9f5cb2698c141 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期四, 10 七月 2025 14:40:13 +0800
Subject: [PATCH] art: 技术状态鉴定-字段修改

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
index 3cd996f..6398882 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
@@ -1,5 +1,6 @@
 package org.jeecg.modules.eam.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,11 +11,15 @@
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.constant.DataBaseConstant;
+import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.eam.constant.EamTechnicalStatusEvaluationOrderEnum;
+import org.jeecg.modules.eam.entity.EamEquipment;
 import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrder;
 import org.jeecg.modules.eam.mapper.EamTechnicalStatusEvaluationOrderMapper;
 import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderQuery;
+import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderRequest;
 import org.jeecg.modules.eam.service.IEamEquipmentService;
 import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderDetailService;
 import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderService;
@@ -25,6 +30,7 @@
 import org.jeecg.modules.system.service.ISysBusinessCodeRuleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Arrays;
 import java.util.List;
@@ -113,4 +119,35 @@
         queryWrapper.orderByDesc("ems.create_time");
         return this.getBaseMapper().queryPageList(page, queryWrapper);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addTechnicalStatusEvaluationOrder(EamTechnicalStatusEvaluationOrderRequest request) {
+        EamEquipment equipment = equipmentService.getById(request.getEquipmentId());
+        if (equipment == null) {
+            throw new JeecgBootException("璁惧涓嶅瓨鍦紝娣诲姞澶辫触锛�");
+        }
+        EamTechnicalStatusEvaluationOrder order = new EamTechnicalStatusEvaluationOrder();
+        order.setOrderNum(request.getOrderNum());
+        order.setEquipmentId(request.getEquipmentId());
+        order.setStandardId(request.getStandardId());
+        order.setEvaluationDate(request.getEvaluationDate());
+        order.setEvaluator(request.getEvaluator());
+        order.setRemark(request.getRemark());
+        //鐘舵�佸垵濮嬪寲
+        order.setEvaluationStatus(EamTechnicalStatusEvaluationOrderEnum.WAIT_EVALUATION.name());
+        order.setCreationMethod(request.getCreationMethod());
+        //鍒犻櫎鏍囪
+        order.setDelFlag(CommonConstant.DEL_FLAG_0);
+        this.getBaseMapper().insert(order);
+        //澶勭悊鏄庣粏鏁版嵁
+        if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
+            request.getTableDetailList().forEach(tableDetail -> {
+                tableDetail.setId(null);
+                tableDetail.setOrderId(order.getId());
+            });
+            orderDetailService.saveBatch(request.getTableDetailList());
+        }
+        return true;
+    }
 }

--
Gitblit v1.9.3