From 8d8c7da4e91028fc877f101dcd244bef3e18c197 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Sun, 12 Nov 2023 07:34:21 +0800
Subject: [PATCH] 标签报事+通知公告
---
src/main/java/org/springblade/modules/house/service/impl/HouseRentalServiceImpl.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/springblade/modules/house/service/impl/HouseRentalServiceImpl.java b/src/main/java/org/springblade/modules/house/service/impl/HouseRentalServiceImpl.java
index ce1ebb2..3afaee9 100644
--- a/src/main/java/org/springblade/modules/house/service/impl/HouseRentalServiceImpl.java
+++ b/src/main/java/org/springblade/modules/house/service/impl/HouseRentalServiceImpl.java
@@ -19,6 +19,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.grid.service.IGridService;
import org.springblade.modules.house.entity.HouseRentalEntity;
import org.springblade.modules.house.entity.HouseTenantEntity;
import org.springblade.modules.house.service.IHouseTenantService;
@@ -36,6 +37,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -50,6 +52,9 @@
@Autowired
private IHouseTenantService houseTenantService;
+ @Autowired
+ private IGridService gridService;
+
/**
* 自定义分页查询
* @param page
@@ -58,7 +63,19 @@
*/
@Override
public IPage<HouseRentalTenantVO> selectHouseRentalPage(IPage<HouseRentalTenantVO> page, HouseRentalTenantVO houseRental) {
- return page.setRecords(baseMapper.selectHouseRentalPage(page, houseRental));
+ List<String> list = new ArrayList<>();
+ if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){
+ if (houseRental.getRoleName().equals("网格员")){
+ // 查询对应的房屋地址code
+ list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
+ }
+ }
+ if (null!=houseRental.getAuditStatus()){
+ if (houseRental.getAuditStatus()==0){
+ houseRental.setAuditStatus(2);
+ }
+ }
+ return page.setRecords(baseMapper.selectHouseRentalPage(page, houseRental,list));
}
/**
@@ -189,8 +206,35 @@
return update && addFlag && updateFlag && removeFlag;
}
+ /**
+ * 获取统计数据
+ * @return
+ */
@Override
- public List<HouseRentalStatistics> getStatistics() {
- return baseMapper.getStatistics();
+ public Object getStatistics(HouseRentalTenantVO houseRental) {
+ List<String> list = new ArrayList<>();
+ if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){
+ if (houseRental.getRoleName().equals("网格员")){
+ // 查询对应的房屋地址code
+ list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
+ }
+ }
+ // 查询
+ List<HouseRentalStatistics> statistics = baseMapper.getStatistics(houseRental,list);
+ // 返回
+ return statistics;
+ }
+
+ /**
+ * 出租屋 确认
+ * @param houseRental
+ * @return
+ */
+ @Override
+ public Boolean confirmHouseRental(HouseRentalVO houseRental) {
+ // 修改状态
+ houseRental.setUpdateTime(new Date());
+ // 修改
+ return updateById(houseRental);
}
}
--
Gitblit v1.9.3