From 458bed025c92c45ce7cfca3e685b9cb9548c61d3 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期一, 06 十月 2025 08:54:53 +0800
Subject: [PATCH] 提交证书
---
zhang-content/src/main/java/com/ruoyi/service/impl/ZPropertyServiceImpl.java | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 43 insertions(+), 4 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 ab72019..06ebf8c 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
@@ -10,20 +10,23 @@
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.domain.ZHonor;
+import com.ruoyi.domain.ZInfoUser;
import com.ruoyi.domain.ZProperty;
-import com.ruoyi.domain.ZProperty;
-import com.ruoyi.domain.ZfProperty;
import com.ruoyi.mapper.ZPropertyMapper;
+import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZPropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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;
import java.util.List;
+import java.util.stream.Collectors;
/**
* <p>
@@ -38,6 +41,10 @@
@Autowired
ZPropertyServiceImpl zPropertyService;
+ @Autowired
+ ZInfoUserService zInfoUserService;
+ @Resource
+ ZPropertyMapper zPropertyMapper;
private LambdaQueryWrapper<ZProperty> uniqueCondition(ZProperty zProperty) {
LambdaQueryWrapper<ZProperty> lqw = new LambdaQueryWrapper<>();
@@ -59,8 +66,25 @@
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())
+ .like(StringUtils.isNotEmpty(zProperty.getIsChange()),ZProperty::getIsChange,zProperty.getIsChange())
+ .like(StringUtils.isNotEmpty(zProperty.getRemark()), ZProperty::getRemark, zProperty.getRemark())
.like(StringUtils.isNotEmpty(zProperty.getTimeLimit()),ZProperty::getTimeLimit,zProperty.getTimeLimit())
+ .eq(zProperty.getStatus()!=null,ZProperty::getStatus,zProperty.getStatus())
+ .between(zProperty.getHappenStartTime() != null && zProperty.getHappenEndTime() != null, ZProperty::getHappenTime, zProperty.getHappenStartTime(), zProperty.getHappenEndTime())
+ .orderByDesc(ZProperty::getCreateTime);
+ return lqw;
+ }
+ private LambdaQueryWrapper<ZProperty> buildConditionSec(ZProperty zProperty, List<Long> userId) {
+ LambdaQueryWrapper<ZProperty> lqw = new LambdaQueryWrapper<>();
+ lqw.in(ZProperty::getUserId, userId)
+ .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType())
+ .like(StringUtils.isNotEmpty(zProperty.getIncomeName()), ZProperty::getIncomeName, zProperty.getIncomeName())
+ .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType())
+ .like(StringUtils.isNotEmpty(zProperty.getIsChange()),ZProperty::getIsChange,zProperty.getIsChange())
+ .like(StringUtils.isNotEmpty(zProperty.getRemark()), ZProperty::getRemark, zProperty.getRemark())
+ .like(StringUtils.isNotEmpty(zProperty.getTimeLimit()),ZProperty::getTimeLimit,zProperty.getTimeLimit())
+ .eq(zProperty.getStatus()!=null,ZProperty::getStatus,zProperty.getStatus())
.between(zProperty.getHappenStartTime() != null && zProperty.getHappenEndTime() != null, ZProperty::getHappenTime, zProperty.getHappenStartTime(), zProperty.getHappenEndTime())
.orderByDesc(ZProperty::getCreateTime);
return lqw;
@@ -73,7 +97,16 @@
public AjaxResult selectDataList(ZProperty zProperty, Integer pageNum, Integer pageSize) {
SysUser user = SecurityUtils.getLoginUser().getUser();
Long userId = user.getUserId();
- LambdaQueryWrapper<ZProperty> lqw = buildCondition(zProperty, userId);
+
+ //鏍规嵁userId鏌ヨ鍒癷nfouser鐨剈aid
+ ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId);
+ //鎷垮埌鎵�鏈夌殑sysid
+ List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList());
+ LambdaQueryWrapper<ZProperty> lqw;
+ if(!fms.isEmpty())
+ lqw = buildConditionSec(zProperty, fms);
+ else
+ lqw = buildCondition(zProperty, userId);
Page<ZProperty> pageBean = new Page<>(pageNum, pageSize);
Page<ZProperty> pageResult = page(pageBean, lqw);
@@ -127,6 +160,12 @@
}
@Override
+ public AjaxResult listType() {
+ List<String> result = zPropertyMapper.listType();
+ return AjaxResult.success(result);
+ }
+
+ @Override
@Transactional
public AjaxResult importExcel(MultipartFile file) {
--
Gitblit v1.9.1