From 25df5530b89fc57a3f32a0e4c706bb40d3e4b415 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 15 Nov 2023 17:27:58 +0800
Subject: [PATCH] 标签控制+通知详情优化

---
 src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java b/src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java
index 65ae716..bb01472 100644
--- a/src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java
+++ b/src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java
@@ -17,17 +17,21 @@
 package org.springblade.modules.house.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springblade.modules.house.entity.HouseLabelEntity;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.house.dto.UserHouseLabelDTO;
+import org.springblade.modules.house.entity.UserHouseLabelEntity;
 import org.springblade.modules.house.vo.HouseLabelVO;
-import org.springblade.modules.house.mapper.HouseLabelMapper;
-import org.springblade.modules.house.service.IHouseLabelService;
-import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.house.mapper.UserHouseLabelMapper;
+import org.springblade.modules.house.service.IUserHouseLabelService;
 import org.springblade.modules.label.entity.LabelEntity;
 import org.springblade.modules.label.service.ILabelService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
 
 /**
  * 房屋-标签 服务实现类
@@ -36,7 +40,7 @@
  * @since 2023-10-28
  */
 @Service
-public class HouseLabelServiceImpl extends ServiceImpl<HouseLabelMapper, HouseLabelEntity> implements IHouseLabelService {
+public class HouseLabelServiceImpl extends ServiceImpl<UserHouseLabelMapper, UserHouseLabelEntity> implements IUserHouseLabelService {
 
 	@Autowired
 	private ILabelService labelService;
@@ -52,20 +56,28 @@
 	 * @return
 	 */
 	@Override
-	public boolean saveOrUpdateHouseLabel(HouseLabelEntity houseLabel) {
+	public boolean saveOrUpdateHouseLabel(UserHouseLabelEntity houseLabel) {
 		// 查询标签名称
 		LabelEntity labelEntity = labelService.getById(houseLabel.getLabelId());
 		houseLabel.setLabelName(labelEntity.getLabelName());
 		// 判断同一个房屋同一个标签是否已存在,已存在则更新,不存在则新增
-		QueryWrapper<HouseLabelEntity> queryWrapper = new QueryWrapper<>();
+		QueryWrapper<UserHouseLabelEntity> queryWrapper = new QueryWrapper<>();
 		queryWrapper.eq("house_code",houseLabel.getHouseCode())
 					.eq("label_id",houseLabel.getLabelId());
-		HouseLabelEntity one = getOne(queryWrapper);
+		UserHouseLabelEntity one = getOne(queryWrapper);
 		if (null != one){
+			houseLabel.setId(one.getId());
 			// 更新
 			return updateById(houseLabel);
 		}
 		// 插入
 		return save(houseLabel);
 	}
+
+	@Override
+	public List<Integer> selectUserLabelList(UserHouseLabelDTO userHouseLabelDTO) {
+		userHouseLabelDTO.setUserId(AuthUtil.getUserId());
+		List<Integer> list = baseMapper.getUserLabelList(userHouseLabelDTO);
+		return list;
+	}
 }

--
Gitblit v1.9.3