From 0b977fb16e8272739bbe25973947f45a55ebe842 Mon Sep 17 00:00:00 2001
From: 唐耀东 <18861537@qq.com>
Date: 星期五, 31 十二月 2021 11:30:49 +0800
Subject: [PATCH] 提交代码

---
 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java
index 4bfe12a..5133b28 100644
--- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java
+++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java
@@ -4,6 +4,7 @@
 import cn.hutool.http.HttpStatus;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.core.page.PagePlus;
@@ -123,14 +124,14 @@
         DevEquipment po = baseMapper.selectOne(new QueryWrapper<DevEquipment>().lambda()
             .eq(DevEquipment::getSequenceCode, bo.getSequenceCode()));
         // 璁惧瀛樺湪锛岀洿鎺ヨ繑鍥炶澶囦俊鎭�
-        if (StringUtils.isEmpty(po)) {
+        if (StringUtils.isNotEmpty(po)) {
             return po;
         }
         // 璁惧涓嶅瓨鍦ㄥ垯鏂板缓
         else {
             // 鍏堟牴鎹簭鍒楃爜鐢熸垚搴忓垪鍙�
             DevEquipmentCode c = new DevEquipmentCode();
-            c.setSequenceCode(bo.getSequenceCode());
+            c.setCreateTime(DateUtils.getNowDate());
             devEquipmentCodeMapper.insert(c);
             // 娣诲姞璁惧
             DevEquipment add = BeanUtil.toBean(bo, DevEquipment.class);
@@ -141,27 +142,47 @@
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public DevEquipment equipmentEdit(DevEquipmentBo bo) {
         DevEquipment po = baseMapper.selectById(bo.getId());
+        if (po == null) {
+            throw new ServiceException("娌℃湁璁惧淇℃伅", HttpStatus.HTTP_PARTIAL);
+        }
         if (null != bo.getSchoolId()) {
             po.setSchoolId(bo.getSchoolId());
         }
-        if (StringUtils.isEmpty(bo.getHostId())) {
+        if (StringUtils.isNotBlank(bo.getHostId())) {
             po.setHostId(bo.getHostId());
         }
-        if (StringUtils.isEmpty(bo.getNetworkId())) {
-            po.setNetworkId(bo.getNetworkId());
-        }
-        if (StringUtils.isEmpty(bo.getFrequencyBand())) {
-            po.setFrequencyBand(bo.getFrequencyBand());
+//        if (StringUtils.isEmpty(bo.getNetworkId())) {
+//            po.setNetworkId(bo.getNetworkId());
+//        }
+//        if (StringUtils.isEmpty(bo.getFrequencyBand())) {
+//            po.setFrequencyBand(bo.getFrequencyBand());
+//        }
+//        if (null != bo.getBatchId()) {
+//            po.setBatchId(bo.getBatchId());
+//        }
+//        if (StringUtils.isEmpty(bo.getRemarks())) {
+//            po.setRemarks(bo.getRemarks());
+//        }
+        baseMapper.updateById(po);
+        return po;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void submitComment(DevEquipmentBo bo) {
+        DevEquipment po = baseMapper.selectById(bo.getId());
+        if (po == null) {
+            throw new ServiceException("娌℃湁璁惧淇℃伅", HttpStatus.HTTP_PARTIAL);
         }
         if (null != bo.getBatchId()) {
             po.setBatchId(bo.getBatchId());
         }
-        if (StringUtils.isEmpty(bo.getRemarks())) {
+        if (StringUtils.isNotBlank(bo.getRemarks())) {
             po.setRemarks(bo.getRemarks());
         }
         baseMapper.updateById(po);
-        return po;
     }
 }

--
Gitblit v1.9.1