From 9f5458b24888bd4ea007528643b25659154b912a Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期三, 17 五月 2023 09:52:30 +0800
Subject: [PATCH] 对于ZfCleanController,ZfCollectionController,ZfContactController, ZfDoctorController,ZfEconomyController,ZfEquipmentController, ZfEventController,ZfPetController,ZfPetNoteController, ZfPropertyController把对应导入模板请求修改成了post请求,另外把对应的 sheetName进行了修改
---
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
index cc75031..6fd2c53 100644
--- a/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
@@ -11,6 +11,7 @@
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZInfoUser;
+import com.ruoyi.domain.ZfEvent;
import com.ruoyi.domain.ZfProperty;
import com.ruoyi.mapper.ZfPropertyMapper;
import com.ruoyi.service.IZfPropertyService;
@@ -46,21 +47,6 @@
@Resource
ZInfoUserService zInfoUserService;
-
-
-// private Date getHappenTime(ZfProperty zfProperty) {
-// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-// String happenTimeStr = format.format(zfProperty.getHappenTime());
-//
-// Date happenTime = null;
-// try {
-// happenTime = format.parse(happenTimeStr);
-// System.out.println("鏂规硶閲岀殑:" + happenTime);
-// } catch (ParseException e) {
-// throw new RuntimeException("鏃堕棿鏍煎紡杞崲鏈夎");
-// }
-// return happenTime;
-// }
private LambdaQueryWrapper<ZfProperty> buildCondition(ZfProperty zfProperty) {
@@ -293,6 +279,13 @@
zfProperty.setFamilyId(myFamilyId);
}
+ //鍒ゆ柇鏄惁鏈夐噸澶嶆暟鎹�
+ LambdaQueryWrapper<ZfProperty> lqw = uniqueCondition(zfProperty);
+ List<ZfProperty> list = list(lqw);
+ if(list.size()>0){
+ throw new RuntimeException("璇峰嬁鏂板閲嶅鏁版嵁");
+ }
+
if (save(zfProperty)) {
return AjaxResult.success();
} else {
@@ -300,6 +293,18 @@
}
}
+ private LambdaQueryWrapper<ZfProperty> uniqueCondition(ZfProperty zfProperty) {
+ LambdaQueryWrapper<ZfProperty> lqw = new LambdaQueryWrapper<>();
+ lqw.eq(!StringUtils.isEmpty(zfProperty.getType()), ZfProperty::getType, zfProperty.getType())
+ .eq(!StringUtils.isEmpty(zfProperty.getTitle()), ZfProperty::getTitle, zfProperty.getTitle())
+ .eq(!StringUtils.isEmpty(zfProperty.getLocation()), ZfProperty::getLocation, zfProperty.getLocation())
+ .eq(!StringUtils.isEmpty(zfProperty.getHolder()), ZfProperty::getHolder, zfProperty.getHolder())
+ .eq(!StringUtils.isEmpty(zfProperty.getAddress()), ZfProperty::getAddress, zfProperty.getAddress())
+ .eq(!StringUtils.isEmpty(zfProperty.getRemark()), ZfProperty::getRemark, zfProperty.getRemark())
+ .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime());
+ return lqw;
+
+ }
@Override
@Transactional
--
Gitblit v1.9.1