From 3eda21a5a601c808b4e7ef7bd56535de96e3d7ed Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期三, 17 五月 2023 11:45:18 +0800
Subject: [PATCH] 添加了两个导出接口一个是选择了id的,一个是没有选择的
---
zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java
index 052b480..d805402 100644
--- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfEquipmentServiceImpl.java
@@ -58,6 +58,17 @@
return lqw;
}
+ private LambdaQueryWrapper<ZfEquipment> uniqueCondition(ZfEquipment zfEquipment) {
+ LambdaQueryWrapper<ZfEquipment> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(StringUtils.isNotEmpty(zfEquipment.getName()), ZfEquipment::getName, zfEquipment.getName());
+ lqw.eq(StringUtils.isNotEmpty(zfEquipment.getBuyer()), ZfEquipment::getBuyer, zfEquipment.getBuyer());
+ lqw.eq(StringUtils.isNotEmpty(zfEquipment.getContent()), ZfEquipment::getContent, zfEquipment.getContent());
+ lqw.eq(StringUtils.isNotEmpty(zfEquipment.getLocation()), ZfEquipment::getLocation, zfEquipment.getLocation());
+ lqw.eq(StringUtils.isNotEmpty(zfEquipment.getRemark()), ZfEquipment::getRemark, zfEquipment.getRemark());
+ lqw.eq(zfEquipment.getHappenTime() != null, ZfEquipment::getHappenTime, zfEquipment.getHappenTime());
+ return lqw;
+ }
+
//------------------------------------------------------------------------------------------
@@ -277,6 +288,13 @@
zfEquipment.setFamilyId(myFamilyId);
}
+ //鍒ゆ柇鏄惁鏈夐噸澶嶆暟鎹�
+ LambdaQueryWrapper<ZfEquipment> lqw = uniqueCondition(zfEquipment);
+ List<ZfEquipment> list = list(lqw);
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
+ }
+
if (save(zfEquipment)) {
return AjaxResult.success();
} else {
@@ -285,6 +303,8 @@
}
+
+
@Override
@Transactional
public AjaxResult importExcel(MultipartFile file) {
--
Gitblit v1.9.1