From 923af8f8eb0d849b92afa8b567036aae2837f202 Mon Sep 17 00:00:00 2001
From: Jinquan_Ou <Jinquan@gdut.com>
Date: 星期五, 21 四月 2023 16:41:00 +0800
Subject: [PATCH] 888

---
 zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 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 d1c5af7..cc75031 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
@@ -22,6 +22,9 @@
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -38,14 +41,26 @@
 @Service
 public class IZfPropertyServiceImpl extends ServiceImpl<ZfPropertyMapper, ZfProperty> implements IZfPropertyService {
 
-
-
     @Resource
     IZfPropertyService zfPropertyService;
 
     @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) {
@@ -57,7 +72,8 @@
                 .like(!StringUtils.isEmpty(zfProperty.getHolder()), ZfProperty::getHolder, zfProperty.getHolder())
                 .like(!StringUtils.isEmpty(zfProperty.getAddress()), ZfProperty::getAddress, zfProperty.getAddress())
                 .like(!StringUtils.isEmpty(zfProperty.getRemark()), ZfProperty::getRemark, zfProperty.getRemark())
-                .like(zfProperty.getCreateTime() != null, ZfProperty::getCreateTime, zfProperty.getCreateTime());
+                .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime())
+                .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime());
         return lqw;
     }
 
@@ -86,7 +102,7 @@
                     secondFamilyIdsBuffer.deleteCharAt(secondFamilyIdsBuffer.length() - 1);
                 }
 
-            }else{
+            } else {
                 setSecondFamilyAuthority(secondFamilyIdsBuffer, secondFamilyAuthority);
                 //鎶婂悗闈㈢殑閫楀彿鍘绘帀
                 if (secondFamilyIdsBuffer.length() > 1) {
@@ -140,7 +156,7 @@
 
         }
 
-        lqw.orderByDesc(ZfProperty::getId);
+        lqw.orderByDesc(ZfProperty::getCreateTime);
         return lqw;
     }
 
@@ -183,7 +199,7 @@
     }
 
     @Override
-        public List<ZfProperty> selectByCondition(ZfProperty zfProperty) {
+    public List<ZfProperty> selectByCondition(ZfProperty zfProperty) {
         String familyIds = listFamilyIds();
         String secondFamilyIds = listSecondFamilyIds();
         LambdaQueryWrapper<ZfProperty> lambdaQueryWrapper = buildCondition(zfProperty, familyIds, secondFamilyIds);
@@ -247,7 +263,7 @@
         if (flag) {
             if (save(zfProperty)) {
                 return AjaxResult.success();
-            }else {
+            } else {
                 return AjaxResult.error();
             }
 
@@ -257,33 +273,32 @@
     }
 
     @Override
-    public AjaxResult addData2(ZfProperty zfProperty){
+    public AjaxResult addData2(ZfProperty zfProperty) {
         ZInfoUser mySelf = getMySelf();
         String myFamilyId = mySelf.getFamilyId();
 
-        if (StringUtils.isNotEmpty(zfProperty.getFamilyId())){
+        if (StringUtils.isNotEmpty(zfProperty.getFamilyId())) {
             throw new RuntimeException("瀵煎叆鏁版嵁鏃舵偍涓嶈兘鎸囧畾瀹跺涵鍙�");
         }
 
-        if(StringUtils.isEmpty(myFamilyId)){
+        if (StringUtils.isEmpty(myFamilyId)) {
             throw new RuntimeException("鎮ㄨ繕鏈姞鍏ヤ换浣曞搴�");
         }
 
-        if (myFamilyId.contains(",")){
+        if (myFamilyId.contains(",")) {
             String[] myFamilyIds = myFamilyId.split(",");
             //榛樿娣诲姞绗竴涓搴殑鏁版嵁
             zfProperty.setFamilyId(myFamilyIds[0]);
-        }else {
+        } else {
             zfProperty.setFamilyId(myFamilyId);
         }
 
         if (save(zfProperty)) {
             return AjaxResult.success();
-        }else {
+        } else {
             return AjaxResult.error();
         }
     }
-
 
 
     @Override

--
Gitblit v1.9.1