From d29cce61fb3a38f9f57a64a2a20d276b0d1254bc Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期六, 16 九月 2023 11:54:24 +0800 Subject: [PATCH] es的增加索引和查询已经写好了,可以直接调用了 --- zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 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 4015611..c9bbfa2 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 @@ -16,6 +16,7 @@ import com.ruoyi.service.IZfPropertyService; import com.ruoyi.service.ZAuthorityService; import com.ruoyi.service.ZInfoUserService; +import com.ruoyi.service.ZfLogService; import com.ruoyi.util.ArraysUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -25,6 +26,7 @@ import javax.annotation.Resource; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -48,6 +50,9 @@ @Resource ZAuthorityService zAuthorityService; + + @Resource + ZfPropertyMapper zfPropertyMapper; // private LambdaQueryWrapper<ZfProperty> buildCondition(ZfProperty zfProperty) { @@ -77,7 +82,6 @@ .in(ZfProperty::getFamilyId,familyIdList) .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime()) .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime()); - lqw.orderByDesc(ZfProperty::getCreateTime); return lqw; @@ -275,7 +279,7 @@ bean.setOwnData(0); } } - ).collect(Collectors.toList()); + ).sorted((a,b)-> b.getOwnData()-a.getOwnData()).collect(Collectors.toList()); } @Override @@ -380,6 +384,9 @@ } } + @Resource + ZfLogService zfLogService; + @Override public AjaxResult updateData(ZfProperty zfProperty) { ZInfoUser myself = zInfoUserService.getMyself(); @@ -395,6 +402,13 @@ if (dataFamilyId!=null && !familyIdList.contains(dataFamilyId)) { throw new RuntimeException("浣犳病鏈夋潈闄愭搷浣滄瀹跺涵鐨勬暟鎹�"); } + + //鎿嶄綔鍚庡姞鍏ユ棩蹇� + ZfLog zfLog = new ZfLog(); + zfLog.setUpdateTime(LocalDateTime.now()); + zfLog.setModule("瀹跺涵璧勪骇"); + zfLog.setUpdater(zInfoUserService.getMyself().getNickName()); + zfLogService.save(zfLog); if(updateById(zfProperty)){ return AjaxResult.success(); @@ -499,6 +513,12 @@ } + @Override + public AjaxResult listType() { + List<String> result = zfPropertyMapper.listType(); + return AjaxResult.success(result); + } + } -- Gitblit v1.9.1