From bfd7201c84e250e88b9a83ba55317b16f08c7a38 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期五, 15 九月 2023 12:00:24 +0800 Subject: [PATCH] 定义了EsModel作为报错到es的数据模型,每个表要存储的是每个表的表明 表对应的主键,以及要被检索的字段 --- zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java index 3aabe7e..bd144ca 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.domain.ZProperty; import com.ruoyi.domain.ZProperty; +import com.ruoyi.domain.ZfProperty; import com.ruoyi.mapper.ZPropertyMapper; import com.ruoyi.service.ZPropertyService; import org.springframework.beans.factory.annotation.Autowired; @@ -19,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -37,6 +39,9 @@ @Autowired ZPropertyServiceImpl zPropertyService; + + @Resource + ZPropertyMapper zPropertyMapper; private LambdaQueryWrapper<ZProperty> uniqueCondition(ZProperty zProperty) { LambdaQueryWrapper<ZProperty> lqw = new LambdaQueryWrapper<>(); @@ -58,7 +63,9 @@ lqw.eq(userId != null, ZProperty::getUserId, userId) .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()) .like(StringUtils.isNotEmpty(zProperty.getIncomeName()), ZProperty::getIncomeName, zProperty.getIncomeName()) - .eq(zProperty.getIsChange()!=null,ZProperty::getIsChange,zProperty.getIsChange()) + .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()).eq(zProperty.getIsChange()!=null,ZProperty::getIsChange,zProperty.getIsChange()) + .like(StringUtils.isNotEmpty(zProperty.getRemark()), ZProperty::getRemark, zProperty.getRemark()) + .like(StringUtils.isNotEmpty(zProperty.getTimeLimit()),ZProperty::getTimeLimit,zProperty.getTimeLimit()) .between(zProperty.getHappenStartTime() != null && zProperty.getHappenEndTime() != null, ZProperty::getHappenTime, zProperty.getHappenStartTime(), zProperty.getHappenEndTime()) .orderByDesc(ZProperty::getCreateTime); return lqw; @@ -116,6 +123,21 @@ } @Override + public List<ZProperty> selectByCondition() { + SysUser user = SecurityUtils.getLoginUser().getUser(); + Long userId = user.getUserId(); + ZProperty zProperty = new ZProperty(); + LambdaQueryWrapper<ZProperty> lqw = buildCondition(zProperty, userId); + return list(lqw); + } + + @Override + public AjaxResult listType() { + List<String> result = zPropertyMapper.listType(); + return AjaxResult.success(result); + } + + @Override @Transactional public AjaxResult importExcel(MultipartFile file) { -- Gitblit v1.9.1